You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17318 lines
5.2 MiB

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/javascript-C7a4RI8G.js","assets/typescript-Jd3ZmU9m.js"])))=>i.map(i=>d[i]);
var J8e=Object.defineProperty;var Rue=i=>{throw TypeError(i)};var e9e=(i,e,n)=>e in i?J8e(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n;var xt=(i,e,n)=>e9e(i,typeof e!="symbol"?e+"":e,n),Aue=(i,e,n)=>e.has(i)||Rue("Cannot "+n);var GH=(i,e,n)=>(Aue(i,e,"read from private field"),n?n.call(i):e.get(i)),Nue=(i,e,n)=>e.has(i)?Rue("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,n),XH=(i,e,n,r)=>(Aue(i,e,"write to private field"),r?r.call(i,n):e.set(i,n),n);function t9e(i,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in i)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(i,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var hy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ql(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function a_(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var s=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return i[r]}})}),n}var YH={exports:{}},ER={},ZH={exports:{}},Zi={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Mue;function n9e(){if(Mue)return Zi;Mue=1;var i=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.iterator;function f(K){return K===null||typeof K!="object"?null:(K=h&&K[h]||K["@@iterator"],typeof K=="function"?K:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function _(K,ee,le){this.props=K,this.context=ee,this.refs=m,this.updater=le||p}_.prototype.isReactComponent={},_.prototype.setState=function(K,ee){if(typeof K!="object"&&typeof K!="function"&&K!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,ee,"setState")},_.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function b(){}b.prototype=_.prototype;function y(K,ee,le){this.props=K,this.context=ee,this.refs=m,this.updater=le||p}var x=y.prototype=new b;x.constructor=y,g(x,_.prototype),x.isPureReactComponent=!0;var k=Array.isArray,D=Object.prototype.hasOwnProperty,R={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function A(K,ee,le){var ke,xe={},me=null,Ee=null;if(ee!=null)for(ke in ee.ref!==void 0&&(Ee=ee.ref),ee.key!==void 0&&(me=""+ee.key),ee)D.call(ee,ke)&&!E.hasOwnProperty(ke)&&(xe[ke]=ee[ke]);var je=arguments.length-2;if(je===1)xe.children=le;else if(1<je){for(var qe=Array(je),Ze=0;Ze<je;Ze++)qe[Ze]=arguments[Ze+2];xe.children=qe}if(K&&K.defaultProps)for(ke in je=K.defaultProps,je)xe[ke]===void 0&&(xe[ke]=je[ke]);return{$$typeof:i,type:K,key:me,ref:Ee,props:xe,_owner:R.current}}function M(K,ee){return{$$typeof:i,type:K.type,key:ee,ref:K.ref,props:K.props,_owner:K._owner}}function N(K){return typeof K=="object"&&K!==null&&K.$$typeof===i}function P(K){var ee={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(le){return ee[le]})}var O=/\/+/g;function B(K,ee){return typeof K=="object"&&K!==null&&K.key!=null?P(""+K.key):ee.toString(36)}function j(K,ee,le,ke,xe){var me=typeof K;(me==="undefined"||me==="boolean")&&(K=null);var Ee=!1;if(K===null)Ee=!0;else switch(me){case"string":case"number":Ee=!0;break;case"object":switch(K.$$typeof){case i:case e:Ee=!0}}if(Ee)return Ee=K,xe=xe(Ee),K=ke===""?"."+B(Ee,0):ke,k(xe)?(le="",K!=null&&(le=K.replace(O,"$&/")+"/"),j(xe,ee,le,"",function(Ze){return Ze})):xe!=null&&(N(xe)&&(xe=M(xe,le+(!xe.key||Ee&&Ee.key===xe.key?"":(""+xe.key).replace(O,"$&/")+"/")+K)),ee.push(xe)),1;if(Ee=0,ke=ke===""?".":ke+":",k(K))for(var je=0;je<K.length;je++){me=K[je];var qe=ke+B(me,je);Ee+=j(me,ee,le,qe,xe)}else if(qe=f(K),typeof qe=="function")for(K=qe.call(K),je=0;!(me=K.next()).done;)me=me.value,qe=ke+B(me,je++),Ee+=j(me,ee,le,qe,xe);else if(me==="object")throw ee=String(K),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.");return Ee}function z(K,ee,le){if(K==null)return K;var ke=[],xe=0;return j(K,ke,"","",function(me){return ee.call(le,me,xe++)}),ke}function H(K){if(K._status===-1){var ee=K._result;ee=ee(),ee.then(function(le){(K._status===0||K._status===-1)&&(K._status=1,K._result=le)},function(le){(K._status===0||K._status===-1)&&(K._status=2,K._result=le)}),K._status===-1&&(K._status=0,K._result=ee)}if(K._status===1)return K._result.default;throw K._result}var Y={current:null},X={transition:null},Q={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:X,ReactCurrentOwner:R};function ie(){throw Error("act(...) is not supported in production builds of React.")}return Zi.Children={map:z,forEach:function(K,ee,le){z(K,function(){ee.apply(this,arguments)},le)},count:function(K){var ee=0;return z(K,function(){ee++}),ee},toArray:function(K){return z(K,function(ee){return ee})||[]},only:function(K){if(!N(K))throw Error("React.Children.only expected to receive a single React element child.");return K}},Zi.Component=_,Zi.Fragment=n,Zi.Profiler=s,Zi.PureComponent=y,Zi.StrictMode=r,Zi.Suspense=c,Zi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,Zi.act=ie,Zi.cloneElement=function(K,ee,le){if(K==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+K+".");var ke=g({},K.props),xe=K.key,me=K.ref,Ee=K._owner;if(ee!=null){if(ee.ref!==void 0&&(me=ee.ref,Ee=R.current),ee.key!==void 0&&(xe=""+ee.key),K.type&&K.type.defaultProps)var je=K.type.defaultProps;for(qe in ee)D.call(ee,qe)&&!E.hasOwnProperty(qe)&&(ke[qe]=ee[qe]===void 0&&je!==void 0?je[qe]:ee[qe])}var qe=arguments.length-2;if(qe===1)ke.children=le;else if(1<qe){je=Array(qe);for(var Ze=0;Ze<qe;Ze++)je[Ze]=arguments[Ze+2];ke.children=je}return{$$typeof:i,type:K.type,key:xe,ref:me,props:ke,_owner:Ee}},Zi.createContext=function(K){return K={$$typeof:a,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},K.Provider={$$typeof:o,_context:K},K.Consumer=K},Zi.createElement=A,Zi.createFactory=function(K){var ee=A.bind(null,K);return ee.type=K,ee},Zi.createRef=function(){return{current:null}},Zi.forwardRef=function(K){return{$$typeof:l,render:K}},Zi.isValidElement=N,Zi.lazy=function(K){return{$$typeof:d,_payload:{_status:-1,_result:K},_init:H}},Zi.memo=function(K,ee){return{$$typeof:u,type:K,compare:ee===void 0?null:ee}},Zi.startTransition=function(K){var ee=X.transition;X.transition={};try{K()}finally{X.transition=ee}},Zi.unstable_act=ie,Zi.useCallback=function(K,ee){return Y.current.useCallback(K,ee)},Zi.useContext=function(K){return Y.current.useContext(K)},Zi.useDebugValue=function(){},Zi.useDeferredValue=function(K){return Y.current.useDeferredValue(K)},Zi.useEffect=function(K,ee){return Y.current.useEffect(K,ee)},Zi.useId=function(){return Y.current.useId()},Zi.useImperativeHandle=function(K,ee,le){return Y.current.useImperativeHandle(K,ee,le)},Zi.useInsertionEffect=function(K,ee){return Y.current.useInsertionEffect(K,ee)},Zi.useLayoutEffect=function(K,ee){return Y.current.useLayoutEffect(K,ee)},Zi.useMemo=function(K,ee){return Y.current.useMemo(K,ee)},Zi.useReducer=function(K,ee,le){return Y.current.useReducer(K,ee,le)},Zi.useRef=function(K){return Y.current.useRef(K)},Zi.useState=function(K){return Y.current.useState(K)},Zi.useSyncExternalStore=function(K,ee,le){return Y.current.useSyncExternalStore(K,ee,le)},Zi.useTransition=function(){return Y.current.useTransition()},Zi.version="18.3.1",Zi}var Pue;function B1(){return Pue||(Pue=1,ZH.exports=n9e()),ZH.exports}/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Oue;function i9e(){if(Oue)return ER;Oue=1;var i=B1(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(l,c,u){var d,h={},f=null,p=null;u!==void 0&&(f=""+u),c.key!==void 0&&(f=""+c.key),c.ref!==void 0&&(p=c.ref);for(d in c)r.call(c,d)&&!o.hasOwnProperty(d)&&(h[d]=c[d]);if(l&&l.defaultProps)for(d in c=l.defaultProps,c)h[d]===void 0&&(h[d]=c[d]);return{$$typeof:e,type:l,key:f,ref:p,props:h,_owner:s.current}}return ER.Fragment=n,ER.jsx=a,ER.jsxs=a,ER}var Fue;function Uxe(){return Fue||(Fue=1,YH.exports=i9e()),YH.exports}var C=Uxe();const VM={black:"#000",white:"#fff"},BL={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},jL={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Bue={500:"#3f51b5"},WL={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},$L={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},ey={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},IR={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},r9e={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function kv(i,...e){const n=new URL(`https://mui.com/production-error/?code=${i}`);return e.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${i}; visit ${n} for the full message.`}const Bp="$$material";function Bn(){return Bn=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},Bn.apply(null,arguments)}var $=B1();const nn=ql($),ZS=t9e({__proto__:null,default:nn},[$]);function s9e(i){if(i.sheet)return i.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===i)return document.styleSheets[e]}function o9e(i){var e=document.createElement("style");return e.setAttribute("data-emotion",i.key),i.nonce!==void 0&&e.setAttribute("nonce",i.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var a9e=function(){function i(n){var r=this;this._insertTag=function(s){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,o),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=i.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(o9e(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var o=s9e(s);try{o.insertRule(r,o.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},i}(),ac="-ms-",s9="-moz-",Wr="-webkit-",qxe="comm",vre="rule",bre="decl",l9e="@import",Kxe="@keyframes",c9e="@layer",u9e=Math.abs,sW=String.fromCharCode,d9e=Object.assign;function h9e(i,e){return Ml(i,0)^45?(((e<<2^Ml(i,0))<<2^Ml(i,1))<<2^Ml(i,2))<<2^Ml(i,3):0}function Gxe(i){return i.trim()}function f9e(i,e){return(i=e.exec(i))?i[0]:i}function $r(i,e,n){return i.replace(e,n)}function gZ(i,e){return i.indexOf(e)}function Ml(i,e){return i.charCodeAt(e)|0}function HM(i,e,n){return i.slice(e,n)}function em(i){return i.length}function yre(i){return i.length}function l3(i,e){return e.push(i),i}function p9e(i,e){return i.map(e).join("")}var oW=1,gE=1,Xxe=0,cd=0,ka=0,EI="";function aW(i,e,n,r,s,o,a){return{value:i,root:e,parent:n,type:r,props:s,children:o,line:oW,column:gE,length:a,return:""}}function TR(i,e){return d9e(aW("",null,null,"",null,null,0),i,{length:-i.length},e)}function g9e(){return ka}function m9e(){return ka=cd>0?Ml(EI,--cd):0,gE--,ka===10&&(gE=1,oW--),ka}function ah(){return ka=cd<Xxe?Ml(EI,cd++):0,gE++,ka===10&&(gE=1,oW++),ka}function Em(){return Ml(EI,cd)}function qB(){return cd}function e5(i,e){return HM(EI,i,e)}function UM(i){switch(i){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Yxe(i){return oW=gE=1,Xxe=em(EI=i),cd=0,[]}function Zxe(i){return EI="",i}function KB(i){return Gxe(e5(cd-1,mZ(i===91?i+2:i===40?i+1:i)))}function _9e(i){for(;(ka=Em())&&ka<33;)ah();return UM(i)>2||UM(ka)>3?"":" "}function v9e(i,e){for(;--e&&ah()&&!(ka<48||ka>102||ka>57&&ka<65||ka>70&&ka<97););return e5(i,qB()+(e<6&&Em()==32&&ah()==32))}function mZ(i){for(;ah();)switch(ka){case i:return cd;case 34:case 39:i!==34&&i!==39&&mZ(ka);break;case 40:i===41&&mZ(i);break;case 92:ah();break}return cd}function b9e(i,e){for(;ah()&&i+ka!==57;)if(i+ka===84&&Em()===47)break;return"/*"+e5(e,cd-1)+"*"+sW(i===47?i:ah())}function y9e(i){for(;!UM(Em());)ah();return e5(i,cd)}function w9e(i){return Zxe(GB("",null,null,null,[""],i=Yxe(i),0,[0],i))}function GB(i,e,n,r,s,o,a,l,c){for(var u=0,d=0,h=a,f=0,p=0,g=0,m=1,_=1,b=1,y=0,x="",k=s,D=o,R=r,E=x;_;)switch(g=y,y=ah()){case 40:if(g!=108&&Ml(E,h-1)==58){gZ(E+=$r(KB(y),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:E+=KB(y);break;case 9:case 10:case 13:case 32:E+=_9e(g);break;case 92:E+=v9e(qB()-1,7);continue;case 47:switch(Em()){case 42:case 47:l3(C9e(b9e(ah(),qB()),e,n),c);break;default:E+="/"}break;case 123*m:l[u++]=em(E)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+d:b==-1&&(E=$r(E,/\f/g,"")),p>0&&em(E)-h&&l3(p>32?Wue(E+";",r,n,h-1):Wue($r(E," ","")+";",r,n,h-2),c);break;case 59:E+=";";default:if(l3(R=jue(E,e,n,u,d,s,l,x,k=[],D=[],h),o),y===123)if(d===0)GB(E,e,R,R,k,o,h,l,D);else switch(f===99&&Ml(E,3)===110?100:f){case 100:case 108:case 109:case 115:GB(i,R,R,r&&l3(jue(i,R,R,0,0,s,l,x,s,k=[],h),D),s,D,h,l,r?k:D);break;default:GB(E,R,R,R,[""],D,0,l,D)}}u=d=p=0,m=b=1,x=E="",h=a;break;case 58:h=1+em(E),p=g;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&m9e()==125)continue}switch(E+=sW(y),y*m){case 38:b=d>0?1:(E+="\f",-1);break;case 44:l[u++]=(em(E)-1)*b,b=1;break;case 64:Em()===45&&(E+=KB(ah())),f=Em(),d=h=em(x=E+=y9e(qB())),y++;break;case 45:g===45&&em(E)==2&&(m=0)}}return o}function jue(i,e,n,r,s,o,a,l,c,u,d){for(var h=s-1,f=s===0?o:[""],p=yre(f),g=0,m=0,_=0;g<r;++g)for(var b=0,y=HM(i,h+1,h=u9e(m=a[g])),x=i;b<p;++b)(x=Gxe(m>0?f[b]+" "+y:$r(y,/&\f/g,f[b])))&&(c[_++]=x);return aW(i,e,n,s===0?vre:l,c,u,d)}function C9e(i,e,n){return aW(i,e,n,qxe,sW(g9e()),HM(i,2,-2),0)}function Wue(i,e,n,r){return aW(i,e,n,bre,HM(i,0,r),HM(i,r+1,-1),r)}function T2(i,e){for(var n="",r=yre(i),s=0;s<r;s++)n+=e(i[s],s,i,e)||"";return n}function S9e(i,e,n,r){switch(i.type){case c9e:if(i.children.length)break;case l9e:case bre:return i.return=i.return||i.value;case qxe:return"";case Kxe:return i.return=i.value+"{"+T2(i.children,r)+"}";case vre:i.value=i.props.join(",")}return em(n=T2(i.children,r))?i.return=i.value+"{"+n+"}":""}function x9e(i){var e=yre(i);return function(n,r,s,o){for(var a="",l=0;l<e;l++)a+=i[l](n,r,s,o)||"";return a}}function k9e(i){return function(e){e.root||(e=e.return)&&i(e)}}function Qxe(i){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=i(n)),e[n]}}var L9e=function(e,n,r){for(var s=0,o=0;s=o,o=Em(),s===38&&o===12&&(n[r]=1),!UM(o);)ah();return e5(e,cd)},D9e=function(e,n){var r=-1,s=44;do switch(UM(s)){case 0:s===38&&Em()===12&&(n[r]=1),e[r]+=L9e(cd-1,n,r);break;case 2:e[r]+=KB(s);break;case 4:if(s===44){e[++r]=Em()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=sW(s)}while(s=ah());return e},E9e=function(e,n){return Zxe(D9e(Yxe(e),n))},$ue=new WeakMap,I9e=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,s=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!$ue.get(r))&&!s){$ue.set(e,!0);for(var o=[],a=E9e(n,o),l=r.props,c=0,u=0;c<a.length;c++)for(var d=0;d<l.length;d++,u++)e.props[u]=o[c]?a[c].replace(/&\f/g,l[d]):l[d]+" "+a[c]}}},T9e=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function Jxe(i,e){switch(h9e(i,e)){case 5103:return Wr+"print-"+i+i;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Wr+i+i;case 5349:case 4246:case 4810:case 6968:case 2756:return Wr+i+s9+i+ac+i+i;case 6828:case 4268:return Wr+i+ac+i+i;case 6165:return Wr+i+ac+"flex-"+i+i;case 5187:return Wr+i+$r(i,/(\w+).+(:[^]+)/,Wr+"box-$1$2"+ac+"flex-$1$2")+i;case 5443:return Wr+i+ac+"flex-item-"+$r(i,/flex-|-self/,"")+i;case 4675:return Wr+i+ac+"flex-line-pack"+$r(i,/align-content|flex-|-self/,"")+i;case 5548:return Wr+i+ac+$r(i,"shrink","negative")+i;case 5292:return Wr+i+ac+$r(i,"basis","preferred-size")+i;case 6060:return Wr+"box-"+$r(i,"-grow","")+Wr+i+ac+$r(i,"grow","positive")+i;case 4554:return Wr+$r(i,/([^-])(transform)/g,"$1"+Wr+"$2")+i;case 6187:return $r($r($r(i,/(zoom-|grab)/,Wr+"$1"),/(image-set)/,Wr+"$1"),i,"")+i;case 5495:case 3959:return $r(i,/(image-set\([^]*)/,Wr+"$1$`$1");case 4968:return $r($r(i,/(.+:)(flex-)?(.*)/,Wr+"box-pack:$3"+ac+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Wr+i+i;case 4095:case 3583:case 4068:case 2532:return $r(i,/(.+)-inline(.+)/,Wr+"$1$2")+i;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(em(i)-1-e>6)switch(Ml(i,e+1)){case 109:if(Ml(i,e+4)!==45)break;case 102:return $r(i,/(.+:)(.+)-([^]+)/,"$1"+Wr+"$2-$3$1"+s9+(Ml(i,e+3)==108?"$3":"$2-$3"))+i;case 115:return~gZ(i,"stretch")?Jxe($r(i,"stretch","fill-available"),e)+i:i}break;case 4949:if(Ml(i,e+1)!==115)break;case 6444:switch(Ml(i,em(i)-3-(~gZ(i,"!important")&&10))){case 107:return $r(i,":",":"+Wr)+i;case 101:return $r(i,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Wr+(Ml(i,14)===45?"inline-":"")+"box$3$1"+Wr+"$2$3$1"+ac+"$2box$3")+i}break;case 5936:switch(Ml(i,e+11)){case 114:return Wr+i+ac+$r(i,/[svh]\w+-[tblr]{2}/,"tb")+i;case 108:return Wr+i+ac+$r(i,/[svh]\w+-[tblr]{2}/,"tb-rl")+i;case 45:return Wr+i+ac+$r(i,/[svh]\w+-[tblr]{2}/,"lr")+i}return Wr+i+ac+i+i}return i}var R9e=function(e,n,r,s){if(e.length>-1&&!e.return)switch(e.type){case bre:e.return=Jxe(e.value,e.length);break;case Kxe:return T2([TR(e,{value:$r(e.value,"@","@"+Wr)})],s);case vre:if(e.length)return p9e(e.props,function(o){switch(f9e(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return T2([TR(e,{props:[$r(o,/:(read-\w+)/,":"+s9+"$1")]})],s);case"::placeholder":return T2([TR(e,{props:[$r(o,/:(plac\w+)/,":"+Wr+"input-$1")]}),TR(e,{props:[$r(o,/:(plac\w+)/,":"+s9+"$1")]}),TR(e,{props:[$r(o,/:(plac\w+)/,ac+"input-$1")]})],s)}return""})}},A9e=[R9e],wre=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var _=m.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var s=e.stylisPlugins||A9e,o={},a,l=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var _=m.getAttribute("data-emotion").split(" "),b=1;b<_.length;b++)o[_[b]]=!0;l.push(m)});var c,u=[I9e,T9e];{var d,h=[S9e,k9e(function(m){d.insert(m)})],f=x9e(u.concat(s,h)),p=function(_){return T2(w9e(_),f)};c=function(_,b,y,x){d=y,p(_?_+"{"+b.styles+"}":b.styles),x&&(g.inserted[b.name]=!0)}}var g={key:n,sheet:new a9e({key:n,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:c};return g.sheet.hydrate(l),g},QH={exports:{}},Yr={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var zue;function N9e(){if(zue)return Yr;zue=1;var i=typeof Symbol=="function"&&Symbol.for,e=i?Symbol.for("react.element"):60103,n=i?Symbol.for("react.portal"):60106,r=i?Symbol.for("react.fragment"):60107,s=i?Symbol.for("react.strict_mode"):60108,o=i?Symbol.for("react.profiler"):60114,a=i?Symbol.for("react.provider"):60109,l=i?Symbol.for("react.context"):60110,c=i?Symbol.for("react.async_mode"):60111,u=i?Symbol.for("react.concurrent_mode"):60111,d=i?Symbol.for("react.forward_ref"):60112,h=i?Symbol.for("react.suspense"):60113,f=i?Symbol.for("react.suspense_list"):60120,p=i?Symbol.for("react.memo"):60115,g=i?Symbol.for("react.lazy"):60116,m=i?Symbol.for("react.block"):60121,_=i?Symbol.for("react.fundamental"):60117,b=i?Symbol.for("react.responder"):60118,y=i?Symbol.for("react.scope"):60119;function x(D){if(typeof D=="object"&&D!==null){var R=D.$$typeof;switch(R){case e:switch(D=D.type,D){case c:case u:case r:case o:case s:case h:return D;default:switch(D=D&&D.$$typeof,D){case l:case d:case g:case p:case a:return D;default:return R}}case n:return R}}}function k(D){return x(D)===u}return Yr.AsyncMode=c,Yr.ConcurrentMode=u,Yr.ContextConsumer=l,Yr.ContextProvider=a,Yr.Element=e,Yr.ForwardRef=d,Yr.Fragment=r,Yr.Lazy=g,Yr.Memo=p,Yr.Portal=n,Yr.Profiler=o,Yr.StrictMode=s,Yr.Suspense=h,Yr.isAsyncMode=function(D){return k(D)||x(D)===c},Yr.isConcurrentMode=k,Yr.isContextConsumer=function(D){return x(D)===l},Yr.isContextProvider=function(D){return x(D)===a},Yr.isElement=function(D){return typeof D=="object"&&D!==null&&D.$$typeof===e},Yr.isForwardRef=function(D){return x(D)===d},Yr.isFragment=function(D){return x(D)===r},Yr.isLazy=function(D){return x(D)===g},Yr.isMemo=function(D){return x(D)===p},Yr.isPortal=function(D){return x(D)===n},Yr.isProfiler=function(D){return x(D)===o},Yr.isStrictMode=function(D){return x(D)===s},Yr.isSuspense=function(D){return x(D)===h},Yr.isValidElementType=function(D){return typeof D=="string"||typeof D=="function"||D===r||D===u||D===o||D===s||D===h||D===f||typeof D=="object"&&D!==null&&(D.$$typeof===g||D.$$typeof===p||D.$$typeof===a||D.$$typeof===l||D.$$typeof===d||D.$$typeof===_||D.$$typeof===b||D.$$typeof===y||D.$$typeof===m)},Yr.typeOf=x,Yr}var Vue;function M9e(){return Vue||(Vue=1,QH.exports=N9e()),QH.exports}var JH,Hue;function P9e(){if(Hue)return JH;Hue=1;var i=M9e(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[i.ForwardRef]=r,o[i.Memo]=s;function a(g){return i.isMemo(g)?s:o[g.$$typeof]||e}var l=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,f=Object.prototype;function p(g,m,_){if(typeof m!="string"){if(f){var b=h(m);b&&b!==f&&p(g,b,_)}var y=c(m);u&&(y=y.concat(u(m)));for(var x=a(g),k=a(m),D=0;D<y.length;++D){var R=y[D];if(!n[R]&&!(_&&_[R])&&!(k&&k[R])&&!(x&&x[R])){var E=d(m,R);try{l(g,R,E)}catch{}}}}return g}return JH=p,JH}P9e();var O9e=!0;function lW(i,e,n){var r="";return n.split(" ").forEach(function(s){i[s]!==void 0?e.push(i[s]+";"):s&&(r+=s+" ")}),r}var Cre=function(e,n,r){var s=e.key+"-"+n.name;(r===!1||O9e===!1)&&e.registered[s]===void 0&&(e.registered[s]=n.styles)},cW=function(e,n,r){Cre(e,n,r);var s=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+s:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function F9e(i){for(var e=0,n,r=0,s=i.length;s>=4;++r,s-=4)n=i.charCodeAt(r)&255|(i.charCodeAt(++r)&255)<<8|(i.charCodeAt(++r)&255)<<16|(i.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(i.charCodeAt(r+2)&255)<<16;case 2:e^=(i.charCodeAt(r+1)&255)<<8;case 1:e^=i.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var B9e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},j9e=/[A-Z]|^ms/g,W9e=/_EMO_([^_]+?)_([^]*?)_EMO_/g,eke=function(e){return e.charCodeAt(1)===45},Uue=function(e){return e!=null&&typeof e!="boolean"},eU=Qxe(function(i){return eke(i)?i:i.replace(j9e,"-$&").toLowerCase()}),que=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(W9e,function(r,s,o){return tm={name:s,styles:o,next:tm},s})}return B9e[e]!==1&&!eke(e)&&typeof n=="number"&&n!==0?n+"px":n};function qM(i,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return tm={name:s.name,styles:s.styles,next:tm},s.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)tm={name:a.name,styles:a.styles,next:tm},a=a.next;var l=o.styles+";";return l}return $9e(i,e,n)}case"function":{if(i!==void 0){var c=tm,u=n(i);return tm=c,qM(i,e,u)}break}}var d=n;if(e==null)return d;var h=e[d];return h!==void 0?h:d}function $9e(i,e,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=qM(i,e,n[s])+";";else for(var o in n){var a=n[o];if(typeof a!="object"){var l=a;e!=null&&e[l]!==void 0?r+=o+"{"+e[l]+"}":Uue(l)&&(r+=eU(o)+":"+que(o,l)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(e==null||e[a[0]]===void 0))for(var c=0;c<a.length;c++)Uue(a[c])&&(r+=eU(o)+":"+que(o,a[c])+";");else{var u=qM(i,e,a);switch(o){case"animation":case"animationName":{r+=eU(o)+":"+u+";";break}default:r+=o+"{"+u+"}"}}}return r}var Kue=/label:\s*([^\s;{]+)\s*(;|$)/g,tm;function My(i,e,n){if(i.length===1&&typeof i[0]=="object"&&i[0]!==null&&i[0].styles!==void 0)return i[0];var r=!0,s="";tm=void 0;var o=i[0];if(o==null||o.raw===void 0)r=!1,s+=qM(n,e,o);else{var a=o;s+=a[0]}for(var l=1;l<i.length;l++)if(s+=qM(n,e,i[l]),r){var c=o;s+=c[l]}Kue.lastIndex=0;for(var u="",d;(d=Kue.exec(s))!==null;)u+="-"+d[1];var h=F9e(s)+u;return{name:h,styles:s,next:tm}}var z9e=function(e){return e()},tke=ZS.useInsertionEffect?ZS.useInsertionEffect:!1,nke=tke||z9e,Gue=tke||$.useLayoutEffect,ike=$.createContext(typeof HTMLElement<"u"?wre({key:"css"}):null),V9e=ike.Provider,Sre=function(e){return $.forwardRef(function(n,r){var s=$.useContext(ike);return e(n,s,r)})},j1=$.createContext({}),t5={}.hasOwnProperty,_Z="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",xre=function(e,n){var r={};for(var s in n)t5.call(n,s)&&(r[s]=n[s]);return r[_Z]=e,r},H9e=function(e){var n=e.cache,r=e.serialized,s=e.isStringTag;return Cre(n,r,s),nke(function(){return cW(n,r,s)}),null},U9e=Sre(function(i,e,n){var r=i.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var s=i[_Z],o=[r],a="";typeof i.className=="string"?a=lW(e.registered,o,i.className):i.className!=null&&(a=i.className+" ");var l=My(o,void 0,$.useContext(j1));a+=e.key+"-"+l.name;var c={};for(var u in i)t5.call(i,u)&&u!=="css"&&u!==_Z&&(c[u]=i[u]);return c.className=a,n&&(c.ref=n),$.createElement($.Fragment,null,$.createElement(H9e,{cache:e,serialized:l,isStringTag:typeof s=="string"}),$.createElement(s,c))}),kre=U9e,Xue=function(e,n){var r=arguments;if(n==null||!t5.call(n,"css"))return $.createElement.apply(void 0,r);var s=r.length,o=new Array(s);o[0]=kre,o[1]=xre(e,n);for(var a=2;a<s;a++)o[a]=r[a];return $.createElement.apply(null,o)};(function(i){var e;e||(e=i.JSX||(i.JSX={}))})(Xue||(Xue={}));var rke=Sre(function(i,e){var n=i.styles,r=My([n],void 0,$.useContext(j1)),s=$.useRef();return Gue(function(){var o=e.key+"-global",a=new e.sheet.constructor({key:o,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),l=!1,c=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return e.sheet.tags.length&&(a.before=e.sheet.tags[0]),c!==null&&(l=!0,c.setAttribute("data-emotion",o),a.hydrate([c])),s.current=[a,l],function(){a.flush()}},[e]),Gue(function(){var o=s.current,a=o[0],l=o[1];if(l){o[1]=!1;return}if(r.next!==void 0&&cW(e,r.next,!0),a.tags.length){var c=a.tags[a.tags.length-1].nextElementSibling;a.before=c,a.flush()}e.insert("",r,a,!1)},[e,r.name]),null});function Mv(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++)e[n]=arguments[n];return My(e)}function tg(){var i=Mv.apply(void 0,arguments),e="animation-"+i.name;return{name:e,styles:"@keyframes "+e+"{"+i.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var q9e=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,K9e=Qxe(function(i){return q9e.test(i)||i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)<91}),G9e=K9e,X9e=function(e){return e!=="theme"},Yue=function(e){return typeof e=="string"&&e.charCodeAt(0)>96?G9e:X9e},Zue=function(e,n,r){var s;if(n){var o=n.shouldForwardProp;s=e.__emotion_forwardProp&&o?function(a){return e.__emotion_forwardProp(a)&&o(a)}:o}return typeof s!="function"&&r&&(s=e.__emotion_forwardProp),s},Y9e=function(e){var n=e.cache,r=e.serialized,s=e.isStringTag;return Cre(n,r,s),nke(function(){return cW(n,r,s)}),null},Z9e=function i(e,n){var r=e.__emotion_real===e,s=r&&e.__emotion_base||e,o,a;n!==void 0&&(o=n.label,a=n.target);var l=Zue(e,n,r),c=l||Yue(s),u=!c("as");return function(){var d=arguments,h=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{var f=d[0];h.push(f[0]);for(var p=d.length,g=1;g<p;g++)h.push(d[g],f[g])}var m=Sre(function(_,b,y){var x=u&&_.as||s,k="",D=[],R=_;if(_.theme==null){R={};for(var E in _)R[E]=_[E];R.theme=$.useContext(j1)}typeof _.className=="string"?k=lW(b.registered,D,_.className):_.className!=null&&(k=_.className+" ");var A=My(h.concat(D),b.registered,R);k+=b.key+"-"+A.name,a!==void 0&&(k+=" "+a);var M=u&&l===void 0?Yue(x):c,N={};for(var P in _)u&&P==="as"||M(P)&&(N[P]=_[P]);return N.className=k,y&&(N.ref=y),$.createElement($.Fragment,null,$.createElement(Y9e,{cache:b,serialized:A,isStringTag:typeof x=="string"}),$.createElement(x,N))});return m.displayName=o!==void 0?o:"Styled("+(typeof s=="string"?s:s.displayName||s.name||"Component")+")",m.defaultProps=e.defaultProps,m.__emotion_real=m,m.__emotion_base=s,m.__emotion_styles=h,m.__emotion_forwardProp=l,Object.defineProperty(m,"toString",{value:function(){return"."+a}}),m.withComponent=function(_,b){var y=i(_,Bn({},n,b,{shouldForwardProp:Zue(m,b,!0)}));return y.apply(void 0,h)},m}},Q9e=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],o9=Z9e.bind(null);Q9e.forEach(function(i){o9[i]=o9(i)});var tU={exports:{}},nU,Que;function J9e(){if(Que)return nU;Que=1;var i="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return nU=i,nU}var iU,Jue;function e7e(){if(Jue)return iU;Jue=1;var i=J9e();function e(){}function n(){}return n.resetWarningCache=e,iU=function(){function r(a,l,c,u,d,h){if(h!==i){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function s(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},iU}var ede;function t7e(){return ede||(ede=1,tU.exports=e7e()()),tU.exports}var n7e=t7e();const Z=ql(n7e);function i7e(i){return i==null||Object.keys(i).length===0}function ske(i){const{styles:e,defaultTheme:n={}}=i,r=typeof e=="function"?s=>e(i7e(s)?n:s):e;return C.jsx(rke,{styles:r})}function oke(i,e){return o9(i,e)}function r7e(i,e){Array.isArray(i.__emotion_styles)&&(i.__emotion_styles=e(i.__emotion_styles))}const tde=[];function Py(i){return tde[0]=i,My(tde)}var rU={exports:{}},ps={};/**
* @license React
* react-is.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var nde;function s7e(){if(nde)return ps;nde=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function g(m){if(typeof m=="object"&&m!==null){var _=m.$$typeof;switch(_){case i:switch(m=m.type,m){case n:case s:case r:case c:case u:case f:return m;default:switch(m=m&&m.$$typeof,m){case a:case l:case h:case d:return m;case o:return m;default:return _}}case e:return _}}}return ps.ContextConsumer=o,ps.ContextProvider=a,ps.Element=i,ps.ForwardRef=l,ps.Fragment=n,ps.Lazy=h,ps.Memo=d,ps.Portal=e,ps.Profiler=s,ps.StrictMode=r,ps.Suspense=c,ps.SuspenseList=u,ps.isContextConsumer=function(m){return g(m)===o},ps.isContextProvider=function(m){return g(m)===a},ps.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===i},ps.isForwardRef=function(m){return g(m)===l},ps.isFragment=function(m){return g(m)===n},ps.isLazy=function(m){return g(m)===h},ps.isMemo=function(m){return g(m)===d},ps.isPortal=function(m){return g(m)===e},ps.isProfiler=function(m){return g(m)===s},ps.isStrictMode=function(m){return g(m)===r},ps.isSuspense=function(m){return g(m)===c},ps.isSuspenseList=function(m){return g(m)===u},ps.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===s||m===r||m===c||m===u||typeof m=="object"&&m!==null&&(m.$$typeof===h||m.$$typeof===d||m.$$typeof===a||m.$$typeof===o||m.$$typeof===l||m.$$typeof===p||m.getModuleId!==void 0)},ps.typeOf=g,ps}var ide;function o7e(){return ide||(ide=1,rU.exports=s7e()),rU.exports}var a9=o7e();function am(i){if(typeof i!="object"||i===null)return!1;const e=Object.getPrototypeOf(i);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)}function ake(i){if($.isValidElement(i)||a9.isValidElementType(i)||!am(i))return i;const e={};return Object.keys(i).forEach(n=>{e[n]=ake(i[n])}),e}function pl(i,e,n={clone:!0}){const r=n.clone?{...i}:i;return am(i)&&am(e)&&Object.keys(e).forEach(s=>{$.isValidElement(e[s])||a9.isValidElementType(e[s])?r[s]=e[s]:am(e[s])&&Object.prototype.hasOwnProperty.call(i,s)&&am(i[s])?r[s]=pl(i[s],e[s],n):n.clone?r[s]=am(e[s])?ake(e[s]):e[s]:r[s]=e[s]}),r}const a7e=i=>{const e=Object.keys(i).map(n=>({key:n,val:i[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function l7e(i){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...s}=i,o=a7e(e),a=Object.keys(o);function l(f){return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n})`}function c(f){return`@media (max-width:${(typeof e[f]=="number"?e[f]:f)-r/100}${n})`}function u(f,p){const g=a.indexOf(p);return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n}) and (max-width:${(g!==-1&&typeof e[a[g]]=="number"?e[a[g]]:p)-r/100}${n})`}function d(f){return a.indexOf(f)+1<a.length?u(f,a[a.indexOf(f)+1]):l(f)}function h(f){const p=a.indexOf(f);return p===0?l(a[1]):p===a.length-1?c(a[p]):u(f,a[a.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:a,values:o,up:l,down:c,between:u,only:d,not:h,unit:n,...s}}function rde(i,e){if(!i.containerQueries)return e;const n=Object.keys(e).filter(r=>r.startsWith("@container")).sort((r,s)=>{var a,l;const o=/min-width:\s*([0-9.]+)/;return+(((a=r.match(o))==null?void 0:a[1])||0)-+(((l=s.match(o))==null?void 0:l[1])||0)});return n.length?n.reduce((r,s)=>{const o=e[s];return delete r[s],r[s]=o,r},{...e}):e}function c7e(i,e){return e==="@"||e.startsWith("@")&&(i.some(n=>e.startsWith(`@${n}`))||!!e.match(/^@\d/))}function u7e(i,e){const n=e.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,s]=n,o=Number.isNaN(+r)?r||0:+r;return i.containerQueries(s).up(o)}function d7e(i){const e=(o,a)=>o.replace("@media",a?`@container ${a}`:"@container");function n(o,a){o.up=(...l)=>e(i.breakpoints.up(...l),a),o.down=(...l)=>e(i.breakpoints.down(...l),a),o.between=(...l)=>e(i.breakpoints.between(...l),a),o.only=(...l)=>e(i.breakpoints.only(...l),a),o.not=(...l)=>{const c=e(i.breakpoints.not(...l),a);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const r={},s=o=>(n(r,o),r);return n(s),{...i,containerQueries:s}}const h7e={borderRadius:4};function $N(i,e){return e?pl(i,e,{clone:!1}):i}const uW={xs:0,sm:600,md:900,lg:1200,xl:1536},sde={keys:["xs","sm","md","lg","xl"],up:i=>`@media (min-width:${uW[i]}px)`},f7e={containerQueries:i=>({up:e=>{let n=typeof e=="number"?e:uW[e]||e;return typeof n=="number"&&(n=`${n}px`),i?`@container ${i} (min-width:${n})`:`@container (min-width:${n})`}})};function Lv(i,e,n){const r=i.theme||{};if(Array.isArray(e)){const o=r.breakpoints||sde;return e.reduce((a,l,c)=>(a[o.up(o.keys[c])]=n(e[c]),a),{})}if(typeof e=="object"){const o=r.breakpoints||sde;return Object.keys(e).reduce((a,l)=>{if(c7e(o.keys,l)){const c=u7e(r.containerQueries?r:f7e,l);c&&(a[c]=n(e[l],l))}else if(Object.keys(o.values||uW).includes(l)){const c=o.up(l);a[c]=n(e[l],l)}else{const c=l;a[c]=e[c]}return a},{})}return n(e)}function p7e(i={}){var n;return((n=i.keys)==null?void 0:n.reduce((r,s)=>{const o=i.up(s);return r[o]={},r},{}))||{}}function ode(i,e){return i.reduce((n,r)=>{const s=n[r];return(!s||Object.keys(s).length===0)&&delete n[r],n},e)}function Ue(i){if(typeof i!="string")throw new Error(kv(7));return i.charAt(0).toUpperCase()+i.slice(1)}function fy(i,e,n=!0){if(!e||typeof e!="string")return null;if(i&&i.vars&&n){const r=`vars.${e}`.split(".").reduce((s,o)=>s&&s[o]?s[o]:null,i);if(r!=null)return r}return e.split(".").reduce((r,s)=>r&&r[s]!=null?r[s]:null,i)}function l9(i,e,n,r=n){let s;return typeof i=="function"?s=i(n):Array.isArray(i)?s=i[n]||r:s=fy(i,n)||r,e&&(s=e(s,r,i)),s}function pa(i){const{prop:e,cssProperty:n=i.prop,themeKey:r,transform:s}=i,o=a=>{if(a[e]==null)return null;const l=a[e],c=a.theme,u=fy(c,r)||{};return Lv(a,l,h=>{let f=l9(u,s,h);return h===f&&typeof h=="string"&&(f=l9(u,s,`${e}${h==="default"?"":Ue(h)}`,h)),n===!1?f:{[n]:f}})};return o.propTypes={},o.filterProps=[e],o}function g7e(i){const e={};return n=>(e[n]===void 0&&(e[n]=i(n)),e[n])}const m7e={m:"margin",p:"padding"},_7e={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},ade={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},v7e=g7e(i=>{if(i.length>2)if(ade[i])i=ade[i];else return[i];const[e,n]=i.split(""),r=m7e[e],s=_7e[n]||"";return Array.isArray(s)?s.map(o=>r+o):[r+s]}),Lre=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Dre=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Lre,...Dre];function n5(i,e,n,r){const s=fy(i,e,!0)??n;return typeof s=="number"||typeof s=="string"?o=>typeof o=="string"?o:typeof s=="string"?s.startsWith("var(")&&o===0?0:s.startsWith("var(")&&o===1?s:`calc(${o} * ${s})`:s*o:Array.isArray(s)?o=>{if(typeof o=="string")return o;const a=Math.abs(o),l=s[a];return o>=0?l:typeof l=="number"?-l:typeof l=="string"&&l.startsWith("var(")?`calc(-1 * ${l})`:`-${l}`}:typeof s=="function"?s:()=>{}}function Ere(i){return n5(i,"spacing",8)}function i5(i,e){return typeof e=="string"||e==null?e:i(e)}function b7e(i,e){return n=>i.reduce((r,s)=>(r[s]=i5(e,n),r),{})}function y7e(i,e,n,r){if(!e.includes(n))return null;const s=v7e(n),o=b7e(s,r),a=i[n];return Lv(i,a,o)}function lke(i,e){const n=Ere(i.theme);return Object.keys(i).map(r=>y7e(i,e,r,n)).reduce($N,{})}function Ao(i){return lke(i,Lre)}Ao.propTypes={};Ao.filterProps=Lre;function No(i){return lke(i,Dre)}No.propTypes={};No.filterProps=Dre;function cke(i=8,e=Ere({spacing:i})){if(i.mui)return i;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=e(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function dW(...i){const e=i.reduce((r,s)=>(s.filterProps.forEach(o=>{r[o]=s}),r),{}),n=r=>Object.keys(r).reduce((s,o)=>e[o]?$N(s,e[o](r)):s,{});return n.propTypes={},n.filterProps=i.reduce((r,s)=>r.concat(s.filterProps),[]),n}function of(i){return typeof i!="number"?i:`${i}px solid`}function Af(i,e){return pa({prop:i,themeKey:"borders",transform:e})}const w7e=Af("border",of),C7e=Af("borderTop",of),S7e=Af("borderRight",of),x7e=Af("borderBottom",of),k7e=Af("borderLeft",of),L7e=Af("borderColor"),D7e=Af("borderTopColor"),E7e=Af("borderRightColor"),I7e=Af("borderBottomColor"),T7e=Af("borderLeftColor"),R7e=Af("outline",of),A7e=Af("outlineColor"),hW=i=>{if(i.borderRadius!==void 0&&i.borderRadius!==null){const e=n5(i.theme,"shape.borderRadius",4),n=r=>({borderRadius:i5(e,r)});return Lv(i,i.borderRadius,n)}return null};hW.propTypes={};hW.filterProps=["borderRadius"];dW(w7e,C7e,S7e,x7e,k7e,L7e,D7e,E7e,I7e,T7e,hW,R7e,A7e);const fW=i=>{if(i.gap!==void 0&&i.gap!==null){const e=n5(i.theme,"spacing",8),n=r=>({gap:i5(e,r)});return Lv(i,i.gap,n)}return null};fW.propTypes={};fW.filterProps=["gap"];const pW=i=>{if(i.columnGap!==void 0&&i.columnGap!==null){const e=n5(i.theme,"spacing",8),n=r=>({columnGap:i5(e,r)});return Lv(i,i.columnGap,n)}return null};pW.propTypes={};pW.filterProps=["columnGap"];const gW=i=>{if(i.rowGap!==void 0&&i.rowGap!==null){const e=n5(i.theme,"spacing",8),n=r=>({rowGap:i5(e,r)});return Lv(i,i.rowGap,n)}return null};gW.propTypes={};gW.filterProps=["rowGap"];const N7e=pa({prop:"gridColumn"}),M7e=pa({prop:"gridRow"}),P7e=pa({prop:"gridAutoFlow"}),O7e=pa({prop:"gridAutoColumns"}),F7e=pa({prop:"gridAutoRows"}),B7e=pa({prop:"gridTemplateColumns"}),j7e=pa({prop:"gridTemplateRows"}),W7e=pa({prop:"gridTemplateAreas"}),$7e=pa({prop:"gridArea"});dW(fW,pW,gW,N7e,M7e,P7e,O7e,F7e,B7e,j7e,W7e,$7e);function R2(i,e){return e==="grey"?e:i}const z7e=pa({prop:"color",themeKey:"palette",transform:R2}),V7e=pa({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:R2}),H7e=pa({prop:"backgroundColor",themeKey:"palette",transform:R2});dW(z7e,V7e,H7e);function Jd(i){return i<=1&&i!==0?`${i*100}%`:i}const U7e=pa({prop:"width",transform:Jd}),Ire=i=>{if(i.maxWidth!==void 0&&i.maxWidth!==null){const e=n=>{var s,o,a,l,c;const r=((a=(o=(s=i.theme)==null?void 0:s.breakpoints)==null?void 0:o.values)==null?void 0:a[n])||uW[n];return r?((c=(l=i.theme)==null?void 0:l.breakpoints)==null?void 0:c.unit)!=="px"?{maxWidth:`${r}${i.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Jd(n)}};return Lv(i,i.maxWidth,e)}return null};Ire.filterProps=["maxWidth"];const q7e=pa({prop:"minWidth",transform:Jd}),K7e=pa({prop:"height",transform:Jd}),G7e=pa({prop:"maxHeight",transform:Jd}),X7e=pa({prop:"minHeight",transform:Jd});pa({prop:"size",cssProperty:"width",transform:Jd});pa({prop:"size",cssProperty:"height",transform:Jd});const Y7e=pa({prop:"boxSizing"});dW(U7e,Ire,q7e,K7e,G7e,X7e,Y7e);const r5={border:{themeKey:"borders",transform:of},borderTop:{themeKey:"borders",transform:of},borderRight:{themeKey:"borders",transform:of},borderBottom:{themeKey:"borders",transform:of},borderLeft:{themeKey:"borders",transform:of},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:of},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:hW},color:{themeKey:"palette",transform:R2},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:R2},backgroundColor:{themeKey:"palette",transform:R2},p:{style:No},pt:{style:No},pr:{style:No},pb:{style:No},pl:{style:No},px:{style:No},py:{style:No},padding:{style:No},paddingTop:{style:No},paddingRight:{style:No},paddingBottom:{style:No},paddingLeft:{style:No},paddingX:{style:No},paddingY:{style:No},paddingInline:{style:No},paddingInlineStart:{style:No},paddingInlineEnd:{style:No},paddingBlock:{style:No},paddingBlockStart:{style:No},paddingBlockEnd:{style:No},m:{style:Ao},mt:{style:Ao},mr:{style:Ao},mb:{style:Ao},ml:{style:Ao},mx:{style:Ao},my:{style:Ao},margin:{style:Ao},marginTop:{style:Ao},marginRight:{style:Ao},marginBottom:{style:Ao},marginLeft:{style:Ao},marginX:{style:Ao},marginY:{style:Ao},marginInline:{style:Ao},marginInlineStart:{style:Ao},marginInlineEnd:{style:Ao},marginBlock:{style:Ao},marginBlockStart:{style:Ao},marginBlockEnd:{style:Ao},displayPrint:{cssProperty:!1,transform:i=>({"@media print":{display:i}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:fW},rowGap:{style:gW},columnGap:{style:pW},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Jd},maxWidth:{style:Ire},minWidth:{transform:Jd},height:{transform:Jd},maxHeight:{transform:Jd},minHeight:{transform:Jd},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Z7e(...i){const e=i.reduce((r,s)=>r.concat(Object.keys(s)),[]),n=new Set(e);return i.every(r=>n.size===Object.keys(r).length)}function Q7e(i,e){return typeof i=="function"?i(e):i}function J7e(){function i(n,r,s,o){const a={[n]:r,theme:s},l=o[n];if(!l)return{[n]:r};const{cssProperty:c=n,themeKey:u,transform:d,style:h}=l;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const f=fy(s,u)||{};return h?h(a):Lv(a,r,g=>{let m=l9(f,d,g);return g===m&&typeof g=="string"&&(m=l9(f,d,`${n}${g==="default"?"":Ue(g)}`,g)),c===!1?m:{[c]:m}})}function e(n){const{sx:r,theme:s={},nested:o}=n||{};if(!r)return null;const a=s.unstable_sxConfig??r5;function l(c){let u=c;if(typeof c=="function")u=c(s);else if(typeof c!="object")return c;if(!u)return null;const d=p7e(s.breakpoints),h=Object.keys(d);let f=d;return Object.keys(u).forEach(p=>{const g=Q7e(u[p],s);if(g!=null)if(typeof g=="object")if(a[p])f=$N(f,i(p,g,s,a));else{const m=Lv({theme:s},g,_=>({[p]:_}));Z7e(m,g)?f[p]=e({sx:g,theme:s,nested:!0}):f=$N(f,m)}else f=$N(f,i(p,g,s,a))}),!o&&s.modularCssLayers?{"@layer sx":rde(s,ode(h,f))}:rde(s,ode(h,f))}return Array.isArray(r)?r.map(l):l(r)}return e}const i1=J7e();i1.filterProps=["sx"];function eje(i,e){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[i])||typeof n.getColorSchemeSelector!="function")return{};let s=n.getColorSchemeSelector(i);return s==="&"?e:((s.includes("data-")||s.includes("."))&&(s=`*:where(${s.replace(/\s*&$/,"")}) &`),{[s]:e})}return n.palette.mode===i?e:{}}function s5(i={},...e){const{breakpoints:n={},palette:r={},spacing:s,shape:o={},...a}=i,l=l7e(n),c=cke(s);let u=pl({breakpoints:l,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:c,shape:{...h7e,...o}},a);return u=d7e(u),u.applyStyles=eje,u=e.reduce((d,h)=>pl(d,h),u),u.unstable_sxConfig={...r5,...a==null?void 0:a.unstable_sxConfig},u.unstable_sx=function(h){return i1({sx:h,theme:this})},u}function tje(i){return Object.keys(i).length===0}function mW(i=null){const e=$.useContext(j1);return!e||tje(e)?i:e}const nje=s5();function o5(i=nje){return mW(i)}function sU(i){const e=Py(i);return i!==e&&e.styles?(e.styles.match(/^@layer\s+[^{]*$/)||(e.styles=`@layer global{${e.styles}}`),e):i}function uke({styles:i,themeId:e,defaultTheme:n={}}){const r=o5(n),s=e&&r[e]||r;let o=typeof i=="function"?i(s):i;return s.modularCssLayers&&(Array.isArray(o)?o=o.map(a=>sU(typeof a=="function"?a(s):a)):o=sU(o)),C.jsx(ske,{styles:o})}const ije=i=>{var r;const e={systemProps:{},otherProps:{}},n=((r=i==null?void 0:i.theme)==null?void 0:r.unstable_sxConfig)??r5;return Object.keys(i).forEach(s=>{n[s]?e.systemProps[s]=i[s]:e.otherProps[s]=i[s]}),e};function Tre(i){const{sx:e,...n}=i,{systemProps:r,otherProps:s}=ije(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...a)=>{const l=e(...a);return am(l)?{...r,...l}:r}:o={...r,...e},{...s,sx:o}}const lde=i=>i,rje=()=>{let i=lde;return{configure(e){i=e},generate(e){return i(e)},reset(){i=lde}}},Rre=rje();function dke(i){var e,n,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var s=i.length;for(e=0;e<s;e++)i[e]&&(n=dke(i[e]))&&(r&&(r+=" "),r+=n)}else for(n in i)i[n]&&(r&&(r+=" "),r+=n);return r}function dt(){for(var i,e,n=0,r="",s=arguments.length;n<s;n++)(i=arguments[n])&&(e=dke(i))&&(r&&(r+=" "),r+=e);return r}function hke(i={}){const{themeId:e,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:s}=i,o=oke("div",{shouldForwardProp:l=>l!=="theme"&&l!=="sx"&&l!=="as"})(i1);return $.forwardRef(function(c,u){const d=o5(n),{className:h,component:f="div",...p}=Tre(c);return C.jsx(o,{as:f,ref:u,className:dt(h,s?s(r):r),theme:e&&d[e]||d,...p})})}const sje={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Xt(i,e,n="Mui"){const r=sje[e];return r?`${n}-${r}`:`${Rre.generate(i)}-${e}`}function Yt(i,e,n="Mui"){const r={};return e.forEach(s=>{r[s]=Xt(i,s,n)}),r}const oje=Yt("MuiBox",["root"]),aje=hke({defaultClassName:oje.root,generateClassName:Rre.generate});function fke(i){const{variants:e,...n}=i,r={variants:e,style:Py(n),isProcessed:!0};return r.style===n||e&&e.forEach(s=>{typeof s.style!="function"&&(s.style=Py(s.style))}),r}const lje=s5();function oU(i){return i!=="ownerState"&&i!=="theme"&&i!=="sx"&&i!=="as"}function oS(i,e){return e&&i&&typeof i=="object"&&i.styles&&!i.styles.startsWith("@layer")&&(i.styles=`@layer ${e}{${String(i.styles)}}`),i}function cje(i){return i?(e,n)=>n[i]:null}function uje(i,e,n){i.theme=hje(i.theme)?n:i.theme[e]||i.theme}function XB(i,e,n){const r=typeof e=="function"?e(i):e;if(Array.isArray(r))return r.flatMap(s=>XB(i,s,n));if(Array.isArray(r==null?void 0:r.variants)){let s;if(r.isProcessed)s=n?oS(r.style,n):r.style;else{const{variants:o,...a}=r;s=n?oS(Py(a),n):a}return pke(i,r.variants,[s],n)}return r!=null&&r.isProcessed?n?oS(Py(r.style),n):r.style:n?oS(Py(r),n):r}function pke(i,e,n=[],r=void 0){var o;let s;e:for(let a=0;a<e.length;a+=1){const l=e[a];if(typeof l.props=="function"){if(s??(s={...i,...i.ownerState,ownerState:i.ownerState}),!l.props(s))continue}else for(const c in l.props)if(i[c]!==l.props[c]&&((o=i.ownerState)==null?void 0:o[c])!==l.props[c])continue e;typeof l.style=="function"?(s??(s={...i,...i.ownerState,ownerState:i.ownerState}),n.push(r?oS(Py(l.style(s)),r):l.style(s))):n.push(r?oS(Py(l.style),r):l.style)}return n}function gke(i={}){const{themeId:e,defaultTheme:n=lje,rootShouldForwardProp:r=oU,slotShouldForwardProp:s=oU}=i;function o(l){uje(l,e,n)}return(l,c={})=>{r7e(l,R=>R.filter(E=>E!==i1));const{name:u,slot:d,skipVariantsResolver:h,skipSx:f,overridesResolver:p=cje(pje(d)),...g}=c,m=u&&u.startsWith("Mui")||d?"components":"custom",_=h!==void 0?h:d&&d!=="Root"&&d!=="root"||!1,b=f||!1;let y=oU;d==="Root"||d==="root"?y=r:d?y=s:fje(l)&&(y=void 0);const x=oke(l,{shouldForwardProp:y,label:dje(),...g}),k=R=>{if(R.__emotion_real===R)return R;if(typeof R=="function")return function(A){return XB(A,R,A.theme.modularCssLayers?m:void 0)};if(am(R)){const E=fke(R);return function(M){return E.variants?XB(M,E,M.theme.modularCssLayers?m:void 0):M.theme.modularCssLayers?oS(E.style,m):E.style}}return R},D=(...R)=>{const E=[],A=R.map(k),M=[];if(E.push(o),u&&p&&M.push(function(B){var Y,X;const z=(X=(Y=B.theme.components)==null?void 0:Y[u])==null?void 0:X.styleOverrides;if(!z)return null;const H={};for(const Q in z)H[Q]=XB(B,z[Q],B.theme.modularCssLayers?"theme":void 0);return p(B,H)}),u&&!_&&M.push(function(B){var H,Y;const j=B.theme,z=(Y=(H=j==null?void 0:j.components)==null?void 0:H[u])==null?void 0:Y.variants;return z?pke(B,z,[],B.theme.modularCssLayers?"theme":void 0):null}),b||M.push(i1),Array.isArray(A[0])){const O=A.shift(),B=new Array(E.length).fill(""),j=new Array(M.length).fill("");let z;z=[...B,...O,...j],z.raw=[...B,...O.raw,...j],E.unshift(z)}const N=[...E,...A,...M],P=x(...N);return l.muiName&&(P.muiName=l.muiName),P};return x.withConfig&&(D.withConfig=x.withConfig),D}}function dje(i,e){return void 0}function hje(i){for(const e in i)return!1;return!0}function fje(i){return typeof i=="string"&&i.charCodeAt(0)>96}function pje(i){return i&&i.charAt(0).toLowerCase()+i.slice(1)}const mke=gke();function mE(i,e,n=!1){const r={...e};for(const s in i)if(Object.prototype.hasOwnProperty.call(i,s)){const o=s;if(o==="components"||o==="slots")r[o]={...i[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const a=i[o],l=e[o];if(!l)r[o]=a||{};else if(!a)r[o]=l;else{r[o]={...l};for(const c in a)if(Object.prototype.hasOwnProperty.call(a,c)){const u=c;r[o][u]=mE(a[u],l[u],n)}}}else o==="className"&&n&&e.className?r.className=dt(i==null?void 0:i.className,e==null?void 0:e.className):o==="style"&&n&&e.style?r.style={...i==null?void 0:i.style,...e==null?void 0:e.style}:r[o]===void 0&&(r[o]=i[o])}return r}function _ke(i){const{theme:e,name:n,props:r}=i;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:mE(e.components[n].defaultProps,r)}function vke({props:i,name:e,defaultTheme:n,themeId:r}){let s=o5(n);return r&&(s=s[r]||s),_ke({theme:s,name:e,props:i})}const wc=typeof window<"u"?$.useLayoutEffect:$.useEffect;function gje(i,e,n,r,s){const[o,a]=$.useState(()=>s&&n?n(i).matches:r?r(i).matches:e);return wc(()=>{if(!n)return;const l=n(i),c=()=>{a(l.matches)};return c(),l.addEventListener("change",c),()=>{l.removeEventListener("change",c)}},[i,n]),o}const mje={...ZS},bke=mje.useSyncExternalStore;function _je(i,e,n,r,s){const o=$.useCallback(()=>e,[e]),a=$.useMemo(()=>{if(s&&n)return()=>n(i).matches;if(r!==null){const{matches:d}=r(i);return()=>d}return o},[o,i,r,s,n]),[l,c]=$.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const d=n(i);return[()=>d.matches,h=>(d.addEventListener("change",h),()=>{d.removeEventListener("change",h)})]},[o,n,i]);return bke(c,l,a)}function yke(i={}){const{themeId:e}=i;return function(r,s={}){let o=mW();o&&e&&(o=o[e]||o);const a=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:l=!1,matchMedia:c=a?window.matchMedia:null,ssrMatchMedia:u=null,noSsr:d=!1}=_ke({name:"MuiUseMediaQuery",props:s,theme:o});let h=typeof r=="function"?r(o):r;return h=h.replace(/^@media( ?)/m,""),h.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
`)),(bke!==void 0?_je:gje)(h,l,c,u,d)}}yke();function FD(i,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(i,n))}function Are(i,e=0,n=1){return FD(i,e,n)}function vje(i){i=i.slice(1);const e=new RegExp(`.{1,${i.length>=6?2:1}}`,"g");let n=i.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,s)=>s<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function r1(i){if(i.type)return i;if(i.charAt(0)==="#")return r1(vje(i));const e=i.indexOf("("),n=i.substring(0,e);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(kv(9,i));let r=i.substring(e+1,i.length-1),s;if(n==="color"){if(r=r.split(" "),s=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(s))throw new Error(kv(10,s))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:s}}const bje=i=>{const e=r1(i);return e.values.slice(0,3).map((n,r)=>e.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},QA=(i,e)=>{try{return bje(i)}catch{return i}};function _W(i){const{type:e,colorSpace:n}=i;let{values:r}=i;return e.includes("rgb")?r=r.map((s,o)=>o<3?parseInt(s,10):s):e.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function wke(i){i=r1(i);const{values:e}=i,n=e[0],r=e[1]/100,s=e[2]/100,o=r*Math.min(s,1-s),a=(u,d=(u+n/30)%12)=>s-o*Math.max(Math.min(d-3,9-d,1),-1);let l="rgb";const c=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return i.type==="hsla"&&(l+="a",c.push(e[3])),_W({type:l,values:c})}function vZ(i){i=r1(i);let e=i.type==="hsl"||i.type==="hsla"?r1(wke(i)).values:i.values;return e=e.map(n=>(i.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function yje(i,e){const n=vZ(i),r=vZ(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Pt(i,e){return i=r1(i),e=Are(e),(i.type==="rgb"||i.type==="hsl")&&(i.type+="a"),i.type==="color"?i.values[3]=`/${e}`:i.values[3]=e,_W(i)}function c3(i,e,n){try{return Pt(i,e)}catch{return i}}function $m(i,e){if(i=r1(i),e=Are(e),i.type.includes("hsl"))i.values[2]*=1-e;else if(i.type.includes("rgb")||i.type.includes("color"))for(let n=0;n<3;n+=1)i.values[n]*=1-e;return _W(i)}function Ls(i,e,n){try{return $m(i,e)}catch{return i}}function qp(i,e){if(i=r1(i),e=Are(e),i.type.includes("hsl"))i.values[2]+=(100-i.values[2])*e;else if(i.type.includes("rgb"))for(let n=0;n<3;n+=1)i.values[n]+=(255-i.values[n])*e;else if(i.type.includes("color"))for(let n=0;n<3;n+=1)i.values[n]+=(1-i.values[n])*e;return _W(i)}function Ds(i,e,n){try{return qp(i,e)}catch{return i}}function wje(i,e=.15){return vZ(i)>.5?$m(i,e):qp(i,e)}function u3(i,e,n){try{return wje(i,e)}catch{return i}}const Cke=$.createContext(null);function Nre(){return $.useContext(Cke)}const Cje=typeof Symbol=="function"&&Symbol.for,Sje=Cje?Symbol.for("mui.nested"):"__THEME_NESTED__";function xje(i,e){return typeof e=="function"?e(i):{...i,...e}}function kje(i){const{children:e,theme:n}=i,r=Nre(),s=$.useMemo(()=>{const o=r===null?{...n}:xje(r,n);return o!=null&&(o[Sje]=r!==null),o},[n,r]);return C.jsx(Cke.Provider,{value:s,children:e})}const Ske=$.createContext();function Lje({value:i,...e}){return C.jsx(Ske.Provider,{value:i??!0,...e})}const Pv=()=>$.useContext(Ske)??!1,xke=$.createContext(void 0);function Dje({value:i,children:e}){return C.jsx(xke.Provider,{value:i,children:e})}function Eje(i){const{theme:e,name:n,props:r}=i;if(!e||!e.components||!e.components[n])return r;const s=e.components[n];return s.defaultProps?mE(s.defaultProps,r,e.components.mergeClassNameAndStyle):!s.styleOverrides&&!s.variants?mE(s,r,e.components.mergeClassNameAndStyle):r}function Ije({props:i,name:e}){const n=$.useContext(xke);return Eje({props:i,name:e,theme:{components:n}})}let cde=0;function Tje(i){const[e,n]=$.useState(i),r=i||e;return $.useEffect(()=>{e==null&&(cde+=1,n(`mui-${cde}`))},[e]),r}const Rje={...ZS},ude=Rje.useId;function W1(i){if(ude!==void 0){const e=ude();return i??e}return Tje(i)}function Aje(i){const e=mW(),n=W1()||"",{modularCssLayers:r}=i;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!r||e!==null?s="":typeof r=="string"?s=r.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,wc(()=>{var l,c;const o=document.querySelector("head");if(!o)return;const a=o.firstChild;if(s){if(a&&((l=a.hasAttribute)!=null&&l.call(a,"data-mui-layer-order"))&&a.getAttribute("data-mui-layer-order")===n)return;const u=document.createElement("style");u.setAttribute("data-mui-layer-order",n),u.textContent=s,o.prepend(u)}else(c=o.querySelector(`style[data-mui-layer-order="${n}"]`))==null||c.remove()},[s,n]),s?C.jsx(uke,{styles:s}):null}const dde={};function hde(i,e,n,r=!1){return $.useMemo(()=>{const s=i&&e[i]||e;if(typeof n=="function"){const o=n(s),a=i?{...e,[i]:o}:o;return r?()=>a:a}return i?{...e,[i]:n}:{...e,...n}},[i,e,n,r])}function kke(i){const{children:e,theme:n,themeId:r}=i,s=mW(dde),o=Nre()||dde,a=hde(r,s,n),l=hde(r,o,n,!0),c=(r?a[r]:a).direction==="rtl",u=Aje(a);return C.jsx(kje,{theme:l,children:C.jsx(j1.Provider,{value:a,children:C.jsx(Lje,{value:c,children:C.jsxs(Dje,{value:r?a[r].components:a.components,children:[u,e]})})})})}const fde={theme:void 0};function Nje(i){let e,n;return function(s){let o=e;return(o===void 0||s.theme!==n)&&(fde.theme=s.theme,o=fke(i(fde)),e=o,n=s.theme),o}}const Mre="mode",Pre="color-scheme",Mje="data-color-scheme";function Pje(i){const{defaultMode:e="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:s=Mre,colorSchemeStorageKey:o=Pre,attribute:a=Mje,colorSchemeNode:l="document.documentElement",nonce:c}=i||{};let u="",d=a;if(a==="class"&&(d=".%s"),a==="data"&&(d="[data-%s]"),d.startsWith(".")){const f=d.substring(1);u+=`${l}.classList.remove('${f}'.replace('%s', light), '${f}'.replace('%s', dark));
${l}.classList.add('${f}'.replace('%s', colorScheme));`}const h=d.match(/\[([^\]]+)\]/);if(h){const[f,p]=h[1].split("=");p||(u+=`${l}.removeAttribute('${f}'.replace('%s', light));
${l}.removeAttribute('${f}'.replace('%s', dark));`),u+=`
${l}.setAttribute('${f}'.replace('%s', colorScheme), ${p?`${p}.replace('%s', colorScheme)`:'""'});`}else u+=`${l}.setAttribute('${d}', colorScheme);`;return C.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(function() {
try {
let colorScheme = '';
const mode = localStorage.getItem('${s}') || '${e}';
const dark = localStorage.getItem('${o}-dark') || '${r}';
const light = localStorage.getItem('${o}-light') || '${n}';
if (mode === 'system') {
// handle system mode
const mql = window.matchMedia('(prefers-color-scheme: dark)');
if (mql.matches) {
colorScheme = dark
} else {
colorScheme = light
}
}
if (mode === 'light') {
colorScheme = light;
}
if (mode === 'dark') {
colorScheme = dark;
}
if (colorScheme) {
${u}
}
} catch(e){}})();`}},"mui-color-scheme-init")}function Oje(){}const Fje=({key:i,storageWindow:e})=>(!e&&typeof window<"u"&&(e=window),{get(n){if(typeof window>"u")return;if(!e)return n;let r;try{r=e.localStorage.getItem(i)}catch{}return r||n},set:n=>{if(e)try{e.localStorage.setItem(i,n)}catch{}},subscribe:n=>{if(!e)return Oje;const r=s=>{const o=s.newValue;s.key===i&&n(o)};return e.addEventListener("storage",r),()=>{e.removeEventListener("storage",r)}}});function aU(){}function pde(i){if(typeof window<"u"&&typeof window.matchMedia=="function"&&i==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Lke(i,e){if(i.mode==="light"||i.mode==="system"&&i.systemMode==="light")return e("light");if(i.mode==="dark"||i.mode==="system"&&i.systemMode==="dark")return e("dark")}function Bje(i){return Lke(i,e=>{if(e==="light")return i.lightColorScheme;if(e==="dark")return i.darkColorScheme})}function jje(i){const{defaultMode:e="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:s=[],modeStorageKey:o=Mre,colorSchemeStorageKey:a=Pre,storageWindow:l=typeof window>"u"?void 0:window,storageManager:c=Fje,noSsr:u=!1}=i,d=s.join(","),h=s.length>1,f=$.useMemo(()=>c==null?void 0:c({key:o,storageWindow:l}),[c,o,l]),p=$.useMemo(()=>c==null?void 0:c({key:`${a}-light`,storageWindow:l}),[c,a,l]),g=$.useMemo(()=>c==null?void 0:c({key:`${a}-dark`,storageWindow:l}),[c,a,l]),[m,_]=$.useState(()=>{const A=(f==null?void 0:f.get(e))||e,M=(p==null?void 0:p.get(n))||n,N=(g==null?void 0:g.get(r))||r;return{mode:A,systemMode:pde(A),lightColorScheme:M,darkColorScheme:N}}),[b,y]=$.useState(u||!h);$.useEffect(()=>{y(!0)},[]);const x=Bje(m),k=$.useCallback(A=>{_(M=>{if(A===M.mode)return M;const N=A??e;return f==null||f.set(N),{...M,mode:N,systemMode:pde(N)}})},[f,e]),D=$.useCallback(A=>{A?typeof A=="string"?A&&!d.includes(A)?console.error(`\`${A}\` does not exist in \`theme.colorSchemes\`.`):_(M=>{const N={...M};return Lke(M,P=>{P==="light"&&(p==null||p.set(A),N.lightColorScheme=A),P==="dark"&&(g==null||g.set(A),N.darkColorScheme=A)}),N}):_(M=>{const N={...M},P=A.light===null?n:A.light,O=A.dark===null?r:A.dark;return P&&(d.includes(P)?(N.lightColorScheme=P,p==null||p.set(P)):console.error(`\`${P}\` does not exist in \`theme.colorSchemes\`.`)),O&&(d.includes(O)?(N.darkColorScheme=O,g==null||g.set(O)):console.error(`\`${O}\` does not exist in \`theme.colorSchemes\`.`)),N}):_(M=>(p==null||p.set(n),g==null||g.set(r),{...M,lightColorScheme:n,darkColorScheme:r}))},[d,p,g,n,r]),R=$.useCallback(A=>{m.mode==="system"&&_(M=>{const N=A!=null&&A.matches?"dark":"light";return M.systemMode===N?M:{...M,systemMode:N}})},[m.mode]),E=$.useRef(R);return E.current=R,$.useEffect(()=>{if(typeof window.matchMedia!="function"||!h)return;const A=(...N)=>E.current(...N),M=window.matchMedia("(prefers-color-scheme: dark)");return M.addListener(A),A(M),()=>{M.removeListener(A)}},[h]),$.useEffect(()=>{if(h){const A=(f==null?void 0:f.subscribe(P=>{(!P||["light","dark","system"].includes(P))&&k(P||e)}))||aU,M=(p==null?void 0:p.subscribe(P=>{(!P||d.match(P))&&D({light:P})}))||aU,N=(g==null?void 0:g.subscribe(P=>{(!P||d.match(P))&&D({dark:P})}))||aU;return()=>{A(),M(),N()}}},[D,k,d,e,l,h,f,p,g]),{...m,mode:b?m.mode:void 0,systemMode:b?m.systemMode:void 0,colorScheme:b?x:void 0,setMode:k,setColorScheme:D}}const Wje="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function $je(i){const{themeId:e,theme:n={},modeStorageKey:r=Mre,colorSchemeStorageKey:s=Pre,disableTransitionOnChange:o=!1,defaultColorScheme:a,resolveTheme:l}=i,c={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},u=$.createContext(void 0),d=()=>$.useContext(u)||c,h={},f={};function p(b){var de,Se,Ie,nt;const{children:y,theme:x,modeStorageKey:k=r,colorSchemeStorageKey:D=s,disableTransitionOnChange:R=o,storageManager:E,storageWindow:A=typeof window>"u"?void 0:window,documentNode:M=typeof document>"u"?void 0:document,colorSchemeNode:N=typeof document>"u"?void 0:document.documentElement,disableNestedContext:P=!1,disableStyleSheetGeneration:O=!1,defaultMode:B="system",forceThemeRerender:j=!1,noSsr:z}=b,H=$.useRef(!1),Y=Nre(),X=$.useContext(u),Q=!!X&&!P,ie=$.useMemo(()=>x||(typeof n=="function"?n():n),[x]),K=ie[e],ee=K||ie,{colorSchemes:le=h,components:ke=f,cssVarPrefix:xe}=ee,me=Object.keys(le).filter(Oe=>!!le[Oe]).join(","),Ee=$.useMemo(()=>me.split(","),[me]),je=typeof a=="string"?a:a.light,qe=typeof a=="string"?a:a.dark,Ze=le[je]&&le[qe]?B:((Se=(de=le[ee.defaultColorScheme])==null?void 0:de.palette)==null?void 0:Se.mode)||((Ie=ee.palette)==null?void 0:Ie.mode),{mode:We,setMode:ut,systemMode:st,lightColorScheme:mt,darkColorScheme:Rt,colorScheme:Vt,setColorScheme:Ot}=jje({supportedColorSchemes:Ee,defaultLightColorScheme:je,defaultDarkColorScheme:qe,modeStorageKey:k,colorSchemeStorageKey:D,defaultMode:Ze,storageManager:E,storageWindow:A,noSsr:z});let vt=We,wn=Vt;Q&&(vt=X.mode,wn=X.colorScheme);let Ce=wn||ee.defaultColorScheme;ee.vars&&!j&&(Ce=ee.defaultColorScheme);const ge=$.useMemo(()=>{var gt;const Oe=((gt=ee.generateThemeVars)==null?void 0:gt.call(ee))||ee.vars,Ve={...ee,components:ke,colorSchemes:le,cssVarPrefix:xe,vars:Oe};if(typeof Ve.generateSpacing=="function"&&(Ve.spacing=Ve.generateSpacing()),Ce){const $t=le[Ce];$t&&typeof $t=="object"&&Object.keys($t).forEach(Mt=>{$t[Mt]&&typeof $t[Mt]=="object"?Ve[Mt]={...Ve[Mt],...$t[Mt]}:Ve[Mt]=$t[Mt]})}return l?l(Ve):Ve},[ee,Ce,ke,le,xe]),pe=ee.colorSchemeSelector;wc(()=>{if(wn&&N&&pe&&pe!=="media"){const Oe=pe;let Ve=pe;if(Oe==="class"&&(Ve=".%s"),Oe==="data"&&(Ve="[data-%s]"),Oe!=null&&Oe.startsWith("data-")&&!Oe.includes("%s")&&(Ve=`[${Oe}="%s"]`),Ve.startsWith("."))N.classList.remove(...Ee.map(gt=>Ve.substring(1).replace("%s",gt))),N.classList.add(Ve.substring(1).replace("%s",wn));else{const gt=Ve.replace("%s",wn).match(/\[([^\]]+)\]/);if(gt){const[$t,Mt]=gt[1].split("=");Mt||Ee.forEach(Bt=>{N.removeAttribute($t.replace(wn,Bt))}),N.setAttribute($t,Mt?Mt.replace(/"|'/g,""):"")}else N.setAttribute(Ve,wn)}}},[wn,pe,N,Ee]),$.useEffect(()=>{let Oe;if(R&&H.current&&M){const Ve=M.createElement("style");Ve.appendChild(M.createTextNode(Wje)),M.head.appendChild(Ve),window.getComputedStyle(M.body),Oe=setTimeout(()=>{M.head.removeChild(Ve)},1)}return()=>{clearTimeout(Oe)}},[wn,R,M]),$.useEffect(()=>(H.current=!0,()=>{H.current=!1}),[]);const ne=$.useMemo(()=>({allColorSchemes:Ee,colorScheme:wn,darkColorScheme:Rt,lightColorScheme:mt,mode:vt,setColorScheme:Ot,setMode:ut,systemMode:st}),[Ee,wn,Rt,mt,vt,Ot,ut,st,ge.colorSchemeSelector]);let ae=!0;(O||ee.cssVariables===!1||Q&&(Y==null?void 0:Y.cssVarPrefix)===xe)&&(ae=!1);const ue=C.jsxs($.Fragment,{children:[C.jsx(kke,{themeId:K?e:void 0,theme:ge,children:y}),ae&&C.jsx(ske,{styles:((nt=ge.generateStyleSheets)==null?void 0:nt.call(ge))||[]})]});return Q?ue:C.jsx(u.Provider,{value:ne,children:ue})}const g=typeof a=="string"?a:a.light,m=typeof a=="string"?a:a.dark;return{CssVarsProvider:p,useColorScheme:d,getInitColorSchemeScript:b=>Pje({colorSchemeStorageKey:s,defaultLightColorScheme:g,defaultDarkColorScheme:m,modeStorageKey:r,...b})}}function zje(i=""){function e(...r){if(!r.length)return"";const s=r[0];return typeof s=="string"&&!s.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${i?`${i}-`:""}${s}${e(...r.slice(1))})`:`, ${s}`}return(r,...s)=>`var(--${i?`${i}-`:""}${r}${e(...s)})`}const gde=(i,e,n,r=[])=>{let s=i;e.forEach((o,a)=>{a===e.length-1?Array.isArray(s)?s[Number(o)]=n:s&&typeof s=="object"&&(s[o]=n):s&&typeof s=="object"&&(s[o]||(s[o]=r.includes(o)?[]:{}),s=s[o])})},Vje=(i,e,n)=>{function r(s,o=[],a=[]){Object.entries(s).forEach(([l,c])=>{(!n||n&&!n([...o,l]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...o,l],Array.isArray(c)?[...a,l]:a):e([...o,l],c,a))})}r(i)},Hje=(i,e)=>typeof e=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>i.includes(r))||i[i.length-1].toLowerCase().includes("opacity")?e:`${e}px`:e;function lU(i,e){const{prefix:n,shouldSkipGeneratingVar:r}=e||{},s={},o={},a={};return Vje(i,(l,c,u)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(l,c))){const d=`--${n?`${n}-`:""}${l.join("-")}`,h=Hje(l,c);Object.assign(s,{[d]:h}),gde(o,l,`var(${d})`,u),gde(a,l,`var(${d}, ${h})`,u)}},l=>l[0]==="vars"),{css:s,vars:o,varsWithDefaults:a}}function Uje(i,e={}){const{getSelector:n=_,disableCssColorScheme:r,colorSchemeSelector:s}=e,{colorSchemes:o={},components:a,defaultColorScheme:l="light",...c}=i,{vars:u,css:d,varsWithDefaults:h}=lU(c,e);let f=h;const p={},{[l]:g,...m}=o;if(Object.entries(m||{}).forEach(([x,k])=>{const{vars:D,css:R,varsWithDefaults:E}=lU(k,e);f=pl(f,E),p[x]={css:R,vars:D}}),g){const{css:x,vars:k,varsWithDefaults:D}=lU(g,e);f=pl(f,D),p[l]={css:x,vars:k}}function _(x,k){var R,E;let D=s;if(s==="class"&&(D=".%s"),s==="data"&&(D="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(D=`[${s}="%s"]`),x){if(D==="media")return i.defaultColorScheme===x?":root":{[`@media (prefers-color-scheme: ${((E=(R=o[x])==null?void 0:R.palette)==null?void 0:E.mode)||x})`]:{":root":k}};if(D)return i.defaultColorScheme===x?`:root, ${D.replace("%s",String(x))}`:D.replace("%s",String(x))}return":root"}return{vars:f,generateThemeVars:()=>{let x={...u};return Object.entries(p).forEach(([,{vars:k}])=>{x=pl(x,k)}),x},generateStyleSheets:()=>{var A,M;const x=[],k=i.defaultColorScheme||"light";function D(N,P){Object.keys(P).length&&x.push(typeof N=="string"?{[N]:{...P}}:N)}D(n(void 0,{...d}),d);const{[k]:R,...E}=p;if(R){const{css:N}=R,P=(M=(A=o[k])==null?void 0:A.palette)==null?void 0:M.mode,O=!r&&P?{colorScheme:P,...N}:{...N};D(n(k,{...O}),O)}return Object.entries(E).forEach(([N,{css:P}])=>{var j,z;const O=(z=(j=o[N])==null?void 0:j.palette)==null?void 0:z.mode,B=!r&&O?{colorScheme:O,...P}:{...P};D(n(N,{...B}),B)}),x}}}function qje(i){return function(n){return i==="media"?`@media (prefers-color-scheme: ${n})`:i?i.startsWith("data-")&&!i.includes("%s")?`[${i}="${n}"] &`:i==="class"?`.${n} &`:i==="data"?`[data-${n}] &`:`${i.replace("%s",n)} &`:"&"}}function Zt(i,e,n=void 0){const r={};for(const s in i){const o=i[s];let a="",l=!0;for(let c=0;c<o.length;c+=1){const u=o[c];u&&(a+=(l===!0?"":" ")+e(u),l=!1,n&&n[u]&&(a+=" "+n[u]))}r[s]=a}return r}const Kje=s5(),Gje=mke("div",{name:"MuiContainer",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[`maxWidth${Ue(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),Xje=i=>vke({props:i,name:"MuiContainer",defaultTheme:Kje}),Yje=(i,e)=>{const n=c=>Xt(e,c),{classes:r,fixed:s,disableGutters:o,maxWidth:a}=i,l={root:["root",a&&`maxWidth${Ue(String(a))}`,s&&"fixed",o&&"disableGutters"]};return Zt(l,n,r)};function Zje(i={}){const{createStyledComponent:e=Gje,useThemeProps:n=Xje,componentName:r="MuiContainer"}=i,s=e(({theme:a,ownerState:l})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!l.disableGutters&&{paddingLeft:a.spacing(2),paddingRight:a.spacing(2),[a.breakpoints.up("sm")]:{paddingLeft:a.spacing(3),paddingRight:a.spacing(3)}}}),({theme:a,ownerState:l})=>l.fixed&&Object.keys(a.breakpoints.values).reduce((c,u)=>{const d=u,h=a.breakpoints.values[d];return h!==0&&(c[a.breakpoints.up(d)]={maxWidth:`${h}${a.breakpoints.unit}`}),c},{}),({theme:a,ownerState:l})=>({...l.maxWidth==="xs"&&{[a.breakpoints.up("xs")]:{maxWidth:Math.max(a.breakpoints.values.xs,444)}},...l.maxWidth&&l.maxWidth!=="xs"&&{[a.breakpoints.up(l.maxWidth)]:{maxWidth:`${a.breakpoints.values[l.maxWidth]}${a.breakpoints.unit}`}}}));return $.forwardRef(function(l,c){const u=n(l),{className:d,component:h="div",disableGutters:f=!1,fixed:p=!1,maxWidth:g="lg",classes:m,..._}=u,b={...u,component:h,disableGutters:f,fixed:p,maxWidth:g},y=Yje(b,r);return C.jsx(s,{as:h,ownerState:b,className:dt(y.root,d),ref:c,..._})})}function zN(i,e){var n,r,s;return $.isValidElement(i)&&e.indexOf(i.type.muiName??((s=(r=(n=i.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:s.muiName))!==-1}const Qje=(i,e)=>i.filter(n=>e.includes(n)),II=(i,e,n)=>{const r=i.keys[0];Array.isArray(e)?e.forEach((s,o)=>{n((a,l)=>{o<=i.keys.length-1&&(o===0?Object.assign(a,l):a[i.up(i.keys[o])]=l)},s)}):e&&typeof e=="object"?(Object.keys(e).length>i.keys.length?i.keys:Qje(i.keys,Object.keys(e))).forEach(o=>{if(i.keys.includes(o)){const a=e[o];a!==void 0&&n((l,c)=>{r===o?Object.assign(l,c):l[i.up(o)]=c},a)}}):(typeof e=="number"||typeof e=="string")&&n((s,o)=>{Object.assign(s,o)},e)};function c9(i){return`--Grid-${i}Spacing`}function vW(i){return`--Grid-parent-${i}Spacing`}const mde="--Grid-columns",A2="--Grid-parent-columns",Jje=({theme:i,ownerState:e})=>{const n={};return II(i.breakpoints,e.size,(r,s)=>{let o={};s==="grow"&&(o={flexBasis:0,flexGrow:1,maxWidth:"100%"}),s==="auto"&&(o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),typeof s=="number"&&(o={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${s} / var(${A2}) - (var(${A2}) - ${s}) * (var(${vW("column")}) / var(${A2})))`}),r(n,o)}),n},eWe=({theme:i,ownerState:e})=>{const n={};return II(i.breakpoints,e.offset,(r,s)=>{let o={};s==="auto"&&(o={marginLeft:"auto"}),typeof s=="number"&&(o={marginLeft:s===0?"0px":`calc(100% * ${s} / var(${A2}) + var(${vW("column")}) * ${s} / var(${A2}))`}),r(n,o)}),n},tWe=({theme:i,ownerState:e})=>{if(!e.container)return{};const n={[mde]:12};return II(i.breakpoints,e.columns,(r,s)=>{const o=s??12;r(n,{[mde]:o,"> *":{[A2]:o}})}),n},nWe=({theme:i,ownerState:e})=>{if(!e.container)return{};const n={};return II(i.breakpoints,e.rowSpacing,(r,s)=>{var a;const o=typeof s=="string"?s:(a=i.spacing)==null?void 0:a.call(i,s);r(n,{[c9("row")]:o,"> *":{[vW("row")]:o}})}),n},iWe=({theme:i,ownerState:e})=>{if(!e.container)return{};const n={};return II(i.breakpoints,e.columnSpacing,(r,s)=>{var a;const o=typeof s=="string"?s:(a=i.spacing)==null?void 0:a.call(i,s);r(n,{[c9("column")]:o,"> *":{[vW("column")]:o}})}),n},rWe=({theme:i,ownerState:e})=>{if(!e.container)return{};const n={};return II(i.breakpoints,e.direction,(r,s)=>{r(n,{flexDirection:s})}),n},sWe=({ownerState:i})=>({minWidth:0,boxSizing:"border-box",...i.container&&{display:"flex",flexWrap:"wrap",...i.wrap&&i.wrap!=="wrap"&&{flexWrap:i.wrap},gap:`var(${c9("row")}) var(${c9("column")})`}}),oWe=i=>{const e=[];return Object.entries(i).forEach(([n,r])=>{r!==!1&&r!==void 0&&e.push(`grid-${n}-${String(r)}`)}),e},aWe=(i,e="xs")=>{function n(r){return r===void 0?!1:typeof r=="string"&&!Number.isNaN(Number(r))||typeof r=="number"&&r>0}if(n(i))return[`spacing-${e}-${String(i)}`];if(typeof i=="object"&&!Array.isArray(i)){const r=[];return Object.entries(i).forEach(([s,o])=>{n(o)&&r.push(`spacing-${s}-${String(o)}`)}),r}return[]},lWe=i=>i===void 0?[]:typeof i=="object"?Object.entries(i).map(([e,n])=>`direction-${e}-${n}`):[`direction-xs-${String(i)}`];function cWe(i,e){i.item!==void 0&&delete i.item,i.zeroMinWidth!==void 0&&delete i.zeroMinWidth,e.keys.forEach(n=>{i[n]!==void 0&&delete i[n]})}const uWe=s5(),dWe=mke("div",{name:"MuiGrid",slot:"Root"});function hWe(i){return vke({props:i,name:"MuiGrid",defaultTheme:uWe})}function fWe(i={}){const{createStyledComponent:e=dWe,useThemeProps:n=hWe,useTheme:r=o5,componentName:s="MuiGrid"}=i,o=(u,d)=>{const{container:h,direction:f,spacing:p,wrap:g,size:m}=u,_={root:["root",h&&"container",g!=="wrap"&&`wrap-xs-${String(g)}`,...lWe(f),...oWe(m),...h?aWe(p,d.breakpoints.keys[0]):[]]};return Zt(_,b=>Xt(s,b),{})};function a(u,d,h=()=>!0){const f={};return u===null||(Array.isArray(u)?u.forEach((p,g)=>{p!==null&&h(p)&&d.keys[g]&&(f[d.keys[g]]=p)}):typeof u=="object"?Object.keys(u).forEach(p=>{const g=u[p];g!=null&&h(g)&&(f[p]=g)}):f[d.keys[0]]=u),f}const l=e(tWe,iWe,nWe,Jje,rWe,sWe,eWe),c=$.forwardRef(function(d,h){const f=r(),p=n(d),g=Tre(p);cWe(g,f.breakpoints);const{className:m,children:_,columns:b=12,container:y=!1,component:x="div",direction:k="row",wrap:D="wrap",size:R={},offset:E={},spacing:A=0,rowSpacing:M=A,columnSpacing:N=A,unstable_level:P=0,...O}=g,B=a(R,f.breakpoints,K=>K!==!1),j=a(E,f.breakpoints),z=d.columns??(P?void 0:b),H=d.spacing??(P?void 0:A),Y=d.rowSpacing??d.spacing??(P?void 0:M),X=d.columnSpacing??d.spacing??(P?void 0:N),Q={...g,level:P,columns:z,container:y,direction:k,wrap:D,spacing:H,rowSpacing:Y,columnSpacing:X,size:B,offset:j},ie=o(Q,f);return C.jsx(l,{ref:h,as:x,ownerState:Q,className:dt(ie.root,m),...O,children:$.Children.map(_,K=>{var ee;return $.isValidElement(K)&&zN(K,["Grid"])&&y&&K.props.container?$.cloneElement(K,{unstable_level:((ee=K.props)==null?void 0:ee.unstable_level)??P+1}):K})})});return c.muiName="Grid",c}function Dke(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:VM.white,default:VM.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const pWe=Dke();function Eke(){return{text:{primary:VM.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:VM.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const _de=Eke();function vde(i,e,n,r){const s=r.light||r,o=r.dark||r*1.5;i[e]||(i.hasOwnProperty(n)?i[e]=i[n]:e==="light"?i.light=qp(i.main,s):e==="dark"&&(i.dark=$m(i.main,o)))}function gWe(i="light"){return i==="dark"?{main:WL[200],light:WL[50],dark:WL[400]}:{main:WL[700],light:WL[400],dark:WL[800]}}function mWe(i="light"){return i==="dark"?{main:jL[200],light:jL[50],dark:jL[400]}:{main:jL[500],light:jL[300],dark:jL[700]}}function _We(i="light"){return i==="dark"?{main:BL[500],light:BL[300],dark:BL[700]}:{main:BL[700],light:BL[400],dark:BL[800]}}function vWe(i="light"){return i==="dark"?{main:$L[400],light:$L[300],dark:$L[700]}:{main:$L[700],light:$L[500],dark:$L[900]}}function bWe(i="light"){return i==="dark"?{main:ey[400],light:ey[300],dark:ey[700]}:{main:ey[800],light:ey[500],dark:ey[900]}}function yWe(i="light"){return i==="dark"?{main:IR[400],light:IR[300],dark:IR[700]}:{main:"#ed6c02",light:IR[500],dark:IR[900]}}function Ore(i){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2,...s}=i,o=i.primary||gWe(e),a=i.secondary||mWe(e),l=i.error||_We(e),c=i.info||vWe(e),u=i.success||bWe(e),d=i.warning||yWe(e);function h(m){return yje(m,_de.text.primary)>=n?_de.text.primary:pWe.text.primary}const f=({color:m,name:_,mainShade:b=500,lightShade:y=300,darkShade:x=700})=>{if(m={...m},!m.main&&m[b]&&(m.main=m[b]),!m.hasOwnProperty("main"))throw new Error(kv(11,_?` (${_})`:"",b));if(typeof m.main!="string")throw new Error(kv(12,_?` (${_})`:"",JSON.stringify(m.main)));return vde(m,"light",y,r),vde(m,"dark",x,r),m.contrastText||(m.contrastText=h(m.main)),m};let p;return e==="light"?p=Dke():e==="dark"&&(p=Eke()),pl({common:{...VM},mode:e,primary:f({color:o,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:l,name:"error"}),warning:f({color:d,name:"warning"}),info:f({color:c,name:"info"}),success:f({color:u,name:"success"}),grey:r9e,contrastThreshold:n,getContrastText:h,augmentColor:f,tonalOffset:r,...p},s)}function wWe(i){const e={};return Object.entries(i).forEach(r=>{const[s,o]=r;typeof o=="object"&&(e[s]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),e}function CWe(i,e){return{toolbar:{minHeight:56,[i.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[i.up("sm")]:{minHeight:64}},...e}}function SWe(i){return Math.round(i*1e5)/1e5}const bde={textTransform:"uppercase"},yde='"Roboto", "Helvetica", "Arial", sans-serif';function Ike(i,e){const{fontFamily:n=yde,fontSize:r=14,fontWeightLight:s=300,fontWeightRegular:o=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d,...h}=typeof e=="function"?e(i):e,f=r/14,p=d||(_=>`${_/c*f}rem`),g=(_,b,y,x,k)=>({fontFamily:n,fontWeight:_,fontSize:p(b),lineHeight:y,...n===yde?{letterSpacing:`${SWe(x/b)}em`}:{},...k,...u}),m={h1:g(s,96,1.167,-1.5),h2:g(s,60,1.2,-.5),h3:g(o,48,1.167,0),h4:g(o,34,1.235,.25),h5:g(o,24,1.334,0),h6:g(a,20,1.6,.15),subtitle1:g(o,16,1.75,.15),subtitle2:g(a,14,1.57,.1),body1:g(o,16,1.5,.15),body2:g(o,14,1.43,.15),button:g(a,14,1.75,.4,bde),caption:g(o,12,1.66,.4),overline:g(o,12,2.66,1,bde),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return pl({htmlFontSize:c,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:s,fontWeightRegular:o,fontWeightMedium:a,fontWeightBold:l,...m},h,{clone:!1})}const xWe=.2,kWe=.14,LWe=.12;function ao(...i){return[`${i[0]}px ${i[1]}px ${i[2]}px ${i[3]}px rgba(0,0,0,${xWe})`,`${i[4]}px ${i[5]}px ${i[6]}px ${i[7]}px rgba(0,0,0,${kWe})`,`${i[8]}px ${i[9]}px ${i[10]}px ${i[11]}px rgba(0,0,0,${LWe})`].join(",")}const DWe=["none",ao(0,2,1,-1,0,1,1,0,0,1,3,0),ao(0,3,1,-2,0,2,2,0,0,1,5,0),ao(0,3,3,-2,0,3,4,0,0,1,8,0),ao(0,2,4,-1,0,4,5,0,0,1,10,0),ao(0,3,5,-1,0,5,8,0,0,1,14,0),ao(0,3,5,-1,0,6,10,0,0,1,18,0),ao(0,4,5,-2,0,7,10,1,0,2,16,1),ao(0,5,5,-3,0,8,10,1,0,3,14,2),ao(0,5,6,-3,0,9,12,1,0,3,16,2),ao(0,6,6,-3,0,10,14,1,0,4,18,3),ao(0,6,7,-4,0,11,15,1,0,4,20,3),ao(0,7,8,-4,0,12,17,2,0,5,22,4),ao(0,7,8,-4,0,13,19,2,0,5,24,4),ao(0,7,9,-4,0,14,21,2,0,5,26,4),ao(0,8,9,-5,0,15,22,2,0,6,28,5),ao(0,8,10,-5,0,16,24,2,0,6,30,5),ao(0,8,11,-5,0,17,26,2,0,6,32,5),ao(0,9,11,-5,0,18,28,2,0,7,34,6),ao(0,9,12,-6,0,19,29,2,0,7,36,6),ao(0,10,13,-6,0,20,31,3,0,8,38,7),ao(0,10,13,-6,0,21,33,3,0,8,40,7),ao(0,10,14,-6,0,22,35,3,0,8,42,7),ao(0,11,14,-7,0,23,36,3,0,9,44,8),ao(0,11,15,-7,0,24,38,3,0,9,46,8)],EWe={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Tke={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function wde(i){return`${Math.round(i)}ms`}function IWe(i){if(!i)return 0;const e=i/36;return Math.min(Math.round((4+15*e**.25+e/5)*10),3e3)}function TWe(i){const e={...EWe,...i.easing},n={...Tke,...i.duration};return{getAutoHeightDuration:IWe,create:(s=["all"],o={})=>{const{duration:a=n.standard,easing:l=e.easeInOut,delay:c=0,...u}=o;return(Array.isArray(s)?s:[s]).map(d=>`${d} ${typeof a=="string"?a:wde(a)} ${l} ${typeof c=="string"?c:wde(c)}`).join(",")},...i,easing:e,duration:n}}const RWe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function AWe(i){return am(i)||typeof i>"u"||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||Array.isArray(i)}function Rke(i={}){const e={...i};function n(r){const s=Object.entries(r);for(let o=0;o<s.length;o++){const[a,l]=s[o];!AWe(l)||a.startsWith("unstable_")?delete r[a]:am(l)&&(r[a]={...l},n(r[a]))}}return n(e),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
const theme = ${JSON.stringify(e,null,2)};
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
theme.transitions = createTransitions(theme.transitions || {});
export default theme;`}function bZ(i={},...e){const{breakpoints:n,mixins:r={},spacing:s,palette:o={},transitions:a={},typography:l={},shape:c,...u}=i;if(i.vars&&i.generateThemeVars===void 0)throw new Error(kv(20));const d=Ore(o),h=s5(i);let f=pl(h,{mixins:CWe(h.breakpoints,r),palette:d,shadows:DWe.slice(),typography:Ike(d,l),transitions:TWe(a),zIndex:{...RWe}});return f=pl(f,u),f=e.reduce((p,g)=>pl(p,g),f),f.unstable_sxConfig={...r5,...u==null?void 0:u.unstable_sxConfig},f.unstable_sx=function(g){return i1({sx:g,theme:this})},f.toRuntimeSource=Rke,f}function yZ(i){let e;return i<1?e=5.11916*i**2:e=4.5*Math.log(i+1)+2,Math.round(e*10)/1e3}const NWe=[...Array(25)].map((i,e)=>{if(e===0)return"none";const n=yZ(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Ake(i){return{inputPlaceholder:i==="dark"?.5:.42,inputUnderline:i==="dark"?.7:.42,switchTrackDisabled:i==="dark"?.2:.12,switchTrack:i==="dark"?.3:.38}}function Nke(i){return i==="dark"?NWe:[]}function MWe(i){const{palette:e={mode:"light"},opacity:n,overlays:r,...s}=i,o=Ore(e);return{palette:o,opacity:{...Ake(o.mode),...n},overlays:r||Nke(o.mode),...s}}function PWe(i){var e;return!!i[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!i[0].match(/sxConfig$/)||i[0]==="palette"&&!!((e=i[1])!=null&&e.match(/(mode|contrastThreshold|tonalOffset)/))}const OWe=i=>[...[...Array(25)].map((e,n)=>`--${i?`${i}-`:""}overlays-${n}`),`--${i?`${i}-`:""}palette-AppBar-darkBg`,`--${i?`${i}-`:""}palette-AppBar-darkColor`],FWe=i=>(e,n)=>{const r=i.rootSelector||":root",s=i.colorSchemeSelector;let o=s;if(s==="class"&&(o=".%s"),s==="data"&&(o="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(o=`[${s}="%s"]`),i.defaultColorScheme===e){if(e==="dark"){const a={};return OWe(i.cssVarPrefix).forEach(l=>{a[l]=n[l],delete n[l]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:a}}:o?{[o.replace("%s",e)]:a,[`${r}, ${o.replace("%s",e)}`]:n}:{[r]:{...n,...a}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(e))}`}else if(e){if(o==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[r]:n}};if(o)return o.replace("%s",String(e))}return r};function BWe(i,e){e.forEach(n=>{i[n]||(i[n]={})})}function pt(i,e,n){!i[e]&&n&&(i[e]=n)}function JA(i){return typeof i!="string"||!i.startsWith("hsl")?i:wke(i)}function q_(i,e){`${e}Channel`in i||(i[`${e}Channel`]=QA(JA(i[e])))}function jWe(i){return typeof i=="number"?`${i}px`:typeof i=="string"||typeof i=="function"||Array.isArray(i)?i:"8px"}const Fg=i=>{try{return i()}catch{}},WWe=(i="mui")=>zje(i);function cU(i,e,n,r){if(!e)return;e=e===!0?{}:e;const s=r==="dark"?"dark":"light";if(!n){i[r]=MWe({...e,palette:{mode:s,...e==null?void 0:e.palette}});return}const{palette:o,...a}=bZ({...n,palette:{mode:s,...e==null?void 0:e.palette}});return i[r]={...e,palette:o,opacity:{...Ake(s),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||Nke(s)},a}function $We(i={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:s=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:a=PWe,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...u}=i,d=Object.keys(n)[0],h=r||(n.light&&d!=="light"?"light":d),f=WWe(o),{[h]:p,light:g,dark:m,..._}=n,b={..._};let y=p;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(kv(21,h));const x=cU(b,y,u,h);g&&!b.light&&cU(b,g,void 0,"light"),m&&!b.dark&&cU(b,m,void 0,"dark");let k={defaultColorScheme:h,...x,cssVarPrefix:o,colorSchemeSelector:l,rootSelector:c,getCssVar:f,colorSchemes:b,font:{...wWe(x.typography),...x.font},spacing:jWe(u.spacing)};Object.keys(k.colorSchemes).forEach(M=>{const N=k.colorSchemes[M].palette,P=O=>{const B=O.split("-"),j=B[1],z=B[2];return f(O,N[j][z])};if(N.mode==="light"&&(pt(N.common,"background","#fff"),pt(N.common,"onBackground","#000")),N.mode==="dark"&&(pt(N.common,"background","#000"),pt(N.common,"onBackground","#fff")),BWe(N,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),N.mode==="light"){pt(N.Alert,"errorColor",Ls(N.error.light,.6)),pt(N.Alert,"infoColor",Ls(N.info.light,.6)),pt(N.Alert,"successColor",Ls(N.success.light,.6)),pt(N.Alert,"warningColor",Ls(N.warning.light,.6)),pt(N.Alert,"errorFilledBg",P("palette-error-main")),pt(N.Alert,"infoFilledBg",P("palette-info-main")),pt(N.Alert,"successFilledBg",P("palette-success-main")),pt(N.Alert,"warningFilledBg",P("palette-warning-main")),pt(N.Alert,"errorFilledColor",Fg(()=>N.getContrastText(N.error.main))),pt(N.Alert,"infoFilledColor",Fg(()=>N.getContrastText(N.info.main))),pt(N.Alert,"successFilledColor",Fg(()=>N.getContrastText(N.success.main))),pt(N.Alert,"warningFilledColor",Fg(()=>N.getContrastText(N.warning.main))),pt(N.Alert,"errorStandardBg",Ds(N.error.light,.9)),pt(N.Alert,"infoStandardBg",Ds(N.info.light,.9)),pt(N.Alert,"successStandardBg",Ds(N.success.light,.9)),pt(N.Alert,"warningStandardBg",Ds(N.warning.light,.9)),pt(N.Alert,"errorIconColor",P("palette-error-main")),pt(N.Alert,"infoIconColor",P("palette-info-main")),pt(N.Alert,"successIconColor",P("palette-success-main")),pt(N.Alert,"warningIconColor",P("palette-warning-main")),pt(N.AppBar,"defaultBg",P("palette-grey-100")),pt(N.Avatar,"defaultBg",P("palette-grey-400")),pt(N.Button,"inheritContainedBg",P("palette-grey-300")),pt(N.Button,"inheritContainedHoverBg",P("palette-grey-A100")),pt(N.Chip,"defaultBorder",P("palette-grey-400")),pt(N.Chip,"defaultAvatarColor",P("palette-grey-700")),pt(N.Chip,"defaultIconColor",P("palette-grey-700")),pt(N.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),pt(N.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),pt(N.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),pt(N.LinearProgress,"primaryBg",Ds(N.primary.main,.62)),pt(N.LinearProgress,"secondaryBg",Ds(N.secondary.main,.62)),pt(N.LinearProgress,"errorBg",Ds(N.error.main,.62)),pt(N.LinearProgress,"infoBg",Ds(N.info.main,.62)),pt(N.LinearProgress,"successBg",Ds(N.success.main,.62)),pt(N.LinearProgress,"warningBg",Ds(N.warning.main,.62)),pt(N.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.11)`),pt(N.Slider,"primaryTrack",Ds(N.primary.main,.62)),pt(N.Slider,"secondaryTrack",Ds(N.secondary.main,.62)),pt(N.Slider,"errorTrack",Ds(N.error.main,.62)),pt(N.Slider,"infoTrack",Ds(N.info.main,.62)),pt(N.Slider,"successTrack",Ds(N.success.main,.62)),pt(N.Slider,"warningTrack",Ds(N.warning.main,.62));const O=u3(N.background.default,.8);pt(N.SnackbarContent,"bg",O),pt(N.SnackbarContent,"color",Fg(()=>N.getContrastText(O))),pt(N.SpeedDialAction,"fabHoverBg",u3(N.background.paper,.15)),pt(N.StepConnector,"border",P("palette-grey-400")),pt(N.StepContent,"border",P("palette-grey-400")),pt(N.Switch,"defaultColor",P("palette-common-white")),pt(N.Switch,"defaultDisabledColor",P("palette-grey-100")),pt(N.Switch,"primaryDisabledColor",Ds(N.primary.main,.62)),pt(N.Switch,"secondaryDisabledColor",Ds(N.secondary.main,.62)),pt(N.Switch,"errorDisabledColor",Ds(N.error.main,.62)),pt(N.Switch,"infoDisabledColor",Ds(N.info.main,.62)),pt(N.Switch,"successDisabledColor",Ds(N.success.main,.62)),pt(N.Switch,"warningDisabledColor",Ds(N.warning.main,.62)),pt(N.TableCell,"border",Ds(c3(N.divider,1),.88)),pt(N.Tooltip,"bg",c3(N.grey[700],.92))}if(N.mode==="dark"){pt(N.Alert,"errorColor",Ds(N.error.light,.6)),pt(N.Alert,"infoColor",Ds(N.info.light,.6)),pt(N.Alert,"successColor",Ds(N.success.light,.6)),pt(N.Alert,"warningColor",Ds(N.warning.light,.6)),pt(N.Alert,"errorFilledBg",P("palette-error-dark")),pt(N.Alert,"infoFilledBg",P("palette-info-dark")),pt(N.Alert,"successFilledBg",P("palette-success-dark")),pt(N.Alert,"warningFilledBg",P("palette-warning-dark")),pt(N.Alert,"errorFilledColor",Fg(()=>N.getContrastText(N.error.dark))),pt(N.Alert,"infoFilledColor",Fg(()=>N.getContrastText(N.info.dark))),pt(N.Alert,"successFilledColor",Fg(()=>N.getContrastText(N.success.dark))),pt(N.Alert,"warningFilledColor",Fg(()=>N.getContrastText(N.warning.dark))),pt(N.Alert,"errorStandardBg",Ls(N.error.light,.9)),pt(N.Alert,"infoStandardBg",Ls(N.info.light,.9)),pt(N.Alert,"successStandardBg",Ls(N.success.light,.9)),pt(N.Alert,"warningStandardBg",Ls(N.warning.light,.9)),pt(N.Alert,"errorIconColor",P("palette-error-main")),pt(N.Alert,"infoIconColor",P("palette-info-main")),pt(N.Alert,"successIconColor",P("palette-success-main")),pt(N.Alert,"warningIconColor",P("palette-warning-main")),pt(N.AppBar,"defaultBg",P("palette-grey-900")),pt(N.AppBar,"darkBg",P("palette-background-paper")),pt(N.AppBar,"darkColor",P("palette-text-primary")),pt(N.Avatar,"defaultBg",P("palette-grey-600")),pt(N.Button,"inheritContainedBg",P("palette-grey-800")),pt(N.Button,"inheritContainedHoverBg",P("palette-grey-700")),pt(N.Chip,"defaultBorder",P("palette-grey-700")),pt(N.Chip,"defaultAvatarColor",P("palette-grey-300")),pt(N.Chip,"defaultIconColor",P("palette-grey-300")),pt(N.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),pt(N.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),pt(N.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),pt(N.LinearProgress,"primaryBg",Ls(N.primary.main,.5)),pt(N.LinearProgress,"secondaryBg",Ls(N.secondary.main,.5)),pt(N.LinearProgress,"errorBg",Ls(N.error.main,.5)),pt(N.LinearProgress,"infoBg",Ls(N.info.main,.5)),pt(N.LinearProgress,"successBg",Ls(N.success.main,.5)),pt(N.LinearProgress,"warningBg",Ls(N.warning.main,.5)),pt(N.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.13)`),pt(N.Slider,"primaryTrack",Ls(N.primary.main,.5)),pt(N.Slider,"secondaryTrack",Ls(N.secondary.main,.5)),pt(N.Slider,"errorTrack",Ls(N.error.main,.5)),pt(N.Slider,"infoTrack",Ls(N.info.main,.5)),pt(N.Slider,"successTrack",Ls(N.success.main,.5)),pt(N.Slider,"warningTrack",Ls(N.warning.main,.5));const O=u3(N.background.default,.98);pt(N.SnackbarContent,"bg",O),pt(N.SnackbarContent,"color",Fg(()=>N.getContrastText(O))),pt(N.SpeedDialAction,"fabHoverBg",u3(N.background.paper,.15)),pt(N.StepConnector,"border",P("palette-grey-600")),pt(N.StepContent,"border",P("palette-grey-600")),pt(N.Switch,"defaultColor",P("palette-grey-300")),pt(N.Switch,"defaultDisabledColor",P("palette-grey-600")),pt(N.Switch,"primaryDisabledColor",Ls(N.primary.main,.55)),pt(N.Switch,"secondaryDisabledColor",Ls(N.secondary.main,.55)),pt(N.Switch,"errorDisabledColor",Ls(N.error.main,.55)),pt(N.Switch,"infoDisabledColor",Ls(N.info.main,.55)),pt(N.Switch,"successDisabledColor",Ls(N.success.main,.55)),pt(N.Switch,"warningDisabledColor",Ls(N.warning.main,.55)),pt(N.TableCell,"border",Ls(c3(N.divider,1),.68)),pt(N.Tooltip,"bg",c3(N.grey[700],.92))}q_(N.background,"default"),q_(N.background,"paper"),q_(N.common,"background"),q_(N.common,"onBackground"),q_(N,"divider"),Object.keys(N).forEach(O=>{const B=N[O];O!=="tonalOffset"&&B&&typeof B=="object"&&(B.main&&pt(N[O],"mainChannel",QA(JA(B.main))),B.light&&pt(N[O],"lightChannel",QA(JA(B.light))),B.dark&&pt(N[O],"darkChannel",QA(JA(B.dark))),B.contrastText&&pt(N[O],"contrastTextChannel",QA(JA(B.contrastText))),O==="text"&&(q_(N[O],"primary"),q_(N[O],"secondary")),O==="action"&&(B.active&&q_(N[O],"active"),B.selected&&q_(N[O],"selected")))})}),k=e.reduce((M,N)=>pl(M,N),k);const D={prefix:o,disableCssColorScheme:s,shouldSkipGeneratingVar:a,getSelector:FWe(k)},{vars:R,generateThemeVars:E,generateStyleSheets:A}=Uje(k,D);return k.vars=R,Object.entries(k.colorSchemes[k.defaultColorScheme]).forEach(([M,N])=>{k[M]=N}),k.generateThemeVars=E,k.generateStyleSheets=A,k.generateSpacing=function(){return cke(u.spacing,Ere(this))},k.getColorSchemeSelector=qje(l),k.spacing=k.generateSpacing(),k.shouldSkipGeneratingVar=a,k.unstable_sxConfig={...r5,...u==null?void 0:u.unstable_sxConfig},k.unstable_sx=function(N){return i1({sx:N,theme:this})},k.toRuntimeSource=Rke,k}function Cde(i,e,n){i.colorSchemes&&n&&(i.colorSchemes[e]={...n!==!0&&n,palette:Ore({...n===!0?{}:n.palette,mode:e})})}function a5(i={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:s=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...a}=i,l=o||"light",c=s==null?void 0:s[l],u={...s,...n?{[l]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in i))return bZ(i,...e);let d=n;"palette"in i||u[l]&&(u[l]!==!0?d=u[l].palette:l==="dark"&&(d={mode:"dark"}));const h=bZ({...i,palette:d},...e);return h.defaultColorScheme=l,h.colorSchemes=u,h.palette.mode==="light"&&(h.colorSchemes.light={...u.light!==!0&&u.light,palette:h.palette},Cde(h,"dark",u.dark)),h.palette.mode==="dark"&&(h.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:h.palette},Cde(h,"light",u.light)),h}return!n&&!("light"in u)&&l==="light"&&(u.light=!0),$We({...a,colorSchemes:u,defaultColorScheme:l,...typeof r!="boolean"&&r},...e)}function zWe(i){return String(i).match(/[\d.\-+]*\s*(.*)/)[1]||""}function VWe(i){return parseFloat(i)}const Fre=a5();function $i(){const i=o5(Fre);return i[Bp]||i}function bW(i){return i!=="ownerState"&&i!=="theme"&&i!=="sx"&&i!=="as"}const vl=i=>bW(i)&&i!=="classes",ye=gke({themeId:Bp,defaultTheme:Fre,rootShouldForwardProp:vl});function HWe({theme:i,...e}){const n=Bp in i?i[Bp]:void 0;return C.jsx(kke,{...e,themeId:n?Bp:void 0,theme:n||i})}const d3={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:UWe}=$je({themeId:Bp,theme:()=>a5({cssVariables:!0}),colorSchemeStorageKey:d3.colorSchemeStorageKey,modeStorageKey:d3.modeStorageKey,defaultColorScheme:{light:d3.defaultLightColorScheme,dark:d3.defaultDarkColorScheme},resolveTheme:i=>{const e={...i,typography:Ike(i.palette,i.typography)};return e.unstable_sx=function(r){return i1({sx:r,theme:this})},e}}),qWe=UWe;function KWe({theme:i,...e}){const n=$.useMemo(()=>{if(typeof i=="function")return i;const r=Bp in i?i[Bp]:i;return"colorSchemes"in r?null:"vars"in r?i:{...i,vars:null}},[i]);return n?C.jsx(HWe,{theme:n,...e}):C.jsx(qWe,{theme:i,...e})}function Sde(...i){return i.reduce((e,n)=>n==null?e:function(...s){e.apply(this,s),n.apply(this,s)},()=>{})}function GWe(i){return C.jsx(uke,{...i,defaultTheme:Fre,themeId:Bp})}function Bre(i){return function(n){return C.jsx(GWe,{styles:typeof i=="function"?r=>i({theme:r,...n}):i})}}function XWe(){return Tre}const jt=Nje;function Qt(i){return Ije(i)}function YWe(i){return Xt("MuiSvgIcon",i)}Yt("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const ZWe=i=>{const{color:e,fontSize:n,classes:r}=i,s={root:["root",e!=="inherit"&&`color${Ue(e)}`,`fontSize${Ue(n)}`]};return Zt(s,YWe,r)},QWe=ye("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.color!=="inherit"&&e[`color${Ue(n.color)}`],e[`fontSize${Ue(n.fontSize)}`]]}})(jt(({theme:i})=>{var e,n,r,s,o,a,l,c,u,d,h,f,p,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(s=(e=i.transitions)==null?void 0:e.create)==null?void 0:s.call(e,"fill",{duration:(r=(n=(i.vars??i).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:m=>!m.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((a=(o=i.typography)==null?void 0:o.pxToRem)==null?void 0:a.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((c=(l=i.typography)==null?void 0:l.pxToRem)==null?void 0:c.call(l,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((d=(u=i.typography)==null?void 0:u.pxToRem)==null?void 0:d.call(u,35))||"2.1875rem"}},...Object.entries((i.vars??i).palette).filter(([,m])=>m&&m.main).map(([m])=>{var _,b;return{props:{color:m},style:{color:(b=(_=(i.vars??i).palette)==null?void 0:_[m])==null?void 0:b.main}}}),{props:{color:"action"},style:{color:(f=(h=(i.vars??i).palette)==null?void 0:h.action)==null?void 0:f.active}},{props:{color:"disabled"},style:{color:(g=(p=(i.vars??i).palette)==null?void 0:p.action)==null?void 0:g.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),u9=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiSvgIcon"}),{children:s,className:o,color:a="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:d=!1,titleAccess:h,viewBox:f="0 0 24 24",...p}=r,g=$.isValidElement(s)&&s.type==="svg",m={...r,color:a,component:l,fontSize:c,instanceFontSize:e.fontSize,inheritViewBox:d,viewBox:f,hasSvgAsChild:g},_={};d||(_.viewBox=f);const b=ZWe(m);return C.jsxs(QWe,{as:l,className:dt(b.root,o),focusable:"false",color:u,"aria-hidden":h?void 0:!0,role:h?"img":void 0,ref:n,..._,...p,...g&&s.props,ownerState:m,children:[g?s.props.children:s,h?C.jsx("title",{children:h}):null]})});u9.muiName="SvgIcon";function Hr(i,e){function n(r,s){return C.jsx(u9,{"data-testid":void 0,ref:s,...r,children:i})}return n.muiName=u9.muiName,$.memo($.forwardRef(n))}function l5(i,e=166){let n;function r(...s){const o=()=>{i.apply(this,s)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function gl(i){return i&&i.ownerDocument||document}function fh(i){return gl(i).defaultView||window}function wZ(i,e){typeof i=="function"?i(e):i&&(i.current=e)}function Im(i){const{controlled:e,default:n,name:r,state:s="value"}=i,{current:o}=$.useRef(e!==void 0),[a,l]=$.useState(n),c=o?e:a,u=$.useCallback(d=>{o||l(d)},[]);return[c,u]}function Ha(i){const e=$.useRef(i);return wc(()=>{e.current=i}),$.useRef((...n)=>(0,e.current)(...n)).current}function mo(...i){const e=$.useRef(void 0),n=$.useCallback(r=>{const s=i.map(o=>{if(o==null)return null;if(typeof o=="function"){const a=o,l=a(r);return typeof l=="function"?l:()=>{a(null)}}return o.current=r,()=>{o.current=null}});return()=>{s.forEach(o=>o==null?void 0:o())}},i);return $.useMemo(()=>i.every(r=>r==null)?null:r=>{e.current&&(e.current(),e.current=void 0),r!=null&&(e.current=n(r))},i)}function JWe(i,e){const n=i.charCodeAt(2);return i[0]==="o"&&i[1]==="n"&&n>=65&&n<=90&&typeof e=="function"}function jre(i,e){if(!i)return e;function n(a,l){const c={};return Object.keys(l).forEach(u=>{JWe(u,l[u])&&typeof a[u]=="function"&&(c[u]=(...d)=>{a[u](...d),l[u](...d)})}),c}if(typeof i=="function"||typeof e=="function")return a=>{const l=typeof e=="function"?e(a):e,c=typeof i=="function"?i({...a,...l}):i,u=dt(a==null?void 0:a.className,l==null?void 0:l.className,c==null?void 0:c.className),d=n(c,l);return{...l,...c,...d,...!!u&&{className:u},...(l==null?void 0:l.style)&&(c==null?void 0:c.style)&&{style:{...l.style,...c.style}},...(l==null?void 0:l.sx)&&(c==null?void 0:c.sx)&&{sx:[...Array.isArray(l.sx)?l.sx:[l.sx],...Array.isArray(c.sx)?c.sx:[c.sx]]}}};const r=e,s=n(i,r),o=dt(r==null?void 0:r.className,i==null?void 0:i.className);return{...e,...i,...s,...!!o&&{className:o},...(r==null?void 0:r.style)&&(i==null?void 0:i.style)&&{style:{...r.style,...i.style}},...(r==null?void 0:r.sx)&&(i==null?void 0:i.sx)&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(i.sx)?i.sx:[i.sx]]}}}function Dc(i,e){if(i==null)return{};var n={};for(var r in i)if({}.hasOwnProperty.call(i,r)){if(e.indexOf(r)!==-1)continue;n[r]=i[r]}return n}function CZ(i,e){return CZ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},CZ(i,e)}function Mke(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,CZ(i,e)}var uU={exports:{}},Nu={},dU={exports:{}},hU={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var xde;function e$e(){return xde||(xde=1,function(i){function e(X,Q){var ie=X.length;X.push(Q);e:for(;0<ie;){var K=ie-1>>>1,ee=X[K];if(0<s(ee,Q))X[K]=Q,X[ie]=ee,ie=K;else break e}}function n(X){return X.length===0?null:X[0]}function r(X){if(X.length===0)return null;var Q=X[0],ie=X.pop();if(ie!==Q){X[0]=ie;e:for(var K=0,ee=X.length,le=ee>>>1;K<le;){var ke=2*(K+1)-1,xe=X[ke],me=ke+1,Ee=X[me];if(0>s(xe,ie))me<ee&&0>s(Ee,xe)?(X[K]=Ee,X[me]=ie,K=me):(X[K]=xe,X[ke]=ie,K=ke);else if(me<ee&&0>s(Ee,ie))X[K]=Ee,X[me]=ie,K=me;else break e}}return Q}function s(X,Q){var ie=X.sortIndex-Q.sortIndex;return ie!==0?ie:X.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;i.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();i.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,h=null,f=3,p=!1,g=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(X){for(var Q=n(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=X)r(u),Q.sortIndex=Q.expirationTime,e(c,Q);else break;Q=n(u)}}function k(X){if(m=!1,x(X),!g)if(n(c)!==null)g=!0,H(D);else{var Q=n(u);Q!==null&&Y(k,Q.startTime-X)}}function D(X,Q){g=!1,m&&(m=!1,b(A),A=-1),p=!0;var ie=f;try{for(x(Q),h=n(c);h!==null&&(!(h.expirationTime>Q)||X&&!P());){var K=h.callback;if(typeof K=="function"){h.callback=null,f=h.priorityLevel;var ee=K(h.expirationTime<=Q);Q=i.unstable_now(),typeof ee=="function"?h.callback=ee:h===n(c)&&r(c),x(Q)}else r(c);h=n(c)}if(h!==null)var le=!0;else{var ke=n(u);ke!==null&&Y(k,ke.startTime-Q),le=!1}return le}finally{h=null,f=ie,p=!1}}var R=!1,E=null,A=-1,M=5,N=-1;function P(){return!(i.unstable_now()-N<M)}function O(){if(E!==null){var X=i.unstable_now();N=X;var Q=!0;try{Q=E(!0,X)}finally{Q?B():(R=!1,E=null)}}else R=!1}var B;if(typeof y=="function")B=function(){y(O)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,z=j.port2;j.port1.onmessage=O,B=function(){z.postMessage(null)}}else B=function(){_(O,0)};function H(X){E=X,R||(R=!0,B())}function Y(X,Q){A=_(function(){X(i.unstable_now())},Q)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(X){X.callback=null},i.unstable_continueExecution=function(){g||p||(g=!0,H(D))},i.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<X?Math.floor(1e3/X):5},i.unstable_getCurrentPriorityLevel=function(){return f},i.unstable_getFirstCallbackNode=function(){return n(c)},i.unstable_next=function(X){switch(f){case 1:case 2:case 3:var Q=3;break;default:Q=f}var ie=f;f=Q;try{return X()}finally{f=ie}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(X,Q){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var ie=f;f=X;try{return Q()}finally{f=ie}},i.unstable_scheduleCallback=function(X,Q,ie){var K=i.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?K+ie:K):ie=K,X){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=ie+ee,X={id:d++,callback:Q,priorityLevel:X,startTime:ie,expirationTime:ee,sortIndex:-1},ie>K?(X.sortIndex=ie,e(u,X),n(c)===null&&X===n(u)&&(m?(b(A),A=-1):m=!0,Y(k,ie-K))):(X.sortIndex=ee,e(c,X),g||p||(g=!0,H(D))),X},i.unstable_shouldYield=P,i.unstable_wrapCallback=function(X){var Q=f;return function(){var ie=f;f=Q;try{return X.apply(this,arguments)}finally{f=ie}}}}(hU)),hU}var kde;function t$e(){return kde||(kde=1,dU.exports=e$e()),dU.exports}/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Lde;function n$e(){if(Lde)return Nu;Lde=1;var i=B1(),e=t$e();function n(v){for(var w="https://reactjs.org/docs/error-decoder.html?invariant="+v,T=1;T<arguments.length;T++)w+="&args[]="+encodeURIComponent(arguments[T]);return"Minified React error #"+v+"; visit "+w+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function o(v,w){a(v,w),a(v+"Capture",w)}function a(v,w){for(s[v]=w,v=0;v<w.length;v++)r.add(w[v])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},h={};function f(v){return c.call(h,v)?!0:c.call(d,v)?!1:u.test(v)?h[v]=!0:(d[v]=!0,!1)}function p(v,w,T,F){if(T!==null&&T.type===0)return!1;switch(typeof w){case"function":case"symbol":return!0;case"boolean":return F?!1:T!==null?!T.acceptsBooleans:(v=v.toLowerCase().slice(0,5),v!=="data-"&&v!=="aria-");default:return!1}}function g(v,w,T,F){if(w===null||typeof w>"u"||p(v,w,T,F))return!0;if(F)return!1;if(T!==null)switch(T.type){case 3:return!w;case 4:return w===!1;case 5:return isNaN(w);case 6:return isNaN(w)||1>w}return!1}function m(v,w,T,F,V,U,re){this.acceptsBooleans=w===2||w===3||w===4,this.attributeName=F,this.attributeNamespace=V,this.mustUseProperty=T,this.propertyName=v,this.type=w,this.sanitizeURL=U,this.removeEmptyString=re}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(v){_[v]=new m(v,0,!1,v,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(v){var w=v[0];_[w]=new m(w,1,!1,v[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(v){_[v]=new m(v,2,!1,v.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(v){_[v]=new m(v,2,!1,v,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(v){_[v]=new m(v,3,!1,v.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(v){_[v]=new m(v,3,!0,v,null,!1,!1)}),["capture","download"].forEach(function(v){_[v]=new m(v,4,!1,v,null,!1,!1)}),["cols","rows","size","span"].forEach(function(v){_[v]=new m(v,6,!1,v,null,!1,!1)}),["rowSpan","start"].forEach(function(v){_[v]=new m(v,5,!1,v.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function y(v){return v[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(v){var w=v.replace(b,y);_[w]=new m(w,1,!1,v,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(v){var w=v.replace(b,y);_[w]=new m(w,1,!1,v,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(v){var w=v.replace(b,y);_[w]=new m(w,1,!1,v,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(v){_[v]=new m(v,1,!1,v.toLowerCase(),null,!1,!1)}),_.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(v){_[v]=new m(v,1,!1,v.toLowerCase(),null,!0,!0)});function x(v,w,T,F){var V=_.hasOwnProperty(w)?_[w]:null;(V!==null?V.type!==0:F||!(2<w.length)||w[0]!=="o"&&w[0]!=="O"||w[1]!=="n"&&w[1]!=="N")&&(g(w,T,V,F)&&(T=null),F||V===null?f(w)&&(T===null?v.removeAttribute(w):v.setAttribute(w,""+T)):V.mustUseProperty?v[V.propertyName]=T===null?V.type===3?!1:"":T:(w=V.attributeName,F=V.attributeNamespace,T===null?v.removeAttribute(w):(V=V.type,T=V===3||V===4&&T===!0?"":""+T,F?v.setAttributeNS(F,w,T):v.setAttribute(w,T))))}var k=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),R=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),P=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),X=Symbol.iterator;function Q(v){return v===null||typeof v!="object"?null:(v=X&&v[X]||v["@@iterator"],typeof v=="function"?v:null)}var ie=Object.assign,K;function ee(v){if(K===void 0)try{throw Error()}catch(T){var w=T.stack.trim().match(/\n( *(at )?)/);K=w&&w[1]||""}return`
`+K+v}var le=!1;function ke(v,w){if(!v||le)return"";le=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(w)if(w=function(){throw Error()},Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(et){var F=et}Reflect.construct(v,[],w)}else{try{w.call()}catch(et){F=et}v.call(w.prototype)}else{try{throw Error()}catch(et){F=et}v()}}catch(et){if(et&&F&&typeof et.stack=="string"){for(var V=et.stack.split(`
`),U=F.stack.split(`
`),re=V.length-1,be=U.length-1;1<=re&&0<=be&&V[re]!==U[be];)be--;for(;1<=re&&0<=be;re--,be--)if(V[re]!==U[be]){if(re!==1||be!==1)do if(re--,be--,0>be||V[re]!==U[be]){var Re=`
`+V[re].replace(" at new "," at ");return v.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",v.displayName)),Re}while(1<=re&&0<=be);break}}}finally{le=!1,Error.prepareStackTrace=T}return(v=v?v.displayName||v.name:"")?ee(v):""}function xe(v){switch(v.tag){case 5:return ee(v.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return v=ke(v.type,!1),v;case 11:return v=ke(v.type.render,!1),v;case 1:return v=ke(v.type,!0),v;default:return""}}function me(v){if(v==null)return null;if(typeof v=="function")return v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case E:return"Fragment";case R:return"Portal";case M:return"Profiler";case A:return"StrictMode";case B:return"Suspense";case j:return"SuspenseList"}if(typeof v=="object")switch(v.$$typeof){case P:return(v.displayName||"Context")+".Consumer";case N:return(v._context.displayName||"Context")+".Provider";case O:var w=v.render;return v=v.displayName,v||(v=w.displayName||w.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case z:return w=v.displayName||null,w!==null?w:me(v.type)||"Memo";case H:w=v._payload,v=v._init;try{return me(v(w))}catch{}}return null}function Ee(v){var w=v.type;switch(v.tag){case 24:return"Cache";case 9:return(w.displayName||"Context")+".Consumer";case 10:return(w._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return v=w.render,v=v.displayName||v.name||"",w.displayName||(v!==""?"ForwardRef("+v+")":"ForwardRef");case 7:return"Fragment";case 5:return w;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(w);case 8:return w===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w}return null}function je(v){switch(typeof v){case"boolean":case"number":case"string":case"undefined":return v;case"object":return v;default:return""}}function qe(v){var w=v.type;return(v=v.nodeName)&&v.toLowerCase()==="input"&&(w==="checkbox"||w==="radio")}function Ze(v){var w=qe(v)?"checked":"value",T=Object.getOwnPropertyDescriptor(v.constructor.prototype,w),F=""+v[w];if(!v.hasOwnProperty(w)&&typeof T<"u"&&typeof T.get=="function"&&typeof T.set=="function"){var V=T.get,U=T.set;return Object.defineProperty(v,w,{configurable:!0,get:function(){return V.call(this)},set:function(re){F=""+re,U.call(this,re)}}),Object.defineProperty(v,w,{enumerable:T.enumerable}),{getValue:function(){return F},setValue:function(re){F=""+re},stopTracking:function(){v._valueTracker=null,delete v[w]}}}}function We(v){v._valueTracker||(v._valueTracker=Ze(v))}function ut(v){if(!v)return!1;var w=v._valueTracker;if(!w)return!0;var T=w.getValue(),F="";return v&&(F=qe(v)?v.checked?"true":"false":v.value),v=F,v!==T?(w.setValue(v),!0):!1}function st(v){if(v=v||(typeof document<"u"?document:void 0),typeof v>"u")return null;try{return v.activeElement||v.body}catch{return v.body}}function mt(v,w){var T=w.checked;return ie({},w,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:T??v._wrapperState.initialChecked})}function Rt(v,w){var T=w.defaultValue==null?"":w.defaultValue,F=w.checked!=null?w.checked:w.defaultChecked;T=je(w.value!=null?w.value:T),v._wrapperState={initialChecked:F,initialValue:T,controlled:w.type==="checkbox"||w.type==="radio"?w.checked!=null:w.value!=null}}function Vt(v,w){w=w.checked,w!=null&&x(v,"checked",w,!1)}function Ot(v,w){Vt(v,w);var T=je(w.value),F=w.type;if(T!=null)F==="number"?(T===0&&v.value===""||v.value!=T)&&(v.value=""+T):v.value!==""+T&&(v.value=""+T);else if(F==="submit"||F==="reset"){v.removeAttribute("value");return}w.hasOwnProperty("value")?wn(v,w.type,T):w.hasOwnProperty("defaultValue")&&wn(v,w.type,je(w.defaultValue)),w.checked==null&&w.defaultChecked!=null&&(v.defaultChecked=!!w.defaultChecked)}function vt(v,w,T){if(w.hasOwnProperty("value")||w.hasOwnProperty("defaultValue")){var F=w.type;if(!(F!=="submit"&&F!=="reset"||w.value!==void 0&&w.value!==null))return;w=""+v._wrapperState.initialValue,T||w===v.value||(v.value=w),v.defaultValue=w}T=v.name,T!==""&&(v.name=""),v.defaultChecked=!!v._wrapperState.initialChecked,T!==""&&(v.name=T)}function wn(v,w,T){(w!=="number"||st(v.ownerDocument)!==v)&&(T==null?v.defaultValue=""+v._wrapperState.initialValue:v.defaultValue!==""+T&&(v.defaultValue=""+T))}var Ce=Array.isArray;function ge(v,w,T,F){if(v=v.options,w){w={};for(var V=0;V<T.length;V++)w["$"+T[V]]=!0;for(T=0;T<v.length;T++)V=w.hasOwnProperty("$"+v[T].value),v[T].selected!==V&&(v[T].selected=V),V&&F&&(v[T].defaultSelected=!0)}else{for(T=""+je(T),w=null,V=0;V<v.length;V++){if(v[V].value===T){v[V].selected=!0,F&&(v[V].defaultSelected=!0);return}w!==null||v[V].disabled||(w=v[V])}w!==null&&(w.selected=!0)}}function pe(v,w){if(w.dangerouslySetInnerHTML!=null)throw Error(n(91));return ie({},w,{value:void 0,defaultValue:void 0,children:""+v._wrapperState.initialValue})}function ne(v,w){var T=w.value;if(T==null){if(T=w.children,w=w.defaultValue,T!=null){if(w!=null)throw Error(n(92));if(Ce(T)){if(1<T.length)throw Error(n(93));T=T[0]}w=T}w==null&&(w=""),T=w}v._wrapperState={initialValue:je(T)}}function ae(v,w){var T=je(w.value),F=je(w.defaultValue);T!=null&&(T=""+T,T!==v.value&&(v.value=T),w.defaultValue==null&&v.defaultValue!==T&&(v.defaultValue=T)),F!=null&&(v.defaultValue=""+F)}function ue(v){var w=v.textContent;w===v._wrapperState.initialValue&&w!==""&&w!==null&&(v.value=w)}function de(v){switch(v){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Se(v,w){return v==null||v==="http://www.w3.org/1999/xhtml"?de(w):v==="http://www.w3.org/2000/svg"&&w==="foreignObject"?"http://www.w3.org/1999/xhtml":v}var Ie,nt=function(v){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(w,T,F,V){MSApp.execUnsafeLocalFunction(function(){return v(w,T,F,V)})}:v}(function(v,w){if(v.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in v)v.innerHTML=w;else{for(Ie=Ie||document.createElement("div"),Ie.innerHTML="<svg>"+w.valueOf().toString()+"</svg>",w=Ie.firstChild;v.firstChild;)v.removeChild(v.firstChild);for(;w.firstChild;)v.appendChild(w.firstChild)}});function Oe(v,w){if(w){var T=v.firstChild;if(T&&T===v.lastChild&&T.nodeType===3){T.nodeValue=w;return}}v.textContent=w}var Ve={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gt=["Webkit","ms","Moz","O"];Object.keys(Ve).forEach(function(v){gt.forEach(function(w){w=w+v.charAt(0).toUpperCase()+v.substring(1),Ve[w]=Ve[v]})});function $t(v,w,T){return w==null||typeof w=="boolean"||w===""?"":T||typeof w!="number"||w===0||Ve.hasOwnProperty(v)&&Ve[v]?(""+w).trim():w+"px"}function Mt(v,w){v=v.style;for(var T in w)if(w.hasOwnProperty(T)){var F=T.indexOf("--")===0,V=$t(T,w[T],F);T==="float"&&(T="cssFloat"),F?v.setProperty(T,V):v[T]=V}}var Bt=ie({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function jn(v,w){if(w){if(Bt[v]&&(w.children!=null||w.dangerouslySetInnerHTML!=null))throw Error(n(137,v));if(w.dangerouslySetInnerHTML!=null){if(w.children!=null)throw Error(n(60));if(typeof w.dangerouslySetInnerHTML!="object"||!("__html"in w.dangerouslySetInnerHTML))throw Error(n(61))}if(w.style!=null&&typeof w.style!="object")throw Error(n(62))}}function Dt(v,w){if(v.indexOf("-")===-1)return typeof w.is=="string";switch(v){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 Fn=null;function tn(v){return v=v.target||v.srcElement||window,v.correspondingUseElement&&(v=v.correspondingUseElement),v.nodeType===3?v.parentNode:v}var pi=null,Pi=null,ti=null;function mi(v){if(v=el(v)){if(typeof pi!="function")throw Error(n(280));var w=v.stateNode;w&&(w=Vk(w),pi(v.stateNode,v.type,w))}}function ds(v){Pi?ti?ti.push(v):ti=[v]:Pi=v}function Nr(){if(Pi){var v=Pi,w=ti;if(ti=Pi=null,mi(v),w)for(v=0;v<w.length;v++)mi(w[v])}}function Br(v,w){return v(w)}function Mn(){}var hr=!1;function rn(v,w,T){if(hr)return v(w,T);hr=!0;try{return Br(v,w,T)}finally{hr=!1,(Pi!==null||ti!==null)&&(Mn(),Nr())}}function sn(v,w){var T=v.stateNode;if(T===null)return null;var F=Vk(T);if(F===null)return null;T=F[w];e:switch(w){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(F=!F.disabled)||(v=v.type,F=!(v==="button"||v==="input"||v==="select"||v==="textarea")),v=!F;break e;default:v=!1}if(v)return null;if(T&&typeof T!="function")throw Error(n(231,w,typeof T));return T}var Kn=!1;if(l)try{var ai={};Object.defineProperty(ai,"passive",{get:function(){Kn=!0}}),window.addEventListener("test",ai,ai),window.removeEventListener("test",ai,ai)}catch{Kn=!1}function Ki(v,w,T,F,V,U,re,be,Re){var et=Array.prototype.slice.call(arguments,3);try{w.apply(T,et)}catch(It){this.onError(It)}}var so=!1,_o=null,Cs=!1,_u=null,yl={onError:function(v){so=!0,_o=v}};function qs(v,w,T,F,V,U,re,be,Re){so=!1,_o=null,Ki.apply(yl,arguments)}function Ks(v,w,T,F,V,U,re,be,Re){if(qs.apply(this,arguments),so){if(so){var et=_o;so=!1,_o=null}else throw Error(n(198));Cs||(Cs=!0,_u=et)}}function ma(v){var w=v,T=v;if(v.alternate)for(;w.return;)w=w.return;else{v=w;do w=v,(w.flags&4098)!==0&&(T=w.return),v=w.return;while(v)}return w.tag===3?T:null}function yn(v){if(v.tag===13){var w=v.memoizedState;if(w===null&&(v=v.alternate,v!==null&&(w=v.memoizedState)),w!==null)return w.dehydrated}return null}function Pe(v){if(ma(v)!==v)throw Error(n(188))}function De(v){var w=v.alternate;if(!w){if(w=ma(v),w===null)throw Error(n(188));return w!==v?null:v}for(var T=v,F=w;;){var V=T.return;if(V===null)break;var U=V.alternate;if(U===null){if(F=V.return,F!==null){T=F;continue}break}if(V.child===U.child){for(U=V.child;U;){if(U===T)return Pe(V),v;if(U===F)return Pe(V),w;U=U.sibling}throw Error(n(188))}if(T.return!==F.return)T=V,F=U;else{for(var re=!1,be=V.child;be;){if(be===T){re=!0,T=V,F=U;break}if(be===F){re=!0,F=V,T=U;break}be=be.sibling}if(!re){for(be=U.child;be;){if(be===T){re=!0,T=U,F=V;break}if(be===F){re=!0,F=U,T=V;break}be=be.sibling}if(!re)throw Error(n(189))}}if(T.alternate!==F)throw Error(n(190))}if(T.tag!==3)throw Error(n(188));return T.stateNode.current===T?v:w}function Ne(v){return v=De(v),v!==null?At(v):null}function At(v){if(v.tag===5||v.tag===6)return v;for(v=v.child;v!==null;){var w=At(v);if(w!==null)return w;v=v.sibling}return null}var En=e.unstable_scheduleCallback,bn=e.unstable_cancelCallback,Yn=e.unstable_shouldYield,fr=e.unstable_requestPaint,Ei=e.unstable_now,dg=e.unstable_getCurrentPriorityLevel,Xv=e.unstable_ImmediatePriority,lw=e.unstable_UserBlockingPriority,Dh=e.unstable_NormalPriority,m_=e.unstable_LowPriority,Yi=e.unstable_IdlePriority,Ic=null,Uo=null;function __(v){if(Uo&&typeof Uo.onCommitFiberRoot=="function")try{Uo.onCommitFiberRoot(Ic,v,void 0,(v.current.flags&128)===128)}catch{}}var Cd=Math.clz32?Math.clz32:V4,$4=Math.log,z4=Math.LN2;function V4(v){return v>>>=0,v===0?32:31-($4(v)/z4|0)|0}var Yv=64,_k=4194304;function Zv(v){switch(v&-v){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: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 v&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return v&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return v}}function v_(v,w){var T=v.pendingLanes;if(T===0)return 0;var F=0,V=v.suspendedLanes,U=v.pingedLanes,re=T&268435455;if(re!==0){var be=re&~V;be!==0?F=Zv(be):(U&=re,U!==0&&(F=Zv(U)))}else re=T&~V,re!==0?F=Zv(re):U!==0&&(F=Zv(U));if(F===0)return 0;if(w!==0&&w!==F&&(w&V)===0&&(V=F&-F,U=w&-w,V>=U||V===16&&(U&4194240)!==0))return w;if((F&4)!==0&&(F|=T&16),w=v.entangledLanes,w!==0)for(v=v.entanglements,w&=F;0<w;)T=31-Cd(w),V=1<<T,F|=v[T],w&=~V;return F}function H4(v,w){switch(v){case 1:case 2:case 4:return w+250;case 8:case 16:case 32:case 64: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 w+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ZV(v,w){for(var T=v.suspendedLanes,F=v.pingedLanes,V=v.expirationTimes,U=v.pendingLanes;0<U;){var re=31-Cd(U),be=1<<re,Re=V[re];Re===-1?((be&T)===0||(be&F)!==0)&&(V[re]=H4(be,w)):Re<=w&&(v.expiredLanes|=be),U&=~be}}function vk(v){return v=v.pendingLanes&-1073741825,v!==0?v:v&1073741824?1073741824:0}function uT(){var v=Yv;return Yv<<=1,(Yv&4194240)===0&&(Yv=64),v}function cw(v){for(var w=[],T=0;31>T;T++)w.push(v);return w}function uw(v,w,T){v.pendingLanes|=w,w!==536870912&&(v.suspendedLanes=0,v.pingedLanes=0),v=v.eventTimes,w=31-Cd(w),v[w]=T}function U4(v,w){var T=v.pendingLanes&~w;v.pendingLanes=w,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=w,v.mutableReadLanes&=w,v.entangledLanes&=w,w=v.entanglements;var F=v.eventTimes;for(v=v.expirationTimes;0<T;){var V=31-Cd(T),U=1<<V;w[V]=0,F[V]=-1,v[V]=-1,T&=~U}}function dw(v,w){var T=v.entangledLanes|=w;for(v=v.entanglements;T;){var F=31-Cd(T),V=1<<F;V&w|v[F]&w&&(v[F]|=w),T&=~V}}var Tr=0;function b_(v){return v&=-v,1<v?4<v?(v&268435455)!==0?16:536870912:4:1}var dT,bk,q4,hT,fT,yk=!1,hw=[],hg=null,fg=null,pg=null,Qv=new Map,fw=new Map,gg=[],QV="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 submit".split(" ");function K4(v,w){switch(v){case"focusin":case"focusout":hg=null;break;case"dragenter":case"dragleave":fg=null;break;case"mouseover":case"mouseout":pg=null;break;case"pointerover":case"pointerout":Qv.delete(w.pointerId);break;case"gotpointercapture":case"lostpointercapture":fw.delete(w.pointerId)}}function y_(v,w,T,F,V,U){return v===null||v.nativeEvent!==U?(v={blockedOn:w,domEventName:T,eventSystemFlags:F,nativeEvent:U,targetContainers:[V]},w!==null&&(w=el(w),w!==null&&bk(w)),v):(v.eventSystemFlags|=F,w=v.targetContainers,V!==null&&w.indexOf(V)===-1&&w.push(V),v)}function JV(v,w,T,F,V){switch(w){case"focusin":return hg=y_(hg,v,w,T,F,V),!0;case"dragenter":return fg=y_(fg,v,w,T,F,V),!0;case"mouseover":return pg=y_(pg,v,w,T,F,V),!0;case"pointerover":var U=V.pointerId;return Qv.set(U,y_(Qv.get(U)||null,v,w,T,F,V)),!0;case"gotpointercapture":return U=V.pointerId,fw.set(U,y_(fw.get(U)||null,v,w,T,F,V)),!0}return!1}function G4(v){var w=Rh(v.target);if(w!==null){var T=ma(w);if(T!==null){if(w=T.tag,w===13){if(w=yn(T),w!==null){v.blockedOn=w,fT(v.priority,function(){q4(T)});return}}else if(w===3&&T.stateNode.current.memoizedState.isDehydrated){v.blockedOn=T.tag===3?T.stateNode.containerInfo:null;return}}}v.blockedOn=null}function wk(v){if(v.blockedOn!==null)return!1;for(var w=v.targetContainers;0<w.length;){var T=xk(v.domEventName,v.eventSystemFlags,w[0],v.nativeEvent);if(T===null){T=v.nativeEvent;var F=new T.constructor(T.type,T);Fn=F,T.target.dispatchEvent(F),Fn=null}else return w=el(T),w!==null&&bk(w),v.blockedOn=T,!1;w.shift()}return!0}function X4(v,w,T){wk(v)&&T.delete(w)}function eH(){yk=!1,hg!==null&&wk(hg)&&(hg=null),fg!==null&&wk(fg)&&(fg=null),pg!==null&&wk(pg)&&(pg=null),Qv.forEach(X4),fw.forEach(X4)}function jr(v,w){v.blockedOn===w&&(v.blockedOn=null,yk||(yk=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,eH)))}function Mr(v){function w(V){return jr(V,v)}if(0<hw.length){jr(hw[0],v);for(var T=1;T<hw.length;T++){var F=hw[T];F.blockedOn===v&&(F.blockedOn=null)}}for(hg!==null&&jr(hg,v),fg!==null&&jr(fg,v),pg!==null&&jr(pg,v),Qv.forEach(w),fw.forEach(w),T=0;T<gg.length;T++)F=gg[T],F.blockedOn===v&&(F.blockedOn=null);for(;0<gg.length&&(T=gg[0],T.blockedOn===null);)G4(T),T.blockedOn===null&&gg.shift()}var Jv=k.ReactCurrentBatchConfig,Ck=!0;function tH(v,w,T,F){var V=Tr,U=Jv.transition;Jv.transition=null;try{Tr=1,pT(v,w,T,F)}finally{Tr=V,Jv.transition=U}}function nH(v,w,T,F){var V=Tr,U=Jv.transition;Jv.transition=null;try{Tr=4,pT(v,w,T,F)}finally{Tr=V,Jv.transition=U}}function pT(v,w,T,F){if(Ck){var V=xk(v,w,T,F);if(V===null)RT(v,w,F,Sk,T),K4(v,F);else if(JV(V,v,w,T,F))F.stopPropagation();else if(K4(v,F),w&4&&-1<QV.indexOf(v)){for(;V!==null;){var U=el(V);if(U!==null&&dT(U),U=xk(v,w,T,F),U===null&&RT(v,w,F,Sk,T),U===V)break;V=U}V!==null&&F.stopPropagation()}else RT(v,w,F,null,T)}}var Sk=null;function xk(v,w,T,F){if(Sk=null,v=tn(F),v=Rh(v),v!==null)if(w=ma(v),w===null)v=null;else if(T=w.tag,T===13){if(v=yn(w),v!==null)return v;v=null}else if(T===3){if(w.stateNode.current.memoizedState.isDehydrated)return w.tag===3?w.stateNode.containerInfo:null;v=null}else w!==v&&(v=null);return Sk=v,null}function Y4(v){switch(v){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(dg()){case Xv:return 1;case lw:return 4;case Dh:case m_:return 16;case Yi:return 536870912;default:return 16}default:return 16}}var Fs=null,pw=null,Eh=null;function gT(){if(Eh)return Eh;var v,w=pw,T=w.length,F,V="value"in Fs?Fs.value:Fs.textContent,U=V.length;for(v=0;v<T&&w[v]===V[v];v++);var re=T-v;for(F=1;F<=re&&w[T-F]===V[U-F];F++);return Eh=V.slice(v,1<F?1-F:void 0)}function eb(v){var w=v.keyCode;return"charCode"in v?(v=v.charCode,v===0&&w===13&&(v=13)):v=w,v===10&&(v=13),32<=v||v===13?v:0}function wl(){return!0}function mT(){return!1}function Zl(v){function w(T,F,V,U,re){this._reactName=T,this._targetInst=V,this.type=F,this.nativeEvent=U,this.target=re,this.currentTarget=null;for(var be in v)v.hasOwnProperty(be)&&(T=v[be],this[be]=T?T(U):U[be]);return this.isDefaultPrevented=(U.defaultPrevented!=null?U.defaultPrevented:U.returnValue===!1)?wl:mT,this.isPropagationStopped=mT,this}return ie(w.prototype,{preventDefault:function(){this.defaultPrevented=!0;var T=this.nativeEvent;T&&(T.preventDefault?T.preventDefault():typeof T.returnValue!="unknown"&&(T.returnValue=!1),this.isDefaultPrevented=wl)},stopPropagation:function(){var T=this.nativeEvent;T&&(T.stopPropagation?T.stopPropagation():typeof T.cancelBubble!="unknown"&&(T.cancelBubble=!0),this.isPropagationStopped=wl)},persist:function(){},isPersistent:wl}),w}var w_={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(v){return v.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kk=Zl(w_),tb=ie({},w_,{view:0,detail:0}),Z4=Zl(tb),Cl,_T,Qa,Lk=ie({},tb,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:CT,button:0,buttons:0,relatedTarget:function(v){return v.relatedTarget===void 0?v.fromElement===v.srcElement?v.toElement:v.fromElement:v.relatedTarget},movementX:function(v){return"movementX"in v?v.movementX:(v!==Qa&&(Qa&&v.type==="mousemove"?(Cl=v.screenX-Qa.screenX,_T=v.screenY-Qa.screenY):_T=Cl=0,Qa=v),Cl)},movementY:function(v){return"movementY"in v?v.movementY:_T}}),vT=Zl(Lk),mg=ie({},Lk,{dataTransfer:0}),Dk=Zl(mg),bT=ie({},tb,{relatedTarget:0}),hs=Zl(bT),_g=ie({},w_,{animationName:0,elapsedTime:0,pseudoElement:0}),yT=Zl(_g),iH=ie({},w_,{clipboardData:function(v){return"clipboardData"in v?v.clipboardData:window.clipboardData}}),wT=Zl(iH),rH=ie({},w_,{data:0}),Q4=Zl(rH),sH={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J4={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"},Ek={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nb(v){var w=this.nativeEvent;return w.getModifierState?w.getModifierState(v):(v=Ek[v])?!!w[v]:!1}function CT(){return nb}var eF=ie({},tb,{key:function(v){if(v.key){var w=sH[v.key]||v.key;if(w!=="Unidentified")return w}return v.type==="keypress"?(v=eb(v),v===13?"Enter":String.fromCharCode(v)):v.type==="keydown"||v.type==="keyup"?J4[v.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:CT,charCode:function(v){return v.type==="keypress"?eb(v):0},keyCode:function(v){return v.type==="keydown"||v.type==="keyup"?v.keyCode:0},which:function(v){return v.type==="keypress"?eb(v):v.type==="keydown"||v.type==="keyup"?v.keyCode:0}}),tF=Zl(eF),ST=ie({},Lk,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ik=Zl(ST),nF=ie({},tb,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:CT}),oH=Zl(nF),xT=ie({},w_,{propertyName:0,elapsedTime:0,pseudoElement:0}),kT=Zl(xT),aH=ie({},Lk,{deltaX:function(v){return"deltaX"in v?v.deltaX:"wheelDeltaX"in v?-v.wheelDeltaX:0},deltaY:function(v){return"deltaY"in v?v.deltaY:"wheelDeltaY"in v?-v.wheelDeltaY:"wheelDelta"in v?-v.wheelDelta:0},deltaZ:0,deltaMode:0}),iF=Zl(aH),Tc=[9,13,27,32],gw=l&&"CompositionEvent"in window,zf=null;l&&"documentMode"in document&&(zf=document.documentMode);var rF=l&&"TextEvent"in window&&!zf,LT=l&&(!gw||zf&&8<zf&&11>=zf),sF=" ",oF=!1;function aF(v,w){switch(v){case"keyup":return Tc.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lF(v){return v=v.detail,typeof v=="object"&&"data"in v?v.data:null}var ib=!1;function rb(v,w){switch(v){case"compositionend":return lF(w);case"keypress":return w.which!==32?null:(oF=!0,sF);case"textInput":return v=w.data,v===sF&&oF?null:v;default:return null}}function lH(v,w){if(ib)return v==="compositionend"||!gw&&aF(v,w)?(v=gT(),Eh=pw=Fs=null,ib=!1,v):null;switch(v){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1<w.char.length)return w.char;if(w.which)return String.fromCharCode(w.which)}return null;case"compositionend":return LT&&w.locale!=="ko"?null:w.data;default:return null}}var cH={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 Tk(v){var w=v&&v.nodeName&&v.nodeName.toLowerCase();return w==="input"?!!cH[v.type]:w==="textarea"}function DT(v,w,T,F){ds(F),w=jk(w,"onChange"),0<w.length&&(T=new kk("onChange","change",null,T,F),v.push({event:T,listeners:w}))}var vu=null,vg=null;function uH(v){gF(v,0)}function Rk(v){var w=Ii(v);if(ut(w))return v}function dH(v,w){if(v==="change")return w}var C_=!1;if(l){var Rc;if(l){var Ak="oninput"in document;if(!Ak){var cF=document.createElement("div");cF.setAttribute("oninput","return;"),Ak=typeof cF.oninput=="function"}Rc=Ak}else Rc=!1;C_=Rc&&(!document.documentMode||9<document.documentMode)}function uF(){vu&&(vu.detachEvent("onpropertychange",dF),vg=vu=null)}function dF(v){if(v.propertyName==="value"&&Rk(vg)){var w=[];DT(w,vg,v,tn(v)),rn(uH,w)}}function hH(v,w,T){v==="focusin"?(uF(),vu=w,vg=T,vu.attachEvent("onpropertychange",dF)):v==="focusout"&&uF()}function fH(v){if(v==="selectionchange"||v==="keyup"||v==="keydown")return Rk(vg)}function sb(v,w){if(v==="click")return Rk(w)}function Fe(v,w){if(v==="input"||v==="change")return Rk(w)}function ft(v,w){return v===w&&(v!==0||1/v===1/w)||v!==v&&w!==w}var Qe=typeof Object.is=="function"?Object.is:ft;function fn(v,w){if(Qe(v,w))return!0;if(typeof v!="object"||v===null||typeof w!="object"||w===null)return!1;var T=Object.keys(v),F=Object.keys(w);if(T.length!==F.length)return!1;for(F=0;F<T.length;F++){var V=T[F];if(!c.call(w,V)||!Qe(v[V],w[V]))return!1}return!0}function vi(v){for(;v&&v.firstChild;)v=v.firstChild;return v}function Cr(v,w){var T=vi(v);v=0;for(var F;T;){if(T.nodeType===3){if(F=v+T.textContent.length,v<=w&&F>=w)return{node:T,offset:w-v};v=F}e:{for(;T;){if(T.nextSibling){T=T.nextSibling;break e}T=T.parentNode}T=void 0}T=vi(T)}}function Eo(v,w){return v&&w?v===w?!0:v&&v.nodeType===3?!1:w&&w.nodeType===3?Eo(v,w.parentNode):"contains"in v?v.contains(w):v.compareDocumentPosition?!!(v.compareDocumentPosition(w)&16):!1:!1}function Gr(){for(var v=window,w=st();w instanceof v.HTMLIFrameElement;){try{var T=typeof w.contentWindow.location.href=="string"}catch{T=!1}if(T)v=w.contentWindow;else break;w=st(v.document)}return w}function mw(v){var w=v&&v.nodeName&&v.nodeName.toLowerCase();return w&&(w==="input"&&(v.type==="text"||v.type==="search"||v.type==="tel"||v.type==="url"||v.type==="password")||w==="textarea"||v.contentEditable==="true")}function pH(v){var w=Gr(),T=v.focusedElem,F=v.selectionRange;if(w!==T&&T&&T.ownerDocument&&Eo(T.ownerDocument.documentElement,T)){if(F!==null&&mw(T)){if(w=F.start,v=F.end,v===void 0&&(v=w),"selectionStart"in T)T.selectionStart=w,T.selectionEnd=Math.min(v,T.value.length);else if(v=(w=T.ownerDocument||document)&&w.defaultView||window,v.getSelection){v=v.getSelection();var V=T.textContent.length,U=Math.min(F.start,V);F=F.end===void 0?U:Math.min(F.end,V),!v.extend&&U>F&&(V=F,F=U,U=V),V=Cr(T,U);var re=Cr(T,F);V&&re&&(v.rangeCount!==1||v.anchorNode!==V.node||v.anchorOffset!==V.offset||v.focusNode!==re.node||v.focusOffset!==re.offset)&&(w=w.createRange(),w.setStart(V.node,V.offset),v.removeAllRanges(),U>F?(v.addRange(w),v.extend(re.node,re.offset)):(w.setEnd(re.node,re.offset),v.addRange(w)))}}for(w=[],v=T;v=v.parentNode;)v.nodeType===1&&w.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<w.length;T++)v=w[T],v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}var bu=l&&"documentMode"in document&&11>=document.documentMode,Vf=null,ET=null,Ih=null,ob=!1;function _w(v,w,T){var F=T.window===T?T.document:T.nodeType===9?T:T.ownerDocument;ob||Vf==null||Vf!==st(F)||(F=Vf,"selectionStart"in F&&mw(F)?F={start:F.selectionStart,end:F.selectionEnd}:(F=(F.ownerDocument&&F.ownerDocument.defaultView||window).getSelection(),F={anchorNode:F.anchorNode,anchorOffset:F.anchorOffset,focusNode:F.focusNode,focusOffset:F.focusOffset}),Ih&&fn(Ih,F)||(Ih=F,F=jk(ET,"onSelect"),0<F.length&&(w=new kk("onSelect","select",null,w,T),v.push({event:w,listeners:F}),w.target=Vf)))}function Sr(v,w){var T={};return T[v.toLowerCase()]=w.toLowerCase(),T["Webkit"+v]="webkit"+w,T["Moz"+v]="moz"+w,T}var ab={animationend:Sr("Animation","AnimationEnd"),animationiteration:Sr("Animation","AnimationIteration"),animationstart:Sr("Animation","AnimationStart"),transitionend:Sr("Transition","TransitionEnd")},Nk={},vw={};l&&(vw=document.createElement("div").style,"AnimationEvent"in window||(delete ab.animationend.animation,delete ab.animationiteration.animation,delete ab.animationstart.animation),"TransitionEvent"in window||delete ab.transitionend.transition);function Mk(v){if(Nk[v])return Nk[v];if(!ab[v])return v;var w=ab[v],T;for(T in w)if(w.hasOwnProperty(T)&&T in vw)return Nk[v]=w[T];return v}var hF=Mk("animationend"),fF=Mk("animationiteration"),bw=Mk("animationstart"),Hf=Mk("transitionend"),yw=new Map,IT="abort auxClick 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(" ");function Sd(v,w){yw.set(v,w),o(w,[v])}for(var Pk=0;Pk<IT.length;Pk++){var Ok=IT[Pk],Fk=Ok.toLowerCase(),pF=Ok[0].toUpperCase()+Ok.slice(1);Sd(Fk,"on"+pF)}Sd(hF,"onAnimationEnd"),Sd(fF,"onAnimationIteration"),Sd(bw,"onAnimationStart"),Sd("dblclick","onDoubleClick"),Sd("focusin","onFocus"),Sd("focusout","onBlur"),Sd(Hf,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uf="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(" "),S_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Uf));function ww(v,w,T){var F=v.type||"unknown-event";v.currentTarget=T,Ks(F,w,void 0,v),v.currentTarget=null}function gF(v,w){w=(w&4)!==0;for(var T=0;T<v.length;T++){var F=v[T],V=F.event;F=F.listeners;e:{var U=void 0;if(w)for(var re=F.length-1;0<=re;re--){var be=F[re],Re=be.instance,et=be.currentTarget;if(be=be.listener,Re!==U&&V.isPropagationStopped())break e;ww(V,be,et),U=Re}else for(re=0;re<F.length;re++){if(be=F[re],Re=be.instance,et=be.currentTarget,be=be.listener,Re!==U&&V.isPropagationStopped())break e;ww(V,be,et),U=Re}}}if(Cs)throw v=_u,Cs=!1,_u=null,v}function Ss(v,w){var T=w[zk];T===void 0&&(T=w[zk]=new Set);var F=v+"__bubble";T.has(F)||(Bk(w,v,2,!1),T.add(F))}function TT(v,w,T){var F=0;w&&(F|=4),Bk(T,v,F,w)}var x_="_reactListening"+Math.random().toString(36).slice(2);function bg(v){if(!v[x_]){v[x_]=!0,r.forEach(function(T){T!=="selectionchange"&&(S_.has(T)||TT(T,!1,v),TT(T,!0,v))});var w=v.nodeType===9?v:v.ownerDocument;w===null||w[x_]||(w[x_]=!0,TT("selectionchange",!1,w))}}function Bk(v,w,T,F){switch(Y4(w)){case 1:var V=tH;break;case 4:V=nH;break;default:V=pT}T=V.bind(null,w,T,v),V=void 0,!Kn||w!=="touchstart"&&w!=="touchmove"&&w!=="wheel"||(V=!0),F?V!==void 0?v.addEventListener(w,T,{capture:!0,passive:V}):v.addEventListener(w,T,!0):V!==void 0?v.addEventListener(w,T,{passive:V}):v.addEventListener(w,T,!1)}function RT(v,w,T,F,V){var U=F;if((w&1)===0&&(w&2)===0&&F!==null)e:for(;;){if(F===null)return;var re=F.tag;if(re===3||re===4){var be=F.stateNode.containerInfo;if(be===V||be.nodeType===8&&be.parentNode===V)break;if(re===4)for(re=F.return;re!==null;){var Re=re.tag;if((Re===3||Re===4)&&(Re=re.stateNode.containerInfo,Re===V||Re.nodeType===8&&Re.parentNode===V))return;re=re.return}for(;be!==null;){if(re=Rh(be),re===null)return;if(Re=re.tag,Re===5||Re===6){F=U=re;continue e}be=be.parentNode}}F=F.return}rn(function(){var et=U,It=tn(T),Nt=[];e:{var Lt=yw.get(v);if(Lt!==void 0){var pn=kk,Cn=v;switch(v){case"keypress":if(eb(T)===0)break e;case"keydown":case"keyup":pn=tF;break;case"focusin":Cn="focus",pn=hs;break;case"focusout":Cn="blur",pn=hs;break;case"beforeblur":case"afterblur":pn=hs;break;case"click":if(T.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pn=vT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pn=Dk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pn=oH;break;case hF:case fF:case bw:pn=yT;break;case Hf:pn=kT;break;case"scroll":pn=Z4;break;case"wheel":pn=iF;break;case"copy":case"cut":case"paste":pn=wT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pn=Ik}var Dn=(w&4)!==0,bo=!Dn&&v==="scroll",Ke=Dn?Lt!==null?Lt+"Capture":null:Lt;Dn=[];for(var Me=et,Ge;Me!==null;){Ge=Me;var Wt=Ge.stateNode;if(Ge.tag===5&&Wt!==null&&(Ge=Wt,Ke!==null&&(Wt=sn(Me,Ke),Wt!=null&&Dn.push(lb(Me,Wt,Ge)))),bo)break;Me=Me.return}0<Dn.length&&(Lt=new pn(Lt,Cn,null,T,It),Nt.push({event:Lt,listeners:Dn}))}}if((w&7)===0){e:{if(Lt=v==="mouseover"||v==="pointerover",pn=v==="mouseout"||v==="pointerout",Lt&&T!==Fn&&(Cn=T.relatedTarget||T.fromElement)&&(Rh(Cn)||Cn[Ac]))break e;if((pn||Lt)&&(Lt=It.window===It?It:(Lt=It.ownerDocument)?Lt.defaultView||Lt.parentWindow:window,pn?(Cn=T.relatedTarget||T.toElement,pn=et,Cn=Cn?Rh(Cn):null,Cn!==null&&(bo=ma(Cn),Cn!==bo||Cn.tag!==5&&Cn.tag!==6)&&(Cn=null)):(pn=null,Cn=et),pn!==Cn)){if(Dn=vT,Wt="onMouseLeave",Ke="onMouseEnter",Me="mouse",(v==="pointerout"||v==="pointerover")&&(Dn=Ik,Wt="onPointerLeave",Ke="onPointerEnter",Me="pointer"),bo=pn==null?Lt:Ii(pn),Ge=Cn==null?Lt:Ii(Cn),Lt=new Dn(Wt,Me+"leave",pn,T,It),Lt.target=bo,Lt.relatedTarget=Ge,Wt=null,Rh(It)===et&&(Dn=new Dn(Ke,Me+"enter",Cn,T,It),Dn.target=Ge,Dn.relatedTarget=bo,Wt=Dn),bo=Wt,pn&&Cn)t:{for(Dn=pn,Ke=Cn,Me=0,Ge=Dn;Ge;Ge=cb(Ge))Me++;for(Ge=0,Wt=Ke;Wt;Wt=cb(Wt))Ge++;for(;0<Me-Ge;)Dn=cb(Dn),Me--;for(;0<Ge-Me;)Ke=cb(Ke),Ge--;for(;Me--;){if(Dn===Ke||Ke!==null&&Dn===Ke.alternate)break t;Dn=cb(Dn),Ke=cb(Ke)}Dn=null}else Dn=null;pn!==null&&Io(Nt,Lt,pn,Dn,!1),Cn!==null&&bo!==null&&Io(Nt,bo,Cn,Dn,!0)}}e:{if(Lt=et?Ii(et):window,pn=Lt.nodeName&&Lt.nodeName.toLowerCase(),pn==="select"||pn==="input"&&Lt.type==="file")var In=dH;else if(Tk(Lt))if(C_)In=Fe;else{In=fH;var Gn=hH}else(pn=Lt.nodeName)&&pn.toLowerCase()==="input"&&(Lt.type==="checkbox"||Lt.type==="radio")&&(In=sb);if(In&&(In=In(v,et))){DT(Nt,In,T,It);break e}Gn&&Gn(v,Lt,et),v==="focusout"&&(Gn=Lt._wrapperState)&&Gn.controlled&&Lt.type==="number"&&wn(Lt,"number",Lt.value)}switch(Gn=et?Ii(et):window,v){case"focusin":(Tk(Gn)||Gn.contentEditable==="true")&&(Vf=Gn,ET=et,Ih=null);break;case"focusout":Ih=ET=Vf=null;break;case"mousedown":ob=!0;break;case"contextmenu":case"mouseup":case"dragend":ob=!1,_w(Nt,T,It);break;case"selectionchange":if(bu)break;case"keydown":case"keyup":_w(Nt,T,It)}var zn;if(gw)e:{switch(v){case"compositionstart":var ci="onCompositionStart";break e;case"compositionend":ci="onCompositionEnd";break e;case"compositionupdate":ci="onCompositionUpdate";break e}ci=void 0}else ib?aF(v,T)&&(ci="onCompositionEnd"):v==="keydown"&&T.keyCode===229&&(ci="onCompositionStart");ci&&(LT&&T.locale!=="ko"&&(ib||ci!=="onCompositionStart"?ci==="onCompositionEnd"&&ib&&(zn=gT()):(Fs=It,pw="value"in Fs?Fs.value:Fs.textContent,ib=!0)),Gn=jk(et,ci),0<Gn.length&&(ci=new Q4(ci,v,null,T,It),Nt.push({event:ci,listeners:Gn}),zn?ci.data=zn:(zn=lF(T),zn!==null&&(ci.data=zn)))),(zn=rF?rb(v,T):lH(v,T))&&(et=jk(et,"onBeforeInput"),0<et.length&&(It=new Q4("onBeforeInput","beforeinput",null,T,It),Nt.push({event:It,listeners:et}),It.data=zn))}gF(Nt,w)})}function lb(v,w,T){return{instance:v,listener:w,currentTarget:T}}function jk(v,w){for(var T=w+"Capture",F=[];v!==null;){var V=v,U=V.stateNode;V.tag===5&&U!==null&&(V=U,U=sn(v,T),U!=null&&F.unshift(lb(v,U,V)),U=sn(v,w),U!=null&&F.push(lb(v,U,V))),v=v.return}return F}function cb(v){if(v===null)return null;do v=v.return;while(v&&v.tag!==5);return v||null}function Io(v,w,T,F,V){for(var U=w._reactName,re=[];T!==null&&T!==F;){var be=T,Re=be.alternate,et=be.stateNode;if(Re!==null&&Re===F)break;be.tag===5&&et!==null&&(be=et,V?(Re=sn(T,U),Re!=null&&re.unshift(lb(T,Re,be))):V||(Re=sn(T,U),Re!=null&&re.push(lb(T,Re,be)))),T=T.return}re.length!==0&&v.push({event:w,listeners:re})}var Ja=/\r\n?/g,gH=/\u0000|\uFFFD/g;function mF(v){return(typeof v=="string"?v:""+v).replace(Ja,`
`).replace(gH,"")}function Cw(v,w,T){if(w=mF(w),mF(v)!==w&&T)throw Error(n(425))}function Wk(){}var Sw=null,k_=null;function xw(v,w){return v==="textarea"||v==="noscript"||typeof w.children=="string"||typeof w.children=="number"||typeof w.dangerouslySetInnerHTML=="object"&&w.dangerouslySetInnerHTML!==null&&w.dangerouslySetInnerHTML.__html!=null}var yg=typeof setTimeout=="function"?setTimeout:void 0,kw=typeof clearTimeout=="function"?clearTimeout:void 0,ub=typeof Promise=="function"?Promise:void 0,$k=typeof queueMicrotask=="function"?queueMicrotask:typeof ub<"u"?function(v){return ub.resolve(null).then(v).catch(db)}:yg;function db(v){setTimeout(function(){throw v})}function AT(v,w){var T=w,F=0;do{var V=T.nextSibling;if(v.removeChild(T),V&&V.nodeType===8)if(T=V.data,T==="/$"){if(F===0){v.removeChild(V),Mr(w);return}F--}else T!=="$"&&T!=="$?"&&T!=="$!"||F++;T=V}while(T);Mr(w)}function wg(v){for(;v!=null;v=v.nextSibling){var w=v.nodeType;if(w===1||w===3)break;if(w===8){if(w=v.data,w==="$"||w==="$!"||w==="$?")break;if(w==="/$")return null}}return v}function _F(v){v=v.previousSibling;for(var w=0;v;){if(v.nodeType===8){var T=v.data;if(T==="$"||T==="$!"||T==="$?"){if(w===0)return v;w--}else T==="/$"&&w++}v=v.previousSibling}return null}var hb=Math.random().toString(36).slice(2),Th="__reactFiber$"+hb,Cg="__reactProps$"+hb,Ac="__reactContainer$"+hb,zk="__reactEvents$"+hb,he="__reactListeners$"+hb,fb="__reactHandles$"+hb;function Rh(v){var w=v[Th];if(w)return w;for(var T=v.parentNode;T;){if(w=T[Ac]||T[Th]){if(T=w.alternate,w.child!==null||T!==null&&T.child!==null)for(v=_F(v);v!==null;){if(T=v[Th])return T;v=_F(v)}return w}v=T,T=v.parentNode}return null}function el(v){return v=v[Th]||v[Ac],!v||v.tag!==5&&v.tag!==6&&v.tag!==13&&v.tag!==3?null:v}function Ii(v){if(v.tag===5||v.tag===6)return v.stateNode;throw Error(n(33))}function Vk(v){return v[Cg]||null}var NT=[],pb=-1;function Ql(v){return{current:v}}function xs(v){0>pb||(v.current=NT[pb],NT[pb]=null,pb--)}function fs(v,w){pb++,NT[pb]=v.current,v.current=w}var Sg={},tl=Ql(Sg),Jl=Ql(!1),Sl=Sg;function gb(v,w){var T=v.type.contextTypes;if(!T)return Sg;var F=v.stateNode;if(F&&F.__reactInternalMemoizedUnmaskedChildContext===w)return F.__reactInternalMemoizedMaskedChildContext;var V={},U;for(U in T)V[U]=w[U];return F&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=w,v.__reactInternalMemoizedMaskedChildContext=V),V}function ec(v){return v=v.childContextTypes,v!=null}function Hk(){xs(Jl),xs(tl)}function vF(v,w,T){if(tl.current!==Sg)throw Error(n(168));fs(tl,w),fs(Jl,T)}function bF(v,w,T){var F=v.stateNode;if(w=w.childContextTypes,typeof F.getChildContext!="function")return T;F=F.getChildContext();for(var V in F)if(!(V in w))throw Error(n(108,Ee(v)||"Unknown",V));return ie({},T,F)}function yu(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||Sg,Sl=tl.current,fs(tl,v),fs(Jl,Jl.current),!0}function yF(v,w,T){var F=v.stateNode;if(!F)throw Error(n(169));T?(v=bF(v,w,Sl),F.__reactInternalMemoizedMergedChildContext=v,xs(Jl),xs(tl),fs(tl,v)):xs(Jl),fs(Jl,T)}var qf=null,Uk=!1,MT=!1;function wF(v){qf===null?qf=[v]:qf.push(v)}function L_(v){Uk=!0,wF(v)}function xg(){if(!MT&&qf!==null){MT=!0;var v=0,w=Tr;try{var T=qf;for(Tr=1;v<T.length;v++){var F=T[v];do F=F(!0);while(F!==null)}qf=null,Uk=!1}catch(V){throw qf!==null&&(qf=qf.slice(v+1)),En(Xv,xg),V}finally{Tr=w,MT=!1}}return null}var mb=[],nl=0,qk=null,Kk=0,wu=[],Cu=0,D_=null,Ah=1,Nh="";function E_(v,w){mb[nl++]=Kk,mb[nl++]=qk,qk=v,Kk=w}function CF(v,w,T){wu[Cu++]=Ah,wu[Cu++]=Nh,wu[Cu++]=D_,D_=v;var F=Ah;v=Nh;var V=32-Cd(F)-1;F&=~(1<<V),T+=1;var U=32-Cd(w)+V;if(30<U){var re=V-V%5;U=(F&(1<<re)-1).toString(32),F>>=re,V-=re,Ah=1<<32-Cd(w)+V|T<<V|F,Nh=U+v}else Ah=1<<U|T<<V|F,Nh=v}function Lw(v){v.return!==null&&(E_(v,1),CF(v,1,0))}function I_(v){for(;v===qk;)qk=mb[--nl],mb[nl]=null,Kk=mb[--nl],mb[nl]=null;for(;v===D_;)D_=wu[--Cu],wu[Cu]=null,Nh=wu[--Cu],wu[Cu]=null,Ah=wu[--Cu],wu[Cu]=null}var il=null,Nc=null,ks=!1,xd=null;function Mh(v,w){var T=Iu(5,null,null,0);T.elementType="DELETED",T.stateNode=w,T.return=v,w=v.deletions,w===null?(v.deletions=[T],v.flags|=16):w.push(T)}function Gk(v,w){switch(v.tag){case 5:var T=v.type;return w=w.nodeType!==1||T.toLowerCase()!==w.nodeName.toLowerCase()?null:w,w!==null?(v.stateNode=w,il=v,Nc=wg(w.firstChild),!0):!1;case 6:return w=v.pendingProps===""||w.nodeType!==3?null:w,w!==null?(v.stateNode=w,il=v,Nc=null,!0):!1;case 13:return w=w.nodeType!==8?null:w,w!==null?(T=D_!==null?{id:Ah,overflow:Nh}:null,v.memoizedState={dehydrated:w,treeContext:T,retryLane:1073741824},T=Iu(18,null,null,0),T.stateNode=w,T.return=v,v.child=T,il=v,Nc=null,!0):!1;default:return!1}}function Kf(v){return(v.mode&1)!==0&&(v.flags&128)===0}function tc(v){if(ks){var w=Nc;if(w){var T=w;if(!Gk(v,w)){if(Kf(v))throw Error(n(418));w=wg(T.nextSibling);var F=il;w&&Gk(v,w)?Mh(F,T):(v.flags=v.flags&-4097|2,ks=!1,il=v)}}else{if(Kf(v))throw Error(n(418));v.flags=v.flags&-4097|2,ks=!1,il=v}}}function SF(v){for(v=v.return;v!==null&&v.tag!==5&&v.tag!==3&&v.tag!==13;)v=v.return;il=v}function Dw(v){if(v!==il)return!1;if(!ks)return SF(v),ks=!0,!1;var w;if((w=v.tag!==3)&&!(w=v.tag!==5)&&(w=v.type,w=w!=="head"&&w!=="body"&&!xw(v.type,v.memoizedProps)),w&&(w=Nc)){if(Kf(v))throw PT(),Error(n(418));for(;w;)Mh(v,w),w=wg(w.nextSibling)}if(SF(v),v.tag===13){if(v=v.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(n(317));e:{for(v=v.nextSibling,w=0;v;){if(v.nodeType===8){var T=v.data;if(T==="/$"){if(w===0){Nc=wg(v.nextSibling);break e}w--}else T!=="$"&&T!=="$!"&&T!=="$?"||w++}v=v.nextSibling}Nc=null}}else Nc=il?wg(v.stateNode.nextSibling):null;return!0}function PT(){for(var v=Nc;v;)v=wg(v.nextSibling)}function Ph(){Nc=il=null,ks=!1}function Oh(v){xd===null?xd=[v]:xd.push(v)}var xF=k.ReactCurrentBatchConfig;function Ew(v,w,T){if(v=T.ref,v!==null&&typeof v!="function"&&typeof v!="object"){if(T._owner){if(T=T._owner,T){if(T.tag!==1)throw Error(n(309));var F=T.stateNode}if(!F)throw Error(n(147,v));var V=F,U=""+v;return w!==null&&w.ref!==null&&typeof w.ref=="function"&&w.ref._stringRef===U?w.ref:(w=function(re){var be=V.refs;re===null?delete be[U]:be[U]=re},w._stringRef=U,w)}if(typeof v!="string")throw Error(n(284));if(!T._owner)throw Error(n(290,v))}return v}function T_(v,w){throw v=Object.prototype.toString.call(w),Error(n(31,v==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":v))}function kF(v){var w=v._init;return w(v._payload)}function OT(v){function w(Ke,Me){if(v){var Ge=Ke.deletions;Ge===null?(Ke.deletions=[Me],Ke.flags|=16):Ge.push(Me)}}function T(Ke,Me){if(!v)return null;for(;Me!==null;)w(Ke,Me),Me=Me.sibling;return null}function F(Ke,Me){for(Ke=new Map;Me!==null;)Me.key!==null?Ke.set(Me.key,Me):Ke.set(Me.index,Me),Me=Me.sibling;return Ke}function V(Ke,Me){return Ke=Rd(Ke,Me),Ke.index=0,Ke.sibling=null,Ke}function U(Ke,Me,Ge){return Ke.index=Ge,v?(Ge=Ke.alternate,Ge!==null?(Ge=Ge.index,Ge<Me?(Ke.flags|=2,Me):Ge):(Ke.flags|=2,Me)):(Ke.flags|=1048576,Me)}function re(Ke){return v&&Ke.alternate===null&&(Ke.flags|=2),Ke}function be(Ke,Me,Ge,Wt){return Me===null||Me.tag!==6?(Me=CR(Ge,Ke.mode,Wt),Me.return=Ke,Me):(Me=V(Me,Ge),Me.return=Ke,Me)}function Re(Ke,Me,Ge,Wt){var In=Ge.type;return In===E?It(Ke,Me,Ge.props.children,Wt,Ge.key):Me!==null&&(Me.elementType===In||typeof In=="object"&&In!==null&&In.$$typeof===H&&kF(In)===Me.type)?(Wt=V(Me,Ge.props),Wt.ref=Ew(Ke,Me,Ge),Wt.return=Ke,Wt):(Wt=IL(Ge.type,Ge.key,Ge.props,null,Ke.mode,Wt),Wt.ref=Ew(Ke,Me,Ge),Wt.return=Ke,Wt)}function et(Ke,Me,Ge,Wt){return Me===null||Me.tag!==4||Me.stateNode.containerInfo!==Ge.containerInfo||Me.stateNode.implementation!==Ge.implementation?(Me=SR(Ge,Ke.mode,Wt),Me.return=Ke,Me):(Me=V(Me,Ge.children||[]),Me.return=Ke,Me)}function It(Ke,Me,Ge,Wt,In){return Me===null||Me.tag!==7?(Me=$_(Ge,Ke.mode,Wt,In),Me.return=Ke,Me):(Me=V(Me,Ge),Me.return=Ke,Me)}function Nt(Ke,Me,Ge){if(typeof Me=="string"&&Me!==""||typeof Me=="number")return Me=CR(""+Me,Ke.mode,Ge),Me.return=Ke,Me;if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case D:return Ge=IL(Me.type,Me.key,Me.props,null,Ke.mode,Ge),Ge.ref=Ew(Ke,null,Me),Ge.return=Ke,Ge;case R:return Me=SR(Me,Ke.mode,Ge),Me.return=Ke,Me;case H:var Wt=Me._init;return Nt(Ke,Wt(Me._payload),Ge)}if(Ce(Me)||Q(Me))return Me=$_(Me,Ke.mode,Ge,null),Me.return=Ke,Me;T_(Ke,Me)}return null}function Lt(Ke,Me,Ge,Wt){var In=Me!==null?Me.key:null;if(typeof Ge=="string"&&Ge!==""||typeof Ge=="number")return In!==null?null:be(Ke,Me,""+Ge,Wt);if(typeof Ge=="object"&&Ge!==null){switch(Ge.$$typeof){case D:return Ge.key===In?Re(Ke,Me,Ge,Wt):null;case R:return Ge.key===In?et(Ke,Me,Ge,Wt):null;case H:return In=Ge._init,Lt(Ke,Me,In(Ge._payload),Wt)}if(Ce(Ge)||Q(Ge))return In!==null?null:It(Ke,Me,Ge,Wt,null);T_(Ke,Ge)}return null}function pn(Ke,Me,Ge,Wt,In){if(typeof Wt=="string"&&Wt!==""||typeof Wt=="number")return Ke=Ke.get(Ge)||null,be(Me,Ke,""+Wt,In);if(typeof Wt=="object"&&Wt!==null){switch(Wt.$$typeof){case D:return Ke=Ke.get(Wt.key===null?Ge:Wt.key)||null,Re(Me,Ke,Wt,In);case R:return Ke=Ke.get(Wt.key===null?Ge:Wt.key)||null,et(Me,Ke,Wt,In);case H:var Gn=Wt._init;return pn(Ke,Me,Ge,Gn(Wt._payload),In)}if(Ce(Wt)||Q(Wt))return Ke=Ke.get(Ge)||null,It(Me,Ke,Wt,In,null);T_(Me,Wt)}return null}function Cn(Ke,Me,Ge,Wt){for(var In=null,Gn=null,zn=Me,ci=Me=0,ba=null;zn!==null&&ci<Ge.length;ci++){zn.index>ci?(ba=zn,zn=null):ba=zn.sibling;var xr=Lt(Ke,zn,Ge[ci],Wt);if(xr===null){zn===null&&(zn=ba);break}v&&zn&&xr.alternate===null&&w(Ke,zn),Me=U(xr,Me,ci),Gn===null?In=xr:Gn.sibling=xr,Gn=xr,zn=ba}if(ci===Ge.length)return T(Ke,zn),ks&&E_(Ke,ci),In;if(zn===null){for(;ci<Ge.length;ci++)zn=Nt(Ke,Ge[ci],Wt),zn!==null&&(Me=U(zn,Me,ci),Gn===null?In=zn:Gn.sibling=zn,Gn=zn);return ks&&E_(Ke,ci),In}for(zn=F(Ke,zn);ci<Ge.length;ci++)ba=pn(zn,Ke,ci,Ge[ci],Wt),ba!==null&&(v&&ba.alternate!==null&&zn.delete(ba.key===null?ci:ba.key),Me=U(ba,Me,ci),Gn===null?In=ba:Gn.sibling=ba,Gn=ba);return v&&zn.forEach(function(Og){return w(Ke,Og)}),ks&&E_(Ke,ci),In}function Dn(Ke,Me,Ge,Wt){var In=Q(Ge);if(typeof In!="function")throw Error(n(150));if(Ge=In.call(Ge),Ge==null)throw Error(n(151));for(var Gn=In=null,zn=Me,ci=Me=0,ba=null,xr=Ge.next();zn!==null&&!xr.done;ci++,xr=Ge.next()){zn.index>ci?(ba=zn,zn=null):ba=zn.sibling;var Og=Lt(Ke,zn,xr.value,Wt);if(Og===null){zn===null&&(zn=ba);break}v&&zn&&Og.alternate===null&&w(Ke,zn),Me=U(Og,Me,ci),Gn===null?In=Og:Gn.sibling=Og,Gn=Og,zn=ba}if(xr.done)return T(Ke,zn),ks&&E_(Ke,ci),In;if(zn===null){for(;!xr.done;ci++,xr=Ge.next())xr=Nt(Ke,xr.value,Wt),xr!==null&&(Me=U(xr,Me,ci),Gn===null?In=xr:Gn.sibling=xr,Gn=xr);return ks&&E_(Ke,ci),In}for(zn=F(Ke,zn);!xr.done;ci++,xr=Ge.next())xr=pn(zn,Ke,ci,xr.value,Wt),xr!==null&&(v&&xr.alternate!==null&&zn.delete(xr.key===null?ci:xr.key),Me=U(xr,Me,ci),Gn===null?In=xr:Gn.sibling=xr,Gn=xr);return v&&zn.forEach(function(OH){return w(Ke,OH)}),ks&&E_(Ke,ci),In}function bo(Ke,Me,Ge,Wt){if(typeof Ge=="object"&&Ge!==null&&Ge.type===E&&Ge.key===null&&(Ge=Ge.props.children),typeof Ge=="object"&&Ge!==null){switch(Ge.$$typeof){case D:e:{for(var In=Ge.key,Gn=Me;Gn!==null;){if(Gn.key===In){if(In=Ge.type,In===E){if(Gn.tag===7){T(Ke,Gn.sibling),Me=V(Gn,Ge.props.children),Me.return=Ke,Ke=Me;break e}}else if(Gn.elementType===In||typeof In=="object"&&In!==null&&In.$$typeof===H&&kF(In)===Gn.type){T(Ke,Gn.sibling),Me=V(Gn,Ge.props),Me.ref=Ew(Ke,Gn,Ge),Me.return=Ke,Ke=Me;break e}T(Ke,Gn);break}else w(Ke,Gn);Gn=Gn.sibling}Ge.type===E?(Me=$_(Ge.props.children,Ke.mode,Wt,Ge.key),Me.return=Ke,Ke=Me):(Wt=IL(Ge.type,Ge.key,Ge.props,null,Ke.mode,Wt),Wt.ref=Ew(Ke,Me,Ge),Wt.return=Ke,Ke=Wt)}return re(Ke);case R:e:{for(Gn=Ge.key;Me!==null;){if(Me.key===Gn)if(Me.tag===4&&Me.stateNode.containerInfo===Ge.containerInfo&&Me.stateNode.implementation===Ge.implementation){T(Ke,Me.sibling),Me=V(Me,Ge.children||[]),Me.return=Ke,Ke=Me;break e}else{T(Ke,Me);break}else w(Ke,Me);Me=Me.sibling}Me=SR(Ge,Ke.mode,Wt),Me.return=Ke,Ke=Me}return re(Ke);case H:return Gn=Ge._init,bo(Ke,Me,Gn(Ge._payload),Wt)}if(Ce(Ge))return Cn(Ke,Me,Ge,Wt);if(Q(Ge))return Dn(Ke,Me,Ge,Wt);T_(Ke,Ge)}return typeof Ge=="string"&&Ge!==""||typeof Ge=="number"?(Ge=""+Ge,Me!==null&&Me.tag===6?(T(Ke,Me.sibling),Me=V(Me,Ge),Me.return=Ke,Ke=Me):(T(Ke,Me),Me=CR(Ge,Ke.mode,Wt),Me.return=Ke,Ke=Me),re(Ke)):T(Ke,Me)}return bo}var oo=OT(!0),Xk=OT(!1),Iw=Ql(null),Mc=null,kg=null,_b=null;function Gf(){_b=kg=Mc=null}function Yk(v){var w=Iw.current;xs(Iw),v._currentValue=w}function Na(v,w,T){for(;v!==null;){var F=v.alternate;if((v.childLanes&w)!==w?(v.childLanes|=w,F!==null&&(F.childLanes|=w)):F!==null&&(F.childLanes&w)!==w&&(F.childLanes|=w),v===T)break;v=v.return}}function Lg(v,w){Mc=v,_b=kg=null,v=v.dependencies,v!==null&&v.firstContext!==null&&((v.lanes&w)!==0&&(kl=!0),v.firstContext=null)}function Su(v){var w=v._currentValue;if(_b!==v)if(v={context:v,memoizedValue:w,next:null},kg===null){if(Mc===null)throw Error(n(308));kg=v,Mc.dependencies={lanes:0,firstContext:v}}else kg=kg.next=v;return w}var R_=null;function FT(v){R_===null?R_=[v]:R_.push(v)}function Zk(v,w,T,F){var V=w.interleaved;return V===null?(T.next=T,FT(w)):(T.next=V.next,V.next=T),w.interleaved=T,Xf(v,F)}function Xf(v,w){v.lanes|=w;var T=v.alternate;for(T!==null&&(T.lanes|=w),T=v,v=v.return;v!==null;)v.childLanes|=w,T=v.alternate,T!==null&&(T.childLanes|=w),T=v,v=v.return;return T.tag===3?T.stateNode:null}var xu=!1;function Qk(v){v.updateQueue={baseState:v.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function LF(v,w){v=v.updateQueue,w.updateQueue===v&&(w.updateQueue={baseState:v.baseState,firstBaseUpdate:v.firstBaseUpdate,lastBaseUpdate:v.lastBaseUpdate,shared:v.shared,effects:v.effects})}function Yf(v,w){return{eventTime:v,lane:w,tag:0,payload:null,callback:null,next:null}}function ku(v,w,T){var F=v.updateQueue;if(F===null)return null;if(F=F.shared,(pr&2)!==0){var V=F.pending;return V===null?w.next=w:(w.next=V.next,V.next=w),F.pending=w,Xf(v,T)}return V=F.interleaved,V===null?(w.next=w,FT(F)):(w.next=V.next,V.next=w),F.interleaved=w,Xf(v,T)}function Jk(v,w,T){if(w=w.updateQueue,w!==null&&(w=w.shared,(T&4194240)!==0)){var F=w.lanes;F&=v.pendingLanes,T|=F,w.lanes=T,dw(v,T)}}function DF(v,w){var T=v.updateQueue,F=v.alternate;if(F!==null&&(F=F.updateQueue,T===F)){var V=null,U=null;if(T=T.firstBaseUpdate,T!==null){do{var re={eventTime:T.eventTime,lane:T.lane,tag:T.tag,payload:T.payload,callback:T.callback,next:null};U===null?V=U=re:U=U.next=re,T=T.next}while(T!==null);U===null?V=U=w:U=U.next=w}else V=U=w;T={baseState:F.baseState,firstBaseUpdate:V,lastBaseUpdate:U,shared:F.shared,effects:F.effects},v.updateQueue=T;return}v=T.lastBaseUpdate,v===null?T.firstBaseUpdate=w:v.next=w,T.lastBaseUpdate=w}function vb(v,w,T,F){var V=v.updateQueue;xu=!1;var U=V.firstBaseUpdate,re=V.lastBaseUpdate,be=V.shared.pending;if(be!==null){V.shared.pending=null;var Re=be,et=Re.next;Re.next=null,re===null?U=et:re.next=et,re=Re;var It=v.alternate;It!==null&&(It=It.updateQueue,be=It.lastBaseUpdate,be!==re&&(be===null?It.firstBaseUpdate=et:be.next=et,It.lastBaseUpdate=Re))}if(U!==null){var Nt=V.baseState;re=0,It=et=Re=null,be=U;do{var Lt=be.lane,pn=be.eventTime;if((F&Lt)===Lt){It!==null&&(It=It.next={eventTime:pn,lane:0,tag:be.tag,payload:be.payload,callback:be.callback,next:null});e:{var Cn=v,Dn=be;switch(Lt=w,pn=T,Dn.tag){case 1:if(Cn=Dn.payload,typeof Cn=="function"){Nt=Cn.call(pn,Nt,Lt);break e}Nt=Cn;break e;case 3:Cn.flags=Cn.flags&-65537|128;case 0:if(Cn=Dn.payload,Lt=typeof Cn=="function"?Cn.call(pn,Nt,Lt):Cn,Lt==null)break e;Nt=ie({},Nt,Lt);break e;case 2:xu=!0}}be.callback!==null&&be.lane!==0&&(v.flags|=64,Lt=V.effects,Lt===null?V.effects=[be]:Lt.push(be))}else pn={eventTime:pn,lane:Lt,tag:be.tag,payload:be.payload,callback:be.callback,next:null},It===null?(et=It=pn,Re=Nt):It=It.next=pn,re|=Lt;if(be=be.next,be===null){if(be=V.shared.pending,be===null)break;Lt=be,be=Lt.next,Lt.next=null,V.lastBaseUpdate=Lt,V.shared.pending=null}}while(!0);if(It===null&&(Re=Nt),V.baseState=Re,V.firstBaseUpdate=et,V.lastBaseUpdate=It,w=V.shared.interleaved,w!==null){V=w;do re|=V.lane,V=V.next;while(V!==w)}else U===null&&(V.shared.lanes=0);Rg|=re,v.lanes=re,v.memoizedState=Nt}}function BT(v,w,T){if(v=w.effects,w.effects=null,v!==null)for(w=0;w<v.length;w++){var F=v[w],V=F.callback;if(V!==null){if(F.callback=null,F=T,typeof V!="function")throw Error(n(191,V));V.call(F)}}}var Tw={},Fh=Ql(Tw),Rw=Ql(Tw),bb=Ql(Tw);function Zf(v){if(v===Tw)throw Error(n(174));return v}function jT(v,w){switch(fs(bb,w),fs(Rw,v),fs(Fh,Tw),v=w.nodeType,v){case 9:case 11:w=(w=w.documentElement)?w.namespaceURI:Se(null,"");break;default:v=v===8?w.parentNode:w,w=v.namespaceURI||null,v=v.tagName,w=Se(w,v)}xs(Fh),fs(Fh,w)}function Dg(){xs(Fh),xs(Rw),xs(bb)}function WT(v){Zf(bb.current);var w=Zf(Fh.current),T=Se(w,v.type);w!==T&&(fs(Rw,v),fs(Fh,T))}function eL(v){Rw.current===v&&(xs(Fh),xs(Rw))}var Bs=Ql(0);function A_(v){for(var w=v;w!==null;){if(w.tag===13){var T=w.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||T.data==="$?"||T.data==="$!"))return w}else if(w.tag===19&&w.memoizedProps.revealOrder!==void 0){if((w.flags&128)!==0)return w}else if(w.child!==null){w.child.return=w,w=w.child;continue}if(w===v)break;for(;w.sibling===null;){if(w.return===null||w.return===v)return null;w=w.return}w.sibling.return=w.return,w=w.sibling}return null}var $T=[];function tL(){for(var v=0;v<$T.length;v++)$T[v]._workInProgressVersionPrimary=null;$T.length=0}var Aw=k.ReactCurrentDispatcher,zT=k.ReactCurrentBatchConfig,Eg=0,Gs=null,vo=null,qo=null,yb=!1,Nw=!1,N_=0,Oi=0;function rl(){throw Error(n(321))}function VT(v,w){if(w===null)return!1;for(var T=0;T<w.length&&T<v.length;T++)if(!Qe(v[T],w[T]))return!1;return!0}function M_(v,w,T,F,V,U){if(Eg=U,Gs=w,w.memoizedState=null,w.updateQueue=null,w.lanes=0,Aw.current=v===null||v.memoizedState===null?_H:lL,v=T(F,V),Nw){U=0;do{if(Nw=!1,N_=0,25<=U)throw Error(n(301));U+=1,qo=vo=null,w.updateQueue=null,Aw.current=xb,v=T(F,V)}while(Nw)}if(Aw.current=aL,w=vo!==null&&vo.next!==null,Eg=0,qo=vo=Gs=null,yb=!1,w)throw Error(n(300));return v}function nL(){var v=N_!==0;return N_=0,v}function Bh(){var v={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qo===null?Gs.memoizedState=qo=v:qo=qo.next=v,qo}function Lu(){if(vo===null){var v=Gs.alternate;v=v!==null?v.memoizedState:null}else v=vo.next;var w=qo===null?Gs.memoizedState:qo.next;if(w!==null)qo=w,vo=v;else{if(v===null)throw Error(n(310));vo=v,v={memoizedState:vo.memoizedState,baseState:vo.baseState,baseQueue:vo.baseQueue,queue:vo.queue,next:null},qo===null?Gs.memoizedState=qo=v:qo=qo.next=v}return qo}function sl(v,w){return typeof w=="function"?w(v):w}function HT(v){var w=Lu(),T=w.queue;if(T===null)throw Error(n(311));T.lastRenderedReducer=v;var F=vo,V=F.baseQueue,U=T.pending;if(U!==null){if(V!==null){var re=V.next;V.next=U.next,U.next=re}F.baseQueue=V=U,T.pending=null}if(V!==null){U=V.next,F=F.baseState;var be=re=null,Re=null,et=U;do{var It=et.lane;if((Eg&It)===It)Re!==null&&(Re=Re.next={lane:0,action:et.action,hasEagerState:et.hasEagerState,eagerState:et.eagerState,next:null}),F=et.hasEagerState?et.eagerState:v(F,et.action);else{var Nt={lane:It,action:et.action,hasEagerState:et.hasEagerState,eagerState:et.eagerState,next:null};Re===null?(be=Re=Nt,re=F):Re=Re.next=Nt,Gs.lanes|=It,Rg|=It}et=et.next}while(et!==null&&et!==U);Re===null?re=F:Re.next=be,Qe(F,w.memoizedState)||(kl=!0),w.memoizedState=F,w.baseState=re,w.baseQueue=Re,T.lastRenderedState=F}if(v=T.interleaved,v!==null){V=v;do U=V.lane,Gs.lanes|=U,Rg|=U,V=V.next;while(V!==v)}else V===null&&(T.lanes=0);return[w.memoizedState,T.dispatch]}function wb(v){var w=Lu(),T=w.queue;if(T===null)throw Error(n(311));T.lastRenderedReducer=v;var F=T.dispatch,V=T.pending,U=w.memoizedState;if(V!==null){T.pending=null;var re=V=V.next;do U=v(U,re.action),re=re.next;while(re!==V);Qe(U,w.memoizedState)||(kl=!0),w.memoizedState=U,w.baseQueue===null&&(w.baseState=U),T.lastRenderedState=U}return[U,F]}function iL(){}function UT(v,w){var T=Gs,F=Lu(),V=w(),U=!Qe(F.memoizedState,V);if(U&&(F.memoizedState=V,kl=!0),F=F.queue,jh(Qf.bind(null,T,F,v),[v]),F.getSnapshot!==w||U||qo!==null&&qo.memoizedState.tag&1){if(T.flags|=2048,Cb(9,nc.bind(null,T,F,V,w),void 0,null),va===null)throw Error(n(349));(Eg&30)!==0||qT(T,w,V)}return V}function qT(v,w,T){v.flags|=16384,v={getSnapshot:w,value:T},w=Gs.updateQueue,w===null?(w={lastEffect:null,stores:null},Gs.updateQueue=w,w.stores=[v]):(T=w.stores,T===null?w.stores=[v]:T.push(v))}function nc(v,w,T,F){w.value=T,w.getSnapshot=F,rL(w)&&KT(v)}function Qf(v,w,T){return T(function(){rL(w)&&KT(v)})}function rL(v){var w=v.getSnapshot;v=v.value;try{var T=w();return!Qe(v,T)}catch{return!0}}function KT(v){var w=Xf(v,1);w!==null&&Td(w,v,1,-1)}function Mw(v){var w=Bh();return typeof v=="function"&&(v=v()),w.memoizedState=w.baseState=v,v={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:sl,lastRenderedState:v},w.queue=v,v=v.dispatch=NF.bind(null,Gs,v),[w.memoizedState,v]}function Cb(v,w,T,F){return v={tag:v,create:w,destroy:T,deps:F,next:null},w=Gs.updateQueue,w===null?(w={lastEffect:null,stores:null},Gs.updateQueue=w,w.lastEffect=v.next=v):(T=w.lastEffect,T===null?w.lastEffect=v.next=v:(F=T.next,T.next=v,v.next=F,w.lastEffect=v)),v}function sL(){return Lu().memoizedState}function Pw(v,w,T,F){var V=Bh();Gs.flags|=v,V.memoizedState=Cb(1|w,T,void 0,F===void 0?null:F)}function Sb(v,w,T,F){var V=Lu();F=F===void 0?null:F;var U=void 0;if(vo!==null){var re=vo.memoizedState;if(U=re.destroy,F!==null&&VT(F,re.deps)){V.memoizedState=Cb(w,T,U,F);return}}Gs.flags|=v,V.memoizedState=Cb(1|w,T,U,F)}function oL(v,w){return Pw(8390656,8,v,w)}function jh(v,w){return Sb(2048,8,v,w)}function EF(v,w){return Sb(4,2,v,w)}function Jf(v,w){return Sb(4,4,v,w)}function GT(v,w){if(typeof w=="function")return v=v(),w(v),function(){w(null)};if(w!=null)return v=v(),w.current=v,function(){w.current=null}}function XT(v,w,T){return T=T!=null?T.concat([v]):null,Sb(4,4,GT.bind(null,w,v),T)}function Ow(){}function IF(v,w){var T=Lu();w=w===void 0?null:w;var F=T.memoizedState;return F!==null&&w!==null&&VT(w,F[1])?F[0]:(T.memoizedState=[v,w],v)}function TF(v,w){var T=Lu();w=w===void 0?null:w;var F=T.memoizedState;return F!==null&&w!==null&&VT(w,F[1])?F[0]:(v=v(),T.memoizedState=[v,w],v)}function RF(v,w,T){return(Eg&21)===0?(v.baseState&&(v.baseState=!1,kl=!0),v.memoizedState=T):(Qe(T,w)||(T=uT(),Gs.lanes|=T,Rg|=T,v.baseState=!0),w)}function AF(v,w){var T=Tr;Tr=T!==0&&4>T?T:4,v(!0);var F=zT.transition;zT.transition={};try{v(!1),w()}finally{Tr=T,zT.transition=F}}function YT(){return Lu().memoizedState}function mH(v,w,T){var F=Mg(v);if(T={lane:F,action:T,hasEagerState:!1,eagerState:null,next:null},ZT(v))xl(w,T);else if(T=Zk(v,w,T,F),T!==null){var V=El();Td(T,v,F,V),kd(T,w,F)}}function NF(v,w,T){var F=Mg(v),V={lane:F,action:T,hasEagerState:!1,eagerState:null,next:null};if(ZT(v))xl(w,V);else{var U=v.alternate;if(v.lanes===0&&(U===null||U.lanes===0)&&(U=w.lastRenderedReducer,U!==null))try{var re=w.lastRenderedState,be=U(re,T);if(V.hasEagerState=!0,V.eagerState=be,Qe(be,re)){var Re=w.interleaved;Re===null?(V.next=V,FT(w)):(V.next=Re.next,Re.next=V),w.interleaved=V;return}}catch{}finally{}T=Zk(v,w,V,F),T!==null&&(V=El(),Td(T,v,F,V),kd(T,w,F))}}function ZT(v){var w=v.alternate;return v===Gs||w!==null&&w===Gs}function xl(v,w){Nw=yb=!0;var T=v.pending;T===null?w.next=w:(w.next=T.next,T.next=w),v.pending=w}function kd(v,w,T){if((T&4194240)!==0){var F=w.lanes;F&=v.pendingLanes,T|=F,w.lanes=T,dw(v,T)}}var aL={readContext:Su,useCallback:rl,useContext:rl,useEffect:rl,useImperativeHandle:rl,useInsertionEffect:rl,useLayoutEffect:rl,useMemo:rl,useReducer:rl,useRef:rl,useState:rl,useDebugValue:rl,useDeferredValue:rl,useTransition:rl,useMutableSource:rl,useSyncExternalStore:rl,useId:rl,unstable_isNewReconciler:!1},_H={readContext:Su,useCallback:function(v,w){return Bh().memoizedState=[v,w===void 0?null:w],v},useContext:Su,useEffect:oL,useImperativeHandle:function(v,w,T){return T=T!=null?T.concat([v]):null,Pw(4194308,4,GT.bind(null,w,v),T)},useLayoutEffect:function(v,w){return Pw(4194308,4,v,w)},useInsertionEffect:function(v,w){return Pw(4,2,v,w)},useMemo:function(v,w){var T=Bh();return w=w===void 0?null:w,v=v(),T.memoizedState=[v,w],v},useReducer:function(v,w,T){var F=Bh();return w=T!==void 0?T(w):w,F.memoizedState=F.baseState=w,v={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:v,lastRenderedState:w},F.queue=v,v=v.dispatch=mH.bind(null,Gs,v),[F.memoizedState,v]},useRef:function(v){var w=Bh();return v={current:v},w.memoizedState=v},useState:Mw,useDebugValue:Ow,useDeferredValue:function(v){return Bh().memoizedState=v},useTransition:function(){var v=Mw(!1),w=v[0];return v=AF.bind(null,v[1]),Bh().memoizedState=v,[w,v]},useMutableSource:function(){},useSyncExternalStore:function(v,w,T){var F=Gs,V=Bh();if(ks){if(T===void 0)throw Error(n(407));T=T()}else{if(T=w(),va===null)throw Error(n(349));(Eg&30)!==0||qT(F,w,T)}V.memoizedState=T;var U={value:T,getSnapshot:w};return V.queue=U,oL(Qf.bind(null,F,U,v),[v]),F.flags|=2048,Cb(9,nc.bind(null,F,U,T,w),void 0,null),T},useId:function(){var v=Bh(),w=va.identifierPrefix;if(ks){var T=Nh,F=Ah;T=(F&~(1<<32-Cd(F)-1)).toString(32)+T,w=":"+w+"R"+T,T=N_++,0<T&&(w+="H"+T.toString(32)),w+=":"}else T=Oi++,w=":"+w+"r"+T.toString(32)+":";return v.memoizedState=w},unstable_isNewReconciler:!1},lL={readContext:Su,useCallback:IF,useContext:Su,useEffect:jh,useImperativeHandle:XT,useInsertionEffect:EF,useLayoutEffect:Jf,useMemo:TF,useReducer:HT,useRef:sL,useState:function(){return HT(sl)},useDebugValue:Ow,useDeferredValue:function(v){var w=Lu();return RF(w,vo.memoizedState,v)},useTransition:function(){var v=HT(sl)[0],w=Lu().memoizedState;return[v,w]},useMutableSource:iL,useSyncExternalStore:UT,useId:YT,unstable_isNewReconciler:!1},xb={readContext:Su,useCallback:IF,useContext:Su,useEffect:jh,useImperativeHandle:XT,useInsertionEffect:EF,useLayoutEffect:Jf,useMemo:TF,useReducer:wb,useRef:sL,useState:function(){return wb(sl)},useDebugValue:Ow,useDeferredValue:function(v){var w=Lu();return vo===null?w.memoizedState=v:RF(w,vo.memoizedState,v)},useTransition:function(){var v=wb(sl)[0],w=Lu().memoizedState;return[v,w]},useMutableSource:iL,useSyncExternalStore:UT,useId:YT,unstable_isNewReconciler:!1};function Du(v,w){if(v&&v.defaultProps){w=ie({},w),v=v.defaultProps;for(var T in v)w[T]===void 0&&(w[T]=v[T]);return w}return w}function cL(v,w,T,F){w=v.memoizedState,T=T(F,w),T=T==null?w:ie({},w,T),v.memoizedState=T,v.lanes===0&&(v.updateQueue.baseState=T)}var uL={isMounted:function(v){return(v=v._reactInternals)?ma(v)===v:!1},enqueueSetState:function(v,w,T){v=v._reactInternals;var F=El(),V=Mg(v),U=Yf(F,V);U.payload=w,T!=null&&(U.callback=T),w=ku(v,U,V),w!==null&&(Td(w,v,V,F),Jk(w,v,V))},enqueueReplaceState:function(v,w,T){v=v._reactInternals;var F=El(),V=Mg(v),U=Yf(F,V);U.tag=1,U.payload=w,T!=null&&(U.callback=T),w=ku(v,U,V),w!==null&&(Td(w,v,V,F),Jk(w,v,V))},enqueueForceUpdate:function(v,w){v=v._reactInternals;var T=El(),F=Mg(v),V=Yf(T,F);V.tag=2,w!=null&&(V.callback=w),w=ku(v,V,F),w!==null&&(Td(w,v,F,T),Jk(w,v,F))}};function QT(v,w,T,F,V,U,re){return v=v.stateNode,typeof v.shouldComponentUpdate=="function"?v.shouldComponentUpdate(F,U,re):w.prototype&&w.prototype.isPureReactComponent?!fn(T,F)||!fn(V,U):!0}function P_(v,w,T){var F=!1,V=Sg,U=w.contextType;return typeof U=="object"&&U!==null?U=Su(U):(V=ec(w)?Sl:tl.current,F=w.contextTypes,U=(F=F!=null)?gb(v,V):Sg),w=new w(T,U),v.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=uL,v.stateNode=w,w._reactInternals=v,F&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=V,v.__reactInternalMemoizedMaskedChildContext=U),w}function kb(v,w,T,F){v=w.state,typeof w.componentWillReceiveProps=="function"&&w.componentWillReceiveProps(T,F),typeof w.UNSAFE_componentWillReceiveProps=="function"&&w.UNSAFE_componentWillReceiveProps(T,F),w.state!==v&&uL.enqueueReplaceState(w,w.state,null)}function JT(v,w,T,F){var V=v.stateNode;V.props=T,V.state=v.memoizedState,V.refs={},Qk(v);var U=w.contextType;typeof U=="object"&&U!==null?V.context=Su(U):(U=ec(w)?Sl:tl.current,V.context=gb(v,U)),V.state=v.memoizedState,U=w.getDerivedStateFromProps,typeof U=="function"&&(cL(v,w,U,T),V.state=v.memoizedState),typeof w.getDerivedStateFromProps=="function"||typeof V.getSnapshotBeforeUpdate=="function"||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(w=V.state,typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount(),w!==V.state&&uL.enqueueReplaceState(V,V.state,null),vb(v,T,V,F),V.state=v.memoizedState),typeof V.componentDidMount=="function"&&(v.flags|=4194308)}function O_(v,w){try{var T="",F=w;do T+=xe(F),F=F.return;while(F);var V=T}catch(U){V=`
Error generating stack: `+U.message+`
`+U.stack}return{value:v,source:w,stack:V,digest:null}}function dL(v,w,T){return{value:v,source:null,stack:T??null,digest:w??null}}function Lb(v,w){try{console.error(w.value)}catch(T){setTimeout(function(){throw T})}}var MF=typeof WeakMap=="function"?WeakMap:Map;function Fw(v,w,T){T=Yf(-1,T),T.tag=3,T.payload={element:null};var F=w.value;return T.callback=function(){CL||(CL=!0,gR=F),Lb(v,w)},T}function hL(v,w,T){T=Yf(-1,T),T.tag=3;var F=v.type.getDerivedStateFromError;if(typeof F=="function"){var V=w.value;T.payload=function(){return F(V)},T.callback=function(){Lb(v,w)}}var U=v.stateNode;return U!==null&&typeof U.componentDidCatch=="function"&&(T.callback=function(){Lb(v,w),typeof F!="function"&&(Ag===null?Ag=new Set([this]):Ag.add(this));var re=w.stack;this.componentDidCatch(w.value,{componentStack:re!==null?re:""})}),T}function Bw(v,w,T){var F=v.pingCache;if(F===null){F=v.pingCache=new MF;var V=new Set;F.set(w,V)}else V=F.get(w),V===void 0&&(V=new Set,F.set(w,V));V.has(T)||(V.add(T),v=kH.bind(null,v,w,T),w.then(v,v))}function PF(v){do{var w;if((w=v.tag===13)&&(w=v.memoizedState,w=w!==null?w.dehydrated!==null:!0),w)return v;v=v.return}while(v!==null);return null}function eR(v,w,T,F,V){return(v.mode&1)===0?(v===w?v.flags|=65536:(v.flags|=128,T.flags|=131072,T.flags&=-52805,T.tag===1&&(T.alternate===null?T.tag=17:(w=Yf(-1,1),w.tag=2,ku(T,w,1))),T.lanes|=1),v):(v.flags|=65536,v.lanes=V,v)}var fL=k.ReactCurrentOwner,kl=!1;function Ma(v,w,T,F){w.child=v===null?Xk(w,null,T,F):oo(w,v.child,T,F)}function OF(v,w,T,F,V){T=T.render;var U=w.ref;return Lg(w,V),F=M_(v,w,T,F,U,V),T=nL(),v!==null&&!kl?(w.updateQueue=v.updateQueue,w.flags&=-2053,v.lanes&=~V,Ld(v,w,V)):(ks&&T&&Lw(w),w.flags|=1,Ma(v,w,F,V),w.child)}function tR(v,w,T,F,V){if(v===null){var U=T.type;return typeof U=="function"&&!EL(U)&&U.defaultProps===void 0&&T.compare===null&&T.defaultProps===void 0?(w.tag=15,w.type=U,Wh(v,w,U,F,V)):(v=IL(T.type,null,F,w,w.mode,V),v.ref=w.ref,v.return=w,w.child=v)}if(U=v.child,(v.lanes&V)===0){var re=U.memoizedProps;if(T=T.compare,T=T!==null?T:fn,T(re,F)&&v.ref===w.ref)return Ld(v,w,V)}return w.flags|=1,v=Rd(U,F),v.ref=w.ref,v.return=w,w.child=v}function Wh(v,w,T,F,V){if(v!==null){var U=v.memoizedProps;if(fn(U,F)&&v.ref===w.ref)if(kl=!1,w.pendingProps=F=U,(v.lanes&V)!==0)(v.flags&131072)!==0&&(kl=!0);else return w.lanes=v.lanes,Ld(v,w,V)}return rR(v,w,T,F,V)}function nR(v,w,T){var F=w.pendingProps,V=F.children,U=v!==null?v.memoizedState:null;if(F.mode==="hidden")if((w.mode&1)===0)w.memoizedState={baseLanes:0,cachePool:null,transitions:null},fs(Tb,Oc),Oc|=T;else{if((T&1073741824)===0)return v=U!==null?U.baseLanes|T:T,w.lanes=w.childLanes=1073741824,w.memoizedState={baseLanes:v,cachePool:null,transitions:null},w.updateQueue=null,fs(Tb,Oc),Oc|=v,null;w.memoizedState={baseLanes:0,cachePool:null,transitions:null},F=U!==null?U.baseLanes:T,fs(Tb,Oc),Oc|=F}else U!==null?(F=U.baseLanes|T,w.memoizedState=null):F=T,fs(Tb,Oc),Oc|=F;return Ma(v,w,V,T),w.child}function iR(v,w){var T=w.ref;(v===null&&T!==null||v!==null&&v.ref!==T)&&(w.flags|=512,w.flags|=2097152)}function rR(v,w,T,F,V){var U=ec(T)?Sl:tl.current;return U=gb(w,U),Lg(w,V),T=M_(v,w,T,F,U,V),F=nL(),v!==null&&!kl?(w.updateQueue=v.updateQueue,w.flags&=-2053,v.lanes&=~V,Ld(v,w,V)):(ks&&F&&Lw(w),w.flags|=1,Ma(v,w,T,V),w.child)}function sR(v,w,T,F,V){if(ec(T)){var U=!0;yu(w)}else U=!1;if(Lg(w,V),w.stateNode===null)gL(v,w),P_(w,T,F),JT(w,T,F,V),F=!0;else if(v===null){var re=w.stateNode,be=w.memoizedProps;re.props=be;var Re=re.context,et=T.contextType;typeof et=="object"&&et!==null?et=Su(et):(et=ec(T)?Sl:tl.current,et=gb(w,et));var It=T.getDerivedStateFromProps,Nt=typeof It=="function"||typeof re.getSnapshotBeforeUpdate=="function";Nt||typeof re.UNSAFE_componentWillReceiveProps!="function"&&typeof re.componentWillReceiveProps!="function"||(be!==F||Re!==et)&&kb(w,re,F,et),xu=!1;var Lt=w.memoizedState;re.state=Lt,vb(w,F,re,V),Re=w.memoizedState,be!==F||Lt!==Re||Jl.current||xu?(typeof It=="function"&&(cL(w,T,It,F),Re=w.memoizedState),(be=xu||QT(w,T,be,F,Lt,Re,et))?(Nt||typeof re.UNSAFE_componentWillMount!="function"&&typeof re.componentWillMount!="function"||(typeof re.componentWillMount=="function"&&re.componentWillMount(),typeof re.UNSAFE_componentWillMount=="function"&&re.UNSAFE_componentWillMount()),typeof re.componentDidMount=="function"&&(w.flags|=4194308)):(typeof re.componentDidMount=="function"&&(w.flags|=4194308),w.memoizedProps=F,w.memoizedState=Re),re.props=F,re.state=Re,re.context=et,F=be):(typeof re.componentDidMount=="function"&&(w.flags|=4194308),F=!1)}else{re=w.stateNode,LF(v,w),be=w.memoizedProps,et=w.type===w.elementType?be:Du(w.type,be),re.props=et,Nt=w.pendingProps,Lt=re.context,Re=T.contextType,typeof Re=="object"&&Re!==null?Re=Su(Re):(Re=ec(T)?Sl:tl.current,Re=gb(w,Re));var pn=T.getDerivedStateFromProps;(It=typeof pn=="function"||typeof re.getSnapshotBeforeUpdate=="function")||typeof re.UNSAFE_componentWillReceiveProps!="function"&&typeof re.componentWillReceiveProps!="function"||(be!==Nt||Lt!==Re)&&kb(w,re,F,Re),xu=!1,Lt=w.memoizedState,re.state=Lt,vb(w,F,re,V);var Cn=w.memoizedState;be!==Nt||Lt!==Cn||Jl.current||xu?(typeof pn=="function"&&(cL(w,T,pn,F),Cn=w.memoizedState),(et=xu||QT(w,T,et,F,Lt,Cn,Re)||!1)?(It||typeof re.UNSAFE_componentWillUpdate!="function"&&typeof re.componentWillUpdate!="function"||(typeof re.componentWillUpdate=="function"&&re.componentWillUpdate(F,Cn,Re),typeof re.UNSAFE_componentWillUpdate=="function"&&re.UNSAFE_componentWillUpdate(F,Cn,Re)),typeof re.componentDidUpdate=="function"&&(w.flags|=4),typeof re.getSnapshotBeforeUpdate=="function"&&(w.flags|=1024)):(typeof re.componentDidUpdate!="function"||be===v.memoizedProps&&Lt===v.memoizedState||(w.flags|=4),typeof re.getSnapshotBeforeUpdate!="function"||be===v.memoizedProps&&Lt===v.memoizedState||(w.flags|=1024),w.memoizedProps=F,w.memoizedState=Cn),re.props=F,re.state=Cn,re.context=Re,F=et):(typeof re.componentDidUpdate!="function"||be===v.memoizedProps&&Lt===v.memoizedState||(w.flags|=4),typeof re.getSnapshotBeforeUpdate!="function"||be===v.memoizedProps&&Lt===v.memoizedState||(w.flags|=1024),F=!1)}return oR(v,w,T,F,U,V)}function oR(v,w,T,F,V,U){iR(v,w);var re=(w.flags&128)!==0;if(!F&&!re)return V&&yF(w,T,!1),Ld(v,w,U);F=w.stateNode,fL.current=w;var be=re&&typeof T.getDerivedStateFromError!="function"?null:F.render();return w.flags|=1,v!==null&&re?(w.child=oo(w,v.child,null,U),w.child=oo(w,null,be,U)):Ma(v,w,be,U),w.memoizedState=F.state,V&&yF(w,T,!0),w.child}function FF(v){var w=v.stateNode;w.pendingContext?vF(v,w.pendingContext,w.pendingContext!==w.context):w.context&&vF(v,w.context,!1),jT(v,w.containerInfo)}function $h(v,w,T,F,V){return Ph(),Oh(V),w.flags|=256,Ma(v,w,T,F),w.child}var jw={dehydrated:null,treeContext:null,retryLane:0};function Ww(v){return{baseLanes:v,cachePool:null,transitions:null}}function pL(v,w,T){var F=w.pendingProps,V=Bs.current,U=!1,re=(w.flags&128)!==0,be;if((be=re)||(be=v!==null&&v.memoizedState===null?!1:(V&2)!==0),be?(U=!0,w.flags&=-129):(v===null||v.memoizedState!==null)&&(V|=1),fs(Bs,V&1),v===null)return tc(w),v=w.memoizedState,v!==null&&(v=v.dehydrated,v!==null)?((w.mode&1)===0?w.lanes=1:v.data==="$!"?w.lanes=8:w.lanes=1073741824,null):(re=F.children,v=F.fallback,U?(F=w.mode,U=w.child,re={mode:"hidden",children:re},(F&1)===0&&U!==null?(U.childLanes=0,U.pendingProps=re):U=TL(re,F,0,null),v=$_(v,F,T,null),U.return=w,v.return=w,U.sibling=v,w.child=U,w.child.memoizedState=Ww(T),w.memoizedState=jw,v):Db(w,re));if(V=v.memoizedState,V!==null&&(be=V.dehydrated,be!==null))return Zn(v,w,re,F,be,V,T);if(U){U=F.fallback,re=w.mode,V=v.child,be=V.sibling;var Re={mode:"hidden",children:F.children};return(re&1)===0&&w.child!==V?(F=w.child,F.childLanes=0,F.pendingProps=Re,w.deletions=null):(F=Rd(V,Re),F.subtreeFlags=V.subtreeFlags&14680064),be!==null?U=Rd(be,U):(U=$_(U,re,T,null),U.flags|=2),U.return=w,F.return=w,F.sibling=U,w.child=F,F=U,U=w.child,re=v.child.memoizedState,re=re===null?Ww(T):{baseLanes:re.baseLanes|T,cachePool:null,transitions:re.transitions},U.memoizedState=re,U.childLanes=v.childLanes&~T,w.memoizedState=jw,F}return U=v.child,v=U.sibling,F=Rd(U,{mode:"visible",children:F.children}),(w.mode&1)===0&&(F.lanes=T),F.return=w,F.sibling=null,v!==null&&(T=w.deletions,T===null?(w.deletions=[v],w.flags|=16):T.push(v)),w.child=F,w.memoizedState=null,F}function Db(v,w){return w=TL({mode:"visible",children:w},v.mode,0,null),w.return=v,v.child=w}function ep(v,w,T,F){return F!==null&&Oh(F),oo(w,v.child,null,T),v=Db(w,w.pendingProps.children),v.flags|=2,w.memoizedState=null,v}function Zn(v,w,T,F,V,U,re){if(T)return w.flags&256?(w.flags&=-257,F=dL(Error(n(422))),ep(v,w,re,F)):w.memoizedState!==null?(w.child=v.child,w.flags|=128,null):(U=F.fallback,V=w.mode,F=TL({mode:"visible",children:F.children},V,0,null),U=$_(U,V,re,null),U.flags|=2,F.return=w,U.return=w,F.sibling=U,w.child=F,(w.mode&1)!==0&&oo(w,v.child,null,re),w.child.memoizedState=Ww(re),w.memoizedState=jw,U);if((w.mode&1)===0)return ep(v,w,re,null);if(V.data==="$!"){if(F=V.nextSibling&&V.nextSibling.dataset,F)var be=F.dgst;return F=be,U=Error(n(419)),F=dL(U,F,void 0),ep(v,w,re,F)}if(be=(re&v.childLanes)!==0,kl||be){if(F=va,F!==null){switch(re&-re){case 4:V=2;break;case 16:V=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:V=32;break;case 536870912:V=268435456;break;default:V=0}V=(V&(F.suspendedLanes|re))!==0?0:V,V!==0&&V!==U.retryLane&&(U.retryLane=V,Xf(v,V),Td(F,v,V,-1))}return wR(),F=dL(Error(n(421))),ep(v,w,re,F)}return V.data==="$?"?(w.flags|=128,w.child=v.child,w=LH.bind(null,v),V._reactRetry=w,null):(v=U.treeContext,Nc=wg(V.nextSibling),il=w,ks=!0,xd=null,v!==null&&(wu[Cu++]=Ah,wu[Cu++]=Nh,wu[Cu++]=D_,Ah=v.id,Nh=v.overflow,D_=w),w=Db(w,F.children),w.flags|=4096,w)}function $w(v,w,T){v.lanes|=w;var F=v.alternate;F!==null&&(F.lanes|=w),Na(v.return,w,T)}function zw(v,w,T,F,V){var U=v.memoizedState;U===null?v.memoizedState={isBackwards:w,rendering:null,renderingStartTime:0,last:F,tail:T,tailMode:V}:(U.isBackwards=w,U.rendering=null,U.renderingStartTime=0,U.last=F,U.tail=T,U.tailMode=V)}function Ig(v,w,T){var F=w.pendingProps,V=F.revealOrder,U=F.tail;if(Ma(v,w,F.children,T),F=Bs.current,(F&2)!==0)F=F&1|2,w.flags|=128;else{if(v!==null&&(v.flags&128)!==0)e:for(v=w.child;v!==null;){if(v.tag===13)v.memoizedState!==null&&$w(v,T,w);else if(v.tag===19)$w(v,T,w);else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===w)break e;for(;v.sibling===null;){if(v.return===null||v.return===w)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}F&=1}if(fs(Bs,F),(w.mode&1)===0)w.memoizedState=null;else switch(V){case"forwards":for(T=w.child,V=null;T!==null;)v=T.alternate,v!==null&&A_(v)===null&&(V=T),T=T.sibling;T=V,T===null?(V=w.child,w.child=null):(V=T.sibling,T.sibling=null),zw(w,!1,V,T,U);break;case"backwards":for(T=null,V=w.child,w.child=null;V!==null;){if(v=V.alternate,v!==null&&A_(v)===null){w.child=V;break}v=V.sibling,V.sibling=T,T=V,V=v}zw(w,!0,T,null,U);break;case"together":zw(w,!1,null,null,void 0);break;default:w.memoizedState=null}return w.child}function gL(v,w){(w.mode&1)===0&&v!==null&&(v.alternate=null,w.alternate=null,w.flags|=2)}function Ld(v,w,T){if(v!==null&&(w.dependencies=v.dependencies),Rg|=w.lanes,(T&w.childLanes)===0)return null;if(v!==null&&w.child!==v.child)throw Error(n(153));if(w.child!==null){for(v=w.child,T=Rd(v,v.pendingProps),w.child=T,T.return=w;v.sibling!==null;)v=v.sibling,T=T.sibling=Rd(v,v.pendingProps),T.return=w;T.sibling=null}return w.child}function BF(v,w,T){switch(w.tag){case 3:FF(w),Ph();break;case 5:WT(w);break;case 1:ec(w.type)&&yu(w);break;case 4:jT(w,w.stateNode.containerInfo);break;case 10:var F=w.type._context,V=w.memoizedProps.value;fs(Iw,F._currentValue),F._currentValue=V;break;case 13:if(F=w.memoizedState,F!==null)return F.dehydrated!==null?(fs(Bs,Bs.current&1),w.flags|=128,null):(T&w.child.childLanes)!==0?pL(v,w,T):(fs(Bs,Bs.current&1),v=Ld(v,w,T),v!==null?v.sibling:null);fs(Bs,Bs.current&1);break;case 19:if(F=(T&w.childLanes)!==0,(v.flags&128)!==0){if(F)return Ig(v,w,T);w.flags|=128}if(V=w.memoizedState,V!==null&&(V.rendering=null,V.tail=null,V.lastEffect=null),fs(Bs,Bs.current),F)break;return null;case 22:case 23:return w.lanes=0,nR(v,w,T)}return Ld(v,w,T)}var Pa,aR,jF,lR;Pa=function(v,w){for(var T=w.child;T!==null;){if(T.tag===5||T.tag===6)v.appendChild(T.stateNode);else if(T.tag!==4&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===w)break;for(;T.sibling===null;){if(T.return===null||T.return===w)return;T=T.return}T.sibling.return=T.return,T=T.sibling}},aR=function(){},jF=function(v,w,T,F){var V=v.memoizedProps;if(V!==F){v=w.stateNode,Zf(Fh.current);var U=null;switch(T){case"input":V=mt(v,V),F=mt(v,F),U=[];break;case"select":V=ie({},V,{value:void 0}),F=ie({},F,{value:void 0}),U=[];break;case"textarea":V=pe(v,V),F=pe(v,F),U=[];break;default:typeof V.onClick!="function"&&typeof F.onClick=="function"&&(v.onclick=Wk)}jn(T,F);var re;T=null;for(et in V)if(!F.hasOwnProperty(et)&&V.hasOwnProperty(et)&&V[et]!=null)if(et==="style"){var be=V[et];for(re in be)be.hasOwnProperty(re)&&(T||(T={}),T[re]="")}else et!=="dangerouslySetInnerHTML"&&et!=="children"&&et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&et!=="autoFocus"&&(s.hasOwnProperty(et)?U||(U=[]):(U=U||[]).push(et,null));for(et in F){var Re=F[et];if(be=V!=null?V[et]:void 0,F.hasOwnProperty(et)&&Re!==be&&(Re!=null||be!=null))if(et==="style")if(be){for(re in be)!be.hasOwnProperty(re)||Re&&Re.hasOwnProperty(re)||(T||(T={}),T[re]="");for(re in Re)Re.hasOwnProperty(re)&&be[re]!==Re[re]&&(T||(T={}),T[re]=Re[re])}else T||(U||(U=[]),U.push(et,T)),T=Re;else et==="dangerouslySetInnerHTML"?(Re=Re?Re.__html:void 0,be=be?be.__html:void 0,Re!=null&&be!==Re&&(U=U||[]).push(et,Re)):et==="children"?typeof Re!="string"&&typeof Re!="number"||(U=U||[]).push(et,""+Re):et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&(s.hasOwnProperty(et)?(Re!=null&&et==="onScroll"&&Ss("scroll",v),U||be===Re||(U=[])):(U=U||[]).push(et,Re))}T&&(U=U||[]).push("style",T);var et=U;(w.updateQueue=et)&&(w.flags|=4)}},lR=function(v,w,T,F){T!==F&&(w.flags|=4)};function Vw(v,w){if(!ks)switch(v.tailMode){case"hidden":w=v.tail;for(var T=null;w!==null;)w.alternate!==null&&(T=w),w=w.sibling;T===null?v.tail=null:T.sibling=null;break;case"collapsed":T=v.tail;for(var F=null;T!==null;)T.alternate!==null&&(F=T),T=T.sibling;F===null?w||v.tail===null?v.tail=null:v.tail.sibling=null:F.sibling=null}}function Oa(v){var w=v.alternate!==null&&v.alternate.child===v.child,T=0,F=0;if(w)for(var V=v.child;V!==null;)T|=V.lanes|V.childLanes,F|=V.subtreeFlags&14680064,F|=V.flags&14680064,V.return=v,V=V.sibling;else for(V=v.child;V!==null;)T|=V.lanes|V.childLanes,F|=V.subtreeFlags,F|=V.flags,V.return=v,V=V.sibling;return v.subtreeFlags|=F,v.childLanes=T,w}function vH(v,w,T){var F=w.pendingProps;switch(I_(w),w.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oa(w),null;case 1:return ec(w.type)&&Hk(),Oa(w),null;case 3:return F=w.stateNode,Dg(),xs(Jl),xs(tl),tL(),F.pendingContext&&(F.context=F.pendingContext,F.pendingContext=null),(v===null||v.child===null)&&(Dw(w)?w.flags|=4:v===null||v.memoizedState.isDehydrated&&(w.flags&256)===0||(w.flags|=1024,xd!==null&&(vR(xd),xd=null))),aR(v,w),Oa(w),null;case 5:eL(w);var V=Zf(bb.current);if(T=w.type,v!==null&&w.stateNode!=null)jF(v,w,T,F,V),v.ref!==w.ref&&(w.flags|=512,w.flags|=2097152);else{if(!F){if(w.stateNode===null)throw Error(n(166));return Oa(w),null}if(v=Zf(Fh.current),Dw(w)){F=w.stateNode,T=w.type;var U=w.memoizedProps;switch(F[Th]=w,F[Cg]=U,v=(w.mode&1)!==0,T){case"dialog":Ss("cancel",F),Ss("close",F);break;case"iframe":case"object":case"embed":Ss("load",F);break;case"video":case"audio":for(V=0;V<Uf.length;V++)Ss(Uf[V],F);break;case"source":Ss("error",F);break;case"img":case"image":case"link":Ss("error",F),Ss("load",F);break;case"details":Ss("toggle",F);break;case"input":Rt(F,U),Ss("invalid",F);break;case"select":F._wrapperState={wasMultiple:!!U.multiple},Ss("invalid",F);break;case"textarea":ne(F,U),Ss("invalid",F)}jn(T,U),V=null;for(var re in U)if(U.hasOwnProperty(re)){var be=U[re];re==="children"?typeof be=="string"?F.textContent!==be&&(U.suppressHydrationWarning!==!0&&Cw(F.textContent,be,v),V=["children",be]):typeof be=="number"&&F.textContent!==""+be&&(U.suppressHydrationWarning!==!0&&Cw(F.textContent,be,v),V=["children",""+be]):s.hasOwnProperty(re)&&be!=null&&re==="onScroll"&&Ss("scroll",F)}switch(T){case"input":We(F),vt(F,U,!0);break;case"textarea":We(F),ue(F);break;case"select":case"option":break;default:typeof U.onClick=="function"&&(F.onclick=Wk)}F=V,w.updateQueue=F,F!==null&&(w.flags|=4)}else{re=V.nodeType===9?V:V.ownerDocument,v==="http://www.w3.org/1999/xhtml"&&(v=de(T)),v==="http://www.w3.org/1999/xhtml"?T==="script"?(v=re.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild)):typeof F.is=="string"?v=re.createElement(T,{is:F.is}):(v=re.createElement(T),T==="select"&&(re=v,F.multiple?re.multiple=!0:F.size&&(re.size=F.size))):v=re.createElementNS(v,T),v[Th]=w,v[Cg]=F,Pa(v,w,!1,!1),w.stateNode=v;e:{switch(re=Dt(T,F),T){case"dialog":Ss("cancel",v),Ss("close",v),V=F;break;case"iframe":case"object":case"embed":Ss("load",v),V=F;break;case"video":case"audio":for(V=0;V<Uf.length;V++)Ss(Uf[V],v);V=F;break;case"source":Ss("error",v),V=F;break;case"img":case"image":case"link":Ss("error",v),Ss("load",v),V=F;break;case"details":Ss("toggle",v),V=F;break;case"input":Rt(v,F),V=mt(v,F),Ss("invalid",v);break;case"option":V=F;break;case"select":v._wrapperState={wasMultiple:!!F.multiple},V=ie({},F,{value:void 0}),Ss("invalid",v);break;case"textarea":ne(v,F),V=pe(v,F),Ss("invalid",v);break;default:V=F}jn(T,V),be=V;for(U in be)if(be.hasOwnProperty(U)){var Re=be[U];U==="style"?Mt(v,Re):U==="dangerouslySetInnerHTML"?(Re=Re?Re.__html:void 0,Re!=null&&nt(v,Re)):U==="children"?typeof Re=="string"?(T!=="textarea"||Re!=="")&&Oe(v,Re):typeof Re=="number"&&Oe(v,""+Re):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(s.hasOwnProperty(U)?Re!=null&&U==="onScroll"&&Ss("scroll",v):Re!=null&&x(v,U,Re,re))}switch(T){case"input":We(v),vt(v,F,!1);break;case"textarea":We(v),ue(v);break;case"option":F.value!=null&&v.setAttribute("value",""+je(F.value));break;case"select":v.multiple=!!F.multiple,U=F.value,U!=null?ge(v,!!F.multiple,U,!1):F.defaultValue!=null&&ge(v,!!F.multiple,F.defaultValue,!0);break;default:typeof V.onClick=="function"&&(v.onclick=Wk)}switch(T){case"button":case"input":case"select":case"textarea":F=!!F.autoFocus;break e;case"img":F=!0;break e;default:F=!1}}F&&(w.flags|=4)}w.ref!==null&&(w.flags|=512,w.flags|=2097152)}return Oa(w),null;case 6:if(v&&w.stateNode!=null)lR(v,w,v.memoizedProps,F);else{if(typeof F!="string"&&w.stateNode===null)throw Error(n(166));if(T=Zf(bb.current),Zf(Fh.current),Dw(w)){if(F=w.stateNode,T=w.memoizedProps,F[Th]=w,(U=F.nodeValue!==T)&&(v=il,v!==null))switch(v.tag){case 3:Cw(F.nodeValue,T,(v.mode&1)!==0);break;case 5:v.memoizedProps.suppressHydrationWarning!==!0&&Cw(F.nodeValue,T,(v.mode&1)!==0)}U&&(w.flags|=4)}else F=(T.nodeType===9?T:T.ownerDocument).createTextNode(F),F[Th]=w,w.stateNode=F}return Oa(w),null;case 13:if(xs(Bs),F=w.memoizedState,v===null||v.memoizedState!==null&&v.memoizedState.dehydrated!==null){if(ks&&Nc!==null&&(w.mode&1)!==0&&(w.flags&128)===0)PT(),Ph(),w.flags|=98560,U=!1;else if(U=Dw(w),F!==null&&F.dehydrated!==null){if(v===null){if(!U)throw Error(n(318));if(U=w.memoizedState,U=U!==null?U.dehydrated:null,!U)throw Error(n(317));U[Th]=w}else Ph(),(w.flags&128)===0&&(w.memoizedState=null),w.flags|=4;Oa(w),U=!1}else xd!==null&&(vR(xd),xd=null),U=!0;if(!U)return w.flags&65536?w:null}return(w.flags&128)!==0?(w.lanes=T,w):(F=F!==null,F!==(v!==null&&v.memoizedState!==null)&&F&&(w.child.flags|=8192,(w.mode&1)!==0&&(v===null||(Bs.current&1)!==0?Ko===0&&(Ko=3):wR())),w.updateQueue!==null&&(w.flags|=4),Oa(w),null);case 4:return Dg(),aR(v,w),v===null&&bg(w.stateNode.containerInfo),Oa(w),null;case 10:return Yk(w.type._context),Oa(w),null;case 17:return ec(w.type)&&Hk(),Oa(w),null;case 19:if(xs(Bs),U=w.memoizedState,U===null)return Oa(w),null;if(F=(w.flags&128)!==0,re=U.rendering,re===null)if(F)Vw(U,!1);else{if(Ko!==0||v!==null&&(v.flags&128)!==0)for(v=w.child;v!==null;){if(re=A_(v),re!==null){for(w.flags|=128,Vw(U,!1),F=re.updateQueue,F!==null&&(w.updateQueue=F,w.flags|=4),w.subtreeFlags=0,F=T,T=w.child;T!==null;)U=T,v=F,U.flags&=14680066,re=U.alternate,re===null?(U.childLanes=0,U.lanes=v,U.child=null,U.subtreeFlags=0,U.memoizedProps=null,U.memoizedState=null,U.updateQueue=null,U.dependencies=null,U.stateNode=null):(U.childLanes=re.childLanes,U.lanes=re.lanes,U.child=re.child,U.subtreeFlags=0,U.deletions=null,U.memoizedProps=re.memoizedProps,U.memoizedState=re.memoizedState,U.updateQueue=re.updateQueue,U.type=re.type,v=re.dependencies,U.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext}),T=T.sibling;return fs(Bs,Bs.current&1|2),w.child}v=v.sibling}U.tail!==null&&Ei()>F_&&(w.flags|=128,F=!0,Vw(U,!1),w.lanes=4194304)}else{if(!F)if(v=A_(re),v!==null){if(w.flags|=128,F=!0,T=v.updateQueue,T!==null&&(w.updateQueue=T,w.flags|=4),Vw(U,!0),U.tail===null&&U.tailMode==="hidden"&&!re.alternate&&!ks)return Oa(w),null}else 2*Ei()-U.renderingStartTime>F_&&T!==1073741824&&(w.flags|=128,F=!0,Vw(U,!1),w.lanes=4194304);U.isBackwards?(re.sibling=w.child,w.child=re):(T=U.last,T!==null?T.sibling=re:w.child=re,U.last=re)}return U.tail!==null?(w=U.tail,U.rendering=w,U.tail=w.sibling,U.renderingStartTime=Ei(),w.sibling=null,T=Bs.current,fs(Bs,F?T&1|2:T&1),w):(Oa(w),null);case 22:case 23:return yR(),F=w.memoizedState!==null,v!==null&&v.memoizedState!==null!==F&&(w.flags|=8192),F&&(w.mode&1)!==0?(Oc&1073741824)!==0&&(Oa(w),w.subtreeFlags&6&&(w.flags|=8192)):Oa(w),null;case 24:return null;case 25:return null}throw Error(n(156,w.tag))}function bH(v,w){switch(I_(w),w.tag){case 1:return ec(w.type)&&Hk(),v=w.flags,v&65536?(w.flags=v&-65537|128,w):null;case 3:return Dg(),xs(Jl),xs(tl),tL(),v=w.flags,(v&65536)!==0&&(v&128)===0?(w.flags=v&-65537|128,w):null;case 5:return eL(w),null;case 13:if(xs(Bs),v=w.memoizedState,v!==null&&v.dehydrated!==null){if(w.alternate===null)throw Error(n(340));Ph()}return v=w.flags,v&65536?(w.flags=v&-65537|128,w):null;case 19:return xs(Bs),null;case 4:return Dg(),null;case 10:return Yk(w.type._context),null;case 22:case 23:return yR(),null;case 24:return null;default:return null}}var mL=!1,js=!1,Ll=typeof WeakSet=="function"?WeakSet:Set,_n=null;function Eb(v,w){var T=v.ref;if(T!==null)if(typeof T=="function")try{T(null)}catch(F){Xs(v,w,F)}else T.current=null}function Hw(v,w,T){try{T()}catch(F){Xs(v,w,F)}}var WF=!1;function yH(v,w){if(Sw=Ck,v=Gr(),mw(v)){if("selectionStart"in v)var T={start:v.selectionStart,end:v.selectionEnd};else e:{T=(T=v.ownerDocument)&&T.defaultView||window;var F=T.getSelection&&T.getSelection();if(F&&F.rangeCount!==0){T=F.anchorNode;var V=F.anchorOffset,U=F.focusNode;F=F.focusOffset;try{T.nodeType,U.nodeType}catch{T=null;break e}var re=0,be=-1,Re=-1,et=0,It=0,Nt=v,Lt=null;t:for(;;){for(var pn;Nt!==T||V!==0&&Nt.nodeType!==3||(be=re+V),Nt!==U||F!==0&&Nt.nodeType!==3||(Re=re+F),Nt.nodeType===3&&(re+=Nt.nodeValue.length),(pn=Nt.firstChild)!==null;)Lt=Nt,Nt=pn;for(;;){if(Nt===v)break t;if(Lt===T&&++et===V&&(be=re),Lt===U&&++It===F&&(Re=re),(pn=Nt.nextSibling)!==null)break;Nt=Lt,Lt=Nt.parentNode}Nt=pn}T=be===-1||Re===-1?null:{start:be,end:Re}}else T=null}T=T||{start:0,end:0}}else T=null;for(k_={focusedElem:v,selectionRange:T},Ck=!1,_n=w;_n!==null;)if(w=_n,v=w.child,(w.subtreeFlags&1028)!==0&&v!==null)v.return=w,_n=v;else for(;_n!==null;){w=_n;try{var Cn=w.alternate;if((w.flags&1024)!==0)switch(w.tag){case 0:case 11:case 15:break;case 1:if(Cn!==null){var Dn=Cn.memoizedProps,bo=Cn.memoizedState,Ke=w.stateNode,Me=Ke.getSnapshotBeforeUpdate(w.elementType===w.type?Dn:Du(w.type,Dn),bo);Ke.__reactInternalSnapshotBeforeUpdate=Me}break;case 3:var Ge=w.stateNode.containerInfo;Ge.nodeType===1?Ge.textContent="":Ge.nodeType===9&&Ge.documentElement&&Ge.removeChild(Ge.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Wt){Xs(w,w.return,Wt)}if(v=w.sibling,v!==null){v.return=w.return,_n=v;break}_n=w.return}return Cn=WF,WF=!1,Cn}function tp(v,w,T){var F=w.updateQueue;if(F=F!==null?F.lastEffect:null,F!==null){var V=F=F.next;do{if((V.tag&v)===v){var U=V.destroy;V.destroy=void 0,U!==void 0&&Hw(w,T,U)}V=V.next}while(V!==F)}}function Uw(v,w){if(w=w.updateQueue,w=w!==null?w.lastEffect:null,w!==null){var T=w=w.next;do{if((T.tag&v)===v){var F=T.create;T.destroy=F()}T=T.next}while(T!==w)}}function _L(v){var w=v.ref;if(w!==null){var T=v.stateNode;switch(v.tag){case 5:v=T;break;default:v=T}typeof w=="function"?w(v):w.current=v}}function $F(v){var w=v.alternate;w!==null&&(v.alternate=null,$F(w)),v.child=null,v.deletions=null,v.sibling=null,v.tag===5&&(w=v.stateNode,w!==null&&(delete w[Th],delete w[Cg],delete w[zk],delete w[he],delete w[fb])),v.stateNode=null,v.return=null,v.dependencies=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.stateNode=null,v.updateQueue=null}function zF(v){return v.tag===5||v.tag===3||v.tag===4}function VF(v){e:for(;;){for(;v.sibling===null;){if(v.return===null||zF(v.return))return null;v=v.return}for(v.sibling.return=v.return,v=v.sibling;v.tag!==5&&v.tag!==6&&v.tag!==18;){if(v.flags&2||v.child===null||v.tag===4)continue e;v.child.return=v,v=v.child}if(!(v.flags&2))return v.stateNode}}function cR(v,w,T){var F=v.tag;if(F===5||F===6)v=v.stateNode,w?T.nodeType===8?T.parentNode.insertBefore(v,w):T.insertBefore(v,w):(T.nodeType===8?(w=T.parentNode,w.insertBefore(v,T)):(w=T,w.appendChild(v)),T=T._reactRootContainer,T!=null||w.onclick!==null||(w.onclick=Wk));else if(F!==4&&(v=v.child,v!==null))for(cR(v,w,T),v=v.sibling;v!==null;)cR(v,w,T),v=v.sibling}function vL(v,w,T){var F=v.tag;if(F===5||F===6)v=v.stateNode,w?T.insertBefore(v,w):T.appendChild(v);else if(F!==4&&(v=v.child,v!==null))for(vL(v,w,T),v=v.sibling;v!==null;)vL(v,w,T),v=v.sibling}var _a=null,Dd=!1;function zh(v,w,T){for(T=T.child;T!==null;)uR(v,w,T),T=T.sibling}function uR(v,w,T){if(Uo&&typeof Uo.onCommitFiberUnmount=="function")try{Uo.onCommitFiberUnmount(Ic,T)}catch{}switch(T.tag){case 5:js||Eb(T,w);case 6:var F=_a,V=Dd;_a=null,zh(v,w,T),_a=F,Dd=V,_a!==null&&(Dd?(v=_a,T=T.stateNode,v.nodeType===8?v.parentNode.removeChild(T):v.removeChild(T)):_a.removeChild(T.stateNode));break;case 18:_a!==null&&(Dd?(v=_a,T=T.stateNode,v.nodeType===8?AT(v.parentNode,T):v.nodeType===1&&AT(v,T),Mr(v)):AT(_a,T.stateNode));break;case 4:F=_a,V=Dd,_a=T.stateNode.containerInfo,Dd=!0,zh(v,w,T),_a=F,Dd=V;break;case 0:case 11:case 14:case 15:if(!js&&(F=T.updateQueue,F!==null&&(F=F.lastEffect,F!==null))){V=F=F.next;do{var U=V,re=U.destroy;U=U.tag,re!==void 0&&((U&2)!==0||(U&4)!==0)&&Hw(T,w,re),V=V.next}while(V!==F)}zh(v,w,T);break;case 1:if(!js&&(Eb(T,w),F=T.stateNode,typeof F.componentWillUnmount=="function"))try{F.props=T.memoizedProps,F.state=T.memoizedState,F.componentWillUnmount()}catch(be){Xs(T,w,be)}zh(v,w,T);break;case 21:zh(v,w,T);break;case 22:T.mode&1?(js=(F=js)||T.memoizedState!==null,zh(v,w,T),js=F):zh(v,w,T);break;default:zh(v,w,T)}}function Ib(v){var w=v.updateQueue;if(w!==null){v.updateQueue=null;var T=v.stateNode;T===null&&(T=v.stateNode=new Ll),w.forEach(function(F){var V=DH.bind(null,v,F);T.has(F)||(T.add(F),F.then(V,V))})}}function Pc(v,w){var T=w.deletions;if(T!==null)for(var F=0;F<T.length;F++){var V=T[F];try{var U=v,re=w,be=re;e:for(;be!==null;){switch(be.tag){case 5:_a=be.stateNode,Dd=!1;break e;case 3:_a=be.stateNode.containerInfo,Dd=!0;break e;case 4:_a=be.stateNode.containerInfo,Dd=!0;break e}be=be.return}if(_a===null)throw Error(n(160));uR(U,re,V),_a=null,Dd=!1;var Re=V.alternate;Re!==null&&(Re.return=null),V.return=null}catch(et){Xs(V,w,et)}}if(w.subtreeFlags&12854)for(w=w.child;w!==null;)dR(w,v),w=w.sibling}function dR(v,w){var T=v.alternate,F=v.flags;switch(v.tag){case 0:case 11:case 14:case 15:if(Pc(w,v),Ed(v),F&4){try{tp(3,v,v.return),Uw(3,v)}catch(Dn){Xs(v,v.return,Dn)}try{tp(5,v,v.return)}catch(Dn){Xs(v,v.return,Dn)}}break;case 1:Pc(w,v),Ed(v),F&512&&T!==null&&Eb(T,T.return);break;case 5:if(Pc(w,v),Ed(v),F&512&&T!==null&&Eb(T,T.return),v.flags&32){var V=v.stateNode;try{Oe(V,"")}catch(Dn){Xs(v,v.return,Dn)}}if(F&4&&(V=v.stateNode,V!=null)){var U=v.memoizedProps,re=T!==null?T.memoizedProps:U,be=v.type,Re=v.updateQueue;if(v.updateQueue=null,Re!==null)try{be==="input"&&U.type==="radio"&&U.name!=null&&Vt(V,U),Dt(be,re);var et=Dt(be,U);for(re=0;re<Re.length;re+=2){var It=Re[re],Nt=Re[re+1];It==="style"?Mt(V,Nt):It==="dangerouslySetInnerHTML"?nt(V,Nt):It==="children"?Oe(V,Nt):x(V,It,Nt,et)}switch(be){case"input":Ot(V,U);break;case"textarea":ae(V,U);break;case"select":var Lt=V._wrapperState.wasMultiple;V._wrapperState.wasMultiple=!!U.multiple;var pn=U.value;pn!=null?ge(V,!!U.multiple,pn,!1):Lt!==!!U.multiple&&(U.defaultValue!=null?ge(V,!!U.multiple,U.defaultValue,!0):ge(V,!!U.multiple,U.multiple?[]:"",!1))}V[Cg]=U}catch(Dn){Xs(v,v.return,Dn)}}break;case 6:if(Pc(w,v),Ed(v),F&4){if(v.stateNode===null)throw Error(n(162));V=v.stateNode,U=v.memoizedProps;try{V.nodeValue=U}catch(Dn){Xs(v,v.return,Dn)}}break;case 3:if(Pc(w,v),Ed(v),F&4&&T!==null&&T.memoizedState.isDehydrated)try{Mr(w.containerInfo)}catch(Dn){Xs(v,v.return,Dn)}break;case 4:Pc(w,v),Ed(v);break;case 13:Pc(w,v),Ed(v),V=v.child,V.flags&8192&&(U=V.memoizedState!==null,V.stateNode.isHidden=U,!U||V.alternate!==null&&V.alternate.memoizedState!==null||(pR=Ei())),F&4&&Ib(v);break;case 22:if(It=T!==null&&T.memoizedState!==null,v.mode&1?(js=(et=js)||It,Pc(w,v),js=et):Pc(w,v),Ed(v),F&8192){if(et=v.memoizedState!==null,(v.stateNode.isHidden=et)&&!It&&(v.mode&1)!==0)for(_n=v,It=v.child;It!==null;){for(Nt=_n=It;_n!==null;){switch(Lt=_n,pn=Lt.child,Lt.tag){case 0:case 11:case 14:case 15:tp(4,Lt,Lt.return);break;case 1:Eb(Lt,Lt.return);var Cn=Lt.stateNode;if(typeof Cn.componentWillUnmount=="function"){F=Lt,T=Lt.return;try{w=F,Cn.props=w.memoizedProps,Cn.state=w.memoizedState,Cn.componentWillUnmount()}catch(Dn){Xs(F,T,Dn)}}break;case 5:Eb(Lt,Lt.return);break;case 22:if(Lt.memoizedState!==null){Tg(Nt);continue}}pn!==null?(pn.return=Lt,_n=pn):Tg(Nt)}It=It.sibling}e:for(It=null,Nt=v;;){if(Nt.tag===5){if(It===null){It=Nt;try{V=Nt.stateNode,et?(U=V.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none"):(be=Nt.stateNode,Re=Nt.memoizedProps.style,re=Re!=null&&Re.hasOwnProperty("display")?Re.display:null,be.style.display=$t("display",re))}catch(Dn){Xs(v,v.return,Dn)}}}else if(Nt.tag===6){if(It===null)try{Nt.stateNode.nodeValue=et?"":Nt.memoizedProps}catch(Dn){Xs(v,v.return,Dn)}}else if((Nt.tag!==22&&Nt.tag!==23||Nt.memoizedState===null||Nt===v)&&Nt.child!==null){Nt.child.return=Nt,Nt=Nt.child;continue}if(Nt===v)break e;for(;Nt.sibling===null;){if(Nt.return===null||Nt.return===v)break e;It===Nt&&(It=null),Nt=Nt.return}It===Nt&&(It=null),Nt.sibling.return=Nt.return,Nt=Nt.sibling}}break;case 19:Pc(w,v),Ed(v),F&4&&Ib(v);break;case 21:break;default:Pc(w,v),Ed(v)}}function Ed(v){var w=v.flags;if(w&2){try{e:{for(var T=v.return;T!==null;){if(zF(T)){var F=T;break e}T=T.return}throw Error(n(160))}switch(F.tag){case 5:var V=F.stateNode;F.flags&32&&(Oe(V,""),F.flags&=-33);var U=VF(v);vL(v,U,V);break;case 3:case 4:var re=F.stateNode.containerInfo,be=VF(v);cR(v,be,re);break;default:throw Error(n(161))}}catch(Re){Xs(v,v.return,Re)}v.flags&=-3}w&4096&&(v.flags&=-4097)}function bL(v,w,T){_n=v,hR(v)}function hR(v,w,T){for(var F=(v.mode&1)!==0;_n!==null;){var V=_n,U=V.child;if(V.tag===22&&F){var re=V.memoizedState!==null||mL;if(!re){var be=V.alternate,Re=be!==null&&be.memoizedState!==null||js;be=mL;var et=js;if(mL=re,(js=Re)&&!et)for(_n=V;_n!==null;)re=_n,Re=re.child,re.tag===22&&re.memoizedState!==null?HF(V):Re!==null?(Re.return=re,_n=Re):HF(V);for(;U!==null;)_n=U,hR(U),U=U.sibling;_n=V,mL=be,js=et}Id(v)}else(V.subtreeFlags&8772)!==0&&U!==null?(U.return=V,_n=U):Id(v)}}function Id(v){for(;_n!==null;){var w=_n;if((w.flags&8772)!==0){var T=w.alternate;try{if((w.flags&8772)!==0)switch(w.tag){case 0:case 11:case 15:js||Uw(5,w);break;case 1:var F=w.stateNode;if(w.flags&4&&!js)if(T===null)F.componentDidMount();else{var V=w.elementType===w.type?T.memoizedProps:Du(w.type,T.memoizedProps);F.componentDidUpdate(V,T.memoizedState,F.__reactInternalSnapshotBeforeUpdate)}var U=w.updateQueue;U!==null&&BT(w,U,F);break;case 3:var re=w.updateQueue;if(re!==null){if(T=null,w.child!==null)switch(w.child.tag){case 5:T=w.child.stateNode;break;case 1:T=w.child.stateNode}BT(w,re,T)}break;case 5:var be=w.stateNode;if(T===null&&w.flags&4){T=be;var Re=w.memoizedProps;switch(w.type){case"button":case"input":case"select":case"textarea":Re.autoFocus&&T.focus();break;case"img":Re.src&&(T.src=Re.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(w.memoizedState===null){var et=w.alternate;if(et!==null){var It=et.memoizedState;if(It!==null){var Nt=It.dehydrated;Nt!==null&&Mr(Nt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}js||w.flags&512&&_L(w)}catch(Lt){Xs(w,w.return,Lt)}}if(w===v){_n=null;break}if(T=w.sibling,T!==null){T.return=w.return,_n=T;break}_n=w.return}}function Tg(v){for(;_n!==null;){var w=_n;if(w===v){_n=null;break}var T=w.sibling;if(T!==null){T.return=w.return,_n=T;break}_n=w.return}}function HF(v){for(;_n!==null;){var w=_n;try{switch(w.tag){case 0:case 11:case 15:var T=w.return;try{Uw(4,w)}catch(Re){Xs(w,T,Re)}break;case 1:var F=w.stateNode;if(typeof F.componentDidMount=="function"){var V=w.return;try{F.componentDidMount()}catch(Re){Xs(w,V,Re)}}var U=w.return;try{_L(w)}catch(Re){Xs(w,U,Re)}break;case 5:var re=w.return;try{_L(w)}catch(Re){Xs(w,re,Re)}}}catch(Re){Xs(w,w.return,Re)}if(w===v){_n=null;break}var be=w.sibling;if(be!==null){be.return=w.return,_n=be;break}_n=w.return}}var UF=Math.ceil,yL=k.ReactCurrentDispatcher,fR=k.ReactCurrentOwner,Eu=k.ReactCurrentBatchConfig,pr=0,va=null,To=null,Fa=0,Oc=0,Tb=Ql(0),Ko=0,qw=null,Rg=0,Kw=0,wL=0,Gw=null,ic=null,pR=0,F_=1/0,np=null,CL=!1,gR=null,Ag=null,SL=!1,Ng=null,Dl=0,Xw=0,mR=null,xL=-1,Yw=0;function El(){return(pr&6)!==0?Ei():xL!==-1?xL:xL=Ei()}function Mg(v){return(v.mode&1)===0?1:(pr&2)!==0&&Fa!==0?Fa&-Fa:xF.transition!==null?(Yw===0&&(Yw=uT()),Yw):(v=Tr,v!==0||(v=window.event,v=v===void 0?16:Y4(v.type)),v)}function Td(v,w,T,F){if(50<Xw)throw Xw=0,mR=null,Error(n(185));uw(v,T,F),((pr&2)===0||v!==va)&&(v===va&&((pr&2)===0&&(Kw|=T),Ko===4&&Pg(v,Fa)),rc(v,F),T===1&&pr===0&&(w.mode&1)===0&&(F_=Ei()+500,Uk&&xg()))}function rc(v,w){var T=v.callbackNode;ZV(v,w);var F=v_(v,v===va?Fa:0);if(F===0)T!==null&&bn(T),v.callbackNode=null,v.callbackPriority=0;else if(w=F&-F,v.callbackPriority!==w){if(T!=null&&bn(T),w===1)v.tag===0?L_(qF.bind(null,v)):wF(qF.bind(null,v)),$k(function(){(pr&6)===0&&xg()}),T=null;else{switch(b_(F)){case 1:T=Xv;break;case 4:T=lw;break;case 16:T=Dh;break;case 536870912:T=Yi;break;default:T=Dh}T=JF(T,kL.bind(null,v))}v.callbackPriority=w,v.callbackNode=T}}function kL(v,w){if(xL=-1,Yw=0,(pr&6)!==0)throw Error(n(327));var T=v.callbackNode;if(Rb()&&v.callbackNode!==T)return null;var F=v_(v,v===va?Fa:0);if(F===0)return null;if((F&30)!==0||(F&v.expiredLanes)!==0||w)w=LL(v,F);else{w=F;var V=pr;pr|=2;var U=GF();(va!==v||Fa!==w)&&(np=null,F_=Ei()+500,j_(v,w));do try{SH();break}catch(be){KF(v,be)}while(!0);Gf(),yL.current=U,pr=V,To!==null?w=0:(va=null,Fa=0,w=Ko)}if(w!==0){if(w===2&&(V=vk(v),V!==0&&(F=V,w=_R(v,V))),w===1)throw T=qw,j_(v,0),Pg(v,F),rc(v,Ei()),T;if(w===6)Pg(v,F);else{if(V=v.current.alternate,(F&30)===0&&!wH(V)&&(w=LL(v,F),w===2&&(U=vk(v),U!==0&&(F=U,w=_R(v,U))),w===1))throw T=qw,j_(v,0),Pg(v,F),rc(v,Ei()),T;switch(v.finishedWork=V,v.finishedLanes=F,w){case 0:case 1:throw Error(n(345));case 2:W_(v,ic,np);break;case 3:if(Pg(v,F),(F&130023424)===F&&(w=pR+500-Ei(),10<w)){if(v_(v,0)!==0)break;if(V=v.suspendedLanes,(V&F)!==F){El(),v.pingedLanes|=v.suspendedLanes&V;break}v.timeoutHandle=yg(W_.bind(null,v,ic,np),w);break}W_(v,ic,np);break;case 4:if(Pg(v,F),(F&4194240)===F)break;for(w=v.eventTimes,V=-1;0<F;){var re=31-Cd(F);U=1<<re,re=w[re],re>V&&(V=re),F&=~U}if(F=V,F=Ei()-F,F=(120>F?120:480>F?480:1080>F?1080:1920>F?1920:3e3>F?3e3:4320>F?4320:1960*UF(F/1960))-F,10<F){v.timeoutHandle=yg(W_.bind(null,v,ic,np),F);break}W_(v,ic,np);break;case 5:W_(v,ic,np);break;default:throw Error(n(329))}}}return rc(v,Ei()),v.callbackNode===T?kL.bind(null,v):null}function _R(v,w){var T=Gw;return v.current.memoizedState.isDehydrated&&(j_(v,w).flags|=256),v=LL(v,w),v!==2&&(w=ic,ic=T,w!==null&&vR(w)),v}function vR(v){ic===null?ic=v:ic.push.apply(ic,v)}function wH(v){for(var w=v;;){if(w.flags&16384){var T=w.updateQueue;if(T!==null&&(T=T.stores,T!==null))for(var F=0;F<T.length;F++){var V=T[F],U=V.getSnapshot;V=V.value;try{if(!Qe(U(),V))return!1}catch{return!1}}}if(T=w.child,w.subtreeFlags&16384&&T!==null)T.return=w,w=T;else{if(w===v)break;for(;w.sibling===null;){if(w.return===null||w.return===v)return!0;w=w.return}w.sibling.return=w.return,w=w.sibling}}return!0}function Pg(v,w){for(w&=~wL,w&=~Kw,v.suspendedLanes|=w,v.pingedLanes&=~w,v=v.expirationTimes;0<w;){var T=31-Cd(w),F=1<<T;v[T]=-1,w&=~F}}function qF(v){if((pr&6)!==0)throw Error(n(327));Rb();var w=v_(v,0);if((w&1)===0)return rc(v,Ei()),null;var T=LL(v,w);if(v.tag!==0&&T===2){var F=vk(v);F!==0&&(w=F,T=_R(v,F))}if(T===1)throw T=qw,j_(v,0),Pg(v,w),rc(v,Ei()),T;if(T===6)throw Error(n(345));return v.finishedWork=v.current.alternate,v.finishedLanes=w,W_(v,ic,np),rc(v,Ei()),null}function bR(v,w){var T=pr;pr|=1;try{return v(w)}finally{pr=T,pr===0&&(F_=Ei()+500,Uk&&xg())}}function B_(v){Ng!==null&&Ng.tag===0&&(pr&6)===0&&Rb();var w=pr;pr|=1;var T=Eu.transition,F=Tr;try{if(Eu.transition=null,Tr=1,v)return v()}finally{Tr=F,Eu.transition=T,pr=w,(pr&6)===0&&xg()}}function yR(){Oc=Tb.current,xs(Tb)}function j_(v,w){v.finishedWork=null,v.finishedLanes=0;var T=v.timeoutHandle;if(T!==-1&&(v.timeoutHandle=-1,kw(T)),To!==null)for(T=To.return;T!==null;){var F=T;switch(I_(F),F.tag){case 1:F=F.type.childContextTypes,F!=null&&Hk();break;case 3:Dg(),xs(Jl),xs(tl),tL();break;case 5:eL(F);break;case 4:Dg();break;case 13:xs(Bs);break;case 19:xs(Bs);break;case 10:Yk(F.type._context);break;case 22:case 23:yR()}T=T.return}if(va=v,To=v=Rd(v.current,null),Fa=Oc=w,Ko=0,qw=null,wL=Kw=Rg=0,ic=Gw=null,R_!==null){for(w=0;w<R_.length;w++)if(T=R_[w],F=T.interleaved,F!==null){T.interleaved=null;var V=F.next,U=T.pending;if(U!==null){var re=U.next;U.next=V,F.next=re}T.pending=F}R_=null}return v}function KF(v,w){do{var T=To;try{if(Gf(),Aw.current=aL,yb){for(var F=Gs.memoizedState;F!==null;){var V=F.queue;V!==null&&(V.pending=null),F=F.next}yb=!1}if(Eg=0,qo=vo=Gs=null,Nw=!1,N_=0,fR.current=null,T===null||T.return===null){Ko=1,qw=w,To=null;break}e:{var U=v,re=T.return,be=T,Re=w;if(w=Fa,be.flags|=32768,Re!==null&&typeof Re=="object"&&typeof Re.then=="function"){var et=Re,It=be,Nt=It.tag;if((It.mode&1)===0&&(Nt===0||Nt===11||Nt===15)){var Lt=It.alternate;Lt?(It.updateQueue=Lt.updateQueue,It.memoizedState=Lt.memoizedState,It.lanes=Lt.lanes):(It.updateQueue=null,It.memoizedState=null)}var pn=PF(re);if(pn!==null){pn.flags&=-257,eR(pn,re,be,U,w),pn.mode&1&&Bw(U,et,w),w=pn,Re=et;var Cn=w.updateQueue;if(Cn===null){var Dn=new Set;Dn.add(Re),w.updateQueue=Dn}else Cn.add(Re);break e}else{if((w&1)===0){Bw(U,et,w),wR();break e}Re=Error(n(426))}}else if(ks&&be.mode&1){var bo=PF(re);if(bo!==null){(bo.flags&65536)===0&&(bo.flags|=256),eR(bo,re,be,U,w),Oh(O_(Re,be));break e}}U=Re=O_(Re,be),Ko!==4&&(Ko=2),Gw===null?Gw=[U]:Gw.push(U),U=re;do{switch(U.tag){case 3:U.flags|=65536,w&=-w,U.lanes|=w;var Ke=Fw(U,Re,w);DF(U,Ke);break e;case 1:be=Re;var Me=U.type,Ge=U.stateNode;if((U.flags&128)===0&&(typeof Me.getDerivedStateFromError=="function"||Ge!==null&&typeof Ge.componentDidCatch=="function"&&(Ag===null||!Ag.has(Ge)))){U.flags|=65536,w&=-w,U.lanes|=w;var Wt=hL(U,be,w);DF(U,Wt);break e}}U=U.return}while(U!==null)}YF(T)}catch(In){w=In,To===T&&T!==null&&(To=T=T.return);continue}break}while(!0)}function GF(){var v=yL.current;return yL.current=aL,v===null?aL:v}function wR(){(Ko===0||Ko===3||Ko===2)&&(Ko=4),va===null||(Rg&268435455)===0&&(Kw&268435455)===0||Pg(va,Fa)}function LL(v,w){var T=pr;pr|=2;var F=GF();(va!==v||Fa!==w)&&(np=null,j_(v,w));do try{CH();break}catch(V){KF(v,V)}while(!0);if(Gf(),pr=T,yL.current=F,To!==null)throw Error(n(261));return va=null,Fa=0,Ko}function CH(){for(;To!==null;)XF(To)}function SH(){for(;To!==null&&!Yn();)XF(To)}function XF(v){var w=QF(v.alternate,v,Oc);v.memoizedProps=v.pendingProps,w===null?YF(v):To=w,fR.current=null}function YF(v){var w=v;do{var T=w.alternate;if(v=w.return,(w.flags&32768)===0){if(T=vH(T,w,Oc),T!==null){To=T;return}}else{if(T=bH(T,w),T!==null){T.flags&=32767,To=T;return}if(v!==null)v.flags|=32768,v.subtreeFlags=0,v.deletions=null;else{Ko=6,To=null;return}}if(w=w.sibling,w!==null){To=w;return}To=w=v}while(w!==null);Ko===0&&(Ko=5)}function W_(v,w,T){var F=Tr,V=Eu.transition;try{Eu.transition=null,Tr=1,xH(v,w,T,F)}finally{Eu.transition=V,Tr=F}return null}function xH(v,w,T,F){do Rb();while(Ng!==null);if((pr&6)!==0)throw Error(n(327));T=v.finishedWork;var V=v.finishedLanes;if(T===null)return null;if(v.finishedWork=null,v.finishedLanes=0,T===v.current)throw Error(n(177));v.callbackNode=null,v.callbackPriority=0;var U=T.lanes|T.childLanes;if(U4(v,U),v===va&&(To=va=null,Fa=0),(T.subtreeFlags&2064)===0&&(T.flags&2064)===0||SL||(SL=!0,JF(Dh,function(){return Rb(),null})),U=(T.flags&15990)!==0,(T.subtreeFlags&15990)!==0||U){U=Eu.transition,Eu.transition=null;var re=Tr;Tr=1;var be=pr;pr|=4,fR.current=null,yH(v,T),dR(T,v),pH(k_),Ck=!!Sw,k_=Sw=null,v.current=T,bL(T),fr(),pr=be,Tr=re,Eu.transition=U}else v.current=T;if(SL&&(SL=!1,Ng=v,Dl=V),U=v.pendingLanes,U===0&&(Ag=null),__(T.stateNode),rc(v,Ei()),w!==null)for(F=v.onRecoverableError,T=0;T<w.length;T++)V=w[T],F(V.value,{componentStack:V.stack,digest:V.digest});if(CL)throw CL=!1,v=gR,gR=null,v;return(Dl&1)!==0&&v.tag!==0&&Rb(),U=v.pendingLanes,(U&1)!==0?v===mR?Xw++:(Xw=0,mR=v):Xw=0,xg(),null}function Rb(){if(Ng!==null){var v=b_(Dl),w=Eu.transition,T=Tr;try{if(Eu.transition=null,Tr=16>v?16:v,Ng===null)var F=!1;else{if(v=Ng,Ng=null,Dl=0,(pr&6)!==0)throw Error(n(331));var V=pr;for(pr|=4,_n=v.current;_n!==null;){var U=_n,re=U.child;if((_n.flags&16)!==0){var be=U.deletions;if(be!==null){for(var Re=0;Re<be.length;Re++){var et=be[Re];for(_n=et;_n!==null;){var It=_n;switch(It.tag){case 0:case 11:case 15:tp(8,It,U)}var Nt=It.child;if(Nt!==null)Nt.return=It,_n=Nt;else for(;_n!==null;){It=_n;var Lt=It.sibling,pn=It.return;if($F(It),It===et){_n=null;break}if(Lt!==null){Lt.return=pn,_n=Lt;break}_n=pn}}}var Cn=U.alternate;if(Cn!==null){var Dn=Cn.child;if(Dn!==null){Cn.child=null;do{var bo=Dn.sibling;Dn.sibling=null,Dn=bo}while(Dn!==null)}}_n=U}}if((U.subtreeFlags&2064)!==0&&re!==null)re.return=U,_n=re;else e:for(;_n!==null;){if(U=_n,(U.flags&2048)!==0)switch(U.tag){case 0:case 11:case 15:tp(9,U,U.return)}var Ke=U.sibling;if(Ke!==null){Ke.return=U.return,_n=Ke;break e}_n=U.return}}var Me=v.current;for(_n=Me;_n!==null;){re=_n;var Ge=re.child;if((re.subtreeFlags&2064)!==0&&Ge!==null)Ge.return=re,_n=Ge;else e:for(re=Me;_n!==null;){if(be=_n,(be.flags&2048)!==0)try{switch(be.tag){case 0:case 11:case 15:Uw(9,be)}}catch(In){Xs(be,be.return,In)}if(be===re){_n=null;break e}var Wt=be.sibling;if(Wt!==null){Wt.return=be.return,_n=Wt;break e}_n=be.return}}if(pr=V,xg(),Uo&&typeof Uo.onPostCommitFiberRoot=="function")try{Uo.onPostCommitFiberRoot(Ic,v)}catch{}F=!0}return F}finally{Tr=T,Eu.transition=w}}return!1}function DL(v,w,T){w=O_(T,w),w=Fw(v,w,1),v=ku(v,w,1),w=El(),v!==null&&(uw(v,1,w),rc(v,w))}function Xs(v,w,T){if(v.tag===3)DL(v,v,T);else for(;w!==null;){if(w.tag===3){DL(w,v,T);break}else if(w.tag===1){var F=w.stateNode;if(typeof w.type.getDerivedStateFromError=="function"||typeof F.componentDidCatch=="function"&&(Ag===null||!Ag.has(F))){v=O_(T,v),v=hL(w,v,1),w=ku(w,v,1),v=El(),w!==null&&(uw(w,1,v),rc(w,v));break}}w=w.return}}function kH(v,w,T){var F=v.pingCache;F!==null&&F.delete(w),w=El(),v.pingedLanes|=v.suspendedLanes&T,va===v&&(Fa&T)===T&&(Ko===4||Ko===3&&(Fa&130023424)===Fa&&500>Ei()-pR?j_(v,0):wL|=T),rc(v,w)}function ZF(v,w){w===0&&((v.mode&1)===0?w=1:(w=_k,_k<<=1,(_k&130023424)===0&&(_k=4194304)));var T=El();v=Xf(v,w),v!==null&&(uw(v,w,T),rc(v,T))}function LH(v){var w=v.memoizedState,T=0;w!==null&&(T=w.retryLane),ZF(v,T)}function DH(v,w){var T=0;switch(v.tag){case 13:var F=v.stateNode,V=v.memoizedState;V!==null&&(T=V.retryLane);break;case 19:F=v.stateNode;break;default:throw Error(n(314))}F!==null&&F.delete(w),ZF(v,T)}var QF;QF=function(v,w,T){if(v!==null)if(v.memoizedProps!==w.pendingProps||Jl.current)kl=!0;else{if((v.lanes&T)===0&&(w.flags&128)===0)return kl=!1,BF(v,w,T);kl=(v.flags&131072)!==0}else kl=!1,ks&&(w.flags&1048576)!==0&&CF(w,Kk,w.index);switch(w.lanes=0,w.tag){case 2:var F=w.type;gL(v,w),v=w.pendingProps;var V=gb(w,tl.current);Lg(w,T),V=M_(null,w,F,v,V,T);var U=nL();return w.flags|=1,typeof V=="object"&&V!==null&&typeof V.render=="function"&&V.$$typeof===void 0?(w.tag=1,w.memoizedState=null,w.updateQueue=null,ec(F)?(U=!0,yu(w)):U=!1,w.memoizedState=V.state!==null&&V.state!==void 0?V.state:null,Qk(w),V.updater=uL,w.stateNode=V,V._reactInternals=w,JT(w,F,v,T),w=oR(null,w,F,!0,U,T)):(w.tag=0,ks&&U&&Lw(w),Ma(null,w,V,T),w=w.child),w;case 16:F=w.elementType;e:{switch(gL(v,w),v=w.pendingProps,V=F._init,F=V(F._payload),w.type=F,V=w.tag=IH(F),v=Du(F,v),V){case 0:w=rR(null,w,F,v,T);break e;case 1:w=sR(null,w,F,v,T);break e;case 11:w=OF(null,w,F,v,T);break e;case 14:w=tR(null,w,F,Du(F.type,v),T);break e}throw Error(n(306,F,""))}return w;case 0:return F=w.type,V=w.pendingProps,V=w.elementType===F?V:Du(F,V),rR(v,w,F,V,T);case 1:return F=w.type,V=w.pendingProps,V=w.elementType===F?V:Du(F,V),sR(v,w,F,V,T);case 3:e:{if(FF(w),v===null)throw Error(n(387));F=w.pendingProps,U=w.memoizedState,V=U.element,LF(v,w),vb(w,F,null,T);var re=w.memoizedState;if(F=re.element,U.isDehydrated)if(U={element:F,isDehydrated:!1,cache:re.cache,pendingSuspenseBoundaries:re.pendingSuspenseBoundaries,transitions:re.transitions},w.updateQueue.baseState=U,w.memoizedState=U,w.flags&256){V=O_(Error(n(423)),w),w=$h(v,w,F,T,V);break e}else if(F!==V){V=O_(Error(n(424)),w),w=$h(v,w,F,T,V);break e}else for(Nc=wg(w.stateNode.containerInfo.firstChild),il=w,ks=!0,xd=null,T=Xk(w,null,F,T),w.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(Ph(),F===V){w=Ld(v,w,T);break e}Ma(v,w,F,T)}w=w.child}return w;case 5:return WT(w),v===null&&tc(w),F=w.type,V=w.pendingProps,U=v!==null?v.memoizedProps:null,re=V.children,xw(F,V)?re=null:U!==null&&xw(F,U)&&(w.flags|=32),iR(v,w),Ma(v,w,re,T),w.child;case 6:return v===null&&tc(w),null;case 13:return pL(v,w,T);case 4:return jT(w,w.stateNode.containerInfo),F=w.pendingProps,v===null?w.child=oo(w,null,F,T):Ma(v,w,F,T),w.child;case 11:return F=w.type,V=w.pendingProps,V=w.elementType===F?V:Du(F,V),OF(v,w,F,V,T);case 7:return Ma(v,w,w.pendingProps,T),w.child;case 8:return Ma(v,w,w.pendingProps.children,T),w.child;case 12:return Ma(v,w,w.pendingProps.children,T),w.child;case 10:e:{if(F=w.type._context,V=w.pendingProps,U=w.memoizedProps,re=V.value,fs(Iw,F._currentValue),F._currentValue=re,U!==null)if(Qe(U.value,re)){if(U.children===V.children&&!Jl.current){w=Ld(v,w,T);break e}}else for(U=w.child,U!==null&&(U.return=w);U!==null;){var be=U.dependencies;if(be!==null){re=U.child;for(var Re=be.firstContext;Re!==null;){if(Re.context===F){if(U.tag===1){Re=Yf(-1,T&-T),Re.tag=2;var et=U.updateQueue;if(et!==null){et=et.shared;var It=et.pending;It===null?Re.next=Re:(Re.next=It.next,It.next=Re),et.pending=Re}}U.lanes|=T,Re=U.alternate,Re!==null&&(Re.lanes|=T),Na(U.return,T,w),be.lanes|=T;break}Re=Re.next}}else if(U.tag===10)re=U.type===w.type?null:U.child;else if(U.tag===18){if(re=U.return,re===null)throw Error(n(341));re.lanes|=T,be=re.alternate,be!==null&&(be.lanes|=T),Na(re,T,w),re=U.sibling}else re=U.child;if(re!==null)re.return=U;else for(re=U;re!==null;){if(re===w){re=null;break}if(U=re.sibling,U!==null){U.return=re.return,re=U;break}re=re.return}U=re}Ma(v,w,V.children,T),w=w.child}return w;case 9:return V=w.type,F=w.pendingProps.children,Lg(w,T),V=Su(V),F=F(V),w.flags|=1,Ma(v,w,F,T),w.child;case 14:return F=w.type,V=Du(F,w.pendingProps),V=Du(F.type,V),tR(v,w,F,V,T);case 15:return Wh(v,w,w.type,w.pendingProps,T);case 17:return F=w.type,V=w.pendingProps,V=w.elementType===F?V:Du(F,V),gL(v,w),w.tag=1,ec(F)?(v=!0,yu(w)):v=!1,Lg(w,T),P_(w,F,V),JT(w,F,V,T),oR(null,w,F,!0,v,T);case 19:return Ig(v,w,T);case 22:return nR(v,w,T)}throw Error(n(156,w.tag))};function JF(v,w){return En(v,w)}function EH(v,w,T,F){this.tag=v,this.key=T,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=w,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=F,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Iu(v,w,T,F){return new EH(v,w,T,F)}function EL(v){return v=v.prototype,!(!v||!v.isReactComponent)}function IH(v){if(typeof v=="function")return EL(v)?1:0;if(v!=null){if(v=v.$$typeof,v===O)return 11;if(v===z)return 14}return 2}function Rd(v,w){var T=v.alternate;return T===null?(T=Iu(v.tag,w,v.key,v.mode),T.elementType=v.elementType,T.type=v.type,T.stateNode=v.stateNode,T.alternate=v,v.alternate=T):(T.pendingProps=w,T.type=v.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=v.flags&14680064,T.childLanes=v.childLanes,T.lanes=v.lanes,T.child=v.child,T.memoizedProps=v.memoizedProps,T.memoizedState=v.memoizedState,T.updateQueue=v.updateQueue,w=v.dependencies,T.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext},T.sibling=v.sibling,T.index=v.index,T.ref=v.ref,T}function IL(v,w,T,F,V,U){var re=2;if(F=v,typeof v=="function")EL(v)&&(re=1);else if(typeof v=="string")re=5;else e:switch(v){case E:return $_(T.children,V,U,w);case A:re=8,V|=8;break;case M:return v=Iu(12,T,w,V|2),v.elementType=M,v.lanes=U,v;case B:return v=Iu(13,T,w,V),v.elementType=B,v.lanes=U,v;case j:return v=Iu(19,T,w,V),v.elementType=j,v.lanes=U,v;case Y:return TL(T,V,U,w);default:if(typeof v=="object"&&v!==null)switch(v.$$typeof){case N:re=10;break e;case P:re=9;break e;case O:re=11;break e;case z:re=14;break e;case H:re=16,F=null;break e}throw Error(n(130,v==null?v:typeof v,""))}return w=Iu(re,T,w,V),w.elementType=v,w.type=F,w.lanes=U,w}function $_(v,w,T,F){return v=Iu(7,v,F,w),v.lanes=T,v}function TL(v,w,T,F){return v=Iu(22,v,F,w),v.elementType=Y,v.lanes=T,v.stateNode={isHidden:!1},v}function CR(v,w,T){return v=Iu(6,v,null,w),v.lanes=T,v}function SR(v,w,T){return w=Iu(4,v.children!==null?v.children:[],v.key,w),w.lanes=T,w.stateNode={containerInfo:v.containerInfo,pendingChildren:null,implementation:v.implementation},w}function TH(v,w,T,F,V){this.tag=w,this.containerInfo=v,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cw(0),this.expirationTimes=cw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cw(0),this.identifierPrefix=F,this.onRecoverableError=V,this.mutableSourceEagerHydrationData=null}function xR(v,w,T,F,V,U,re,be,Re){return v=new TH(v,w,T,be,Re),w===1?(w=1,U===!0&&(w|=8)):w=0,U=Iu(3,null,null,w),v.current=U,U.stateNode=v,U.memoizedState={element:F,isDehydrated:T,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qk(U),v}function RH(v,w,T){var F=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:F==null?null:""+F,children:v,containerInfo:w,implementation:T}}function e3(v){if(!v)return Sg;v=v._reactInternals;e:{if(ma(v)!==v||v.tag!==1)throw Error(n(170));var w=v;do{switch(w.tag){case 3:w=w.stateNode.context;break e;case 1:if(ec(w.type)){w=w.stateNode.__reactInternalMemoizedMergedChildContext;break e}}w=w.return}while(w!==null);throw Error(n(171))}if(v.tag===1){var T=v.type;if(ec(T))return bF(v,T,w)}return w}function t3(v,w,T,F,V,U,re,be,Re){return v=xR(T,F,!0,v,V,U,re,be,Re),v.context=e3(null),T=v.current,F=El(),V=Mg(T),U=Yf(F,V),U.callback=w??null,ku(T,U,V),v.current.lanes=V,uw(v,V,F),rc(v,F),v}function RL(v,w,T,F){var V=w.current,U=El(),re=Mg(V);return T=e3(T),w.context===null?w.context=T:w.pendingContext=T,w=Yf(U,re),w.payload={element:v},F=F===void 0?null:F,F!==null&&(w.callback=F),v=ku(V,w,re),v!==null&&(Td(v,V,re,U),Jk(v,V,re)),re}function AL(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return v.child.stateNode;default:return v.child.stateNode}}function n3(v,w){if(v=v.memoizedState,v!==null&&v.dehydrated!==null){var T=v.retryLane;v.retryLane=T!==0&&T<w?T:w}}function kR(v,w){n3(v,w),(v=v.alternate)&&n3(v,w)}function AH(){return null}var i3=typeof reportError=="function"?reportError:function(v){console.error(v)};function NL(v){this._internalRoot=v}Zw.prototype.render=NL.prototype.render=function(v){var w=this._internalRoot;if(w===null)throw Error(n(409));RL(v,w,null,null)},Zw.prototype.unmount=NL.prototype.unmount=function(){var v=this._internalRoot;if(v!==null){this._internalRoot=null;var w=v.containerInfo;B_(function(){RL(null,v,null,null)}),w[Ac]=null}};function Zw(v){this._internalRoot=v}Zw.prototype.unstable_scheduleHydration=function(v){if(v){var w=hT();v={blockedOn:null,target:v,priority:w};for(var T=0;T<gg.length&&w!==0&&w<gg[T].priority;T++);gg.splice(T,0,v),T===0&&G4(v)}};function LR(v){return!(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)}function ML(v){return!(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11&&(v.nodeType!==8||v.nodeValue!==" react-mount-point-unstable "))}function r3(){}function NH(v,w,T,F,V){if(V){if(typeof F=="function"){var U=F;F=function(){var et=AL(re);U.call(et)}}var re=t3(w,F,v,0,null,!1,!1,"",r3);return v._reactRootContainer=re,v[Ac]=re.current,bg(v.nodeType===8?v.parentNode:v),B_(),re}for(;V=v.lastChild;)v.removeChild(V);if(typeof F=="function"){var be=F;F=function(){var et=AL(Re);be.call(et)}}var Re=xR(v,0,!1,null,null,!1,!1,"",r3);return v._reactRootContainer=Re,v[Ac]=Re.current,bg(v.nodeType===8?v.parentNode:v),B_(function(){RL(w,Re,T,F)}),Re}function z_(v,w,T,F,V){var U=T._reactRootContainer;if(U){var re=U;if(typeof V=="function"){var be=V;V=function(){var Re=AL(re);be.call(Re)}}RL(w,re,v,V)}else re=NH(T,w,v,V,F);return AL(re)}dT=function(v){switch(v.tag){case 3:var w=v.stateNode;if(w.current.memoizedState.isDehydrated){var T=Zv(w.pendingLanes);T!==0&&(dw(w,T|1),rc(w,Ei()),(pr&6)===0&&(F_=Ei()+500,xg()))}break;case 13:B_(function(){var F=Xf(v,1);if(F!==null){var V=El();Td(F,v,1,V)}}),kR(v,1)}},bk=function(v){if(v.tag===13){var w=Xf(v,134217728);if(w!==null){var T=El();Td(w,v,134217728,T)}kR(v,134217728)}},q4=function(v){if(v.tag===13){var w=Mg(v),T=Xf(v,w);if(T!==null){var F=El();Td(T,v,w,F)}kR(v,w)}},hT=function(){return Tr},fT=function(v,w){var T=Tr;try{return Tr=v,w()}finally{Tr=T}},pi=function(v,w,T){switch(w){case"input":if(Ot(v,T),w=T.name,T.type==="radio"&&w!=null){for(T=v;T.parentNode;)T=T.parentNode;for(T=T.querySelectorAll("input[name="+JSON.stringify(""+w)+'][type="radio"]'),w=0;w<T.length;w++){var F=T[w];if(F!==v&&F.form===v.form){var V=Vk(F);if(!V)throw Error(n(90));ut(F),Ot(F,V)}}}break;case"textarea":ae(v,T);break;case"select":w=T.value,w!=null&&ge(v,!!T.multiple,w,!1)}},Br=bR,Mn=B_;var MH={usingClientEntryPoint:!1,Events:[el,Ii,Vk,ds,Nr,bR]},Qw={findFiberByHostInstance:Rh,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},PH={bundleType:Qw.bundleType,version:Qw.version,rendererPackageName:Qw.rendererPackageName,rendererConfig:Qw.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(v){return v=Ne(v),v===null?null:v.stateNode},findFiberByHostInstance:Qw.findFiberByHostInstance||AH,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var PL=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!PL.isDisabled&&PL.supportsFiber)try{Ic=PL.inject(PH),Uo=PL}catch{}}return Nu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=MH,Nu.createPortal=function(v,w){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!LR(w))throw Error(n(200));return RH(v,w,null,T)},Nu.createRoot=function(v,w){if(!LR(v))throw Error(n(299));var T=!1,F="",V=i3;return w!=null&&(w.unstable_strictMode===!0&&(T=!0),w.identifierPrefix!==void 0&&(F=w.identifierPrefix),w.onRecoverableError!==void 0&&(V=w.onRecoverableError)),w=xR(v,1,!1,null,null,T,!1,F,V),v[Ac]=w.current,bg(v.nodeType===8?v.parentNode:v),new NL(w)},Nu.findDOMNode=function(v){if(v==null)return null;if(v.nodeType===1)return v;var w=v._reactInternals;if(w===void 0)throw typeof v.render=="function"?Error(n(188)):(v=Object.keys(v).join(","),Error(n(268,v)));return v=Ne(w),v=v===null?null:v.stateNode,v},Nu.flushSync=function(v){return B_(v)},Nu.hydrate=function(v,w,T){if(!ML(w))throw Error(n(200));return z_(null,v,w,!0,T)},Nu.hydrateRoot=function(v,w,T){if(!LR(v))throw Error(n(405));var F=T!=null&&T.hydratedSources||null,V=!1,U="",re=i3;if(T!=null&&(T.unstable_strictMode===!0&&(V=!0),T.identifierPrefix!==void 0&&(U=T.identifierPrefix),T.onRecoverableError!==void 0&&(re=T.onRecoverableError)),w=t3(w,null,v,1,T??null,V,!1,U,re),v[Ac]=w.current,bg(v),F)for(v=0;v<F.length;v++)T=F[v],V=T._getVersion,V=V(T._source),w.mutableSourceEagerHydrationData==null?w.mutableSourceEagerHydrationData=[T,V]:w.mutableSourceEagerHydrationData.push(T,V);return new Zw(w)},Nu.render=function(v,w,T){if(!ML(w))throw Error(n(200));return z_(null,v,w,!1,T)},Nu.unmountComponentAtNode=function(v){if(!ML(v))throw Error(n(40));return v._reactRootContainer?(B_(function(){z_(null,null,v,!1,function(){v._reactRootContainer=null,v[Ac]=null})}),!0):!1},Nu.unstable_batchedUpdates=bR,Nu.unstable_renderSubtreeIntoContainer=function(v,w,T,F){if(!ML(T))throw Error(n(200));if(v==null||v._reactInternals===void 0)throw Error(n(38));return z_(v,w,T,!1,F)},Nu.version="18.3.1-next-f1338f8080-20240426",Nu}var Dde;function Pke(){if(Dde)return uU.exports;Dde=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),uU.exports=n$e(),uU.exports}var Wre=Pke();const h3=ql(Wre),Ede={disabled:!1},d9=nn.createContext(null);var i$e=function(e){return e.scrollTop},eN="unmounted",IC="exited",TC="entering",BD="entered",SZ="exiting",Nf=function(i){Mke(e,i);function e(r,s){var o;o=i.call(this,r,s)||this;var a=s,l=a&&!a.isMounting?r.enter:r.appear,c;return o.appearStatus=null,r.in?l?(c=IC,o.appearStatus=TC):c=BD:r.unmountOnExit||r.mountOnEnter?c=eN:c=IC,o.state={status:c},o.nextCallback=null,o}e.getDerivedStateFromProps=function(s,o){var a=s.in;return a&&o.status===eN?{status:IC}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(s){var o=null;if(s!==this.props){var a=this.state.status;this.props.in?a!==TC&&a!==BD&&(o=TC):(a===TC||a===BD)&&(o=SZ)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var s=this.props.timeout,o,a,l;return o=a=l=s,s!=null&&typeof s!="number"&&(o=s.exit,a=s.enter,l=s.appear!==void 0?s.appear:a),{exit:o,enter:a,appear:l}},n.updateStatus=function(s,o){if(s===void 0&&(s=!1),o!==null)if(this.cancelNextCallback(),o===TC){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:h3.findDOMNode(this);a&&i$e(a)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===IC&&this.setState({status:eN})},n.performEnter=function(s){var o=this,a=this.props.enter,l=this.context?this.context.isMounting:s,c=this.props.nodeRef?[l]:[h3.findDOMNode(this),l],u=c[0],d=c[1],h=this.getTimeouts(),f=l?h.appear:h.enter;if(!s&&!a||Ede.disabled){this.safeSetState({status:BD},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:TC},function(){o.props.onEntering(u,d),o.onTransitionEnd(f,function(){o.safeSetState({status:BD},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var s=this,o=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:h3.findDOMNode(this);if(!o||Ede.disabled){this.safeSetState({status:IC},function(){s.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:SZ},function(){s.props.onExiting(l),s.onTransitionEnd(a.exit,function(){s.safeSetState({status:IC},function(){s.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},n.setNextCallback=function(s){var o=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,o.nextCallback=null,s(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(s,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:h3.findDOMNode(this),l=s==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}s!=null&&setTimeout(this.nextCallback,s)},n.render=function(){var s=this.state.status;if(s===eN)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var l=Dc(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return nn.createElement(d9.Provider,{value:null},typeof a=="function"?a(s,l):nn.cloneElement(nn.Children.only(a),l))},e}(nn.Component);Nf.contextType=d9;Nf.propTypes={};function zL(){}Nf.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:zL,onEntering:zL,onEntered:zL,onExit:zL,onExiting:zL,onExited:zL};Nf.UNMOUNTED=eN;Nf.EXITED=IC;Nf.ENTERING=TC;Nf.ENTERED=BD;Nf.EXITING=SZ;function r$e(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function $re(i,e){var n=function(o){return e&&$.isValidElement(o)?e(o):o},r=Object.create(null);return i&&$.Children.map(i,function(s){return s}).forEach(function(s){r[s.key]=n(s)}),r}function s$e(i,e){i=i||{},e=e||{};function n(d){return d in e?e[d]:i[d]}var r=Object.create(null),s=[];for(var o in i)o in e?s.length&&(r[o]=s,s=[]):s.push(o);var a,l={};for(var c in e){if(r[c])for(a=0;a<r[c].length;a++){var u=r[c][a];l[r[c][a]]=n(u)}l[c]=n(c)}for(a=0;a<s.length;a++)l[s[a]]=n(s[a]);return l}function aS(i,e,n){return n[e]!=null?n[e]:i.props[e]}function o$e(i,e){return $re(i.children,function(n){return $.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:aS(n,"appear",i),enter:aS(n,"enter",i),exit:aS(n,"exit",i)})})}function a$e(i,e,n){var r=$re(i.children),s=s$e(e,r);return Object.keys(s).forEach(function(o){var a=s[o];if($.isValidElement(a)){var l=o in e,c=o in r,u=e[o],d=$.isValidElement(u)&&!u.props.in;c&&(!l||d)?s[o]=$.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:aS(a,"exit",i),enter:aS(a,"enter",i)}):!c&&l&&!d?s[o]=$.cloneElement(a,{in:!1}):c&&l&&$.isValidElement(u)&&(s[o]=$.cloneElement(a,{onExited:n.bind(null,a),in:u.props.in,exit:aS(a,"exit",i),enter:aS(a,"enter",i)}))}}),s}var l$e=Object.values||function(i){return Object.keys(i).map(function(e){return i[e]})},c$e={component:"div",childFactory:function(e){return e}},zre=function(i){Mke(e,i);function e(r,s){var o;o=i.call(this,r,s)||this;var a=o.handleExited.bind(r$e(o));return o.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},o}var n=e.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(s,o){var a=o.children,l=o.handleExited,c=o.firstRender;return{children:c?o$e(s,l):a$e(s,a,l),firstRender:!1}},n.handleExited=function(s,o){var a=$re(this.props.children);s.key in a||(s.props.onExited&&s.props.onExited(o),this.mounted&&this.setState(function(l){var c=Bn({},l.children);return delete c[s.key],{children:c}}))},n.render=function(){var s=this.props,o=s.component,a=s.childFactory,l=Dc(s,["component","childFactory"]),c=this.state.contextValue,u=l$e(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,o===null?nn.createElement(d9.Provider,{value:c},u):nn.createElement(d9.Provider,{value:c},nn.createElement(o,l,u))},e}(nn.Component);zre.propTypes={};zre.defaultProps=c$e;const Ide={};function Oke(i,e){const n=$.useRef(Ide);return n.current===Ide&&(n.current=i(e)),n}const u$e=[];function d$e(i){$.useEffect(i,u$e)}class yW{constructor(){xt(this,"currentId",null);xt(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});xt(this,"disposeEffect",()=>this.clear)}static create(){return new yW}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function lS(){const i=Oke(yW.create).current;return d$e(i.disposeEffect),i}const Vre=i=>i.scrollTop;function s1(i,e){const{timeout:n,easing:r,style:s={}}=i;return{duration:s.transitionDuration??(typeof n=="number"?n:n[e.mode]||0),easing:s.transitionTimingFunction??(typeof r=="object"?r[e.mode]:r),delay:s.transitionDelay}}function h$e(i){return Xt("MuiCollapse",i)}Yt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const f$e=i=>{const{orientation:e,classes:n}=i,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Zt(r,h$e,n)},p$e=ye("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(jt(({theme:i})=>({height:0,overflow:"hidden",transition:i.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:i.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:e})=>e.state==="exited"&&!e.in&&e.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),g$e=ye("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),m$e=ye("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),_E=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiCollapse"}),{addEndListener:s,children:o,className:a,collapsedSize:l="0px",component:c,easing:u,in:d,onEnter:h,onEntered:f,onEntering:p,onExit:g,onExited:m,onExiting:_,orientation:b="vertical",style:y,timeout:x=Tke.standard,TransitionComponent:k=Nf,...D}=r,R={...r,orientation:b,collapsedSize:l},E=f$e(R),A=$i(),M=lS(),N=$.useRef(null),P=$.useRef(),O=typeof l=="number"?`${l}px`:l,B=b==="horizontal",j=B?"width":"height",z=$.useRef(null),H=mo(n,z),Y=me=>Ee=>{if(me){const je=z.current;Ee===void 0?me(je):me(je,Ee)}},X=()=>N.current?N.current[B?"clientWidth":"clientHeight"]:0,Q=Y((me,Ee)=>{N.current&&B&&(N.current.style.position="absolute"),me.style[j]=O,h&&h(me,Ee)}),ie=Y((me,Ee)=>{const je=X();N.current&&B&&(N.current.style.position="");const{duration:qe,easing:Ze}=s1({style:y,timeout:x,easing:u},{mode:"enter"});if(x==="auto"){const We=A.transitions.getAutoHeightDuration(je);me.style.transitionDuration=`${We}ms`,P.current=We}else me.style.transitionDuration=typeof qe=="string"?qe:`${qe}ms`;me.style[j]=`${je}px`,me.style.transitionTimingFunction=Ze,p&&p(me,Ee)}),K=Y((me,Ee)=>{me.style[j]="auto",f&&f(me,Ee)}),ee=Y(me=>{me.style[j]=`${X()}px`,g&&g(me)}),le=Y(m),ke=Y(me=>{const Ee=X(),{duration:je,easing:qe}=s1({style:y,timeout:x,easing:u},{mode:"exit"});if(x==="auto"){const Ze=A.transitions.getAutoHeightDuration(Ee);me.style.transitionDuration=`${Ze}ms`,P.current=Ze}else me.style.transitionDuration=typeof je=="string"?je:`${je}ms`;me.style[j]=O,me.style.transitionTimingFunction=qe,_&&_(me)}),xe=me=>{x==="auto"&&M.start(P.current||0,me),s&&s(z.current,me)};return C.jsx(k,{in:d,onEnter:Q,onEntered:K,onEntering:ie,onExit:ee,onExited:le,onExiting:ke,addEndListener:xe,nodeRef:z,timeout:x==="auto"?null:x,...D,children:(me,{ownerState:Ee,...je})=>C.jsx(p$e,{as:c,className:dt(E.root,a,{entered:E.entered,exited:!d&&O==="0px"&&E.hidden}[me]),style:{[B?"minWidth":"minHeight"]:O,...y},ref:H,ownerState:{...R,state:me},...je,children:C.jsx(g$e,{ownerState:{...R,state:me},className:E.wrapper,ref:N,children:C.jsx(m$e,{ownerState:{...R,state:me},className:E.wrapperInner,children:o})})})})});_E&&(_E.muiSupportAuto=!0);function _$e(i){return Xt("MuiPaper",i)}Yt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const v$e=i=>{const{square:e,elevation:n,variant:r,classes:s}=i,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Zt(o,_$e,s)},b$e=ye("div",{name:"MuiPaper",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(jt(({theme:i})=>({backgroundColor:(i.vars||i).palette.background.paper,color:(i.vars||i).palette.text.primary,transition:i.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:i.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(i.vars||i).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),du=$.forwardRef(function(e,n){var p;const r=Qt({props:e,name:"MuiPaper"}),s=$i(),{className:o,component:a="div",elevation:l=1,square:c=!1,variant:u="elevation",...d}=r,h={...r,component:a,elevation:l,square:c,variant:u},f=v$e(h);return C.jsx(b$e,{as:a,ownerState:h,className:dt(f.root,o),ref:n,...d,style:{...u==="elevation"&&{"--Paper-shadow":(s.vars||s).shadows[l],...s.vars&&{"--Paper-overlay":(p=s.vars.overlays)==null?void 0:p[l]},...!s.vars&&s.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Pt("#fff",yZ(l))}, ${Pt("#fff",yZ(l))})`}},...d.style}})}),Fke=$.createContext({});function y$e(i){return typeof i=="string"}function Bke(i,e,n){return i===void 0||y$e(i)?e:{...e,ownerState:{...e.ownerState,...n}}}function jke(i,e,n){return typeof i=="function"?i(e,n):i}function VN(i,e=[]){if(i===void 0)return{};const n={};return Object.keys(i).filter(r=>r.match(/^on[A-Z]/)&&typeof i[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=i[r]}),n}function Tde(i){if(i===void 0)return{};const e={};return Object.keys(i).filter(n=>!(n.match(/^on[A-Z]/)&&typeof i[n]=="function")).forEach(n=>{e[n]=i[n]}),e}function Wke(i){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:s,className:o}=i;if(!e){const p=dt(n==null?void 0:n.className,o,s==null?void 0:s.className,r==null?void 0:r.className),g={...n==null?void 0:n.style,...s==null?void 0:s.style,...r==null?void 0:r.style},m={...n,...s,...r};return p.length>0&&(m.className=p),Object.keys(g).length>0&&(m.style=g),{props:m,internalRef:void 0}}const a=VN({...s,...r}),l=Tde(r),c=Tde(s),u=e(a),d=dt(u==null?void 0:u.className,n==null?void 0:n.className,o,s==null?void 0:s.className,r==null?void 0:r.className),h={...u==null?void 0:u.style,...n==null?void 0:n.style,...s==null?void 0:s.style,...r==null?void 0:r.style},f={...u,...n,...c,...l};return d.length>0&&(f.className=d),Object.keys(h).length>0&&(f.style=h),{props:f,internalRef:u.ref}}function an(i,e){const{className:n,elementType:r,ownerState:s,externalForwardedProps:o,internalForwardedProps:a,shouldForwardComponentProp:l=!1,...c}=e,{component:u,slots:d={[i]:void 0},slotProps:h={[i]:void 0},...f}=o,p=d[i]||r,g=jke(h[i],s),{props:{component:m,..._},internalRef:b}=Wke({className:n,...c,externalForwardedProps:i==="root"?f:void 0,externalSlotProps:g}),y=mo(b,g==null?void 0:g.ref,e.ref),x=i==="root"?m||u:m,k=Bke(p,{...i==="root"&&!u&&!d[i]&&a,...i!=="root"&&!d[i]&&a,..._,...x&&!l&&{as:x},...x&&l&&{component:x},ref:y},s);return[p,k]}function w$e(i){return Xt("MuiAccordion",i)}const f3=Yt("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),C$e=i=>{const{classes:e,square:n,expanded:r,disabled:s,disableGutters:o}=i;return Zt({root:["root",!n&&"rounded",r&&"expanded",s&&"disabled",!o&&"gutters"],heading:["heading"],region:["region"]},w$e,e)},S$e=ye(du,{name:"MuiAccordion",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[{[`& .${f3.region}`]:e.region},e.root,!n.square&&e.rounded,!n.disableGutters&&e.gutters]}})(jt(({theme:i})=>{const e={duration:i.transitions.duration.shortest};return{position:"relative",transition:i.transitions.create(["margin"],e),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(i.vars||i).palette.divider,transition:i.transitions.create(["opacity","background-color"],e)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${f3.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${f3.disabled}`]:{backgroundColor:(i.vars||i).palette.action.disabledBackground}}}),jt(({theme:i})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(i.vars||i).shape.borderRadius,borderTopRightRadius:(i.vars||i).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(i.vars||i).shape.borderRadius,borderBottomRightRadius:(i.vars||i).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${f3.expanded}`]:{margin:"16px 0"}}}]}))),x$e=ye("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),k$e=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiAccordion"}),{children:s,className:o,defaultExpanded:a=!1,disabled:l=!1,disableGutters:c=!1,expanded:u,onChange:d,square:h=!1,slots:f={},slotProps:p={},TransitionComponent:g,TransitionProps:m,..._}=r,[b,y]=Im({controlled:u,default:a,name:"Accordion",state:"expanded"}),x=$.useCallback(X=>{y(!b),d&&d(X,!b)},[b,d,y]),[k,...D]=$.Children.toArray(s),R=$.useMemo(()=>({expanded:b,disabled:l,disableGutters:c,toggle:x}),[b,l,c,x]),E={...r,square:h,disabled:l,disableGutters:c,expanded:b},A=C$e(E),M={transition:g,...f},N={transition:m,...p},P={slots:M,slotProps:N},[O,B]=an("root",{elementType:S$e,externalForwardedProps:{...P,..._},className:dt(A.root,o),shouldForwardComponentProp:!0,ownerState:E,ref:n,additionalProps:{square:h}}),[j,z]=an("heading",{elementType:x$e,externalForwardedProps:P,className:A.heading,ownerState:E}),[H,Y]=an("transition",{elementType:_E,externalForwardedProps:P,ownerState:E});return C.jsxs(O,{...B,children:[C.jsx(j,{...z,children:C.jsx(Fke.Provider,{value:R,children:k})}),C.jsx(H,{in:b,timeout:"auto",...Y,children:C.jsx("div",{"aria-labelledby":k.props.id,id:k.props["aria-controls"],role:"region",className:A.region,children:D})})]})});function L$e(i){return Xt("MuiAccordionDetails",i)}Yt("MuiAccordionDetails",["root"]);const D$e=i=>{const{classes:e}=i;return Zt({root:["root"]},L$e,e)},E$e=ye("div",{name:"MuiAccordionDetails",slot:"Root"})(jt(({theme:i})=>({padding:i.spacing(1,2,2)}))),I$e=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiAccordionDetails"}),{className:s,...o}=r,a=r,l=D$e(a);return C.jsx(E$e,{className:dt(l.root,s),ref:n,ownerState:a,...o})});function o1(i){try{return i.matches(":focus-visible")}catch{}return!1}class h9{constructor(){xt(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new h9}static use(){const e=Oke(h9.create).current,[n,r]=$.useState(!1);return e.shouldMount=n,e.setShouldMount=r,$.useEffect(e.mountEffect,[n]),e}mount(){return this.mounted||(this.mounted=R$e(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...e)})}stop(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...e)})}pulsate(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...e)})}}function T$e(){return h9.use()}function R$e(){let i,e;const n=new Promise((r,s)=>{i=r,e=s});return n.resolve=i,n.reject=e,n}function A$e(i){const{className:e,classes:n,pulsate:r=!1,rippleX:s,rippleY:o,rippleSize:a,in:l,onExited:c,timeout:u}=i,[d,h]=$.useState(!1),f=dt(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:a,height:a,top:-(a/2)+o,left:-(a/2)+s},g=dt(n.child,d&&n.childLeaving,r&&n.childPulsate);return!l&&!d&&h(!0),$.useEffect(()=>{if(!l&&c!=null){const m=setTimeout(c,u);return()=>{clearTimeout(m)}}},[c,l,u]),C.jsx("span",{className:f,style:p,children:C.jsx("span",{className:g})})}const nf=Yt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),xZ=550,N$e=80,M$e=tg`
0% {
transform: scale(0);
opacity: 0.1;
}
100% {
transform: scale(1);
opacity: 0.3;
}
`,P$e=tg`
0% {
opacity: 1;
}
100% {
opacity: 0;
}
`,O$e=tg`
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
`,F$e=ye("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),B$e=ye(A$e,{name:"MuiTouchRipple",slot:"Ripple"})`
opacity: 0;
position: absolute;
&.${nf.rippleVisible} {
opacity: 0.3;
transform: scale(1);
animation-name: ${M$e};
animation-duration: ${xZ}ms;
animation-timing-function: ${({theme:i})=>i.transitions.easing.easeInOut};
}
&.${nf.ripplePulsate} {
animation-duration: ${({theme:i})=>i.transitions.duration.shorter}ms;
}
& .${nf.child} {
opacity: 1;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
}
& .${nf.childLeaving} {
opacity: 0;
animation-name: ${P$e};
animation-duration: ${xZ}ms;
animation-timing-function: ${({theme:i})=>i.transitions.easing.easeInOut};
}
& .${nf.childPulsate} {
position: absolute;
/* @noflip */
left: 0px;
top: 0;
animation-name: ${O$e};
animation-duration: 2500ms;
animation-timing-function: ${({theme:i})=>i.transitions.easing.easeInOut};
animation-iteration-count: infinite;
animation-delay: 200ms;
}
`,j$e=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTouchRipple"}),{center:s=!1,classes:o={},className:a,...l}=r,[c,u]=$.useState([]),d=$.useRef(0),h=$.useRef(null);$.useEffect(()=>{h.current&&(h.current(),h.current=null)},[c]);const f=$.useRef(!1),p=lS(),g=$.useRef(null),m=$.useRef(null),_=$.useCallback(k=>{const{pulsate:D,rippleX:R,rippleY:E,rippleSize:A,cb:M}=k;u(N=>[...N,C.jsx(B$e,{classes:{ripple:dt(o.ripple,nf.ripple),rippleVisible:dt(o.rippleVisible,nf.rippleVisible),ripplePulsate:dt(o.ripplePulsate,nf.ripplePulsate),child:dt(o.child,nf.child),childLeaving:dt(o.childLeaving,nf.childLeaving),childPulsate:dt(o.childPulsate,nf.childPulsate)},timeout:xZ,pulsate:D,rippleX:R,rippleY:E,rippleSize:A},d.current)]),d.current+=1,h.current=M},[o]),b=$.useCallback((k={},D={},R=()=>{})=>{const{pulsate:E=!1,center:A=s||D.pulsate,fakeElement:M=!1}=D;if((k==null?void 0:k.type)==="mousedown"&&f.current){f.current=!1;return}(k==null?void 0:k.type)==="touchstart"&&(f.current=!0);const N=M?null:m.current,P=N?N.getBoundingClientRect():{width:0,height:0,left:0,top:0};let O,B,j;if(A||k===void 0||k.clientX===0&&k.clientY===0||!k.clientX&&!k.touches)O=Math.round(P.width/2),B=Math.round(P.height/2);else{const{clientX:z,clientY:H}=k.touches&&k.touches.length>0?k.touches[0]:k;O=Math.round(z-P.left),B=Math.round(H-P.top)}if(A)j=Math.sqrt((2*P.width**2+P.height**2)/3),j%2===0&&(j+=1);else{const z=Math.max(Math.abs((N?N.clientWidth:0)-O),O)*2+2,H=Math.max(Math.abs((N?N.clientHeight:0)-B),B)*2+2;j=Math.sqrt(z**2+H**2)}k!=null&&k.touches?g.current===null&&(g.current=()=>{_({pulsate:E,rippleX:O,rippleY:B,rippleSize:j,cb:R})},p.start(N$e,()=>{g.current&&(g.current(),g.current=null)})):_({pulsate:E,rippleX:O,rippleY:B,rippleSize:j,cb:R})},[s,_,p]),y=$.useCallback(()=>{b({},{pulsate:!0})},[b]),x=$.useCallback((k,D)=>{if(p.clear(),(k==null?void 0:k.type)==="touchend"&&g.current){g.current(),g.current=null,p.start(0,()=>{x(k,D)});return}g.current=null,u(R=>R.length>0?R.slice(1):R),h.current=D},[p]);return $.useImperativeHandle(n,()=>({pulsate:y,start:b,stop:x}),[y,b,x]),C.jsx(F$e,{className:dt(nf.root,o.root,a),ref:m,...l,children:C.jsx(zre,{component:null,exit:!0,children:c})})});function W$e(i){return Xt("MuiButtonBase",i)}const $$e=Yt("MuiButtonBase",["root","disabled","focusVisible"]),z$e=i=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:s}=i,a=Zt({root:["root",e&&"disabled",n&&"focusVisible"]},W$e,s);return n&&r&&(a.root+=` ${r}`),a},V$e=ye("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${$$e.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ud=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiButtonBase"}),{action:s,centerRipple:o=!1,children:a,className:l,component:c="button",disabled:u=!1,disableRipple:d=!1,disableTouchRipple:h=!1,focusRipple:f=!1,focusVisibleClassName:p,LinkComponent:g="a",onBlur:m,onClick:_,onContextMenu:b,onDragLeave:y,onFocus:x,onFocusVisible:k,onKeyDown:D,onKeyUp:R,onMouseDown:E,onMouseLeave:A,onMouseUp:M,onTouchEnd:N,onTouchMove:P,onTouchStart:O,tabIndex:B=0,TouchRippleProps:j,touchRippleRef:z,type:H,...Y}=r,X=$.useRef(null),Q=T$e(),ie=mo(Q.ref,z),[K,ee]=$.useState(!1);u&&K&&ee(!1),$.useImperativeHandle(s,()=>({focusVisible:()=>{ee(!0),X.current.focus()}}),[]);const le=Q.shouldMount&&!d&&!u;$.useEffect(()=>{K&&f&&!d&&Q.pulsate()},[d,f,K,Q]);const ke=K_(Q,"start",E,h),xe=K_(Q,"stop",b,h),me=K_(Q,"stop",y,h),Ee=K_(Q,"stop",M,h),je=K_(Q,"stop",pe=>{K&&pe.preventDefault(),A&&A(pe)},h),qe=K_(Q,"start",O,h),Ze=K_(Q,"stop",N,h),We=K_(Q,"stop",P,h),ut=K_(Q,"stop",pe=>{o1(pe.target)||ee(!1),m&&m(pe)},!1),st=Ha(pe=>{X.current||(X.current=pe.currentTarget),o1(pe.target)&&(ee(!0),k&&k(pe)),x&&x(pe)}),mt=()=>{const pe=X.current;return c&&c!=="button"&&!(pe.tagName==="A"&&pe.href)},Rt=Ha(pe=>{f&&!pe.repeat&&K&&pe.key===" "&&Q.stop(pe,()=>{Q.start(pe)}),pe.target===pe.currentTarget&&mt()&&pe.key===" "&&pe.preventDefault(),D&&D(pe),pe.target===pe.currentTarget&&mt()&&pe.key==="Enter"&&!u&&(pe.preventDefault(),_&&_(pe))}),Vt=Ha(pe=>{f&&pe.key===" "&&K&&!pe.defaultPrevented&&Q.stop(pe,()=>{Q.pulsate(pe)}),R&&R(pe),_&&pe.target===pe.currentTarget&&mt()&&pe.key===" "&&!pe.defaultPrevented&&_(pe)});let Ot=c;Ot==="button"&&(Y.href||Y.to)&&(Ot=g);const vt={};Ot==="button"?(vt.type=H===void 0?"button":H,vt.disabled=u):(!Y.href&&!Y.to&&(vt.role="button"),u&&(vt["aria-disabled"]=u));const wn=mo(n,X),Ce={...r,centerRipple:o,component:c,disabled:u,disableRipple:d,disableTouchRipple:h,focusRipple:f,tabIndex:B,focusVisible:K},ge=z$e(Ce);return C.jsxs(V$e,{as:Ot,className:dt(ge.root,l),ownerState:Ce,onBlur:ut,onClick:_,onContextMenu:xe,onFocus:st,onKeyDown:Rt,onKeyUp:Vt,onMouseDown:ke,onMouseLeave:je,onMouseUp:Ee,onDragLeave:me,onTouchEnd:Ze,onTouchMove:We,onTouchStart:qe,ref:wn,tabIndex:u?-1:B,type:H,...vt,...Y,children:[a,le?C.jsx(j$e,{ref:ie,center:o,...j}):null]})});function K_(i,e,n,r=!1){return Ha(s=>(n&&n(s),r||i[e](s),!0))}function H$e(i){return Xt("MuiAccordionSummary",i)}const ZD=Yt("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),U$e=i=>{const{classes:e,expanded:n,disabled:r,disableGutters:s}=i;return Zt({root:["root",n&&"expanded",r&&"disabled",!s&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!s&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},H$e,e)},q$e=ye(ud,{name:"MuiAccordionSummary",slot:"Root"})(jt(({theme:i})=>{const e={duration:i.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:i.spacing(0,2),transition:i.transitions.create(["min-height","background-color"],e),[`&.${ZD.focusVisible}`]:{backgroundColor:(i.vars||i).palette.action.focus},[`&.${ZD.disabled}`]:{opacity:(i.vars||i).palette.action.disabledOpacity},[`&:hover:not(.${ZD.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${ZD.expanded}`]:{minHeight:64}}}]}})),K$e=ye("span",{name:"MuiAccordionSummary",slot:"Content"})(jt(({theme:i})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:i.transitions.create(["margin"],{duration:i.transitions.duration.shortest}),[`&.${ZD.expanded}`]:{margin:"20px 0"}}}]}))),G$e=ye("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper"})(jt(({theme:i})=>({display:"flex",color:(i.vars||i).palette.action.active,transform:"rotate(0deg)",transition:i.transitions.create("transform",{duration:i.transitions.duration.shortest}),[`&.${ZD.expanded}`]:{transform:"rotate(180deg)"}}))),X$e=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiAccordionSummary"}),{children:s,className:o,expandIcon:a,focusVisibleClassName:l,onClick:c,slots:u,slotProps:d,...h}=r,{disabled:f=!1,disableGutters:p,expanded:g,toggle:m}=$.useContext(Fke),_=N=>{m&&m(N),c&&c(N)},b={...r,expanded:g,disabled:f,disableGutters:p},y=U$e(b),x={slots:u,slotProps:d},[k,D]=an("root",{ref:n,shouldForwardComponentProp:!0,className:dt(y.root,o),elementType:q$e,externalForwardedProps:{...x,...h},ownerState:b,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:f,"aria-expanded":g,focusVisibleClassName:dt(y.focusVisible,l)},getSlotProps:N=>({...N,onClick:P=>{var O;(O=N.onClick)==null||O.call(N,P),_(P)}})}),[R,E]=an("content",{className:y.content,elementType:K$e,externalForwardedProps:x,ownerState:b}),[A,M]=an("expandIconWrapper",{className:y.expandIconWrapper,elementType:G$e,externalForwardedProps:x,ownerState:b});return C.jsxs(k,{...D,children:[C.jsx(R,{...E,children:s}),a&&C.jsx(A,{...M,children:a})]})});function Y$e(i){return typeof i.main=="string"}function Z$e(i,e=[]){if(!Y$e(i))return!1;for(const n of e)if(!i.hasOwnProperty(n)||typeof i[n]!="string")return!1;return!0}function br(i=[]){return([,e])=>e&&Z$e(e,i)}function Q$e(i){return Xt("MuiAlert",i)}const Rde=Yt("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function J$e(i){return Xt("MuiCircularProgress",i)}Yt("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Nb=44,kZ=tg`
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`,LZ=tg`
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: -126px;
}
`,eze=typeof kZ!="string"?Mv`
animation: ${kZ} 1.4s linear infinite;
`:null,tze=typeof LZ!="string"?Mv`
animation: ${LZ} 1.4s ease-in-out infinite;
`:null,nze=i=>{const{classes:e,variant:n,color:r,disableShrink:s}=i,o={root:["root",n,`color${Ue(r)}`],svg:["svg"],circle:["circle",`circle${Ue(n)}`,s&&"circleDisableShrink"]};return Zt(o,J$e,e)},ize=ye("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant],e[`color${Ue(n.color)}`]]}})(jt(({theme:i})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:i.transitions.create("transform")}},{props:{variant:"indeterminate"},style:eze||{animation:`${kZ} 1.4s linear infinite`}},...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{color:(i.vars||i).palette[e].main}}))]}))),rze=ye("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),sze=ye("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.circle,e[`circle${Ue(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(jt(({theme:i})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:i.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink,style:tze||{animation:`${LZ} 1.4s ease-in-out infinite`}}]}))),c5=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiCircularProgress"}),{className:s,color:o="primary",disableShrink:a=!1,size:l=40,style:c,thickness:u=3.6,value:d=0,variant:h="indeterminate",...f}=r,p={...r,color:o,disableShrink:a,size:l,thickness:u,value:d,variant:h},g=nze(p),m={},_={},b={};if(h==="determinate"){const y=2*Math.PI*((Nb-u)/2);m.strokeDasharray=y.toFixed(3),b["aria-valuenow"]=Math.round(d),m.strokeDashoffset=`${((100-d)/100*y).toFixed(3)}px`,_.transform="rotate(-90deg)"}return C.jsx(ize,{className:dt(g.root,s),style:{width:l,height:l,..._,...c},ownerState:p,ref:n,role:"progressbar",...b,...f,children:C.jsx(rze,{className:g.svg,ownerState:p,viewBox:`${Nb/2} ${Nb/2} ${Nb} ${Nb}`,children:C.jsx(sze,{className:g.circle,style:m,ownerState:p,cx:Nb,cy:Nb,r:(Nb-u)/2,fill:"none",strokeWidth:u})})})});function oze(i){return Xt("MuiIconButton",i)}const Ade=Yt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),aze=i=>{const{classes:e,disabled:n,color:r,edge:s,size:o,loading:a}=i,l={root:["root",a&&"loading",n&&"disabled",r!=="default"&&`color${Ue(r)}`,s&&`edge${Ue(s)}`,`size${Ue(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Zt(l,oze,e)},lze=ye(ud,{name:"MuiIconButton",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.loading&&e.loading,n.color!=="default"&&e[`color${Ue(n.color)}`],n.edge&&e[`edge${Ue(n.edge)}`],e[`size${Ue(n.size)}`]]}})(jt(({theme:i})=>({textAlign:"center",flex:"0 0 auto",fontSize:i.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(i.vars||i).palette.action.active,transition:i.transitions.create("background-color",{duration:i.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":i.vars?`rgba(${i.vars.palette.action.activeChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette.action.active,i.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),jt(({theme:i})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{color:(i.vars||i).palette[e].main}})),...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{"--IconButton-hoverBg":i.vars?`rgba(${(i.vars||i).palette[e].mainChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt((i.vars||i).palette[e].main,i.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:i.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:i.typography.pxToRem(28)}}],[`&.${Ade.disabled}`]:{backgroundColor:"transparent",color:(i.vars||i).palette.action.disabled},[`&.${Ade.loading}`]:{color:"transparent"}}))),cze=ye("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:i})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(i.vars||i).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Ga=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiIconButton"}),{edge:s=!1,children:o,className:a,color:l="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium",id:h,loading:f=null,loadingIndicator:p,...g}=r,m=W1(h),_=p??C.jsx(c5,{"aria-labelledby":m,color:"inherit",size:16}),b={...r,edge:s,color:l,disabled:c,disableFocusRipple:u,loading:f,loadingIndicator:_,size:d},y=aze(b);return C.jsxs(lze,{id:f?m:h,className:dt(y.root,a),centerRipple:!0,focusRipple:!u,disabled:c||f,ref:n,...g,ownerState:b,children:[typeof f=="boolean"&&C.jsx("span",{className:y.loadingWrapper,style:{display:"contents"},children:C.jsx(cze,{className:y.loadingIndicator,ownerState:b,children:f&&_})}),o]})}),uze=Hr(C.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),dze=Hr(C.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),hze=Hr(C.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),fze=Hr(C.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),$ke=Hr(C.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),pze=i=>{const{variant:e,color:n,severity:r,classes:s}=i,o={root:["root",`color${Ue(n||r)}`,`${e}${Ue(n||r)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return Zt(o,Q$e,s)},gze=ye(du,{name:"MuiAlert",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant],e[`${n.variant}${Ue(n.color||n.severity)}`]]}})(jt(({theme:i})=>{const e=i.palette.mode==="light"?$m:qp,n=i.palette.mode==="light"?qp:$m;return{...i.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(i.palette).filter(br(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:i.vars?i.vars.palette.Alert[`${r}Color`]:e(i.palette[r].light,.6),backgroundColor:i.vars?i.vars.palette.Alert[`${r}StandardBg`]:n(i.palette[r].light,.9),[`& .${Rde.icon}`]:i.vars?{color:i.vars.palette.Alert[`${r}IconColor`]}:{color:i.palette[r].main}}})),...Object.entries(i.palette).filter(br(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:i.vars?i.vars.palette.Alert[`${r}Color`]:e(i.palette[r].light,.6),border:`1px solid ${(i.vars||i).palette[r].light}`,[`& .${Rde.icon}`]:i.vars?{color:i.vars.palette.Alert[`${r}IconColor`]}:{color:i.palette[r].main}}})),...Object.entries(i.palette).filter(br(["dark"])).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:{fontWeight:i.typography.fontWeightMedium,...i.vars?{color:i.vars.palette.Alert[`${r}FilledColor`],backgroundColor:i.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:i.palette.mode==="dark"?i.palette[r].dark:i.palette[r].main,color:i.palette.getContrastText(i.palette[r].main)}}}))]}})),mze=ye("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),_ze=ye("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),vze=ye("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Nde={success:C.jsx(uze,{fontSize:"inherit"}),warning:C.jsx(dze,{fontSize:"inherit"}),error:C.jsx(hze,{fontSize:"inherit"}),info:C.jsx(fze,{fontSize:"inherit"})},l_=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiAlert"}),{action:s,children:o,className:a,closeText:l="Close",color:c,components:u={},componentsProps:d={},icon:h,iconMapping:f=Nde,onClose:p,role:g="alert",severity:m="success",slotProps:_={},slots:b={},variant:y="standard",...x}=r,k={...r,color:c,severity:m,variant:y,colorSeverity:c||m},D=pze(k),R={slots:{closeButton:u.CloseButton,closeIcon:u.CloseIcon,...b},slotProps:{...d,..._}},[E,A]=an("root",{ref:n,shouldForwardComponentProp:!0,className:dt(D.root,a),elementType:gze,externalForwardedProps:{...R,...x},ownerState:k,additionalProps:{role:g,elevation:0}}),[M,N]=an("icon",{className:D.icon,elementType:mze,externalForwardedProps:R,ownerState:k}),[P,O]=an("message",{className:D.message,elementType:_ze,externalForwardedProps:R,ownerState:k}),[B,j]=an("action",{className:D.action,elementType:vze,externalForwardedProps:R,ownerState:k}),[z,H]=an("closeButton",{elementType:Ga,externalForwardedProps:R,ownerState:k}),[Y,X]=an("closeIcon",{elementType:$ke,externalForwardedProps:R,ownerState:k});return C.jsxs(E,{...A,children:[h!==!1?C.jsx(M,{...N,children:h||f[m]||Nde[m]}):null,C.jsx(P,{...O,children:o}),s!=null?C.jsx(B,{...j,children:s}):null,s==null&&p?C.jsx(B,{...j,children:C.jsx(z,{size:"small","aria-label":l,title:l,color:"inherit",onClick:p,...H,children:C.jsx(Y,{fontSize:"small",...X})})}):null]})});function bze(i){return Xt("MuiTypography",i)}const f9=Yt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),yze={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},wze=XWe(),Cze=i=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:s,variant:o,classes:a}=i,l={root:["root",o,i.align!=="inherit"&&`align${Ue(e)}`,n&&"gutterBottom",r&&"noWrap",s&&"paragraph"]};return Zt(l,bze,a)},Sze=ye("span",{name:"MuiTypography",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${Ue(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(jt(({theme:i})=>{var e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(i.typography).filter(([n,r])=>n!=="inherit"&&r&&typeof r=="object").map(([n,r])=>({props:{variant:n},style:r})),...Object.entries(i.palette).filter(br()).map(([n])=>({props:{color:n},style:{color:(i.vars||i).palette[n].main}})),...Object.entries(((e=i.palette)==null?void 0:e.text)||{}).filter(([,n])=>typeof n=="string").map(([n])=>({props:{color:`text${Ue(n)}`},style:{color:(i.vars||i).palette.text[n]}})),{props:({ownerState:n})=>n.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:n})=>n.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:n})=>n.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:n})=>n.paragraph,style:{marginBottom:16}}]}})),Mde={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Je=$.forwardRef(function(e,n){const{color:r,...s}=Qt({props:e,name:"MuiTypography"}),o=!yze[r],a=wze({...s,...o&&{color:r}}),{align:l="inherit",className:c,component:u,gutterBottom:d=!1,noWrap:h=!1,paragraph:f=!1,variant:p="body1",variantMapping:g=Mde,...m}=a,_={...a,align:l,color:r,className:c,component:u,gutterBottom:d,noWrap:h,paragraph:f,variant:p,variantMapping:g},b=u||(f?"p":g[p]||Mde[p])||"span",y=Cze(_);return C.jsx(Sze,{as:b,ref:n,className:dt(y.root,c),...m,ownerState:_,style:{...l!=="inherit"&&{"--Typography-textAlign":l},...m.style}})});function xze(i){return Xt("MuiAppBar",i)}Yt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const kze=i=>{const{color:e,position:n,classes:r}=i,s={root:["root",`color${Ue(e)}`,`position${Ue(n)}`]};return Zt(s,xze,r)},Pde=(i,e)=>i?`${i==null?void 0:i.replace(")","")}, ${e})`:e,Lze=ye(du,{name:"MuiAppBar",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[`position${Ue(n.position)}`],e[`color${Ue(n.color)}`]]}})(jt(({theme:i})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(i.vars||i).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(i.vars||i).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(i.vars||i).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":i.vars?i.vars.palette.AppBar.defaultBg:i.palette.grey[100],"--AppBar-color":i.vars?i.vars.palette.text.primary:i.palette.getContrastText(i.palette.grey[100]),...i.applyStyles("dark",{"--AppBar-background":i.vars?i.vars.palette.AppBar.defaultBg:i.palette.grey[900],"--AppBar-color":i.vars?i.vars.palette.text.primary:i.palette.getContrastText(i.palette.grey[900])})}},...Object.entries(i.palette).filter(br(["contrastText"])).map(([e])=>({props:{color:e},style:{"--AppBar-background":(i.vars??i).palette[e].main,"--AppBar-color":(i.vars??i).palette[e].contrastText}})),{props:e=>e.enableColorOnDark===!0&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>e.enableColorOnDark===!1&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...i.applyStyles("dark",{backgroundColor:i.vars?Pde(i.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:i.vars?Pde(i.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...i.applyStyles("dark",{backgroundImage:"none"})}}]}))),zke=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiAppBar"}),{className:s,color:o="primary",enableColorOnDark:a=!1,position:l="fixed",...c}=r,u={...r,color:o,position:l,enableColorOnDark:a},d=kze(u);return C.jsx(Lze,{square:!0,component:"header",ownerState:u,elevation:4,className:dt(d.root,s,l==="fixed"&&"mui-fixed"),ref:n,...c})}),Dze=i=>{const e=$.useRef({});return $.useEffect(()=>{e.current=i}),e.current};function Ode(i){return i.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Eze(i={}){const{ignoreAccents:e=!0,ignoreCase:n=!0,limit:r,matchFrom:s="any",stringify:o,trim:a=!1}=i;return(l,{inputValue:c,getOptionLabel:u})=>{let d=a?c.trim():c;n&&(d=d.toLowerCase()),e&&(d=Ode(d));const h=d?l.filter(f=>{let p=(o||u)(f);return n&&(p=p.toLowerCase()),e&&(p=Ode(p)),s==="start"?p.startsWith(d):p.includes(d)}):l;return typeof r=="number"?h.slice(0,r):h}}const Ize=Eze(),Fde=5,Tze=i=>{var e;return i.current!==null&&((e=i.current.parentElement)==null?void 0:e.contains(document.activeElement))},Rze=[];function Bde(i,e,n,r){if(e||i==null||r)return"";const s=n(i);return typeof s=="string"?s:""}function Aze(i){const{unstable_isActiveElementInListbox:e=Tze,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:s=!1,autoSelect:o=!1,blurOnSelect:a=!1,clearOnBlur:l=!i.freeSolo,clearOnEscape:c=!1,componentName:u="useAutocomplete",defaultValue:d=i.multiple?Rze:null,disableClearable:h=!1,disableCloseOnSelect:f=!1,disabled:p,disabledItemsFocusable:g=!1,disableListWrap:m=!1,filterOptions:_=Ize,filterSelectedOptions:b=!1,freeSolo:y=!1,getOptionDisabled:x,getOptionKey:k,getOptionLabel:D=De=>De.label??De,groupBy:R,handleHomeEndKeys:E=!i.freeSolo,id:A,includeInputInList:M=!1,inputValue:N,isOptionEqualToValue:P=(De,Ne)=>De===Ne,multiple:O=!1,onChange:B,onClose:j,onHighlightChange:z,onInputChange:H,onOpen:Y,open:X,openOnFocus:Q=!1,options:ie,readOnly:K=!1,renderValue:ee,selectOnFocus:le=!i.freeSolo,value:ke}=i,xe=W1(A);let me=D;me=De=>{const Ne=D(De);return typeof Ne!="string"?String(Ne):Ne};const Ee=$.useRef(!1),je=$.useRef(!0),qe=$.useRef(null),Ze=$.useRef(null),[We,ut]=$.useState(null),[st,mt]=$.useState(-1),Rt=s?0:-1,Vt=$.useRef(Rt),Ot=$.useRef(Bde(d??ke,O,me)).current,[vt,wn]=Im({controlled:ke,default:d,name:u}),[Ce,ge]=Im({controlled:N,default:Ot,name:u,state:"inputValue"}),[pe,ne]=$.useState(!1),ae=$.useCallback((De,Ne,At)=>{if(!(O?vt.length<Ne.length:Ne!==null)&&!l)return;const bn=Bde(Ne,O,me,ee);Ce!==bn&&(ge(bn),H&&H(De,bn,At))},[me,Ce,O,H,ge,l,vt,ee]),[ue,de]=Im({controlled:X,default:!1,name:u,state:"open"}),[Se,Ie]=$.useState(!0),nt=!O&&vt!=null&&Ce===me(vt),Oe=ue&&!K,Ve=Oe?_(ie.filter(De=>!(b&&(O?vt:[vt]).some(Ne=>Ne!==null&&P(De,Ne)))),{inputValue:nt&&Se?"":Ce,getOptionLabel:me}):[],gt=Dze({filteredOptions:Ve,value:vt,inputValue:Ce});$.useEffect(()=>{const De=vt!==gt.value;pe&&!De||y&&!De||ae(null,vt,"reset")},[vt,ae,pe,gt.value,y]);const $t=ue&&Ve.length>0&&!K,Mt=Ha(De=>{if(De===-1)qe.current.focus();else{const Ne=ee?"data-item-index":"data-tag-index";We.querySelector(`[${Ne}="${De}"]`).focus()}});$.useEffect(()=>{O&&st>vt.length-1&&(mt(-1),Mt(-1))},[vt,O,st,Mt]);function Bt(De,Ne){if(!Ze.current||De<0||De>=Ve.length)return-1;let At=De;for(;;){const En=Ze.current.querySelector(`[data-option-index="${At}"]`),bn=g?!1:!En||En.disabled||En.getAttribute("aria-disabled")==="true";if(En&&En.hasAttribute("tabindex")&&!bn)return At;if(Ne==="next"?At=(At+1)%Ve.length:At=(At-1+Ve.length)%Ve.length,At===De)return-1}}const jn=Ha(({event:De,index:Ne,reason:At})=>{if(Vt.current=Ne,Ne===-1?qe.current.removeAttribute("aria-activedescendant"):qe.current.setAttribute("aria-activedescendant",`${xe}-option-${Ne}`),z&&["mouse","keyboard","touch"].includes(At)&&z(De,Ne===-1?null:Ve[Ne],At),!Ze.current)return;const En=Ze.current.querySelector(`[role="option"].${n}-focused`);En&&(En.classList.remove(`${n}-focused`),En.classList.remove(`${n}-focusVisible`));let bn=Ze.current;if(Ze.current.getAttribute("role")!=="listbox"&&(bn=Ze.current.parentElement.querySelector('[role="listbox"]')),!bn)return;if(Ne===-1){bn.scrollTop=0;return}const Yn=Ze.current.querySelector(`[data-option-index="${Ne}"]`);if(Yn&&(Yn.classList.add(`${n}-focused`),At==="keyboard"&&Yn.classList.add(`${n}-focusVisible`),bn.scrollHeight>bn.clientHeight&&At!=="mouse"&&At!=="touch")){const fr=Yn,Ei=bn.clientHeight+bn.scrollTop,dg=fr.offsetTop+fr.offsetHeight;dg>Ei?bn.scrollTop=dg-bn.clientHeight:fr.offsetTop-fr.offsetHeight*(R?1.3:0)<bn.scrollTop&&(bn.scrollTop=fr.offsetTop-fr.offsetHeight*(R?1.3:0))}}),Dt=Ha(({event:De,diff:Ne,direction:At="next",reason:En})=>{if(!Oe)return;const Yn=Bt((()=>{const fr=Ve.length-1;if(Ne==="reset")return Rt;if(Ne==="start")return 0;if(Ne==="end")return fr;const Ei=Vt.current+Ne;return Ei<0?Ei===-1&&M?-1:m&&Vt.current!==-1||Math.abs(Ne)>1?0:fr:Ei>fr?Ei===fr+1&&M?-1:m||Math.abs(Ne)>1?fr:0:Ei})(),At);if(jn({index:Yn,reason:En,event:De}),r&&Ne!=="reset")if(Yn===-1)qe.current.value=Ce;else{const fr=me(Ve[Yn]);qe.current.value=fr,fr.toLowerCase().indexOf(Ce.toLowerCase())===0&&Ce.length>0&&qe.current.setSelectionRange(Ce.length,fr.length)}}),Fn=()=>{const De=(Ne,At)=>{const En=Ne?me(Ne):"",bn=At?me(At):"";return En===bn};if(Vt.current!==-1&&gt.filteredOptions&&gt.filteredOptions.length!==Ve.length&&gt.inputValue===Ce&&(O?vt.length===gt.value.length&&gt.value.every((Ne,At)=>me(vt[At])===me(Ne)):De(gt.value,vt))){const Ne=gt.filteredOptions[Vt.current];if(Ne)return Ve.findIndex(At=>me(At)===me(Ne))}return-1},tn=$.useCallback(()=>{if(!Oe)return;const De=Fn();if(De!==-1){Vt.current=De;return}const Ne=O?vt[0]:vt;if(Ve.length===0||Ne==null){Dt({diff:"reset"});return}if(Ze.current){if(Ne!=null){const At=Ve[Vt.current];if(O&&At&&vt.findIndex(bn=>P(At,bn))!==-1)return;const En=Ve.findIndex(bn=>P(bn,Ne));En===-1?Dt({diff:"reset"}):jn({index:En});return}if(Vt.current>=Ve.length-1){jn({index:Ve.length-1});return}jn({index:Vt.current})}},[Ve.length,O?!1:vt,b,Dt,jn,Oe,Ce,O]),pi=Ha(De=>{wZ(Ze,De),De&&tn()});$.useEffect(()=>{tn()},[tn]);const Pi=De=>{ue||(de(!0),Ie(!0),Y&&Y(De))},ti=(De,Ne)=>{ue&&(de(!1),j&&j(De,Ne))},mi=(De,Ne,At,En)=>{if(O){if(vt.length===Ne.length&&vt.every((bn,Yn)=>bn===Ne[Yn]))return}else if(vt===Ne)return;B&&B(De,Ne,At,En),wn(Ne)},ds=$.useRef(!1),Nr=(De,Ne,At="selectOption",En="options")=>{let bn=At,Yn=Ne;if(O){Yn=Array.isArray(vt)?vt.slice():[];const fr=Yn.findIndex(Ei=>P(Ne,Ei));fr===-1?Yn.push(Ne):En!=="freeSolo"&&(Yn.splice(fr,1),bn="removeOption")}ae(De,Yn,bn),mi(De,Yn,bn,{option:Ne}),!f&&(!De||!De.ctrlKey&&!De.metaKey)&&ti(De,bn),(a===!0||a==="touch"&&ds.current||a==="mouse"&&!ds.current)&&qe.current.blur()};function Br(De,Ne){if(De===-1)return-1;let At=De;for(;;){if(Ne==="next"&&At===vt.length||Ne==="previous"&&At===-1)return-1;const En=ee?"data-item-index":"data-tag-index",bn=We.querySelector(`[${En}="${At}"]`);if(!bn||!bn.hasAttribute("tabindex")||bn.disabled||bn.getAttribute("aria-disabled")==="true")At+=Ne==="next"?1:-1;else return At}}const Mn=(De,Ne)=>{if(!O)return;Ce===""&&ti(De,"toggleInput");let At=st;st===-1?Ce===""&&Ne==="previous"&&(At=vt.length-1):(At+=Ne==="next"?1:-1,At<0&&(At=0),At===vt.length&&(At=-1)),At=Br(At,Ne),mt(At),Mt(At)},hr=De=>{Ee.current=!0,ge(""),H&&H(De,"","clear"),mi(De,O?[]:null,"clear")},rn=De=>Ne=>{if(De.onKeyDown&&De.onKeyDown(Ne),!Ne.defaultMuiPrevented&&(st!==-1&&!["ArrowLeft","ArrowRight"].includes(Ne.key)&&(mt(-1),Mt(-1)),Ne.which!==229))switch(Ne.key){case"Home":Oe&&E&&(Ne.preventDefault(),Dt({diff:"start",direction:"next",reason:"keyboard",event:Ne}));break;case"End":Oe&&E&&(Ne.preventDefault(),Dt({diff:"end",direction:"previous",reason:"keyboard",event:Ne}));break;case"PageUp":Ne.preventDefault(),Dt({diff:-Fde,direction:"previous",reason:"keyboard",event:Ne}),Pi(Ne);break;case"PageDown":Ne.preventDefault(),Dt({diff:Fde,direction:"next",reason:"keyboard",event:Ne}),Pi(Ne);break;case"ArrowDown":Ne.preventDefault(),Dt({diff:1,direction:"next",reason:"keyboard",event:Ne}),Pi(Ne);break;case"ArrowUp":Ne.preventDefault(),Dt({diff:-1,direction:"previous",reason:"keyboard",event:Ne}),Pi(Ne);break;case"ArrowLeft":!O&&ee?Mt(0):Mn(Ne,"previous");break;case"ArrowRight":!O&&ee?Mt(-1):Mn(Ne,"next");break;case"Enter":if(Vt.current!==-1&&Oe){const At=Ve[Vt.current],En=x?x(At):!1;if(Ne.preventDefault(),En)return;Nr(Ne,At,"selectOption"),r&&qe.current.setSelectionRange(qe.current.value.length,qe.current.value.length)}else y&&Ce!==""&&nt===!1&&(O&&Ne.preventDefault(),Nr(Ne,Ce,"createOption","freeSolo"));break;case"Escape":Oe?(Ne.preventDefault(),Ne.stopPropagation(),ti(Ne,"escape")):c&&(Ce!==""||O&&vt.length>0||ee)&&(Ne.preventDefault(),Ne.stopPropagation(),hr(Ne));break;case"Backspace":if(O&&!K&&Ce===""&&vt.length>0){const At=st===-1?vt.length-1:st,En=vt.slice();En.splice(At,1),mi(Ne,En,"removeOption",{option:vt[At]})}!O&&ee&&!K&&(wn(null),Mt(-1));break;case"Delete":if(O&&!K&&Ce===""&&vt.length>0&&st!==-1){const At=st,En=vt.slice();En.splice(At,1),mi(Ne,En,"removeOption",{option:vt[At]})}!O&&ee&&!K&&(wn(null),Mt(-1));break}},sn=De=>{ne(!0),Q&&!Ee.current&&Pi(De)},Kn=De=>{if(e(Ze)){qe.current.focus();return}ne(!1),je.current=!0,Ee.current=!1,o&&Vt.current!==-1&&Oe?Nr(De,Ve[Vt.current],"blur"):o&&y&&Ce!==""?Nr(De,Ce,"blur","freeSolo"):l&&ae(De,vt,"blur"),ti(De,"blur")},ai=De=>{const Ne=De.target.value;Ce!==Ne&&(ge(Ne),Ie(!1),H&&H(De,Ne,"input")),Ne===""?!h&&!O&&mi(De,null,"clear"):Pi(De)},Ki=De=>{const Ne=Number(De.currentTarget.getAttribute("data-option-index"));Vt.current!==Ne&&jn({event:De,index:Ne,reason:"mouse"})},so=De=>{jn({event:De,index:Number(De.currentTarget.getAttribute("data-option-index")),reason:"touch"}),ds.current=!0},_o=De=>{const Ne=Number(De.currentTarget.getAttribute("data-option-index"));Nr(De,Ve[Ne],"selectOption"),ds.current=!1},Cs=De=>Ne=>{const At=vt.slice();At.splice(De,1),mi(Ne,At,"removeOption",{option:vt[De]})},_u=De=>{mi(De,null,"removeOption",{option:vt})},yl=De=>{ue?ti(De,"toggleInput"):Pi(De)},qs=De=>{De.currentTarget.contains(De.target)&&De.target.getAttribute("id")!==xe&&De.preventDefault()},Ks=De=>{De.currentTarget.contains(De.target)&&(qe.current.focus(),le&&je.current&&qe.current.selectionEnd-qe.current.selectionStart===0&&qe.current.select(),je.current=!1)},ma=De=>{!p&&(Ce===""||!ue)&&yl(De)};let yn=y&&Ce.length>0;yn=yn||(O?vt.length>0:vt!==null);let Pe=Ve;return R&&(Pe=Ve.reduce((De,Ne,At)=>{const En=R(Ne);return De.length>0&&De[De.length-1].group===En?De[De.length-1].options.push(Ne):De.push({key:At,index:At,group:En,options:[Ne]}),De},[])),p&&pe&&Kn(),{getRootProps:(De={})=>({...De,onKeyDown:rn(De),onMouseDown:qs,onClick:Ks}),getInputLabelProps:()=>({id:`${xe}-label`,htmlFor:xe}),getInputProps:()=>({id:xe,value:Ce,onBlur:Kn,onFocus:sn,onChange:ai,onMouseDown:ma,"aria-activedescendant":Oe?"":null,"aria-autocomplete":r?"both":"list","aria-controls":$t?`${xe}-listbox`:void 0,"aria-expanded":$t,autoComplete:"off",ref:qe,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:p}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:hr}),getItemProps:({index:De=0}={})=>({...O&&{key:De},...ee?{"data-item-index":De}:{"data-tag-index":De},tabIndex:-1,...!K&&{onDelete:O?Cs(De):_u}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:yl}),getTagProps:({index:De})=>({key:De,"data-tag-index":De,tabIndex:-1,...!K&&{onDelete:Cs(De)}}),getListboxProps:()=>({role:"listbox",id:`${xe}-listbox`,"aria-labelledby":`${xe}-label`,ref:pi,onMouseDown:De=>{De.preventDefault()}}),getOptionProps:({index:De,option:Ne})=>{const At=(O?vt:[vt]).some(bn=>bn!=null&&P(Ne,bn)),En=x?x(Ne):!1;return{key:(k==null?void 0:k(Ne))??me(Ne),tabIndex:-1,role:"option",id:`${xe}-option-${De}`,onMouseMove:Ki,onClick:_o,onTouchStart:so,"data-option-index":De,"aria-disabled":En,"aria-selected":At}},id:xe,inputValue:Ce,value:vt,dirty:yn,expanded:Oe&&We,popupOpen:Oe,focused:pe||st!==-1,anchorEl:We,setAnchorEl:ut,focusedItem:st,focusedTag:st,groupedOptions:Pe}}var nd="top",Df="bottom",Ef="right",id="left",Hre="auto",u5=[nd,Df,Ef,id],vE="start",KM="end",Nze="clippingParents",Vke="viewport",RR="popper",Mze="reference",jde=u5.reduce(function(i,e){return i.concat([e+"-"+vE,e+"-"+KM])},[]),Hke=[].concat(u5,[Hre]).reduce(function(i,e){return i.concat([e,e+"-"+vE,e+"-"+KM])},[]),Pze="beforeRead",Oze="read",Fze="afterRead",Bze="beforeMain",jze="main",Wze="afterMain",$ze="beforeWrite",zze="write",Vze="afterWrite",Hze=[Pze,Oze,Fze,Bze,jze,Wze,$ze,zze,Vze];function zm(i){return i?(i.nodeName||"").toLowerCase():null}function ph(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function QS(i){var e=ph(i).Element;return i instanceof e||i instanceof Element}function wf(i){var e=ph(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function Ure(i){if(typeof ShadowRoot>"u")return!1;var e=ph(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function Uze(i){var e=i.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},s=e.attributes[n]||{},o=e.elements[n];!wf(o)||!zm(o)||(Object.assign(o.style,r),Object.keys(s).forEach(function(a){var l=s[a];l===!1?o.removeAttribute(a):o.setAttribute(a,l===!0?"":l)}))})}function qze(i){var e=i.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var s=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=a.reduce(function(c,u){return c[u]="",c},{});!wf(s)||!zm(s)||(Object.assign(s.style,l),Object.keys(o).forEach(function(c){s.removeAttribute(c)}))})}}const Kze={name:"applyStyles",enabled:!0,phase:"write",fn:Uze,effect:qze,requires:["computeStyles"]};function Tm(i){return i.split("-")[0]}var IS=Math.max,p9=Math.min,bE=Math.round;function DZ(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Uke(){return!/^((?!chrome|android).)*safari/i.test(DZ())}function yE(i,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=i.getBoundingClientRect(),s=1,o=1;e&&wf(i)&&(s=i.offsetWidth>0&&bE(r.width)/i.offsetWidth||1,o=i.offsetHeight>0&&bE(r.height)/i.offsetHeight||1);var a=QS(i)?ph(i):window,l=a.visualViewport,c=!Uke()&&n,u=(r.left+(c&&l?l.offsetLeft:0))/s,d=(r.top+(c&&l?l.offsetTop:0))/o,h=r.width/s,f=r.height/o;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u,x:u,y:d}}function qre(i){var e=yE(i),n=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:n,height:r}}function qke(i,e){var n=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(n&&Ure(n)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Dv(i){return ph(i).getComputedStyle(i)}function Gze(i){return["table","td","th"].indexOf(zm(i))>=0}function $1(i){return((QS(i)?i.ownerDocument:i.document)||window.document).documentElement}function wW(i){return zm(i)==="html"?i:i.assignedSlot||i.parentNode||(Ure(i)?i.host:null)||$1(i)}function Wde(i){return!wf(i)||Dv(i).position==="fixed"?null:i.offsetParent}function Xze(i){var e=/firefox/i.test(DZ()),n=/Trident/i.test(DZ());if(n&&wf(i)){var r=Dv(i);if(r.position==="fixed")return null}var s=wW(i);for(Ure(s)&&(s=s.host);wf(s)&&["html","body"].indexOf(zm(s))<0;){var o=Dv(s);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return s;s=s.parentNode}return null}function d5(i){for(var e=ph(i),n=Wde(i);n&&Gze(n)&&Dv(n).position==="static";)n=Wde(n);return n&&(zm(n)==="html"||zm(n)==="body"&&Dv(n).position==="static")?e:n||Xze(i)||e}function Kre(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function HN(i,e,n){return IS(i,p9(e,n))}function Yze(i,e,n){var r=HN(i,e,n);return r>n?n:r}function Kke(){return{top:0,right:0,bottom:0,left:0}}function Gke(i){return Object.assign({},Kke(),i)}function Xke(i,e){return e.reduce(function(n,r){return n[r]=i,n},{})}var Zze=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Gke(typeof e!="number"?e:Xke(e,u5))};function Qze(i){var e,n=i.state,r=i.name,s=i.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Tm(n.placement),c=Kre(l),u=[id,Ef].indexOf(l)>=0,d=u?"height":"width";if(!(!o||!a)){var h=Zze(s.padding,n),f=qre(o),p=c==="y"?nd:id,g=c==="y"?Df:Ef,m=n.rects.reference[d]+n.rects.reference[c]-a[c]-n.rects.popper[d],_=a[c]-n.rects.reference[c],b=d5(o),y=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-_/2,k=h[p],D=y-f[d]-h[g],R=y/2-f[d]/2+x,E=HN(k,R,D),A=c;n.modifiersData[r]=(e={},e[A]=E,e.centerOffset=E-R,e)}}function Jze(i){var e=i.state,n=i.options,r=n.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||qke(e.elements.popper,s)&&(e.elements.arrow=s))}const eVe={name:"arrow",enabled:!0,phase:"main",fn:Qze,effect:Jze,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wE(i){return i.split("-")[1]}var tVe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nVe(i,e){var n=i.x,r=i.y,s=e.devicePixelRatio||1;return{x:bE(n*s)/s||0,y:bE(r*s)/s||0}}function $de(i){var e,n=i.popper,r=i.popperRect,s=i.placement,o=i.variation,a=i.offsets,l=i.position,c=i.gpuAcceleration,u=i.adaptive,d=i.roundOffsets,h=i.isFixed,f=a.x,p=f===void 0?0:f,g=a.y,m=g===void 0?0:g,_=typeof d=="function"?d({x:p,y:m}):{x:p,y:m};p=_.x,m=_.y;var b=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),x=id,k=nd,D=window;if(u){var R=d5(n),E="clientHeight",A="clientWidth";if(R===ph(n)&&(R=$1(n),Dv(R).position!=="static"&&l==="absolute"&&(E="scrollHeight",A="scrollWidth")),R=R,s===nd||(s===id||s===Ef)&&o===KM){k=Df;var M=h&&R===D&&D.visualViewport?D.visualViewport.height:R[E];m-=M-r.height,m*=c?1:-1}if(s===id||(s===nd||s===Df)&&o===KM){x=Ef;var N=h&&R===D&&D.visualViewport?D.visualViewport.width:R[A];p-=N-r.width,p*=c?1:-1}}var P=Object.assign({position:l},u&&tVe),O=d===!0?nVe({x:p,y:m},ph(n)):{x:p,y:m};if(p=O.x,m=O.y,c){var B;return Object.assign({},P,(B={},B[k]=y?"0":"",B[x]=b?"0":"",B.transform=(D.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",B))}return Object.assign({},P,(e={},e[k]=y?m+"px":"",e[x]=b?p+"px":"",e.transform="",e))}function iVe(i){var e=i.state,n=i.options,r=n.gpuAcceleration,s=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,l=n.roundOffsets,c=l===void 0?!0:l,u={placement:Tm(e.placement),variation:wE(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,$de(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,$de(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const rVe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:iVe,data:{}};var p3={passive:!0};function sVe(i){var e=i.state,n=i.instance,r=i.options,s=r.scroll,o=s===void 0?!0:s,a=r.resize,l=a===void 0?!0:a,c=ph(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,p3)}),l&&c.addEventListener("resize",n.update,p3),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,p3)}),l&&c.removeEventListener("resize",n.update,p3)}}const oVe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sVe,data:{}};var aVe={left:"right",right:"left",bottom:"top",top:"bottom"};function YB(i){return i.replace(/left|right|bottom|top/g,function(e){return aVe[e]})}var lVe={start:"end",end:"start"};function zde(i){return i.replace(/start|end/g,function(e){return lVe[e]})}function Gre(i){var e=ph(i),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Xre(i){return yE($1(i)).left+Gre(i).scrollLeft}function cVe(i,e){var n=ph(i),r=$1(i),s=n.visualViewport,o=r.clientWidth,a=r.clientHeight,l=0,c=0;if(s){o=s.width,a=s.height;var u=Uke();(u||!u&&e==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:l+Xre(i),y:c}}function uVe(i){var e,n=$1(i),r=Gre(i),s=(e=i.ownerDocument)==null?void 0:e.body,o=IS(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=IS(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-r.scrollLeft+Xre(i),c=-r.scrollTop;return Dv(s||n).direction==="rtl"&&(l+=IS(n.clientWidth,s?s.clientWidth:0)-o),{width:o,height:a,x:l,y:c}}function Yre(i){var e=Dv(i),n=e.overflow,r=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+r)}function Yke(i){return["html","body","#document"].indexOf(zm(i))>=0?i.ownerDocument.body:wf(i)&&Yre(i)?i:Yke(wW(i))}function UN(i,e){var n;e===void 0&&(e=[]);var r=Yke(i),s=r===((n=i.ownerDocument)==null?void 0:n.body),o=ph(r),a=s?[o].concat(o.visualViewport||[],Yre(r)?r:[]):r,l=e.concat(a);return s?l:l.concat(UN(wW(a)))}function EZ(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function dVe(i,e){var n=yE(i,!1,e==="fixed");return n.top=n.top+i.clientTop,n.left=n.left+i.clientLeft,n.bottom=n.top+i.clientHeight,n.right=n.left+i.clientWidth,n.width=i.clientWidth,n.height=i.clientHeight,n.x=n.left,n.y=n.top,n}function Vde(i,e,n){return e===Vke?EZ(cVe(i,n)):QS(e)?dVe(e,n):EZ(uVe($1(i)))}function hVe(i){var e=UN(wW(i)),n=["absolute","fixed"].indexOf(Dv(i).position)>=0,r=n&&wf(i)?d5(i):i;return QS(r)?e.filter(function(s){return QS(s)&&qke(s,r)&&zm(s)!=="body"}):[]}function fVe(i,e,n,r){var s=e==="clippingParents"?hVe(i):[].concat(e),o=[].concat(s,[n]),a=o[0],l=o.reduce(function(c,u){var d=Vde(i,u,r);return c.top=IS(d.top,c.top),c.right=p9(d.right,c.right),c.bottom=p9(d.bottom,c.bottom),c.left=IS(d.left,c.left),c},Vde(i,a,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Zke(i){var e=i.reference,n=i.element,r=i.placement,s=r?Tm(r):null,o=r?wE(r):null,a=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,c;switch(s){case nd:c={x:a,y:e.y-n.height};break;case Df:c={x:a,y:e.y+e.height};break;case Ef:c={x:e.x+e.width,y:l};break;case id:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var u=s?Kre(s):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case vE:c[u]=c[u]-(e[d]/2-n[d]/2);break;case KM:c[u]=c[u]+(e[d]/2-n[d]/2);break}}return c}function GM(i,e){e===void 0&&(e={});var n=e,r=n.placement,s=r===void 0?i.placement:r,o=n.strategy,a=o===void 0?i.strategy:o,l=n.boundary,c=l===void 0?Nze:l,u=n.rootBoundary,d=u===void 0?Vke:u,h=n.elementContext,f=h===void 0?RR:h,p=n.altBoundary,g=p===void 0?!1:p,m=n.padding,_=m===void 0?0:m,b=Gke(typeof _!="number"?_:Xke(_,u5)),y=f===RR?Mze:RR,x=i.rects.popper,k=i.elements[g?y:f],D=fVe(QS(k)?k:k.contextElement||$1(i.elements.popper),c,d,a),R=yE(i.elements.reference),E=Zke({reference:R,element:x,placement:s}),A=EZ(Object.assign({},x,E)),M=f===RR?A:R,N={top:D.top-M.top+b.top,bottom:M.bottom-D.bottom+b.bottom,left:D.left-M.left+b.left,right:M.right-D.right+b.right},P=i.modifiersData.offset;if(f===RR&&P){var O=P[s];Object.keys(N).forEach(function(B){var j=[Ef,Df].indexOf(B)>=0?1:-1,z=[nd,Df].indexOf(B)>=0?"y":"x";N[B]+=O[z]*j})}return N}function pVe(i,e){e===void 0&&(e={});var n=e,r=n.placement,s=n.boundary,o=n.rootBoundary,a=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?Hke:c,d=wE(r),h=d?l?jde:jde.filter(function(g){return wE(g)===d}):u5,f=h.filter(function(g){return u.indexOf(g)>=0});f.length===0&&(f=h);var p=f.reduce(function(g,m){return g[m]=GM(i,{placement:m,boundary:s,rootBoundary:o,padding:a})[Tm(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function gVe(i){if(Tm(i)===Hre)return[];var e=YB(i);return[zde(i),e,zde(e)]}function mVe(i){var e=i.state,n=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var s=n.mainAxis,o=s===void 0?!0:s,a=n.altAxis,l=a===void 0?!0:a,c=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,g=p===void 0?!0:p,m=n.allowedAutoPlacements,_=e.options.placement,b=Tm(_),y=b===_,x=c||(y||!g?[YB(_)]:gVe(_)),k=[_].concat(x).reduce(function(ke,xe){return ke.concat(Tm(xe)===Hre?pVe(e,{placement:xe,boundary:d,rootBoundary:h,padding:u,flipVariations:g,allowedAutoPlacements:m}):xe)},[]),D=e.rects.reference,R=e.rects.popper,E=new Map,A=!0,M=k[0],N=0;N<k.length;N++){var P=k[N],O=Tm(P),B=wE(P)===vE,j=[nd,Df].indexOf(O)>=0,z=j?"width":"height",H=GM(e,{placement:P,boundary:d,rootBoundary:h,altBoundary:f,padding:u}),Y=j?B?Ef:id:B?Df:nd;D[z]>R[z]&&(Y=YB(Y));var X=YB(Y),Q=[];if(o&&Q.push(H[O]<=0),l&&Q.push(H[Y]<=0,H[X]<=0),Q.every(function(ke){return ke})){M=P,A=!1;break}E.set(P,Q)}if(A)for(var ie=g?3:1,K=function(xe){var me=k.find(function(Ee){var je=E.get(Ee);if(je)return je.slice(0,xe).every(function(qe){return qe})});if(me)return M=me,"break"},ee=ie;ee>0;ee--){var le=K(ee);if(le==="break")break}e.placement!==M&&(e.modifiersData[r]._skip=!0,e.placement=M,e.reset=!0)}}const _Ve={name:"flip",enabled:!0,phase:"main",fn:mVe,requiresIfExists:["offset"],data:{_skip:!1}};function Hde(i,e,n){return n===void 0&&(n={x:0,y:0}),{top:i.top-e.height-n.y,right:i.right-e.width+n.x,bottom:i.bottom-e.height+n.y,left:i.left-e.width-n.x}}function Ude(i){return[nd,Ef,Df,id].some(function(e){return i[e]>=0})}function vVe(i){var e=i.state,n=i.name,r=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,a=GM(e,{elementContext:"reference"}),l=GM(e,{altBoundary:!0}),c=Hde(a,r),u=Hde(l,s,o),d=Ude(c),h=Ude(u);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const bVe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:vVe};function yVe(i,e,n){var r=Tm(i),s=[id,nd].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:i})):n,a=o[0],l=o[1];return a=a||0,l=(l||0)*s,[id,Ef].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}function wVe(i){var e=i.state,n=i.options,r=i.name,s=n.offset,o=s===void 0?[0,0]:s,a=Hke.reduce(function(d,h){return d[h]=yVe(h,e.rects,o),d},{}),l=a[e.placement],c=l.x,u=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=a}const CVe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:wVe};function SVe(i){var e=i.state,n=i.name;e.modifiersData[n]=Zke({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const xVe={name:"popperOffsets",enabled:!0,phase:"read",fn:SVe,data:{}};function kVe(i){return i==="x"?"y":"x"}function LVe(i){var e=i.state,n=i.options,r=i.name,s=n.mainAxis,o=s===void 0?!0:s,a=n.altAxis,l=a===void 0?!1:a,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,f=n.tether,p=f===void 0?!0:f,g=n.tetherOffset,m=g===void 0?0:g,_=GM(e,{boundary:c,rootBoundary:u,padding:h,altBoundary:d}),b=Tm(e.placement),y=wE(e.placement),x=!y,k=Kre(b),D=kVe(k),R=e.modifiersData.popperOffsets,E=e.rects.reference,A=e.rects.popper,M=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,N=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,O={x:0,y:0};if(R){if(o){var B,j=k==="y"?nd:id,z=k==="y"?Df:Ef,H=k==="y"?"height":"width",Y=R[k],X=Y+_[j],Q=Y-_[z],ie=p?-A[H]/2:0,K=y===vE?E[H]:A[H],ee=y===vE?-A[H]:-E[H],le=e.elements.arrow,ke=p&&le?qre(le):{width:0,height:0},xe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Kke(),me=xe[j],Ee=xe[z],je=HN(0,E[H],ke[H]),qe=x?E[H]/2-ie-je-me-N.mainAxis:K-je-me-N.mainAxis,Ze=x?-E[H]/2+ie+je+Ee+N.mainAxis:ee+je+Ee+N.mainAxis,We=e.elements.arrow&&d5(e.elements.arrow),ut=We?k==="y"?We.clientTop||0:We.clientLeft||0:0,st=(B=P==null?void 0:P[k])!=null?B:0,mt=Y+qe-st-ut,Rt=Y+Ze-st,Vt=HN(p?p9(X,mt):X,Y,p?IS(Q,Rt):Q);R[k]=Vt,O[k]=Vt-Y}if(l){var Ot,vt=k==="x"?nd:id,wn=k==="x"?Df:Ef,Ce=R[D],ge=D==="y"?"height":"width",pe=Ce+_[vt],ne=Ce-_[wn],ae=[nd,id].indexOf(b)!==-1,ue=(Ot=P==null?void 0:P[D])!=null?Ot:0,de=ae?pe:Ce-E[ge]-A[ge]-ue+N.altAxis,Se=ae?Ce+E[ge]+A[ge]-ue-N.altAxis:ne,Ie=p&&ae?Yze(de,Ce,Se):HN(p?de:pe,Ce,p?Se:ne);R[D]=Ie,O[D]=Ie-Ce}e.modifiersData[r]=O}}const DVe={name:"preventOverflow",enabled:!0,phase:"main",fn:LVe,requiresIfExists:["offset"]};function EVe(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function IVe(i){return i===ph(i)||!wf(i)?Gre(i):EVe(i)}function TVe(i){var e=i.getBoundingClientRect(),n=bE(e.width)/i.offsetWidth||1,r=bE(e.height)/i.offsetHeight||1;return n!==1||r!==1}function RVe(i,e,n){n===void 0&&(n=!1);var r=wf(e),s=wf(e)&&TVe(e),o=$1(e),a=yE(i,s,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((zm(e)!=="body"||Yre(o))&&(l=IVe(e)),wf(e)?(c=yE(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=Xre(o))),{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function AVe(i){var e=new Map,n=new Set,r=[];i.forEach(function(o){e.set(o.name,o)});function s(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var c=e.get(l);c&&s(c)}}),r.push(o)}return i.forEach(function(o){n.has(o.name)||s(o)}),r}function NVe(i){var e=AVe(i);return Hze.reduce(function(n,r){return n.concat(e.filter(function(s){return s.phase===r}))},[])}function MVe(i){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(i())})})),e}}function PVe(i){var e=i.reduce(function(n,r){var s=n[r.name];return n[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var qde={placement:"bottom",modifiers:[],strategy:"absolute"};function Kde(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function OVe(i){i===void 0&&(i={});var e=i,n=e.defaultModifiers,r=n===void 0?[]:n,s=e.defaultOptions,o=s===void 0?qde:s;return function(l,c,u){u===void 0&&(u=o);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},qde,o),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},h=[],f=!1,p={state:d,setOptions:function(b){var y=typeof b=="function"?b(d.options):b;m(),d.options=Object.assign({},o,d.options,y),d.scrollParents={reference:QS(l)?UN(l):l.contextElement?UN(l.contextElement):[],popper:UN(c)};var x=NVe(PVe([].concat(r,d.options.modifiers)));return d.orderedModifiers=x.filter(function(k){return k.enabled}),g(),p.update()},forceUpdate:function(){if(!f){var b=d.elements,y=b.reference,x=b.popper;if(Kde(y,x)){d.rects={reference:RVe(y,d5(x),d.options.strategy==="fixed"),popper:qre(x)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(N){return d.modifiersData[N.name]=Object.assign({},N.data)});for(var k=0;k<d.orderedModifiers.length;k++){if(d.reset===!0){d.reset=!1,k=-1;continue}var D=d.orderedModifiers[k],R=D.fn,E=D.options,A=E===void 0?{}:E,M=D.name;typeof R=="function"&&(d=R({state:d,options:A,name:M,instance:p})||d)}}}},update:MVe(function(){return new Promise(function(_){p.forceUpdate(),_(d)})}),destroy:function(){m(),f=!0}};if(!Kde(l,c))return p;p.setOptions(u).then(function(_){!f&&u.onFirstUpdate&&u.onFirstUpdate(_)});function g(){d.orderedModifiers.forEach(function(_){var b=_.name,y=_.options,x=y===void 0?{}:y,k=_.effect;if(typeof k=="function"){var D=k({state:d,name:b,instance:p,options:x}),R=function(){};h.push(D||R)}})}function m(){h.forEach(function(_){return _()}),h=[]}return p}}var FVe=[oVe,xVe,rVe,Kze,CVe,_Ve,DVe,eVe,bVe],BVe=OVe({defaultModifiers:FVe});function $u(i){var h;const{elementType:e,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:s=!1,...o}=i,a=s?{}:jke(n,r),{props:l,internalRef:c}=Wke({...o,externalSlotProps:a}),u=mo(c,a==null?void 0:a.ref,(h=i.additionalProps)==null?void 0:h.ref);return Bke(e,{...l,ref:u},r)}function Hx(i){var e;return parseInt($.version,10)>=19?((e=i==null?void 0:i.props)==null?void 0:e.ref)||null:(i==null?void 0:i.ref)||null}function jVe(i){return typeof i=="function"?i():i}const Qke=$.forwardRef(function(e,n){const{children:r,container:s,disablePortal:o=!1}=e,[a,l]=$.useState(null),c=mo($.isValidElement(r)?Hx(r):null,n);if(wc(()=>{o||l(jVe(s)||document.body)},[s,o]),wc(()=>{if(a&&!o)return wZ(n,a),()=>{wZ(n,null)}},[n,a,o]),o){if($.isValidElement(r)){const u={ref:c};return $.cloneElement(r,u)}return r}return a&&Wre.createPortal(r,a)});function WVe(i){return Xt("MuiPopper",i)}Yt("MuiPopper",["root"]);function $Ve(i,e){if(e==="ltr")return i;switch(i){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return i}}function IZ(i){return typeof i=="function"?i():i}function zVe(i){return i.nodeType!==void 0}const VVe=i=>{const{classes:e}=i;return Zt({root:["root"]},WVe,e)},HVe={},UVe=$.forwardRef(function(e,n){const{anchorEl:r,children:s,direction:o,disablePortal:a,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:h,slotProps:f={},slots:p={},TransitionProps:g,ownerState:m,..._}=e,b=$.useRef(null),y=mo(b,n),x=$.useRef(null),k=mo(x,h),D=$.useRef(k);wc(()=>{D.current=k},[k]),$.useImperativeHandle(h,()=>x.current,[]);const R=$Ve(u,o),[E,A]=$.useState(R),[M,N]=$.useState(IZ(r));$.useEffect(()=>{x.current&&x.current.forceUpdate()}),$.useEffect(()=>{r&&N(IZ(r))},[r]),wc(()=>{if(!M||!c)return;const z=X=>{A(X.placement)};let H=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:X})=>{z(X)}}];l!=null&&(H=H.concat(l)),d&&d.modifiers!=null&&(H=H.concat(d.modifiers));const Y=BVe(M,b.current,{placement:R,...d,modifiers:H});return D.current(Y),()=>{Y.destroy(),D.current(null)}},[M,a,l,c,d,R]);const P={placement:E};g!==null&&(P.TransitionProps=g);const O=VVe(e),B=p.root??"div",j=$u({elementType:B,externalSlotProps:f.root,externalForwardedProps:_,additionalProps:{role:"tooltip",ref:y},ownerState:e,className:O.root});return C.jsx(B,{...j,children:typeof s=="function"?s(P):s})}),qVe=$.forwardRef(function(e,n){const{anchorEl:r,children:s,container:o,direction:a="ltr",disablePortal:l=!1,keepMounted:c=!1,modifiers:u,open:d,placement:h="bottom",popperOptions:f=HVe,popperRef:p,style:g,transition:m=!1,slotProps:_={},slots:b={},...y}=e,[x,k]=$.useState(!0),D=()=>{k(!1)},R=()=>{k(!0)};if(!c&&!d&&(!m||x))return null;let E;if(o)E=o;else if(r){const N=IZ(r);E=N&&zVe(N)?gl(N).body:gl(null).body}const A=!d&&c&&(!m||x)?"none":void 0,M=m?{in:d,onEnter:D,onExited:R}:void 0;return C.jsx(Qke,{disablePortal:l,container:E,children:C.jsx(UVe,{anchorEl:r,direction:a,disablePortal:l,modifiers:u,ref:n,open:m?!x:d,placement:h,popperOptions:f,popperRef:p,slotProps:_,slots:b,...y,style:{position:"fixed",top:0,left:0,display:A,...g},TransitionProps:M,children:s})})}),KVe=ye(qVe,{name:"MuiPopper",slot:"Root"})({}),CW=$.forwardRef(function(e,n){const r=Pv(),s=Qt({props:e,name:"MuiPopper"}),{anchorEl:o,component:a,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:h,modifiers:f,open:p,placement:g,popperOptions:m,popperRef:_,transition:b,slots:y,slotProps:x,...k}=s,D=(y==null?void 0:y.root)??(l==null?void 0:l.Root),R={anchorEl:o,container:u,disablePortal:d,keepMounted:h,modifiers:f,open:p,placement:g,popperOptions:m,popperRef:_,transition:b,...k};return C.jsx(KVe,{as:a,direction:r?"rtl":"ltr",slots:{root:D},slotProps:x??c,...R,ref:n})});function GVe(i){return Xt("MuiListSubheader",i)}Yt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const XVe=i=>{const{classes:e,color:n,disableGutters:r,inset:s,disableSticky:o}=i,a={root:["root",n!=="default"&&`color${Ue(n)}`,!r&&"gutters",s&&"inset",!o&&"sticky"]};return Zt(a,GVe,e)},YVe=ye("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.color!=="default"&&e[`color${Ue(n.color)}`],!n.disableGutters&&e.gutters,n.inset&&e.inset,!n.disableSticky&&e.sticky]}})(jt(({theme:i})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(i.vars||i).palette.text.secondary,fontFamily:i.typography.fontFamily,fontWeight:i.typography.fontWeightMedium,fontSize:i.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(i.vars||i).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:72}},{props:({ownerState:e})=>!e.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(i.vars||i).palette.background.paper}}]}))),TZ=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiListSubheader"}),{className:s,color:o="default",component:a="li",disableGutters:l=!1,disableSticky:c=!1,inset:u=!1,...d}=r,h={...r,color:o,component:a,disableGutters:l,disableSticky:c,inset:u},f=XVe(h);return C.jsx(YVe,{as:a,className:dt(f.root,s),ref:n,ownerState:h,...d})});TZ&&(TZ.muiSkipListHighlight=!0);const ZVe=Hr(C.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function QVe(i){return Xt("MuiChip",i)}const nr=Yt("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),JVe=i=>{const{classes:e,disabled:n,size:r,color:s,iconColor:o,onDelete:a,clickable:l,variant:c}=i,u={root:["root",c,n&&"disabled",`size${Ue(r)}`,`color${Ue(s)}`,l&&"clickable",l&&`clickableColor${Ue(s)}`,a&&"deletable",a&&`deletableColor${Ue(s)}`,`${c}${Ue(s)}`],label:["label",`label${Ue(r)}`],avatar:["avatar",`avatar${Ue(r)}`,`avatarColor${Ue(s)}`],icon:["icon",`icon${Ue(r)}`,`iconColor${Ue(o)}`],deleteIcon:["deleteIcon",`deleteIcon${Ue(r)}`,`deleteIconColor${Ue(s)}`,`deleteIcon${Ue(c)}Color${Ue(s)}`]};return Zt(u,QVe,e)},eHe=ye("div",{name:"MuiChip",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i,{color:r,iconColor:s,clickable:o,onDelete:a,size:l,variant:c}=n;return[{[`& .${nr.avatar}`]:e.avatar},{[`& .${nr.avatar}`]:e[`avatar${Ue(l)}`]},{[`& .${nr.avatar}`]:e[`avatarColor${Ue(r)}`]},{[`& .${nr.icon}`]:e.icon},{[`& .${nr.icon}`]:e[`icon${Ue(l)}`]},{[`& .${nr.icon}`]:e[`iconColor${Ue(s)}`]},{[`& .${nr.deleteIcon}`]:e.deleteIcon},{[`& .${nr.deleteIcon}`]:e[`deleteIcon${Ue(l)}`]},{[`& .${nr.deleteIcon}`]:e[`deleteIconColor${Ue(r)}`]},{[`& .${nr.deleteIcon}`]:e[`deleteIcon${Ue(c)}Color${Ue(r)}`]},e.root,e[`size${Ue(l)}`],e[`color${Ue(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${Ue(r)})`],a&&e.deletable,a&&r!=="default"&&e[`deletableColor${Ue(r)}`],e[c],e[`${c}${Ue(r)}`]]}})(jt(({theme:i})=>{const e=i.palette.mode==="light"?i.palette.grey[700]:i.palette.grey[300];return{maxWidth:"100%",fontFamily:i.typography.fontFamily,fontSize:i.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(i.vars||i).palette.text.primary,backgroundColor:(i.vars||i).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:i.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${nr.disabled}`]:{opacity:(i.vars||i).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${nr.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:i.vars?i.vars.palette.Chip.defaultAvatarColor:e,fontSize:i.typography.pxToRem(12)},[`& .${nr.avatarColorPrimary}`]:{color:(i.vars||i).palette.primary.contrastText,backgroundColor:(i.vars||i).palette.primary.dark},[`& .${nr.avatarColorSecondary}`]:{color:(i.vars||i).palette.secondary.contrastText,backgroundColor:(i.vars||i).palette.secondary.dark},[`& .${nr.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:i.typography.pxToRem(10)},[`& .${nr.icon}`]:{marginLeft:5,marginRight:-6},[`& .${nr.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:i.vars?`rgba(${i.vars.palette.text.primaryChannel} / 0.26)`:Pt(i.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:i.vars?`rgba(${i.vars.palette.text.primaryChannel} / 0.4)`:Pt(i.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${nr.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${nr.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(i.palette).filter(br(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(i.vars||i).palette[n].main,color:(i.vars||i).palette[n].contrastText,[`& .${nr.deleteIcon}`]:{color:i.vars?`rgba(${i.vars.palette[n].contrastTextChannel} / 0.7)`:Pt(i.palette[n].contrastText,.7),"&:hover, &:active":{color:(i.vars||i).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${nr.icon}`]:{color:i.vars?i.vars.palette.Chip.defaultIconColor:e}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${nr.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${nr.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.action.selectedChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:Pt(i.palette.action.selected,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)}}},...Object.entries(i.palette).filter(br(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${nr.focusVisible}`]:{background:(i.vars||i).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.selectedChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:Pt(i.palette.action.selected,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity)},[`&.${nr.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.action.selectedChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:Pt(i.palette.action.selected,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)},"&:active":{boxShadow:(i.vars||i).shadows[1]}}},...Object.entries(i.palette).filter(br(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${nr.focusVisible}`]:{backgroundColor:(i.vars||i).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:i.vars?`1px solid ${i.vars.palette.Chip.defaultBorder}`:`1px solid ${i.palette.mode==="light"?i.palette.grey[400]:i.palette.grey[700]}`,[`&.${nr.clickable}:hover`]:{backgroundColor:(i.vars||i).palette.action.hover},[`&.${nr.focusVisible}`]:{backgroundColor:(i.vars||i).palette.action.focus},[`& .${nr.avatar}`]:{marginLeft:4},[`& .${nr.avatarSmall}`]:{marginLeft:2},[`& .${nr.icon}`]:{marginLeft:4},[`& .${nr.iconSmall}`]:{marginLeft:2},[`& .${nr.deleteIcon}`]:{marginRight:5},[`& .${nr.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(i.palette).filter(br()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(i.vars||i).palette[n].main,border:`1px solid ${i.vars?`rgba(${i.vars.palette[n].mainChannel} / 0.7)`:Pt(i.palette[n].main,.7)}`,[`&.${nr.clickable}:hover`]:{backgroundColor:i.vars?`rgba(${i.vars.palette[n].mainChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette[n].main,i.palette.action.hoverOpacity)},[`&.${nr.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette[n].mainChannel} / ${i.vars.palette.action.focusOpacity})`:Pt(i.palette[n].main,i.palette.action.focusOpacity)},[`& .${nr.deleteIcon}`]:{color:i.vars?`rgba(${i.vars.palette[n].mainChannel} / 0.7)`:Pt(i.palette[n].main,.7),"&:hover, &:active":{color:(i.vars||i).palette[n].main}}}}))]}})),tHe=ye("span",{name:"MuiChip",slot:"Label",overridesResolver:(i,e)=>{const{ownerState:n}=i,{size:r}=n;return[e.label,e[`label${Ue(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function Gde(i){return i.key==="Backspace"||i.key==="Delete"}const JS=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiChip"}),{avatar:s,className:o,clickable:a,color:l="default",component:c,deleteIcon:u,disabled:d=!1,icon:h,label:f,onClick:p,onDelete:g,onKeyDown:m,onKeyUp:_,size:b="medium",variant:y="filled",tabIndex:x,skipFocusWhenDisabled:k=!1,slots:D={},slotProps:R={},...E}=r,A=$.useRef(null),M=mo(A,n),N=me=>{me.stopPropagation(),g&&g(me)},P=me=>{me.currentTarget===me.target&&Gde(me)&&me.preventDefault(),m&&m(me)},O=me=>{me.currentTarget===me.target&&g&&Gde(me)&&g(me),_&&_(me)},B=a!==!1&&p?!0:a,j=B||g?ud:c||"div",z={...r,component:j,disabled:d,size:b,color:l,iconColor:$.isValidElement(h)&&h.props.color||l,onDelete:!!g,clickable:B,variant:y},H=JVe(z),Y=j===ud?{component:c||"div",focusVisibleClassName:H.focusVisible,...g&&{disableRipple:!0}}:{};let X=null;g&&(X=u&&$.isValidElement(u)?$.cloneElement(u,{className:dt(u.props.className,H.deleteIcon),onClick:N}):C.jsx(ZVe,{className:H.deleteIcon,onClick:N}));let Q=null;s&&$.isValidElement(s)&&(Q=$.cloneElement(s,{className:dt(H.avatar,s.props.className)}));let ie=null;h&&$.isValidElement(h)&&(ie=$.cloneElement(h,{className:dt(H.icon,h.props.className)}));const K={slots:D,slotProps:R},[ee,le]=an("root",{elementType:eHe,externalForwardedProps:{...K,...E},ownerState:z,shouldForwardComponentProp:!0,ref:M,className:dt(H.root,o),additionalProps:{disabled:B&&d?!0:void 0,tabIndex:k&&d?-1:x,...Y},getSlotProps:me=>({...me,onClick:Ee=>{var je;(je=me.onClick)==null||je.call(me,Ee),p==null||p(Ee)},onKeyDown:Ee=>{var je;(je=me.onKeyDown)==null||je.call(me,Ee),P==null||P(Ee)},onKeyUp:Ee=>{var je;(je=me.onKeyUp)==null||je.call(me,Ee),O==null||O(Ee)}})}),[ke,xe]=an("label",{elementType:tHe,externalForwardedProps:K,ownerState:z,className:H.label});return C.jsxs(ee,{as:j,...le,children:[Q||ie,C.jsx(ke,{...xe,children:f}),X]})});function g3(i){return parseInt(i,10)||0}const nHe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function iHe(i){for(const e in i)return!1;return!0}function Xde(i){return iHe(i)||i.outerHeightStyle===0&&!i.overflowing}const rHe=$.forwardRef(function(e,n){const{onChange:r,maxRows:s,minRows:o=1,style:a,value:l,...c}=e,{current:u}=$.useRef(l!=null),d=$.useRef(null),h=mo(n,d),f=$.useRef(null),p=$.useRef(null),g=$.useCallback(()=>{const x=d.current,k=p.current;if(!x||!k)return;const R=fh(x).getComputedStyle(x);if(R.width==="0px")return{outerHeightStyle:0,overflowing:!1};k.style.width=R.width,k.value=x.value||e.placeholder||"x",k.value.slice(-1)===`
`&&(k.value+=" ");const E=R.boxSizing,A=g3(R.paddingBottom)+g3(R.paddingTop),M=g3(R.borderBottomWidth)+g3(R.borderTopWidth),N=k.scrollHeight;k.value="x";const P=k.scrollHeight;let O=N;o&&(O=Math.max(Number(o)*P,O)),s&&(O=Math.min(Number(s)*P,O)),O=Math.max(O,P);const B=O+(E==="border-box"?A+M:0),j=Math.abs(O-N)<=1;return{outerHeightStyle:B,overflowing:j}},[s,o,e.placeholder]),m=Ha(()=>{const x=d.current,k=g();if(!x||!k||Xde(k))return!1;const D=k.outerHeightStyle;return f.current!=null&&f.current!==D}),_=$.useCallback(()=>{const x=d.current,k=g();if(!x||!k||Xde(k))return;const D=k.outerHeightStyle;f.current!==D&&(f.current=D,x.style.height=`${D}px`),x.style.overflow=k.overflowing?"hidden":""},[g]),b=$.useRef(-1);wc(()=>{const x=l5(_),k=d==null?void 0:d.current;if(!k)return;const D=fh(k);D.addEventListener("resize",x);let R;return typeof ResizeObserver<"u"&&(R=new ResizeObserver(()=>{m()&&(R.unobserve(k),cancelAnimationFrame(b.current),_(),b.current=requestAnimationFrame(()=>{R.observe(k)}))}),R.observe(k)),()=>{x.clear(),cancelAnimationFrame(b.current),D.removeEventListener("resize",x),R&&R.disconnect()}},[g,_,m]),wc(()=>{_()});const y=x=>{u||_();const k=x.target,D=k.value.length,R=k.value.endsWith(`
`),E=k.selectionStart===D;R&&E&&k.setSelectionRange(D,D),r&&r(x)};return C.jsxs($.Fragment,{children:[C.jsx("textarea",{value:l,onChange:y,ref:h,rows:o,style:a,...c}),C.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:p,tabIndex:-1,style:{...nHe.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function dv(i){return typeof i=="string"}function Ux({props:i,states:e,muiFormControl:n}){return e.reduce((r,s)=>(r[s]=i[s],n&&typeof i[s]>"u"&&(r[s]=n[s]),r),{})}const SW=$.createContext(void 0);function Ov(){return $.useContext(SW)}function Yde(i){return i!=null&&!(Array.isArray(i)&&i.length===0)}function g9(i,e=!1){return i&&(Yde(i.value)&&i.value!==""||e&&Yde(i.defaultValue)&&i.defaultValue!=="")}function sHe(i){return i.startAdornment}function oHe(i){return Xt("MuiInputBase",i)}const qd=Yt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Zde;const xW=(i,e)=>{const{ownerState:n}=i;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${Ue(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},kW=(i,e)=>{const{ownerState:n}=i;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},aHe=i=>{const{classes:e,color:n,disabled:r,error:s,endAdornment:o,focused:a,formControl:l,fullWidth:c,hiddenLabel:u,multiline:d,readOnly:h,size:f,startAdornment:p,type:g}=i,m={root:["root",`color${Ue(n)}`,r&&"disabled",s&&"error",c&&"fullWidth",a&&"focused",l&&"formControl",f&&f!=="medium"&&`size${Ue(f)}`,d&&"multiline",p&&"adornedStart",o&&"adornedEnd",u&&"hiddenLabel",h&&"readOnly"],input:["input",r&&"disabled",g==="search"&&"inputTypeSearch",d&&"inputMultiline",f==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",o&&"inputAdornedEnd",h&&"readOnly"]};return Zt(m,oHe,e)},LW=ye("div",{name:"MuiInputBase",slot:"Root",overridesResolver:xW})(jt(({theme:i})=>({...i.typography.body1,color:(i.vars||i).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${qd.disabled}`]:{color:(i.vars||i).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:n})=>e.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),DW=ye("input",{name:"MuiInputBase",slot:"Input",overridesResolver:kW})(jt(({theme:i})=>{const e=i.palette.mode==="light",n={color:"currentColor",...i.vars?{opacity:i.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5},transition:i.transitions.create("opacity",{duration:i.transitions.duration.shorter})},r={opacity:"0 !important"},s=i.vars?{opacity:i.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${qd.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":s,"&:focus::-moz-placeholder":s,"&:focus::-ms-input-placeholder":s},[`&.${qd.disabled}`]:{opacity:1,WebkitTextFillColor:(i.vars||i).palette.text.disabled},variants:[{props:({ownerState:o})=>!o.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:o})=>o.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Qde=Bre({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),EW=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiInputBase"}),{"aria-describedby":s,autoComplete:o,autoFocus:a,className:l,color:c,components:u={},componentsProps:d={},defaultValue:h,disabled:f,disableInjectingGlobalStyles:p,endAdornment:g,error:m,fullWidth:_=!1,id:b,inputComponent:y="input",inputProps:x={},inputRef:k,margin:D,maxRows:R,minRows:E,multiline:A=!1,name:M,onBlur:N,onChange:P,onClick:O,onFocus:B,onKeyDown:j,onKeyUp:z,placeholder:H,readOnly:Y,renderSuffix:X,rows:Q,size:ie,slotProps:K={},slots:ee={},startAdornment:le,type:ke="text",value:xe,...me}=r,Ee=x.value!=null?x.value:xe,{current:je}=$.useRef(Ee!=null),qe=$.useRef(),Ze=$.useCallback(Ve=>{},[]),We=mo(qe,k,x.ref,Ze),[ut,st]=$.useState(!1),mt=Ov(),Rt=Ux({props:r,muiFormControl:mt,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Rt.focused=mt?mt.focused:ut,$.useEffect(()=>{!mt&&f&&ut&&(st(!1),N&&N())},[mt,f,ut,N]);const Vt=mt&&mt.onFilled,Ot=mt&&mt.onEmpty,vt=$.useCallback(Ve=>{g9(Ve)?Vt&&Vt():Ot&&Ot()},[Vt,Ot]);wc(()=>{je&&vt({value:Ee})},[Ee,vt,je]);const wn=Ve=>{B&&B(Ve),x.onFocus&&x.onFocus(Ve),mt&&mt.onFocus?mt.onFocus(Ve):st(!0)},Ce=Ve=>{N&&N(Ve),x.onBlur&&x.onBlur(Ve),mt&&mt.onBlur?mt.onBlur(Ve):st(!1)},ge=(Ve,...gt)=>{if(!je){const $t=Ve.target||qe.current;if($t==null)throw new Error(kv(1));vt({value:$t.value})}x.onChange&&x.onChange(Ve,...gt),P&&P(Ve,...gt)};$.useEffect(()=>{vt(qe.current)},[]);const pe=Ve=>{qe.current&&Ve.currentTarget===Ve.target&&qe.current.focus(),O&&O(Ve)};let ne=y,ae=x;A&&ne==="input"&&(Q?ae={type:void 0,minRows:Q,maxRows:Q,...ae}:ae={type:void 0,maxRows:R,minRows:E,...ae},ne=rHe);const ue=Ve=>{vt(Ve.animationName==="mui-auto-fill-cancel"?qe.current:{value:"x"})};$.useEffect(()=>{mt&&mt.setAdornedStart(!!le)},[mt,le]);const de={...r,color:Rt.color||"primary",disabled:Rt.disabled,endAdornment:g,error:Rt.error,focused:Rt.focused,formControl:mt,fullWidth:_,hiddenLabel:Rt.hiddenLabel,multiline:A,size:Rt.size,startAdornment:le,type:ke},Se=aHe(de),Ie=ee.root||u.Root||LW,nt=K.root||d.root||{},Oe=ee.input||u.Input||DW;return ae={...ae,...K.input??d.input},C.jsxs($.Fragment,{children:[!p&&typeof Qde=="function"&&(Zde||(Zde=C.jsx(Qde,{}))),C.jsxs(Ie,{...nt,ref:n,onClick:pe,...me,...!dv(Ie)&&{ownerState:{...de,...nt.ownerState}},className:dt(Se.root,nt.className,l,Y&&"MuiInputBase-readOnly"),children:[le,C.jsx(SW.Provider,{value:null,children:C.jsx(Oe,{"aria-invalid":Rt.error,"aria-describedby":s,autoComplete:o,autoFocus:a,defaultValue:h,disabled:Rt.disabled,id:b,onAnimationStart:ue,name:M,placeholder:H,readOnly:Y,required:Rt.required,rows:Q,value:Ee,onKeyDown:j,onKeyUp:z,type:ke,...ae,...!dv(Oe)&&{as:ne,ownerState:{...de,...ae.ownerState}},ref:We,className:dt(Se.input,ae.className,Y&&"MuiInputBase-readOnly"),onBlur:Ce,onChange:ge,onFocus:wn})}),g,X?X({...Rt,startAdornment:le}):null]})]})});function lHe(i){return Xt("MuiInput",i)}const sy={...qd,...Yt("MuiInput",["root","underline","input"])};function cHe(i){return Xt("MuiOutlinedInput",i)}const Qh={...qd,...Yt("MuiOutlinedInput",["root","notchedOutline","input"])};function uHe(i){return Xt("MuiFilledInput",i)}const Kd={...qd,...Yt("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},Jke=Hr(C.jsx("path",{d:"M7 10l5 5 5-5z"}));function dHe(i){return Xt("MuiAutocomplete",i)}const Hi=Yt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var Jde,ehe;const hHe=i=>{const{classes:e,disablePortal:n,expanded:r,focused:s,fullWidth:o,hasClearIcon:a,hasPopupIcon:l,inputFocused:c,popupOpen:u,size:d}=i,h={root:["root",r&&"expanded",s&&"focused",o&&"fullWidth",a&&"hasClearIcon",l&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",c&&"inputFocused"],tag:["tag",`tagSize${Ue(d)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Zt(h,dHe,e)},fHe=ye("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i,{fullWidth:r,hasClearIcon:s,hasPopupIcon:o,inputFocused:a,size:l}=n;return[{[`& .${Hi.tag}`]:e.tag},{[`& .${Hi.tag}`]:e[`tagSize${Ue(l)}`]},{[`& .${Hi.inputRoot}`]:e.inputRoot},{[`& .${Hi.input}`]:e.input},{[`& .${Hi.input}`]:a&&e.inputFocused},e.root,r&&e.fullWidth,o&&e.hasPopupIcon,s&&e.hasClearIcon]}})({[`&.${Hi.focused} .${Hi.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${Hi.clearIndicator}`]:{visibility:"visible"}},[`& .${Hi.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${Hi.inputRoot}`]:{[`.${Hi.hasPopupIcon}&, .${Hi.hasClearIcon}&`]:{paddingRight:30},[`.${Hi.hasPopupIcon}.${Hi.hasClearIcon}&`]:{paddingRight:56},[`& .${Hi.input}`]:{width:0,minWidth:30}},[`& .${sy.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${sy.root}.${qd.sizeSmall}`]:{[`& .${sy.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Qh.root}`]:{padding:9,[`.${Hi.hasPopupIcon}&, .${Hi.hasClearIcon}&`]:{paddingRight:39},[`.${Hi.hasPopupIcon}.${Hi.hasClearIcon}&`]:{paddingRight:65},[`& .${Hi.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${Hi.endAdornment}`]:{right:9}},[`& .${Qh.root}.${qd.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${Hi.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${Kd.root}`]:{paddingTop:19,paddingLeft:8,[`.${Hi.hasPopupIcon}&, .${Hi.hasClearIcon}&`]:{paddingRight:39},[`.${Hi.hasPopupIcon}.${Hi.hasClearIcon}&`]:{paddingRight:65},[`& .${Kd.input}`]:{padding:"7px 4px"},[`& .${Hi.endAdornment}`]:{right:9}},[`& .${Kd.root}.${qd.sizeSmall}`]:{paddingBottom:1,[`& .${Kd.input}`]:{padding:"2.5px 4px"}},[`& .${qd.hiddenLabel}`]:{paddingTop:8},[`& .${Kd.root}.${qd.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${Hi.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${Kd.root}.${qd.hiddenLabel}.${qd.sizeSmall}`]:{[`& .${Hi.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${Hi.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${Hi.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${Hi.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${Hi.inputRoot}`]:{flexWrap:"wrap"}}}]}),pHe=ye("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),gHe=ye(Ga,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),mHe=ye(Ga,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.popupIndicator,n.popupOpen&&e.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),_He=ye(CW,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[{[`& .${Hi.option}`]:e.option},e.popper,n.disablePortal&&e.popperDisablePortal]}})(jt(({theme:i})=>({zIndex:(i.vars||i).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),vHe=ye(du,{name:"MuiAutocomplete",slot:"Paper"})(jt(({theme:i})=>({...i.typography.body1,overflow:"auto"}))),bHe=ye("div",{name:"MuiAutocomplete",slot:"Loading"})(jt(({theme:i})=>({color:(i.vars||i).palette.text.secondary,padding:"14px 16px"}))),yHe=ye("div",{name:"MuiAutocomplete",slot:"NoOptions"})(jt(({theme:i})=>({color:(i.vars||i).palette.text.secondary,padding:"14px 16px"}))),wHe=ye("ul",{name:"MuiAutocomplete",slot:"Listbox"})(jt(({theme:i})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${Hi.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[i.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${Hi.focused}`]:{backgroundColor:(i.vars||i).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(i.vars||i).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Hi.focusVisible}`]:{backgroundColor:(i.vars||i).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity),[`&.${Hi.focused}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(i.vars||i).palette.action.selected}},[`&.${Hi.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)}}}}))),CHe=ye(TZ,{name:"MuiAutocomplete",slot:"GroupLabel"})(jt(({theme:i})=>({backgroundColor:(i.vars||i).palette.background.paper,top:-8}))),SHe=ye("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${Hi.option}`]:{paddingLeft:24}}),eLe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiAutocomplete"}),{autoComplete:s=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:l=!1,ChipProps:c,className:u,clearIcon:d=Jde||(Jde=C.jsx($ke,{fontSize:"small"})),clearOnBlur:h=!r.freeSolo,clearOnEscape:f=!1,clearText:p="Clear",closeText:g="Close",componentsProps:m,defaultValue:_=r.multiple?[]:null,disableClearable:b=!1,disableCloseOnSelect:y=!1,disabled:x=!1,disabledItemsFocusable:k=!1,disableListWrap:D=!1,disablePortal:R=!1,filterOptions:E,filterSelectedOptions:A=!1,forcePopupIcon:M="auto",freeSolo:N=!1,fullWidth:P=!1,getLimitTagsText:O=Yi=>`+${Yi}`,getOptionDisabled:B,getOptionKey:j,getOptionLabel:z,isOptionEqualToValue:H,groupBy:Y,handleHomeEndKeys:X=!r.freeSolo,id:Q,includeInputInList:ie=!1,inputValue:K,limitTags:ee=-1,ListboxComponent:le,ListboxProps:ke,loading:xe=!1,loadingText:me="Loading…",multiple:Ee=!1,noOptionsText:je="No options",onChange:qe,onClose:Ze,onHighlightChange:We,onInputChange:ut,onOpen:st,open:mt,openOnFocus:Rt=!1,openText:Vt="Open",options:Ot,PaperComponent:vt,PopperComponent:wn,popupIcon:Ce=ehe||(ehe=C.jsx(Jke,{})),readOnly:ge=!1,renderGroup:pe,renderInput:ne,renderOption:ae,renderTags:ue,renderValue:de,selectOnFocus:Se=!r.freeSolo,size:Ie="medium",slots:nt={},slotProps:Oe={},value:Ve,...gt}=r,{getRootProps:$t,getInputProps:Mt,getInputLabelProps:Bt,getPopupIndicatorProps:jn,getClearProps:Dt,getItemProps:Fn,getListboxProps:tn,getOptionProps:pi,value:Pi,dirty:ti,expanded:mi,id:ds,popupOpen:Nr,focused:Br,focusedItem:Mn,anchorEl:hr,setAnchorEl:rn,inputValue:sn,groupedOptions:Kn}=Aze({...r,componentName:"Autocomplete"}),ai=!b&&!x&&ti&&!ge,Ki=(!N||M===!0)&&M!==!1,{onMouseDown:so}=Mt(),{ref:_o,...Cs}=tn(),yl=z||(Yi=>Yi.label??Yi),qs={...r,disablePortal:R,expanded:mi,focused:Br,fullWidth:P,getOptionLabel:yl,hasClearIcon:ai,hasPopupIcon:Ki,inputFocused:Mn===-1,popupOpen:Nr,size:Ie},Ks=hHe(qs),ma={slots:{paper:vt,popper:wn,...nt},slotProps:{chip:c,listbox:ke,...m,...Oe}},[yn,Pe]=an("listbox",{elementType:wHe,externalForwardedProps:ma,ownerState:qs,className:Ks.listbox,additionalProps:Cs,ref:_o}),[De,Ne]=an("paper",{elementType:du,externalForwardedProps:ma,ownerState:qs,className:Ks.paper}),[At,En]=an("popper",{elementType:CW,externalForwardedProps:ma,ownerState:qs,className:Ks.popper,additionalProps:{disablePortal:R,style:{width:hr?hr.clientWidth:null},role:"presentation",anchorEl:hr,open:Nr}});let bn;const Yn=Yi=>({className:Ks.tag,disabled:x,...Fn(Yi)});if(Ee?Pi.length>0&&(ue?bn=ue(Pi,Yn,qs):de?bn=de(Pi,Yn,qs):bn=Pi.map((Yi,Ic)=>{const{key:Uo,...__}=Yn({index:Ic});return C.jsx(JS,{label:yl(Yi),size:Ie,...__,...ma.slotProps.chip},Uo)})):de&&Pi!=null&&(bn=de(Pi,Yn,qs)),ee>-1&&Array.isArray(bn)){const Yi=bn.length-ee;!Br&&Yi>0&&(bn=bn.splice(0,ee),bn.push(C.jsx("span",{className:Ks.tag,children:O(Yi)},bn.length)))}const Ei=pe||(Yi=>C.jsxs("li",{children:[C.jsx(CHe,{className:Ks.groupLabel,ownerState:qs,component:"div",children:Yi.group}),C.jsx(SHe,{className:Ks.groupUl,ownerState:qs,children:Yi.children})]},Yi.key)),Xv=ae||((Yi,Ic)=>{const{key:Uo,...__}=Yi;return C.jsx("li",{...__,children:yl(Ic)},Uo)}),lw=(Yi,Ic)=>{const Uo=pi({option:Yi,index:Ic});return Xv({...Uo,className:Ks.option},Yi,{selected:Uo["aria-selected"],index:Ic,inputValue:sn},qs)},Dh=ma.slotProps.clearIndicator,m_=ma.slotProps.popupIndicator;return C.jsxs($.Fragment,{children:[C.jsx(fHe,{ref:n,className:dt(Ks.root,u),ownerState:qs,...$t(gt),children:ne({id:ds,disabled:x,fullWidth:!0,size:Ie==="small"?"small":void 0,InputLabelProps:Bt(),InputProps:{ref:rn,className:Ks.inputRoot,startAdornment:bn,onMouseDown:Yi=>{Yi.target===Yi.currentTarget&&so(Yi)},...(ai||Ki)&&{endAdornment:C.jsxs(pHe,{className:Ks.endAdornment,ownerState:qs,children:[ai?C.jsx(gHe,{...Dt(),"aria-label":p,title:p,ownerState:qs,...Dh,className:dt(Ks.clearIndicator,Dh==null?void 0:Dh.className),children:d}):null,Ki?C.jsx(mHe,{...jn(),disabled:x,"aria-label":Nr?g:Vt,title:Nr?g:Vt,ownerState:qs,...m_,className:dt(Ks.popupIndicator,m_==null?void 0:m_.className),children:Ce}):null]})}},inputProps:{className:Ks.input,disabled:x,readOnly:ge,...Mt()}})}),hr?C.jsx(_He,{as:At,...En,children:C.jsxs(vHe,{as:De,...Ne,children:[xe&&Kn.length===0?C.jsx(bHe,{className:Ks.loading,ownerState:qs,children:me}):null,Kn.length===0&&!N&&!xe?C.jsx(yHe,{className:Ks.noOptions,ownerState:qs,role:"presentation",onMouseDown:Yi=>{Yi.preventDefault()},children:je}):null,Kn.length>0?C.jsx(yn,{as:le,...Pe,children:Kn.map((Yi,Ic)=>Y?Ei({key:Yi.key,group:Yi.group,children:Yi.options.map((Uo,__)=>lw(Uo,Yi.index+__))}):lw(Yi,Ic))}):null]})}):null]})}),xHe={entering:{opacity:1},entered:{opacity:1}},RZ=$.forwardRef(function(e,n){const r=$i(),s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:l,easing:c,in:u,onEnter:d,onEntered:h,onEntering:f,onExit:p,onExited:g,onExiting:m,style:_,timeout:b=s,TransitionComponent:y=Nf,...x}=e,k=$.useRef(null),D=mo(k,Hx(l),n),R=j=>z=>{if(j){const H=k.current;z===void 0?j(H):j(H,z)}},E=R(f),A=R((j,z)=>{Vre(j);const H=s1({style:_,timeout:b,easing:c},{mode:"enter"});j.style.webkitTransition=r.transitions.create("opacity",H),j.style.transition=r.transitions.create("opacity",H),d&&d(j,z)}),M=R(h),N=R(m),P=R(j=>{const z=s1({style:_,timeout:b,easing:c},{mode:"exit"});j.style.webkitTransition=r.transitions.create("opacity",z),j.style.transition=r.transitions.create("opacity",z),p&&p(j)}),O=R(g),B=j=>{o&&o(k.current,j)};return C.jsx(y,{appear:a,in:u,nodeRef:k,onEnter:A,onEntered:M,onEntering:E,onExit:P,onExited:O,onExiting:N,addEndListener:B,timeout:b,...x,children:(j,{ownerState:z,...H})=>$.cloneElement(l,{style:{opacity:0,visibility:j==="exited"&&!u?"hidden":void 0,...xHe[j],..._,...l.props.style},ref:D,...H})})});function kHe(i){return Xt("MuiBackdrop",i)}Yt("MuiBackdrop",["root","invisible"]);const LHe=i=>{const{classes:e,invisible:n}=i;return Zt({root:["root",n&&"invisible"]},kHe,e)},DHe=ye("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.invisible&&e.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),tLe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiBackdrop"}),{children:s,className:o,component:a="div",invisible:l=!1,open:c,components:u={},componentsProps:d={},slotProps:h={},slots:f={},TransitionComponent:p,transitionDuration:g,...m}=r,_={...r,component:a,invisible:l},b=LHe(_),y={transition:p,root:u.Root,...f},x={...d,...h},k={component:a,slots:y,slotProps:x},[D,R]=an("root",{elementType:DHe,externalForwardedProps:k,className:dt(b.root,o),ownerState:_}),[E,A]=an("transition",{elementType:RZ,externalForwardedProps:k,ownerState:_});return C.jsx(E,{in:c,timeout:g,...m,...A,children:C.jsx(D,{"aria-hidden":!0,...R,classes:b,ref:n,children:s})})}),EHe=Yt("MuiBox",["root"]),IHe=a5(),Ye=hke({themeId:Bp,defaultTheme:IHe,defaultClassName:EHe.root,generateClassName:Rre.generate});function THe(i){return Xt("MuiButton",i)}const eC=Yt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),nLe=$.createContext({}),iLe=$.createContext(void 0),RHe=i=>{const{color:e,disableElevation:n,fullWidth:r,size:s,variant:o,loading:a,loadingPosition:l,classes:c}=i,u={root:["root",a&&"loading",o,`${o}${Ue(e)}`,`size${Ue(s)}`,`${o}Size${Ue(s)}`,`color${Ue(e)}`,n&&"disableElevation",r&&"fullWidth",a&&`loadingPosition${Ue(l)}`],startIcon:["icon","startIcon",`iconSize${Ue(s)}`],endIcon:["icon","endIcon",`iconSize${Ue(s)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},d=Zt(u,THe,c);return{...c,...d}},rLe=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],AHe=ye(ud,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiButton",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant],e[`${n.variant}${Ue(n.color)}`],e[`size${Ue(n.size)}`],e[`${n.variant}Size${Ue(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth,n.loading&&e.loading]}})(jt(({theme:i})=>{const e=i.palette.mode==="light"?i.palette.grey[300]:i.palette.grey[800],n=i.palette.mode==="light"?i.palette.grey.A100:i.palette.grey[700];return{...i.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(i.vars||i).shape.borderRadius,transition:i.transitions.create(["background-color","box-shadow","border-color","color"],{duration:i.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${eC.disabled}`]:{color:(i.vars||i).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(i.vars||i).shadows[2],"&:hover":{boxShadow:(i.vars||i).shadows[4],"@media (hover: none)":{boxShadow:(i.vars||i).shadows[2]}},"&:active":{boxShadow:(i.vars||i).shadows[8]},[`&.${eC.focusVisible}`]:{boxShadow:(i.vars||i).shadows[6]},[`&.${eC.disabled}`]:{color:(i.vars||i).palette.action.disabled,boxShadow:(i.vars||i).shadows[0],backgroundColor:(i.vars||i).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${eC.disabled}`]:{border:`1px solid ${(i.vars||i).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(i.palette).filter(br()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(i.vars||i).palette[r].main,"--variant-outlinedColor":(i.vars||i).palette[r].main,"--variant-outlinedBorder":i.vars?`rgba(${i.vars.palette[r].mainChannel} / 0.5)`:Pt(i.palette[r].main,.5),"--variant-containedColor":(i.vars||i).palette[r].contrastText,"--variant-containedBg":(i.vars||i).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(i.vars||i).palette[r].dark,"--variant-textBg":i.vars?`rgba(${i.vars.palette[r].mainChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette[r].main,i.palette.action.hoverOpacity),"--variant-outlinedBorder":(i.vars||i).palette[r].main,"--variant-outlinedBg":i.vars?`rgba(${i.vars.palette[r].mainChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette[r].main,i.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":i.vars?i.vars.palette.Button.inheritContainedBg:e,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":i.vars?i.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":i.vars?`rgba(${i.vars.palette.text.primaryChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette.text.primary,i.palette.action.hoverOpacity),"--variant-outlinedBg":i.vars?`rgba(${i.vars.palette.text.primaryChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette.text.primary,i.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:i.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:i.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:i.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:i.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:i.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:i.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${eC.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${eC.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:i.transitions.create(["background-color","box-shadow","border-color"],{duration:i.transitions.duration.short}),[`&.${eC.loading}`]:{color:"transparent"}}}]}})),NHe=ye("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.startIcon,n.loading&&e.startIconLoadingStart,e[`iconSize${Ue(n.size)}`]]}})(({theme:i})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:i.transitions.create(["opacity"],{duration:i.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...rLe]})),MHe=ye("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.endIcon,n.loading&&e.endIconLoadingEnd,e[`iconSize${Ue(n.size)}`]]}})(({theme:i})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:i.transitions.create(["opacity"],{duration:i.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...rLe]})),PHe=ye("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:i})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(i.vars||i).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),the=ye("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Ci=$.forwardRef(function(e,n){const r=$.useContext(nLe),s=$.useContext(iLe),o=mE(r,e),a=Qt({props:o,name:"MuiButton"}),{children:l,color:c="primary",component:u="button",className:d,disabled:h=!1,disableElevation:f=!1,disableFocusRipple:p=!1,endIcon:g,focusVisibleClassName:m,fullWidth:_=!1,id:b,loading:y=null,loadingIndicator:x,loadingPosition:k="center",size:D="medium",startIcon:R,type:E,variant:A="text",...M}=a,N=W1(b),P=x??C.jsx(c5,{"aria-labelledby":N,color:"inherit",size:16}),O={...a,color:c,component:u,disabled:h,disableElevation:f,disableFocusRipple:p,fullWidth:_,loading:y,loadingIndicator:P,loadingPosition:k,size:D,type:E,variant:A},B=RHe(O),j=(R||y&&k==="start")&&C.jsx(NHe,{className:B.startIcon,ownerState:O,children:R||C.jsx(the,{className:B.loadingIconPlaceholder,ownerState:O})}),z=(g||y&&k==="end")&&C.jsx(MHe,{className:B.endIcon,ownerState:O,children:g||C.jsx(the,{className:B.loadingIconPlaceholder,ownerState:O})}),H=s||"",Y=typeof y=="boolean"?C.jsx("span",{className:B.loadingWrapper,style:{display:"contents"},children:y&&C.jsx(PHe,{className:B.loadingIndicator,ownerState:O,children:P})}):null;return C.jsxs(AHe,{ownerState:O,className:dt(r.className,B.root,d,H),component:u,disabled:h||y,focusRipple:!p,focusVisibleClassName:dt(B.focusVisible,m),ref:n,type:E,id:y?N:b,...M,classes:B,children:[j,k!=="end"&&Y,l,k==="end"&&Y,z]})});function sLe(i){return $.Children.toArray(i).filter(e=>$.isValidElement(e))}function OHe(i){return Xt("MuiButtonGroup",i)}const ji=Yt("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","horizontal","vertical","colorPrimary","colorSecondary","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]),FHe=(i,e)=>{const{ownerState:n}=i;return[{[`& .${ji.grouped}`]:e.grouped},{[`& .${ji.grouped}`]:e[`grouped${Ue(n.orientation)}`]},{[`& .${ji.grouped}`]:e[`grouped${Ue(n.variant)}`]},{[`& .${ji.grouped}`]:e[`grouped${Ue(n.variant)}${Ue(n.orientation)}`]},{[`& .${ji.grouped}`]:e[`grouped${Ue(n.variant)}${Ue(n.color)}`]},{[`& .${ji.firstButton}`]:e.firstButton},{[`& .${ji.lastButton}`]:e.lastButton},{[`& .${ji.middleButton}`]:e.middleButton},e.root,e[n.variant],n.disableElevation===!0&&e.disableElevation,n.fullWidth&&e.fullWidth,n.orientation==="vertical"&&e.vertical]},BHe=i=>{const{classes:e,color:n,disabled:r,disableElevation:s,fullWidth:o,orientation:a,variant:l}=i,c={root:["root",l,a,o&&"fullWidth",s&&"disableElevation",`color${Ue(n)}`],grouped:["grouped",`grouped${Ue(a)}`,`grouped${Ue(l)}`,`grouped${Ue(l)}${Ue(a)}`,`grouped${Ue(l)}${Ue(n)}`,r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Zt(c,OHe,e)},jHe=ye("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:FHe})(jt(({theme:i})=>({display:"inline-flex",borderRadius:(i.vars||i).shape.borderRadius,variants:[{props:{variant:"contained"},style:{boxShadow:(i.vars||i).shadows[2]}},{props:{disableElevation:!0},style:{boxShadow:"none"}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${ji.lastButton},& .${ji.middleButton}`]:{borderTopRightRadius:0,borderTopLeftRadius:0},[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderBottomRightRadius:0,borderBottomLeftRadius:0}}},{props:{orientation:"horizontal"},style:{[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${ji.lastButton},& .${ji.middleButton}`]:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}},{props:{variant:"text",orientation:"horizontal"},style:{[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderRight:i.vars?`1px solid rgba(${i.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${i.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${ji.disabled}`]:{borderRight:`1px solid ${(i.vars||i).palette.action.disabled}`}}}},{props:{variant:"text",orientation:"vertical"},style:{[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderBottom:i.vars?`1px solid rgba(${i.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${i.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${ji.disabled}`]:{borderBottom:`1px solid ${(i.vars||i).palette.action.disabled}`}}}},...Object.entries(i.palette).filter(br()).flatMap(([e])=>[{props:{variant:"text",color:e},style:{[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderColor:i.vars?`rgba(${i.vars.palette[e].mainChannel} / 0.5)`:Pt(i.palette[e].main,.5)}}}]),{props:{variant:"outlined",orientation:"horizontal"},style:{[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderRightColor:"transparent","&:hover":{borderRightColor:"currentColor"}},[`& .${ji.lastButton},& .${ji.middleButton}`]:{marginLeft:-1}}},{props:{variant:"outlined",orientation:"vertical"},style:{[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderBottomColor:"transparent","&:hover":{borderBottomColor:"currentColor"}},[`& .${ji.lastButton},& .${ji.middleButton}`]:{marginTop:-1}}},{props:{variant:"contained",orientation:"horizontal"},style:{[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderRight:`1px solid ${(i.vars||i).palette.grey[400]}`,[`&.${ji.disabled}`]:{borderRight:`1px solid ${(i.vars||i).palette.action.disabled}`}}}},{props:{variant:"contained",orientation:"vertical"},style:{[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderBottom:`1px solid ${(i.vars||i).palette.grey[400]}`,[`&.${ji.disabled}`]:{borderBottom:`1px solid ${(i.vars||i).palette.action.disabled}`}}}},...Object.entries(i.palette).filter(br(["dark"])).map(([e])=>({props:{variant:"contained",color:e},style:{[`& .${ji.firstButton},& .${ji.middleButton}`]:{borderColor:(i.vars||i).palette[e].dark}}}))],[`& .${ji.grouped}`]:{minWidth:40,boxShadow:"none",props:{variant:"contained"},style:{"&:hover":{boxShadow:"none"}}}}))),WHe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiButtonGroup"}),{children:s,className:o,color:a="primary",component:l="div",disabled:c=!1,disableElevation:u=!1,disableFocusRipple:d=!1,disableRipple:h=!1,fullWidth:f=!1,orientation:p="horizontal",size:g="medium",variant:m="outlined",..._}=r,b={...r,color:a,component:l,disabled:c,disableElevation:u,disableFocusRipple:d,disableRipple:h,fullWidth:f,orientation:p,size:g,variant:m},y=BHe(b),x=$.useMemo(()=>({className:y.grouped,color:a,disabled:c,disableElevation:u,disableFocusRipple:d,disableRipple:h,fullWidth:f,size:g,variant:m}),[a,c,u,d,h,f,g,m,y.grouped]),k=sLe(s),D=k.length,R=E=>{const A=E===0,M=E===D-1;return A&&M?"":A?y.firstButton:M?y.lastButton:y.middleButton};return C.jsx(jHe,{as:l,role:"group",className:dt(y.root,o),ref:n,ownerState:b,..._,children:C.jsx(nLe.Provider,{value:x,children:k.map((E,A)=>C.jsx(iLe.Provider,{value:R(A),children:E},A))})})});function $He(i){return Xt("MuiCard",i)}Yt("MuiCard",["root"]);const zHe=i=>{const{classes:e}=i;return Zt({root:["root"]},$He,e)},VHe=ye(du,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),Fv=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiCard"}),{className:s,raised:o=!1,...a}=r,l={...r,raised:o},c=zHe(l);return C.jsx(VHe,{className:dt(c.root,s),elevation:o?8:void 0,ref:n,ownerState:l,...a})});function HHe(i){return Xt("MuiCardActionArea",i)}const fU=Yt("MuiCardActionArea",["root","focusVisible","focusHighlight"]),UHe=i=>{const{classes:e}=i;return Zt({root:["root"],focusHighlight:["focusHighlight"]},HHe,e)},qHe=ye(ud,{name:"MuiCardActionArea",slot:"Root"})(jt(({theme:i})=>({display:"block",textAlign:"inherit",borderRadius:"inherit",width:"100%",[`&:hover .${fU.focusHighlight}`]:{opacity:(i.vars||i).palette.action.hoverOpacity,"@media (hover: none)":{opacity:0}},[`&.${fU.focusVisible} .${fU.focusHighlight}`]:{opacity:(i.vars||i).palette.action.focusOpacity}}))),KHe=ye("span",{name:"MuiCardActionArea",slot:"FocusHighlight"})(jt(({theme:i})=>({overflow:"hidden",pointerEvents:"none",position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:"inherit",opacity:0,backgroundColor:"currentcolor",transition:i.transitions.create("opacity",{duration:i.transitions.duration.short})}))),GHe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiCardActionArea"}),{children:s,className:o,focusVisibleClassName:a,slots:l={},slotProps:c={},...u}=r,d=r,h=UHe(d),f={slots:l,slotProps:c},[p,g]=an("root",{elementType:qHe,externalForwardedProps:{...f,...u},shouldForwardComponentProp:!0,ownerState:d,ref:n,className:dt(h.root,o),additionalProps:{focusVisibleClassName:dt(a,h.focusVisible)}}),[m,_]=an("focusHighlight",{elementType:KHe,externalForwardedProps:f,ownerState:d,ref:n,className:h.focusHighlight});return C.jsxs(p,{...g,children:[s,C.jsx(m,{..._})]})});function XHe(i){return Xt("MuiCardActions",i)}Yt("MuiCardActions",["root","spacing"]);const YHe=i=>{const{classes:e,disableSpacing:n}=i;return Zt({root:["root",!n&&"spacing"]},XHe,e)},ZHe=ye("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),QHe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiCardActions"}),{disableSpacing:s=!1,className:o,...a}=r,l={...r,disableSpacing:s},c=YHe(l);return C.jsx(ZHe,{className:dt(c.root,o),ownerState:l,ref:n,...a})});function JHe(i){return Xt("MuiCardContent",i)}Yt("MuiCardContent",["root"]);const eUe=i=>{const{classes:e}=i;return Zt({root:["root"]},JHe,e)},tUe=ye("div",{name:"MuiCardContent",slot:"Root"})({padding:16,"&:last-child":{paddingBottom:24}}),ex=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiCardContent"}),{className:s,component:o="div",...a}=r,l={...r,component:o},c=eUe(l);return C.jsx(tUe,{as:o,className:dt(c.root,s),ownerState:l,ref:n,...a})});function nUe(i){return Xt("MuiCardHeader",i)}const m9=Yt("MuiCardHeader",["root","avatar","action","content","title","subheader"]),iUe=i=>{const{classes:e}=i;return Zt({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},nUe,e)},rUe=ye("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(i,e)=>[{[`& .${m9.title}`]:e.title},{[`& .${m9.subheader}`]:e.subheader},e.root]})({display:"flex",alignItems:"center",padding:16}),sUe=ye("div",{name:"MuiCardHeader",slot:"Avatar"})({display:"flex",flex:"0 0 auto",marginRight:16}),oUe=ye("div",{name:"MuiCardHeader",slot:"Action"})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),aUe=ye("div",{name:"MuiCardHeader",slot:"Content"})({flex:"1 1 auto",[`.${f9.root}:where(& .${m9.title})`]:{display:"block"},[`.${f9.root}:where(& .${m9.subheader})`]:{display:"block"}}),h5=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiCardHeader"}),{action:s,avatar:o,component:a="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:d,titleTypographyProps:h,slots:f={},slotProps:p={},...g}=r,m={...r,component:a,disableTypography:l},_=iUe(m),b={slots:f,slotProps:{title:h,subheader:u,...p}};let y=d;const[x,k]=an("title",{className:_.title,elementType:Je,externalForwardedProps:b,ownerState:m,additionalProps:{variant:o?"body2":"h5",component:"span"}});y!=null&&y.type!==Je&&!l&&(y=C.jsx(x,{...k,children:y}));let D=c;const[R,E]=an("subheader",{className:_.subheader,elementType:Je,externalForwardedProps:b,ownerState:m,additionalProps:{variant:o?"body2":"body1",color:"textSecondary",component:"span"}});D!=null&&D.type!==Je&&!l&&(D=C.jsx(R,{...E,children:D}));const[A,M]=an("root",{ref:n,className:_.root,elementType:rUe,externalForwardedProps:{...b,...g,component:a},ownerState:m}),[N,P]=an("avatar",{className:_.avatar,elementType:sUe,externalForwardedProps:b,ownerState:m}),[O,B]=an("content",{className:_.content,elementType:aUe,externalForwardedProps:b,ownerState:m}),[j,z]=an("action",{className:_.action,elementType:oUe,externalForwardedProps:b,ownerState:m});return C.jsxs(A,{...M,children:[o&&C.jsx(N,{...P,children:o}),C.jsxs(O,{...B,children:[y,D]}),s&&C.jsx(j,{...z,children:s})]})});function lUe(i){return Xt("MuiCardMedia",i)}Yt("MuiCardMedia",["root","media","img"]);const cUe=i=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=i;return Zt({root:["root",n&&"media",r&&"img"]},lUe,e)},uUe=ye("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i,{isMediaComponent:r,isImageComponent:s}=n;return[e.root,r&&e.media,s&&e.img]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),dUe=["video","audio","picture","iframe","img"],hUe=["picture","img"],fUe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiCardMedia"}),{children:s,className:o,component:a="div",image:l,src:c,style:u,...d}=r,h=dUe.includes(a),f=!h&&l?{backgroundImage:`url("${l}")`,...u}:u,p={...r,component:a,isMediaComponent:h,isImageComponent:hUe.includes(a)},g=cUe(p);return C.jsx(uUe,{className:dt(g.root,o),as:a,role:!h&&l?"img":void 0,ref:n,style:f,ownerState:p,src:h?l||c:void 0,...d,children:s})});function pUe(i){return Xt("PrivateSwitchBase",i)}Yt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const gUe=i=>{const{classes:e,checked:n,disabled:r,edge:s}=i,o={root:["root",n&&"checked",r&&"disabled",s&&`edge${Ue(s)}`],input:["input"]};return Zt(o,pUe,e)},mUe=ye(ud,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:i,ownerState:e})=>i==="start"&&e.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:i,ownerState:e})=>i==="end"&&e.size!=="small",style:{marginRight:-12}}]}),_Ue=ye("input",{name:"MuiSwitchBase",shouldForwardProp:vl})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),oLe=$.forwardRef(function(e,n){const{autoFocus:r,checked:s,checkedIcon:o,defaultChecked:a,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:d,id:h,inputProps:f,inputRef:p,name:g,onBlur:m,onChange:_,onFocus:b,readOnly:y,required:x=!1,tabIndex:k,type:D,value:R,slots:E={},slotProps:A={},...M}=e,[N,P]=Im({controlled:s,default:!!a,name:"SwitchBase",state:"checked"}),O=Ov(),B=xe=>{b&&b(xe),O&&O.onFocus&&O.onFocus(xe)},j=xe=>{m&&m(xe),O&&O.onBlur&&O.onBlur(xe)},z=xe=>{if(xe.nativeEvent.defaultPrevented)return;const me=xe.target.checked;P(me),_&&_(xe,me)};let H=l;O&&typeof H>"u"&&(H=O.disabled);const Y=D==="checkbox"||D==="radio",X={...e,checked:N,disabled:H,disableFocusRipple:c,edge:u},Q=gUe(X),ie={slots:E,slotProps:{input:f,...A}},[K,ee]=an("root",{ref:n,elementType:mUe,className:Q.root,shouldForwardComponentProp:!0,externalForwardedProps:{...ie,component:"span",...M},getSlotProps:xe=>({...xe,onFocus:me=>{var Ee;(Ee=xe.onFocus)==null||Ee.call(xe,me),B(me)},onBlur:me=>{var Ee;(Ee=xe.onBlur)==null||Ee.call(xe,me),j(me)}}),ownerState:X,additionalProps:{centerRipple:!0,focusRipple:!c,disabled:H,role:void 0,tabIndex:null}}),[le,ke]=an("input",{ref:p,elementType:_Ue,className:Q.input,externalForwardedProps:ie,getSlotProps:xe=>({...xe,onChange:me=>{var Ee;(Ee=xe.onChange)==null||Ee.call(xe,me),z(me)}}),ownerState:X,additionalProps:{autoFocus:r,checked:s,defaultChecked:a,disabled:H,id:Y?h:void 0,name:g,readOnly:y,required:x,tabIndex:k,type:D,...D==="checkbox"&&R===void 0?{}:{value:R}}});return C.jsxs(K,{...ee,children:[C.jsx(le,{...ke}),N?o:d]})}),vUe=Hr(C.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),bUe=Hr(C.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),yUe=Hr(C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function wUe(i){return Xt("MuiCheckbox",i)}const pU=Yt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),CUe=i=>{const{classes:e,indeterminate:n,color:r,size:s}=i,o={root:["root",n&&"indeterminate",`color${Ue(r)}`,`size${Ue(s)}`]},a=Zt(o,wUe,e);return{...e,...a}},SUe=ye(oLe,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.indeterminate&&e.indeterminate,e[`size${Ue(n.size)}`],n.color!=="default"&&e[`color${Ue(n.color)}`]]}})(jt(({theme:i})=>({color:(i.vars||i).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.activeChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette.action.active,i.palette.action.hoverOpacity)}}},...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e,disableRipple:!1},style:{"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette[e].mainChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette[e].main,i.palette.action.hoverOpacity)}}})),...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{[`&.${pU.checked}, &.${pU.indeterminate}`]:{color:(i.vars||i).palette[e].main},[`&.${pU.disabled}`]:{color:(i.vars||i).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),xUe=C.jsx(bUe,{}),kUe=C.jsx(vUe,{}),LUe=C.jsx(yUe,{}),DUe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiCheckbox"}),{checkedIcon:s=xUe,color:o="primary",icon:a=kUe,indeterminate:l=!1,indeterminateIcon:c=LUe,inputProps:u,size:d="medium",disableRipple:h=!1,className:f,slots:p={},slotProps:g={},...m}=r,_=l?c:a,b=l?c:s,y={...r,disableRipple:h,color:o,indeterminate:l,size:d},x=CUe(y),k=g.input??u,[D,R]=an("root",{ref:n,elementType:SUe,className:dt(x.root,f),shouldForwardComponentProp:!0,externalForwardedProps:{slots:p,slotProps:g,...m},ownerState:y,additionalProps:{type:"checkbox",icon:$.cloneElement(_,{fontSize:_.props.fontSize??d}),checkedIcon:$.cloneElement(b,{fontSize:b.props.fontSize??d}),disableRipple:h,slots:p,slotProps:{input:jre(typeof k=="function"?k(y):k,{"data-indeterminate":l})}}});return C.jsx(D,{...R,classes:x})}),aLe=Zje({createStyledComponent:ye("div",{name:"MuiContainer",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[`maxWidth${Ue(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),useThemeProps:i=>Qt({props:i,name:"MuiContainer"})}),AZ=typeof Bre({})=="function",EUe=(i,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!i.vars&&{colorScheme:i.palette.mode}}),IUe=i=>({color:(i.vars||i).palette.text.primary,...i.typography.body1,backgroundColor:(i.vars||i).palette.background.default,"@media print":{backgroundColor:(i.vars||i).palette.common.white}}),lLe=(i,e=!1)=>{var o,a;const n={};e&&i.colorSchemes&&typeof i.getColorSchemeSelector=="function"&&Object.entries(i.colorSchemes).forEach(([l,c])=>{var d,h;const u=i.getColorSchemeSelector(l);u.startsWith("@")?n[u]={":root":{colorScheme:(d=c.palette)==null?void 0:d.mode}}:n[u.replace(/\s*&/,"")]={colorScheme:(h=c.palette)==null?void 0:h.mode}});let r={html:EUe(i,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:i.typography.fontWeightBold},body:{margin:0,...IUe(i),"&::backdrop":{backgroundColor:(i.vars||i).palette.background.default}},...n};const s=(a=(o=i.components)==null?void 0:o.MuiCssBaseline)==null?void 0:a.styleOverrides;return s&&(r=[r,s]),r},ZB="mui-ecs",TUe=i=>{const e=lLe(i,!1),n=Array.isArray(e)?e[0]:e;return!i.vars&&n&&(n.html[`:root:has(${ZB})`]={colorScheme:i.palette.mode}),i.colorSchemes&&Object.entries(i.colorSchemes).forEach(([r,s])=>{var a,l;const o=i.getColorSchemeSelector(r);o.startsWith("@")?n[o]={[`:root:not(:has(.${ZB}))`]:{colorScheme:(a=s.palette)==null?void 0:a.mode}}:n[o.replace(/\s*&/,"")]={[`&:not(:has(.${ZB}))`]:{colorScheme:(l=s.palette)==null?void 0:l.mode}}}),e},RUe=Bre(AZ?({theme:i,enableColorScheme:e})=>lLe(i,e):({theme:i})=>TUe(i));function cLe(i){const e=Qt({props:i,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return C.jsxs($.Fragment,{children:[AZ&&C.jsx(RUe,{enableColorScheme:r}),!AZ&&!r&&C.jsx("span",{className:ZB,style:{display:"none"}}),n]})}function uLe(i=window){const e=i.document.documentElement.clientWidth;return i.innerWidth-e}function AUe(i){const e=gl(i);return e.body===i?fh(i).innerWidth>e.documentElement.clientWidth:i.scrollHeight>i.clientHeight}function qN(i,e){e?i.setAttribute("aria-hidden","true"):i.removeAttribute("aria-hidden")}function nhe(i){return parseInt(fh(i).getComputedStyle(i).paddingRight,10)||0}function NUe(i){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(i.tagName),r=i.tagName==="INPUT"&&i.getAttribute("type")==="hidden";return n||r}function ihe(i,e,n,r,s){const o=[e,n,...r];[].forEach.call(i.children,a=>{const l=!o.includes(a),c=!NUe(a);l&&c&&qN(a,s)})}function gU(i,e){let n=-1;return i.some((r,s)=>e(r)?(n=s,!0):!1),n}function MUe(i,e){const n=[],r=i.container;if(!e.disableScrollLock){if(AUe(r)){const a=uLe(fh(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${nhe(r)+a}px`;const l=gl(r).querySelectorAll(".mui-fixed");[].forEach.call(l,c=>{n.push({value:c.style.paddingRight,property:"padding-right",el:c}),c.style.paddingRight=`${nhe(c)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=gl(r).body;else{const a=r.parentElement,l=fh(r);o=(a==null?void 0:a.nodeName)==="HTML"&&l.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:a,property:l})=>{o?a.style.setProperty(l,o):a.style.removeProperty(l)})}}function PUe(i){const e=[];return[].forEach.call(i.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class OUe{constructor(){this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&qN(e.modalRef,!1);const s=PUe(n);ihe(n,e.mount,e.modalRef,s,!0);const o=gU(this.containers,a=>a.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:s}),r)}mount(e,n){const r=gU(this.containers,o=>o.modals.includes(e)),s=this.containers[r];s.restore||(s.restore=MUe(s,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const s=gU(this.containers,a=>a.modals.includes(e)),o=this.containers[s];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&qN(e.modalRef,n),ihe(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(s,1);else{const a=o.modals[o.modals.length-1];a.modalRef&&qN(a.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}const FUe=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function BUe(i){const e=parseInt(i.getAttribute("tabindex")||"",10);return Number.isNaN(e)?i.contentEditable==="true"||(i.nodeName==="AUDIO"||i.nodeName==="VIDEO"||i.nodeName==="DETAILS")&&i.getAttribute("tabindex")===null?0:i.tabIndex:e}function jUe(i){if(i.tagName!=="INPUT"||i.type!=="radio"||!i.name)return!1;const e=r=>i.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${i.name}"]:checked`);return n||(n=e(`[name="${i.name}"]`)),n!==i}function WUe(i){return!(i.disabled||i.tagName==="INPUT"&&i.type==="hidden"||jUe(i))}function $Ue(i){const e=[],n=[];return Array.from(i.querySelectorAll(FUe)).forEach((r,s)=>{const o=BUe(r);o===-1||!WUe(r)||(o===0?e.push(r):n.push({documentOrder:s,tabIndex:o,node:r}))}),n.sort((r,s)=>r.tabIndex===s.tabIndex?r.documentOrder-s.documentOrder:r.tabIndex-s.tabIndex).map(r=>r.node).concat(e)}function zUe(){return!0}function VUe(i){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:s=!1,getTabbable:o=$Ue,isEnabled:a=zUe,open:l}=i,c=$.useRef(!1),u=$.useRef(null),d=$.useRef(null),h=$.useRef(null),f=$.useRef(null),p=$.useRef(!1),g=$.useRef(null),m=mo(Hx(e),g),_=$.useRef(null);$.useEffect(()=>{!l||!g.current||(p.current=!n)},[n,l]),$.useEffect(()=>{if(!l||!g.current)return;const x=gl(g.current);return g.current.contains(x.activeElement)||(g.current.hasAttribute("tabIndex")||g.current.setAttribute("tabIndex","-1"),p.current&&g.current.focus()),()=>{s||(h.current&&h.current.focus&&(c.current=!0,h.current.focus()),h.current=null)}},[l]),$.useEffect(()=>{if(!l||!g.current)return;const x=gl(g.current),k=E=>{_.current=E,!(r||!a()||E.key!=="Tab")&&x.activeElement===g.current&&E.shiftKey&&(c.current=!0,d.current&&d.current.focus())},D=()=>{var M,N;const E=g.current;if(E===null)return;if(!x.hasFocus()||!a()||c.current){c.current=!1;return}if(E.contains(x.activeElement)||r&&x.activeElement!==u.current&&x.activeElement!==d.current)return;if(x.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let A=[];if((x.activeElement===u.current||x.activeElement===d.current)&&(A=o(g.current)),A.length>0){const P=!!((M=_.current)!=null&&M.shiftKey&&((N=_.current)==null?void 0:N.key)==="Tab"),O=A[0],B=A[A.length-1];typeof O!="string"&&typeof B!="string"&&(P?B.focus():O.focus())}else E.focus()};x.addEventListener("focusin",D),x.addEventListener("keydown",k,!0);const R=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&D()},50);return()=>{clearInterval(R),x.removeEventListener("focusin",D),x.removeEventListener("keydown",k,!0)}},[n,r,s,a,l,o]);const b=x=>{h.current===null&&(h.current=x.relatedTarget),p.current=!0,f.current=x.target;const k=e.props.onFocus;k&&k(x)},y=x=>{h.current===null&&(h.current=x.relatedTarget),p.current=!0};return C.jsxs($.Fragment,{children:[C.jsx("div",{tabIndex:l?0:-1,onFocus:y,ref:u,"data-testid":"sentinelStart"}),$.cloneElement(e,{ref:m,onFocus:b}),C.jsx("div",{tabIndex:l?0:-1,onFocus:y,ref:d,"data-testid":"sentinelEnd"})]})}function HUe(i){return typeof i=="function"?i():i}function UUe(i){return i?i.props.hasOwnProperty("in"):!1}const rhe=()=>{},m3=new OUe;function qUe(i){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:s=!1,onTransitionEnter:o,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:d}=i,h=$.useRef({}),f=$.useRef(null),p=$.useRef(null),g=mo(p,d),[m,_]=$.useState(!u),b=UUe(l);let y=!0;(i["aria-hidden"]==="false"||i["aria-hidden"]===!1)&&(y=!1);const x=()=>gl(f.current),k=()=>(h.current.modalRef=p.current,h.current.mount=f.current,h.current),D=()=>{m3.mount(k(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},R=Ha(()=>{const z=HUe(e)||x().body;m3.add(k(),z),p.current&&D()}),E=()=>m3.isTopModal(k()),A=Ha(z=>{f.current=z,z&&(u&&E()?D():p.current&&qN(p.current,y))}),M=$.useCallback(()=>{m3.remove(k(),y)},[y]);$.useEffect(()=>()=>{M()},[M]),$.useEffect(()=>{u?R():(!b||!s)&&M()},[u,M,b,s,R]);const N=z=>H=>{var Y;(Y=z.onKeyDown)==null||Y.call(z,H),!(H.key!=="Escape"||H.which===229||!E())&&(n||(H.stopPropagation(),c&&c(H,"escapeKeyDown")))},P=z=>H=>{var Y;(Y=z.onClick)==null||Y.call(z,H),H.target===H.currentTarget&&c&&c(H,"backdropClick")};return{getRootProps:(z={})=>{const H=VN(i);delete H.onTransitionEnter,delete H.onTransitionExited;const Y={...H,...z};return{role:"presentation",...Y,onKeyDown:N(Y),ref:g}},getBackdropProps:(z={})=>{const H=z;return{"aria-hidden":!0,...H,onClick:P(H),open:u}},getTransitionProps:()=>{const z=()=>{_(!1),o&&o()},H=()=>{_(!0),a&&a(),s&&M()};return{onEnter:Sde(z,(l==null?void 0:l.props.onEnter)??rhe),onExited:Sde(H,(l==null?void 0:l.props.onExited)??rhe)}},rootRef:g,portalRef:A,isTopModal:E,exited:m,hasTransition:b}}function KUe(i){return Xt("MuiModal",i)}Yt("MuiModal",["root","hidden","backdrop"]);const GUe=i=>{const{open:e,exited:n,classes:r}=i;return Zt({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},KUe,r)},XUe=ye("div",{name:"MuiModal",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,!n.open&&n.exited&&e.hidden]}})(jt(({theme:i})=>({position:"fixed",zIndex:(i.vars||i).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]}))),YUe=ye(tLe,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),IW=$.forwardRef(function(e,n){const r=Qt({name:"MuiModal",props:e}),{BackdropComponent:s=YUe,BackdropProps:o,classes:a,className:l,closeAfterTransition:c=!1,children:u,container:d,component:h,components:f={},componentsProps:p={},disableAutoFocus:g=!1,disableEnforceFocus:m=!1,disableEscapeKeyDown:_=!1,disablePortal:b=!1,disableRestoreFocus:y=!1,disableScrollLock:x=!1,hideBackdrop:k=!1,keepMounted:D=!1,onClose:R,onTransitionEnter:E,onTransitionExited:A,open:M,slotProps:N={},slots:P={},theme:O,...B}=r,j={...r,closeAfterTransition:c,disableAutoFocus:g,disableEnforceFocus:m,disableEscapeKeyDown:_,disablePortal:b,disableRestoreFocus:y,disableScrollLock:x,hideBackdrop:k,keepMounted:D},{getRootProps:z,getBackdropProps:H,getTransitionProps:Y,portalRef:X,isTopModal:Q,exited:ie,hasTransition:K}=qUe({...j,rootRef:n}),ee={...j,exited:ie},le=GUe(ee),ke={};if(u.props.tabIndex===void 0&&(ke.tabIndex="-1"),K){const{onEnter:Ze,onExited:We}=Y();ke.onEnter=Ze,ke.onExited=We}const xe={slots:{root:f.Root,backdrop:f.Backdrop,...P},slotProps:{...p,...N}},[me,Ee]=an("root",{ref:n,elementType:XUe,externalForwardedProps:{...xe,...B,component:h},getSlotProps:z,ownerState:ee,className:dt(l,le==null?void 0:le.root,!ee.open&&ee.exited&&(le==null?void 0:le.hidden))}),[je,qe]=an("backdrop",{ref:o==null?void 0:o.ref,elementType:s,externalForwardedProps:xe,shouldForwardComponentProp:!0,additionalProps:o,getSlotProps:Ze=>H({...Ze,onClick:We=>{Ze!=null&&Ze.onClick&&Ze.onClick(We)}}),className:dt(o==null?void 0:o.className,le==null?void 0:le.backdrop),ownerState:ee});return!D&&!M&&(!K||ie)?null:C.jsx(Qke,{ref:X,container:d,disablePortal:b,children:C.jsxs(me,{...Ee,children:[!k&&s?C.jsx(je,{...qe}):null,C.jsx(VUe,{disableEnforceFocus:m,disableAutoFocus:g,disableRestoreFocus:y,isEnabled:Q,open:M,children:$.cloneElement(u,ke)})]})})});function ZUe(i){return Xt("MuiDialog",i)}const mU=Yt("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),dLe=$.createContext({}),QUe=ye(tLe,{name:"MuiDialog",slot:"Backdrop",overrides:(i,e)=>e.backdrop})({zIndex:-1}),JUe=i=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:s,fullScreen:o}=i,a={root:["root"],container:["container",`scroll${Ue(n)}`],paper:["paper",`paperScroll${Ue(n)}`,`paperWidth${Ue(String(r))}`,s&&"paperFullWidth",o&&"paperFullScreen"]};return Zt(a,ZUe,e)},eqe=ye(IW,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),tqe=ye("div",{name:"MuiDialog",slot:"Container",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.container,e[`scroll${Ue(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),nqe=ye(du,{name:"MuiDialog",slot:"Paper",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.paper,e[`scrollPaper${Ue(n.scroll)}`],e[`paperWidth${Ue(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(jt(({theme:i})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:i.breakpoints.unit==="px"?Math.max(i.breakpoints.values.xs,444):`max(${i.breakpoints.values.xs}${i.breakpoints.unit}, 444px)`,[`&.${mU.paperScrollBody}`]:{[i.breakpoints.down(Math.max(i.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(i.breakpoints.values).filter(e=>e!=="xs").map(e=>({props:{maxWidth:e},style:{maxWidth:`${i.breakpoints.values[e]}${i.breakpoints.unit}`,[`&.${mU.paperScrollBody}`]:{[i.breakpoints.down(i.breakpoints.values[e]+32*2)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${mU.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Vm=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiDialog"}),s=$i(),o={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":l,"aria-modal":c=!0,BackdropComponent:u,BackdropProps:d,children:h,className:f,disableEscapeKeyDown:p=!1,fullScreen:g=!1,fullWidth:m=!1,maxWidth:_="sm",onClick:b,onClose:y,open:x,PaperComponent:k=du,PaperProps:D={},scroll:R="paper",slots:E={},slotProps:A={},TransitionComponent:M=RZ,transitionDuration:N=o,TransitionProps:P,...O}=r,B={...r,disableEscapeKeyDown:p,fullScreen:g,fullWidth:m,maxWidth:_,scroll:R},j=JUe(B),z=$.useRef(),H=st=>{z.current=st.target===st.currentTarget},Y=st=>{b&&b(st),z.current&&(z.current=null,y&&y(st,"backdropClick"))},X=W1(l),Q=$.useMemo(()=>({titleId:X}),[X]),ie={transition:M,...E},K={transition:P,paper:D,backdrop:d,...A},ee={slots:ie,slotProps:K},[le,ke]=an("root",{elementType:eqe,shouldForwardComponentProp:!0,externalForwardedProps:ee,ownerState:B,className:dt(j.root,f),ref:n}),[xe,me]=an("backdrop",{elementType:QUe,shouldForwardComponentProp:!0,externalForwardedProps:ee,ownerState:B}),[Ee,je]=an("paper",{elementType:nqe,shouldForwardComponentProp:!0,externalForwardedProps:ee,ownerState:B,className:dt(j.paper,D.className)}),[qe,Ze]=an("container",{elementType:tqe,externalForwardedProps:ee,ownerState:B,className:j.container}),[We,ut]=an("transition",{elementType:RZ,externalForwardedProps:ee,ownerState:B,additionalProps:{appear:!0,in:x,timeout:N,role:"presentation"}});return C.jsx(le,{closeAfterTransition:!0,slots:{backdrop:xe},slotProps:{backdrop:{transitionDuration:N,as:u,...me}},disableEscapeKeyDown:p,onClose:y,open:x,onClick:Y,...ke,...O,children:C.jsx(We,{...ut,children:C.jsx(qe,{onMouseDown:H,...Ze,children:C.jsx(Ee,{as:k,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":X,"aria-modal":c,...je,children:C.jsx(dLe.Provider,{value:Q,children:h})})})})})});function iqe(i){return Xt("MuiDialogActions",i)}Yt("MuiDialogActions",["root","spacing"]);const rqe=i=>{const{classes:e,disableSpacing:n}=i;return Zt({root:["root",!n&&"spacing"]},iqe,e)},sqe=ye("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:i})=>!i.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),CE=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiDialogActions"}),{className:s,disableSpacing:o=!1,...a}=r,l={...r,disableSpacing:o},c=rqe(l);return C.jsx(sqe,{className:dt(c.root,s),ownerState:l,ref:n,...a})});function oqe(i){return Xt("MuiDialogContent",i)}Yt("MuiDialogContent",["root","dividers"]);function aqe(i){return Xt("MuiDialogTitle",i)}const lqe=Yt("MuiDialogTitle",["root"]),cqe=i=>{const{classes:e,dividers:n}=i;return Zt({root:["root",n&&"dividers"]},oqe,e)},uqe=ye("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.dividers&&e.dividers]}})(jt(({theme:i})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:e})=>e.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(i.vars||i).palette.divider}`,borderBottom:`1px solid ${(i.vars||i).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${lqe.root} + &`]:{paddingTop:0}}}]}))),a1=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiDialogContent"}),{className:s,dividers:o=!1,...a}=r,l={...r,dividers:o},c=cqe(l);return C.jsx(uqe,{className:dt(c.root,s),ownerState:l,ref:n,...a})});function dqe(i){return Xt("MuiDialogContentText",i)}Yt("MuiDialogContentText",["root"]);const hqe=i=>{const{classes:e}=i,r=Zt({root:["root"]},dqe,e);return{...e,...r}},fqe=ye(Je,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiDialogContentText",slot:"Root"})({}),pqe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiDialogContentText"}),{children:s,className:o,...a}=r,l=hqe(a);return C.jsx(fqe,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:a,className:dt(l.root,o),...r,classes:l})}),gqe=i=>{const{classes:e}=i;return Zt({root:["root"]},aqe,e)},mqe=ye(Je,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),tx=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiDialogTitle"}),{className:s,id:o,...a}=r,l=r,c=gqe(l),{titleId:u=o}=$.useContext(dLe);return C.jsx(mqe,{component:"h2",className:dt(c.root,s),ownerState:l,ref:n,variant:"h6",id:o??u,...a})});function _qe(i){return Xt("MuiDivider",i)}const she=Yt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),vqe=i=>{const{absolute:e,children:n,classes:r,flexItem:s,light:o,orientation:a,textAlign:l,variant:c}=i;return Zt({root:["root",e&&"absolute",c,o&&"light",a==="vertical"&&"vertical",s&&"flexItem",n&&"withChildren",n&&a==="vertical"&&"withChildrenVertical",l==="right"&&a!=="vertical"&&"textAlignRight",l==="left"&&a!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",a==="vertical"&&"wrapperVertical"]},_qe,r)},bqe=ye("div",{name:"MuiDivider",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(jt(({theme:i})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(i.vars||i).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:i.vars?`rgba(${i.vars.palette.dividerChannel} / 0.08)`:Pt(i.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:i.spacing(2),marginRight:i.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:i.spacing(1),marginBottom:i.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&e.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(i.vars||i).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>e.orientation==="vertical"&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(i.vars||i).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>e.textAlign==="right"&&e.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>e.textAlign==="left"&&e.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),yqe=ye("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(jt(({theme:i})=>({display:"inline-block",paddingLeft:`calc(${i.spacing(1)} * 1.2)`,paddingRight:`calc(${i.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${i.spacing(1)} * 1.2)`,paddingBottom:`calc(${i.spacing(1)} * 1.2)`}}]}))),SE=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiDivider"}),{absolute:s=!1,children:o,className:a,orientation:l="horizontal",component:c=o||l==="vertical"?"div":"hr",flexItem:u=!1,light:d=!1,role:h=c!=="hr"?"separator":void 0,textAlign:f="center",variant:p="fullWidth",...g}=r,m={...r,absolute:s,component:c,flexItem:u,light:d,orientation:l,role:h,textAlign:f,variant:p},_=vqe(m);return C.jsx(bqe,{as:c,className:dt(_.root,a),role:h,ref:n,ownerState:m,"aria-orientation":h==="separator"&&(c!=="hr"||l==="vertical")?l:void 0,...g,children:o?C.jsx(yqe,{className:_.wrapper,ownerState:m,children:o}):null})});SE&&(SE.muiSkipListHighlight=!0);function wqe(i,e,n){const r=e.getBoundingClientRect(),s=n&&n.getBoundingClientRect(),o=fh(e);let a;if(e.fakeTransform)a=e.fakeTransform;else{const u=o.getComputedStyle(e);a=u.getPropertyValue("-webkit-transform")||u.getPropertyValue("transform")}let l=0,c=0;if(a&&a!=="none"&&typeof a=="string"){const u=a.split("(")[1].split(")")[0].split(",");l=parseInt(u[4],10),c=parseInt(u[5],10)}return i==="left"?s?`translateX(${s.right+l-r.left}px)`:`translateX(${o.innerWidth+l-r.left}px)`:i==="right"?s?`translateX(-${r.right-s.left-l}px)`:`translateX(-${r.left+r.width-l}px)`:i==="up"?s?`translateY(${s.bottom+c-r.top}px)`:`translateY(${o.innerHeight+c-r.top}px)`:s?`translateY(-${r.top-s.top+r.height-c}px)`:`translateY(-${r.top+r.height-c}px)`}function Cqe(i){return typeof i=="function"?i():i}function _3(i,e,n){const r=Cqe(n),s=wqe(i,e,r);s&&(e.style.webkitTransform=s,e.style.transform=s)}const Sqe=$.forwardRef(function(e,n){const r=$i(),s={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:l=!0,children:c,container:u,direction:d="down",easing:h=s,in:f,onEnter:p,onEntered:g,onEntering:m,onExit:_,onExited:b,onExiting:y,style:x,timeout:k=o,TransitionComponent:D=Nf,...R}=e,E=$.useRef(null),A=mo(Hx(c),E,n),M=X=>Q=>{X&&(Q===void 0?X(E.current):X(E.current,Q))},N=M((X,Q)=>{_3(d,X,u),Vre(X),p&&p(X,Q)}),P=M((X,Q)=>{const ie=s1({timeout:k,style:x,easing:h},{mode:"enter"});X.style.webkitTransition=r.transitions.create("-webkit-transform",{...ie}),X.style.transition=r.transitions.create("transform",{...ie}),X.style.webkitTransform="none",X.style.transform="none",m&&m(X,Q)}),O=M(g),B=M(y),j=M(X=>{const Q=s1({timeout:k,style:x,easing:h},{mode:"exit"});X.style.webkitTransition=r.transitions.create("-webkit-transform",Q),X.style.transition=r.transitions.create("transform",Q),_3(d,X,u),_&&_(X)}),z=M(X=>{X.style.webkitTransition="",X.style.transition="",b&&b(X)}),H=X=>{a&&a(E.current,X)},Y=$.useCallback(()=>{E.current&&_3(d,E.current,u)},[d,u]);return $.useEffect(()=>{if(f||d==="down"||d==="right")return;const X=l5(()=>{E.current&&_3(d,E.current,u)}),Q=fh(E.current);return Q.addEventListener("resize",X),()=>{X.clear(),Q.removeEventListener("resize",X)}},[d,f,u]),$.useEffect(()=>{f||Y()},[f,Y]),C.jsx(D,{nodeRef:E,onEnter:N,onEntered:O,onEntering:P,onExit:j,onExited:z,onExiting:B,addEndListener:H,appear:l,in:f,timeout:k,...R,children:(X,{ownerState:Q,...ie})=>$.cloneElement(c,{ref:A,style:{visibility:X==="exited"&&!f?"hidden":void 0,...x,...c.props.style},...ie})})});function xqe(i){return Xt("MuiDrawer",i)}Yt("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const hLe=(i,e)=>{const{ownerState:n}=i;return[e.root,(n.variant==="permanent"||n.variant==="persistent")&&e.docked,e.modal]},kqe=i=>{const{classes:e,anchor:n,variant:r}=i,s={root:["root",`anchor${Ue(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${Ue(n)}`,r!=="temporary"&&`paperAnchorDocked${Ue(n)}`]};return Zt(s,xqe,e)},Lqe=ye(IW,{name:"MuiDrawer",slot:"Root",overridesResolver:hLe})(jt(({theme:i})=>({zIndex:(i.vars||i).zIndex.drawer}))),Dqe=ye("div",{shouldForwardProp:vl,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:hLe})({flex:"0 0 auto"}),Eqe=ye(du,{name:"MuiDrawer",slot:"Paper",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.paper,e[`paperAnchor${Ue(n.anchor)}`],n.variant!=="temporary"&&e[`paperAnchorDocked${Ue(n.anchor)}`]]}})(jt(({theme:i})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(i.vars||i).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:e})=>e.anchor==="left"&&e.variant!=="temporary",style:{borderRight:`1px solid ${(i.vars||i).palette.divider}`}},{props:({ownerState:e})=>e.anchor==="top"&&e.variant!=="temporary",style:{borderBottom:`1px solid ${(i.vars||i).palette.divider}`}},{props:({ownerState:e})=>e.anchor==="right"&&e.variant!=="temporary",style:{borderLeft:`1px solid ${(i.vars||i).palette.divider}`}},{props:({ownerState:e})=>e.anchor==="bottom"&&e.variant!=="temporary",style:{borderTop:`1px solid ${(i.vars||i).palette.divider}`}}]}))),fLe={left:"right",right:"left",top:"down",bottom:"up"};function Iqe(i){return["left","right"].includes(i)}function Tqe({direction:i},e){return i==="rtl"&&Iqe(e)?fLe[e]:e}const pLe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiDrawer"}),s=$i(),o=Pv(),a={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:l="left",BackdropProps:c,children:u,className:d,elevation:h=16,hideBackdrop:f=!1,ModalProps:{BackdropProps:p,...g}={},onClose:m,open:_=!1,PaperProps:b={},SlideProps:y,TransitionComponent:x,transitionDuration:k=a,variant:D="temporary",slots:R={},slotProps:E={},...A}=r,M=$.useRef(!1);$.useEffect(()=>{M.current=!0},[]);const N=Tqe({direction:o?"rtl":"ltr"},l),O={...r,anchor:l,elevation:h,open:_,variant:D,...A},B=kqe(O),j={slots:{transition:x,...R},slotProps:{paper:b,transition:y,...E,backdrop:jre(E.backdrop||{...c,...p},{transitionDuration:k})}},[z,H]=an("root",{ref:n,elementType:Lqe,className:dt(B.root,B.modal,d),shouldForwardComponentProp:!0,ownerState:O,externalForwardedProps:{...j,...A,...g},additionalProps:{open:_,onClose:m,hideBackdrop:f,slots:{backdrop:j.slots.backdrop},slotProps:{backdrop:j.slotProps.backdrop}}}),[Y,X]=an("paper",{elementType:Eqe,shouldForwardComponentProp:!0,className:dt(B.paper,b.className),ownerState:O,externalForwardedProps:j,additionalProps:{elevation:D==="temporary"?h:0,square:!0}}),[Q,ie]=an("docked",{elementType:Dqe,ref:n,className:dt(B.root,B.docked,d),ownerState:O,externalForwardedProps:j,additionalProps:A}),[K,ee]=an("transition",{elementType:Sqe,ownerState:O,externalForwardedProps:j,additionalProps:{in:_,direction:fLe[N],timeout:k,appear:M.current}}),le=C.jsx(Y,{...X,children:u});if(D==="permanent")return C.jsx(Q,{...ie,children:le});const ke=C.jsx(K,{...ee,children:le});return D==="persistent"?C.jsx(Q,{...ie,children:ke}):C.jsx(z,{...H,children:ke})});function Rqe(i){return Xt("MuiFab",i)}const ohe=Yt("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]),Aqe=i=>{const{color:e,variant:n,classes:r,size:s}=i,o={root:["root",n,`size${Ue(s)}`,e==="inherit"?"colorInherit":e]},a=Zt(o,Rqe,r);return{...r,...a}},Nqe=ye(ud,{name:"MuiFab",slot:"Root",shouldForwardProp:i=>vl(i)||i==="classes",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant],e[`size${Ue(n.size)}`],n.color==="inherit"&&e.colorInherit,e[Ue(n.size)],e[n.color]]}})(jt(({theme:i})=>{var e,n;return{...i.typography.button,minHeight:36,transition:i.transitions.create(["background-color","box-shadow","border-color"],{duration:i.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(i.vars||i).zIndex.fab,boxShadow:(i.vars||i).shadows[6],"&:active":{boxShadow:(i.vars||i).shadows[12]},color:i.vars?i.vars.palette.grey[900]:(n=(e=i.palette).getContrastText)==null?void 0:n.call(e,i.palette.grey[300]),backgroundColor:(i.vars||i).palette.grey[300],"&:hover":{backgroundColor:(i.vars||i).palette.grey.A100,"@media (hover: none)":{backgroundColor:(i.vars||i).palette.grey[300]},textDecoration:"none"},[`&.${ohe.focusVisible}`]:{boxShadow:(i.vars||i).shadows[6]},variants:[{props:{size:"small"},style:{width:40,height:40}},{props:{size:"medium"},style:{width:48,height:48}},{props:{variant:"extended"},style:{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48}},{props:{variant:"extended",size:"small"},style:{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34}},{props:{variant:"extended",size:"medium"},style:{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40}},{props:{color:"inherit"},style:{color:"inherit"}}]}}),jt(({theme:i})=>({variants:[...Object.entries(i.palette).filter(br(["dark","contrastText"])).map(([e])=>({props:{color:e},style:{color:(i.vars||i).palette[e].contrastText,backgroundColor:(i.vars||i).palette[e].main,"&:hover":{backgroundColor:(i.vars||i).palette[e].dark,"@media (hover: none)":{backgroundColor:(i.vars||i).palette[e].main}}}}))]})),jt(({theme:i})=>({[`&.${ohe.disabled}`]:{color:(i.vars||i).palette.action.disabled,boxShadow:(i.vars||i).shadows[0],backgroundColor:(i.vars||i).palette.action.disabledBackground}}))),Mqe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiFab"}),{children:s,className:o,color:a="default",component:l="button",disabled:c=!1,disableFocusRipple:u=!1,focusVisibleClassName:d,size:h="large",variant:f="circular",...p}=r,g={...r,color:a,component:l,disabled:c,disableFocusRipple:u,size:h,variant:f},m=Aqe(g);return C.jsx(Nqe,{className:dt(m.root,o),component:l,disabled:c,focusRipple:!u,focusVisibleClassName:dt(m.focusVisible,d),ownerState:g,ref:n,...p,classes:m,children:s})}),Pqe=i=>{const{classes:e,disableUnderline:n,startAdornment:r,endAdornment:s,size:o,hiddenLabel:a,multiline:l}=i,c={root:["root",!n&&"underline",r&&"adornedStart",s&&"adornedEnd",o==="small"&&`size${Ue(o)}`,a&&"hiddenLabel",l&&"multiline"],input:["input"]},u=Zt(c,uHe,e);return{...e,...u}},Oqe=ye(LW,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[...xW(i,e),!n.disableUnderline&&e.underline]}})(jt(({theme:i})=>{const e=i.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:i.vars?i.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(i.vars||i).shape.borderRadius,borderTopRightRadius:(i.vars||i).shape.borderRadius,transition:i.transitions.create("background-color",{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut}),"&:hover":{backgroundColor:i.vars?i.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:i.vars?i.vars.palette.FilledInput.bg:r}},[`&.${Kd.focused}`]:{backgroundColor:i.vars?i.vars.palette.FilledInput.bg:r},[`&.${Kd.disabled}`]:{backgroundColor:i.vars?i.vars.palette.FilledInput.disabledBg:o},variants:[{props:({ownerState:a})=>!a.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:i.transitions.create("transform",{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Kd.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Kd.error}`]:{"&::before, &::after":{borderBottomColor:(i.vars||i).palette.error.main}},"&::before":{borderBottom:`1px solid ${i.vars?`rgba(${i.vars.palette.common.onBackgroundChannel} / ${i.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:i.transitions.create("border-bottom-color",{duration:i.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Kd.disabled}, .${Kd.error}):before`]:{borderBottom:`1px solid ${(i.vars||i).palette.text.primary}`},[`&.${Kd.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(i.palette).filter(br()).map(([a])=>{var l;return{props:{disableUnderline:!1,color:a},style:{"&::after":{borderBottom:`2px solid ${(l=(i.vars||i).palette[a])==null?void 0:l.main}`}}}}),{props:({ownerState:a})=>a.startAdornment,style:{paddingLeft:12}},{props:({ownerState:a})=>a.endAdornment,style:{paddingRight:12}},{props:({ownerState:a})=>a.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:a,size:l})=>a.multiline&&l==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:a})=>a.multiline&&a.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:a})=>a.multiline&&a.hiddenLabel&&a.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),Fqe=ye(DW,{name:"MuiFilledInput",slot:"Input",overridesResolver:kW})(jt(({theme:i})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!i.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:i.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:i.palette.mode==="light"?null:"#fff",caretColor:i.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...i.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[i.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),Zre=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiFilledInput"}),{disableUnderline:s=!1,components:o={},componentsProps:a,fullWidth:l=!1,hiddenLabel:c,inputComponent:u="input",multiline:d=!1,slotProps:h,slots:f={},type:p="text",...g}=r,m={...r,disableUnderline:s,fullWidth:l,inputComponent:u,multiline:d,type:p},_=Pqe(r),b={root:{ownerState:m},input:{ownerState:m}},y=h??a?pl(b,h??a):b,x=f.root??o.Root??Oqe,k=f.input??o.Input??Fqe;return C.jsx(EW,{slots:{root:x,input:k},slotProps:y,fullWidth:l,inputComponent:u,multiline:d,ref:n,type:p,...g,classes:_})});Zre.muiName="Input";function Bqe(i){return Xt("MuiFormControl",i)}Yt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const jqe=i=>{const{classes:e,margin:n,fullWidth:r}=i,s={root:["root",n!=="none"&&`margin${Ue(n)}`,r&&"fullWidth"]};return Zt(s,Bqe,e)},Wqe=ye("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[`margin${Ue(n.margin)}`],n.fullWidth&&e.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),gLe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiFormControl"}),{children:s,className:o,color:a="primary",component:l="div",disabled:c=!1,error:u=!1,focused:d,fullWidth:h=!1,hiddenLabel:f=!1,margin:p="none",required:g=!1,size:m="medium",variant:_="outlined",...b}=r,y={...r,color:a,component:l,disabled:c,error:u,fullWidth:h,hiddenLabel:f,margin:p,required:g,size:m,variant:_},x=jqe(y),[k,D]=$.useState(()=>{let z=!1;return s&&$.Children.forEach(s,H=>{if(!zN(H,["Input","Select"]))return;const Y=zN(H,["Select"])?H.props.input:H;Y&&sHe(Y.props)&&(z=!0)}),z}),[R,E]=$.useState(()=>{let z=!1;return s&&$.Children.forEach(s,H=>{zN(H,["Input","Select"])&&(g9(H.props,!0)||g9(H.props.inputProps,!0))&&(z=!0)}),z}),[A,M]=$.useState(!1);c&&A&&M(!1);const N=d!==void 0&&!c?d:A;let P;$.useRef(!1);const O=$.useCallback(()=>{E(!0)},[]),B=$.useCallback(()=>{E(!1)},[]),j=$.useMemo(()=>({adornedStart:k,setAdornedStart:D,color:a,disabled:c,error:u,filled:R,focused:N,fullWidth:h,hiddenLabel:f,size:m,onBlur:()=>{M(!1)},onFocus:()=>{M(!0)},onEmpty:B,onFilled:O,registerEffect:P,required:g,variant:_}),[k,a,c,u,R,N,h,f,P,B,O,g,m,_]);return C.jsx(SW.Provider,{value:j,children:C.jsx(Wqe,{as:l,ownerState:y,className:dt(x.root,o),ref:n,...b,children:s})})});function $qe(i){return Xt("MuiFormControlLabel",i)}const tN=Yt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),zqe=i=>{const{classes:e,disabled:n,labelPlacement:r,error:s,required:o}=i,a={root:["root",n&&"disabled",`labelPlacement${Ue(r)}`,s&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",s&&"error"]};return Zt(a,$qe,e)},Vqe=ye("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[{[`& .${tN.label}`]:e.label},e.root,e[`labelPlacement${Ue(n.labelPlacement)}`]]}})(jt(({theme:i})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${tN.disabled}`]:{cursor:"default"},[`& .${tN.label}`]:{[`&.${tN.disabled}`]:{color:(i.vars||i).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>e==="start"||e==="top"||e==="bottom",style:{marginLeft:16}}]}))),Hqe=ye("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(jt(({theme:i})=>({[`&.${tN.error}`]:{color:(i.vars||i).palette.error.main}}))),Qre=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiFormControlLabel"}),{checked:s,className:o,componentsProps:a={},control:l,disabled:c,disableTypography:u,inputRef:d,label:h,labelPlacement:f="end",name:p,onChange:g,required:m,slots:_={},slotProps:b={},value:y,...x}=r,k=Ov(),D=c??l.props.disabled??(k==null?void 0:k.disabled),R=m??l.props.required,E={disabled:D,required:R};["checked","name","onChange","value","inputRef"].forEach(z=>{typeof l.props[z]>"u"&&typeof r[z]<"u"&&(E[z]=r[z])});const A=Ux({props:r,muiFormControl:k,states:["error"]}),M={...r,disabled:D,labelPlacement:f,required:R,error:A.error},N=zqe(M),P={slots:_,slotProps:{...a,...b}},[O,B]=an("typography",{elementType:Je,externalForwardedProps:P,ownerState:M});let j=h;return j!=null&&j.type!==Je&&!u&&(j=C.jsx(O,{component:"span",...B,className:dt(N.label,B==null?void 0:B.className),children:j})),C.jsxs(Vqe,{className:dt(N.root,o),ownerState:M,ref:n,...x,children:[$.cloneElement(l,E),R?C.jsxs("div",{children:[j,C.jsxs(Hqe,{ownerState:M,"aria-hidden":!0,className:N.asterisk,children:["","*"]})]}):j]})});function Uqe(i){return Xt("MuiFormHelperText",i)}const ahe=Yt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var lhe;const qqe=i=>{const{classes:e,contained:n,size:r,disabled:s,error:o,filled:a,focused:l,required:c}=i,u={root:["root",s&&"disabled",o&&"error",r&&`size${Ue(r)}`,n&&"contained",l&&"focused",a&&"filled",c&&"required"]};return Zt(u,Uqe,e)},Kqe=ye("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.size&&e[`size${Ue(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(jt(({theme:i})=>({color:(i.vars||i).palette.text.secondary,...i.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${ahe.disabled}`]:{color:(i.vars||i).palette.text.disabled},[`&.${ahe.error}`]:{color:(i.vars||i).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),Gqe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiFormHelperText"}),{children:s,className:o,component:a="p",disabled:l,error:c,filled:u,focused:d,margin:h,required:f,variant:p,...g}=r,m=Ov(),_=Ux({props:r,muiFormControl:m,states:["variant","size","disabled","error","filled","focused","required"]}),b={...r,component:a,contained:_.variant==="filled"||_.variant==="outlined",variant:_.variant,size:_.size,disabled:_.disabled,error:_.error,filled:_.filled,focused:_.focused,required:_.required};delete b.ownerState;const y=qqe(b);return C.jsx(Kqe,{as:a,className:dt(y.root,o),ref:n,...g,ownerState:b,children:s===" "?lhe||(lhe=C.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):s})});function Xqe(i){return Xt("MuiFormLabel",i)}const KN=Yt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Yqe=i=>{const{classes:e,color:n,focused:r,disabled:s,error:o,filled:a,required:l}=i,c={root:["root",`color${Ue(n)}`,s&&"disabled",o&&"error",a&&"filled",r&&"focused",l&&"required"],asterisk:["asterisk",o&&"error"]};return Zt(c,Xqe,e)},Zqe=ye("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.color==="secondary"&&e.colorSecondary,n.filled&&e.filled]}})(jt(({theme:i})=>({color:(i.vars||i).palette.text.secondary,...i.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{[`&.${KN.focused}`]:{color:(i.vars||i).palette[e].main}}})),{props:{},style:{[`&.${KN.disabled}`]:{color:(i.vars||i).palette.text.disabled},[`&.${KN.error}`]:{color:(i.vars||i).palette.error.main}}}]}))),Qqe=ye("span",{name:"MuiFormLabel",slot:"Asterisk"})(jt(({theme:i})=>({[`&.${KN.error}`]:{color:(i.vars||i).palette.error.main}}))),Jqe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiFormLabel"}),{children:s,className:o,color:a,component:l="label",disabled:c,error:u,filled:d,focused:h,required:f,...p}=r,g=Ov(),m=Ux({props:r,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]}),_={...r,color:m.color||"primary",component:l,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required},b=Yqe(_);return C.jsxs(Zqe,{as:l,ownerState:_,className:dt(b.root,o),ref:n,...p,children:[s,m.required&&C.jsxs(Qqe,{ownerState:_,"aria-hidden":!0,className:b.asterisk,children:["","*"]})]})}),ln=fWe({createStyledComponent:ye("div",{name:"MuiGrid",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.container&&e.container]}}),componentName:"MuiGrid",useThemeProps:i=>Qt({props:i,name:"MuiGrid"}),useTheme:$i});function NZ(i){return`scale(${i}, ${i**2})`}const eKe={entering:{opacity:1,transform:NZ(1)},entered:{opacity:1,transform:"none"}},_U=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),_9=$.forwardRef(function(e,n){const{addEndListener:r,appear:s=!0,children:o,easing:a,in:l,onEnter:c,onEntered:u,onEntering:d,onExit:h,onExited:f,onExiting:p,style:g,timeout:m="auto",TransitionComponent:_=Nf,...b}=e,y=lS(),x=$.useRef(),k=$i(),D=$.useRef(null),R=mo(D,Hx(o),n),E=z=>H=>{if(z){const Y=D.current;H===void 0?z(Y):z(Y,H)}},A=E(d),M=E((z,H)=>{Vre(z);const{duration:Y,delay:X,easing:Q}=s1({style:g,timeout:m,easing:a},{mode:"enter"});let ie;m==="auto"?(ie=k.transitions.getAutoHeightDuration(z.clientHeight),x.current=ie):ie=Y,z.style.transition=[k.transitions.create("opacity",{duration:ie,delay:X}),k.transitions.create("transform",{duration:_U?ie:ie*.666,delay:X,easing:Q})].join(","),c&&c(z,H)}),N=E(u),P=E(p),O=E(z=>{const{duration:H,delay:Y,easing:X}=s1({style:g,timeout:m,easing:a},{mode:"exit"});let Q;m==="auto"?(Q=k.transitions.getAutoHeightDuration(z.clientHeight),x.current=Q):Q=H,z.style.transition=[k.transitions.create("opacity",{duration:Q,delay:Y}),k.transitions.create("transform",{duration:_U?Q:Q*.666,delay:_U?Y:Y||Q*.333,easing:X})].join(","),z.style.opacity=0,z.style.transform=NZ(.75),h&&h(z)}),B=E(f),j=z=>{m==="auto"&&y.start(x.current||0,z),r&&r(D.current,z)};return C.jsx(_,{appear:s,in:l,nodeRef:D,onEnter:M,onEntered:N,onEntering:A,onExit:O,onExited:B,onExiting:P,addEndListener:j,timeout:m==="auto"?null:m,...b,children:(z,{ownerState:H,...Y})=>$.cloneElement(o,{style:{opacity:0,transform:NZ(.75),visibility:z==="exited"&&!l?"hidden":void 0,...eKe[z],...g,...o.props.style},ref:R,...Y})})});_9&&(_9.muiSupportAuto=!0);const tKe=i=>{const{classes:e,disableUnderline:n}=i,s=Zt({root:["root",!n&&"underline"],input:["input"]},lHe,e);return{...e,...s}},nKe=ye(LW,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiInput",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[...xW(i,e),!n.disableUnderline&&e.underline]}})(jt(({theme:i})=>{let n=i.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return i.vars&&(n=`rgba(${i.vars.palette.common.onBackgroundChannel} / ${i.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:i.transitions.create("transform",{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${sy.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${sy.error}`]:{"&::before, &::after":{borderBottomColor:(i.vars||i).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:i.transitions.create("border-bottom-color",{duration:i.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${sy.disabled}, .${sy.error}):before`]:{borderBottom:`2px solid ${(i.vars||i).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${sy.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(i.palette).filter(br()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(i.vars||i).palette[r].main}`}}}))]}})),iKe=ye(DW,{name:"MuiInput",slot:"Input",overridesResolver:kW})({}),Jre=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiInput"}),{disableUnderline:s=!1,components:o={},componentsProps:a,fullWidth:l=!1,inputComponent:c="input",multiline:u=!1,slotProps:d,slots:h={},type:f="text",...p}=r,g=tKe(r),_={root:{ownerState:{disableUnderline:s}}},b=d??a?pl(d??a,_):_,y=h.root??o.Root??nKe,x=h.input??o.Input??iKe;return C.jsx(EW,{slots:{root:y,input:x},slotProps:b,fullWidth:l,inputComponent:c,multiline:u,ref:n,type:f,...p,classes:g})});Jre.muiName="Input";function rKe(i){return Xt("MuiInputAdornment",i)}const che=Yt("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var uhe;const sKe=(i,e)=>{const{ownerState:n}=i;return[e.root,e[`position${Ue(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},oKe=i=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:s,size:o,variant:a}=i,l={root:["root",n&&"disablePointerEvents",s&&`position${Ue(s)}`,a,r&&"hiddenLabel",o&&`size${Ue(o)}`]};return Zt(l,rKe,e)},aKe=ye("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:sKe})(jt(({theme:i})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(i.vars||i).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${che.positionStart}&:not(.${che.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),TW=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiInputAdornment"}),{children:s,className:o,component:a="div",disablePointerEvents:l=!1,disableTypography:c=!1,position:u,variant:d,...h}=r,f=Ov()||{};let p=d;d&&f.variant,f&&!p&&(p=f.variant);const g={...r,hiddenLabel:f.hiddenLabel,size:f.size,disablePointerEvents:l,position:u,variant:p},m=oKe(g);return C.jsx(SW.Provider,{value:null,children:C.jsx(aKe,{as:a,ownerState:g,className:dt(m.root,o),ref:n,...h,children:typeof s=="string"&&!c?C.jsx(Je,{color:"textSecondary",children:s}):C.jsxs($.Fragment,{children:[u==="start"?uhe||(uhe=C.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):null,s]})})})});function lKe(i){return Xt("MuiInputLabel",i)}Yt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const cKe=i=>{const{classes:e,formControl:n,size:r,shrink:s,disableAnimation:o,variant:a,required:l}=i,c={root:["root",n&&"formControl",!o&&"animated",s&&"shrink",r&&r!=="medium"&&`size${Ue(r)}`,a],asterisk:[l&&"asterisk"]},u=Zt(c,lKe,e);return{...e,...u}},uKe=ye(Jqe,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[{[`& .${KN.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(jt(({theme:i})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:e})=>e.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:e})=>e.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:i.transitions.create(["color","transform","max-width"],{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:e,ownerState:n,size:r})=>e==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),RW=$.forwardRef(function(e,n){const r=Qt({name:"MuiInputLabel",props:e}),{disableAnimation:s=!1,margin:o,shrink:a,variant:l,className:c,...u}=r,d=Ov();let h=a;typeof h>"u"&&d&&(h=d.filled||d.focused||d.adornedStart);const f=Ux({props:r,muiFormControl:d,states:["size","variant","required","focused"]}),p={...r,disableAnimation:s,formControl:d,shrink:h,size:f.size,variant:f.variant,required:f.required,focused:f.focused},g=cKe(p);return C.jsx(uKe,{"data-shrink":h,ref:n,className:dt(g.root,c),...u,ownerState:p,classes:g})});function dKe(i){return Xt("MuiLinearProgress",i)}Yt("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const MZ=4,PZ=tg`
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
`,hKe=typeof PZ!="string"?Mv`
animation: ${PZ} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
`:null,OZ=tg`
0% {
left: -200%;
right: 100%;
}
60% {
left: 107%;
right: -8%;
}
100% {
left: 107%;
right: -8%;
}
`,fKe=typeof OZ!="string"?Mv`
animation: ${OZ} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
`:null,FZ=tg`
0% {
opacity: 1;
background-position: 0 -23px;
}
60% {
opacity: 0;
background-position: 0 -23px;
}
100% {
opacity: 1;
background-position: -200px -23px;
}
`,pKe=typeof FZ!="string"?Mv`
animation: ${FZ} 3s infinite linear;
`:null,gKe=i=>{const{classes:e,variant:n,color:r}=i,s={root:["root",`color${Ue(r)}`,n],dashed:["dashed",`dashedColor${Ue(r)}`],bar1:["bar","bar1",`barColor${Ue(r)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",n!=="buffer"&&`barColor${Ue(r)}`,n==="buffer"&&`color${Ue(r)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return Zt(s,dKe,e)},ese=(i,e)=>i.vars?i.vars.palette.LinearProgress[`${e}Bg`]:i.palette.mode==="light"?qp(i.palette[e].main,.62):$m(i.palette[e].main,.5),mKe=ye("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[`color${Ue(n.color)}`],e[n.variant]]}})(jt(({theme:i})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{backgroundColor:ese(i,e)}})),{props:({ownerState:e})=>e.color==="inherit"&&e.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),_Ke=ye("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.dashed,e[`dashedColor${Ue(n.color)}`]]}})(jt(({theme:i})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(i.palette).filter(br()).map(([e])=>{const n=ese(i,e);return{props:{color:e},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),pKe||{animation:`${FZ} 3s infinite linear`}),vKe=ye("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.bar,e.bar1,e[`barColor${Ue(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&e.bar1Indeterminate,n.variant==="determinate"&&e.bar1Determinate,n.variant==="buffer"&&e.bar1Buffer]}})(jt(({theme:i})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{backgroundColor:(i.vars||i).palette[e].main}})),{props:{variant:"determinate"},style:{transition:`transform .${MZ}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${MZ}s linear`}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:{width:"auto"}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:hKe||{animation:`${PZ} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),bKe=ye("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.bar,e.bar2,e[`barColor${Ue(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&e.bar2Indeterminate,n.variant==="buffer"&&e.bar2Buffer]}})(jt(({theme:i})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{"--LinearProgressBar2-barColor":(i.vars||i).palette[e].main}})),{props:({ownerState:e})=>e.variant!=="buffer"&&e.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:e})=>e.variant!=="buffer"&&e.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e,variant:"buffer"},style:{backgroundColor:ese(i,e),transition:`transform .${MZ}s linear`}})),{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:{width:"auto"}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:fKe||{animation:`${OZ} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),AW=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiLinearProgress"}),{className:s,color:o="primary",value:a,valueBuffer:l,variant:c="indeterminate",...u}=r,d={...r,color:o,variant:c},h=gKe(d),f=Pv(),p={},g={bar1:{},bar2:{}};if((c==="determinate"||c==="buffer")&&a!==void 0){p["aria-valuenow"]=Math.round(a),p["aria-valuemin"]=0,p["aria-valuemax"]=100;let m=a-100;f&&(m=-m),g.bar1.transform=`translateX(${m}%)`}if(c==="buffer"&&l!==void 0){let m=(l||0)-100;f&&(m=-m),g.bar2.transform=`translateX(${m}%)`}return C.jsxs(mKe,{className:dt(h.root,s),ownerState:d,role:"progressbar",...p,ref:n,...u,children:[c==="buffer"?C.jsx(_Ke,{className:h.dashed,ownerState:d}):null,C.jsx(vKe,{className:h.bar1,ownerState:d,style:g.bar1}),c==="determinate"?null:C.jsx(bKe,{className:h.bar2,ownerState:d,style:g.bar2})]})});function yKe(i){return Xt("MuiLink",i)}const wKe=Yt("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),CKe=({theme:i,ownerState:e})=>{const n=e.color,r=fy(i,`palette.${n}.main`,!1)||fy(i,`palette.${n}`,!1)||e.color,s=fy(i,`palette.${n}.mainChannel`)||fy(i,`palette.${n}Channel`);return"vars"in i&&s?`rgba(${s} / 0.4)`:Pt(r,.4)},dhe={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},SKe=i=>{const{classes:e,component:n,focusVisible:r,underline:s}=i,o={root:["root",`underline${Ue(s)}`,n==="button"&&"button",r&&"focusVisible"]};return Zt(o,yKe,e)},xKe=ye(Je,{name:"MuiLink",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[`underline${Ue(n.underline)}`],n.component==="button"&&e.button]}})(jt(({theme:i})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:n})=>e==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(i.palette).filter(br()).map(([e])=>({props:{underline:"always",color:e},style:{"--Link-underlineColor":i.vars?`rgba(${i.vars.palette[e].mainChannel} / 0.4)`:Pt(i.palette[e].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":i.vars?`rgba(${i.vars.palette.text.primaryChannel} / 0.4)`:Pt(i.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":i.vars?`rgba(${i.vars.palette.text.secondaryChannel} / 0.4)`:Pt(i.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(i.vars||i).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${wKe.focusVisible}`]:{outline:"auto"}}}]}))),XM=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiLink"}),s=$i(),{className:o,color:a="primary",component:l="a",onBlur:c,onFocus:u,TypographyClasses:d,underline:h="always",variant:f="inherit",sx:p,...g}=r,[m,_]=$.useState(!1),b=D=>{o1(D.target)||_(!1),c&&c(D)},y=D=>{o1(D.target)&&_(!0),u&&u(D)},x={...r,color:a,component:l,focusVisible:m,underline:h,variant:f},k=SKe(x);return C.jsx(xKe,{color:a,className:dt(k.root,o),classes:d,component:l,onBlur:b,onFocus:y,ref:n,ownerState:x,variant:f,...g,sx:[...dhe[a]===void 0?[{color:a}]:[],...Array.isArray(p)?p:[p]],style:{...g.style,...h==="always"&&a!=="inherit"&&!dhe[a]&&{"--Link-underlineColor":CKe({theme:s,ownerState:x})}}})}),jp=$.createContext({});function kKe(i){return Xt("MuiList",i)}Yt("MuiList",["root","padding","dense","subheader"]);const LKe=i=>{const{classes:e,disablePadding:n,dense:r,subheader:s}=i;return Zt({root:["root",!n&&"padding",r&&"dense",s&&"subheader"]},kKe,e)},DKe=ye("ul",{name:"MuiList",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:i})=>!i.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:i})=>i.subheader,style:{paddingTop:0}}]}),tse=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiList"}),{children:s,className:o,component:a="ul",dense:l=!1,disablePadding:c=!1,subheader:u,...d}=r,h=$.useMemo(()=>({dense:l}),[l]),f={...r,component:a,dense:l,disablePadding:c},p=LKe(f);return C.jsx(jp.Provider,{value:h,children:C.jsxs(DKe,{as:a,className:dt(p.root,o),ref:n,ownerState:f,...d,children:[u,s]})})});function EKe(i){return Xt("MuiListItem",i)}Yt("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function IKe(i){return Xt("MuiListItemButton",i)}const jD=Yt("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),TKe=(i,e)=>{const{ownerState:n}=i;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},RKe=i=>{const{alignItems:e,classes:n,dense:r,disabled:s,disableGutters:o,divider:a,selected:l}=i,u=Zt({root:["root",r&&"dense",!o&&"gutters",a&&"divider",s&&"disabled",e==="flex-start"&&"alignItemsFlexStart",l&&"selected"]},IKe,n);return{...n,...u}},AKe=ye(ud,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:TKe})(jt(({theme:i})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:i.transitions.create("background-color",{duration:i.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(i.vars||i).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${jD.selected}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity),[`&.${jD.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)}},[`&.${jD.selected}:hover`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity)}},[`&.${jD.focusVisible}`]:{backgroundColor:(i.vars||i).palette.action.focus},[`&.${jD.disabled}`]:{opacity:(i.vars||i).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(i.vars||i).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),NKe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiListItemButton"}),{alignItems:s="center",autoFocus:o=!1,component:a="div",children:l,dense:c=!1,disableGutters:u=!1,divider:d=!1,focusVisibleClassName:h,selected:f=!1,className:p,...g}=r,m=$.useContext(jp),_=$.useMemo(()=>({dense:c||m.dense||!1,alignItems:s,disableGutters:u}),[s,m.dense,c,u]),b=$.useRef(null);wc(()=>{o&&b.current&&b.current.focus()},[o]);const y={...r,alignItems:s,dense:_.dense,disableGutters:u,divider:d,selected:f},x=RKe(y),k=mo(b,n);return C.jsx(jp.Provider,{value:_,children:C.jsx(AKe,{ref:k,href:g.href||g.to,component:(g.href||g.to)&&a==="div"?"button":a,focusVisibleClassName:dt(x.focusVisible,h),ownerState:y,className:dt(x.root,p),...g,classes:x,children:l})})});function MKe(i){return Xt("MuiListItemSecondaryAction",i)}Yt("MuiListItemSecondaryAction",["root","disableGutters"]);const PKe=i=>{const{disableGutters:e,classes:n}=i;return Zt({root:["root",e&&"disableGutters"]},MKe,n)},OKe=ye("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.disableGutters&&e.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:i})=>i.disableGutters,style:{right:0}}]}),mLe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiListItemSecondaryAction"}),{className:s,...o}=r,a=$.useContext(jp),l={...r,disableGutters:a.disableGutters},c=PKe(l);return C.jsx(OKe,{className:dt(c.root,s),ownerState:l,ref:n,...o})});mLe.muiName="ListItemSecondaryAction";const FKe=(i,e)=>{const{ownerState:n}=i;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.hasSecondaryAction&&e.secondaryAction]},BKe=i=>{const{alignItems:e,classes:n,dense:r,disableGutters:s,disablePadding:o,divider:a,hasSecondaryAction:l}=i;return Zt({root:["root",r&&"dense",!s&&"gutters",!o&&"padding",a&&"divider",e==="flex-start"&&"alignItemsFlexStart",l&&"secondaryAction"],container:["container"]},EKe,n)},jKe=ye("div",{name:"MuiListItem",slot:"Root",overridesResolver:FKe})(jt(({theme:i})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${jD.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(i.vars||i).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{transition:i.transitions.create("background-color",{duration:i.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(i.vars||i).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),WKe=ye("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),nse=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiListItem"}),{alignItems:s="center",children:o,className:a,component:l,components:c={},componentsProps:u={},ContainerComponent:d="li",ContainerProps:{className:h,...f}={},dense:p=!1,disableGutters:g=!1,disablePadding:m=!1,divider:_=!1,secondaryAction:b,slotProps:y={},slots:x={},...k}=r,D=$.useContext(jp),R=$.useMemo(()=>({dense:p||D.dense||!1,alignItems:s,disableGutters:g}),[s,D.dense,p,g]),E=$.useRef(null),A=$.Children.toArray(o),M=A.length&&zN(A[A.length-1],["ListItemSecondaryAction"]),N={...r,alignItems:s,dense:R.dense,disableGutters:g,disablePadding:m,divider:_,hasSecondaryAction:M},P=BKe(N),O=mo(E,n),B=x.root||c.Root||jKe,j=y.root||u.root||{},z={className:dt(P.root,j.className,a),...k};let H=l||"li";return M?(H=!z.component&&!l?"div":H,d==="li"&&(H==="li"?H="div":z.component==="li"&&(z.component="div")),C.jsx(jp.Provider,{value:R,children:C.jsxs(WKe,{as:d,className:dt(P.container,h),ref:O,ownerState:N,...f,children:[C.jsx(B,{...j,...!dv(B)&&{as:H,ownerState:{...N,...j.ownerState}},...z,children:A}),A.pop()]})})):C.jsx(jp.Provider,{value:R,children:C.jsxs(B,{...j,as:H,ref:O,...!dv(B)&&{ownerState:{...N,...j.ownerState}},...z,children:[A,b&&C.jsx(mLe,{children:b})]})})});function $Ke(i){return Xt("MuiListItemIcon",i)}const hhe=Yt("MuiListItemIcon",["root","alignItemsFlexStart"]),zKe=i=>{const{alignItems:e,classes:n}=i;return Zt({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},$Ke,n)},VKe=ye("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(jt(({theme:i})=>({minWidth:56,color:(i.vars||i).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),_Le=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiListItemIcon"}),{className:s,...o}=r,a=$.useContext(jp),l={...r,alignItems:a.alignItems},c=zKe(l);return C.jsx(VKe,{className:dt(c.root,s),ownerState:l,ref:n,...o})});function HKe(i){return Xt("MuiListItemText",i)}const QD=Yt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),UKe=i=>{const{classes:e,inset:n,primary:r,secondary:s,dense:o}=i;return Zt({root:["root",n&&"inset",o&&"dense",r&&s&&"multiline"],primary:["primary"],secondary:["secondary"]},HKe,e)},qKe=ye("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[{[`& .${QD.primary}`]:e.primary},{[`& .${QD.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${f9.root}:where(& .${QD.primary})`]:{display:"block"},[`.${f9.root}:where(& .${QD.secondary})`]:{display:"block"},variants:[{props:({ownerState:i})=>i.primary&&i.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:i})=>i.inset,style:{paddingLeft:56}}]}),vLe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiListItemText"}),{children:s,className:o,disableTypography:a=!1,inset:l=!1,primary:c,primaryTypographyProps:u,secondary:d,secondaryTypographyProps:h,slots:f={},slotProps:p={},...g}=r,{dense:m}=$.useContext(jp);let _=c??s,b=d;const y={...r,disableTypography:a,inset:l,primary:!!_,secondary:!!b,dense:m},x=UKe(y),k={slots:f,slotProps:{primary:u,secondary:h,...p}},[D,R]=an("root",{className:dt(x.root,o),elementType:qKe,externalForwardedProps:{...k,...g},ownerState:y,ref:n}),[E,A]=an("primary",{className:x.primary,elementType:Je,externalForwardedProps:k,ownerState:y}),[M,N]=an("secondary",{className:x.secondary,elementType:Je,externalForwardedProps:k,ownerState:y});return _!=null&&_.type!==Je&&!a&&(_=C.jsx(E,{variant:m?"body2":"body1",component:A!=null&&A.variant?void 0:"span",...A,children:_})),b!=null&&b.type!==Je&&!a&&(b=C.jsx(M,{variant:"body2",color:"textSecondary",...N,children:b})),C.jsxs(D,{...R,children:[_,b]})});function vU(i,e,n){return i===e?i.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:i.firstChild}function fhe(i,e,n){return i===e?n?i.firstChild:i.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:i.lastChild}function bLe(i,e){if(e===void 0)return!0;let n=i.innerText;return n===void 0&&(n=i.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.startsWith(e.keys.join(""))}function AR(i,e,n,r,s,o){let a=!1,l=s(i,e,e?n:!1);for(;l;){if(l===i.firstChild){if(a)return!1;a=!0}const c=r?!1:l.disabled||l.getAttribute("aria-disabled")==="true";if(!l.hasAttribute("tabindex")||!bLe(l,o)||c)l=s(i,l,n);else return l.focus(),!0}return!1}const KKe=$.forwardRef(function(e,n){const{actions:r,autoFocus:s=!1,autoFocusItem:o=!1,children:a,className:l,disabledItemsFocusable:c=!1,disableListWrap:u=!1,onKeyDown:d,variant:h="selectedMenu",...f}=e,p=$.useRef(null),g=$.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});wc(()=>{s&&p.current.focus()},[s]),$.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:k})=>{const D=!p.current.style.width;if(x.clientHeight<p.current.clientHeight&&D){const R=`${uLe(fh(x))}px`;p.current.style[k==="rtl"?"paddingLeft":"paddingRight"]=R,p.current.style.width=`calc(100% + ${R})`}return p.current}}),[]);const m=x=>{const k=p.current,D=x.key;if(x.ctrlKey||x.metaKey||x.altKey){d&&d(x);return}const E=gl(k).activeElement;if(D==="ArrowDown")x.preventDefault(),AR(k,E,u,c,vU);else if(D==="ArrowUp")x.preventDefault(),AR(k,E,u,c,fhe);else if(D==="Home")x.preventDefault(),AR(k,null,u,c,vU);else if(D==="End")x.preventDefault(),AR(k,null,u,c,fhe);else if(D.length===1){const A=g.current,M=D.toLowerCase(),N=performance.now();A.keys.length>0&&(N-A.lastTime>500?(A.keys=[],A.repeating=!0,A.previousKeyMatched=!0):A.repeating&&M!==A.keys[0]&&(A.repeating=!1)),A.lastTime=N,A.keys.push(M);const P=E&&!A.repeating&&bLe(E,A);A.previousKeyMatched&&(P||AR(k,E,!1,c,vU,A))?x.preventDefault():A.previousKeyMatched=!1}d&&d(x)},_=mo(p,n);let b=-1;$.Children.forEach(a,(x,k)=>{if(!$.isValidElement(x)){b===k&&(b+=1,b>=a.length&&(b=-1));return}x.props.disabled||(h==="selectedMenu"&&x.props.selected||b===-1)&&(b=k),b===k&&(x.props.disabled||x.props.muiSkipListHighlight||x.type.muiSkipListHighlight)&&(b+=1,b>=a.length&&(b=-1))});const y=$.Children.map(a,(x,k)=>{if(k===b){const D={};return o&&(D.autoFocus=!0),x.props.tabIndex===void 0&&h==="selectedMenu"&&(D.tabIndex=0),$.cloneElement(x,D)}return x});return C.jsx(tse,{role:"menu",ref:_,className:l,onKeyDown:m,tabIndex:s?0:-1,...f,children:y})});function GKe(i){return Xt("MuiPopover",i)}Yt("MuiPopover",["root","paper"]);function phe(i,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=i.height/2:e==="bottom"&&(n=i.height),n}function ghe(i,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=i.width/2:e==="right"&&(n=i.width),n}function mhe(i){return[i.horizontal,i.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function v3(i){return typeof i=="function"?i():i}const XKe=i=>{const{classes:e}=i;return Zt({root:["root"],paper:["paper"]},GKe,e)},YKe=ye(IW,{name:"MuiPopover",slot:"Root"})({}),yLe=ye(du,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),ZKe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiPopover"}),{action:s,anchorEl:o,anchorOrigin:a={vertical:"top",horizontal:"left"},anchorPosition:l,anchorReference:c="anchorEl",children:u,className:d,container:h,elevation:f=8,marginThreshold:p=16,open:g,PaperProps:m={},slots:_={},slotProps:b={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:x,transitionDuration:k="auto",TransitionProps:D={},disableScrollLock:R=!1,...E}=r,A=$.useRef(),M={...r,anchorOrigin:a,anchorReference:c,elevation:f,marginThreshold:p,transformOrigin:y,TransitionComponent:x,transitionDuration:k,TransitionProps:D},N=XKe(M),P=$.useCallback(()=>{if(c==="anchorPosition")return l;const Ze=v3(o),ut=(Ze&&Ze.nodeType===1?Ze:gl(A.current).body).getBoundingClientRect();return{top:ut.top+phe(ut,a.vertical),left:ut.left+ghe(ut,a.horizontal)}},[o,a.horizontal,a.vertical,l,c]),O=$.useCallback(Ze=>({vertical:phe(Ze,y.vertical),horizontal:ghe(Ze,y.horizontal)}),[y.horizontal,y.vertical]),B=$.useCallback(Ze=>{const We={width:Ze.offsetWidth,height:Ze.offsetHeight},ut=O(We);if(c==="none")return{top:null,left:null,transformOrigin:mhe(ut)};const st=P();let mt=st.top-ut.vertical,Rt=st.left-ut.horizontal;const Vt=mt+We.height,Ot=Rt+We.width,vt=fh(v3(o)),wn=vt.innerHeight-p,Ce=vt.innerWidth-p;if(p!==null&&mt<p){const ge=mt-p;mt-=ge,ut.vertical+=ge}else if(p!==null&&Vt>wn){const ge=Vt-wn;mt-=ge,ut.vertical+=ge}if(p!==null&&Rt<p){const ge=Rt-p;Rt-=ge,ut.horizontal+=ge}else if(Ot>Ce){const ge=Ot-Ce;Rt-=ge,ut.horizontal+=ge}return{top:`${Math.round(mt)}px`,left:`${Math.round(Rt)}px`,transformOrigin:mhe(ut)}},[o,c,P,O,p]),[j,z]=$.useState(g),H=$.useCallback(()=>{const Ze=A.current;if(!Ze)return;const We=B(Ze);We.top!==null&&Ze.style.setProperty("top",We.top),We.left!==null&&(Ze.style.left=We.left),Ze.style.transformOrigin=We.transformOrigin,z(!0)},[B]);$.useEffect(()=>(R&&window.addEventListener("scroll",H),()=>window.removeEventListener("scroll",H)),[o,R,H]);const Y=()=>{H()},X=()=>{z(!1)};$.useEffect(()=>{g&&H()}),$.useImperativeHandle(s,()=>g?{updatePosition:()=>{H()}}:null,[g,H]),$.useEffect(()=>{if(!g)return;const Ze=l5(()=>{H()}),We=fh(v3(o));return We.addEventListener("resize",Ze),()=>{Ze.clear(),We.removeEventListener("resize",Ze)}},[o,g,H]);let Q=k;const ie={slots:{transition:x,..._},slotProps:{transition:D,paper:m,...b}},[K,ee]=an("transition",{elementType:_9,externalForwardedProps:ie,ownerState:M,getSlotProps:Ze=>({...Ze,onEntering:(We,ut)=>{var st;(st=Ze.onEntering)==null||st.call(Ze,We,ut),Y()},onExited:We=>{var ut;(ut=Ze.onExited)==null||ut.call(Ze,We),X()}}),additionalProps:{appear:!0,in:g}});k==="auto"&&!K.muiSupportAuto&&(Q=void 0);const le=h||(o?gl(v3(o)).body:void 0),[ke,{slots:xe,slotProps:me,...Ee}]=an("root",{ref:n,elementType:YKe,externalForwardedProps:{...ie,...E},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:_.backdrop},slotProps:{backdrop:jre(typeof b.backdrop=="function"?b.backdrop(M):b.backdrop,{invisible:!0})},container:le,open:g},ownerState:M,className:dt(N.root,d)}),[je,qe]=an("paper",{ref:A,className:N.paper,elementType:yLe,externalForwardedProps:ie,shouldForwardComponentProp:!0,additionalProps:{elevation:f,style:j?void 0:{opacity:0}},ownerState:M});return C.jsx(ke,{...Ee,...!dv(ke)&&{slots:xe,slotProps:me,disableScrollLock:R},children:C.jsx(K,{...ee,timeout:Q,children:C.jsx(je,{...qe,children:u})})})});function QKe(i){return Xt("MuiMenu",i)}Yt("MuiMenu",["root","paper","list"]);const JKe={vertical:"top",horizontal:"right"},eGe={vertical:"top",horizontal:"left"},tGe=i=>{const{classes:e}=i;return Zt({root:["root"],paper:["paper"],list:["list"]},QKe,e)},nGe=ye(ZKe,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiMenu",slot:"Root"})({}),iGe=ye(yLe,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),rGe=ye(KKe,{name:"MuiMenu",slot:"List"})({outline:0}),wLe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiMenu"}),{autoFocus:s=!0,children:o,className:a,disableAutoFocusItem:l=!1,MenuListProps:c={},onClose:u,open:d,PaperProps:h={},PopoverClasses:f,transitionDuration:p="auto",TransitionProps:{onEntering:g,...m}={},variant:_="selectedMenu",slots:b={},slotProps:y={},...x}=r,k=Pv(),D={...r,autoFocus:s,disableAutoFocusItem:l,MenuListProps:c,onEntering:g,PaperProps:h,transitionDuration:p,TransitionProps:m,variant:_},R=tGe(D),E=s&&!l&&d,A=$.useRef(null),M=(Q,ie)=>{A.current&&A.current.adjustStyleForScrollbar(Q,{direction:k?"rtl":"ltr"}),g&&g(Q,ie)},N=Q=>{Q.key==="Tab"&&(Q.preventDefault(),u&&u(Q,"tabKeyDown"))};let P=-1;$.Children.map(o,(Q,ie)=>{$.isValidElement(Q)&&(Q.props.disabled||(_==="selectedMenu"&&Q.props.selected||P===-1)&&(P=ie))});const O={slots:b,slotProps:{list:c,transition:m,paper:h,...y}},B=$u({elementType:b.root,externalSlotProps:y.root,ownerState:D,className:[R.root,a]}),[j,z]=an("paper",{className:R.paper,elementType:iGe,externalForwardedProps:O,shouldForwardComponentProp:!0,ownerState:D}),[H,Y]=an("list",{className:dt(R.list,c.className),elementType:rGe,shouldForwardComponentProp:!0,externalForwardedProps:O,getSlotProps:Q=>({...Q,onKeyDown:ie=>{var K;N(ie),(K=Q.onKeyDown)==null||K.call(Q,ie)}}),ownerState:D}),X=typeof O.slotProps.transition=="function"?O.slotProps.transition(D):O.slotProps.transition;return C.jsx(nGe,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:k?"right":"left"},transformOrigin:k?JKe:eGe,slots:{root:b.root,paper:j,backdrop:b.backdrop,...b.transition&&{transition:b.transition}},slotProps:{root:B,paper:z,backdrop:typeof y.backdrop=="function"?y.backdrop(D):y.backdrop,transition:{...X,onEntering:(...Q)=>{var ie;M(...Q),(ie=X==null?void 0:X.onEntering)==null||ie.call(X,...Q)}}},open:d,ref:n,transitionDuration:p,ownerState:D,...x,classes:f,children:C.jsx(H,{actions:A,autoFocus:s&&(P===-1||l),autoFocusItem:E,variant:_,...Y,children:o})})});function sGe(i){return Xt("MuiMenuItem",i)}const NR=Yt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),oGe=(i,e)=>{const{ownerState:n}=i;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},aGe=i=>{const{disabled:e,dense:n,divider:r,disableGutters:s,selected:o,classes:a}=i,c=Zt({root:["root",n&&"dense",e&&"disabled",!s&&"gutters",r&&"divider",o&&"selected"]},sGe,a);return{...a,...c}},lGe=ye(ud,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:oGe})(jt(({theme:i})=>({...i.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(i.vars||i).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${NR.selected}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity),[`&.${NR.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)}},[`&.${NR.selected}:hover`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity)}},[`&.${NR.focusVisible}`]:{backgroundColor:(i.vars||i).palette.action.focus},[`&.${NR.disabled}`]:{opacity:(i.vars||i).palette.action.disabledOpacity},[`& + .${she.root}`]:{marginTop:i.spacing(1),marginBottom:i.spacing(1)},[`& + .${she.inset}`]:{marginLeft:52},[`& .${QD.root}`]:{marginTop:0,marginBottom:0},[`& .${QD.inset}`]:{paddingLeft:36},[`& .${hhe.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(i.vars||i).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[i.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...i.typography.body2,[`& .${hhe.root} svg`]:{fontSize:"1.25rem"}}}]}))),hf=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiMenuItem"}),{autoFocus:s=!1,component:o="li",dense:a=!1,divider:l=!1,disableGutters:c=!1,focusVisibleClassName:u,role:d="menuitem",tabIndex:h,className:f,...p}=r,g=$.useContext(jp),m=$.useMemo(()=>({dense:a||g.dense||!1,disableGutters:c}),[g.dense,a,c]),_=$.useRef(null);wc(()=>{s&&_.current&&_.current.focus()},[s]);const b={...r,dense:m.dense,divider:l,disableGutters:c},y=aGe(r),x=mo(_,n);let k;return r.disabled||(k=h!==void 0?h:-1),C.jsx(jp.Provider,{value:m,children:C.jsx(lGe,{ref:x,role:d,tabIndex:k,component:o,focusVisibleClassName:dt(y.focusVisible,u),className:dt(y.root,f),...p,ownerState:b,classes:y})})});function cGe(i){return Xt("MuiNativeSelect",i)}const ise=Yt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),uGe=i=>{const{classes:e,variant:n,disabled:r,multiple:s,open:o,error:a}=i,l={select:["select",n,r&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${Ue(n)}`,o&&"iconOpen",r&&"disabled"]};return Zt(l,cGe,e)},CLe=ye("select",{name:"MuiNativeSelect"})(({theme:i})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${ise.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(i.vars||i).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!=="filled"&&e.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(i.vars||i).shape.borderRadius,"&:focus":{borderRadius:(i.vars||i).shape.borderRadius},"&&&":{paddingRight:32}}}]})),dGe=ye(CLe,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:vl,overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.select,e[n.variant],n.error&&e.error,{[`&.${ise.multiple}`]:e.multiple}]}})({}),SLe=ye("svg",{name:"MuiNativeSelect"})(({theme:i})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(i.vars||i).palette.action.active,[`&.${ise.disabled}`]:{color:(i.vars||i).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),hGe=ye(SLe,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.icon,n.variant&&e[`icon${Ue(n.variant)}`],n.open&&e.iconOpen]}})({}),fGe=$.forwardRef(function(e,n){const{className:r,disabled:s,error:o,IconComponent:a,inputRef:l,variant:c="standard",...u}=e,d={...e,disabled:s,variant:c,error:o},h=uGe(d);return C.jsxs($.Fragment,{children:[C.jsx(dGe,{ownerState:d,className:dt(h.select,r),disabled:s,ref:l||n,...u}),e.multiple?null:C.jsx(hGe,{as:a,ownerState:d,className:h.icon})]})});var _he;const pGe=ye("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:vl})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),gGe=ye("legend",{name:"MuiNotchedOutlined",shouldForwardProp:vl})(jt(({theme:i})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:"11px",transition:i.transitions.create("width",{duration:150,easing:i.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:i.transitions.create("max-width",{duration:50,easing:i.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:"100%",transition:i.transitions.create("max-width",{duration:100,easing:i.transitions.easing.easeOut,delay:50})}}]})));function mGe(i){const{children:e,classes:n,className:r,label:s,notched:o,...a}=i,l=s!=null&&s!=="",c={...i,notched:o,withLabel:l};return C.jsx(pGe,{"aria-hidden":!0,className:r,ownerState:c,...a,children:C.jsx(gGe,{ownerState:c,children:l?C.jsx("span",{children:s}):_he||(_he=C.jsx("span",{className:"notranslate","aria-hidden":!0,children:""}))})})}const _Ge=i=>{const{classes:e}=i,r=Zt({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},cHe,e);return{...e,...r}},vGe=ye(LW,{shouldForwardProp:i=>vl(i)||i==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:xW})(jt(({theme:i})=>{const e=i.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(i.vars||i).shape.borderRadius,[`&:hover .${Qh.notchedOutline}`]:{borderColor:(i.vars||i).palette.text.primary},"@media (hover: none)":{[`&:hover .${Qh.notchedOutline}`]:{borderColor:i.vars?`rgba(${i.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Qh.focused} .${Qh.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(i.palette).filter(br()).map(([n])=>({props:{color:n},style:{[`&.${Qh.focused} .${Qh.notchedOutline}`]:{borderColor:(i.vars||i).palette[n].main}}})),{props:{},style:{[`&.${Qh.error} .${Qh.notchedOutline}`]:{borderColor:(i.vars||i).palette.error.main},[`&.${Qh.disabled} .${Qh.notchedOutline}`]:{borderColor:(i.vars||i).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),bGe=ye(mGe,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(jt(({theme:i})=>{const e=i.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:i.vars?`rgba(${i.vars.palette.common.onBackgroundChannel} / 0.23)`:e}})),yGe=ye(DW,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:kW})(jt(({theme:i})=>({padding:"16.5px 14px",...!i.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:i.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:i.palette.mode==="light"?null:"#fff",caretColor:i.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...i.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[i.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),TI=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiOutlinedInput"}),{components:s={},fullWidth:o=!1,inputComponent:a="input",label:l,multiline:c=!1,notched:u,slots:d={},slotProps:h={},type:f="text",...p}=r,g=_Ge(r),m=Ov(),_=Ux({props:r,muiFormControl:m,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),b={...r,color:_.color||"primary",disabled:_.disabled,error:_.error,focused:_.focused,formControl:m,fullWidth:o,hiddenLabel:_.hiddenLabel,multiline:c,size:_.size,type:f},y=d.root??s.Root??vGe,x=d.input??s.Input??yGe,[k,D]=an("notchedOutline",{elementType:bGe,className:g.notchedOutline,shouldForwardComponentProp:!0,ownerState:b,externalForwardedProps:{slots:d,slotProps:h},additionalProps:{label:l!=null&&l!==""&&_.required?C.jsxs($.Fragment,{children:[l,"","*"]}):l}});return C.jsx(EW,{slots:{root:y,input:x},slotProps:h,renderSuffix:R=>C.jsx(k,{...D,notched:typeof u<"u"?u:!!(R.startAdornment||R.filled||R.focused)}),fullWidth:o,inputComponent:a,multiline:c,ref:n,type:f,...p,classes:{...g,notchedOutline:null}})});TI.muiName="Input";function wGe(i){return Xt("MuiPagination",i)}Yt("MuiPagination",["root","ul","outlined","text"]);function CGe(i={}){const{boundaryCount:e=1,componentName:n="usePagination",count:r=1,defaultPage:s=1,disabled:o=!1,hideNextButton:a=!1,hidePrevButton:l=!1,onChange:c,page:u,showFirstButton:d=!1,showLastButton:h=!1,siblingCount:f=1,...p}=i,[g,m]=Im({controlled:u,default:s,name:n,state:"page"}),_=(M,N)=>{u||m(N),c&&c(M,N)},b=(M,N)=>{const P=N-M+1;return Array.from({length:P},(O,B)=>M+B)},y=b(1,Math.min(e,r)),x=b(Math.max(r-e+1,e+1),r),k=Math.max(Math.min(g-f,r-e-f*2-1),e+2),D=Math.min(Math.max(g+f,e+f*2+2),r-e-1),R=[...d?["first"]:[],...l?[]:["previous"],...y,...k>e+2?["start-ellipsis"]:e+1<r-e?[e+1]:[],...b(k,D),...D<r-e-1?["end-ellipsis"]:r-e>e?[r-e]:[],...x,...a?[]:["next"],...h?["last"]:[]],E=M=>{switch(M){case"first":return 1;case"previous":return g-1;case"next":return g+1;case"last":return r;default:return null}};return{items:R.map(M=>typeof M=="number"?{onClick:N=>{_(N,M)},type:"page",page:M,selected:M===g,disabled:o,"aria-current":M===g?"page":void 0}:{onClick:N=>{_(N,E(M))},type:M,page:E(M),selected:!1,disabled:o||!M.includes("ellipsis")&&(M==="next"||M==="last"?g>=r:g<=1)}),...p}}function SGe(i){return Xt("MuiPaginationItem",i)}const Vc=Yt("MuiPaginationItem",["root","page","sizeSmall","sizeLarge","text","textPrimary","textSecondary","outlined","outlinedPrimary","outlinedSecondary","rounded","ellipsis","firstLast","previousNext","focusVisible","disabled","selected","icon","colorPrimary","colorSecondary"]),xGe=Hr(C.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})),kGe=Hr(C.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})),LGe=Hr(C.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),DGe=Hr(C.jsx("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),xLe=(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant],e[`size${Ue(n.size)}`],n.variant==="text"&&e[`text${Ue(n.color)}`],n.variant==="outlined"&&e[`outlined${Ue(n.color)}`],n.shape==="rounded"&&e.rounded,n.type==="page"&&e.page,(n.type==="start-ellipsis"||n.type==="end-ellipsis")&&e.ellipsis,(n.type==="previous"||n.type==="next")&&e.previousNext,(n.type==="first"||n.type==="last")&&e.firstLast]},EGe=i=>{const{classes:e,color:n,disabled:r,selected:s,size:o,shape:a,type:l,variant:c}=i,u={root:["root",`size${Ue(o)}`,c,a,n!=="standard"&&`color${Ue(n)}`,n!=="standard"&&`${c}${Ue(n)}`,r&&"disabled",s&&"selected",{page:"page",first:"firstLast",last:"firstLast","start-ellipsis":"ellipsis","end-ellipsis":"ellipsis",previous:"previousNext",next:"previousNext"}[l]],icon:["icon"]};return Zt(u,SGe,e)},IGe=ye("div",{name:"MuiPaginationItem",slot:"Root",overridesResolver:xLe})(jt(({theme:i})=>({...i.typography.body2,borderRadius:32/2,textAlign:"center",boxSizing:"border-box",minWidth:32,padding:"0 6px",margin:"0 3px",color:(i.vars||i).palette.text.primary,height:"auto",[`&.${Vc.disabled}`]:{opacity:(i.vars||i).palette.action.disabledOpacity},variants:[{props:{size:"small"},style:{minWidth:26,borderRadius:26/2,margin:"0 1px",padding:"0 4px"}},{props:{size:"large"},style:{minWidth:40,borderRadius:40/2,padding:"0 10px",fontSize:i.typography.pxToRem(15)}}]}))),TGe=ye(ud,{name:"MuiPaginationItem",slot:"Root",overridesResolver:xLe})(jt(({theme:i})=>({...i.typography.body2,borderRadius:32/2,textAlign:"center",boxSizing:"border-box",minWidth:32,height:32,padding:"0 6px",margin:"0 3px",color:(i.vars||i).palette.text.primary,[`&.${Vc.focusVisible}`]:{backgroundColor:(i.vars||i).palette.action.focus},[`&.${Vc.disabled}`]:{opacity:(i.vars||i).palette.action.disabledOpacity},transition:i.transitions.create(["color","background-color"],{duration:i.transitions.duration.short}),"&:hover":{backgroundColor:(i.vars||i).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Vc.selected}`]:{backgroundColor:(i.vars||i).palette.action.selected,"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.selectedChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:Pt(i.palette.action.selected,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(i.vars||i).palette.action.selected}},[`&.${Vc.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.action.selectedChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:Pt(i.palette.action.selected,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)},[`&.${Vc.disabled}`]:{opacity:1,color:(i.vars||i).palette.action.disabled,backgroundColor:(i.vars||i).palette.action.selected}},variants:[{props:{size:"small"},style:{minWidth:26,height:26,borderRadius:26/2,margin:"0 1px",padding:"0 4px"}},{props:{size:"large"},style:{minWidth:40,height:40,borderRadius:40/2,padding:"0 10px",fontSize:i.typography.pxToRem(15)}},{props:{shape:"rounded"},style:{borderRadius:(i.vars||i).shape.borderRadius}},{props:{variant:"outlined"},style:{border:i.vars?`1px solid rgba(${i.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${i.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${Vc.selected}`]:{[`&.${Vc.disabled}`]:{borderColor:(i.vars||i).palette.action.disabledBackground,color:(i.vars||i).palette.action.disabled}}}},{props:{variant:"text"},style:{[`&.${Vc.selected}`]:{[`&.${Vc.disabled}`]:{color:(i.vars||i).palette.action.disabled}}}},...Object.entries(i.palette).filter(br(["dark","contrastText"])).map(([e])=>({props:{variant:"text",color:e},style:{[`&.${Vc.selected}`]:{color:(i.vars||i).palette[e].contrastText,backgroundColor:(i.vars||i).palette[e].main,"&:hover":{backgroundColor:(i.vars||i).palette[e].dark,"@media (hover: none)":{backgroundColor:(i.vars||i).palette[e].main}},[`&.${Vc.focusVisible}`]:{backgroundColor:(i.vars||i).palette[e].dark},[`&.${Vc.disabled}`]:{color:(i.vars||i).palette.action.disabled}}}})),...Object.entries(i.palette).filter(br(["light"])).map(([e])=>({props:{variant:"outlined",color:e},style:{[`&.${Vc.selected}`]:{color:(i.vars||i).palette[e].main,border:`1px solid ${i.vars?`rgba(${i.vars.palette[e].mainChannel} / 0.5)`:Pt(i.palette[e].main,.5)}`,backgroundColor:i.vars?`rgba(${i.vars.palette[e].mainChannel} / ${i.vars.palette.action.activatedOpacity})`:Pt(i.palette[e].main,i.palette.action.activatedOpacity),"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette[e].mainChannel} / calc(${i.vars.palette.action.activatedOpacity} + ${i.vars.palette.action.focusOpacity}))`:Pt(i.palette[e].main,i.palette.action.activatedOpacity+i.palette.action.focusOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Vc.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette[e].mainChannel} / calc(${i.vars.palette.action.activatedOpacity} + ${i.vars.palette.action.focusOpacity}))`:Pt(i.palette[e].main,i.palette.action.activatedOpacity+i.palette.action.focusOpacity)}}}}))]}))),RGe=ye("div",{name:"MuiPaginationItem",slot:"Icon"})(jt(({theme:i})=>({fontSize:i.typography.pxToRem(20),margin:"0 -8px",variants:[{props:{size:"small"},style:{fontSize:i.typography.pxToRem(18)}},{props:{size:"large"},style:{fontSize:i.typography.pxToRem(22)}}]}))),AGe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiPaginationItem"}),{className:s,color:o="standard",component:a,components:l={},disabled:c=!1,page:u,selected:d=!1,shape:h="circular",size:f="medium",slots:p={},slotProps:g={},type:m="page",variant:_="text",...b}=r,y={...r,color:o,disabled:c,selected:d,shape:h,size:f,type:m,variant:_},x=Pv(),k=EGe(y),D={slots:{previous:p.previous??l.previous,next:p.next??l.next,first:p.first??l.first,last:p.last??l.last},slotProps:g},[R,E]=an("previous",{elementType:LGe,externalForwardedProps:D,ownerState:y}),[A,M]=an("next",{elementType:DGe,externalForwardedProps:D,ownerState:y}),[N,P]=an("first",{elementType:xGe,externalForwardedProps:D,ownerState:y}),[O,B]=an("last",{elementType:kGe,externalForwardedProps:D,ownerState:y}),j=x?{previous:"next",next:"previous",first:"last",last:"first"}[m]:m,z={previous:R,next:A,first:N,last:O}[j],H={previous:E,next:M,first:P,last:B}[j];return m==="start-ellipsis"||m==="end-ellipsis"?C.jsx(IGe,{ref:n,ownerState:y,className:dt(k.root,s),children:"…"}):C.jsxs(TGe,{ref:n,ownerState:y,component:a,disabled:c,className:dt(k.root,s),...b,children:[m==="page"&&u,z?C.jsx(RGe,{...H,className:k.icon,as:z}):null]})}),NGe=i=>{const{classes:e,variant:n}=i;return Zt({root:["root",n],ul:["ul"]},wGe,e)},MGe=ye("nav",{name:"MuiPagination",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant]]}})({}),PGe=ye("ul",{name:"MuiPagination",slot:"Ul"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"});function OGe(i,e,n){return i==="page"?`${n?"":"Go to "}page ${e}`:`Go to ${i} page`}const FGe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiPagination"}),{boundaryCount:s=1,className:o,color:a="standard",count:l=1,defaultPage:c=1,disabled:u=!1,getItemAriaLabel:d=OGe,hideNextButton:h=!1,hidePrevButton:f=!1,onChange:p,page:g,renderItem:m=N=>C.jsx(AGe,{...N}),shape:_="circular",showFirstButton:b=!1,showLastButton:y=!1,siblingCount:x=1,size:k="medium",variant:D="text",...R}=r,{items:E}=CGe({...r,componentName:"Pagination"}),A={...r,boundaryCount:s,color:a,count:l,defaultPage:c,disabled:u,getItemAriaLabel:d,hideNextButton:h,hidePrevButton:f,renderItem:m,shape:_,showFirstButton:b,showLastButton:y,siblingCount:x,size:k,variant:D},M=NGe(A);return C.jsx(MGe,{"aria-label":"pagination navigation",className:dt(M.root,o),ownerState:A,ref:n,...R,children:C.jsx(PGe,{className:M.ul,ownerState:A,children:E.map((N,P)=>C.jsx("li",{children:m({...N,color:a,"aria-label":d(N.type,N.page,N.selected),shape:_,size:k,variant:D})},P))})})}),BGe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function kLe(i){return Xt("MuiSelect",i)}const MR=Yt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var vhe;const jGe=ye(CLe,{name:"MuiSelect",slot:"Select",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[{[`&.${MR.select}`]:e.select},{[`&.${MR.select}`]:e[n.variant]},{[`&.${MR.error}`]:e.error},{[`&.${MR.multiple}`]:e.multiple}]}})({[`&.${MR.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),WGe=ye(SLe,{name:"MuiSelect",slot:"Icon",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.icon,n.variant&&e[`icon${Ue(n.variant)}`],n.open&&e.iconOpen]}})({}),$Ge=ye("input",{shouldForwardProp:i=>bW(i)&&i!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function bhe(i,e){return typeof e=="object"&&e!==null?i===e:String(i)===String(e)}function zGe(i){return i==null||typeof i=="string"&&!i.trim()}const VGe=i=>{const{classes:e,variant:n,disabled:r,multiple:s,open:o,error:a}=i,l={select:["select",n,r&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${Ue(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Zt(l,kLe,e)},HGe=$.forwardRef(function(e,n){var Bt,jn;const{"aria-describedby":r,"aria-label":s,autoFocus:o,autoWidth:a,children:l,className:c,defaultOpen:u,defaultValue:d,disabled:h,displayEmpty:f,error:p=!1,IconComponent:g,inputRef:m,labelId:_,MenuProps:b={},multiple:y,name:x,onBlur:k,onChange:D,onClose:R,onFocus:E,onOpen:A,open:M,readOnly:N,renderValue:P,required:O,SelectDisplayProps:B={},tabIndex:j,type:z,value:H,variant:Y="standard",...X}=e,[Q,ie]=Im({controlled:H,default:d,name:"Select"}),[K,ee]=Im({controlled:M,default:u,name:"Select"}),le=$.useRef(null),ke=$.useRef(null),[xe,me]=$.useState(null),{current:Ee}=$.useRef(M!=null),[je,qe]=$.useState(),Ze=mo(n,m),We=$.useCallback(Dt=>{ke.current=Dt,Dt&&me(Dt)},[]),ut=xe==null?void 0:xe.parentNode;$.useImperativeHandle(Ze,()=>({focus:()=>{ke.current.focus()},node:le.current,value:Q}),[Q]),$.useEffect(()=>{u&&K&&xe&&!Ee&&(qe(a?null:ut.clientWidth),ke.current.focus())},[xe,a]),$.useEffect(()=>{o&&ke.current.focus()},[o]),$.useEffect(()=>{if(!_)return;const Dt=gl(ke.current).getElementById(_);if(Dt){const Fn=()=>{getSelection().isCollapsed&&ke.current.focus()};return Dt.addEventListener("click",Fn),()=>{Dt.removeEventListener("click",Fn)}}},[_]);const st=(Dt,Fn)=>{Dt?A&&A(Fn):R&&R(Fn),Ee||(qe(a?null:ut.clientWidth),ee(Dt))},mt=Dt=>{Dt.button===0&&(Dt.preventDefault(),ke.current.focus(),st(!0,Dt))},Rt=Dt=>{st(!1,Dt)},Vt=$.Children.toArray(l),Ot=Dt=>{const Fn=Vt.find(tn=>tn.props.value===Dt.target.value);Fn!==void 0&&(ie(Fn.props.value),D&&D(Dt,Fn))},vt=Dt=>Fn=>{let tn;if(Fn.currentTarget.hasAttribute("tabindex")){if(y){tn=Array.isArray(Q)?Q.slice():[];const pi=Q.indexOf(Dt.props.value);pi===-1?tn.push(Dt.props.value):tn.splice(pi,1)}else tn=Dt.props.value;if(Dt.props.onClick&&Dt.props.onClick(Fn),Q!==tn&&(ie(tn),D)){const pi=Fn.nativeEvent||Fn,Pi=new pi.constructor(pi.type,pi);Object.defineProperty(Pi,"target",{writable:!0,value:{value:tn,name:x}}),D(Pi,Dt)}y||st(!1,Fn)}},wn=Dt=>{N||[" ","ArrowUp","ArrowDown","Enter"].includes(Dt.key)&&(Dt.preventDefault(),st(!0,Dt))},Ce=xe!==null&&K,ge=Dt=>{!Ce&&k&&(Object.defineProperty(Dt,"target",{writable:!0,value:{value:Q,name:x}}),k(Dt))};delete X["aria-invalid"];let pe,ne;const ae=[];let ue=!1;(g9({value:Q})||f)&&(P?pe=P(Q):ue=!0);const de=Vt.map(Dt=>{if(!$.isValidElement(Dt))return null;let Fn;if(y){if(!Array.isArray(Q))throw new Error(kv(2));Fn=Q.some(tn=>bhe(tn,Dt.props.value)),Fn&&ue&&ae.push(Dt.props.children)}else Fn=bhe(Q,Dt.props.value),Fn&&ue&&(ne=Dt.props.children);return $.cloneElement(Dt,{"aria-selected":Fn?"true":"false",onClick:vt(Dt),onKeyUp:tn=>{tn.key===" "&&tn.preventDefault(),Dt.props.onKeyUp&&Dt.props.onKeyUp(tn)},role:"option",selected:Fn,value:void 0,"data-value":Dt.props.value})});ue&&(y?ae.length===0?pe=null:pe=ae.reduce((Dt,Fn,tn)=>(Dt.push(Fn),tn<ae.length-1&&Dt.push(", "),Dt),[]):pe=ne);let Se=je;!a&&Ee&&xe&&(Se=ut.clientWidth);let Ie;typeof j<"u"?Ie=j:Ie=h?null:0;const nt=B.id||(x?`mui-component-select-${x}`:void 0),Oe={...e,variant:Y,value:Q,open:Ce,error:p},Ve=VGe(Oe),gt={...b.PaperProps,...(Bt=b.slotProps)==null?void 0:Bt.paper},$t={...b.MenuListProps,...(jn=b.slotProps)==null?void 0:jn.list},Mt=W1();return C.jsxs($.Fragment,{children:[C.jsx(jGe,{as:"div",ref:We,tabIndex:Ie,role:"combobox","aria-controls":Ce?Mt:void 0,"aria-disabled":h?"true":void 0,"aria-expanded":Ce?"true":"false","aria-haspopup":"listbox","aria-label":s,"aria-labelledby":[_,nt].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":O?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:wn,onMouseDown:h||N?null:mt,onBlur:ge,onFocus:E,...B,ownerState:Oe,className:dt(B.className,Ve.select,c),id:nt,children:zGe(pe)?vhe||(vhe=C.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):pe}),C.jsx($Ge,{"aria-invalid":p,value:Array.isArray(Q)?Q.join(","):Q,name:x,ref:le,"aria-hidden":!0,onChange:Ot,tabIndex:-1,disabled:h,className:Ve.nativeInput,autoFocus:o,required:O,...X,ownerState:Oe}),C.jsx(WGe,{as:g,className:Ve.icon,ownerState:Oe}),C.jsx(wLe,{id:`menu-${x||""}`,anchorEl:ut,open:Ce,onClose:Rt,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...b,slotProps:{...b.slotProps,list:{"aria-labelledby":_,role:"listbox","aria-multiselectable":y?"true":void 0,disableListWrap:!0,id:Mt,...$t},paper:{...gt,style:{minWidth:Se,...gt!=null?gt.style:null}}},children:de})]})}),UGe=i=>{const{classes:e}=i,r=Zt({root:["root"]},kLe,e);return{...e,...r}},rse={name:"MuiSelect",slot:"Root",shouldForwardProp:i=>vl(i)&&i!=="variant"},qGe=ye(Jre,rse)(""),KGe=ye(TI,rse)(""),GGe=ye(Zre,rse)(""),sse=$.forwardRef(function(e,n){const r=Qt({name:"MuiSelect",props:e}),{autoWidth:s=!1,children:o,classes:a={},className:l,defaultOpen:c=!1,displayEmpty:u=!1,IconComponent:d=Jke,id:h,input:f,inputProps:p,label:g,labelId:m,MenuProps:_,multiple:b=!1,native:y=!1,onClose:x,onOpen:k,open:D,renderValue:R,SelectDisplayProps:E,variant:A="outlined",...M}=r,N=y?fGe:HGe,P=Ov(),O=Ux({props:r,muiFormControl:P,states:["variant","error"]}),B=O.variant||A,j={...r,variant:B,classes:a},z=UGe(j),{root:H,...Y}=z,X=f||{standard:C.jsx(qGe,{ownerState:j}),outlined:C.jsx(KGe,{label:g,ownerState:j}),filled:C.jsx(GGe,{ownerState:j})}[B],Q=mo(n,Hx(X));return C.jsx($.Fragment,{children:$.cloneElement(X,{inputComponent:N,inputProps:{children:o,error:O.error,IconComponent:d,variant:B,type:void 0,multiple:b,...y?{id:h}:{autoWidth:s,defaultOpen:c,displayEmpty:u,labelId:m,MenuProps:_,onClose:x,onOpen:k,open:D,renderValue:R,SelectDisplayProps:{id:h,...E}},...p,classes:p?pl(Y,p.classes):Y,...f?f.props.inputProps:{}},...(b&&y||u)&&B==="outlined"?{notched:!0}:{},ref:Q,className:dt(X.props.className,l,z.root),...!f&&{variant:B},...M})})});sse.muiName="Select";function XGe(i){return Xt("MuiSkeleton",i)}Yt("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const YGe=i=>{const{classes:e,variant:n,animation:r,hasChildren:s,width:o,height:a}=i;return Zt({root:["root",n,r,s&&"withChildren",s&&!o&&"fitContent",s&&!a&&"heightAuto"]},XGe,e)},BZ=tg`
0% {
opacity: 1;
}
50% {
opacity: 0.4;
}
100% {
opacity: 1;
}
`,jZ=tg`
0% {
transform: translateX(-100%);
}
50% {
/* +0.5s of delay between each loop */
transform: translateX(100%);
}
100% {
transform: translateX(100%);
}
`,ZGe=typeof BZ!="string"?Mv`
animation: ${BZ} 2s ease-in-out 0.5s infinite;
`:null,QGe=typeof jZ!="string"?Mv`
&::after {
animation: ${jZ} 2s linear 0.5s infinite;
}
`:null,JGe=ye("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant],n.animation!==!1&&e[n.animation],n.hasChildren&&e.withChildren,n.hasChildren&&!n.width&&e.fitContent,n.hasChildren&&!n.height&&e.heightAuto]}})(jt(({theme:i})=>{const e=zWe(i.shape.borderRadius)||"px",n=VWe(i.shape.borderRadius);return{display:"block",backgroundColor:i.vars?i.vars.palette.Skeleton.bg:Pt(i.palette.text.primary,i.palette.mode==="light"?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${e}/${Math.round(n/.6*10)/10}${e}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(i.vars||i).shape.borderRadius}},{props:({ownerState:r})=>r.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:r})=>r.hasChildren&&!r.width,style:{maxWidth:"fit-content"}},{props:({ownerState:r})=>r.hasChildren&&!r.height,style:{height:"auto"}},{props:{animation:"pulse"},style:ZGe||{animation:`${BZ} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(
90deg,
transparent,
${(i.vars||i).palette.action.hover},
transparent
)`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:QGe||{"&::after":{animation:`${jZ} 2s linear 0.5s infinite`}}}]}})),bU=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiSkeleton"}),{animation:s="pulse",className:o,component:a="span",height:l,style:c,variant:u="text",width:d,...h}=r,f={...r,animation:s,component:a,variant:u,hasChildren:!!h.children},p=YGe(f);return C.jsx(JGe,{as:a,ref:n,className:dt(p.root,o),ownerState:f,...h,style:{width:d,height:l,...c}})});function eXe(i,e,n=(r,s)=>r===s){return i.length===e.length&&i.every((r,s)=>n(r,e[s]))}const tXe=2;function VL(i,e,n,r,s){return n===1?Math.min(i+e,s):Math.max(i-e,r)}function LLe(i,e){return i-e}function yhe(i,e){const{index:n}=i.reduce((r,s,o)=>{const a=Math.abs(e-s);return r===null||a<r.distance||a===r.distance?{distance:a,index:o}:r},null)??{};return n}function b3(i,e){if(e.current!==void 0&&i.changedTouches){const n=i;for(let r=0;r<n.changedTouches.length;r+=1){const s=n.changedTouches[r];if(s.identifier===e.current)return{x:s.clientX,y:s.clientY}}return!1}return{x:i.clientX,y:i.clientY}}function v9(i,e,n){return(i-e)*100/(n-e)}function nXe(i,e,n){return(n-e)*i+e}function iXe(i){if(Math.abs(i)<1){const n=i.toExponential().split("e-"),r=n[0].split(".")[1];return(r?r.length:0)+parseInt(n[1],10)}const e=i.toString().split(".")[1];return e?e.length:0}function rXe(i,e,n){const r=Math.round((i-n)/e)*e+n;return Number(r.toFixed(iXe(e)))}function whe({values:i,newValue:e,index:n}){const r=i.slice();return r[n]=e,r.sort(LLe)}function y3({sliderRef:i,activeIndex:e,setActive:n}){var s,o,a;const r=gl(i.current);(!((s=i.current)!=null&&s.contains(r.activeElement))||Number((o=r==null?void 0:r.activeElement)==null?void 0:o.getAttribute("data-index"))!==e)&&((a=i.current)==null||a.querySelector(`[type="range"][data-index="${e}"]`).focus()),n&&n(e)}function w3(i,e){return typeof i=="number"&&typeof e=="number"?i===e:typeof i=="object"&&typeof e=="object"?eXe(i,e):!1}const sXe={horizontal:{offset:i=>({left:`${i}%`}),leap:i=>({width:`${i}%`})},"horizontal-reverse":{offset:i=>({right:`${i}%`}),leap:i=>({width:`${i}%`})},vertical:{offset:i=>({bottom:`${i}%`}),leap:i=>({height:`${i}%`})}},oXe=i=>i;let C3;function Che(){return C3===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?C3=CSS.supports("touch-action","none"):C3=!0),C3}function aXe(i){const{"aria-labelledby":e,defaultValue:n,disabled:r=!1,disableSwap:s=!1,isRtl:o=!1,marks:a=!1,max:l=100,min:c=0,name:u,onChange:d,onChangeCommitted:h,orientation:f="horizontal",rootRef:p,scale:g=oXe,step:m=1,shiftStep:_=10,tabIndex:b,value:y}=i,x=$.useRef(void 0),[k,D]=$.useState(-1),[R,E]=$.useState(-1),[A,M]=$.useState(!1),N=$.useRef(0),P=$.useRef(null),[O,B]=Im({controlled:y,default:n??c,name:"Slider"}),j=d&&((ue,de,Se)=>{const Ie=ue.nativeEvent||ue,nt=new Ie.constructor(Ie.type,Ie);Object.defineProperty(nt,"target",{writable:!0,value:{value:de,name:u}}),P.current=de,d(nt,de,Se)}),z=Array.isArray(O);let H=z?O.slice().sort(LLe):[O];H=H.map(ue=>ue==null?c:FD(ue,c,l));const Y=a===!0&&m!==null?[...Array(Math.floor((l-c)/m)+1)].map((ue,de)=>({value:c+m*de})):a||[],X=Y.map(ue=>ue.value),[Q,ie]=$.useState(-1),K=$.useRef(null),ee=mo(p,K),le=ue=>de=>{var Ie;const Se=Number(de.currentTarget.getAttribute("data-index"));o1(de.target)&&ie(Se),E(Se),(Ie=ue==null?void 0:ue.onFocus)==null||Ie.call(ue,de)},ke=ue=>de=>{var Se;o1(de.target)||ie(-1),E(-1),(Se=ue==null?void 0:ue.onBlur)==null||Se.call(ue,de)},xe=(ue,de)=>{const Se=Number(ue.currentTarget.getAttribute("data-index")),Ie=H[Se],nt=X.indexOf(Ie);let Oe=de;if(Y&&m==null){const Ve=X[X.length-1];Oe>=Ve?Oe=Ve:Oe<=X[0]?Oe=X[0]:Oe=Oe<Ie?X[nt-1]:X[nt+1]}if(Oe=FD(Oe,c,l),z){s&&(Oe=FD(Oe,H[Se-1]||-1/0,H[Se+1]||1/0));const Ve=Oe;Oe=whe({values:H,newValue:Oe,index:Se});let gt=Se;s||(gt=Oe.indexOf(Ve)),y3({sliderRef:K,activeIndex:gt})}B(Oe),ie(Se),j&&!w3(Oe,O)&&j(ue,Oe,Se),h&&h(ue,P.current??Oe)},me=ue=>de=>{var Se;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(de.key)){de.preventDefault();const Ie=Number(de.currentTarget.getAttribute("data-index")),nt=H[Ie];let Oe=null;if(m!=null){const Ve=de.shiftKey?_:m;switch(de.key){case"ArrowUp":Oe=VL(nt,Ve,1,c,l);break;case"ArrowRight":Oe=VL(nt,Ve,o?-1:1,c,l);break;case"ArrowDown":Oe=VL(nt,Ve,-1,c,l);break;case"ArrowLeft":Oe=VL(nt,Ve,o?1:-1,c,l);break;case"PageUp":Oe=VL(nt,_,1,c,l);break;case"PageDown":Oe=VL(nt,_,-1,c,l);break;case"Home":Oe=c;break;case"End":Oe=l;break}}else if(Y){const Ve=X[X.length-1],gt=X.indexOf(nt),$t=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],Mt=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];$t.includes(de.key)?gt===0?Oe=X[0]:Oe=X[gt-1]:Mt.includes(de.key)&&(gt===X.length-1?Oe=Ve:Oe=X[gt+1])}Oe!=null&&xe(de,Oe)}(Se=ue==null?void 0:ue.onKeyDown)==null||Se.call(ue,de)};wc(()=>{var ue;r&&K.current.contains(document.activeElement)&&((ue=document.activeElement)==null||ue.blur())},[r]),r&&k!==-1&&D(-1),r&&Q!==-1&&ie(-1);const Ee=ue=>de=>{var Se;(Se=ue.onChange)==null||Se.call(ue,de),xe(de,de.target.valueAsNumber)},je=$.useRef(void 0);let qe=f;o&&f==="horizontal"&&(qe+="-reverse");const Ze=({finger:ue,move:de=!1})=>{const{current:Se}=K,{width:Ie,height:nt,bottom:Oe,left:Ve}=Se.getBoundingClientRect();let gt;qe.startsWith("vertical")?gt=(Oe-ue.y)/nt:gt=(ue.x-Ve)/Ie,qe.includes("-reverse")&&(gt=1-gt);let $t;if($t=nXe(gt,c,l),m)$t=rXe($t,m,c);else{const Bt=yhe(X,$t);$t=X[Bt]}$t=FD($t,c,l);let Mt=0;if(z){de?Mt=je.current:Mt=yhe(H,$t),s&&($t=FD($t,H[Mt-1]||-1/0,H[Mt+1]||1/0));const Bt=$t;$t=whe({values:H,newValue:$t,index:Mt}),s&&de||(Mt=$t.indexOf(Bt),je.current=Mt)}return{newValue:$t,activeIndex:Mt}},We=Ha(ue=>{const de=b3(ue,x);if(!de)return;if(N.current+=1,ue.type==="mousemove"&&ue.buttons===0){ut(ue);return}const{newValue:Se,activeIndex:Ie}=Ze({finger:de,move:!0});y3({sliderRef:K,activeIndex:Ie,setActive:D}),B(Se),!A&&N.current>tXe&&M(!0),j&&!w3(Se,O)&&j(ue,Se,Ie)}),ut=Ha(ue=>{const de=b3(ue,x);if(M(!1),!de)return;const{newValue:Se}=Ze({finger:de,move:!0});D(-1),ue.type==="touchend"&&E(-1),h&&h(ue,P.current??Se),x.current=void 0,mt()}),st=Ha(ue=>{if(r)return;Che()||ue.preventDefault();const de=ue.changedTouches[0];de!=null&&(x.current=de.identifier);const Se=b3(ue,x);if(Se!==!1){const{newValue:nt,activeIndex:Oe}=Ze({finger:Se});y3({sliderRef:K,activeIndex:Oe,setActive:D}),B(nt),j&&!w3(nt,O)&&j(ue,nt,Oe)}N.current=0;const Ie=gl(K.current);Ie.addEventListener("touchmove",We,{passive:!0}),Ie.addEventListener("touchend",ut,{passive:!0})}),mt=$.useCallback(()=>{const ue=gl(K.current);ue.removeEventListener("mousemove",We),ue.removeEventListener("mouseup",ut),ue.removeEventListener("touchmove",We),ue.removeEventListener("touchend",ut)},[ut,We]);$.useEffect(()=>{const{current:ue}=K;return ue.addEventListener("touchstart",st,{passive:Che()}),()=>{ue.removeEventListener("touchstart",st),mt()}},[mt,st]),$.useEffect(()=>{r&&mt()},[r,mt]);const Rt=ue=>de=>{var nt;if((nt=ue.onMouseDown)==null||nt.call(ue,de),r||de.defaultPrevented||de.button!==0)return;de.preventDefault();const Se=b3(de,x);if(Se!==!1){const{newValue:Oe,activeIndex:Ve}=Ze({finger:Se});y3({sliderRef:K,activeIndex:Ve,setActive:D}),B(Oe),j&&!w3(Oe,O)&&j(de,Oe,Ve)}N.current=0;const Ie=gl(K.current);Ie.addEventListener("mousemove",We,{passive:!0}),Ie.addEventListener("mouseup",ut)},Vt=v9(z?H[0]:c,c,l),Ot=v9(H[H.length-1],c,l)-Vt,vt=(ue={})=>{const de=VN(ue),Se={onMouseDown:Rt(de||{})},Ie={...de,...Se};return{...ue,ref:ee,...Ie}},wn=ue=>de=>{var Ie;(Ie=ue.onMouseOver)==null||Ie.call(ue,de);const Se=Number(de.currentTarget.getAttribute("data-index"));E(Se)},Ce=ue=>de=>{var Se;(Se=ue.onMouseLeave)==null||Se.call(ue,de),E(-1)},ge=(ue={})=>{const de=VN(ue),Se={onMouseOver:wn(de||{}),onMouseLeave:Ce(de||{})};return{...ue,...de,...Se}},pe=ue=>({pointerEvents:k!==-1&&k!==ue?"none":void 0});let ne;return f==="vertical"&&(ne=o?"vertical-rl":"vertical-lr"),{active:k,axis:qe,axisProps:sXe,dragging:A,focusedThumbIndex:Q,getHiddenInputProps:(ue={})=>{const de=VN(ue),Se={onChange:Ee(de||{}),onFocus:le(de||{}),onBlur:ke(de||{}),onKeyDown:me(de||{})},Ie={...de,...Se};return{tabIndex:b,"aria-labelledby":e,"aria-orientation":f,"aria-valuemax":g(l),"aria-valuemin":g(c),name:u,type:"range",min:i.min,max:i.max,step:i.step===null&&i.marks?"any":i.step??void 0,disabled:r,...ue,...Ie,style:{...BGe,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:ne}}},getRootProps:vt,getThumbProps:ge,marks:Y,open:R,range:z,rootRef:ee,trackLeap:Ot,trackOffset:Vt,values:H,getThumbStyle:pe}}const lXe=i=>!i||!dv(i);function cXe(i){return Xt("MuiSlider",i)}const gf=Yt("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),uXe=i=>{const{open:e}=i;return{offset:dt(e&&gf.valueLabelOpen),circle:gf.valueLabelCircle,label:gf.valueLabelLabel}};function dXe(i){const{children:e,className:n,value:r}=i,s=uXe(i);return e?$.cloneElement(e,{className:e.props.className},C.jsxs($.Fragment,{children:[e.props.children,C.jsx("span",{className:dt(s.offset,n),"aria-hidden":!0,children:C.jsx("span",{className:s.circle,children:C.jsx("span",{className:s.label,children:r})})})]})):null}function She(i){return i}const hXe=ye("span",{name:"MuiSlider",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[`color${Ue(n.color)}`],n.size!=="medium"&&e[`size${Ue(n.size)}`],n.marked&&e.marked,n.orientation==="vertical"&&e.vertical,n.track==="inverted"&&e.trackInverted,n.track===!1&&e.trackFalse]}})(jt(({theme:i})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${gf.disabled}`]:{pointerEvents:"none",cursor:"default",color:(i.vars||i).palette.grey[400]},[`&.${gf.dragging}`]:{[`& .${gf.thumb}, & .${gf.track}`]:{transition:"none"}},variants:[...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{color:(i.vars||i).palette[e].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),fXe=ye("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),pXe=ye("span",{name:"MuiSlider",slot:"Track"})(jt(({theme:i})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:i.transitions.create(["left","width","bottom","height"],{duration:i.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e,track:"inverted"},style:{...i.vars?{backgroundColor:i.vars.palette.Slider[`${e}Track`],borderColor:i.vars.palette.Slider[`${e}Track`]}:{backgroundColor:qp(i.palette[e].main,.62),borderColor:qp(i.palette[e].main,.62),...i.applyStyles("dark",{backgroundColor:$m(i.palette[e].main,.5)}),...i.applyStyles("dark",{borderColor:$m(i.palette[e].main,.5)})}}}))]}))),gXe=ye("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.thumb,e[`thumbColor${Ue(n.color)}`],n.size!=="medium"&&e[`thumbSize${Ue(n.size)}`]]}})(jt(({theme:i})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:i.transitions.create(["box-shadow","left","bottom"],{duration:i.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(i.vars||i).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${gf.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{[`&:hover, &.${gf.focusVisible}`]:{...i.vars?{boxShadow:`0px 0px 0px 8px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${Pt(i.palette[e].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${gf.active}`]:{...i.vars?{boxShadow:`0px 0px 0px 14px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${Pt(i.palette[e].main,.16)}`}}}}))]}))),mXe=ye(dXe,{name:"MuiSlider",slot:"ValueLabel"})(jt(({theme:i})=>({zIndex:1,whiteSpace:"nowrap",...i.typography.body2,fontWeight:500,transition:i.transitions.create(["transform"],{duration:i.transitions.duration.shortest}),position:"absolute",backgroundColor:(i.vars||i).palette.grey[600],borderRadius:2,color:(i.vars||i).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${gf.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${gf.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:i.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}))),_Xe=ye("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:i=>bW(i)&&i!=="markActive",overridesResolver:(i,e)=>{const{markActive:n}=i;return[e.mark,n&&e.markActive]}})(jt(({theme:i})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(i.vars||i).palette.background.paper,opacity:.8}}]}))),vXe=ye("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:i=>bW(i)&&i!=="markLabelActive"})(jt(({theme:i})=>({...i.typography.body2,color:(i.vars||i).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(i.vars||i).palette.text.primary}}]}))),bXe=i=>{const{disabled:e,dragging:n,marked:r,orientation:s,track:o,classes:a,color:l,size:c}=i,u={root:["root",e&&"disabled",n&&"dragging",r&&"marked",s==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",l&&`color${Ue(l)}`,c&&`size${Ue(c)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",c&&`thumbSize${Ue(c)}`,l&&`thumbColor${Ue(l)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Zt(u,cXe,a)},yXe=({children:i})=>i,wXe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiSlider"}),s=Pv(),{"aria-label":o,"aria-valuetext":a,"aria-labelledby":l,component:c="span",components:u={},componentsProps:d={},color:h="primary",classes:f,className:p,disableSwap:g=!1,disabled:m=!1,getAriaLabel:_,getAriaValueText:b,marks:y=!1,max:x=100,min:k=0,name:D,onChange:R,onChangeCommitted:E,orientation:A="horizontal",shiftStep:M=10,size:N="medium",step:P=1,scale:O=She,slotProps:B,slots:j,tabIndex:z,track:H="normal",value:Y,valueLabelDisplay:X="off",valueLabelFormat:Q=She,...ie}=r,K={...r,isRtl:s,max:x,min:k,classes:f,disabled:m,disableSwap:g,orientation:A,marks:y,color:h,size:N,step:P,shiftStep:M,scale:O,track:H,valueLabelDisplay:X,valueLabelFormat:Q},{axisProps:ee,getRootProps:le,getHiddenInputProps:ke,getThumbProps:xe,open:me,active:Ee,axis:je,focusedThumbIndex:qe,range:Ze,dragging:We,marks:ut,values:st,trackOffset:mt,trackLeap:Rt,getThumbStyle:Vt}=aXe({...K,rootRef:n});K.marked=ut.length>0&&ut.some(ti=>ti.label),K.dragging=We,K.focusedThumbIndex=qe;const Ot=bXe(K),vt=(j==null?void 0:j.root)??u.Root??hXe,wn=(j==null?void 0:j.rail)??u.Rail??fXe,Ce=(j==null?void 0:j.track)??u.Track??pXe,ge=(j==null?void 0:j.thumb)??u.Thumb??gXe,pe=(j==null?void 0:j.valueLabel)??u.ValueLabel??mXe,ne=(j==null?void 0:j.mark)??u.Mark??_Xe,ae=(j==null?void 0:j.markLabel)??u.MarkLabel??vXe,ue=(j==null?void 0:j.input)??u.Input??"input",de=(B==null?void 0:B.root)??d.root,Se=(B==null?void 0:B.rail)??d.rail,Ie=(B==null?void 0:B.track)??d.track,nt=(B==null?void 0:B.thumb)??d.thumb,Oe=(B==null?void 0:B.valueLabel)??d.valueLabel,Ve=(B==null?void 0:B.mark)??d.mark,gt=(B==null?void 0:B.markLabel)??d.markLabel,$t=(B==null?void 0:B.input)??d.input,Mt=$u({elementType:vt,getSlotProps:le,externalSlotProps:de,externalForwardedProps:ie,additionalProps:{...lXe(vt)&&{as:c}},ownerState:{...K,...de==null?void 0:de.ownerState},className:[Ot.root,p]}),Bt=$u({elementType:wn,externalSlotProps:Se,ownerState:K,className:Ot.rail}),jn=$u({elementType:Ce,externalSlotProps:Ie,additionalProps:{style:{...ee[je].offset(mt),...ee[je].leap(Rt)}},ownerState:{...K,...Ie==null?void 0:Ie.ownerState},className:Ot.track}),Dt=$u({elementType:ge,getSlotProps:xe,externalSlotProps:nt,ownerState:{...K,...nt==null?void 0:nt.ownerState},className:Ot.thumb}),Fn=$u({elementType:pe,externalSlotProps:Oe,ownerState:{...K,...Oe==null?void 0:Oe.ownerState},className:Ot.valueLabel}),tn=$u({elementType:ne,externalSlotProps:Ve,ownerState:K,className:Ot.mark}),pi=$u({elementType:ae,externalSlotProps:gt,ownerState:K,className:Ot.markLabel}),Pi=$u({elementType:ue,getSlotProps:ke,externalSlotProps:$t,ownerState:K});return C.jsxs(vt,{...Mt,children:[C.jsx(wn,{...Bt}),C.jsx(Ce,{...jn}),ut.filter(ti=>ti.value>=k&&ti.value<=x).map((ti,mi)=>{const ds=v9(ti.value,k,x),Nr=ee[je].offset(ds);let Br;return H===!1?Br=st.includes(ti.value):Br=H==="normal"&&(Ze?ti.value>=st[0]&&ti.value<=st[st.length-1]:ti.value<=st[0])||H==="inverted"&&(Ze?ti.value<=st[0]||ti.value>=st[st.length-1]:ti.value>=st[0]),C.jsxs($.Fragment,{children:[C.jsx(ne,{"data-index":mi,...tn,...!dv(ne)&&{markActive:Br},style:{...Nr,...tn.style},className:dt(tn.className,Br&&Ot.markActive)}),ti.label!=null?C.jsx(ae,{"aria-hidden":!0,"data-index":mi,...pi,...!dv(ae)&&{markLabelActive:Br},style:{...Nr,...pi.style},className:dt(Ot.markLabel,pi.className,Br&&Ot.markLabelActive),children:ti.label}):null]},mi)}),st.map((ti,mi)=>{const ds=v9(ti,k,x),Nr=ee[je].offset(ds),Br=X==="off"?yXe:pe;return C.jsx(Br,{...!dv(Br)&&{valueLabelFormat:Q,valueLabelDisplay:X,value:typeof Q=="function"?Q(O(ti),mi):Q,index:mi,open:me===mi||Ee===mi||X==="on",disabled:m},...Fn,children:C.jsx(ge,{"data-index":mi,...Dt,className:dt(Ot.thumb,Dt.className,Ee===mi&&Ot.active,qe===mi&&Ot.focusVisible),style:{...Nr,...Vt(mi),...Dt.style},children:C.jsx(ue,{"data-index":mi,"aria-label":_?_(mi):o,"aria-valuenow":O(ti),"aria-labelledby":l,"aria-valuetext":b?b(O(ti),mi):a,value:st[mi],...Pi})})},mi)})]})});function CXe(i){return Xt("MuiTooltip",i)}const co=Yt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function SXe(i){return Math.round(i*1e5)/1e5}const xXe=i=>{const{classes:e,disableInteractive:n,arrow:r,touch:s,placement:o}=i,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",s&&"touch",`tooltipPlacement${Ue(o.split("-")[0])}`],arrow:["arrow"]};return Zt(a,CXe,e)},kXe=ye(CW,{name:"MuiTooltip",slot:"Popper",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.popper,!n.disableInteractive&&e.popperInteractive,n.arrow&&e.popperArrow,!n.open&&e.popperClose]}})(jt(({theme:i})=>({zIndex:(i.vars||i).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${co.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${co.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${co.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${co.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${co.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${co.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${co.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${co.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),LXe=ye("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.tooltip,n.touch&&e.touch,n.arrow&&e.tooltipArrow,e[`tooltipPlacement${Ue(n.placement.split("-")[0])}`]]}})(jt(({theme:i})=>({backgroundColor:i.vars?i.vars.palette.Tooltip.bg:Pt(i.palette.grey[700],.92),borderRadius:(i.vars||i).shape.borderRadius,color:(i.vars||i).palette.common.white,fontFamily:i.typography.fontFamily,padding:"4px 8px",fontSize:i.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:i.typography.fontWeightMedium,[`.${co.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${co.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${co.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${co.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:i.typography.pxToRem(14),lineHeight:`${SXe(16/14)}em`,fontWeight:i.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${co.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${co.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${co.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${co.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${co.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${co.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${co.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${co.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${co.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${co.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),DXe=ye("span",{name:"MuiTooltip",slot:"Arrow"})(jt(({theme:i})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:i.vars?i.vars.palette.Tooltip.bg:Pt(i.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let S3=!1;const xhe=new yW;let PR={x:0,y:0};function x3(i,e){return(n,...r)=>{e&&e(n,...r),i(n,...r)}}const ua=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTooltip"}),{arrow:s=!1,children:o,classes:a,components:l={},componentsProps:c={},describeChild:u=!1,disableFocusListener:d=!1,disableHoverListener:h=!1,disableInteractive:f=!1,disableTouchListener:p=!1,enterDelay:g=100,enterNextDelay:m=0,enterTouchDelay:_=700,followCursor:b=!1,id:y,leaveDelay:x=0,leaveTouchDelay:k=1500,onClose:D,onOpen:R,open:E,placement:A="bottom",PopperComponent:M,PopperProps:N={},slotProps:P={},slots:O={},title:B,TransitionComponent:j,TransitionProps:z,...H}=r,Y=$.isValidElement(o)?o:C.jsx("span",{children:o}),X=$i(),Q=Pv(),[ie,K]=$.useState(),[ee,le]=$.useState(null),ke=$.useRef(!1),xe=f||b,me=lS(),Ee=lS(),je=lS(),qe=lS(),[Ze,We]=Im({controlled:E,default:!1,name:"Tooltip",state:"open"});let ut=Ze;const st=W1(y),mt=$.useRef(),Rt=Ha(()=>{mt.current!==void 0&&(document.body.style.WebkitUserSelect=mt.current,mt.current=void 0),qe.clear()});$.useEffect(()=>Rt,[Rt]);const Vt=Mn=>{xhe.clear(),S3=!0,We(!0),R&&!ut&&R(Mn)},Ot=Ha(Mn=>{xhe.start(800+x,()=>{S3=!1}),We(!1),D&&ut&&D(Mn),me.start(X.transitions.duration.shortest,()=>{ke.current=!1})}),vt=Mn=>{ke.current&&Mn.type!=="touchstart"||(ie&&ie.removeAttribute("title"),Ee.clear(),je.clear(),g||S3&&m?Ee.start(S3?m:g,()=>{Vt(Mn)}):Vt(Mn))},wn=Mn=>{Ee.clear(),je.start(x,()=>{Ot(Mn)})},[,Ce]=$.useState(!1),ge=Mn=>{o1(Mn.target)||(Ce(!1),wn(Mn))},pe=Mn=>{ie||K(Mn.currentTarget),o1(Mn.target)&&(Ce(!0),vt(Mn))},ne=Mn=>{ke.current=!0;const hr=Y.props;hr.onTouchStart&&hr.onTouchStart(Mn)},ae=Mn=>{ne(Mn),je.clear(),me.clear(),Rt(),mt.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",qe.start(_,()=>{document.body.style.WebkitUserSelect=mt.current,vt(Mn)})},ue=Mn=>{Y.props.onTouchEnd&&Y.props.onTouchEnd(Mn),Rt(),je.start(k,()=>{Ot(Mn)})};$.useEffect(()=>{if(!ut)return;function Mn(hr){hr.key==="Escape"&&Ot(hr)}return document.addEventListener("keydown",Mn),()=>{document.removeEventListener("keydown",Mn)}},[Ot,ut]);const de=mo(Hx(Y),K,n);!B&&B!==0&&(ut=!1);const Se=$.useRef(),Ie=Mn=>{const hr=Y.props;hr.onMouseMove&&hr.onMouseMove(Mn),PR={x:Mn.clientX,y:Mn.clientY},Se.current&&Se.current.update()},nt={},Oe=typeof B=="string";u?(nt.title=!ut&&Oe&&!h?B:null,nt["aria-describedby"]=ut?st:null):(nt["aria-label"]=Oe?B:null,nt["aria-labelledby"]=ut&&!Oe?st:null);const Ve={...nt,...H,...Y.props,className:dt(H.className,Y.props.className),onTouchStart:ne,ref:de,...b?{onMouseMove:Ie}:{}},gt={};p||(Ve.onTouchStart=ae,Ve.onTouchEnd=ue),h||(Ve.onMouseOver=x3(vt,Ve.onMouseOver),Ve.onMouseLeave=x3(wn,Ve.onMouseLeave),xe||(gt.onMouseOver=vt,gt.onMouseLeave=wn)),d||(Ve.onFocus=x3(pe,Ve.onFocus),Ve.onBlur=x3(ge,Ve.onBlur),xe||(gt.onFocus=pe,gt.onBlur=ge));const $t={...r,isRtl:Q,arrow:s,disableInteractive:xe,placement:A,PopperComponentProp:M,touch:ke.current},Mt=typeof P.popper=="function"?P.popper($t):P.popper,Bt=$.useMemo(()=>{var hr,rn;let Mn=[{name:"arrow",enabled:!!ee,options:{element:ee,padding:4}}];return(hr=N.popperOptions)!=null&&hr.modifiers&&(Mn=Mn.concat(N.popperOptions.modifiers)),(rn=Mt==null?void 0:Mt.popperOptions)!=null&&rn.modifiers&&(Mn=Mn.concat(Mt.popperOptions.modifiers)),{...N.popperOptions,...Mt==null?void 0:Mt.popperOptions,modifiers:Mn}},[ee,N.popperOptions,Mt==null?void 0:Mt.popperOptions]),jn=xXe($t),Dt=typeof P.transition=="function"?P.transition($t):P.transition,Fn={slots:{popper:l.Popper,transition:l.Transition??j,tooltip:l.Tooltip,arrow:l.Arrow,...O},slotProps:{arrow:P.arrow??c.arrow,popper:{...N,...Mt??c.popper},tooltip:P.tooltip??c.tooltip,transition:{...z,...Dt??c.transition}}},[tn,pi]=an("popper",{elementType:kXe,externalForwardedProps:Fn,ownerState:$t,className:dt(jn.popper,N==null?void 0:N.className)}),[Pi,ti]=an("transition",{elementType:_9,externalForwardedProps:Fn,ownerState:$t}),[mi,ds]=an("tooltip",{elementType:LXe,className:jn.tooltip,externalForwardedProps:Fn,ownerState:$t}),[Nr,Br]=an("arrow",{elementType:DXe,className:jn.arrow,externalForwardedProps:Fn,ownerState:$t,ref:le});return C.jsxs($.Fragment,{children:[$.cloneElement(Y,Ve),C.jsx(tn,{as:M??CW,placement:A,anchorEl:b?{getBoundingClientRect:()=>({top:PR.y,left:PR.x,right:PR.x,bottom:PR.y,width:0,height:0})}:ie,popperRef:Se,open:ie?ut:!1,id:st,transition:!0,...gt,...pi,popperOptions:Bt,children:({TransitionProps:Mn})=>C.jsx(Pi,{timeout:X.transitions.duration.shorter,...Mn,...ti,children:C.jsxs(mi,{...ds,children:[B,s?C.jsx(Nr,{...Br}):null]})})})]})}),f5=$.createContext({}),NW=$.createContext({});function EXe(i){return Xt("MuiStep",i)}Yt("MuiStep",["root","horizontal","vertical","alternativeLabel","completed"]);const IXe=i=>{const{classes:e,orientation:n,alternativeLabel:r,completed:s}=i;return Zt({root:["root",n,r&&"alternativeLabel",s&&"completed"]},EXe,e)},TXe=ye("div",{name:"MuiStep",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.orientation],n.alternativeLabel&&e.alternativeLabel,n.completed&&e.completed]}})({variants:[{props:{orientation:"horizontal"},style:{paddingLeft:8,paddingRight:8}},{props:{alternativeLabel:!0},style:{flex:1,position:"relative"}}]}),khe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiStep"}),{active:s,children:o,className:a,component:l="div",completed:c,disabled:u,expanded:d=!1,index:h,last:f,...p}=r,{activeStep:g,connector:m,alternativeLabel:_,orientation:b,nonLinear:y}=$.useContext(f5);let[x=!1,k=!1,D=!1]=[s,c,u];g===h?x=s!==void 0?s:!0:!y&&g>h?k=c!==void 0?c:!0:!y&&g<h&&(D=u!==void 0?u:!0);const R=$.useMemo(()=>({index:h,last:f,expanded:d,icon:h+1,active:x,completed:k,disabled:D}),[h,f,d,x,k,D]),E={...r,active:x,orientation:b,alternativeLabel:_,completed:k,disabled:D,expanded:d,component:l},A=IXe(E),M=C.jsxs(TXe,{as:l,className:dt(A.root,a),ref:n,ownerState:E,...p,children:[m&&_&&h!==0?m:null,o]});return C.jsx(NW.Provider,{value:R,children:m&&!_&&h!==0?C.jsxs($.Fragment,{children:[m,M]}):M})}),RXe=Hr(C.jsx("path",{d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z"})),AXe=Hr(C.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));function NXe(i){return Xt("MuiStepIcon",i)}const yU=Yt("MuiStepIcon",["root","active","completed","error","text"]);var Lhe;const MXe=i=>{const{classes:e,active:n,completed:r,error:s}=i;return Zt({root:["root",n&&"active",r&&"completed",s&&"error"],text:["text"]},NXe,e)},wU=ye(u9,{name:"MuiStepIcon",slot:"Root"})(jt(({theme:i})=>({display:"block",transition:i.transitions.create("color",{duration:i.transitions.duration.shortest}),color:(i.vars||i).palette.text.disabled,[`&.${yU.completed}`]:{color:(i.vars||i).palette.primary.main},[`&.${yU.active}`]:{color:(i.vars||i).palette.primary.main},[`&.${yU.error}`]:{color:(i.vars||i).palette.error.main}}))),PXe=ye("text",{name:"MuiStepIcon",slot:"Text"})(jt(({theme:i})=>({fill:(i.vars||i).palette.primary.contrastText,fontSize:i.typography.caption.fontSize,fontFamily:i.typography.fontFamily}))),OXe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiStepIcon"}),{active:s=!1,className:o,completed:a=!1,error:l=!1,icon:c,...u}=r,d={...r,active:s,completed:a,error:l},h=MXe(d);if(typeof c=="number"||typeof c=="string"){const f=dt(o,h.root);return l?C.jsx(wU,{as:AXe,className:f,ref:n,ownerState:d,...u}):a?C.jsx(wU,{as:RXe,className:f,ref:n,ownerState:d,...u}):C.jsxs(wU,{className:f,ref:n,ownerState:d,...u,children:[Lhe||(Lhe=C.jsx("circle",{cx:"12",cy:"12",r:"12"})),C.jsx(PXe,{className:h.text,x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",ownerState:d,children:c})]})}return c});function FXe(i){return Xt("MuiStepLabel",i)}const py=Yt("MuiStepLabel",["root","horizontal","vertical","label","active","completed","error","disabled","iconContainer","alternativeLabel","labelContainer"]),BXe=i=>{const{classes:e,orientation:n,active:r,completed:s,error:o,disabled:a,alternativeLabel:l}=i;return Zt({root:["root",n,o&&"error",a&&"disabled",l&&"alternativeLabel"],label:["label",r&&"active",s&&"completed",o&&"error",a&&"disabled",l&&"alternativeLabel"],iconContainer:["iconContainer",r&&"active",s&&"completed",o&&"error",a&&"disabled",l&&"alternativeLabel"],labelContainer:["labelContainer",l&&"alternativeLabel"]},FXe,e)},jXe=ye("span",{name:"MuiStepLabel",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.orientation]]}})({display:"flex",alignItems:"center",[`&.${py.alternativeLabel}`]:{flexDirection:"column"},[`&.${py.disabled}`]:{cursor:"default"},variants:[{props:{orientation:"vertical"},style:{textAlign:"left",padding:"8px 0"}}]}),WXe=ye("span",{name:"MuiStepLabel",slot:"Label"})(jt(({theme:i})=>({...i.typography.body2,display:"block",transition:i.transitions.create("color",{duration:i.transitions.duration.shortest}),[`&.${py.active}`]:{color:(i.vars||i).palette.text.primary,fontWeight:500},[`&.${py.completed}`]:{color:(i.vars||i).palette.text.primary,fontWeight:500},[`&.${py.alternativeLabel}`]:{marginTop:16},[`&.${py.error}`]:{color:(i.vars||i).palette.error.main}}))),$Xe=ye("span",{name:"MuiStepLabel",slot:"IconContainer"})({flexShrink:0,display:"flex",paddingRight:8,[`&.${py.alternativeLabel}`]:{paddingRight:0}}),zXe=ye("span",{name:"MuiStepLabel",slot:"LabelContainer"})(jt(({theme:i})=>({width:"100%",color:(i.vars||i).palette.text.secondary,[`&.${py.alternativeLabel}`]:{textAlign:"center"}}))),WZ=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiStepLabel"}),{children:s,className:o,componentsProps:a={},error:l=!1,icon:c,optional:u,slots:d={},slotProps:h={},StepIconComponent:f,StepIconProps:p,...g}=r,{alternativeLabel:m,orientation:_}=$.useContext(f5),{active:b,disabled:y,completed:x,icon:k}=$.useContext(NW),D=c||k;let R=f;D&&!R&&(R=OXe);const E={...r,active:b,alternativeLabel:m,completed:x,disabled:y,error:l,orientation:_},A=BXe(E),M={slots:d,slotProps:{stepIcon:p,...a,...h}},[N,P]=an("root",{elementType:jXe,externalForwardedProps:{...M,...g},ownerState:E,ref:n,className:dt(A.root,o)}),[O,B]=an("label",{elementType:WXe,externalForwardedProps:M,ownerState:E}),[j,z]=an("stepIcon",{elementType:R,externalForwardedProps:M,ownerState:E});return C.jsxs(N,{...P,children:[D||j?C.jsx($Xe,{className:A.iconContainer,ownerState:E,children:C.jsx(j,{completed:x,active:b,error:l,icon:D,...z})}):null,C.jsxs(zXe,{className:A.labelContainer,ownerState:E,children:[s?C.jsx(O,{...B,className:dt(A.label,B==null?void 0:B.className),children:s}):null,u]})]})});WZ.muiName="StepLabel";function VXe(i){return Xt("MuiStepConnector",i)}Yt("MuiStepConnector",["root","horizontal","vertical","alternativeLabel","active","completed","disabled","line","lineHorizontal","lineVertical"]);const HXe=i=>{const{classes:e,orientation:n,alternativeLabel:r,active:s,completed:o,disabled:a}=i,l={root:["root",n,r&&"alternativeLabel",s&&"active",o&&"completed",a&&"disabled"],line:["line",`line${Ue(n)}`]};return Zt(l,VXe,e)},UXe=ye("div",{name:"MuiStepConnector",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.orientation],n.alternativeLabel&&e.alternativeLabel,n.completed&&e.completed]}})({flex:"1 1 auto",variants:[{props:{orientation:"vertical"},style:{marginLeft:12}},{props:{alternativeLabel:!0},style:{position:"absolute",top:12,left:"calc(-50% + 20px)",right:"calc(50% + 20px)"}}]}),qXe=ye("span",{name:"MuiStepConnector",slot:"Line",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.line,e[`line${Ue(n.orientation)}`]]}})(jt(({theme:i})=>{const e=i.palette.mode==="light"?i.palette.grey[400]:i.palette.grey[600];return{display:"block",borderColor:i.vars?i.vars.palette.StepConnector.border:e,variants:[{props:{orientation:"horizontal"},style:{borderTopStyle:"solid",borderTopWidth:1}},{props:{orientation:"vertical"},style:{borderLeftStyle:"solid",borderLeftWidth:1,minHeight:24}}]}})),KXe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiStepConnector"}),{className:s,...o}=r,{alternativeLabel:a,orientation:l="horizontal"}=$.useContext(f5),{active:c,disabled:u,completed:d}=$.useContext(NW),h={...r,alternativeLabel:a,orientation:l,active:c,completed:d,disabled:u},f=HXe(h);return C.jsx(UXe,{className:dt(f.root,s),ref:n,ownerState:h,...o,children:C.jsx(qXe,{className:f.line,ownerState:h})})});function GXe(i){return Xt("MuiStepContent",i)}Yt("MuiStepContent",["root","last","transition"]);const XXe=i=>{const{classes:e,last:n}=i;return Zt({root:["root",n&&"last"],transition:["transition"]},GXe,e)},YXe=ye("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.last&&e.last]}})(jt(({theme:i})=>({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:i.vars?`1px solid ${i.vars.palette.StepContent.border}`:`1px solid ${i.palette.mode==="light"?i.palette.grey[400]:i.palette.grey[600]}`,variants:[{props:{last:!0},style:{borderLeft:"none"}}]}))),ZXe=ye(_E,{name:"MuiStepContent",slot:"Transition"})({}),Dhe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiStepContent"}),{children:s,className:o,TransitionComponent:a=_E,transitionDuration:l="auto",TransitionProps:c,slots:u={},slotProps:d={},...h}=r,{orientation:f}=$.useContext(f5),{active:p,last:g,expanded:m}=$.useContext(NW),_={...r,last:g},b=XXe(_);let y=l;l==="auto"&&!a.muiSupportAuto&&(y=void 0);const x={slots:u,slotProps:{transition:c,...d}},[k,D]=an("transition",{elementType:ZXe,externalForwardedProps:x,ownerState:_,className:b.transition,additionalProps:{in:p||m,timeout:y,unmountOnExit:!0}});return C.jsx(YXe,{className:dt(b.root,o),ref:n,ownerState:_,...h,children:C.jsx(k,{as:a,...D,children:s})})});function QXe(i){return Xt("MuiStepper",i)}Yt("MuiStepper",["root","horizontal","vertical","nonLinear","alternativeLabel"]);const JXe=i=>{const{orientation:e,nonLinear:n,alternativeLabel:r,classes:s}=i;return Zt({root:["root",e,n&&"nonLinear",r&&"alternativeLabel"]},QXe,s)},eYe=ye("div",{name:"MuiStepper",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.orientation],n.alternativeLabel&&e.alternativeLabel,n.nonLinear&&e.nonLinear]}})({display:"flex",variants:[{props:{orientation:"horizontal"},style:{flexDirection:"row",alignItems:"center"}},{props:{orientation:"vertical"},style:{flexDirection:"column"}},{props:{alternativeLabel:!0},style:{alignItems:"flex-start"}}]}),tYe=C.jsx(KXe,{}),nYe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiStepper"}),{activeStep:s=0,alternativeLabel:o=!1,children:a,className:l,component:c="div",connector:u=tYe,nonLinear:d=!1,orientation:h="horizontal",...f}=r,p={...r,nonLinear:d,alternativeLabel:o,orientation:h,component:c},g=JXe(p),m=$.Children.toArray(a).filter(Boolean),_=m.map((y,x)=>$.cloneElement(y,{index:x,last:x+1===m.length,...y.props})),b=$.useMemo(()=>({activeStep:s,alternativeLabel:o,connector:u,nonLinear:d,orientation:h}),[s,o,u,d,h]);return C.jsx(f5.Provider,{value:b,children:C.jsx(eYe,{as:c,ownerState:p,className:dt(g.root,l),ref:n,...f,children:_})})});function iYe(i){return Xt("MuiSwitch",i)}const Hc=Yt("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),rYe=i=>{const{classes:e,edge:n,size:r,color:s,checked:o,disabled:a}=i,l={root:["root",n&&`edge${Ue(n)}`,`size${Ue(r)}`],switchBase:["switchBase",`color${Ue(s)}`,o&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},c=Zt(l,iYe,e);return{...e,...c}},sYe=ye("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.edge&&e[`edge${Ue(n.edge)}`],e[`size${Ue(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Hc.thumb}`]:{width:16,height:16},[`& .${Hc.switchBase}`]:{padding:4,[`&.${Hc.checked}`]:{transform:"translateX(16px)"}}}}]}),oYe=ye(oLe,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.switchBase,{[`& .${Hc.input}`]:e.input},n.color!=="default"&&e[`color${Ue(n.color)}`]]}})(jt(({theme:i})=>({position:"absolute",top:0,left:0,zIndex:1,color:i.vars?i.vars.palette.Switch.defaultColor:`${i.palette.mode==="light"?i.palette.common.white:i.palette.grey[300]}`,transition:i.transitions.create(["left","transform"],{duration:i.transitions.duration.shortest}),[`&.${Hc.checked}`]:{transform:"translateX(20px)"},[`&.${Hc.disabled}`]:{color:i.vars?i.vars.palette.Switch.defaultDisabledColor:`${i.palette.mode==="light"?i.palette.grey[100]:i.palette.grey[600]}`},[`&.${Hc.checked} + .${Hc.track}`]:{opacity:.5},[`&.${Hc.disabled} + .${Hc.track}`]:{opacity:i.vars?i.vars.opacity.switchTrackDisabled:`${i.palette.mode==="light"?.12:.2}`},[`& .${Hc.input}`]:{left:"-100%",width:"300%"}})),jt(({theme:i})=>({"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.activeChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette.action.active,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(i.palette).filter(br(["light"])).map(([e])=>({props:{color:e},style:{[`&.${Hc.checked}`]:{color:(i.vars||i).palette[e].main,"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette[e].mainChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette[e].main,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Hc.disabled}`]:{color:i.vars?i.vars.palette.Switch[`${e}DisabledColor`]:`${i.palette.mode==="light"?qp(i.palette[e].main,.62):$m(i.palette[e].main,.55)}`}},[`&.${Hc.checked} + .${Hc.track}`]:{backgroundColor:(i.vars||i).palette[e].main}}}))]}))),aYe=ye("span",{name:"MuiSwitch",slot:"Track"})(jt(({theme:i})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:i.transitions.create(["opacity","background-color"],{duration:i.transitions.duration.shortest}),backgroundColor:i.vars?i.vars.palette.common.onBackground:`${i.palette.mode==="light"?i.palette.common.black:i.palette.common.white}`,opacity:i.vars?i.vars.opacity.switchTrack:`${i.palette.mode==="light"?.38:.3}`}))),lYe=ye("span",{name:"MuiSwitch",slot:"Thumb"})(jt(({theme:i})=>({boxShadow:(i.vars||i).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),b9=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiSwitch"}),{className:s,color:o="primary",edge:a=!1,size:l="medium",sx:c,slots:u={},slotProps:d={},...h}=r,f={...r,color:o,edge:a,size:l},p=rYe(f),g={slots:u,slotProps:d},[m,_]=an("root",{className:dt(p.root,s),elementType:sYe,externalForwardedProps:g,ownerState:f,additionalProps:{sx:c}}),[b,y]=an("thumb",{className:p.thumb,elementType:lYe,externalForwardedProps:g,ownerState:f}),x=C.jsx(b,{...y}),[k,D]=an("track",{className:p.track,elementType:aYe,externalForwardedProps:g,ownerState:f});return C.jsxs(m,{..._,children:[C.jsx(oYe,{type:"checkbox",icon:x,checkedIcon:x,ref:n,ownerState:f,...h,classes:{...p,root:p.switchBase},slots:{...u.switchBase&&{root:u.switchBase},...u.input&&{input:u.input}},slotProps:{...d.switchBase&&{root:typeof d.switchBase=="function"?d.switchBase(f):d.switchBase},...d.input&&{input:typeof d.input=="function"?d.input(f):d.input}}}),C.jsx(k,{...D})]})});function cYe(i){return Xt("MuiTab",i)}const Hh=Yt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),uYe=i=>{const{classes:e,textColor:n,fullWidth:r,wrapped:s,icon:o,label:a,selected:l,disabled:c}=i,u={root:["root",o&&a&&"labelIcon",`textColor${Ue(n)}`,r&&"fullWidth",s&&"wrapped",l&&"selected",c&&"disabled"],icon:["iconWrapper","icon"]};return Zt(u,cYe,e)},dYe=ye(ud,{name:"MuiTab",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${Ue(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped,{[`& .${Hh.iconWrapper}`]:e.iconWrapper},{[`& .${Hh.icon}`]:e.icon}]}})(jt(({theme:i})=>({...i.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition==="top"||e.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&e.iconPosition!=="top"&&e.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="top",style:{[`& > .${Hh.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="bottom",style:{[`& > .${Hh.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="start",style:{[`& > .${Hh.icon}`]:{marginRight:i.spacing(1)}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="end",style:{[`& > .${Hh.icon}`]:{marginLeft:i.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Hh.selected}`]:{opacity:1},[`&.${Hh.disabled}`]:{opacity:(i.vars||i).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(i.vars||i).palette.text.secondary,[`&.${Hh.selected}`]:{color:(i.vars||i).palette.primary.main},[`&.${Hh.disabled}`]:{color:(i.vars||i).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(i.vars||i).palette.text.secondary,[`&.${Hh.selected}`]:{color:(i.vars||i).palette.secondary.main},[`&.${Hh.disabled}`]:{color:(i.vars||i).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:i.typography.pxToRem(12)}}]}))),mp=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTab"}),{className:s,disabled:o=!1,disableFocusRipple:a=!1,fullWidth:l,icon:c,iconPosition:u="top",indicator:d,label:h,onChange:f,onClick:p,onFocus:g,selected:m,selectionFollowsFocus:_,textColor:b="inherit",value:y,wrapped:x=!1,...k}=r,D={...r,disabled:o,disableFocusRipple:a,selected:m,icon:!!c,iconPosition:u,label:!!h,fullWidth:l,textColor:b,wrapped:x},R=uYe(D),E=c&&h&&$.isValidElement(c)?$.cloneElement(c,{className:dt(R.icon,c.props.className)}):c,A=N=>{!m&&f&&f(N,y),p&&p(N)},M=N=>{_&&!m&&f&&f(N,y),g&&g(N)};return C.jsxs(dYe,{focusRipple:!a,className:dt(R.root,s),ref:n,role:"tab","aria-selected":m,disabled:o,onClick:A,onFocus:M,ownerState:D,tabIndex:m?0:-1,...k,children:[u==="top"||u==="start"?C.jsxs($.Fragment,{children:[E,h]}):C.jsxs($.Fragment,{children:[h,E]}),d]})}),DLe=$.createContext();function hYe(i){return Xt("MuiTable",i)}Yt("MuiTable",["root","stickyHeader"]);const fYe=i=>{const{classes:e,stickyHeader:n}=i;return Zt({root:["root",n&&"stickyHeader"]},hYe,e)},pYe=ye("table",{name:"MuiTable",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.stickyHeader&&e.stickyHeader]}})(jt(({theme:i})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...i.typography.body2,padding:i.spacing(2),color:(i.vars||i).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),Ehe="table",Bv=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTable"}),{className:s,component:o=Ehe,padding:a="normal",size:l="medium",stickyHeader:c=!1,...u}=r,d={...r,component:o,padding:a,size:l,stickyHeader:c},h=fYe(d),f=$.useMemo(()=>({padding:a,size:l,stickyHeader:c}),[a,l,c]);return C.jsx(DLe.Provider,{value:f,children:C.jsx(pYe,{as:o,role:o===Ehe?null:"table",ref:n,className:dt(h.root,s),ownerState:d,...u})})}),MW=$.createContext();function gYe(i){return Xt("MuiTableBody",i)}Yt("MuiTableBody",["root"]);const mYe=i=>{const{classes:e}=i;return Zt({root:["root"]},gYe,e)},_Ye=ye("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),vYe={variant:"body"},Ihe="tbody",PW=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTableBody"}),{className:s,component:o=Ihe,...a}=r,l={...r,component:o},c=mYe(l);return C.jsx(MW.Provider,{value:vYe,children:C.jsx(_Ye,{className:dt(c.root,s),as:o,ref:n,role:o===Ihe?null:"rowgroup",ownerState:l,...a})})});function bYe(i){return Xt("MuiTableCell",i)}const yYe=Yt("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),wYe=i=>{const{classes:e,variant:n,align:r,padding:s,size:o,stickyHeader:a}=i,l={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${Ue(r)}`,s!=="normal"&&`padding${Ue(s)}`,`size${Ue(o)}`]};return Zt(l,bYe,e)},CYe=ye("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant],e[`size${Ue(n.size)}`],n.padding!=="normal"&&e[`padding${Ue(n.padding)}`],n.align!=="inherit"&&e[`align${Ue(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(jt(({theme:i})=>({...i.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:i.vars?`1px solid ${i.vars.palette.TableCell.border}`:`1px solid
${i.palette.mode==="light"?qp(Pt(i.palette.divider,1),.88):$m(Pt(i.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(i.vars||i).palette.text.primary,lineHeight:i.typography.pxToRem(24),fontWeight:i.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(i.vars||i).palette.text.primary}},{props:{variant:"footer"},style:{color:(i.vars||i).palette.text.secondary,lineHeight:i.typography.pxToRem(21),fontSize:i.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${yYe.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(i.vars||i).palette.background.default}}]}))),ki=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTableCell"}),{align:s="inherit",className:o,component:a,padding:l,scope:c,size:u,sortDirection:d,variant:h,...f}=r,p=$.useContext(DLe),g=$.useContext(MW),m=g&&g.variant==="head";let _;a?_=a:_=m?"th":"td";let b=c;_==="td"?b=void 0:!b&&m&&(b="col");const y=h||g&&g.variant,x={...r,align:s,component:_,padding:l||(p&&p.padding?p.padding:"normal"),size:u||(p&&p.size?p.size:"medium"),sortDirection:d,stickyHeader:y==="head"&&p&&p.stickyHeader,variant:y},k=wYe(x);let D=null;return d&&(D=d==="asc"?"ascending":"descending"),C.jsx(CYe,{as:_,ref:n,className:dt(k.root,o),"aria-sort":D,scope:b,ownerState:x,...f})});function SYe(i){return Xt("MuiTableContainer",i)}Yt("MuiTableContainer",["root"]);const xYe=i=>{const{classes:e}=i;return Zt({root:["root"]},SYe,e)},kYe=ye("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),LYe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTableContainer"}),{className:s,component:o="div",...a}=r,l={...r,component:o},c=xYe(l);return C.jsx(kYe,{ref:n,as:o,className:dt(c.root,s),ownerState:l,...a})});function DYe(i){return Xt("MuiTableHead",i)}Yt("MuiTableHead",["root"]);const EYe=i=>{const{classes:e}=i;return Zt({root:["root"]},DYe,e)},IYe=ye("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),TYe={variant:"head"},The="thead",OW=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTableHead"}),{className:s,component:o=The,...a}=r,l={...r,component:o},c=EYe(l);return C.jsx(MW.Provider,{value:TYe,children:C.jsx(IYe,{as:o,className:dt(c.root,s),ref:n,role:o===The?null:"rowgroup",ownerState:l,...a})})});function RYe(i){return Xt("MuiToolbar",i)}Yt("MuiToolbar",["root","gutters","regular","dense"]);const AYe=i=>{const{classes:e,disableGutters:n,variant:r}=i;return Zt({root:["root",!n&&"gutters",r]},RYe,e)},NYe=ye("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(jt(({theme:i})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:i.spacing(2),paddingRight:i.spacing(2),[i.breakpoints.up("sm")]:{paddingLeft:i.spacing(3),paddingRight:i.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:i.mixins.toolbar}]}))),ELe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiToolbar"}),{className:s,component:o="div",disableGutters:a=!1,variant:l="regular",...c}=r,u={...r,component:o,disableGutters:a,variant:l},d=AYe(u);return C.jsx(NYe,{as:o,className:dt(d.root,s),ref:n,ownerState:u,...c})}),MYe=Hr(C.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),PYe=Hr(C.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function OYe(i){return Xt("MuiTableRow",i)}const Rhe=Yt("MuiTableRow",["root","selected","hover","head","footer"]),FYe=i=>{const{classes:e,selected:n,hover:r,head:s,footer:o}=i;return Zt({root:["root",n&&"selected",r&&"hover",s&&"head",o&&"footer"]},OYe,e)},BYe=ye("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(jt(({theme:i})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Rhe.hover}:hover`]:{backgroundColor:(i.vars||i).palette.action.hover},[`&.${Rhe.selected}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity),"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:Pt(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity)}}}))),Ahe="tr",ng=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTableRow"}),{className:s,component:o=Ahe,hover:a=!1,selected:l=!1,...c}=r,u=$.useContext(MW),d={...r,component:o,hover:a,selected:l,head:u&&u.variant==="head",footer:u&&u.variant==="footer"},h=FYe(d);return C.jsx(BYe,{as:o,ref:n,className:dt(h.root,s),role:o===Ahe?null:"row",ownerState:d,...c})});function jYe(i){return(1+Math.sin(Math.PI*i-Math.PI/2))/2}function WYe(i,e,n,r={},s=()=>{}){const{ease:o=jYe,duration:a=300}=r;let l=null;const c=e[i];let u=!1;const d=()=>{u=!0},h=f=>{if(u){s(new Error("Animation cancelled"));return}l===null&&(l=f);const p=Math.min(1,(f-l)/a);if(e[i]=o(p)*(n-c)+c,p>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(h)};return c===n?(s(new Error("Element already at target position")),d):(requestAnimationFrame(h),d)}const $Ye={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function zYe(i){const{onChange:e,...n}=i,r=$.useRef(),s=$.useRef(null),o=()=>{r.current=s.current.offsetHeight-s.current.clientHeight};return wc(()=>{const a=l5(()=>{const c=r.current;o(),c!==r.current&&e(r.current)}),l=fh(s.current);return l.addEventListener("resize",a),()=>{a.clear(),l.removeEventListener("resize",a)}},[e]),$.useEffect(()=>{o(),e(r.current)},[e]),C.jsx("div",{style:$Ye,...n,ref:s})}function VYe(i){return Xt("MuiTabScrollButton",i)}const HYe=Yt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),UYe=i=>{const{classes:e,orientation:n,disabled:r}=i;return Zt({root:["root",n,r&&"disabled"]},VYe,e)},qYe=ye(ud,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.orientation&&e[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${HYe.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),KYe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTabScrollButton"}),{className:s,slots:o={},slotProps:a={},direction:l,orientation:c,disabled:u,...d}=r,h=Pv(),f={isRtl:h,...r},p=UYe(f),g=o.StartScrollButtonIcon??MYe,m=o.EndScrollButtonIcon??PYe,_=$u({elementType:g,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:f}),b=$u({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:f});return C.jsx(qYe,{component:"div",className:dt(p.root,s),ref:n,role:null,ownerState:f,tabIndex:null,...d,style:{...d.style,...c==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${h?-90:90}deg)`}},children:l==="left"?C.jsx(g,{..._}):C.jsx(m,{...b})})});function GYe(i){return Xt("MuiTabs",i)}const CU=Yt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Nhe=(i,e)=>i===e?i.firstChild:e&&e.nextElementSibling?e.nextElementSibling:i.firstChild,Mhe=(i,e)=>i===e?i.lastChild:e&&e.previousElementSibling?e.previousElementSibling:i.lastChild,k3=(i,e,n)=>{let r=!1,s=n(i,e);for(;s;){if(s===i.firstChild){if(r)return;r=!0}const o=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||o)s=n(i,s);else{s.focus();return}}},XYe=i=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:s,scrollableY:o,centered:a,scrollButtonsHideMobile:l,classes:c}=i;return Zt({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",s&&"scrollableX",o&&"scrollableY"],list:["list","flexContainer",e&&"flexContainerVertical",e&&"vertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",l&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},GYe,c)},YYe=ye("div",{name:"MuiTabs",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[{[`& .${CU.scrollButtons}`]:e.scrollButtons},{[`& .${CU.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(jt(({theme:i})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${CU.scrollButtons}`]:{[i.breakpoints.down("sm")]:{display:"none"}}}}]}))),ZYe=ye("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.scroller,n.fixed&&e.fixed,n.hideScrollbar&&e.hideScrollbar,n.scrollableX&&e.scrollableX,n.scrollableY&&e.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:i})=>i.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:i})=>i.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:i})=>i.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:i})=>i.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),QYe=ye("div",{name:"MuiTabs",slot:"List",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.list,e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})({display:"flex",variants:[{props:({ownerState:i})=>i.vertical,style:{flexDirection:"column"}},{props:({ownerState:i})=>i.centered,style:{justifyContent:"center"}}]}),JYe=ye("span",{name:"MuiTabs",slot:"Indicator"})(jt(({theme:i})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:i.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(i.vars||i).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(i.vars||i).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),eZe=ye(zYe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Phe={},ose=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTabs"}),s=$i(),o=Pv(),{"aria-label":a,"aria-labelledby":l,action:c,centered:u=!1,children:d,className:h,component:f="div",allowScrollButtonsMobile:p=!1,indicatorColor:g="primary",onChange:m,orientation:_="horizontal",ScrollButtonComponent:b,scrollButtons:y="auto",selectionFollowsFocus:x,slots:k={},slotProps:D={},TabIndicatorProps:R={},TabScrollButtonProps:E={},textColor:A="primary",value:M,variant:N="standard",visibleScrollbar:P=!1,...O}=r,B=N==="scrollable",j=_==="vertical",z=j?"scrollTop":"scrollLeft",H=j?"top":"left",Y=j?"bottom":"right",X=j?"clientHeight":"clientWidth",Q=j?"height":"width",ie={...r,component:f,allowScrollButtonsMobile:p,indicatorColor:g,orientation:_,vertical:j,scrollButtons:y,textColor:A,variant:N,visibleScrollbar:P,fixed:!B,hideScrollbar:B&&!P,scrollableX:B&&!j,scrollableY:B&&j,centered:u&&!B,scrollButtonsHideMobile:!p},K=XYe(ie),ee=$u({elementType:k.StartScrollButtonIcon,externalSlotProps:D.startScrollButtonIcon,ownerState:ie}),le=$u({elementType:k.EndScrollButtonIcon,externalSlotProps:D.endScrollButtonIcon,ownerState:ie}),[ke,xe]=$.useState(!1),[me,Ee]=$.useState(Phe),[je,qe]=$.useState(!1),[Ze,We]=$.useState(!1),[ut,st]=$.useState(!1),[mt,Rt]=$.useState({overflow:"hidden",scrollbarWidth:0}),Vt=new Map,Ot=$.useRef(null),vt=$.useRef(null),wn={slots:k,slotProps:{indicator:R,scrollButton:E,...D}},Ce=()=>{const rn=Ot.current;let sn;if(rn){const ai=rn.getBoundingClientRect();sn={clientWidth:rn.clientWidth,scrollLeft:rn.scrollLeft,scrollTop:rn.scrollTop,scrollWidth:rn.scrollWidth,top:ai.top,bottom:ai.bottom,left:ai.left,right:ai.right}}let Kn;if(rn&&M!==!1){const ai=vt.current.children;if(ai.length>0){const Ki=ai[Vt.get(M)];Kn=Ki?Ki.getBoundingClientRect():null}}return{tabsMeta:sn,tabMeta:Kn}},ge=Ha(()=>{const{tabsMeta:rn,tabMeta:sn}=Ce();let Kn=0,ai;j?(ai="top",sn&&rn&&(Kn=sn.top-rn.top+rn.scrollTop)):(ai=o?"right":"left",sn&&rn&&(Kn=(o?-1:1)*(sn[ai]-rn[ai]+rn.scrollLeft)));const Ki={[ai]:Kn,[Q]:sn?sn[Q]:0};if(typeof me[ai]!="number"||typeof me[Q]!="number")Ee(Ki);else{const so=Math.abs(me[ai]-Ki[ai]),_o=Math.abs(me[Q]-Ki[Q]);(so>=1||_o>=1)&&Ee(Ki)}}),pe=(rn,{animation:sn=!0}={})=>{sn?WYe(z,Ot.current,rn,{duration:s.transitions.duration.standard}):Ot.current[z]=rn},ne=rn=>{let sn=Ot.current[z];j?sn+=rn:sn+=rn*(o?-1:1),pe(sn)},ae=()=>{const rn=Ot.current[X];let sn=0;const Kn=Array.from(vt.current.children);for(let ai=0;ai<Kn.length;ai+=1){const Ki=Kn[ai];if(sn+Ki[X]>rn){ai===0&&(sn=rn);break}sn+=Ki[X]}return sn},ue=()=>{ne(-1*ae())},de=()=>{ne(ae())},[Se,{onChange:Ie,...nt}]=an("scrollbar",{className:dt(K.scrollableX,K.hideScrollbar),elementType:eZe,shouldForwardComponentProp:!0,externalForwardedProps:wn,ownerState:ie}),Oe=$.useCallback(rn=>{Ie==null||Ie(rn),Rt({overflow:null,scrollbarWidth:rn})},[Ie]),[Ve,gt]=an("scrollButtons",{className:dt(K.scrollButtons,E.className),elementType:KYe,externalForwardedProps:wn,ownerState:ie,additionalProps:{orientation:_,slots:{StartScrollButtonIcon:k.startScrollButtonIcon||k.StartScrollButtonIcon,EndScrollButtonIcon:k.endScrollButtonIcon||k.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:ee,endScrollButtonIcon:le}}}),$t=()=>{const rn={};rn.scrollbarSizeListener=B?C.jsx(Se,{...nt,onChange:Oe}):null;const Kn=B&&(y==="auto"&&(je||Ze)||y===!0);return rn.scrollButtonStart=Kn?C.jsx(Ve,{direction:o?"right":"left",onClick:ue,disabled:!je,...gt}):null,rn.scrollButtonEnd=Kn?C.jsx(Ve,{direction:o?"left":"right",onClick:de,disabled:!Ze,...gt}):null,rn},Mt=Ha(rn=>{const{tabsMeta:sn,tabMeta:Kn}=Ce();if(!(!Kn||!sn)){if(Kn[H]<sn[H]){const ai=sn[z]+(Kn[H]-sn[H]);pe(ai,{animation:rn})}else if(Kn[Y]>sn[Y]){const ai=sn[z]+(Kn[Y]-sn[Y]);pe(ai,{animation:rn})}}}),Bt=Ha(()=>{B&&y!==!1&&st(!ut)});$.useEffect(()=>{const rn=l5(()=>{Ot.current&&ge()});let sn;const Kn=so=>{so.forEach(_o=>{_o.removedNodes.forEach(Cs=>{sn==null||sn.unobserve(Cs)}),_o.addedNodes.forEach(Cs=>{sn==null||sn.observe(Cs)})}),rn(),Bt()},ai=fh(Ot.current);ai.addEventListener("resize",rn);let Ki;return typeof ResizeObserver<"u"&&(sn=new ResizeObserver(rn),Array.from(vt.current.children).forEach(so=>{sn.observe(so)})),typeof MutationObserver<"u"&&(Ki=new MutationObserver(Kn),Ki.observe(vt.current,{childList:!0})),()=>{rn.clear(),ai.removeEventListener("resize",rn),Ki==null||Ki.disconnect(),sn==null||sn.disconnect()}},[ge,Bt]),$.useEffect(()=>{const rn=Array.from(vt.current.children),sn=rn.length;if(typeof IntersectionObserver<"u"&&sn>0&&B&&y!==!1){const Kn=rn[0],ai=rn[sn-1],Ki={root:Ot.current,threshold:.99},so=yl=>{qe(!yl[0].isIntersecting)},_o=new IntersectionObserver(so,Ki);_o.observe(Kn);const Cs=yl=>{We(!yl[0].isIntersecting)},_u=new IntersectionObserver(Cs,Ki);return _u.observe(ai),()=>{_o.disconnect(),_u.disconnect()}}},[B,y,ut,d==null?void 0:d.length]),$.useEffect(()=>{xe(!0)},[]),$.useEffect(()=>{ge()}),$.useEffect(()=>{Mt(Phe!==me)},[Mt,me]),$.useImperativeHandle(c,()=>({updateIndicator:ge,updateScrollButtons:Bt}),[ge,Bt]);const[jn,Dt]=an("indicator",{className:dt(K.indicator,R.className),elementType:JYe,externalForwardedProps:wn,ownerState:ie,additionalProps:{style:me}}),Fn=C.jsx(jn,{...Dt});let tn=0;const pi=$.Children.map(d,rn=>{if(!$.isValidElement(rn))return null;const sn=rn.props.value===void 0?tn:rn.props.value;Vt.set(sn,tn);const Kn=sn===M;return tn+=1,$.cloneElement(rn,{fullWidth:N==="fullWidth",indicator:Kn&&!ke&&Fn,selected:Kn,selectionFollowsFocus:x,onChange:m,textColor:A,value:sn,...tn===1&&M===!1&&!rn.props.tabIndex?{tabIndex:0}:{}})}),Pi=rn=>{if(rn.altKey||rn.shiftKey||rn.ctrlKey||rn.metaKey)return;const sn=vt.current,Kn=gl(sn).activeElement;if(Kn.getAttribute("role")!=="tab")return;let Ki=_==="horizontal"?"ArrowLeft":"ArrowUp",so=_==="horizontal"?"ArrowRight":"ArrowDown";switch(_==="horizontal"&&o&&(Ki="ArrowRight",so="ArrowLeft"),rn.key){case Ki:rn.preventDefault(),k3(sn,Kn,Mhe);break;case so:rn.preventDefault(),k3(sn,Kn,Nhe);break;case"Home":rn.preventDefault(),k3(sn,null,Nhe);break;case"End":rn.preventDefault(),k3(sn,null,Mhe);break}},ti=$t(),[mi,ds]=an("root",{ref:n,className:dt(K.root,h),elementType:YYe,externalForwardedProps:{...wn,...O,component:f},ownerState:ie}),[Nr,Br]=an("scroller",{ref:Ot,className:K.scroller,elementType:ZYe,externalForwardedProps:wn,ownerState:ie,additionalProps:{style:{overflow:mt.overflow,[j?`margin${o?"Left":"Right"}`:"marginBottom"]:P?void 0:-mt.scrollbarWidth}}}),[Mn,hr]=an("list",{ref:vt,className:dt(K.list,K.flexContainer),elementType:QYe,externalForwardedProps:wn,ownerState:ie,getSlotProps:rn=>({...rn,onKeyDown:sn=>{var Kn;Pi(sn),(Kn=rn.onKeyDown)==null||Kn.call(rn,sn)}})});return C.jsxs(mi,{...ds,children:[ti.scrollButtonStart,ti.scrollbarSizeListener,C.jsxs(Nr,{...Br,children:[C.jsx(Mn,{"aria-label":a,"aria-labelledby":l,"aria-orientation":_==="vertical"?"vertical":null,role:"tablist",...hr,children:pi}),ke&&Fn]}),ti.scrollButtonEnd]})});function tZe(i){return Xt("MuiTextField",i)}Yt("MuiTextField",["root"]);const nZe={standard:Jre,filled:Zre,outlined:TI},iZe=i=>{const{classes:e}=i;return Zt({root:["root"]},tZe,e)},rZe=ye(gLe,{name:"MuiTextField",slot:"Root"})({}),Ep=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiTextField"}),{autoComplete:s,autoFocus:o=!1,children:a,className:l,color:c="primary",defaultValue:u,disabled:d=!1,error:h=!1,FormHelperTextProps:f,fullWidth:p=!1,helperText:g,id:m,InputLabelProps:_,inputProps:b,InputProps:y,inputRef:x,label:k,maxRows:D,minRows:R,multiline:E=!1,name:A,onBlur:M,onChange:N,onFocus:P,placeholder:O,required:B=!1,rows:j,select:z=!1,SelectProps:H,slots:Y={},slotProps:X={},type:Q,value:ie,variant:K="outlined",...ee}=r,le={...r,autoFocus:o,color:c,disabled:d,error:h,fullWidth:p,multiline:E,required:B,select:z,variant:K},ke=iZe(le),xe=W1(m),me=g&&xe?`${xe}-helper-text`:void 0,Ee=k&&xe?`${xe}-label`:void 0,je=nZe[K],qe={slots:Y,slotProps:{input:y,inputLabel:_,htmlInput:b,formHelperText:f,select:H,...X}},Ze={},We=qe.slotProps.inputLabel;K==="outlined"&&(We&&typeof We.shrink<"u"&&(Ze.notched=We.shrink),Ze.label=k),z&&((!H||!H.native)&&(Ze.id=void 0),Ze["aria-describedby"]=void 0);const[ut,st]=an("root",{elementType:rZe,shouldForwardComponentProp:!0,externalForwardedProps:{...qe,...ee},ownerState:le,className:dt(ke.root,l),ref:n,additionalProps:{disabled:d,error:h,fullWidth:p,required:B,color:c,variant:K}}),[mt,Rt]=an("input",{elementType:je,externalForwardedProps:qe,additionalProps:Ze,ownerState:le}),[Vt,Ot]=an("inputLabel",{elementType:RW,externalForwardedProps:qe,ownerState:le}),[vt,wn]=an("htmlInput",{elementType:"input",externalForwardedProps:qe,ownerState:le}),[Ce,ge]=an("formHelperText",{elementType:Gqe,externalForwardedProps:qe,ownerState:le}),[pe,ne]=an("select",{elementType:sse,externalForwardedProps:qe,ownerState:le}),ae=C.jsx(mt,{"aria-describedby":me,autoComplete:s,autoFocus:o,defaultValue:u,fullWidth:p,multiline:E,name:A,rows:j,maxRows:D,minRows:R,type:Q,value:ie,id:xe,inputRef:x,onBlur:M,onChange:N,onFocus:P,placeholder:O,inputProps:wn,slots:{input:Y.htmlInput?vt:void 0},...Rt});return C.jsxs(ut,{...st,children:[k!=null&&k!==""&&C.jsx(Vt,{htmlFor:xe,id:Ee,...Ot,children:k}),z?C.jsx(pe,{"aria-describedby":me,id:xe,labelId:Ee,value:ie,input:ae,...ne,children:a}):ae,g&&C.jsx(Ce,{id:me,...ge,children:g})]})});function sZe(i){return Xt("MuiToggleButton",i)}const cS=Yt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),ILe=$.createContext({}),TLe=$.createContext(void 0);function oZe(i,e){return e===void 0||i===void 0?!1:Array.isArray(e)?e.includes(i):i===e}const aZe=i=>{const{classes:e,fullWidth:n,selected:r,disabled:s,size:o,color:a}=i,l={root:["root",r&&"selected",s&&"disabled",n&&"fullWidth",`size${Ue(o)}`,a]};return Zt(l,sZe,e)},lZe=ye(ud,{name:"MuiToggleButton",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[`size${Ue(n.size)}`]]}})(jt(({theme:i})=>({...i.typography.button,borderRadius:(i.vars||i).shape.borderRadius,padding:11,border:`1px solid ${(i.vars||i).palette.divider}`,color:(i.vars||i).palette.action.active,[`&.${cS.disabled}`]:{color:(i.vars||i).palette.action.disabled,border:`1px solid ${(i.vars||i).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:i.vars?`rgba(${i.vars.palette.text.primaryChannel} / ${i.vars.palette.action.hoverOpacity})`:Pt(i.palette.text.primary,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${cS.selected}`]:{color:(i.vars||i).palette.text.primary,backgroundColor:i.vars?`rgba(${i.vars.palette.text.primaryChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette.text.primary,i.palette.action.selectedOpacity),"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.text.primaryChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:Pt(i.palette.text.primary,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:i.vars?`rgba(${i.vars.palette.text.primaryChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette.text.primary,i.palette.action.selectedOpacity)}}}}},...Object.entries(i.palette).filter(br()).map(([e])=>({props:{color:e},style:{[`&.${cS.selected}`]:{color:(i.vars||i).palette[e].main,backgroundColor:i.vars?`rgba(${i.vars.palette[e].mainChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette[e].main,i.palette.action.selectedOpacity),"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette[e].mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:Pt(i.palette[e].main,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:i.vars?`rgba(${i.vars.palette[e].mainChannel} / ${i.vars.palette.action.selectedOpacity})`:Pt(i.palette[e].main,i.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:i.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:i.typography.pxToRem(15)}}]}))),cZe=$.forwardRef(function(e,n){const{value:r,...s}=$.useContext(ILe),o=$.useContext(TLe),a=mE({...s,selected:oZe(e.value,r)},e),l=Qt({props:a,name:"MuiToggleButton"}),{children:c,className:u,color:d="standard",disabled:h=!1,disableFocusRipple:f=!1,fullWidth:p=!1,onChange:g,onClick:m,selected:_,size:b="medium",value:y,...x}=l,k={...l,color:d,disabled:h,disableFocusRipple:f,fullWidth:p,size:b},D=aZe(k),R=A=>{m&&(m(A,y),A.defaultPrevented)||g&&g(A,y)},E=o||"";return C.jsx(lZe,{className:dt(s.className,D.root,u,E),disabled:h,focusRipple:!f,ref:n,onClick:R,onChange:g,value:y,ownerState:k,"aria-pressed":_,...x,children:c})});function uZe(i){return Xt("MuiToggleButtonGroup",i)}const Ys=Yt("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),dZe=i=>{const{classes:e,orientation:n,fullWidth:r,disabled:s}=i,o={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${Ue(n)}`,s&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Zt(o,uZe,e)},hZe=ye("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[{[`& .${Ys.grouped}`]:e.grouped},{[`& .${Ys.grouped}`]:e[`grouped${Ue(n.orientation)}`]},{[`& .${Ys.firstButton}`]:e.firstButton},{[`& .${Ys.lastButton}`]:e.lastButton},{[`& .${Ys.middleButton}`]:e.middleButton},e.root,n.orientation==="vertical"&&e.vertical,n.fullWidth&&e.fullWidth]}})(jt(({theme:i})=>({display:"inline-flex",borderRadius:(i.vars||i).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${Ys.grouped}`]:{[`&.${Ys.selected} + .${Ys.grouped}.${Ys.selected}`]:{borderTop:0,marginTop:0}},[`& .${Ys.firstButton},& .${Ys.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Ys.lastButton},& .${Ys.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Ys.lastButton}.${cS.disabled},& .${Ys.middleButton}.${cS.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${Ys.grouped}`]:{[`&.${Ys.selected} + .${Ys.grouped}.${Ys.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Ys.firstButton},& .${Ys.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Ys.lastButton},& .${Ys.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Ys.lastButton}.${cS.disabled},& .${Ys.middleButton}.${cS.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),fZe=$.forwardRef(function(e,n){const r=Qt({props:e,name:"MuiToggleButtonGroup"}),{children:s,className:o,color:a="standard",disabled:l=!1,exclusive:c=!1,fullWidth:u=!1,onChange:d,orientation:h="horizontal",size:f="medium",value:p,...g}=r,m={...r,disabled:l,fullWidth:u,orientation:h,size:f},_=dZe(m),b=$.useCallback((E,A)=>{if(!d)return;const M=p&&p.indexOf(A);let N;p&&M>=0?(N=p.slice(),N.splice(M,1)):N=p?p.concat(A):[A],d(E,N)},[d,p]),y=$.useCallback((E,A)=>{d&&d(E,p===A?null:A)},[d,p]),x=$.useMemo(()=>({className:_.grouped,onChange:c?y:b,value:p,size:f,fullWidth:u,color:a,disabled:l}),[_.grouped,c,y,b,p,f,u,a,l]),k=sLe(s),D=k.length,R=E=>{const A=E===0,M=E===D-1;return A&&M?"":A?_.firstButton:M?_.lastButton:_.middleButton};return C.jsx(hZe,{role:"group",className:dt(_.root,o),ref:n,ownerState:m,...g,children:C.jsx(ILe.Provider,{value:x,children:k.map((E,A)=>C.jsx(TLe.Provider,{value:R(A),children:E},A))})})}),FW=yke({themeId:Bp});var L3={},Ohe;function pZe(){if(Ohe)return L3;Ohe=1;var i=Pke();return L3.createRoot=i.createRoot,L3.hydrateRoot=i.hydrateRoot,L3}var gZe=pZe();const mZe=ql(gZe);/**
* @remix-run/router v1.23.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function YM(){return YM=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},YM.apply(this,arguments)}var uS;(function(i){i.Pop="POP",i.Push="PUSH",i.Replace="REPLACE"})(uS||(uS={}));const Fhe="popstate";function _Ze(i){i===void 0&&(i={});function e(s,o){let{pathname:a="/",search:l="",hash:c=""}=RI(s.location.hash.substr(1));return!a.startsWith("/")&&!a.startsWith(".")&&(a="/"+a),$Z("",{pathname:a,search:l,hash:c},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(s,o){let a=s.document.querySelector("base"),l="";if(a&&a.getAttribute("href")){let c=s.location.href,u=c.indexOf("#");l=u===-1?c:c.slice(0,u)}return l+"#"+(typeof o=="string"?o:y9(o))}function r(s,o){ase(s.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(o)+")")}return bZe(e,n,r,i)}function yc(i,e){if(i===!1||i===null||typeof i>"u")throw new Error(e)}function ase(i,e){if(!i){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function vZe(){return Math.random().toString(36).substr(2,8)}function Bhe(i,e){return{usr:i.state,key:i.key,idx:e}}function $Z(i,e,n,r){return n===void 0&&(n=null),YM({pathname:typeof i=="string"?i:i.pathname,search:"",hash:""},typeof e=="string"?RI(e):e,{state:n,key:e&&e.key||r||vZe()})}function y9(i){let{pathname:e="/",search:n="",hash:r=""}=i;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function RI(i){let e={};if(i){let n=i.indexOf("#");n>=0&&(e.hash=i.substr(n),i=i.substr(0,n));let r=i.indexOf("?");r>=0&&(e.search=i.substr(r),i=i.substr(0,r)),i&&(e.pathname=i)}return e}function bZe(i,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,a=s.history,l=uS.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(YM({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function h(){l=uS.Pop;let _=d(),b=_==null?null:_-u;u=_,c&&c({action:l,location:m.location,delta:b})}function f(_,b){l=uS.Push;let y=$Z(m.location,_,b);n&&n(y,_),u=d()+1;let x=Bhe(y,u),k=m.createHref(y);try{a.pushState(x,"",k)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(k)}o&&c&&c({action:l,location:m.location,delta:1})}function p(_,b){l=uS.Replace;let y=$Z(m.location,_,b);n&&n(y,_),u=d();let x=Bhe(y,u),k=m.createHref(y);a.replaceState(x,"",k),o&&c&&c({action:l,location:m.location,delta:0})}function g(_){let b=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof _=="string"?_:y9(_);return y=y.replace(/ $/,"%20"),yc(b,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,b)}let m={get action(){return l},get location(){return i(s,a)},listen(_){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Fhe,h),c=_,()=>{s.removeEventListener(Fhe,h),c=null}},createHref(_){return e(s,_)},createURL:g,encodeLocation(_){let b=g(_);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:p,go(_){return a.go(_)}};return m}var jhe;(function(i){i.data="data",i.deferred="deferred",i.redirect="redirect",i.error="error"})(jhe||(jhe={}));function yZe(i,e,n){return n===void 0&&(n="/"),wZe(i,e,n)}function wZe(i,e,n,r){let s=typeof e=="string"?RI(e):e,o=lse(s.pathname||"/",n);if(o==null)return null;let a=RLe(i);CZe(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let u=MZe(o);l=RZe(a[c],u)}return l}function RLe(i,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(o,a,l)=>{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};c.relativePath.startsWith("/")&&(yc(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Oy([r,c.relativePath]),d=n.concat(c);o.children&&o.children.length>0&&(yc(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),RLe(o.children,e,d,u)),!(o.path==null&&!o.index)&&e.push({path:u,score:IZe(u,o.index),routesMeta:d})};return i.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,a);else for(let c of ALe(o.path))s(o,a,c)}),e}function ALe(i){let e=i.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let a=ALe(r.join("/")),l=[];return l.push(...a.map(c=>c===""?o:[o,c].join("/"))),s&&l.push(...a),l.map(c=>i.startsWith("/")&&c===""?"/":c)}function CZe(i){i.sort((e,n)=>e.score!==n.score?n.score-e.score:TZe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const SZe=/^:[\w-]+$/,xZe=3,kZe=2,LZe=1,DZe=10,EZe=-2,Whe=i=>i==="*";function IZe(i,e){let n=i.split("/"),r=n.length;return n.some(Whe)&&(r+=EZe),e&&(r+=kZe),n.filter(s=>!Whe(s)).reduce((s,o)=>s+(SZe.test(o)?xZe:o===""?LZe:DZe),r)}function TZe(i,e){return i.length===e.length&&i.slice(0,-1).every((r,s)=>r===e[s])?i[i.length-1]-e[e.length-1]:0}function RZe(i,e,n){let{routesMeta:r}=i,s={},o="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=o==="/"?e:e.slice(o.length)||"/",h=AZe({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),f=c.route;if(!h)return null;Object.assign(s,h.params),a.push({params:s,pathname:Oy([o,h.pathname]),pathnameBase:BZe(Oy([o,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(o=Oy([o,h.pathnameBase]))}return a}function AZe(i,e){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[n,r]=NZe(i.path,i.caseSensitive,i.end),s=e.match(n);if(!s)return null;let o=s[0],a=o.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,d,h)=>{let{paramName:f,isOptional:p}=d;if(f==="*"){let m=l[h]||"";a=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const g=l[h];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:a,pattern:i}}function NZe(i,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),ase(i==="*"||!i.endsWith("*")||i.endsWith("/*"),'Route path "'+i+'" will be treated as if it were '+('"'+i.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+i.replace(/\*$/,"/*")+'".'));let r=[],s="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return i.endsWith("*")?(r.push({paramName:"*"}),s+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":i!==""&&i!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function MZe(i){try{return i.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ase(!1,'The URL path "'+i+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),i}}function lse(i,e){if(e==="/")return i;if(!i.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=i.charAt(n);return r&&r!=="/"?null:i.slice(n)||"/"}function PZe(i,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof i=="string"?RI(i):i;return{pathname:n?n.startsWith("/")?n:OZe(n,e):e,search:jZe(r),hash:WZe(s)}}function OZe(i,e){let n=e.replace(/\/+$/,"").split("/");return i.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function SU(i,e,n,r){return"Cannot include a '"+i+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function FZe(i){return i.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function NLe(i,e){let n=FZe(i);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function MLe(i,e,n,r){r===void 0&&(r=!1);let s;typeof i=="string"?s=RI(i):(s=YM({},i),yc(!s.pathname||!s.pathname.includes("?"),SU("?","pathname","search",s)),yc(!s.pathname||!s.pathname.includes("#"),SU("#","pathname","hash",s)),yc(!s.search||!s.search.includes("#"),SU("#","search","hash",s)));let o=i===""||s.pathname==="",a=o?"/":s.pathname,l;if(a==null)l=n;else{let h=e.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),h-=1;s.pathname=f.join("/")}l=h>=0?e[h]:"/"}let c=PZe(s,l),u=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Oy=i=>i.join("/").replace(/\/\/+/g,"/"),BZe=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),jZe=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,WZe=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i;function $Ze(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}const PLe=["post","put","patch","delete"];new Set(PLe);const zZe=["get",...PLe];new Set(zZe);/**
* React Router v6.30.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function w9(){return w9=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},w9.apply(this,arguments)}const cse=$.createContext(null),VZe=$.createContext(null),qx=$.createContext(null),use=$.createContext(null),jv=$.createContext({outlet:null,matches:[],isDataRoute:!1}),OLe=$.createContext(null);function HZe(i,e){let{relative:n}=e===void 0?{}:e;p5()||yc(!1);let{basename:r,navigator:s}=$.useContext(qx),{hash:o,pathname:a,search:l}=BLe(i,{relative:n}),c=a;return r!=="/"&&(c=a==="/"?r:Oy([r,a])),s.createHref({pathname:c,search:l,hash:o})}function p5(){return $.useContext(use)!=null}function Wv(){return p5()||yc(!1),$.useContext(use).location}function FLe(i){$.useContext(qx).static||$.useLayoutEffect(i)}function z1(){let{isDataRoute:i}=$.useContext(jv);return i?sQe():UZe()}function UZe(){p5()||yc(!1);let i=$.useContext(cse),{basename:e,future:n,navigator:r}=$.useContext(qx),{matches:s}=$.useContext(jv),{pathname:o}=Wv(),a=JSON.stringify(NLe(s,n.v7_relativeSplatPath)),l=$.useRef(!1);return FLe(()=>{l.current=!0}),$.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let h=MLe(u,JSON.parse(a),o,d.relative==="path");i==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Oy([e,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[e,r,a,o,i])}const qZe=$.createContext(null);function KZe(i){let e=$.useContext(jv).outlet;return e&&$.createElement(qZe.Provider,{value:i},e)}function V1(){let{matches:i}=$.useContext(jv),e=i[i.length-1];return e?e.params:{}}function BLe(i,e){let{relative:n}=e===void 0?{}:e,{future:r}=$.useContext(qx),{matches:s}=$.useContext(jv),{pathname:o}=Wv(),a=JSON.stringify(NLe(s,r.v7_relativeSplatPath));return $.useMemo(()=>MLe(i,JSON.parse(a),o,n==="path"),[i,a,o,n])}function GZe(i,e){return XZe(i)}function XZe(i,e,n,r){p5()||yc(!1);let{navigator:s}=$.useContext(qx),{matches:o}=$.useContext(jv),a=o[o.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=Wv(),d;d=u;let h=d.pathname||"/",f=h;if(c!=="/"){let m=c.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(m.length).join("/")}let p=yZe(i,{pathname:f});return eQe(p&&p.map(m=>Object.assign({},m,{params:Object.assign({},l,m.params),pathname:Oy([c,s.encodeLocation?s.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?c:Oy([c,s.encodeLocation?s.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n,r)}function YZe(){let i=rQe(),e=$Ze(i)?i.status+" "+i.statusText:i instanceof Error?i.message:JSON.stringify(i),n=i instanceof Error?i.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return $.createElement($.Fragment,null,$.createElement("h2",null,"Unexpected Application Error!"),$.createElement("h3",{style:{fontStyle:"italic"}},e),n?$.createElement("pre",{style:s},n):null,null)}const ZZe=$.createElement(YZe,null);class QZe extends $.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?$.createElement(jv.Provider,{value:this.props.routeContext},$.createElement(OLe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function JZe(i){let{routeContext:e,match:n,children:r}=i,s=$.useContext(cse);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),$.createElement(jv.Provider,{value:e},r)}function eQe(i,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),i==null){var o;if(!n)return null;if(n.errors)i=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)i=n.matches;else return null}let a=i,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=a.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||yc(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<a.length;d++){let h=a[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:p}=n,g=h.route.loader&&f[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||g){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,h,f)=>{let p,g=!1,m=null,_=null;n&&(p=l&&h.route.id?l[h.route.id]:void 0,m=h.route.errorElement||ZZe,c&&(u<0&&f===0?(oQe("route-fallback"),g=!0,_=null):u===f&&(g=!0,_=h.route.hydrateFallbackElement||null)));let b=e.concat(a.slice(0,f+1)),y=()=>{let x;return p?x=m:g?x=_:h.route.Component?x=$.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=d,$.createElement(JZe,{match:h,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:x})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?$.createElement(QZe,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:y(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):y()},null)}var jLe=function(i){return i.UseBlocker="useBlocker",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i}(jLe||{}),WLe=function(i){return i.UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i}(WLe||{});function tQe(i){let e=$.useContext(cse);return e||yc(!1),e}function nQe(i){let e=$.useContext(VZe);return e||yc(!1),e}function iQe(i){let e=$.useContext(jv);return e||yc(!1),e}function $Le(i){let e=iQe(),n=e.matches[e.matches.length-1];return n.route.id||yc(!1),n.route.id}function rQe(){var i;let e=$.useContext(OLe),n=nQe(),r=$Le();return e!==void 0?e:(i=n.errors)==null?void 0:i[r]}function sQe(){let{router:i}=tQe(jLe.UseNavigateStable),e=$Le(WLe.UseNavigateStable),n=$.useRef(!1);return FLe(()=>{n.current=!0}),$.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?i.navigate(s):i.navigate(s,w9({fromRouteId:e},o)))},[i,e])}const $he={};function oQe(i,e,n){$he[i]||($he[i]=!0)}function aQe(i,e){i==null||i.v7_startTransition,i==null||i.v7_relativeSplatPath}function lQe(i){return KZe(i.context)}function cQe(i){let{basename:e="/",children:n=null,location:r,navigationType:s=uS.Pop,navigator:o,static:a=!1,future:l}=i;p5()&&yc(!1);let c=e.replace(/^\/*/,"/"),u=$.useMemo(()=>({basename:c,navigator:o,static:a,future:w9({v7_relativeSplatPath:!1},l)}),[c,l,o,a]);typeof r=="string"&&(r=RI(r));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:g="default"}=r,m=$.useMemo(()=>{let _=lse(d,c);return _==null?null:{location:{pathname:_,search:h,hash:f,state:p,key:g},navigationType:s}},[c,d,h,f,p,g,s]);return m==null?null:$.createElement(qx.Provider,{value:u},$.createElement(use.Provider,{children:n,value:m}))}new Promise(()=>{});/**
* React Router DOM v6.30.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function zZ(){return zZ=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},zZ.apply(this,arguments)}function uQe(i,e){if(i==null)return{};var n={},r=Object.keys(i),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(n[s]=i[s]);return n}function dQe(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function hQe(i,e){return i.button===0&&(!e||e==="_self")&&!dQe(i)}const fQe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],pQe="6";try{window.__reactRouterVersion=pQe}catch{}const gQe="startTransition",zhe=ZS[gQe];function mQe(i){let{basename:e,children:n,future:r,window:s}=i,o=$.useRef();o.current==null&&(o.current=_Ze({window:s,v5Compat:!0}));let a=o.current,[l,c]=$.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},d=$.useCallback(h=>{u&&zhe?zhe(()=>c(h)):c(h)},[c,u]);return $.useLayoutEffect(()=>a.listen(d),[a,d]),$.useEffect(()=>aQe(r),[r]),$.createElement(cQe,{basename:e,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}const _Qe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vQe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lh=$.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:o,replace:a,state:l,target:c,to:u,preventScrollReset:d,viewTransition:h}=e,f=uQe(e,fQe),{basename:p}=$.useContext(qx),g,m=!1;if(typeof u=="string"&&vQe.test(u)&&(g=u,_Qe))try{let x=new URL(window.location.href),k=u.startsWith("//")?new URL(x.protocol+u):new URL(u),D=lse(k.pathname,p);k.origin===x.origin&&D!=null?u=D+k.search+k.hash:m=!0}catch{}let _=HZe(u,{relative:s}),b=bQe(u,{replace:a,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:h});function y(x){r&&r(x),x.defaultPrevented||b(x)}return $.createElement("a",zZ({},f,{href:g||_,onClick:m||o?r:y,ref:n,target:c}))});var Vhe;(function(i){i.UseScrollRestoration="useScrollRestoration",i.UseSubmit="useSubmit",i.UseSubmitFetcher="useSubmitFetcher",i.UseFetcher="useFetcher",i.useViewTransitionState="useViewTransitionState"})(Vhe||(Vhe={}));var Hhe;(function(i){i.UseFetcher="useFetcher",i.UseFetchers="useFetchers",i.UseScrollRestoration="useScrollRestoration"})(Hhe||(Hhe={}));function bQe(i,e){let{target:n,replace:r,state:s,preventScrollReset:o,relative:a,viewTransition:l}=e===void 0?{}:e,c=z1(),u=Wv(),d=BLe(i,{relative:a});return $.useCallback(h=>{if(hQe(h,n)){h.preventDefault();let f=r!==void 0?r:y9(u)===y9(d);c(i,{replace:f,state:s,preventScrollReset:o,relative:a,viewTransition:l})}},[u,c,d,r,s,n,i,o,a,l])}const zLe=Hr(C.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),VLe=Hr(C.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function HLe(i,e){return function(){return i.apply(e,arguments)}}const{toString:yQe}=Object.prototype,{getPrototypeOf:dse}=Object,{iterator:BW,toStringTag:ULe}=Symbol,jW=(i=>e=>{const n=yQe.call(e);return i[n]||(i[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ig=i=>(i=i.toLowerCase(),e=>jW(e)===i),WW=i=>e=>typeof e===i,{isArray:AI}=Array,xE=WW("undefined");function g5(i){return i!==null&&!xE(i)&&i.constructor!==null&&!xE(i.constructor)&&rd(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const qLe=ig("ArrayBuffer");function wQe(i){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(i):e=i&&i.buffer&&qLe(i.buffer),e}const CQe=WW("string"),rd=WW("function"),KLe=WW("number"),m5=i=>i!==null&&typeof i=="object",SQe=i=>i===!0||i===!1,QB=i=>{if(jW(i)!=="object")return!1;const e=dse(i);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ULe in i)&&!(BW in i)},xQe=i=>{if(!m5(i)||g5(i))return!1;try{return Object.keys(i).length===0&&Object.getPrototypeOf(i)===Object.prototype}catch{return!1}},kQe=ig("Date"),LQe=ig("File"),DQe=ig("Blob"),EQe=ig("FileList"),IQe=i=>m5(i)&&rd(i.pipe),TQe=i=>{let e;return i&&(typeof FormData=="function"&&i instanceof FormData||rd(i.append)&&((e=jW(i))==="formdata"||e==="object"&&rd(i.toString)&&i.toString()==="[object FormData]"))},RQe=ig("URLSearchParams"),[AQe,NQe,MQe,PQe]=["ReadableStream","Request","Response","Headers"].map(ig),OQe=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _5(i,e,{allOwnKeys:n=!1}={}){if(i===null||typeof i>"u")return;let r,s;if(typeof i!="object"&&(i=[i]),AI(i))for(r=0,s=i.length;r<s;r++)e.call(null,i[r],r,i);else{if(g5(i))return;const o=n?Object.getOwnPropertyNames(i):Object.keys(i),a=o.length;let l;for(r=0;r<a;r++)l=o[r],e.call(null,i[l],l,i)}}function GLe(i,e){if(g5(i))return null;e=e.toLowerCase();const n=Object.keys(i);let r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}const dS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,XLe=i=>!xE(i)&&i!==dS;function VZ(){const{caseless:i,skipUndefined:e}=XLe(this)&&this||{},n={},r=(s,o)=>{const a=i&&GLe(n,o)||o;QB(n[a])&&QB(s)?n[a]=VZ(n[a],s):QB(s)?n[a]=VZ({},s):AI(s)?n[a]=s.slice():(!e||!xE(s))&&(n[a]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&_5(arguments[s],r);return n}const FQe=(i,e,n,{allOwnKeys:r}={})=>(_5(e,(s,o)=>{n&&rd(s)?i[o]=HLe(s,n):i[o]=s},{allOwnKeys:r}),i),BQe=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),jQe=(i,e,n,r)=>{i.prototype=Object.create(e.prototype,r),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:e.prototype}),n&&Object.assign(i.prototype,n)},WQe=(i,e,n,r)=>{let s,o,a;const l={};if(e=e||{},i==null)return e;do{for(s=Object.getOwnPropertyNames(i),o=s.length;o-- >0;)a=s[o],(!r||r(a,i,e))&&!l[a]&&(e[a]=i[a],l[a]=!0);i=n!==!1&&dse(i)}while(i&&(!n||n(i,e))&&i!==Object.prototype);return e},$Qe=(i,e,n)=>{i=String(i),(n===void 0||n>i.length)&&(n=i.length),n-=e.length;const r=i.indexOf(e,n);return r!==-1&&r===n},zQe=i=>{if(!i)return null;if(AI(i))return i;let e=i.length;if(!KLe(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=i[e];return n},VQe=(i=>e=>i&&e instanceof i)(typeof Uint8Array<"u"&&dse(Uint8Array)),HQe=(i,e)=>{const r=(i&&i[BW]).call(i);let s;for(;(s=r.next())&&!s.done;){const o=s.value;e.call(i,o[0],o[1])}},UQe=(i,e)=>{let n;const r=[];for(;(n=i.exec(e))!==null;)r.push(n);return r},qQe=ig("HTMLFormElement"),KQe=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Uhe=(({hasOwnProperty:i})=>(e,n)=>i.call(e,n))(Object.prototype),GQe=ig("RegExp"),YLe=(i,e)=>{const n=Object.getOwnPropertyDescriptors(i),r={};_5(n,(s,o)=>{let a;(a=e(s,o,i))!==!1&&(r[o]=a||s)}),Object.defineProperties(i,r)},XQe=i=>{YLe(i,(e,n)=>{if(rd(i)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=i[n];if(rd(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},YQe=(i,e)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return AI(i)?r(i):r(String(i).split(e)),n},ZQe=()=>{},QQe=(i,e)=>i!=null&&Number.isFinite(i=+i)?i:e;function JQe(i){return!!(i&&rd(i.append)&&i[ULe]==="FormData"&&i[BW])}const eJe=i=>{const e=new Array(10),n=(r,s)=>{if(m5(r)){if(e.indexOf(r)>=0)return;if(g5(r))return r;if(!("toJSON"in r)){e[s]=r;const o=AI(r)?[]:{};return _5(r,(a,l)=>{const c=n(a,s+1);!xE(c)&&(o[l]=c)}),e[s]=void 0,o}}return r};return n(i,0)},tJe=ig("AsyncFunction"),nJe=i=>i&&(m5(i)||rd(i))&&rd(i.then)&&rd(i.catch),ZLe=((i,e)=>i?setImmediate:e?((n,r)=>(dS.addEventListener("message",({source:s,data:o})=>{s===dS&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),dS.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",rd(dS.postMessage)),iJe=typeof queueMicrotask<"u"?queueMicrotask.bind(dS):typeof process<"u"&&process.nextTick||ZLe,rJe=i=>i!=null&&rd(i[BW]),at={isArray:AI,isArrayBuffer:qLe,isBuffer:g5,isFormData:TQe,isArrayBufferView:wQe,isString:CQe,isNumber:KLe,isBoolean:SQe,isObject:m5,isPlainObject:QB,isEmptyObject:xQe,isReadableStream:AQe,isRequest:NQe,isResponse:MQe,isHeaders:PQe,isUndefined:xE,isDate:kQe,isFile:LQe,isBlob:DQe,isRegExp:GQe,isFunction:rd,isStream:IQe,isURLSearchParams:RQe,isTypedArray:VQe,isFileList:EQe,forEach:_5,merge:VZ,extend:FQe,trim:OQe,stripBOM:BQe,inherits:jQe,toFlatObject:WQe,kindOf:jW,kindOfTest:ig,endsWith:$Qe,toArray:zQe,forEachEntry:HQe,matchAll:UQe,isHTMLForm:qQe,hasOwnProperty:Uhe,hasOwnProp:Uhe,reduceDescriptors:YLe,freezeMethods:XQe,toObjectSet:YQe,toCamelCase:KQe,noop:ZQe,toFiniteNumber:QQe,findKey:GLe,global:dS,isContextDefined:XLe,isSpecCompliantForm:JQe,toJSONObject:eJe,isAsyncFn:tJe,isThenable:nJe,setImmediate:ZLe,asap:iJe,isIterable:rJe};function Ni(i,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}at.inherits(Ni,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:at.toJSONObject(this.config),code:this.code,status:this.status}}});const QLe=Ni.prototype,JLe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{JLe[i]={value:i}});Object.defineProperties(Ni,JLe);Object.defineProperty(QLe,"isAxiosError",{value:!0});Ni.from=(i,e,n,r,s,o)=>{const a=Object.create(QLe);at.toFlatObject(i,a,function(d){return d!==Error.prototype},u=>u!=="isAxiosError");const l=i&&i.message?i.message:"Error",c=e==null&&i?i.code:e;return Ni.call(a,l,c,n,r,s),i&&a.cause==null&&Object.defineProperty(a,"cause",{value:i,configurable:!0}),a.name=i&&i.name||"Error",o&&Object.assign(a,o),a};const sJe=null;function HZ(i){return at.isPlainObject(i)||at.isArray(i)}function eDe(i){return at.endsWith(i,"[]")?i.slice(0,-2):i}function qhe(i,e,n){return i?i.concat(e).map(function(s,o){return s=eDe(s),!n&&o?"["+s+"]":s}).join(n?".":""):e}function oJe(i){return at.isArray(i)&&!i.some(HZ)}const aJe=at.toFlatObject(at,{},null,function(e){return/^is[A-Z]/.test(e)});function $W(i,e,n){if(!at.isObject(i))throw new TypeError("target must be an object");e=e||new FormData,n=at.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,_){return!at.isUndefined(_[m])});const r=n.metaTokens,s=n.visitor||d,o=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&at.isSpecCompliantForm(e);if(!at.isFunction(s))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(at.isDate(g))return g.toISOString();if(at.isBoolean(g))return g.toString();if(!c&&at.isBlob(g))throw new Ni("Blob is not supported. Use a Buffer instead.");return at.isArrayBuffer(g)||at.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,_){let b=g;if(g&&!_&&typeof g=="object"){if(at.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(at.isArray(g)&&oJe(g)||(at.isFileList(g)||at.endsWith(m,"[]"))&&(b=at.toArray(g)))return m=eDe(m),b.forEach(function(x,k){!(at.isUndefined(x)||x===null)&&e.append(a===!0?qhe([m],k,o):a===null?m:m+"[]",u(x))}),!1}return HZ(g)?!0:(e.append(qhe(_,m,o),u(g)),!1)}const h=[],f=Object.assign(aJe,{defaultVisitor:d,convertValue:u,isVisitable:HZ});function p(g,m){if(!at.isUndefined(g)){if(h.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));h.push(g),at.forEach(g,function(b,y){(!(at.isUndefined(b)||b===null)&&s.call(e,b,at.isString(y)?y.trim():y,m,f))===!0&&p(b,m?m.concat(y):[y])}),h.pop()}}if(!at.isObject(i))throw new TypeError("data must be an object");return p(i),e}function Khe(i){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function hse(i,e){this._pairs=[],i&&$W(i,this,e)}const tDe=hse.prototype;tDe.append=function(e,n){this._pairs.push([e,n])};tDe.toString=function(e){const n=e?function(r){return e.call(this,r,Khe)}:Khe;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function lJe(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nDe(i,e,n){if(!e)return i;const r=n&&n.encode||lJe;at.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(e,n):o=at.isURLSearchParams(e)?e.toString():new hse(e,n).toString(r),o){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+o}return i}class Ghe{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){at.forEach(this.handlers,function(r){r!==null&&e(r)})}}const iDe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},cJe=typeof URLSearchParams<"u"?URLSearchParams:hse,uJe=typeof FormData<"u"?FormData:null,dJe=typeof Blob<"u"?Blob:null,hJe={isBrowser:!0,classes:{URLSearchParams:cJe,FormData:uJe,Blob:dJe},protocols:["http","https","file","blob","url","data"]},fse=typeof window<"u"&&typeof document<"u",UZ=typeof navigator=="object"&&navigator||void 0,fJe=fse&&(!UZ||["ReactNative","NativeScript","NS"].indexOf(UZ.product)<0),pJe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",gJe=fse&&window.location.href||"http://localhost",mJe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fse,hasStandardBrowserEnv:fJe,hasStandardBrowserWebWorkerEnv:pJe,navigator:UZ,origin:gJe},Symbol.toStringTag,{value:"Module"})),mc={...mJe,...hJe};function _Je(i,e){return $W(i,new mc.classes.URLSearchParams,{visitor:function(n,r,s,o){return mc.isNode&&at.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function vJe(i){return at.matchAll(/\w+|\[(\w*)]/g,i).map(e=>e[0]==="[]"?"":e[1]||e[0])}function bJe(i){const e={},n=Object.keys(i);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],e[o]=i[o];return e}function rDe(i){function e(n,r,s,o){let a=n[o++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),c=o>=n.length;return a=!a&&at.isArray(s)?s.length:a,c?(at.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!l):((!s[a]||!at.isObject(s[a]))&&(s[a]=[]),e(n,r,s[a],o)&&at.isArray(s[a])&&(s[a]=bJe(s[a])),!l)}if(at.isFormData(i)&&at.isFunction(i.entries)){const n={};return at.forEachEntry(i,(r,s)=>{e(vJe(r),s,n,0)}),n}return null}function yJe(i,e,n){if(at.isString(i))try{return(e||JSON.parse)(i),at.trim(i)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(i)}const v5={transitional:iDe,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=at.isObject(e);if(o&&at.isHTMLForm(e)&&(e=new FormData(e)),at.isFormData(e))return s?JSON.stringify(rDe(e)):e;if(at.isArrayBuffer(e)||at.isBuffer(e)||at.isStream(e)||at.isFile(e)||at.isBlob(e)||at.isReadableStream(e))return e;if(at.isArrayBufferView(e))return e.buffer;if(at.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return _Je(e,this.formSerializer).toString();if((l=at.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return $W(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),yJe(e)):e}],transformResponse:[function(e){const n=this.transitional||v5.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(at.isResponse(e)||at.isReadableStream(e))return e;if(e&&at.isString(e)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?Ni.from(l,Ni.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mc.classes.FormData,Blob:mc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};at.forEach(["delete","get","head","post","put","patch"],i=>{v5.headers[i]={}});const wJe=at.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),CJe=i=>{const e={};let n,r,s;return i&&i.split(`
`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||e[n]&&wJe[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Xhe=Symbol("internals");function OR(i){return i&&String(i).trim().toLowerCase()}function JB(i){return i===!1||i==null?i:at.isArray(i)?i.map(JB):String(i)}function SJe(i){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(i);)e[r[1]]=r[2];return e}const xJe=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function xU(i,e,n,r,s){if(at.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!at.isString(e)){if(at.isString(r))return e.indexOf(r)!==-1;if(at.isRegExp(r))return r.test(e)}}function kJe(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function LJe(i,e){const n=at.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(i,r+n,{value:function(s,o,a){return this[r].call(this,e,s,o,a)},configurable:!0})})}let sd=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function o(l,c,u){const d=OR(c);if(!d)throw new Error("header name must be a non-empty string");const h=at.findKey(s,d);(!h||s[h]===void 0||u===!0||u===void 0&&s[h]!==!1)&&(s[h||c]=JB(l))}const a=(l,c)=>at.forEach(l,(u,d)=>o(u,d,c));if(at.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(at.isString(e)&&(e=e.trim())&&!xJe(e))a(CJe(e),n);else if(at.isObject(e)&&at.isIterable(e)){let l={},c,u;for(const d of e){if(!at.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[u=d[0]]=(c=l[u])?at.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}a(l,n)}else e!=null&&o(n,e,r);return this}get(e,n){if(e=OR(e),e){const r=at.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return SJe(s);if(at.isFunction(n))return n.call(this,s,r);if(at.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=OR(e),e){const r=at.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||xU(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function o(a){if(a=OR(a),a){const l=at.findKey(r,a);l&&(!n||xU(r,r[l],l,n))&&(delete r[l],s=!0)}}return at.isArray(e)?e.forEach(o):o(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!e||xU(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const n=this,r={};return at.forEach(this,(s,o)=>{const a=at.findKey(r,o);if(a){n[a]=JB(s),delete n[o];return}const l=e?kJe(o):String(o).trim();l!==o&&delete n[o],n[l]=JB(s),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return at.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&at.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[Xhe]=this[Xhe]={accessors:{}}).accessors,s=this.prototype;function o(a){const l=OR(a);r[l]||(LJe(s,a),r[l]=!0)}return at.isArray(e)?e.forEach(o):o(e),this}};sd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);at.reduceDescriptors(sd.prototype,({value:i},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>i,set(r){this[n]=r}}});at.freezeMethods(sd);function kU(i,e){const n=this||v5,r=e||n,s=sd.from(r.headers);let o=r.data;return at.forEach(i,function(l){o=l.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function sDe(i){return!!(i&&i.__CANCEL__)}function NI(i,e,n){Ni.call(this,i??"canceled",Ni.ERR_CANCELED,e,n),this.name="CanceledError"}at.inherits(NI,Ni,{__CANCEL__:!0});function oDe(i,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?i(n):e(new Ni("Request failed with status code "+n.status,[Ni.ERR_BAD_REQUEST,Ni.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function DJe(i){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return e&&e[1]||""}function EJe(i,e){i=i||10;const n=new Array(i),r=new Array(i);let s=0,o=0,a;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=r[o];a||(a=u),n[s]=c,r[s]=u;let h=o,f=0;for(;h!==s;)f+=n[h++],h=h%i;if(s=(s+1)%i,s===o&&(o=(o+1)%i),u-a<e)return;const p=d&&u-d;return p?Math.round(f*1e3/p):void 0}}function IJe(i,e){let n=0,r=1e3/e,s,o;const a=(u,d=Date.now())=>{n=d,s=null,o&&(clearTimeout(o),o=null),i(...u)};return[(...u)=>{const d=Date.now(),h=d-n;h>=r?a(u,d):(s=u,o||(o=setTimeout(()=>{o=null,a(s)},r-h)))},()=>s&&a(s)]}const C9=(i,e,n=3)=>{let r=0;const s=EJe(50,250);return IJe(o=>{const a=o.loaded,l=o.lengthComputable?o.total:void 0,c=a-r,u=s(c),d=a<=l;r=a;const h={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-a)/u:void 0,event:o,lengthComputable:l!=null,[e?"download":"upload"]:!0};i(h)},n)},Yhe=(i,e)=>{const n=i!=null;return[r=>e[0]({lengthComputable:n,total:i,loaded:r}),e[1]]},Zhe=i=>(...e)=>at.asap(()=>i(...e)),TJe=mc.hasStandardBrowserEnv?((i,e)=>n=>(n=new URL(n,mc.origin),i.protocol===n.protocol&&i.host===n.host&&(e||i.port===n.port)))(new URL(mc.origin),mc.navigator&&/(msie|trident)/i.test(mc.navigator.userAgent)):()=>!0,RJe=mc.hasStandardBrowserEnv?{write(i,e,n,r,s,o){const a=[i+"="+encodeURIComponent(e)];at.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),at.isString(r)&&a.push("path="+r),at.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(i){const e=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(i){this.write(i,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function AJe(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function NJe(i,e){return e?i.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):i}function aDe(i,e,n){let r=!AJe(e);return i&&(r||n==!1)?NJe(i,e):e}const Qhe=i=>i instanceof sd?{...i}:i;function nx(i,e){e=e||{};const n={};function r(u,d,h,f){return at.isPlainObject(u)&&at.isPlainObject(d)?at.merge.call({caseless:f},u,d):at.isPlainObject(d)?at.merge({},d):at.isArray(d)?d.slice():d}function s(u,d,h,f){if(at.isUndefined(d)){if(!at.isUndefined(u))return r(void 0,u,h,f)}else return r(u,d,h,f)}function o(u,d){if(!at.isUndefined(d))return r(void 0,d)}function a(u,d){if(at.isUndefined(d)){if(!at.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,h){if(h in e)return r(u,d);if(h in i)return r(void 0,u)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(u,d,h)=>s(Qhe(u),Qhe(d),h,!0)};return at.forEach(Object.keys({...i,...e}),function(d){const h=c[d]||s,f=h(i[d],e[d],d);at.isUndefined(f)&&h!==l||(n[d]=f)}),n}const lDe=i=>{const e=nx({},i);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=e;if(e.headers=a=sd.from(a),e.url=nDe(aDe(e.baseURL,e.url,e.allowAbsoluteUrls),i.params,i.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),at.isFormData(n)){if(mc.hasStandardBrowserEnv||mc.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(at.isFunction(n.getHeaders)){const c=n.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([d,h])=>{u.includes(d.toLowerCase())&&a.set(d,h)})}}if(mc.hasStandardBrowserEnv&&(r&&at.isFunction(r)&&(r=r(e)),r||r!==!1&&TJe(e.url))){const c=s&&o&&RJe.read(o);c&&a.set(s,c)}return e},MJe=typeof XMLHttpRequest<"u",PJe=MJe&&function(i){return new Promise(function(n,r){const s=lDe(i);let o=s.data;const a=sd.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=s,d,h,f,p,g;function m(){p&&p(),g&&g(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let _=new XMLHttpRequest;_.open(s.method.toUpperCase(),s.url,!0),_.timeout=s.timeout;function b(){if(!_)return;const x=sd.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),D={data:!l||l==="text"||l==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:x,config:i,request:_};oDe(function(E){n(E),m()},function(E){r(E),m()},D),_=null}"onloadend"in _?_.onloadend=b:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(b)},_.onabort=function(){_&&(r(new Ni("Request aborted",Ni.ECONNABORTED,i,_)),_=null)},_.onerror=function(k){const D=k&&k.message?k.message:"Network Error",R=new Ni(D,Ni.ERR_NETWORK,i,_);R.event=k||null,r(R),_=null},_.ontimeout=function(){let k=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const D=s.transitional||iDe;s.timeoutErrorMessage&&(k=s.timeoutErrorMessage),r(new Ni(k,D.clarifyTimeoutError?Ni.ETIMEDOUT:Ni.ECONNABORTED,i,_)),_=null},o===void 0&&a.setContentType(null),"setRequestHeader"in _&&at.forEach(a.toJSON(),function(k,D){_.setRequestHeader(D,k)}),at.isUndefined(s.withCredentials)||(_.withCredentials=!!s.withCredentials),l&&l!=="json"&&(_.responseType=s.responseType),u&&([f,g]=C9(u,!0),_.addEventListener("progress",f)),c&&_.upload&&([h,p]=C9(c),_.upload.addEventListener("progress",h),_.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(d=x=>{_&&(r(!x||x.type?new NI(null,i,_):x),_.abort(),_=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const y=DJe(s.url);if(y&&mc.protocols.indexOf(y)===-1){r(new Ni("Unsupported protocol "+y+":",Ni.ERR_BAD_REQUEST,i));return}_.send(o||null)})},OJe=(i,e)=>{const{length:n}=i=i?i.filter(Boolean):[];if(e||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof Ni?d:new NI(d instanceof Error?d.message:d))}};let a=e&&setTimeout(()=>{a=null,o(new Ni(`timeout ${e} of ms exceeded`,Ni.ETIMEDOUT))},e);const l=()=>{i&&(a&&clearTimeout(a),a=null,i.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),i=null)};i.forEach(u=>u.addEventListener("abort",o));const{signal:c}=r;return c.unsubscribe=()=>at.asap(l),c}},FJe=function*(i,e){let n=i.byteLength;if(n<e){yield i;return}let r=0,s;for(;r<n;)s=r+e,yield i.slice(r,s),r=s},BJe=async function*(i,e){for await(const n of jJe(i))yield*FJe(n,e)},jJe=async function*(i){if(i[Symbol.asyncIterator]){yield*i;return}const e=i.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Jhe=(i,e,n,r)=>{const s=BJe(i,e);let o=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){l(),c.close();return}let h=d.byteLength;if(n){let f=o+=h;n(f)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},efe=64*1024,{isFunction:D3}=at,WJe=(({Request:i,Response:e})=>({Request:i,Response:e}))(at.global),{ReadableStream:tfe,TextEncoder:nfe}=at.global,ife=(i,...e)=>{try{return!!i(...e)}catch{return!1}},$Je=i=>{i=at.merge.call({skipUndefined:!0},WJe,i);const{fetch:e,Request:n,Response:r}=i,s=e?D3(e):typeof fetch=="function",o=D3(n),a=D3(r);if(!s)return!1;const l=s&&D3(tfe),c=s&&(typeof nfe=="function"?(g=>m=>g.encode(m))(new nfe):async g=>new Uint8Array(await new n(g).arrayBuffer())),u=o&&l&&ife(()=>{let g=!1;const m=new n(mc.origin,{body:new tfe,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!m}),d=a&&l&&ife(()=>at.isReadableStream(new r("").body)),h={stream:d&&(g=>g.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!h[g]&&(h[g]=(m,_)=>{let b=m&&m[g];if(b)return b.call(m);throw new Ni(`Response type '${g}' is not supported`,Ni.ERR_NOT_SUPPORT,_)})});const f=async g=>{if(g==null)return 0;if(at.isBlob(g))return g.size;if(at.isSpecCompliantForm(g))return(await new n(mc.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if(at.isArrayBufferView(g)||at.isArrayBuffer(g))return g.byteLength;if(at.isURLSearchParams(g)&&(g=g+""),at.isString(g))return(await c(g)).byteLength},p=async(g,m)=>{const _=at.toFiniteNumber(g.getContentLength());return _??f(m)};return async g=>{let{url:m,method:_,data:b,signal:y,cancelToken:x,timeout:k,onDownloadProgress:D,onUploadProgress:R,responseType:E,headers:A,withCredentials:M="same-origin",fetchOptions:N}=lDe(g),P=e||fetch;E=E?(E+"").toLowerCase():"text";let O=OJe([y,x&&x.toAbortSignal()],k),B=null;const j=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let z;try{if(R&&u&&_!=="get"&&_!=="head"&&(z=await p(A,b))!==0){let K=new n(m,{method:"POST",body:b,duplex:"half"}),ee;if(at.isFormData(b)&&(ee=K.headers.get("content-type"))&&A.setContentType(ee),K.body){const[le,ke]=Yhe(z,C9(Zhe(R)));b=Jhe(K.body,efe,le,ke)}}at.isString(M)||(M=M?"include":"omit");const H=o&&"credentials"in n.prototype,Y={...N,signal:O,method:_.toUpperCase(),headers:A.normalize().toJSON(),body:b,duplex:"half",credentials:H?M:void 0};B=o&&new n(m,Y);let X=await(o?P(B,N):P(m,Y));const Q=d&&(E==="stream"||E==="response");if(d&&(D||Q&&j)){const K={};["status","statusText","headers"].forEach(xe=>{K[xe]=X[xe]});const ee=at.toFiniteNumber(X.headers.get("content-length")),[le,ke]=D&&Yhe(ee,C9(Zhe(D),!0))||[];X=new r(Jhe(X.body,efe,le,()=>{ke&&ke(),j&&j()}),K)}E=E||"text";let ie=await h[at.findKey(h,E)||"text"](X,g);return!Q&&j&&j(),await new Promise((K,ee)=>{oDe(K,ee,{data:ie,headers:sd.from(X.headers),status:X.status,statusText:X.statusText,config:g,request:B})})}catch(H){throw j&&j(),H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new Ni("Network Error",Ni.ERR_NETWORK,g,B),{cause:H.cause||H}):Ni.from(H,H&&H.code,g,B)}}},zJe=new Map,cDe=i=>{let e=i?i.env:{};const{fetch:n,Request:r,Response:s}=e,o=[r,s,n];let a=o.length,l=a,c,u,d=zJe;for(;l--;)c=o[l],u=d.get(c),u===void 0&&d.set(c,u=l?new Map:$Je(e)),d=u;return u};cDe();const qZ={http:sJe,xhr:PJe,fetch:{get:cDe}};at.forEach(qZ,(i,e)=>{if(i){try{Object.defineProperty(i,"name",{value:e})}catch{}Object.defineProperty(i,"adapterName",{value:e})}});const rfe=i=>`- ${i}`,VJe=i=>at.isFunction(i)||i===null||i===!1,uDe={getAdapter:(i,e)=>{i=at.isArray(i)?i:[i];const{length:n}=i;let r,s;const o={};for(let a=0;a<n;a++){r=i[a];let l;if(s=r,!VJe(r)&&(s=qZ[(l=String(r)).toLowerCase()],s===void 0))throw new Ni(`Unknown adapter '${l}'`);if(s&&(at.isFunction(s)||(s=s.get(e))))break;o[l||"#"+a]=s}if(!s){const a=Object.entries(o).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since :
`+a.map(rfe).join(`
`):" "+rfe(a[0]):"as no adapter specified";throw new Ni("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s},adapters:qZ};function LU(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new NI(null,i)}function sfe(i){return LU(i),i.headers=sd.from(i.headers),i.data=kU.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),uDe.getAdapter(i.adapter||v5.adapter,i)(i).then(function(r){return LU(i),r.data=kU.call(i,i.transformResponse,r),r.headers=sd.from(r.headers),r},function(r){return sDe(r)||(LU(i),r&&r.response&&(r.response.data=kU.call(i,i.transformResponse,r.response),r.response.headers=sd.from(r.response.headers))),Promise.reject(r)})}const dDe="1.12.2",zW={};["object","boolean","number","function","string","symbol"].forEach((i,e)=>{zW[i]=function(r){return typeof r===i||"a"+(e<1?"n ":" ")+i}});const ofe={};zW.transitional=function(e,n,r){function s(o,a){return"[Axios v"+dDe+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,l)=>{if(e===!1)throw new Ni(s(a," has been removed"+(n?" in "+n:"")),Ni.ERR_DEPRECATED);return n&&!ofe[a]&&(ofe[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,a,l):!0}};zW.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function HJe(i,e,n){if(typeof i!="object")throw new Ni("options must be an object",Ni.ERR_BAD_OPTION_VALUE);const r=Object.keys(i);let s=r.length;for(;s-- >0;){const o=r[s],a=e[o];if(a){const l=i[o],c=l===void 0||a(l,o,i);if(c!==!0)throw new Ni("option "+o+" must be "+c,Ni.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ni("Unknown option "+o,Ni.ERR_BAD_OPTION)}}const e8={assertOptions:HJe,validators:zW},Bg=e8.validators;let TS=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ghe,response:new Ghe}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=nx(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&e8.assertOptions(r,{silentJSONParsing:Bg.transitional(Bg.boolean),forcedJSONParsing:Bg.transitional(Bg.boolean),clarifyTimeoutError:Bg.transitional(Bg.boolean)},!1),s!=null&&(at.isFunction(s)?n.paramsSerializer={serialize:s}:e8.assertOptions(s,{encode:Bg.function,serialize:Bg.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),e8.assertOptions(n,{baseUrl:Bg.spelling("baseURL"),withXsrfToken:Bg.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&at.merge(o.common,o[n.method]);o&&at.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),n.headers=sd.concat(a,o);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,h=0,f;if(!c){const g=[sfe.bind(this),void 0];for(g.unshift(...l),g.push(...u),f=g.length,d=Promise.resolve(n);h<f;)d=d.then(g[h++],g[h++]);return d}f=l.length;let p=n;for(;h<f;){const g=l[h++],m=l[h++];try{p=g(p)}catch(_){m.call(this,_);break}}try{d=sfe.call(this,p)}catch(g){return Promise.reject(g)}for(h=0,f=u.length;h<f;)d=d.then(u[h++],u[h++]);return d}getUri(e){e=nx(this.defaults,e);const n=aDe(e.baseURL,e.url,e.allowAbsoluteUrls);return nDe(n,e.params,e.paramsSerializer)}};at.forEach(["delete","get","head","options"],function(e){TS.prototype[e]=function(n,r){return this.request(nx(r||{},{method:e,url:n,data:(r||{}).data}))}});at.forEach(["post","put","patch"],function(e){function n(r){return function(o,a,l){return this.request(nx(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}TS.prototype[e]=n(),TS.prototype[e+"Form"]=n(!0)});let UJe=class hDe{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(l=>{r.subscribe(l),o=l}).then(s);return a.cancel=function(){r.unsubscribe(o)},a},e(function(o,a,l){r.reason||(r.reason=new NI(o,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new hDe(function(s){e=s}),cancel:e}}};function qJe(i){return function(n){return i.apply(null,n)}}function KJe(i){return at.isObject(i)&&i.isAxiosError===!0}const KZ={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(KZ).forEach(([i,e])=>{KZ[e]=i});function fDe(i){const e=new TS(i),n=HLe(TS.prototype.request,e);return at.extend(n,TS.prototype,e,{allOwnKeys:!0}),at.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return fDe(nx(i,s))},n}const da=fDe(v5);da.Axios=TS;da.CanceledError=NI;da.CancelToken=UJe;da.isCancel=sDe;da.VERSION=dDe;da.toFormData=$W;da.AxiosError=Ni;da.Cancel=da.CanceledError;da.all=function(e){return Promise.all(e)};da.spread=qJe;da.isAxiosError=KJe;da.mergeConfig=nx;da.AxiosHeaders=sd;da.formToJSON=i=>rDe(at.isHTMLForm(i)?new FormData(i):i);da.getAdapter=uDe.getAdapter;da.HttpStatusCode=KZ;da.default=da;const{Axios:Vtn,AxiosError:Htn,CanceledError:Utn,isCancel:qtn,CancelToken:Ktn,VERSION:Gtn,all:Xtn,Cancel:Ytn,isAxiosError:Ztn,spread:Qtn,toFormData:Jtn,AxiosHeaders:enn,HttpStatusCode:tnn,formToJSON:nnn,getAdapter:inn,mergeConfig:rnn}=da,pse=function(){const i=new URL(window.location.href),e=i.pathname.replace(/dashboard$/,"");return new URL(e,i.href).href},pDe=function(i,e,n=[]){return i.read().then(({done:r,value:s})=>r?n:(e(s.length),n.push(s),pDe(i,e,n)))},GJe=function(i,e){let n=0;return r=>{n+=r;const s=i?parseInt(i,10):null,o=Math.round(n/s*100);e(o)}},XJe=function(i={},e){try{const n=e.parse(i);return e.stringify(n,null,2)}catch{const n={error:`HERE ${i}`};return e.stringify(n,null,2)}};let gDe,mDe;"rawJSON"in JSON&&(gDe=function(i,e,n){if(Number.isInteger(e)&&!Number.isSafeInteger(e))try{return BigInt(n==null?void 0:n.source)}catch{return e}return e},mDe=function(i,e){return typeof e=="bigint"?JSON.rawJSON(String(e)):e});const ls={parse:function(i,e){return JSON.parse(i,e||gDe)},stringify:function(i,e,n){return JSON.stringify(i,e||mDe,n)}},kE=da.create({baseURL:pse(),transformRequest:[function(i,e){return i instanceof FormData?i:(e["Content-Type"]="application/json",e["x-inference-proxy"]="true",ls.stringify(i))}],transformResponse:[function(i){return ls.parse(i)}]});function afe(i,{apiKey:e}){i.defaults.baseURL=pse(),e&&(i.defaults.headers.common["api-key"]=e),i.defaults.transformRequest=[function(n,r){return n instanceof FormData?n:(r["Content-Type"]="application/json",r["x-inference-proxy"]="true",ls.stringify(n))}],i.defaults.transformResponse=[function(n){return n&&ls.parse(n)}]}var S9={isNone:function(){return!0},orElse:function(i){return i},orCall:function(i){return i()},orNull:function(){return null},orThrow:function(i){throw i===void 0&&(i="Unexpected null value"),new TypeError(i)},map:function(){return S9},get:function(){return S9}},_De=function(){function i(e){this.value=e}return i.prototype.isNone=function(){return!1},i.prototype.orElse=function(){return this.value},i.prototype.orCall=function(){return this.value},i.prototype.orNull=function(){return this.value},i.prototype.orThrow=function(){return this.value},i.prototype.map=function(e){return An(e(this.value))},i.prototype.get=function(e){return this.map(function(n){return n[e]})},i}();function YJe(i){return i===S9||i instanceof _De}function An(i){return YJe(i)?i:i==null?S9:ZJe(i)}function ZJe(i){if(i==null)throw new TypeError("some() does not accept null or undefined");return new _De(i)}class x9 extends Error{constructor(e){super(e.statusText),Object.setPrototypeOf(this,new.target.prototype),this.headers=e.headers,this.url=e.url,this.status=e.status,this.statusText=e.statusText,this.data=e.data}}let GZ,vDe;"rawJSON"in JSON&&(GZ=function(i,e,n){if(Number.isInteger(e)&&!Number.isSafeInteger(e))try{return BigInt(n.source)}catch{return e}return e},vDe=function(i,e){return typeof e=="bigint"?JSON.rawJSON(String(e)):e});const gse=i=>i==="post"||i==="put"||i==="patch"||i==="delete";function QJe(i){const e=[],n=(r,s)=>`${encodeURIComponent(r)}=${encodeURIComponent(String(s))}`;return Object.keys(i).forEach(r=>{const s=i[r];s!=null&&(Array.isArray(s)?s.forEach(o=>e.push(n(r,o))):e.push(n(r,s)))}),e.length>0?`?${e.join("&")}`:""}function JJe(i,e){return i.replace(/\{([^}]+)\}/g,(n,r)=>{const s=encodeURIComponent(e[r]);return delete e[r],s})}function eet(i,e,n){let r={};return gse(i)?n.forEach(s=>{r[s]=e[s],delete e[s]}):r={...e},QJe(r)}function tet(i,e){const n=new Headers(e);return i!==void 0&&!(i instanceof FormData)&&!n.has("Content-Type")&&n.append("Content-Type","application/json"),n.has("Accept")||n.append("Accept","application/json"),n}function net(i,e){if(!gse(i))return;const n=e instanceof FormData?e:JSON.stringify(e,vDe);return i==="delete"&&n==="{}"?void 0:n}function iet(i,e){const n=new Headers(i==null?void 0:i.headers),r=new Headers(e==null?void 0:e.headers);for(const s of r.keys()){const o=r.get(s);o!=null&&n.set(s,o)}return{...i,...e,headers:n}}function ret(i){var c,u;const e=Object.assign(Array.isArray(i.payload)?[]:{},i.payload),n=JJe(i.path,e),r=eet(i.method,e,i.queryParams),s=net(i.method,e),o=gse(i.method)?tet(s,(c=i.init)==null?void 0:c.headers):new Headers((u=i.init)==null?void 0:u.headers),a=i.baseUrl+n+r,l={...i.init,method:i.method.toUpperCase(),headers:o,body:s};return{url:a,init:l}}async function set(i){if(i.status===204)return;const e=i.headers.get("content-type"),n=await i.text();if(e&&e.includes("application/json"))return JSON.parse(n,GZ);try{return JSON.parse(n,GZ)}catch{return n}}async function oet(i,e){const n=await fetch(i,e),r=await set(n),s={headers:n.headers,url:n.url,ok:n.ok,status:n.status,statusText:n.statusText,data:r};if(s.ok)return s;throw new x9(s)}function aet(i,e){const n=async(r,s,o)=>{if(i==null||r===i.length)return e(s,o);const a=i[r];return await a(s,o,(l,c)=>n(r+1,l,c))};return(r,s)=>n(0,r,s)}async function cet(i){const{url:e,init:n}=ret(i);return await i.fetch(e,n)}function uet(i){const e=async(n,r)=>{try{return await i(n,r)}catch(s){throw s instanceof x9?new e.Error(s):s}};return e.Error=class extends x9{constructor(n){super(n),Object.setPrototypeOf(this,new.target.prototype)}getActualType(){return{status:this.status,data:this.data}}},e}function det(){let i="",e={};const n=[],r=aet(n,oet);return{configure:s=>{i=s.baseUrl||"",e=s.init||{},n.splice(0),n.push(...s.use||[])},use:s=>n.push(s),path:s=>({method:o=>({create:a=>uet((l,c)=>cet({baseUrl:i||"",path:s,method:o,queryParams:Object.keys(a||{}),payload:l,init:iet(e,c),fetch:r}))})})}}const het={for:()=>det()},fet=200;class ZM extends Error{constructor(e){super(e),this.name=this.constructor.name,Object.setPrototypeOf(this,new.target.prototype)}}class mse extends ZM{static forResponse(e){const n=`${e.status}`,r=e.statusText?`(${e.statusText})`:"(Unrecognized Status Code)",s=`${n} ${r}`.trim(),o=e.data?JSON.stringify(e.data,null,2):null;let a="";o&&(a=o.length<=fet?o:o.slice(0,-4)+" ...");const l=`Raw response content:
${a}`;return new mse(`Unexpected Response: ${s}
${l}`)}}class E3 extends ZM{}class pet extends ZM{}class get extends ZM{constructor(e,n){super(e);const r=Number(n);if(isNaN(r))throw new ZM(`Invalid retryAfter value: ${n}`);this.retry_after=r,Object.setPrototypeOf(this,new.target.prototype)}}function met(i){return{createShardKey:i.path("/collections/{collection_name}/shards").method("put").create({timeout:!0}),deleteShardKey:i.path("/collections/{collection_name}/shards/delete").method("post").create({timeout:!0}),root:i.path("/").method("get").create(),telemetry:i.path("/telemetry").method("get").create(),metrics:i.path("/metrics").method("get").create(),getLocks:i.path("/locks").method("get").create(),postLocks:i.path("/locks").method("post").create(),healthz:i.path("/healthz").method("get").create(),livez:i.path("/livez").method("get").create(),readyz:i.path("/readyz").method("get").create(),getIssues:i.path("/issues").method("get").create(),clearIssues:i.path("/issues").method("delete").create(),clusterStatus:i.path("/cluster").method("get").create(),recoverCurrentPeer:i.path("/cluster/recover").method("post").create(),removePeer:i.path("/cluster/peer/{peer_id}").method("delete").create({force:!0}),getCollections:i.path("/collections").method("get").create(),getCollection:i.path("/collections/{collection_name}").method("get").create(),createCollection:i.path("/collections/{collection_name}").method("put").create({timeout:!0}),deleteCollection:i.path("/collections/{collection_name}").method("delete").create({timeout:!0}),updateCollection:i.path("/collections/{collection_name}").method("patch").create({timeout:!0}),updateAliases:i.path("/collections/aliases").method("post").create({timeout:!0}),createFieldIndex:i.path("/collections/{collection_name}/index").method("put").create({wait:!0,ordering:!0}),collectionExists:i.path("/collections/{collection_name}/exists").method("get").create(),deleteFieldIndex:i.path("/collections/{collection_name}/index/{field_name}").method("delete").create({wait:!0,ordering:!0}),collectionClusterInfo:i.path("/collections/{collection_name}/cluster").method("get").create(),updateCollectionCluster:i.path("/collections/{collection_name}/cluster").method("post").create({timeout:!0}),getCollectionAliases:i.path("/collections/{collection_name}/aliases").method("get").create(),getCollectionsAliases:i.path("/aliases").method("get").create(),recoverFromUploadedSnapshot:i.path("/collections/{collection_name}/snapshots/upload").method("post").create({wait:!0,priority:!0,checksum:!0}),recoverFromSnapshot:i.path("/collections/{collection_name}/snapshots/recover").method("put").create({wait:!0}),listSnapshots:i.path("/collections/{collection_name}/snapshots").method("get").create(),createSnapshot:i.path("/collections/{collection_name}/snapshots").method("post").create({wait:!0}),getSnapshot:i.path("/collections/{collection_name}/snapshots/{snapshot_name}").method("get").create(),deleteSnapshot:i.path("/collections/{collection_name}/snapshots/{snapshot_name}").method("delete").create({wait:!0}),listFullSnapshots:i.path("/snapshots").method("get").create(),createFullSnapshot:i.path("/snapshots").method("post").create({wait:!0}),getFullSnapshot:i.path("/snapshots/{snapshot_name}").method("get").create(),deleteFullSnapshot:i.path("/snapshots/{snapshot_name}").method("delete").create({wait:!0}),recoverShardFromUploadedSnapshot:i.path("/collections/{collection_name}/shards/{shard_id}/snapshots/upload").method("post").create({wait:!0,priority:!0,checksum:!0}),recoverShardFromSnapshot:i.path("/collections/{collection_name}/shards/{shard_id}/snapshots/recover").method("put").create({wait:!0}),listShardSnapshots:i.path("/collections/{collection_name}/shards/{shard_id}/snapshots").method("get").create(),createShardSnapshot:i.path("/collections/{collection_name}/shards/{shard_id}/snapshots").method("post").create({wait:!0}),getShardSnapshot:i.path("/collections/{collection_name}/shards/{shard_id}/snapshots/{snapshot_name}").method("get").create(),deleteShardSnapshot:i.path("/collections/{collection_name}/shards/{shard_id}/snapshots/{snapshot_name}").method("delete").create({wait:!0}),getPoint:i.path("/collections/{collection_name}/points/{id}").method("get").create(),upsertPoints:i.path("/collections/{collection_name}/points").method("put").create({wait:!0,ordering:!0}),getPoints:i.path("/collections/{collection_name}/points").method("post").create({consistency:!0,timeout:!0}),deletePoints:i.path("/collections/{collection_name}/points/delete").method("post").create({wait:!0,ordering:!0}),updateVectors:i.path("/collections/{collection_name}/points/vectors").method("put").create({wait:!0,ordering:!0}),deleteVectors:i.path("/collections/{collection_name}/points/vectors/delete").method("post").create({wait:!0,ordering:!0}),overwritePayload:i.path("/collections/{collection_name}/points/payload").method("put").create({wait:!0,ordering:!0}),setPayload:i.path("/collections/{collection_name}/points/payload").method("post").create({wait:!0,ordering:!0}),deletePayload:i.path("/collections/{collection_name}/points/payload/delete").method("post").create({wait:!0,ordering:!0}),clearPayload:i.path("/collections/{collection_name}/points/payload/clear").method("post").create({wait:!0,ordering:!0}),batchUpdate:i.path("/collections/{collection_name}/points/batch").method("post").create({wait:!0,ordering:!0}),scrollPoints:i.path("/collections/{collection_name}/points/scroll").method("post").create({consistency:!0,timeout:!0}),searchPoints:i.path("/collections/{collection_name}/points/search").method("post").create({consistency:!0,timeout:!0}),searchBatchPoints:i.path("/collections/{collection_name}/points/search/batch").method("post").create({consistency:!0,timeout:!0}),searchPointGroups:i.path("/collections/{collection_name}/points/search/groups").method("post").create({consistency:!0,timeout:!0}),recommendPoints:i.path("/collections/{collection_name}/points/recommend").method("post").create({consistency:!0,timeout:!0}),recommendBatchPoints:i.path("/collections/{collection_name}/points/recommend/batch").method("post").create({consistency:!0,timeout:!0}),recommendPointGroups:i.path("/collections/{collection_name}/points/recommend/groups").method("post").create({consistency:!0,timeout:!0}),discoverPoints:i.path("/collections/{collection_name}/points/discover").method("post").create({consistency:!0,timeout:!0}),discoverBatchPoints:i.path("/collections/{collection_name}/points/discover/batch").method("post").create({consistency:!0,timeout:!0}),countPoints:i.path("/collections/{collection_name}/points/count").method("post").create({timeout:!0}),facet:i.path("/collections/{collection_name}/facet").method("post").create({timeout:!0,consistency:!0}),queryPoints:i.path("/collections/{collection_name}/points/query").method("post").create({consistency:!0,timeout:!0}),queryBatchPoints:i.path("/collections/{collection_name}/points/query/batch").method("post").create({consistency:!0,timeout:!0}),queryPointsGroups:i.path("/collections/{collection_name}/points/query/groups").method("post").create({consistency:!0,timeout:!0}),searchMatrixPairs:i.path("/collections/{collection_name}/points/search/matrix/pairs").method("post").create({consistency:!0,timeout:!0}),searchMatrixOffsets:i.path("/collections/{collection_name}/points/search/matrix/offsets").method("post").create({consistency:!0,timeout:!0})}}function _et(i,e){const n=vet(i,e);return met(n)}function vet(i,{headers:e,timeout:n,connections:r}){const s=[];Number.isFinite(n)&&s.push(async(a,l,c)=>{const u=new AbortController,d=setTimeout(()=>u.abort(),n);try{return await c(a,Object.assign(l,{signal:u.signal}))}catch(h){throw h instanceof Error&&h.name==="AbortError"?new pet(h.message):h}finally{clearTimeout(d)}}),s.push(async(a,l,c)=>{var d;let u;try{if(u=await c(a,l),u.status===200||u.status===201)return u}catch(h){if(h instanceof x9&&h.status===429){const f=(d=h.headers.get("retry-after"))==null?void 0:d[0];if(f)throw new get(h.message,f)}throw h}throw mse.forResponse(u)});const o=het.for();return o.configure({baseUrl:i,init:{headers:e,dispatcher:void 0},use:s}),o}const DU="1.15.1",XZ={parseVersion(i){if(!i)throw new Error("Version is null");let e,n;if([e,n]=i.split(".",2),e=parseInt(e,10),n=parseInt(n,10),isNaN(e)||isNaN(n))throw new Error(`Unable to parse version, expected format: x.y[.z], found: ${i}`);return{major:e,minor:n}},isCompatible(i,e){if(!i||!e)return console.debug(`Unable to compare versions with null values. Client: ${i}, Server: ${e}`),!1;if(i===e)return!0;try{const n=XZ.parseVersion(i),r=XZ.parseVersion(e);return n.major===r.major&&Math.abs(n.minor-r.minor)<=1}catch(n){return console.debug(`Unable to compare versions: ${n}`),!1}}};class bet{constructor({url:e,host:n,apiKey:r,https:s,prefix:o,port:a=6333,timeout:l=3e5,checkCompatibility:c=!0,...u}={}){if(this._https=s??typeof r=="string",this._scheme=this._https?"https":"http",this._prefix=o??"",this._prefix.length>0&&!this._prefix.startsWith("/")&&(this._prefix=`/${this._prefix}`),e&&n)throw new E3(`Only one of \`url\`, \`host\` params can be set. Url is ${e}, host is ${n}`);if(n&&(n.startsWith("http://")||n.startsWith("https://")||/:\d+$/.test(n)))throw new E3("The `host` param is not expected to contain neither protocol (http:// or https://) nor port (:6333).\nTry to use the `url` parameter instead.");if(e){if(!(e.startsWith("http://")||e.startsWith("https://")))throw new E3("The `url` param expected to contain a valid URL starting with a protocol (http:// or https://).");const m=new URL(e);if(this._host=m.hostname,this._port=m.port?Number(m.port):a,this._scheme=m.protocol.replace(":",""),this._prefix.length>0&&m.pathname!=="/")throw new E3(`Prefix can be set either in \`url\` or in \`prefix\`.
url is ${e}, prefix is ${m.pathname}`)}else this._port=a,this._host=n??"127.0.0.1";const d=new Headers([["user-agent","qdrant-js/"+String(DU)]]),h=u.headers??{};Object.keys(h).forEach(m=>{h[m]&&d.set(m,String(h[m]))}),typeof r=="string"&&(this._scheme==="http"&&console.warn("Api key is used with unsecure connection."),d.set("api-key",r));const f=this._port?`${this._host}:${this._port}`:this._host;this._restUri=`${this._scheme}://${f}${this._prefix}`;const p=u.maxConnections,g={headers:d,timeout:l,connections:p};this._openApiClient=_et(this._restUri,g),c&&this._openApiClient.root({}).then(m=>{const _=m.data.version;XZ.isCompatible(DU,_)||console.warn(`Client version ${DU} is incompatible with server version ${_}. Major versions should match and minor version difference must not exceed 1. Set checkCompatibility=false to skip version check.`)}).catch(()=>{console.warn("Failed to obtain server version. Unable to check client-server compatibility. Set checkCompatibility=false to skip version check.")})}api(){return this._openApiClient}async searchBatch(e,{searches:n,consistency:r,timeout:s}){const o=await this._openApiClient.searchBatchPoints({collection_name:e,consistency:r,timeout:s,searches:n});return An(o.data.result).orThrow("Search batch returned empty")}async search(e,{shard_key:n,vector:r,limit:s=10,offset:o=0,filter:a,params:l,with_payload:c=!0,with_vector:u=!1,score_threshold:d,consistency:h,timeout:f}){const p=await this._openApiClient.searchPoints({collection_name:e,consistency:h,timeout:f,shard_key:n,vector:r,limit:s,offset:o,filter:a,params:l,with_payload:c,with_vector:u,score_threshold:d});return An(p.data.result).orThrow("Search returned empty")}async recommendBatch(e,{searches:n,consistency:r,timeout:s}){const o=await this._openApiClient.recommendBatchPoints({collection_name:e,searches:n,consistency:r,timeout:s});return An(o.data.result).orElse([])}async recommend_batch(e,{searches:n,consistency:r,timeout:s}){const o=await this._openApiClient.recommendBatchPoints({collection_name:e,searches:n,consistency:r,timeout:s});return An(o.data.result).orElse([])}async recommend(e,{shard_key:n,positive:r,negative:s,strategy:o,filter:a,params:l,limit:c=10,offset:u=0,with_payload:d=!0,with_vector:h=!1,score_threshold:f,using:p,lookup_from:g,consistency:m,timeout:_}){const b=await this._openApiClient.recommendPoints({collection_name:e,limit:c,shard_key:n,positive:r,negative:s,strategy:o,filter:a,params:l,offset:u,with_payload:d,with_vector:h,score_threshold:f,using:p,lookup_from:g,consistency:m,timeout:_});return An(b.data.result).orThrow("Recommend points API returned empty")}async scroll(e,{shard_key:n,filter:r,consistency:s,timeout:o,limit:a=10,offset:l,with_payload:c=!0,with_vector:u=!1,order_by:d}={}){const h=await this._openApiClient.scrollPoints({collection_name:e,shard_key:n,limit:a,offset:l,filter:r,with_payload:c,with_vector:u,order_by:d,consistency:s,timeout:o});return An(h.data.result).orThrow("Scroll points API returned empty")}async count(e,{shard_key:n,filter:r,exact:s=!0,timeout:o}={}){const a=await this._openApiClient.countPoints({collection_name:e,shard_key:n,filter:r,exact:s,timeout:o});return An(a.data.result).orThrow("Count points returned empty")}async collectionClusterInfo(e){const n=await this._openApiClient.collectionClusterInfo({collection_name:e});return An(n.data.result).orThrow("Collection cluster info returned empty")}async updateCollectionCluster(e,{timeout:n,...r}){const s=await this._openApiClient.updateCollectionCluster({collection_name:e,timeout:n,...r});return An(s.data.result).orThrow("Update collection cluster returned empty")}async updateVectors(e,{wait:n=!0,ordering:r,points:s,shard_key:o}){const a=await this._openApiClient.updateVectors({collection_name:e,wait:n,ordering:r,points:s,shard_key:o});return An(a.data.result).orThrow("Update vectors returned empty")}async deleteVectors(e,{wait:n=!0,ordering:r,points:s,filter:o,vector:a,shard_key:l}){const c=await this._openApiClient.deleteVectors({collection_name:e,wait:n,ordering:r,points:s,filter:o,vector:a,shard_key:l});return An(c.data.result).orThrow("Delete vectors returned empty")}async searchPointGroups(e,{consistency:n,timeout:r,shard_key:s,vector:o,filter:a,params:l,with_payload:c=null,with_vector:u=null,score_threshold:d,group_by:h,group_size:f,limit:p}){const g=await this._openApiClient.searchPointGroups({collection_name:e,consistency:n,timeout:r,shard_key:s,vector:o,filter:a,params:l,with_payload:c,with_vector:u,score_threshold:d,group_by:h,group_size:f,limit:p});return An(g.data.result).orThrow("Search point groups returned empty")}async recommendPointGroups(e,{consistency:n,timeout:r,shard_key:s,positive:o,strategy:a,negative:l=[],filter:c,params:u,with_payload:d=null,with_vector:h=null,score_threshold:f,using:p=null,lookup_from:g=null,group_by:m,group_size:_,limit:b}){const y=await this._openApiClient.recommendPointGroups({collection_name:e,consistency:n,timeout:r,shard_key:s,positive:o,negative:l,strategy:a,filter:c,params:u,with_payload:d,with_vector:h,score_threshold:f,using:p,lookup_from:g,group_by:m,group_size:_,limit:b});return An(y.data.result).orThrow("Recommend point groups API returned empty")}async upsert(e,{wait:n=!0,ordering:r,...s}){const o=await this._openApiClient.upsertPoints({collection_name:e,wait:n,ordering:r,...s});return An(o.data.result).orThrow("Upsert returned empty")}async retrieve(e,{shard_key:n,ids:r,with_payload:s=!0,with_vector:o,consistency:a,timeout:l}){const c=await this._openApiClient.getPoints({collection_name:e,shard_key:n,ids:r,with_payload:s,with_vector:o,consistency:a,timeout:l});return An(c.data.result).orThrow("Retrieve API returned empty")}async delete(e,{wait:n,ordering:r,...s}){const o=await this._openApiClient.deletePoints({collection_name:e,wait:n,ordering:r,...s});return An(o.data.result).orThrow("Delete points returned empty")}async setPayload(e,{payload:n,points:r,filter:s,shard_key:o,key:a,ordering:l,wait:c=!0}){const u=await this._openApiClient.setPayload({collection_name:e,payload:n,points:r,filter:s,shard_key:o,key:a,wait:c,ordering:l});return An(u.data.result).orThrow("Set payload returned empty")}async overwritePayload(e,{ordering:n,payload:r,points:s,filter:o,shard_key:a,key:l,wait:c=!0}){const u=await this._openApiClient.overwritePayload({collection_name:e,payload:r,points:s,filter:o,shard_key:a,key:l,wait:c,ordering:n});return An(u.data.result).orThrow("Overwrite payload returned empty")}async deletePayload(e,{ordering:n,keys:r,points:s,filter:o,shard_key:a,wait:l=!0}){const c=await this._openApiClient.deletePayload({collection_name:e,keys:r,points:s,filter:o,shard_key:a,wait:l,ordering:n});return An(c.data.result).orThrow("Delete payload returned empty")}async clearPayload(e,{ordering:n,wait:r=!0,...s}){const o=await this._openApiClient.clearPayload({collection_name:e,wait:r,ordering:n,...s});return An(o.data.result).orThrow("Clear payload returned empty")}async updateCollectionAliases({actions:e,timeout:n}){const r=await this._openApiClient.updateAliases({actions:e,timeout:n});return An(r.data.result).orThrow("Update aliases returned empty")}async getCollectionAliases(e){const n=await this._openApiClient.getCollectionAliases({collection_name:e});return An(n.data.result).orThrow("Get collection aliases returned empty")}async getAliases(){const e=await this._openApiClient.getCollectionsAliases({});return An(e.data.result).orThrow("Get aliases returned empty")}async getCollections(){const e=await this._openApiClient.getCollections({});return An(e.data.result).orThrow("Get collections returned empty")}async getCollection(e){const n=await this._openApiClient.getCollection({collection_name:e});return An(n.data.result).orThrow("Get collection returned empty")}async updateCollection(e,n){const r=await this._openApiClient.updateCollection({collection_name:e,...n});return An(r.data.result).orThrow("Update collection returned empty")}async deleteCollection(e,n){const r=await this._openApiClient.deleteCollection({collection_name:e,...n});return An(r.data.result).orThrow("Delete collection returned empty")}async createCollection(e,{timeout:n,vectors:r,hnsw_config:s,init_from:o,on_disk_payload:a,optimizers_config:l,quantization_config:c,replication_factor:u,shard_number:d,sharding_method:h,wal_config:f,write_consistency_factor:p,sparse_vectors:g,strict_mode_config:m}){const _=await this._openApiClient.createCollection({collection_name:e,timeout:n,vectors:r,hnsw_config:s,init_from:o,on_disk_payload:a,optimizers_config:l,quantization_config:c,replication_factor:u,shard_number:d,sharding_method:h,wal_config:f,write_consistency_factor:p,sparse_vectors:g,strict_mode_config:m});return An(_.data.result).orThrow("Create collection returned empty")}async recreateCollection(e,{timeout:n,vectors:r,hnsw_config:s,init_from:o,on_disk_payload:a,optimizers_config:l,quantization_config:c,replication_factor:u,shard_number:d,sharding_method:h,wal_config:f,write_consistency_factor:p,sparse_vectors:g,strict_mode_config:m}){An(await this._openApiClient.deleteCollection({collection_name:e,timeout:n})).get("ok").orThrow("Delete collection returned failed");const _=await this._openApiClient.createCollection({collection_name:e,timeout:n,vectors:r,hnsw_config:s,init_from:o,on_disk_payload:a,optimizers_config:l,quantization_config:c,replication_factor:u,shard_number:d,sharding_method:h,wal_config:f,write_consistency_factor:p,sparse_vectors:g,strict_mode_config:m});return An(_).orThrow("Create collection returned empty")}async createPayloadIndex(e,{wait:n,ordering:r,field_name:s,field_schema:o}){const a=await this._openApiClient.createFieldIndex({collection_name:e,field_name:s,field_schema:o,wait:n,ordering:r});return An(a.data.result).orThrow("Create field index returned empty")}async deletePayloadIndex(e,n,{wait:r=!0,ordering:s}={}){const o=await this._openApiClient.deleteFieldIndex({collection_name:e,field_name:n,wait:r,ordering:s});return An(o.data.result).orThrow("Delete field index returned empty")}async listSnapshots(e){const n=await this._openApiClient.listSnapshots({collection_name:e});return An(n.data.result).orThrow("List snapshots API returned empty")}async createSnapshot(e,n){const r=await this._openApiClient.createSnapshot({collection_name:e,...n});return An(r.data.result).orNull()}async deleteSnapshot(e,n,r){const s=await this._openApiClient.deleteSnapshot({collection_name:e,snapshot_name:n,...r});return An(s.data.result).orThrow("Delete snapshot API returned empty")}async listFullSnapshots(){const e=await this._openApiClient.listFullSnapshots({});return An(e.data.result).orThrow("List full snapshots API returned empty")}async createFullSnapshot(e){const n=await this._openApiClient.createFullSnapshot(e??{});return An(n.data.result).orThrow("Create full snapshot API returned empty")}async deleteFullSnapshot(e,n){const r=await this._openApiClient.deleteFullSnapshot({snapshot_name:e,...n});return An(r.data.result).orThrow("Delete full snapshot API returned empty")}async recoverSnapshot(e,{location:n,priority:r,checksum:s,api_key:o}){const a=await this._openApiClient.recoverFromSnapshot({collection_name:e,location:n,priority:r,checksum:s,api_key:o});return An(a.data.result).orThrow("Recover from snapshot API returned empty")}async lockStorage(e){const n=await this._openApiClient.postLocks({write:!0,error_message:e});return An(n.data.result).orThrow("Lock storage returned empty")}async unlockStorage(){const e=await this._openApiClient.postLocks({write:!1});return An(e.data.result).orThrow("Post locks returned empty")}async getLocks(){const e=await this._openApiClient.getLocks({});return An(e.data.result).orThrow("Get locks returned empty")}async batchUpdate(e,{wait:n=!0,ordering:r,...s}){const o=await this._openApiClient.batchUpdate({collection_name:e,wait:n,ordering:r,...s});return An(o.data.result).orThrow("Batch update returned empty")}async recoverShardFromSnapshot(e,n,{wait:r=!0,...s}){const o=await this._openApiClient.recoverShardFromSnapshot({collection_name:e,shard_id:n,wait:r,...s});return An(o.data.result).orThrow("Recover shard from snapshot returned empty")}async listShardSnapshots(e,n){const r=await this._openApiClient.listShardSnapshots({collection_name:e,shard_id:n});return An(r.data.result).orThrow("List shard snapshots returned empty")}async createShardSnapshot(e,n,{wait:r=!0}){const s=await this._openApiClient.createShardSnapshot({collection_name:e,shard_id:n,wait:r});return An(s.data.result).orThrow("Create shard snapshot returned empty")}async deleteShardSnapshot(e,n,r,{wait:s=!0}){const o=await this._openApiClient.deleteShardSnapshot({collection_name:e,shard_id:n,snapshot_name:r,wait:s});return An(o.data.result).orThrow("Create shard snapshot returned empty")}async createShardKey(e,{shard_key:n,shards_number:r,replication_factor:s,placement:o,timeout:a}){const l=await this._openApiClient.createShardKey({collection_name:e,shard_key:n,shards_number:r,replication_factor:s,placement:o,timeout:a});return An(l.data.result).orThrow("Create shard key returned empty")}async deleteShardKey(e,{shard_key:n,timeout:r}){const s=await this._openApiClient.deleteShardKey({collection_name:e,shard_key:n,timeout:r});return An(s.data.result).orThrow("Create shard key returned empty")}async discoverPoints(e,{consistency:n,timeout:r,shard_key:s,target:o,context:a,params:l,limit:c,offset:u,with_payload:d,with_vector:h,using:f,lookup_from:p}){const g=await this._openApiClient.discoverPoints({collection_name:e,consistency:n,timeout:r,shard_key:s,target:o,context:a,params:l,limit:c,offset:u,with_payload:d,with_vector:h,using:f,lookup_from:p});return An(g.data.result).orThrow("Discover points returned empty")}async discoverBatchPoints(e,{consistency:n,timeout:r,searches:s}){const o=await this._openApiClient.discoverBatchPoints({collection_name:e,consistency:n,timeout:r,searches:s});return An(o.data.result).orThrow("Discover batch points returned empty")}async versionInfo(){const e=await this._openApiClient.root({});return An(e.data).orThrow("Version Info returned empty")}async collectionExists(e){const n=await this._openApiClient.collectionExists({collection_name:e});return An(n.data.result).orThrow("Collection exists returned empty")}async query(e,{consistency:n,timeout:r,shard_key:s,prefetch:o,query:a,using:l,filter:c,params:u,score_threshold:d,limit:h,offset:f,with_vector:p,with_payload:g,lookup_from:m}){const _=await this._openApiClient.queryPoints({collection_name:e,consistency:n,timeout:r,shard_key:s,prefetch:o,query:a,using:l,filter:c,params:u,score_threshold:d,limit:h,offset:f,with_vector:p,with_payload:g,lookup_from:m});return An(_.data.result).orThrow("Query points returned empty")}async queryBatch(e,{consistency:n,timeout:r,searches:s}){const o=await this._openApiClient.queryBatchPoints({collection_name:e,consistency:n,timeout:r,searches:s});return An(o.data.result).orThrow("Query points returned empty")}async queryGroups(e,{consistency:n,timeout:r,shard_key:s,prefetch:o,query:a,using:l,filter:c,params:u,score_threshold:d,with_vector:h,with_payload:f,group_by:p,group_size:g,limit:m,with_lookup:_}){const b=await this._openApiClient.queryPointsGroups({collection_name:e,consistency:n,timeout:r,shard_key:s,prefetch:o,query:a,using:l,filter:c,params:u,score_threshold:d,with_vector:h,with_payload:f,group_by:p,group_size:g,limit:m,with_lookup:_});return An(b.data.result).orThrow("Query groups returned empty")}async facet(e,{consistency:n,timeout:r,shard_key:s,key:o,limit:a,filter:l,exact:c}){const u=await this._openApiClient.facet({collection_name:e,consistency:n,timeout:r,shard_key:s,key:o,limit:a,filter:l,exact:c});return An(u.data.result).orThrow("Facet returned empty")}async searchMatrixPairs(e,{consistency:n,timeout:r,shard_key:s,filter:o,sample:a,limit:l,using:c}){const u=await this._openApiClient.searchMatrixPairs({collection_name:e,consistency:n,timeout:r,shard_key:s,filter:o,sample:a,limit:l,using:c});return An(u.data.result).orThrow("Search points matrix pairs returned empty")}async searchMatrixOffsets(e,{consistency:n,timeout:r,shard_key:s,filter:o,sample:a,limit:l,using:c}){const u=await this._openApiClient.searchMatrixOffsets({collection_name:e,consistency:n,timeout:r,shard_key:s,filter:o,sample:a,limit:l,using:c});return An(u.data.result).orThrow("Search points matrix offsets returned empty")}}var ES;class yet extends bet{constructor({url:n,apiKey:r,port:s}){super({url:n,apiKey:r,port:s,checkCompatibility:!1,headers:{"x-inference-proxy":"true"}});Nue(this,ES);this.downloadSnapshot=this.downloadSnapshot.bind(this),this.getSnapshotUploadUrl=this.getSnapshotUploadUrl.bind(this),this.getApiKey=this.getApiKey.bind(this),this.abortDownload=this.abortDownload.bind(this),this.url=n,this.apiKey=r,this.port=s,XH(this,ES,new AbortController)}async downloadSnapshot(n,r,s=!1){const o={"Content-Disposition":`attachment; filename="${r}"`,"Content-Type":"application/gzip"};this.apiKey&&(o["api-key"]=this.apiKey);const a=new URL(`/collections/${n}/snapshots/${r}`,this.url).href,l=new Request(a,{method:"GET",headers:o}),c=await fetch(l,{signal:GH(this,ES).signal});return s?await c.blob():c}abortDownload(){GH(this,ES).abort(),XH(this,ES,new AbortController)}getSnapshotUploadUrl(n){return new URL(`collections/${n}/snapshots/upload`,this.url)}getApiKey(){return this.apiKey}}ES=new WeakMap;function wet({apiKey:i}){let e,n=6333;e=pse(),window.location.port?n=window.location.port:window.location.protocol==="https:"?n=443:n=80;const r={url:e,apiKey:i,port:n};return new yet(r)}const Cet=["/datasets","/jwt","/tutorial"],xet=i=>Cet.some(e=>{if(e.includes("*")){const n=e.replace("*",".*");return new RegExp(`^${n}$`).test(i)}return i===e}),ket=i=>{if(!i)return!1;try{const e=JSON.parse(atob(i.split(".")[1]));return!e.access||!Array.isArray(e.access)?!1:e.access.some(({access:n})=>n==="prw")}catch{return!1}},Let={apiKey:""},Det=i=>{localStorage.setItem("settings",ls.stringify(i))},Eet=()=>{const i=localStorage.getItem("settings");return i?ls.parse(i):Let},bDe=$.createContext(),Ur=()=>{const i=$.useContext(bDe);if(!i)throw new Error("useClient must be used within ClientProvider");return{...i,isRestricted:ket(i.settings.apiKey)}},Iet=i=>{const[e,n]=$.useState(Eet()),r=wet(e);return afe(kE,e),$.useEffect(()=>{afe(kE,e),Det(e)},[e]),C.jsx(bDe.Provider,{value:{client:r,settings:e,setSettings:n},...i})};function yDe({open:i,setOpen:e,onApply:n}){const{settings:r,setSettings:s}=Ur(),[o,a]=nn.useState(!1),[l,c]=nn.useState(!1),u=()=>a(m=>!m),d=m=>{m.preventDefault()},[h,f]=nn.useState(""),p=()=>{c(!1),e(!1)},g=()=>{if(!h){c(!0);return}s({...r,apiKey:h}),e(!1),n()};return C.jsx("div",{children:C.jsxs(Vm,{open:i,onClose:p,slotProps:{transition:{onEntered:()=>{const m=document.getElementById("api-key-input");m&&m.focus()}}},children:[C.jsx(tx,{children:"Set API Key"}),C.jsxs(a1,{children:[C.jsx(pqe,{sx:{mb:2},children:"This instance of Qdrant might be protected by an API Key. If so, please enter your API Key to continue."}),C.jsx(Ep,{onChange:m=>f(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),g())},autoFocus:!0,id:"api-key-input",placeholder:"API Key",error:l,helperText:l?"API Key is required":"",type:o?"text":"password",fullWidth:!0,variant:"outlined",slotProps:{input:{endAdornment:C.jsx(TW,{position:"end",children:C.jsx(Ga,{"aria-label":"toggle password visibility",onClick:u,onMouseDown:d,children:o?C.jsx(VLe,{}):C.jsx(zLe,{})})})}}})]}),C.jsxs(CE,{sx:{p:3},children:[C.jsx(Ci,{variant:"outlined",color:"inherit",onClick:p,children:"Cancel"}),C.jsx(Ci,{variant:"contained",onClick:g,children:"Apply"})]})]})})}yDe.propTypes={open:Z.bool.isRequired,setOpen:Z.func.isRequired,onApply:Z.func.isRequired};/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Tet=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ret=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),lfe=i=>{const e=Ret(i);return e.charAt(0).toUpperCase()+e.slice(1)},wDe=(...i)=>i.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),Aet=i=>{for(const e in i)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Net={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Met=$.forwardRef(({color:i="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...l},c)=>$.createElement("svg",{ref:c,...Net,width:e,height:e,stroke:i,strokeWidth:r?Number(n)*24/Number(e):n,className:wDe("lucide",s),...!o&&!Aet(l)&&{"aria-hidden":"true"},...l},[...a.map(([u,d])=>$.createElement(u,d)),...Array.isArray(o)?o:[o]]));/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qi=(i,e)=>{const n=$.forwardRef(({className:r,...s},o)=>$.createElement(Met,{ref:o,iconNode:e,className:wDe(`lucide-${Tet(lfe(i))}`,`lucide-${i}`,r),...s}));return n.displayName=lfe(i),n};/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Pet=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],CDe=qi("archive-restore",Pet);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Oet=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Fet=qi("arrow-left",Oet);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Bet=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],jet=qi("book-marked",Bet);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wet=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],$et=qi("camera",Wet);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zet=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Vet=qi("chevron-down",zet);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Het=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uet=qi("chevron-right",Het);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qet=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ket=qi("circle-question-mark",qet);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Get=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Xet=qi("circle-x",Get);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yet=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],SDe=qi("copy",Yet);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Zet=[["path",{d:"M20 20v-7a4 4 0 0 0-4-4H4",key:"1nkjon"}],["path",{d:"M9 14 4 9l5-5",key:"102s5s"}]],Qet=qi("corner-up-left",Zet);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jet=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],ett=qi("download",Jet);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ttt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],ntt=qi("ellipsis",ttt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const itt=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],rtt=qi("external-link",itt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const stt=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],_se=qi("file-code",stt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ott=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],att=qi("funnel",ott);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ltt=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],ctt=qi("grip",ltt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const utt=[["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M12 2v8",key:"1q4o3n"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]],dtt=qi("hard-drive-upload",utt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const htt=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],ftt=qi("key-round",htt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ptt=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],gtt=qi("key",ptt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mtt=[["path",{d:"M5 12h14",key:"1ays0h"}]],_tt=qi("minus",mtt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vtt=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],btt=qi("moon",vtt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ytt=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],wtt=qi("network",ytt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ctt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Stt=qi("pencil",Ctt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xtt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ktt=qi("plus",xtt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ltt=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]],Dtt=qi("rectangle-ellipsis",Ltt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ett=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],xDe=qi("rocket",Ett);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Itt=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]],Ttt=qi("scan-text",Itt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rtt=[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Att=qi("search-check",Rtt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ntt=[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Mtt=qi("search-code",Ntt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ptt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ott=qi("search",Ptt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ftt=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Btt=qi("sliders-horizontal",Ftt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jtt=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Wtt=qi("sparkles",jtt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $tt=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],ztt=qi("square-terminal",$tt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vtt=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Htt=qi("sun",Vtt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Utt=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],vse=qi("trash",Utt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qtt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Ktt=qi("upload",qtt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gtt=[["path",{d:"M19.5 7a24 24 0 0 1 0 10",key:"8n60xe"}],["path",{d:"M4.5 7a24 24 0 0 0 0 10",key:"2lmadr"}],["path",{d:"M7 19.5a24 24 0 0 0 10 0",key:"1q94o2"}],["path",{d:"M7 4.5a24 24 0 0 1 10 0",key:"2z8ypa"}],["rect",{x:"17",y:"17",width:"5",height:"5",rx:"1",key:"1ac74s"}],["rect",{x:"17",y:"2",width:"5",height:"5",rx:"1",key:"1e7h5j"}],["rect",{x:"2",y:"17",width:"5",height:"5",rx:"1",key:"1t4eah"}],["rect",{x:"2",y:"2",width:"5",height:"5",rx:"1",key:"940dhs"}]],Xtt=qi("vector-square",Gtt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ytt=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Ztt=qi("workflow",Ytt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qtt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],kDe=qi("x",Qtt);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jtt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ent=qi("zap",Jtt),tu={100:"#bbdefb",300:"#64b5f6",500:"#2196f3",600:"#1e88e5",700:"#1976d2"},LDe={300:"#ff8a65ff",500:"#ff5722ff"},qc={50:"#fafafaff",100:"#f5f5f5ff",200:"#eeeeeeff",300:"#e0e0e0ff",400:"#bdbdbdff",600:"#757575ff",700:"#616161ff"},N2={300:"#4fc3f7ff",400:"#29b6f6ff",500:"#03a9f4ff",700:"#0288d1ff",900:"#01579bff"},EU={300:"#aed581ff"},xi={1:"#fcfdffff",100:"#e2e7f5ff",200:"#d3d9ebff",300:"#cad0e5ff",400:"#abb1c7ff",500:"#898ea3ff",600:"#656b7fff",700:"#4e5366ff",800:"#303547ff",900:"#111824ff",950:"#0b0f19ff"},RS={300:"#ffb74dff",400:"#ffa726ff",500:"#ff9800ff",700:"#f57c00ff",800:"#ef6c00ff",900:"#e65100ff"},M2={200:"#c2c5ff",300:"#9494ff",400:"#7e75ff",500:"#6047ff",600:"#5f36f5"},Yu={300:"#e57373ff",400:"#ef5350ff",500:"#f44336ff",600:"#e53935ff",700:"#d32f2fff",800:"#c62828ff"},AS={300:"#4db6acff",400:"#26a69aff",500:"#009688ff",600:"#00897bff",700:"#00796bff",900:"#004d40ff"},cfe={600:"#fdd835ff"},G_={common:{black:"#000000ff",white:"#ffffffff"},text:{primary:xi[1],secondary:xi[400],disabled:xi[700]},primary:{main:M2[300],dark:M2[500],light:M2[200],contrastText:xi[950]},secondary:{main:tu[300],dark:tu[700],light:tu[100],contrastText:xi[950]},error:{main:Yu[500],dark:Yu[700],light:Yu[300],contrastText:xi[1]},warning:{main:RS[400],dark:RS[700],light:RS[300],contrastText:xi[950]},info:{main:N2[400],dark:N2[700],light:N2[300],contrastText:xi[950]},success:{main:AS[400],dark:AS[700],light:AS[300],contrastText:xi[950]},action:{active:"#fcfdff8f",hover:"#fcfdff14",selected:"#fcfdff29",focus:"#fcfdff1f",disabled:"#fcfdff61",disabledBackground:"#fcfdff1f"},background:{default:xi[950],paper:"#111824ff",card:"#111824ff",code:"#111824",paperElevation0:xi[950],paperElevation1:"#111824ff",paperElevation2:"#141a2aff",paperElevation3:"#171d2cff",paperElevation4:"#191f2eff",paperElevation5:"#1c2130ff",paperElevation6:"#1e2433ff",paperElevation7:"#1e2433ff",paperElevation8:"#212635ff",paperElevation9:"#212635ff",paperElevation10:"#232937ff",paperElevation11:"#232937ff",paperElevation12:"#262b3aff",paperElevation13:"#262b3aff",paperElevation14:"#262b3aff",paperElevation15:"#282e3cff",paperElevation16:"#282e3cff",paperElevation17:"#282e3cff",paperElevation18:"#282e3cff",paperElevation19:"#282e3cff",paperElevation20:"#2b303eff",paperElevation21:"#2b303eff",paperElevation22:"#2b303eff",paperElevation23:"#2b303eff",paperElevation24:"#2b303eff"},elevationOutlined:"#ffffff1f",avatarFill:qc[600],inputStandardEnabledBorder:"#ffffff6b",inputStandardHoverBorder:"#ffffffff",switchKnobFillEnabled:qc[300],switchSlideFill:"#ffffff61",inputFilledEnabledFill:"#ffffff17",inputOutlinedEnabledBorder:"#ffffff3b",inputOutlinedHoverBorder:"#ffffffff",ratingEnabledBorder:"#ffffff3b",inputFilledHoverFill:"#ffffff1f",ratingActiveFill:"#ffb400ff",snackbarFill:"#1e2433ff",chipDefaultCloseFill:"#ffffffff",chipDefaultHoverFill:"#ffffff1f",chipDefaultEnabledBorder:qc[700],tooltipFill:"#616161e5",backdropFill:"#00000080",appBarDefaultFill:"#191f2eff",breadcrumbsCollapseFill:qc[600],alertErrorColor:"#f4c7c7ff",stepperConnector:qc[600],chipDefaultFocusFill:"#ffffff33",alertErrorBackground:"#291414ff",alertWarningColor:"#ffe2b7ff",alertWarningBackground:"#291d0bff",alertInfoColor:"#b8e7fbff",alertInfoBackground:"#0c2029ff",alertSuccessColor:"#cce8cdff",alertSuccessBackground:"#1a291cff",switchKnowFillDisabled:qc[600],nativeScrollbarBg:qc[700],divider:"#ffffff1f"},tnt={palette:G_,components:{MuiAlert:{styleOverrides:{root:{"&.MuiAlert-standardSuccess":{backgroundColor:G_.alertSuccessBackground,color:G_.alertSuccessColor},"&.MuiAlert-standardInfo":{backgroundColor:G_.alertInfoBackground,color:G_.alertInfoColor},"&.MuiAlert-standardWarning":{backgroundColor:G_.alertWarningBackground,color:G_.alertWarningColor},"&.MuiAlert-standardError":{backgroundColor:G_.alertErrorBackground,color:G_.alertErrorColor}}}}}},X_={common:{black:"#000000ff",white:"#ffffffff"},text:{primary:xi[900],secondary:xi[600],disabled:xi[400]},primary:{main:M2[500],dark:M2[600],light:M2[400],contrastText:xi[1]},secondary:{main:tu[500],dark:tu[700],light:tu[300],contrastText:xi[1]},error:{main:Yu[700],dark:Yu[800],light:Yu[400],contrastText:xi[1]},warning:{main:RS[800],dark:RS[900],light:RS[500],contrastText:xi[1]},info:{main:N2[700],dark:N2[900],light:N2[500],contrastText:xi[1]},success:{main:AS[600],dark:AS[900],light:AS[500],contrastText:xi[1]},action:{active:"#0b0f198f",hover:"#0b0f190a",selected:"#0b0f1914",focus:"#0b0f191f",disabled:"#0b0f1961",disabledBackground:"#0b0f191f"},background:{default:"#f7f8faff",paper:"#ffffffff",code:"#ffffff",paperElevation0:"#f7f8faff",paperElevation1:"#ffffffff",paperElevation2:"#ffffffff",paperElevation3:"#ffffffff",paperElevation4:"#ffffffff",paperElevation5:"#ffffffff",paperElevation6:"#ffffffff",paperElevation7:"#ffffffff",paperElevation8:"#ffffffff",paperElevation9:"#ffffffff",paperElevation10:"#ffffffff",paperElevation11:"#ffffffff",paperElevation12:"#ffffffff",paperElevation13:"#ffffffff",paperElevation14:"#ffffffff",paperElevation15:"#ffffffff",paperElevation16:"#ffffffff",paperElevation17:"#ffffffff",paperElevation18:"#ffffffff",paperElevation19:"#ffffffff",paperElevation20:"#ffffffff",paperElevation21:"#ffffffff",paperElevation22:"#ffffffff",paperElevation23:"#ffffffff",paperElevation24:"#ffffffff"},elevationOutlined:"#e0e0e0ff",avatarFill:qc[400],inputStandardEnabledBorder:"#0000006b",inputStandardHoverBorder:"#000000ff",switchKnobFillEnabled:qc[50],switchSlideFill:"#000000ff",inputFilledEnabledFill:"#0000000f",inputOutlinedEnabledBorder:"#0000003b",inputOutlinedHoverBorder:"#000000ff",ratingEnabledBorder:"#0000003b",inputFilledHoverFill:"#00000017",ratingActiveFill:"#ffb400ff",snackbarFill:"#323232ff",chipDefaultCloseFill:"#000000ff",chipDefaultHoverFill:"#0000001f",chipDefaultEnabledBorder:qc[400],tooltipFill:"#616161e5",backdropFill:"#00000080",appBarDefaultFill:qc[100],breadcrumbsCollapseFill:qc[100],alertErrorColor:"#5f2120ff",stepperConnector:qc[400],chipDefaultFocusFill:"#00000033",alertErrorBackground:"#fdededff",alertWarningColor:"#663c00ff",alertWarningBackground:"#fff4e5ff",alertInfoColor:"#014361ff",alertInfoBackground:"#e5f6fdff",alertSuccessColor:"#1e4641ff",alertSuccessBackground:"#edf7f5ff",switchKnowFillDisabled:qc[100],nativeScrollbarBg:qc[200],divider:"#0000001f"},nnt={palette:X_,components:{MuiButton:{styleOverrides:{outlined:({theme:i})=>({"&.MuiButton-colorTextPrimary":{border:`1px solid ${Pt(i.palette.divider,.12)}`}})}},MuiAlert:{styleOverrides:{root:{"&.MuiAlert-standardSuccess":{backgroundColor:X_.alertSuccessBackground,color:X_.alertSuccessColor},"&.MuiAlert-standardInfo":{backgroundColor:X_.alertInfoBackground,color:X_.alertInfoColor},"&.MuiAlert-standardWarning":{backgroundColor:X_.alertWarningBackground,color:X_.alertWarningColor},"&.MuiAlert-standardError":{backgroundColor:X_.alertErrorBackground,color:X_.alertErrorColor}}}}}},int={typography:{fontFamily:['"Mona Sans"',"-apple-system","BlinkMacSystemFont",'"Segoe UI"','"Roboto"','"Oxygen"','"Ubuntu"','"Cantarell"','"Fira Sans"','"Droid Sans"','"Helvetica Neue"',"sans-serif"].join(", "),allVariants:{fontFeatureSettings:"'ss01' on, 'ss05' on, 'ss06' on, 'liga' off, 'clig' off",textDecorationThickness:"1px",textUnderlineOffset:"2px","&:hover":{textDecorationThickness:"1px"}}},components:{MuiCardHeader:{styleOverrides:{root:({theme:i})=>({'&[variant="heading"]':{backgroundColor:Pt(i.palette.action.hover,.04),padding:"0.625rem 1rem",alignItems:"center","& .MuiCardHeader-title":{fontSize:"1.25rem",fontStyle:"normal",fontWeight:500,lineHeight:1,letterSpacing:"-0.03125rem",marginBottom:"-0.25rem"}}})}},MuiCard:{styleOverrides:{root:({theme:i})=>({borderRadius:"8px",border:`1px solid ${i.palette.divider}`,background:i.palette.background.paperElevation1})}},MuiCardContent:{styleOverrides:{root:({theme:i})=>({"&.MuiCardContent-variantHeading":{padding:"0.5rem 1rem","& .MuiTypography-body2":{color:i.palette.text.secondary,fontSize:"0.875rem",fontStyle:"normal",fontWeight:400,lineHeight:"150%"}}})}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.text.secondary,fontSize:"0.875rem",fontStyle:"normal",fontWeight:500,lineHeight:1.4,textTransform:"capitalize"})}},MuiTypography:{styleOverrides:{subtitle2:{fontSize:"0.875rem",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},h4:{fontWeight:600,fontSize:"32px",lineHeight:1.25,letterSpacing:"-0.5px"},h5:{fontWeight:600,fontSize:"24px",lineHeight:1.3},body1:{fontSize:"16px",fontWeight:400,lineHeight:1.5},body2:{fontSize:"14px",fontWeight:400,lineHeight:1.5},subtitle1:{fontSize:"16px",fontWeight:500,lineHeight:1.5}}},MuiButton:{styleOverrides:{root:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.5rem",padding:"0.5rem 1rem",fontSize:"0.875rem",fontStyle:"normal",fontWeight:500,lineHeight:"1.4",textTransform:"capitalize"},outlinedInherit:({theme:i})=>({border:`1px solid ${i.palette.divider}`,color:i.palette.text.primary,"&:hover":{backgroundColor:i.palette.action.hover,border:`1px solid ${i.palette.divider}`}}),containedPrimary:({theme:i})=>({background:i.palette.primary.main,color:i.palette.primary.contrastText,boxShadow:"none","&:hover":{background:i.palette.primary.dark,boxShadow:"none"}})}},MuiLink:{styleOverrides:{root:{textDecorationThickness:"1px",textUnderlineOffset:"2px","&:hover":{textDecorationThickness:"1px"}}}},MuiAlert:{styleOverrides:{root:{borderRadius:"0.5rem",padding:"0.375rem 1rem",fontSize:"0.875rem",fontWeight:400,lineHeight:1.5,"& .MuiAlert-icon":{fontSize:"1.375rem",marginRight:"0.75rem",padding:"0.4375rem 0"},"& .MuiAlert-message":{padding:"0.5rem 0","& .MuiAlertTitle-root":{fontSize:"1rem",fontWeight:500,lineHeight:1.5,marginBottom:"0.25rem"}}}}},MuiDialog:{styleOverrides:{paper:({ownerState:i})=>({borderRadius:i.fullScreen?0:"0.5rem"})}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:"0.5rem"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:"0.5rem"}}}}},rnt=a5(int),snt=i=>{const e=pl(pl(rnt,i.palette.mode==="dark"?tnt:nnt),i);return a5(e)},DDe=$.createContext();function EDe({children:i,initialMode:e}){const[n,r]=$.useState(e);$.useEffect(()=>{localStorage.setItem("qdrant-web-ui-theme",n)},[n]);const s=nn.useMemo(()=>snt({palette:{mode:n}}),[n]);return $.useEffect(()=>{const o=a=>{let l=a.data;if(typeof l=="string")try{l=JSON.parse(l)}catch(u){console.log("could not parse message payload as JSON",u)}const c=(l==null?void 0:l.mode)??(l==null?void 0:l.qdrantTheme)??l;(c==="light"||c==="dark")&&(r(c),a.source.postMessage(`{ status: 'success', message: 'Color mode changed to ${c}' }`,a.origin))};return window.addEventListener("message",o),()=>window.removeEventListener("message",o)},[r]),C.jsx(DDe.Provider,{value:{colorMode:n,setColorMode:r},children:C.jsx(KWe,{theme:s,children:i})})}EDe.propTypes={children:Z.node.isRequired,initialMode:Z.string.isRequired};function ont(){return $.useContext(DDe)}const ant=ye(fZe)(({theme:i})=>({borderRadius:i.shape.borderRadius[1],border:`0.5px solid ${i.palette.divider}`,background:i.palette.background.default,padding:"2px"})),ufe=ye(cZe)(({theme:i})=>({display:"flex",width:"64px",height:"28px",padding:"6px 21px",justifyContent:"center",alignItems:"center",border:"none",background:"transparent","&.Mui-selected":{borderRadius:i.shape.borderRadius*1,border:`1px solid ${Pt(i.palette.divider,.12)}`,background:i.palette.background.paper}})),dfe=ye("div")(()=>({width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center"}));function lnt(){const{colorMode:i,setColorMode:e}=ont(),n=(r,s)=>{s!==null&&e(s)};return C.jsxs(ant,{value:i,exclusive:!0,onChange:n,size:"small",children:[C.jsx(ufe,{value:"dark",children:C.jsx(ua,{title:"Dark Mode",children:C.jsx(dfe,{children:C.jsx(btt,{size:20})})})}),C.jsx(ufe,{value:"light",children:C.jsx(ua,{title:"Light Mode",children:C.jsx(dfe,{children:C.jsx(Htt,{size:20})})})})]})}const hfe=i=>new ResizeObserver(e=>{for(const n of e){const{target:r}=n,{width:s,height:o}=r.getBoundingClientRect();typeof i=="function"&&i(s,o)}}),IDe=function(i,e){const n=u=>u.split(".").map(d=>{const h=Number.parseInt(d,10);return Number.isNaN(h)?0:h}),[r=0,s=0,o=0]=n(i),[a=0,l=0,c=0]=n(e);return r!==a?r>a?1:-1:s!==l?s>l?1:-1:o!==c?o>c?1:-1:0},YZ=i=>{if(i==null)return null;const e=i.toString().trim().replace(/^v/i,"").split(".").map(n=>{const r=Number.parseInt(n,10);return Number.isNaN(r)?0:r});return e.length===0?null:e.join(".")},cnt=(i,e)=>{const n=YZ(i),r=YZ(e);return!n||!r?!1:IDe(n,r)===1},unt=i=>{const e=YZ(i);return e?`https://github.com/qdrant/qdrant/releases/tag/v${e}`:null},bse=i=>{const n="/dashboard/".replace(/\/?$/,"/"),r=i.startsWith("/")?i.slice(1):i;return`${n}${r}`},TDe=()=>{const n=$i().palette.mode==="dark"?"logo-red-white.svg":"logo-red-black.svg",r=bse(n);return C.jsx("img",{src:r,alt:"logo",width:"100px"})},ffe=240,dnt=ye("div")(({theme:i})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:i.spacing(0,1),...i.mixins.toolbar})),hnt=ye(pLe)(()=>({width:ffe,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box","& .MuiDrawer-paper":{width:ffe,overflowX:"hidden"}})),RDe=ye(NKe,{shouldForwardProp:i=>i!=="isActive"})(({theme:i,isActive:e})=>({display:"flex",height:"40px",padding:"8px 12px",justifyContent:"space-between",alignItems:"center",alignSelf:"stretch",borderRadius:"8px","& .MuiListItemText-primary, & .MuiListItemIcon-root":{color:i.palette.text.secondary},"&:hover":{backgroundColor:Pt(i.palette.primary.light,.05)},...e&&{backgroundColor:Pt(i.palette.primary.light,.08),"& .MuiListItemIcon-root":{color:i.palette.primary.main},"& .MuiListItemText-primary":{color:i.palette.text.primary}}})),fnt=ye(tse)(()=>({display:"flex",padding:"24px 12px 0 12px",flexDirection:"column",alignItems:"flex-start",flex:"1 0 0",alignSelf:"stretch"})),pnt=ye(nse)(()=>({display:"flex",padding:"0.5rem 0.75rem",justifyContent:"flex-start",alignItems:"center",gap:"0.75rem",alignSelf:"stretch","& a":{textDecoration:"none","&:hover":{textDecoration:"underline",textDecorationThickness:"1px",textUnderlineOffset:"2px"}}})),gnt=ye(Je)(({theme:i})=>({color:i.palette.text.secondary,fontFeatureSettings:"'ss01' on, 'ss05' on, 'ss06' on, 'liga' off, 'clig' off",fontFamily:"Mona Sans, sans-serif",fontSize:"12px",fontStyle:"normal",fontWeight:400,lineHeight:"150%"})),pfe=ye(tse)(({theme:i})=>({marginTop:"auto",borderTop:`1px solid ${i.palette.divider}`,padding:"1rem"})),b5=$.createContext();function ADe({children:i}){const[e,n]=$.useState(null),[r,s]=$.useState(null),[o,a]=$.useState(!1),[l,c]=$.useState(!0),[u,d]=$.useState(null),{client:h}=Ur();return $.useEffect(()=>{async function f(){var p,g,m;try{const _=await h.api("service").telemetry();n(_.data.result.app.version),a(((p=_.data.result.app)==null?void 0:p.jwt_rbac)||!1),s((g=_.data.result.collections)==null?void 0:g.max_collections),(m=_.data.result.app)!=null&&m.hide_jwt_dashboard&&c(!1),d(null)}catch(_){_.status===403||_.status===401?d(_):console.log("error fetching telemetry",_)}}f()},[h]),C.jsx(b5.Provider,{value:{version:e,maxCollections:r,setMaxCollections:s,jwtEnabled:o,jwtVisible:l,authError:u,clearAuthError:()=>d(null)},children:i})}ADe.propTypes={children:Z.node.isRequired};function NDe(){const i=$.useContext(b5);if(i===void 0)throw new Error("useVersion must be used within a TelemetryProvider");return{version:i.version}}function mnt(){const i=$.useContext(b5);if(i===void 0)throw new Error("useMaxCollections must be used within a TelemetryProvider");return{maxCollections:i.maxCollections,setMaxCollections:i.setMaxCollections}}function _nt(){const i=$.useContext(b5);if(i===void 0)throw new Error("useJwt must be used within a TelemetryProvider");return{jwtEnabled:i.jwtEnabled,jwtVisible:i.jwtVisible}}function vnt(){const i=$.useContext(b5);if(i===void 0)throw new Error("useAuthError must be used within a TelemetryProvider");return{authError:i.authError,clearAuthError:i.clearAuthError}}const IU={},MDe=$.createContext(),bnt=bse("/cloud/data.json");function PDe({children:i}){const[e,n]=$.useState(null),[r,s]=$.useState(null),[o,a]=$.useState(!0),l=$.useMemo(()=>{const d=IU==null?void 0:IU.VITE_CLOUD_INFO_PATH;return typeof d=="string"&&d.trim().length>0?d:bnt},[]),c=$.useCallback(async()=>{a(!0),s(null);try{const d=await kE.get(l);n(d.data)}catch(d){s(d),n(null)}finally{a(!1)}},[l]);$.useEffect(()=>{c()},[c]);const u=$.useMemo(()=>({cloudInfo:e,error:r,isLoading:o,reload:c}),[e,r,o,c]);return C.jsx(MDe.Provider,{value:u,children:i})}PDe.propTypes={children:Z.node.isRequired};function ODe(){const i=$.useContext(MDe);if(i===void 0)throw new Error("useCloudInfo must be used within a CloudInfoProvider");return i}const HL={},FDe=$.createContext(),ynt="https://qdrant.tech/web-ui-info.json";function BDe({children:i}){const[e,n]=$.useState(null),[r,s]=$.useState(null),[o,a]=$.useState(!0),l=$.useMemo(()=>{const d=(HL==null?void 0:HL.VITE_EXTERNAL_INFO_PATH)??(HL==null?void 0:HL.VITE_WEB_INFO_PATH);return typeof d=="string"&&d.trim().length>0?d:ynt},[]),c=$.useCallback(async()=>{a(!0),s(null);try{const d=await fetch(l);if(!d.ok)throw new Error(`Failed to load external info: ${d.status}`);const h=await d.json();n(h)}catch(d){console.error("Error fetching external info:",d),s(d),n(null)}finally{a(!1)}},[l]);$.useEffect(()=>{c()},[c]);const u=$.useMemo(()=>({externalInfo:e,error:r,isLoading:o,reload:c,banner:e==null?void 0:e.banner,latestVersion:e==null?void 0:e.latest_version}),[e,r,o,c]);return C.jsx(FDe.Provider,{value:u,children:i})}BDe.propTypes={children:Z.node.isRequired};function jDe(){const i=$.useContext(FDe);if(i===void 0)throw new Error("useExternalInfo must be used within an ExternalInfoProvider");return i}function wnt(){const{version:i}=NDe(),{jwtEnabled:e,jwtVisible:n}=_nt(),{isRestricted:r}=Ur(),s=Wv(),{cloudInfo:o}=ODe(),{latestVersion:a}=jDe(),l=nn.useMemo(()=>cnt(a,i),[a,i]),c=nn.useMemo(()=>unt(a),[a]),u=h=>s.pathname===h||s.pathname.startsWith(h+"/"),d=(o==null?void 0:o.support_url)||l&&c;return C.jsxs(hnt,{variant:"permanent",children:[C.jsx(dnt,{sx:{justifyContent:"start",paddingLeft:"24px",paddingRight:"24px"},children:C.jsx(TDe,{width:120})}),C.jsx(SE,{}),C.jsxs(fnt,{children:[(o==null?void 0:o.cloud_backlink)&&C.jsx(b0,{title:"Back to Cloud",icon:C.jsx(Qet,{size:"16px"}),linkTo:o.cloud_backlink,active:u(o.cloud_backlink),disabled:!(o!=null&&o.cloud_backlink)}),!r&&C.jsx(b0,{title:"Welcome",icon:C.jsx(xDe,{size:"16px"}),linkTo:"/welcome",active:u("/welcome"),disabled:!1}),C.jsx(b0,{title:"Console",icon:C.jsx(ztt,{size:"16px"}),linkTo:"/console",active:u("/console"),disabled:!1}),C.jsx(b0,{title:"Collections",icon:C.jsx(Dtt,{size:"16px"}),linkTo:"/collections",active:u("/collections"),disabled:!1}),!r&&C.jsx(b0,{title:"Tutorial",icon:C.jsx(jet,{size:"16px"}),linkTo:"/tutorial",active:u("/tutorial"),disabled:!1}),!r&&Cnt("Datasets",C.jsx(_se,{size:"16px"}),"/datasets",s),!r&&n&&C.jsx(b0,{title:"Access Tokens",icon:C.jsx(ftt,{size:"16px"}),linkTo:"/jwt",active:u("/jwt"),disabled:!e})]}),d&&C.jsxs(pfe,{children:[(o==null?void 0:o.support_url)&&C.jsx(b0,{title:"Get Support",icon:C.jsx(Ket,{size:"16px"}),linkTo:o.support_url,active:!1,disabled:!1}),l&&c&&C.jsx(b0,{title:"Update Available",icon:C.jsx(dtt,{size:"16px"}),linkTo:c,active:!1,disabled:!1})]}),C.jsx(pfe,{children:C.jsx(pnt,{children:C.jsxs(gnt,{variant:"caption",children:["Qdrant v",i||"???"]})})})]})}function Cnt(i,e,n,r,s=!0){const o=r.pathname===n||r.pathname.startsWith(n+"/");return C.jsx(nse,{disablePadding:!0,sx:{display:"block"},children:C.jsxs(RDe,{component:lh,to:n,disabled:!s,isActive:o,children:[C.jsx(_Le,{sx:{minWidth:0,mr:3,justifyContent:"center"},children:e}),C.jsx(vLe,{primary:i})]})},i)}function b0({title:i,icon:e,linkTo:n,active:r=!1,disabled:s=!1}){return C.jsx(nse,{disablePadding:!0,sx:{display:"block"},children:C.jsxs(RDe,{component:lh,to:n,disabled:s,isActive:r,children:[C.jsx(_Le,{sx:{minWidth:0,mr:3,justifyContent:"center"},children:e}),C.jsx(vLe,{primary:i})]})},i)}b0.propTypes={title:Z.string.isRequired,icon:Z.element.isRequired,linkTo:Z.string.isRequired,active:Z.bool,disabled:Z.bool};const Snt=ye("div")(({theme:i})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:i.spacing(0,1),...i.mixins.toolbar}));function xnt(){const i=$i(),{authError:e,clearAuthError:n}=vnt(),{cloudInfo:r}=ODe(),[s,o]=$.useState(!1),[a,l]=$.useState(!1);$.useEffect(()=>{o(window.self!==window.top)},[]),$.useEffect(()=>{e&&l(!0)},[e]);const c=d=>{l(d),d||n()},u=()=>{window.location.reload()};return C.jsxs(Ye,{sx:{display:"flex"},children:[C.jsx(cLe,{}),s?C.jsx(C.Fragment,{}):C.jsxs(C.Fragment,{children:[C.jsx(zke,{position:"fixed",sx:{zIndex:d=>d.zIndex.drawer,background:i.palette.background.paper,boxShadow:"none",borderBottom:`1px solid ${i.palette.divider}`},children:C.jsxs(ELe,{children:[C.jsx(TDe,{width:200}),r!=null&&r.cluster_name?C.jsxs(Ye,{sx:{flexGrow:1,pl:"140px",display:"flex",alignItems:"center",gap:1},children:[C.jsx(Je,{variant:"body1",sx:{color:i.palette.text.primary},children:"cluster"}),C.jsx(Je,{variant:"body1",sx:{color:i.palette.text.primary},children:"/"}),C.jsx(Je,{component:lh,to:r.cloud_backlink,variant:"body1",sx:{color:i.palette.text.primary,fontWeight:500,textDecoration:"none","&:hover":{textDecoration:"underline",textDecorationThickness:"1px",textUnderlineOffset:"2px"}},children:r.cluster_name})]}):C.jsx(Ye,{sx:{flexGrow:1}}),(r==null?void 0:r.scale_url)&&C.jsx(Ci,{component:lh,to:r.scale_url,target:"_blank",variant:"contained",color:"primary",size:"small",endIcon:C.jsx(xDe,{size:16}),sx:{mr:2},children:"Upgrade Cluster"}),C.jsxs(Ye,{sx:{display:"flex",alignItems:"center",gap:2},children:[C.jsx(ua,{title:"API Key",children:C.jsx(Ga,{size:"large",onClick:()=>l(!0),children:C.jsx(gtt,{size:20})})}),C.jsx(lnt,{})]})]})}),C.jsx(wnt,{})]}),C.jsxs(Ye,{component:"main",sx:{flexGrow:1,overflow:"hidden"},children:[s?C.jsx(C.Fragment,{}):C.jsx(Snt,{}),C.jsx(lQe,{})]}),C.jsx(yDe,{open:a,setOpen:c,onApply:u})]})}function knt(){return C.jsx(ADe,{children:C.jsx(PDe,{children:C.jsx(BDe,{children:C.jsx(xnt,{})})})})}const{createElement:LE,createContext:Lnt,forwardRef:WDe,useCallback:Ub,useContext:$De,useEffect:hv,useImperativeHandle:zDe,useLayoutEffect:Dnt,useMemo:Ent,useRef:af,useState:GN}=ZS,gfe=ZS.useId,Int=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",k9=Int?Dnt:()=>{},Tnt=typeof gfe=="function"?gfe:()=>null;let Rnt=0;function yse(i=null){const e=Tnt(),n=af(i||e||null);return n.current===null&&(n.current=""+Rnt++),n.current}const VW=Lnt(null);VW.displayName="PanelGroupContext";function VDe({children:i=null,className:e="",collapsible:n=!1,defaultSize:r=null,forwardedRef:s,id:o=null,maxSize:a=100,minSize:l=10,onCollapse:c=null,onResize:u=null,order:d=null,style:h={},tagName:f="div"}){const p=$De(VW);if(p===null)throw Error("Panel components must be rendered within a PanelGroup container");const g=yse(o),{collapsePanel:m,expandPanel:_,getPanelStyle:b,registerPanel:y,resizePanel:x,unregisterPanel:k}=p,D=af({onCollapse:c,onResize:u});if(hv(()=>{D.current.onCollapse=c,D.current.onResize=u}),l<0||l>100)throw Error(`Panel minSize must be between 0 and 100, but was ${l}`);if(a<0||a>100)throw Error(`Panel maxSize must be between 0 and 100, but was ${a}`);if(r!==null){if(r<0||r>100)throw Error(`Panel defaultSize must be between 0 and 100, but was ${r}`);l>r&&!n&&(console.error(`Panel minSize ${l} cannot be greater than defaultSize ${r}`),r=l)}const R=b(g,r),E=af({size:mfe(R)}),A=af({callbacksRef:D,collapsible:n,defaultSize:r,id:g,maxSize:a,minSize:l,order:d});return k9(()=>{E.current.size=mfe(R),A.current.callbacksRef=D,A.current.collapsible=n,A.current.defaultSize=r,A.current.id=g,A.current.maxSize=a,A.current.minSize=l,A.current.order=d}),k9(()=>(y(g,A),()=>{k(g)}),[d,g,y,k]),zDe(s,()=>({collapse:()=>m(g),expand:()=>_(g),getCollapsed(){return E.current.size===0},getSize(){return E.current.size},resize:M=>x(g,M)}),[m,_,g,x]),LE(f,{children:i,className:e,"data-panel":"","data-panel-collapsible":n||void 0,"data-panel-id":g,"data-panel-size":parseFloat(""+R.flexGrow).toFixed(1),id:`data-panel-id-${g}`,style:{...R,...h}})}const ix=WDe((i,e)=>LE(VDe,{...i,forwardedRef:e}));VDe.displayName="Panel";ix.displayName="forwardRef(Panel)";function mfe(i){const{flexGrow:e}=i;return typeof e=="string"?parseFloat(e):e}const rx=10;function nN(i,e,n,r,s,o,a,l){const{sizes:c}=l||{},u=c||o;if(s===0)return u;const d=ef(e),h=u.concat();let f=0;{const m=s<0?r:n,_=d.findIndex(k=>k.current.id===m),b=d[_],y=u[_],x=_fe(b,Math.abs(s),y,i);if(y===x)return u;x===0&&y>0&&a.set(m,y),s=s<0?y-x:x-y}let p=s<0?n:r,g=d.findIndex(m=>m.current.id===p);for(;;){const m=d[g],_=u[g],b=Math.abs(s)-Math.abs(f),y=_fe(m,0-b,_,i);if(_!==y&&(y===0&&_>0&&a.set(m.current.id,_),f+=_-y,h[g]=y,f.toPrecision(rx).localeCompare(Math.abs(s).toPrecision(rx),void 0,{numeric:!0})>=0))break;if(s<0){if(--g<0)break}else if(++g>=d.length)break}return f===0?u:(p=s<0?r:n,g=d.findIndex(m=>m.current.id===p),h[g]=u[g]+f,h)}function UL(i,e,n){e.forEach((r,s)=>{const{callbacksRef:o,collapsible:a,id:l}=i[s].current,c=n[l];if(c!==r){n[l]=r;const{onCollapse:u,onResize:d}=o.current;d&&d(r),a&&u&&(!c&&r!==0?u(!1):c!==0&&r===0&&u(!0))}})}function TU(i,e){if(e.length<2)return[null,null];const n=e.findIndex(a=>a.current.id===i);if(n<0)return[null,null];const r=n===e.length-1,s=r?e[n-1].current.id:i,o=r?i:e[n+1].current.id;return[s,o]}function HDe(i,e,n){if(i.size===1)return"100";const s=ef(i).findIndex(a=>a.current.id===e),o=n[s];return o==null?"0":o.toPrecision(rx)}function Ant(i){const e=document.querySelector(`[data-panel-id="${i}"]`);return e||null}function wse(i){const e=document.querySelector(`[data-panel-group-id="${i}"]`);return e||null}function HW(i){const e=document.querySelector(`[data-panel-resize-handle-id="${i}"]`);return e||null}function Nnt(i){return UDe().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===i)??null}function UDe(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function qDe(i){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${i}"]`))}function Cse(i,e,n){var c,u,d,h;const r=HW(e),s=qDe(i),o=r?s.indexOf(r):-1,a=((u=(c=n[o])==null?void 0:c.current)==null?void 0:u.id)??null,l=((h=(d=n[o+1])==null?void 0:d.current)==null?void 0:h.id)??null;return[a,l]}function ef(i){return Array.from(i.values()).sort((e,n)=>{const r=e.current.order,s=n.current.order;return r==null&&s==null?0:r==null?-1:s==null?1:r-s})}function _fe(i,e,n,r){var a;const s=n+e;if(i.current.collapsible){if(n>0){if(s<=i.current.minSize/2)return 0}else if(!((a=r==null?void 0:r.type)==null?void 0:a.startsWith("key"))&&s<i.current.minSize)return 0}return Math.min(i.current.maxSize,Math.max(i.current.minSize,s))}function KDe(i,e="Assertion failed!"){if(!i)throw console.error(e),Error(e)}function Mnt({committedValuesRef:i,groupId:e,panels:n,setSizes:r,sizes:s,panelSizeBeforeCollapse:o}){hv(()=>{const{direction:a,panels:l}=i.current,c=wse(e),{height:u,width:d}=c.getBoundingClientRect(),f=qDe(e).map(p=>{const g=p.getAttribute("data-panel-resize-handle-id"),m=ef(l),[_,b]=Cse(e,g,m);if(_==null||b==null)return()=>{};let y=0,x=100,k=0,D=0;m.forEach(P=>{P.current.id===_?(x=P.current.maxSize,y=P.current.minSize):(k+=P.current.minSize,D+=P.current.maxSize)});const R=Math.min(x,100-k),E=Math.max(y,(m.length-1)*100-D),A=HDe(l,_,s);p.setAttribute("aria-valuemax",""+Math.round(R)),p.setAttribute("aria-valuemin",""+Math.round(E)),p.setAttribute("aria-valuenow",""+Math.round(parseInt(A)));const M=P=>{if(!P.defaultPrevented)switch(P.key){case"Enter":{P.preventDefault();const O=m.findIndex(B=>B.current.id===_);if(O>=0){const B=m[O],j=s[O];if(j!=null){let z=0;j.toPrecision(rx)<=B.current.minSize.toPrecision(rx)?z=a==="horizontal"?d:u:z=-(a==="horizontal"?d:u);const H=nN(P,l,_,b,z,s,o.current,null);s!==H&&r(H)}}break}}};p.addEventListener("keydown",M);const N=Ant(_);return N!=null&&p.setAttribute("aria-controls",N.id),()=>{p.removeAttribute("aria-valuemax"),p.removeAttribute("aria-valuemin"),p.removeAttribute("aria-valuenow"),p.removeEventListener("keydown",M),N!=null&&p.removeAttribute("aria-controls")}});return()=>{f.forEach(p=>p())}},[i,e,n,o,r,s])}function Pnt({disabled:i,handleId:e,resizeHandler:n}){hv(()=>{if(i||n==null)return;const r=HW(e);if(r==null)return;const s=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const a=UDe(),l=Nnt(e);KDe(l!==null);const c=o.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",s),()=>{r.removeEventListener("keydown",s)}},[i,e,n])}function Ont(i,e){if(i.length!==e.length)return!1;for(let n=0;n<i.length;n++)if(i[n]!==e[n])return!1;return!0}function GDe(i,e,n,r=0,s=null){const o=n==="horizontal";let a=0;if(ZZ(i))a=o?i.clientX:i.clientY;else if(QZ(i)){const d=i.touches[0];a=o?d.screenX:d.screenY}else return 0;const l=HW(e),c=s||l.getBoundingClientRect(),u=o?c.left:c.top;return a-u-r}function Fnt(i,e,n,r,s,o,a){const{dragOffset:l=0,dragHandleRect:c,sizes:u}=a||{},d=u||o;if(Bnt(i)){const h=s==="horizontal",p=wse(e).getBoundingClientRect(),g=h?p.width:p.height,m=i.shiftKey?10:100,_=g/m;let b=0;switch(i.key){case"ArrowDown":b=h?0:_;break;case"ArrowLeft":b=h?-_:0;break;case"ArrowRight":b=h?_:0;break;case"ArrowUp":b=h?0:-_;break;case"End":b=g;break;case"Home":b=-g;break}const[y,x]=Cse(e,n,r),k=b<0?y:x,D=r.findIndex(E=>E.current.id===k),R=r[D];if(R.current.collapsible){const E=d[D];(E===0||E.toPrecision(rx)===R.current.minSize.toPrecision(rx))&&(b=b<0?-R.current.minSize*g:R.current.minSize*g)}return b}else return GDe(i,n,s,l,c)}function Bnt(i){return i.type==="keydown"}function ZZ(i){return i.type.startsWith("mouse")}function QZ(i){return i.type.startsWith("touch")}let JZ=null,hS=null;function XDe(i){switch(i){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function jnt(){hS!==null&&(document.head.removeChild(hS),JZ=null,hS=null)}function RU(i){if(JZ===i)return;JZ=i;const e=XDe(i);hS===null&&(hS=document.createElement("style"),document.head.appendChild(hS)),hS.innerHTML=`*{cursor: ${e}!important;}`}function Wnt(i,e=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{i(...s)},e)}}function YDe(i){return i.map(e=>{const{minSize:n,order:r}=e.current;return r?`${r}:${n}`:`${n}`}).sort((e,n)=>e.localeCompare(n)).join(",")}function ZDe(i,e){try{const n=e.getItem(`PanelGroup:sizes:${i}`);if(n){const r=JSON.parse(n);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function $nt(i,e,n){const r=ZDe(i,n);if(r){const s=YDe(e);return r[s]??null}return null}function znt(i,e,n,r){const s=YDe(e),o=ZDe(i,r)||{};o[s]=n;try{r.setItem(`PanelGroup:sizes:${i}`,JSON.stringify(o))}catch(a){console.error(a)}}const AU={};function vfe(i){try{if(typeof localStorage<"u")i.getItem=e=>localStorage.getItem(e),i.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),i.getItem=()=>null,i.setItem=()=>{}}}const iN={getItem:i=>(vfe(iN),iN.getItem(i)),setItem:(i,e)=>{vfe(iN),iN.setItem(i,e)}};function QDe({autoSaveId:i,children:e=null,className:n="",direction:r,disablePointerEventsDuringResize:s=!1,forwardedRef:o,id:a=null,onLayout:l,storage:c=iN,style:u={},tagName:d="div"}){const h=yse(a),[f,p]=GN(null),[g,m]=GN(new Map),_=af(null),b=af({onLayout:l});hv(()=>{b.current.onLayout=l});const y=af({}),[x,k]=GN([]),D=af(new Map),R=af(0),E=af({direction:r,panels:g,sizes:x});zDe(o,()=>({getLayout:()=>{const{sizes:Y}=E.current;return Y},setLayout:Y=>{const X=Y.reduce((ee,le)=>ee+le,0);KDe(X===100,"Panel sizes must add up to 100%");const{panels:Q}=E.current,ie=y.current,K=ef(Q);UL(K,Y,ie),k(Y)}}),[]),k9(()=>{E.current.direction=r,E.current.panels=g,E.current.sizes=x}),Mnt({committedValuesRef:E,groupId:h,panels:g,setSizes:k,sizes:x,panelSizeBeforeCollapse:D}),hv(()=>{const{onLayout:Y}=b.current;if(Y){const{panels:X,sizes:Q}=E.current;if(Q.length>0){Y(Q);const ie=y.current,K=ef(X);UL(K,Q,ie)}}},[x]),k9(()=>{if(E.current.sizes.length===g.size)return;let X=null;if(i){const Q=ef(g);X=$nt(i,Q,c)}if(X!=null)k(X);else{const Q=ef(g);let ie=0,K=0,ee=0;if(Q.forEach(le=>{ee+=le.current.minSize,le.current.defaultSize===null?ie++:K+=le.current.defaultSize}),K>100)throw new Error("Default panel sizes cannot exceed 100%");if(Q.length>1&&ie===0&&K!==100)throw new Error("Invalid default sizes specified for panels");if(ee>100)throw new Error("Minimum panel sizes cannot exceed 100%");k(Q.map(le=>le.current.defaultSize===null?(100-K)/ie:le.current.defaultSize))}},[i,g,c]),hv(()=>{if(i){if(x.length===0||x.length!==g.size)return;const Y=ef(g);AU[i]||(AU[i]=Wnt(znt,100)),AU[i](i,Y,x,c)}},[i,g,x,c]);const A=Ub((Y,X)=>{const{panels:Q}=E.current;return Q.size===0?{flexBasis:0,flexGrow:X??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:HDe(Q,Y,x),flexShrink:1,overflow:"hidden",pointerEvents:s&&f!==null?"none":void 0}},[f,s,x]),M=Ub((Y,X)=>{m(Q=>{if(Q.has(Y))return Q;const ie=new Map(Q);return ie.set(Y,X),ie})},[]),N=Ub(Y=>Q=>{Q.preventDefault();const{direction:ie,panels:K,sizes:ee}=E.current,le=ef(K),[ke,xe]=Cse(h,Y,le);if(ke==null||xe==null)return;let me=Fnt(Q,h,Y,le,ie,ee,_.current);if(me===0)return;const je=wse(h).getBoundingClientRect(),qe=ie==="horizontal";document.dir==="rtl"&&qe&&(me=-me);const Ze=qe?je.width:je.height,We=me/Ze*100,ut=nN(Q,K,ke,xe,We,ee,D.current,_.current),st=!Ont(ee,ut);if((ZZ(Q)||QZ(Q))&&R.current!=We&&RU(st?qe?"horizontal":"vertical":qe?me<0?"horizontal-min":"horizontal-max":me<0?"vertical-min":"vertical-max"),st){const mt=y.current;UL(le,ut,mt),k(ut)}R.current=We},[h]),P=Ub(Y=>{m(X=>{if(!X.has(Y))return X;const Q=new Map(X);return Q.delete(Y),Q})},[]),O=Ub(Y=>{const{panels:X,sizes:Q}=E.current,ie=X.get(Y);if(ie==null||!ie.current.collapsible)return;const K=ef(X),ee=K.indexOf(ie);if(ee<0)return;const le=Q[ee];if(le===0)return;D.current.set(Y,le);const[ke,xe]=TU(Y,K);if(ke==null||xe==null)return;const Ee=ee===K.length-1?le:0-le,je=nN(null,X,ke,xe,Ee,Q,D.current,null);if(Q!==je){const qe=y.current;UL(K,je,qe),k(je)}},[]),B=Ub(Y=>{const{panels:X,sizes:Q}=E.current,ie=X.get(Y);if(ie==null)return;const K=D.current.get(Y)||ie.current.minSize;if(!K)return;const ee=ef(X),le=ee.indexOf(ie);if(le<0||Q[le]!==0)return;const[xe,me]=TU(Y,ee);if(xe==null||me==null)return;const je=le===ee.length-1?0-K:K,qe=nN(null,X,xe,me,je,Q,D.current,null);if(Q!==qe){const Ze=y.current;UL(ee,qe,Ze),k(qe)}},[]),j=Ub((Y,X)=>{const{panels:Q,sizes:ie}=E.current,K=Q.get(Y);if(K==null)return;const ee=ef(Q),le=ee.indexOf(K);if(le<0)return;const ke=ie[le];if(ke===X)return;K.current.collapsible&&X===0||(X=Math.min(K.current.maxSize,Math.max(K.current.minSize,X)));const[xe,me]=TU(Y,ee);if(xe==null||me==null)return;const je=le===ee.length-1?ke-X:X-ke,qe=nN(null,Q,xe,me,je,ie,D.current,null);if(ie!==qe){const Ze=y.current;UL(ee,qe,Ze),k(qe)}},[]),z=Ent(()=>({activeHandleId:f,collapsePanel:O,direction:r,expandPanel:B,getPanelStyle:A,groupId:h,registerPanel:M,registerResizeHandle:N,resizePanel:j,startDragging:(Y,X)=>{if(p(Y),ZZ(X)||QZ(X)){const Q=HW(Y);_.current={dragHandleRect:Q.getBoundingClientRect(),dragOffset:GDe(X,Y,r),sizes:E.current.sizes}}},stopDragging:()=>{jnt(),p(null),_.current=null},unregisterPanel:P}),[f,O,r,B,A,h,M,N,j,P]),H={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return LE(VW.Provider,{children:LE(d,{children:e,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h,style:{...H,...u}}),value:z})}const UW=WDe((i,e)=>LE(QDe,{...i,forwardedRef:e}));QDe.displayName="PanelGroup";UW.displayName="forwardRef(PanelGroup)";function qW({children:i=null,className:e="",disabled:n=!1,id:r=null,onDragging:s,style:o={},tagName:a="div"}){const l=af(null),c=af({onDragging:s});hv(()=>{c.current.onDragging=s});const u=$De(VW);if(u===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:d,direction:h,groupId:f,registerResizeHandle:p,startDragging:g,stopDragging:m}=u,_=yse(r),b=d===_,[y,x]=GN(!1),[k,D]=GN(null),R=Ub(()=>{l.current.blur(),m();const{onDragging:M}=c.current;M&&M(!1)},[m]);hv(()=>{if(n)D(null);else{const A=p(_);D(()=>A)}},[n,_,p]),hv(()=>{if(n||k==null||!b)return;const A=O=>{k(O)},M=O=>{k(O)},P=l.current.ownerDocument;return P.body.addEventListener("contextmenu",R),P.body.addEventListener("mousemove",A),P.body.addEventListener("touchmove",A),P.body.addEventListener("mouseleave",M),window.addEventListener("mouseup",R),window.addEventListener("touchend",R),()=>{P.body.removeEventListener("contextmenu",R),P.body.removeEventListener("mousemove",A),P.body.removeEventListener("touchmove",A),P.body.removeEventListener("mouseleave",M),window.removeEventListener("mouseup",R),window.removeEventListener("touchend",R)}},[h,n,b,k,R]),Pnt({disabled:n,handleId:_,resizeHandler:k});const E={cursor:XDe(h),touchAction:"none",userSelect:"none"};return LE(a,{children:i,className:e,"data-resize-handle-active":b?"pointer":y?"keyboard":void 0,"data-panel-group-direction":h,"data-panel-group-id":f,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_,onBlur:()=>x(!1),onFocus:()=>x(!0),onMouseDown:A=>{g(_,A.nativeEvent);const{onDragging:M}=c.current;M&&M(!0)},onMouseUp:R,onTouchCancel:R,onTouchEnd:R,onTouchStart:A=>{g(_,A.nativeEvent);const{onDragging:M}=c.current;M&&M(!0)},ref:l,role:"separator",style:{...E,...o},tabIndex:0})}qW.displayName="PanelResizeHandle";function XN(i){let n=i.split("?")[0].split(/\s+/);if(n.length==3&&n[2]==""&&n.pop(),n.length!=2)return n;let r=n[0],s=n[1];s=s.replace(/^\//,"");let o=s.split("/");return[r,...o]}class Vnt{constructor(e,n,r,s,o,a,l){this.method=e,this.path=n,this.body=r,this.operationId=s,this.tags=o,this.parameters=a,this.summary=l}}class JDe{constructor(e){this.openapi=e}getAllMethods(){var n,r,s,o,a,l;let e=[];for(let c in this.openapi.paths)for(let u in this.openapi.paths[c])e.push(new Vnt(u,c,(a=(o=(s=(r=(n=this.openapi.paths[c][u])==null?void 0:n.requestBody)==null?void 0:r.content)==null?void 0:s["application/json"])==null?void 0:o.schema)==null?void 0:a.$ref,this.openapi.paths[c][u].operationId,this.openapi.paths[c][u].tags,(l=this.openapi.paths[c][u])==null?void 0:l.parameters,this.openapi.paths[c][u].summary));return e}objectByRef(e){let n=e.split("/");n.shift();let r=this.openapi;for(let s of n)r=r[s];return r}_objectsByPath(e,n){let r=e;if(typeof r!="object"||r===null)return[];if(r!=null&&r.$ref)return this._objectsByPath(this.objectByRef(r.$ref),n);if(r!=null&&r.anyOf){let a=[];for(let l of r.anyOf)l!=null&&l.$ref&&a.push(...this._objectsByPath(this.objectByRef(l.$ref),n)),((l==null?void 0:l.type)==="object"||(l==null?void 0:l.type)==="array")&&a.push(...this._objectsByPath(l,n));return a}if(r!=null&&r.oneOf){let a=[];for(let l of r.oneOf)l!=null&&l.$ref&&a.push(...this._objectsByPath(this.objectByRef(l.$ref),n)),(l==null?void 0:l.type)==="object"&&a.push(...this._objectsByPath(l,n));return a}if(n===null)return[];if(n.length==0)return[r];let s=n[0],o=n.slice(1);if(typeof s=="number"||s instanceof Number)return(r==null?void 0:r.type)!="array"?[]:r!=null&&r.items?this._objectsByPath(r.items,o):[];if(typeof s=="string"||s instanceof String){if((r==null?void 0:r.type)!="object")return[];if(r!=null&&r.additionalProperties){let l=r.additionalProperties;return this._objectsByPath(l,o)}if(!(r!=null&&r.properties))return[];if(!(r!=null&&r.properties[s]))return[];let a=r.properties[s];return this._objectsByPath(a,o)}return[]}objectsByPath(e,n){let r=this.objectByRef(e);return this._objectsByPath(r,n)}allProperties(e,n,r){let s=this.objectsByPath(e,n),o=[];for(let a of s)if(a!=null&&a.properties)for(let l in a.properties)l.startsWith(r)&&o.push(l);return o}allEnumValues(e,n,r,s){const o=this.objectsByPath(e,n),a=[];function l(c,u){const d=[];return c.forEach(h=>{h!=null&&h.enum&&d.push(...h.enum.filter(f=>f.startsWith(u)))}),d}return o.forEach(c=>{c!=null&&c.properties&&Object.entries(c.properties).forEach(([u,d])=>{if(u===r){const h=l([d],s);if(a.push(...h),d!=null&&d.$ref){const f=l(this.objectsByPath(d.$ref,[]),s);a.push(...f)}d!=null&&d.anyOf&&d.anyOf.forEach(f=>{if(f!=null&&f.$ref){const p=l(this.objectsByPath(f.$ref,[]),s);a.push(...p)}f!=null&&f.enum&&a.push(...f.enum.filter(p=>p.startsWith(s)))})}})}),a}}class NU{constructor(e,n,r){this.name=e,this.accepted=n,this.completable=r,this.children=[],this.terminal=null}addChildren(e){this.children.push(e)}setTerminal(e){this.terminal=e}}class e2e{constructor(){this.root=new NU("root",e=>!0,e=>[])}_match(e){let n=this.root;for(let r of e){let s=!1;for(let o of n.children)if(o.accepted(r)){n=o,s=!0;break}if(!s)return null}return n}autocomplete(e){if(e.length==0)return[];let n=e.slice(0,e.length-1),r=e[e.length-1],s=this._match(n);if(!s)return[];let o=[];for(let a of s.children)o.push(...a.completable(r));return o}match(e){let n=this._match(e);return n?n.terminal:null}addPath(e,n={},r=null){let s=this.root;for(let o of e){let a=!1;for(let c of s.children)if(c.accepted(o)){s=c,a=!0;break}if(a)continue;let l=null;if(n[o])l=new NU(o,n[o][0],n[o][1]);else{let c=u=>o===u;o.startsWith("{")&&o.endsWith("}")&&(c=u=>u===o||u.match(/\w+/)),l=new NU(o,c,u=>o.startsWith(u)?[o]:[])}s.addChildren(l),s=l}s.setTerminal(r)}}class Hnt{constructor(e){this.openapi=e,this.extractor=new JDe(e),this.methods=this.extractor.getAllMethods(),this.trieCompletion=new e2e;for(let n of this.methods){let r=`${n.method.toUpperCase()} ${n.path}`,s=XN(r);this.trieCompletion.addPath(s,{},{operationId:n.operationId,tags:n.tags})}}getRequestDocs(e){let n=XN(e);return this.trieCompletion.match(n)}}const Unt=`{
"paths": {
"/collections/{collection_name}/shards": {
"put": {
"tags": [
"Distributed"
],
"summary": "Create shard key",
"operationId": "create_shard_key",
"requestBody": {
"description": "Shard key configuration",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateShardingKey"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to create shards for",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "timeout",
"in": "query",
"description": "Wait for operation commit timeout in seconds. \\nIf timeout is reached - request will return with service error.\\n",
"schema": {
"type": "integer"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/shards/delete": {
"post": {
"tags": [
"Distributed"
],
"summary": "Delete shard key",
"operationId": "delete_shard_key",
"requestBody": {
"description": "Select shard key to delete",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DropShardingKey"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to create shards for",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "timeout",
"in": "query",
"description": "Wait for operation commit timeout in seconds. \\nIf timeout is reached - request will return with service error.\\n",
"schema": {
"type": "integer"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/": {
"get": {
"summary": "Returns information about the running Qdrant instance",
"description": "Returns information about the running Qdrant instance like version and commit id",
"operationId": "root",
"tags": [
"Service"
],
"responses": {
"200": {
"description": "Qdrant server version information",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VersionInfo"
}
}
}
},
"4XX": {
"description": "error"
}
}
}
},
"/telemetry": {
"get": {
"summary": "Collect telemetry data",
"description": "Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics",
"operationId": "telemetry",
"tags": [
"Service"
],
"parameters": [
{
"name": "anonymize",
"in": "query",
"description": "If true, anonymize result",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "details_level",
"in": "query",
"description": "Level of details in telemetry data. Minimal level is 0, maximal is infinity",
"required": false,
"schema": {
"type": "integer",
"minimum": 0
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/TelemetryData"
}
}
}
}
}
}
}
}
},
"/metrics": {
"get": {
"summary": "Collect Prometheus metrics data",
"description": "Collect metrics data including app info, collections info, cluster info and statistics",
"operationId": "metrics",
"tags": [
"Service"
],
"parameters": [
{
"name": "anonymize",
"in": "query",
"description": "If true, anonymize result",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "Metrics data in Prometheus format",
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "# HELP app_info information about qdrant server\\n# TYPE app_info gauge\\napp_info{name=\\"qdrant\\",version=\\"0.11.1\\"} 1\\n# HELP cluster_enabled is cluster support enabled\\n# TYPE cluster_enabled gauge\\ncluster_enabled 0\\n# HELP collections_total number of collections\\n# TYPE collections_total gauge\\ncollections_total 1\\n"
}
}
}
},
"4XX": {
"description": "error"
}
}
}
},
"/locks": {
"post": {
"summary": "Set lock options",
"description": "Set lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options",
"operationId": "post_locks",
"tags": [
"Service"
],
"requestBody": {
"description": "Lock options and optional error message",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LocksOption"
}
}
}
},
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/LocksOption"
}
}
}
}
}
}
}
},
"get": {
"summary": "Get lock options",
"description": "Get lock options. If write is locked, all write operations and collection creation are forbidden",
"operationId": "get_locks",
"tags": [
"Service"
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/LocksOption"
}
}
}
}
}
}
}
}
},
"/healthz": {
"get": {
"summary": "Kubernetes healthz endpoint",
"description": "An endpoint for health checking used in Kubernetes.",
"operationId": "healthz",
"tags": [
"Service"
],
"responses": {
"200": {
"description": "Healthz response",
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "healthz check passed"
}
}
}
},
"4XX": {
"description": "error"
}
}
}
},
"/livez": {
"get": {
"summary": "Kubernetes livez endpoint",
"description": "An endpoint for health checking used in Kubernetes.",
"operationId": "livez",
"tags": [
"Service"
],
"responses": {
"200": {
"description": "Healthz response",
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "healthz check passed"
}
}
}
},
"4XX": {
"description": "error"
}
}
}
},
"/readyz": {
"get": {
"summary": "Kubernetes readyz endpoint",
"description": "An endpoint for health checking used in Kubernetes.",
"operationId": "readyz",
"tags": [
"Service"
],
"responses": {
"200": {
"description": "Healthz response",
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "healthz check passed"
}
}
}
},
"4XX": {
"description": "error"
}
}
}
},
"/issues": {
"get": {
"summary": "Get issues",
"description": "Get a report of performance issues and configuration suggestions",
"operationId": "get_issues",
"tags": [
"Beta"
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"4XX": {
"description": "error"
}
}
},
"delete": {
"summary": "Clear issues",
"description": "Removes all issues reported so far",
"operationId": "clear_issues",
"tags": [
"Beta"
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "boolean"
}
}
}
},
"4XX": {
"description": "error"
}
}
}
},
"/cluster": {
"get": {
"tags": [
"Distributed"
],
"summary": "Get cluster status info",
"description": "Get information about the current state and composition of the cluster",
"operationId": "cluster_status",
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/ClusterStatus"
}
}
}
}
}
}
}
}
},
"/cluster/recover": {
"post": {
"tags": [
"Distributed"
],
"summary": "Tries to recover current peer Raft state.",
"operationId": "recover_current_peer",
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/cluster/peer/{peer_id}": {
"delete": {
"tags": [
"Distributed"
],
"summary": "Remove peer from the cluster",
"description": "Tries to remove peer from the cluster. Will return an error if peer has shards on it.",
"operationId": "remove_peer",
"parameters": [
{
"name": "peer_id",
"in": "path",
"description": "Id of the peer",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "force",
"in": "query",
"description": "If true - removes peer even if it has shards/replicas on it.",
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/collections": {
"get": {
"tags": [
"Collections"
],
"summary": "List collections",
"description": "Get list name of all existing collections",
"operationId": "get_collections",
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/CollectionsResponse"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}": {
"get": {
"tags": [
"Collections"
],
"summary": "Collection info",
"description": "Get detailed information about specified existing collection",
"operationId": "get_collection",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to retrieve",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/CollectionInfo"
}
}
}
}
}
}
}
},
"put": {
"tags": [
"Collections"
],
"summary": "Create collection",
"description": "Create new collection with given parameters",
"operationId": "create_collection",
"requestBody": {
"description": "Parameters of a new collection",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateCollection"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the new collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "timeout",
"in": "query",
"description": "Wait for operation commit timeout in seconds. \\nIf timeout is reached - request will return with service error.\\n",
"schema": {
"type": "integer"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
},
"patch": {
"tags": [
"Collections"
],
"summary": "Update collection parameters",
"description": "Update parameters of the existing collection",
"operationId": "update_collection",
"requestBody": {
"description": "New parameters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateCollection"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to update",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "timeout",
"in": "query",
"description": "Wait for operation commit timeout in seconds. \\nIf timeout is reached - request will return with service error.\\n",
"schema": {
"type": "integer"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
},
"delete": {
"tags": [
"Collections"
],
"summary": "Delete collection",
"description": "Drop collection and all associated data",
"operationId": "delete_collection",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to delete",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "timeout",
"in": "query",
"description": "Wait for operation commit timeout in seconds. \\nIf timeout is reached - request will return with service error.\\n",
"schema": {
"type": "integer"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/collections/aliases": {
"post": {
"tags": [
"Aliases"
],
"summary": "Update aliases of the collections",
"operationId": "update_aliases",
"requestBody": {
"description": "Alias update operations",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChangeAliasesOperation"
}
}
}
},
"parameters": [
{
"name": "timeout",
"in": "query",
"description": "Wait for operation commit timeout in seconds. \\nIf timeout is reached - request will return with service error.\\n",
"schema": {
"type": "integer"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/index": {
"put": {
"tags": [
"Indexes"
],
"summary": "Create index for field in collection",
"description": "Create index for field in collection",
"operationId": "create_field_index",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"requestBody": {
"description": "Field name",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateFieldIndex"
}
}
}
},
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/exists": {
"get": {
"tags": [
"Collections"
],
"summary": "Check the existence of a collection",
"description": "Returns \\"true\\" if the given collection name exists, and \\"false\\" otherwise",
"operationId": "collection_exists",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/CollectionExistence"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/index/{field_name}": {
"delete": {
"tags": [
"Indexes"
],
"summary": "Delete index for field in collection",
"description": "Delete field index for collection",
"operationId": "delete_field_index",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "field_name",
"in": "path",
"description": "Name of the field where to delete the index",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/cluster": {
"get": {
"tags": [
"Distributed"
],
"summary": "Collection cluster info",
"description": "Get cluster information for a collection",
"operationId": "collection_cluster_info",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to retrieve the cluster info for",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/CollectionClusterInfo"
}
}
}
}
}
}
}
},
"post": {
"tags": [
"Distributed"
],
"summary": "Update collection cluster setup",
"operationId": "update_collection_cluster",
"requestBody": {
"description": "Collection cluster update operations",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClusterOperations"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection on which to to apply the cluster update operation",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "timeout",
"in": "query",
"description": "Wait for operation commit timeout in seconds. \\nIf timeout is reached - request will return with service error.\\n",
"schema": {
"type": "integer"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/aliases": {
"get": {
"tags": [
"Aliases"
],
"summary": "List aliases for collection",
"description": "Get list of all aliases for a collection",
"operationId": "get_collection_aliases",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/CollectionsAliasesResponse"
}
}
}
}
}
}
}
}
},
"/aliases": {
"get": {
"tags": [
"Aliases"
],
"summary": "List collections aliases",
"description": "Get list of all existing collections aliases",
"operationId": "get_collections_aliases",
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/CollectionsAliasesResponse"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/snapshots/upload": {
"post": {
"tags": [
"Snapshots"
],
"summary": "Recover from an uploaded snapshot",
"description": "Recover local collection data from an uploaded snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created.",
"operationId": "recover_from_uploaded_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "priority",
"in": "query",
"description": "Defines source of truth for snapshot recovery",
"required": false,
"schema": {
"$ref": "#/components/schemas/SnapshotPriority"
}
},
{
"name": "checksum",
"in": "query",
"description": "Optional SHA256 checksum to verify snapshot integrity before recovery.",
"required": false,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "Snapshot to recover from",
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"snapshot": {
"type": "string",
"format": "binary"
}
}
}
}
}
},
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/snapshots/recover": {
"put": {
"tags": [
"Snapshots"
],
"summary": "Recover from a snapshot",
"description": "Recover local collection data from a snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created.",
"operationId": "recover_from_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"requestBody": {
"description": "Snapshot to recover from",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SnapshotRecover"
}
}
}
},
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/snapshots": {
"get": {
"tags": [
"Snapshots"
],
"summary": "List collection snapshots",
"description": "Get list of snapshots for a collection",
"operationId": "list_snapshots",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SnapshotDescription"
}
}
}
}
}
}
}
}
},
"post": {
"tags": [
"Snapshots"
],
"summary": "Create collection snapshot",
"description": "Create new snapshot for a collection",
"operationId": "create_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection for which to create a snapshot",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/SnapshotDescription"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/snapshots/{snapshot_name}": {
"delete": {
"tags": [
"Snapshots"
],
"summary": "Delete collection snapshot",
"description": "Delete snapshot for a collection",
"operationId": "delete_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection for which to delete a snapshot",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "snapshot_name",
"in": "path",
"description": "Name of the snapshot to delete",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
},
"get": {
"tags": [
"Snapshots"
],
"summary": "Download collection snapshot",
"description": "Download specified snapshot from a collection as a file",
"operationId": "get_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "snapshot_name",
"in": "path",
"description": "Name of the snapshot to download",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "Snapshot file",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/snapshots": {
"get": {
"tags": [
"Snapshots"
],
"summary": "List of storage snapshots",
"description": "Get list of snapshots of the whole storage",
"operationId": "list_full_snapshots",
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SnapshotDescription"
}
}
}
}
}
}
}
}
},
"post": {
"tags": [
"Snapshots"
],
"summary": "Create storage snapshot",
"description": "Create new snapshot of the whole storage",
"operationId": "create_full_snapshot",
"parameters": [
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/SnapshotDescription"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/snapshots/{snapshot_name}": {
"delete": {
"tags": [
"Snapshots"
],
"summary": "Delete storage snapshot",
"description": "Delete snapshot of the whole storage",
"operationId": "delete_full_snapshot",
"parameters": [
{
"name": "snapshot_name",
"in": "path",
"description": "Name of the full snapshot to delete",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
},
"get": {
"tags": [
"Snapshots"
],
"summary": "Download storage snapshot",
"description": "Download specified snapshot of the whole storage as a file",
"operationId": "get_full_snapshot",
"parameters": [
{
"name": "snapshot_name",
"in": "path",
"description": "Name of the snapshot to download",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "Snapshot file",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/collections/{collection_name}/shards/{shard_id}/snapshots/upload": {
"post": {
"tags": [
"Snapshots"
],
"summary": "Recover shard from an uploaded snapshot",
"description": "Recover shard of a local collection from an uploaded snapshot. This will overwrite any data, stored on this node, for the collection shard.",
"operationId": "recover_shard_from_uploaded_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "shard_id",
"in": "path",
"description": "Id of the shard to recover",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "priority",
"in": "query",
"description": "Defines source of truth for snapshot recovery",
"required": false,
"schema": {
"$ref": "#/components/schemas/SnapshotPriority"
}
},
{
"name": "checksum",
"in": "query",
"description": "Optional SHA256 checksum to verify snapshot integrity before recovery.",
"required": false,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "Snapshot to recover from",
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"snapshot": {
"type": "string",
"format": "binary"
}
}
}
}
}
},
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/shards/{shard_id}/snapshots/recover": {
"put": {
"tags": [
"Snapshots"
],
"summary": "Recover from a snapshot",
"description": "Recover shard of a local collection data from a snapshot. This will overwrite any data, stored in this shard, for the collection.",
"operationId": "recover_shard_from_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "shard_id",
"in": "path",
"description": "Id of the shard to recover",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"requestBody": {
"description": "Snapshot to recover from",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ShardSnapshotRecover"
}
}
}
},
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/shards/{shard_id}/snapshots": {
"get": {
"tags": [
"Snapshots"
],
"summary": "List shards snapshots for a collection",
"description": "Get list of snapshots for a shard of a collection",
"operationId": "list_shard_snapshots",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "shard_id",
"in": "path",
"description": "Id of the shard",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SnapshotDescription"
}
}
}
}
}
}
}
}
},
"post": {
"tags": [
"Snapshots"
],
"summary": "Create shard snapshot",
"description": "Create new snapshot of a shard for a collection",
"operationId": "create_shard_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection for which to create a snapshot",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "shard_id",
"in": "path",
"description": "Id of the shard",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/SnapshotDescription"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/shards/{shard_id}/snapshots/{snapshot_name}": {
"delete": {
"tags": [
"Snapshots"
],
"summary": "Delete shard snapshot",
"description": "Delete snapshot of a shard for a collection",
"operationId": "delete_shard_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection for which to delete a snapshot",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "shard_id",
"in": "path",
"description": "Id of the shard",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "snapshot_name",
"in": "path",
"description": "Name of the snapshot to delete",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen. If false - let changes happen in background. Default is true.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "boolean"
}
}
}
}
}
},
"202": {
"description": "operation is accepted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string"
}
}
}
}
}
}
}
},
"get": {
"tags": [
"Snapshots"
],
"summary": "Download collection snapshot",
"description": "Download specified snapshot of a shard from a collection as a file",
"operationId": "get_shard_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "shard_id",
"in": "path",
"description": "Id of the shard",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "snapshot_name",
"in": "path",
"description": "Name of the snapshot to download",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "Snapshot file",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/collections/{collection_name}/points/{id}": {
"get": {
"tags": [
"Points"
],
"summary": "Get point",
"description": "Retrieve full information of single point by id",
"operationId": "get_point",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to retrieve from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "Id of the point",
"required": true,
"schema": {
"$ref": "#/components/schemas/ExtendedPointId"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/Record"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points": {
"post": {
"tags": [
"Points"
],
"summary": "Get points",
"description": "Retrieve multiple points by specified IDs",
"operationId": "get_points",
"requestBody": {
"description": "List of points to retrieve",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PointRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to retrieve from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Record"
}
}
}
}
}
}
}
}
},
"put": {
"tags": [
"Points"
],
"summary": "Upsert points",
"description": "Perform insert + updates on points. If point with given ID already exists - it will be overwritten.",
"operationId": "upsert_points",
"requestBody": {
"description": "Operation to perform on points",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PointInsertOperations"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to update from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/delete": {
"post": {
"tags": [
"Points"
],
"summary": "Delete points",
"description": "Delete points",
"operationId": "delete_points",
"requestBody": {
"description": "Operation to perform on points",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PointsSelector"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to delete from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/vectors": {
"put": {
"tags": [
"Points"
],
"summary": "Update vectors",
"description": "Update specified named vectors on points, keep unspecified vectors intact.",
"operationId": "update_vectors",
"requestBody": {
"description": "Update named vectors on points",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateVectors"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to update from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/vectors/delete": {
"post": {
"tags": [
"Points"
],
"summary": "Delete vectors",
"description": "Delete named vectors from the given points.",
"operationId": "delete_vectors",
"requestBody": {
"description": "Delete named vectors from points",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteVectors"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to delete from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/payload": {
"post": {
"tags": [
"Points"
],
"summary": "Set payload",
"description": "Set payload values for points",
"operationId": "set_payload",
"requestBody": {
"description": "Set payload on points",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetPayload"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to set from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
},
"put": {
"tags": [
"Points"
],
"summary": "Overwrite payload",
"description": "Replace full payload of points with new one",
"operationId": "overwrite_payload",
"requestBody": {
"description": "Payload and points selector",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetPayload"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to set from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/payload/delete": {
"post": {
"tags": [
"Points"
],
"summary": "Delete payload",
"description": "Delete specified key payload for points",
"operationId": "delete_payload",
"requestBody": {
"description": "delete payload on points",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeletePayload"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to delete from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/payload/clear": {
"post": {
"tags": [
"Points"
],
"summary": "Clear payload",
"description": "Remove all payload for specified points",
"operationId": "clear_payload",
"requestBody": {
"description": "clear payload on points",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PointsSelector"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to clear payload from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/batch": {
"post": {
"tags": [
"Points"
],
"summary": "Batch update points",
"description": "Apply a series of update operations for points, vectors and payloads",
"operationId": "batch_update",
"requestBody": {
"description": "update operations",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateOperations"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to apply operations on",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "wait",
"in": "query",
"description": "If true, wait for changes to actually happen",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "ordering",
"in": "query",
"description": "define ordering guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/WriteOrdering"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UpdateResult"
}
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/scroll": {
"post": {
"tags": [
"Points"
],
"summary": "Scroll points",
"description": "Scroll request - paginate over all points which matches given filtering condition",
"operationId": "scroll_points",
"requestBody": {
"description": "Pagination and filter parameters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ScrollRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to retrieve from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/ScrollResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/search": {
"post": {
"tags": [
"Search"
],
"summary": "Search points",
"description": "Retrieve closest points based on vector similarity and given filtering conditions",
"operationId": "search_points",
"requestBody": {
"description": "Search request with optional filtering",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ScoredPoint"
}
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/search/batch": {
"post": {
"tags": [
"Search"
],
"summary": "Search batch points",
"description": "Retrieve by batch the closest points based on vector similarity and given filtering conditions",
"operationId": "search_batch_points",
"requestBody": {
"description": "Search batch request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchRequestBatch"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ScoredPoint"
}
}
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/search/groups": {
"post": {
"tags": [
"Search"
],
"summary": "Search point groups",
"description": "Retrieve closest points based on vector similarity and given filtering conditions, grouped by a given payload field",
"operationId": "search_point_groups",
"requestBody": {
"description": "Search request with optional filtering, grouped by a given payload field",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchGroupsRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/GroupsResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/recommend": {
"post": {
"tags": [
"Search"
],
"summary": "Recommend points",
"description": "Look for the points which are closer to stored positive examples and at the same time further to negative examples.",
"operationId": "recommend_points",
"requestBody": {
"description": "Request points based on positive and negative examples.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RecommendRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ScoredPoint"
}
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/recommend/batch": {
"post": {
"tags": [
"Search"
],
"summary": "Recommend batch points",
"description": "Look for the points which are closer to stored positive examples and at the same time further to negative examples.",
"operationId": "recommend_batch_points",
"requestBody": {
"description": "Request points based on positive and negative examples.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RecommendRequestBatch"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ScoredPoint"
}
}
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/recommend/groups": {
"post": {
"tags": [
"Search"
],
"summary": "Recommend point groups",
"description": "Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given payload field.",
"operationId": "recommend_point_groups",
"requestBody": {
"description": "Request points based on positive and negative examples, grouped by a payload field.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RecommendGroupsRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/GroupsResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/discover": {
"post": {
"tags": [
"Search"
],
"summary": "Discover points",
"description": "Use context and a target to find the most similar points to the target, constrained by the context.\\nWhen using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair.\\nSince the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0.\\nWhen using target (with or without context), the score behaves a little different: The integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target. The context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise.\\n",
"operationId": "discover_points",
"requestBody": {
"description": "Request points based on {positive, negative} pairs of examples, and/or a target",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DiscoverRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ScoredPoint"
}
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/discover/batch": {
"post": {
"tags": [
"Search"
],
"summary": "Discover batch points",
"description": "Look for points based on target and/or positive and negative example pairs, in batch.",
"operationId": "discover_batch_points",
"requestBody": {
"description": "Batch request points based on { positive, negative } pairs of examples, and/or a target.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DiscoverRequestBatch"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ScoredPoint"
}
}
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/count": {
"post": {
"tags": [
"Points"
],
"summary": "Count points",
"description": "Count points which matches given filtering condition",
"operationId": "count_points",
"requestBody": {
"description": "Request counts of points which matches given filtering condition",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CountRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to count in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/CountResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/facet": {
"post": {
"tags": [
"Points"
],
"summary": "Facet a payload key with a given filter.",
"description": "Count points that satisfy the given filter for each unique value of a payload key.",
"operationId": "facet",
"requestBody": {
"description": "Request counts of points for each unique value of a payload key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FacetRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to facet in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/FacetResponse"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/query": {
"post": {
"tags": [
"Search"
],
"summary": "Query points",
"description": "Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.",
"operationId": "query_points",
"requestBody": {
"description": "Describes the query to make to the collection",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QueryRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/QueryResponse"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/query/batch": {
"post": {
"tags": [
"Search"
],
"summary": "Query points in batch",
"description": "Universally query points in batch. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.",
"operationId": "query_batch_points",
"requestBody": {
"description": "Describes the queries to make to the collection",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QueryRequestBatch"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/QueryResponse"
}
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/query/groups": {
"post": {
"tags": [
"Search"
],
"summary": "Query points, grouped by a given payload field",
"description": "Universally query points, grouped by a given payload field",
"operationId": "query_points_groups",
"requestBody": {
"description": "Describes the query to make to the collection",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QueryGroupsRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/GroupsResult"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/search/matrix/pairs": {
"post": {
"tags": [
"Search"
],
"summary": "Search points matrix distance pairs",
"description": "Compute distance matrix for sampled points with a pair based output format",
"operationId": "search_matrix_pairs",
"requestBody": {
"description": "Search matrix request with optional filtering",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchMatrixRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/SearchMatrixPairsResponse"
}
}
}
}
}
}
}
}
},
"/collections/{collection_name}/points/search/matrix/offsets": {
"post": {
"tags": [
"Search"
],
"summary": "Search points matrix distance offsets",
"description": "Compute distance matrix for sampled points with an offset based output format",
"operationId": "search_matrix_offsets",
"requestBody": {
"description": "Search matrix request with optional filtering",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchMatrixRequest"
}
}
}
},
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection to search in",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "consistency",
"in": "query",
"description": "Define read consistency guarantees for the operation",
"required": false,
"schema": {
"$ref": "#/components/schemas/ReadConsistency"
}
},
{
"name": "timeout",
"in": "query",
"description": "If set, overrides global timeout for this request. Unit is seconds.",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"usage": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/HardwareUsage"
},
{
"nullable": true
}
]
},
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request",
"example": 0.002
},
"status": {
"type": "string",
"example": "ok"
},
"result": {
"$ref": "#/components/schemas/SearchMatrixOffsetsResponse"
}
}
}
}
}
}
}
}
}
},
"openapi": "3.0.1",
"security": [
{
"api-key": []
},
{
"bearerAuth": []
},
{}
],
"info": {
"title": "Qdrant API",
"description": "API description for Qdrant vector search engine.\\n\\nThis document describes CRUD and search operations on collections of points (vectors with payload).\\n\\nQdrant supports any combinations of \`should\`, \`min_should\`, \`must\` and \`must_not\` conditions, which makes it possible to use in applications when object could not be described solely by vector. It could be location features, availability flags, and other custom properties businesses should take into account.\\n## Examples\\nThis examples cover the most basic use-cases - collection creation and basic vector search.\\n### Create collection\\nFirst - let's create a collection with dot-production metric.\\n\`\`\`\\ncurl -X PUT 'http://localhost:6333/collections/test_collection' \\\\\\n -H 'Content-Type: application/json' \\\\\\n --data-raw '{\\n \\"vectors\\": {\\n \\"size\\": 4,\\n \\"distance\\": \\"Dot\\"\\n }\\n }'\\n\\n\`\`\`\\nExpected response:\\n\`\`\`\\n{\\n \\"result\\": true,\\n \\"status\\": \\"ok\\",\\n \\"time\\": 0.031095451\\n}\\n\`\`\`\\nWe can ensure that collection was created:\\n\`\`\`\\ncurl 'http://localhost:6333/collections/test_collection'\\n\`\`\`\\nExpected response:\\n\`\`\`\\n{\\n \\"result\\": {\\n \\"status\\": \\"green\\",\\n \\"vectors_count\\": 0,\\n \\"segments_count\\": 5,\\n \\"disk_data_size\\": 0,\\n \\"ram_data_size\\": 0,\\n \\"config\\": {\\n \\"params\\": {\\n \\"vectors\\": {\\n \\"size\\": 4,\\n \\"distance\\": \\"Dot\\"\\n }\\n },\\n \\"hnsw_config\\": {\\n \\"m\\": 16,\\n \\"ef_construct\\": 100,\\n \\"full_scan_threshold\\": 10000\\n },\\n \\"optimizer_config\\": {\\n \\"deleted_threshold\\": 0.2,\\n \\"vacuum_min_vector_number\\": 1000,\\n \\"default_segment_number\\": 2,\\n \\"max_segment_size\\": null,\\n \\"memmap_threshold\\": null,\\n \\"indexing_threshold\\": 20000,\\n \\"flush_interval_sec\\": 5,\\n \\"max_optimization_threads\\": null\\n },\\n \\"wal_config\\": {\\n \\"wal_capacity_mb\\": 32,\\n \\"wal_segments_ahead\\": 0\\n }\\n }\\n },\\n \\"status\\": \\"ok\\",\\n \\"time\\": 2.1199e-05\\n}\\n\`\`\`\\n\\n### Add points\\nLet's now add vectors with some payload:\\n\`\`\`\\ncurl -L -X PUT 'http://localhost:6333/collections/test_collection/points?wait=true' \\\\ -H 'Content-Type: application/json' \\\\ --data-raw '{\\n \\"points\\": [\\n {\\"id\\": 1, \\"vector\\": [0.05, 0.61, 0.76, 0.74], \\"payload\\": {\\"city\\": \\"Berlin\\"}},\\n {\\"id\\": 2, \\"vector\\": [0.19, 0.81, 0.75, 0.11], \\"payload\\": {\\"city\\": [\\"Berlin\\", \\"London\\"] }},\\n {\\"id\\": 3, \\"vector\\": [0.36, 0.55, 0.47, 0.94], \\"payload\\": {\\"city\\": [\\"Berlin\\", \\"Moscow\\"] }},\\n {\\"id\\": 4, \\"vector\\": [0.18, 0.01, 0.85, 0.80], \\"payload\\": {\\"city\\": [\\"London\\", \\"Moscow\\"] }},\\n {\\"id\\": 5, \\"vector\\": [0.24, 0.18, 0.22, 0.44], \\"payload\\": {\\"count\\": [0]}},\\n {\\"id\\": 6, \\"vector\\": [0.35, 0.08, 0.11, 0.44]}\\n ]\\n}'\\n\`\`\`\\nExpected response:\\n\`\`\`\\n{\\n \\"result\\": {\\n \\"operation_id\\": 0,\\n \\"status\\": \\"completed\\"\\n },\\n \\"status\\": \\"ok\\",\\n \\"time\\": 0.000206061\\n}\\n\`\`\`\\n### Search with filtering\\nLet's start with a basic request:\\n\`\`\`\\ncurl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' \\\\ -H 'Content-Type: application/json' \\\\ --data-raw '{\\n \\"vector\\": [0.2,0.1,0.9,0.7],\\n \\"top\\": 3\\n}'\\n\`\`\`\\nExpected response:\\n\`\`\`\\n{\\n \\"result\\": [\\n { \\"id\\": 4, \\"score\\": 1.362, \\"payload\\": null, \\"version\\": 0 },\\n { \\"id\\": 1, \\"score\\": 1.273, \\"payload\\": null, \\"version\\": 0 },\\n { \\"id\\": 3, \\"score\\": 1.208, \\"payload\\": null, \\"version\\": 0 }\\n ],\\n \\"status\\": \\"ok\\",\\n \\"time\\": 0.000055785\\n}\\n\`\`\`\\nBut result is different if we add a filter:\\n\`\`\`\\ncurl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' \\\\ -H 'Content-Type: application/json' \\\\ --data-raw '{\\n \\"filter\\": {\\n \\"should\\": [\\n {\\n \\"key\\": \\"city\\",\\n \\"match\\": {\\n \\"value\\": \\"London\\"\\n }\\n }\\n ]\\n },\\n \\"vector\\": [0.2, 0.1, 0.9, 0.7],\\n \\"top\\": 3\\n}'\\n\`\`\`\\nExpected response:\\n\`\`\`\\n{\\n \\"result\\": [\\n { \\"id\\": 4, \\"score\\": 1.362, \\"payload\\": null, \\"version\\": 0 },\\n { \\"id\\": 2, \\"score\\": 0.871, \\"payload\\": null, \\"version\\": 0 }\\n ],\\n \\"status\\": \\"ok\\",\\n \\"time\\": 0.000093972\\n}\\n\`\`\`\\n",
"contact": {
"email": "andrey@vasnetsov.com"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "master"
},
"externalDocs": {
"description": "Find out more about Qdrant applications and demo",
"url": "https://qdrant.tech/documentation/"
},
"servers": [
{
"url": "{protocol}://{hostname}:{port}",
"variables": {
"protocol": {
"enum": [
"http",
"https"
],
"default": "http"
},
"hostname": {
"default": "localhost"
},
"port": {
"default": "6333"
}
}
}
],
"tags": [
{
"name": "Collections",
"description": "Searchable collections of points."
},
{
"name": "Points",
"description": "Float-point vectors with payload."
},
{
"name": "Search",
"description": "Find points in a collection."
},
{
"name": "Aliases",
"description": "Additional names for existing collections."
},
{
"name": "Indexes",
"description": "Indexes for payloads associated with points."
},
{
"name": "Distributed",
"description": "Service distributed setup."
},
{
"name": "Snapshots",
"description": "Storage and collections snapshots."
},
{
"name": "Service",
"description": "Qdrant service utilities."
},
{
"name": "Beta",
"description": "Beta features, do not depend on these yet."
}
],
"components": {
"securitySchemes": {
"api-key": {
"type": "apiKey",
"in": "header",
"name": "api-key",
"description": "Authorization key, either read-write or read-only"
},
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
},
"schemas": {
"ErrorResponse": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the occurred error."
}
}
},
"result": {
"type": "object",
"nullable": true
}
}
},
"CollectionsResponse": {
"type": "object",
"required": [
"collections"
],
"properties": {
"collections": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CollectionDescription"
}
}
},
"example": {
"collections": [
{
"name": "arivx-title"
},
{
"name": "arivx-abstract"
},
{
"name": "medium-title"
},
{
"name": "medium-text"
}
]
}
},
"CollectionDescription": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
},
"CollectionInfo": {
"description": "Current statistics and configuration of the collection",
"type": "object",
"required": [
"config",
"optimizer_status",
"payload_schema",
"segments_count",
"status"
],
"properties": {
"status": {
"$ref": "#/components/schemas/CollectionStatus"
},
"optimizer_status": {
"$ref": "#/components/schemas/OptimizersStatus"
},
"vectors_count": {
"description": "DEPRECATED: Approximate number of vectors in collection. All vectors in collection are available for querying. Calculated as \`points_count x vectors_per_point\`. Where \`vectors_per_point\` is a number of named vectors in schema.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"indexed_vectors_count": {
"description": "Approximate number of indexed vectors in the collection. Indexed vectors in large segments are faster to query, as it is stored in a specialized vector index.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"points_count": {
"description": "Approximate number of points (vectors + payloads) in collection. Each point could be accessed by unique id.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"segments_count": {
"description": "Number of segments in collection. Each segment has independent vector as payload indexes",
"type": "integer",
"format": "uint",
"minimum": 0
},
"config": {
"$ref": "#/components/schemas/CollectionConfig"
},
"payload_schema": {
"description": "Types of stored payload",
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/PayloadIndexInfo"
}
}
}
},
"CollectionStatus": {
"description": "Current state of the collection. \`Green\` - all good. \`Yellow\` - optimization is running, 'Grey' - optimizations are possible but not triggered, \`Red\` - some operations failed and was not recovered",
"type": "string",
"enum": [
"green",
"yellow",
"grey",
"red"
]
},
"OptimizersStatus": {
"description": "Current state of the collection",
"oneOf": [
{
"description": "Optimizers are reporting as expected",
"type": "string",
"enum": [
"ok"
]
},
{
"description": "Something wrong happened with optimizers",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "string"
}
},
"additionalProperties": false
}
]
},
"CollectionConfig": {
"description": "Information about the collection configuration",
"type": "object",
"required": [
"hnsw_config",
"optimizer_config",
"params"
],
"properties": {
"params": {
"$ref": "#/components/schemas/CollectionParams"
},
"hnsw_config": {
"$ref": "#/components/schemas/HnswConfig"
},
"optimizer_config": {
"$ref": "#/components/schemas/OptimizersConfig"
},
"wal_config": {
"anyOf": [
{
"$ref": "#/components/schemas/WalConfig"
},
{
"nullable": true
}
]
},
"quantization_config": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/QuantizationConfig"
},
{
"nullable": true
}
]
},
"strict_mode_config": {
"anyOf": [
{
"$ref": "#/components/schemas/StrictModeConfig"
},
{
"nullable": true
}
]
}
}
},
"CollectionParams": {
"type": "object",
"properties": {
"vectors": {
"$ref": "#/components/schemas/VectorsConfig"
},
"shard_number": {
"description": "Number of shards the collection has",
"default": 1,
"type": "integer",
"format": "uint32",
"minimum": 1
},
"sharding_method": {
"description": "Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key",
"anyOf": [
{
"$ref": "#/components/schemas/ShardingMethod"
},
{
"nullable": true
}
]
},
"replication_factor": {
"description": "Number of replicas for each shard",
"default": 1,
"type": "integer",
"format": "uint32",
"minimum": 1
},
"write_consistency_factor": {
"description": "Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact.",
"default": 1,
"type": "integer",
"format": "uint32",
"minimum": 1
},
"read_fan_out_factor": {
"description": "Defines how many additional replicas should be processing read request at the same time. Default value is Auto, which means that fan-out will be determined automatically based on the busyness of the local replica. Having more than 0 might be useful to smooth latency spikes of individual nodes.",
"type": "integer",
"format": "uint32",
"minimum": 0,
"nullable": true
},
"on_disk_payload": {
"description": "If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM.\\n\\nDefault: true",
"default": true,
"type": "boolean"
},
"sparse_vectors": {
"description": "Configuration of the sparse vector storage",
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/SparseVectorParams"
},
"nullable": true
}
}
},
"VectorsConfig": {
"description": "Vector params separator for single and multiple vector modes Single mode:\\n\\n{ \\"size\\": 128, \\"distance\\": \\"Cosine\\" }\\n\\nor multiple mode:\\n\\n{ \\"default\\": { \\"size\\": 128, \\"distance\\": \\"Cosine\\" } }",
"anyOf": [
{
"$ref": "#/components/schemas/VectorParams"
},
{
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/VectorParams"
}
}
]
},
"VectorParams": {
"description": "Params of single vector data storage",
"type": "object",
"required": [
"distance",
"size"
],
"properties": {
"size": {
"description": "Size of a vectors used",
"type": "integer",
"format": "uint64",
"minimum": 1
},
"distance": {
"$ref": "#/components/schemas/Distance"
},
"hnsw_config": {
"description": "Custom params for HNSW index. If none - values from collection configuration are used.",
"anyOf": [
{
"$ref": "#/components/schemas/HnswConfigDiff"
},
{
"nullable": true
}
]
},
"quantization_config": {
"description": "Custom params for quantization. If none - values from collection configuration are used.",
"anyOf": [
{
"$ref": "#/components/schemas/QuantizationConfig"
},
{
"nullable": true
}
]
},
"on_disk": {
"description": "If true, vectors are served from disk, improving RAM usage at the cost of latency Default: false",
"type": "boolean",
"nullable": true
},
"datatype": {
"description": "Defines which datatype should be used to represent vectors in the storage. Choosing different datatypes allows to optimize memory usage and performance vs accuracy.\\n\\n- For \`float32\` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For \`float16\` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For \`uint8\` datatype - vectors are stored as unsigned 8-bit integers, 1 byte. It expects vector elements to be in range \`[0, 255]\`.",
"anyOf": [
{
"$ref": "#/components/schemas/Datatype"
},
{
"nullable": true
}
]
},
"multivector_config": {
"anyOf": [
{
"$ref": "#/components/schemas/MultiVectorConfig"
},
{
"nullable": true
}
]
}
}
},
"Distance": {
"description": "Type of internal tags, build from payload Distance function types used to compare vectors",
"type": "string",
"enum": [
"Cosine",
"Euclid",
"Dot",
"Manhattan"
]
},
"HnswConfigDiff": {
"type": "object",
"properties": {
"m": {
"description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"ef_construct": {
"description": "Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build the index.",
"type": "integer",
"format": "uint",
"minimum": 4,
"nullable": true
},
"full_scan_threshold": {
"description": "Minimal size (in kilobytes) of vectors for additional payload-based indexing. If payload chunk is smaller than \`full_scan_threshold_kb\` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required. Note: 1Kb = 1 vector of size 256",
"type": "integer",
"format": "uint",
"minimum": 10,
"nullable": true
},
"max_indexing_threads": {
"description": "Number of parallel threads used for background index building. If 0 - automatically select from 8 to 16. Best to keep between 8 and 16 to prevent likelihood of building broken/inefficient HNSW graphs. On small CPUs, less threads are used.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"on_disk": {
"description": "Store HNSW index on disk. If set to false, the index will be stored in RAM. Default: false",
"type": "boolean",
"nullable": true
},
"payload_m": {
"description": "Custom M param for additional payload-aware HNSW links. If not set, default M will be used.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
}
}
},
"QuantizationConfig": {
"anyOf": [
{
"$ref": "#/components/schemas/ScalarQuantization"
},
{
"$ref": "#/components/schemas/ProductQuantization"
},
{
"$ref": "#/components/schemas/BinaryQuantization"
}
]
},
"ScalarQuantization": {
"type": "object",
"required": [
"scalar"
],
"properties": {
"scalar": {
"$ref": "#/components/schemas/ScalarQuantizationConfig"
}
}
},
"ScalarQuantizationConfig": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"$ref": "#/components/schemas/ScalarType"
},
"quantile": {
"description": "Quantile for quantization. Expected value range in [0.5, 1.0]. If not set - use the whole range of values",
"type": "number",
"format": "float",
"maximum": 1,
"minimum": 0.5,
"nullable": true
},
"always_ram": {
"description": "If true - quantized vectors always will be stored in RAM, ignoring the config of main storage",
"type": "boolean",
"nullable": true
}
}
},
"ScalarType": {
"type": "string",
"enum": [
"int8"
]
},
"ProductQuantization": {
"type": "object",
"required": [
"product"
],
"properties": {
"product": {
"$ref": "#/components/schemas/ProductQuantizationConfig"
}
}
},
"ProductQuantizationConfig": {
"type": "object",
"required": [
"compression"
],
"properties": {
"compression": {
"$ref": "#/components/schemas/CompressionRatio"
},
"always_ram": {
"type": "boolean",
"nullable": true
}
}
},
"CompressionRatio": {
"type": "string",
"enum": [
"x4",
"x8",
"x16",
"x32",
"x64"
]
},
"BinaryQuantization": {
"type": "object",
"required": [
"binary"
],
"properties": {
"binary": {
"$ref": "#/components/schemas/BinaryQuantizationConfig"
}
}
},
"BinaryQuantizationConfig": {
"type": "object",
"properties": {
"always_ram": {
"type": "boolean",
"nullable": true
}
}
},
"Datatype": {
"type": "string",
"enum": [
"float32",
"uint8",
"float16"
]
},
"MultiVectorConfig": {
"type": "object",
"required": [
"comparator"
],
"properties": {
"comparator": {
"$ref": "#/components/schemas/MultiVectorComparator"
}
}
},
"MultiVectorComparator": {
"type": "string",
"enum": [
"max_sim"
]
},
"ShardingMethod": {
"type": "string",
"enum": [
"auto",
"custom"
]
},
"SparseVectorParams": {
"description": "Params of single sparse vector data storage",
"type": "object",
"properties": {
"index": {
"description": "Custom params for index. If none - values from collection configuration are used.",
"anyOf": [
{
"$ref": "#/components/schemas/SparseIndexParams"
},
{
"nullable": true
}
]
},
"modifier": {
"description": "Configures addition value modifications for sparse vectors. Default: none",
"anyOf": [
{
"$ref": "#/components/schemas/Modifier"
},
{
"nullable": true
}
]
}
}
},
"SparseIndexParams": {
"description": "Configuration for sparse inverted index.",
"type": "object",
"properties": {
"full_scan_threshold": {
"description": "We prefer a full scan search upto (excluding) this number of vectors.\\n\\nNote: this is number of vectors, not KiloBytes.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"on_disk": {
"description": "Store index on disk. If set to false, the index will be stored in RAM. Default: false",
"type": "boolean",
"nullable": true
},
"datatype": {
"description": "Defines which datatype should be used for the index. Choosing different datatypes allows to optimize memory usage and performance vs accuracy.\\n\\n- For \`float32\` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For \`float16\` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For \`uint8\` datatype - vectors are quantized to unsigned 8-bit integers, 1 byte. Quantization to fit byte range \`[0, 255]\` happens during indexing automatically, so the actual vector data does not need to conform to this range.",
"anyOf": [
{
"$ref": "#/components/schemas/Datatype"
},
{
"nullable": true
}
]
}
}
},
"Modifier": {
"description": "If used, include weight modification, which will be applied to sparse vectors at query time: None - no modification (default) Idf - inverse document frequency, based on statistics of the collection",
"type": "string",
"enum": [
"none",
"idf"
]
},
"HnswConfig": {
"description": "Config of HNSW index",
"type": "object",
"required": [
"ef_construct",
"full_scan_threshold",
"m"
],
"properties": {
"m": {
"description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.",
"type": "integer",
"format": "uint",
"minimum": 0
},
"ef_construct": {
"description": "Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index.",
"type": "integer",
"format": "uint",
"minimum": 4
},
"full_scan_threshold": {
"description": "Minimal size (in KiloBytes) of vectors for additional payload-based indexing. If payload chunk is smaller than \`full_scan_threshold_kb\` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required. Note: 1Kb = 1 vector of size 256",
"type": "integer",
"format": "uint",
"minimum": 0
},
"max_indexing_threads": {
"description": "Number of parallel threads used for background index building. If 0 - automatically select from 8 to 16. Best to keep between 8 and 16 to prevent likelihood of slow building or broken/inefficient HNSW graphs. On small CPUs, less threads are used.",
"default": 0,
"type": "integer",
"format": "uint",
"minimum": 0
},
"on_disk": {
"description": "Store HNSW index on disk. If set to false, index will be stored in RAM. Default: false",
"type": "boolean",
"nullable": true
},
"payload_m": {
"description": "Custom M param for hnsw graph built for payload index. If not set, default M will be used.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
}
}
},
"OptimizersConfig": {
"type": "object",
"required": [
"default_segment_number",
"deleted_threshold",
"flush_interval_sec",
"vacuum_min_vector_number"
],
"properties": {
"deleted_threshold": {
"description": "The minimal fraction of deleted vectors in a segment, required to perform segment optimization",
"type": "number",
"format": "double",
"maximum": 1,
"minimum": 0
},
"vacuum_min_vector_number": {
"description": "The minimal number of vectors in a segment, required to perform segment optimization",
"type": "integer",
"format": "uint",
"minimum": 100
},
"default_segment_number": {
"description": "Target amount of segments optimizer will try to keep. Real amount of segments may vary depending on multiple parameters: - Amount of stored points - Current write RPS\\n\\nIt is recommended to select default number of segments as a factor of the number of search threads, so that each segment would be handled evenly by one of the threads. If \`default_segment_number = 0\`, will be automatically selected by the number of available CPUs.",
"type": "integer",
"format": "uint",
"minimum": 0
},
"max_segment_size": {
"description": "Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments.\\n\\nIf indexing speed is more important - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256 If not set, will be automatically selected considering the number of available CPUs.",
"default": null,
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"memmap_threshold": {
"description": "Maximum size (in kilobytes) of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmapped file.\\n\\nMemmap storage is disabled by default, to enable it, set this threshold to a reasonable value.\\n\\nTo disable memmap storage, set this to \`0\`. Internally it will use the largest threshold possible.\\n\\nNote: 1Kb = 1 vector of size 256",
"default": null,
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"indexing_threshold": {
"description": "Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing\\n\\nDefault value is 20,000, based on <https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md>.\\n\\nTo disable vector indexing, set to \`0\`.\\n\\nNote: 1kB = 1 vector of size 256.",
"default": null,
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"flush_interval_sec": {
"description": "Minimum interval between forced flushes.",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"max_optimization_threads": {
"description": "Max number of threads (jobs) for running optimizations per shard. Note: each optimization job will also use \`max_indexing_threads\` threads by itself for index building. If null - have no limit and choose dynamically to saturate CPU. If 0 - no optimization threads, optimizations will be disabled.",
"default": null,
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
}
}
},
"WalConfig": {
"type": "object",
"required": [
"wal_capacity_mb",
"wal_segments_ahead"
],
"properties": {
"wal_capacity_mb": {
"description": "Size of a single WAL segment in MB",
"type": "integer",
"format": "uint",
"minimum": 1
},
"wal_segments_ahead": {
"description": "Number of WAL segments to create ahead of actually used ones",
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"StrictModeConfig": {
"type": "object",
"properties": {
"enabled": {
"description": "Whether strict mode is enabled for a collection or not.",
"type": "boolean",
"nullable": true
},
"max_query_limit": {
"description": "Max allowed \`limit\` parameter for all APIs that don't have their own max limit.",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"max_timeout": {
"description": "Max allowed \`timeout\` parameter.",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"unindexed_filtering_retrieve": {
"description": "Allow usage of unindexed fields in retrieval based (eg. search) filters.",
"type": "boolean",
"nullable": true
},
"unindexed_filtering_update": {
"description": "Allow usage of unindexed fields in filtered updates (eg. delete by payload).",
"type": "boolean",
"nullable": true
},
"search_max_hnsw_ef": {
"description": "Max HNSW value allowed in search parameters.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"search_allow_exact": {
"description": "Whether exact search is allowed or not.",
"type": "boolean",
"nullable": true
},
"search_max_oversampling": {
"description": "Max oversampling value allowed in search.",
"type": "number",
"format": "double",
"nullable": true
},
"upsert_max_batchsize": {
"description": "Max batchsize when upserting",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"max_collection_vector_size_bytes": {
"description": "Max size of a collections vector storage in bytes, ignoring replicas.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"read_rate_limit": {
"description": "Max number of read operations per minute per replica",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"write_rate_limit": {
"description": "Max number of write operations per minute per replica",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"max_collection_payload_size_bytes": {
"description": "Max size of a collections payload storage in bytes",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"filter_max_conditions": {
"description": "Max conditions a filter can have.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"condition_max_size": {
"description": "Max size of a condition, eg. items in \`MatchAny\`.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"multivector_config": {
"description": "Multivector configuration",
"anyOf": [
{
"$ref": "#/components/schemas/StrictModeMultivectorConfig"
},
{
"nullable": true
}
]
},
"sparse_config": {
"description": "Sparse vector configuration",
"anyOf": [
{
"$ref": "#/components/schemas/StrictModeSparseConfig"
},
{
"nullable": true
}
]
}
}
},
"StrictModeMultivectorConfig": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/StrictModeMultivector"
}
},
"StrictModeMultivector": {
"type": "object",
"properties": {
"max_vectors": {
"description": "Max number of vectors in a multivector",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
}
}
},
"StrictModeSparseConfig": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/StrictModeSparse"
}
},
"StrictModeSparse": {
"type": "object",
"properties": {
"max_length": {
"description": "Max length of sparse vector",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
}
}
},
"PayloadIndexInfo": {
"description": "Display payload field type & index information",
"type": "object",
"required": [
"data_type",
"points"
],
"properties": {
"data_type": {
"$ref": "#/components/schemas/PayloadSchemaType"
},
"params": {
"anyOf": [
{
"$ref": "#/components/schemas/PayloadSchemaParams"
},
{
"nullable": true
}
]
},
"points": {
"description": "Number of points indexed with this index",
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"PayloadSchemaType": {
"description": "All possible names of payload types",
"type": "string",
"enum": [
"keyword",
"integer",
"float",
"geo",
"text",
"bool",
"datetime",
"uuid"
]
},
"PayloadSchemaParams": {
"description": "Payload type with parameters",
"anyOf": [
{
"$ref": "#/components/schemas/KeywordIndexParams"
},
{
"$ref": "#/components/schemas/IntegerIndexParams"
},
{
"$ref": "#/components/schemas/FloatIndexParams"
},
{
"$ref": "#/components/schemas/GeoIndexParams"
},
{
"$ref": "#/components/schemas/TextIndexParams"
},
{
"$ref": "#/components/schemas/BoolIndexParams"
},
{
"$ref": "#/components/schemas/DatetimeIndexParams"
},
{
"$ref": "#/components/schemas/UuidIndexParams"
}
]
},
"KeywordIndexParams": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"$ref": "#/components/schemas/KeywordIndexType"
},
"is_tenant": {
"description": "If true - used for tenant optimization. Default: false.",
"type": "boolean",
"nullable": true
},
"on_disk": {
"description": "If true, store the index on disk. Default: false.",
"type": "boolean",
"nullable": true
}
}
},
"KeywordIndexType": {
"type": "string",
"enum": [
"keyword"
]
},
"IntegerIndexParams": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"$ref": "#/components/schemas/IntegerIndexType"
},
"lookup": {
"description": "If true - support direct lookups.",
"type": "boolean",
"nullable": true
},
"range": {
"description": "If true - support ranges filters.",
"type": "boolean",
"nullable": true
},
"is_principal": {
"description": "If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.",
"type": "boolean",
"nullable": true
},
"on_disk": {
"description": "If true, store the index on disk. Default: false.",
"type": "boolean",
"nullable": true
}
}
},
"IntegerIndexType": {
"type": "string",
"enum": [
"integer"
]
},
"FloatIndexParams": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"$ref": "#/components/schemas/FloatIndexType"
},
"is_principal": {
"description": "If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.",
"type": "boolean",
"nullable": true
},
"on_disk": {
"description": "If true, store the index on disk. Default: false.",
"type": "boolean",
"nullable": true
}
}
},
"FloatIndexType": {
"type": "string",
"enum": [
"float"
]
},
"GeoIndexParams": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"$ref": "#/components/schemas/GeoIndexType"
},
"on_disk": {
"description": "If true, store the index on disk. Default: false.",
"type": "boolean",
"nullable": true
}
}
},
"GeoIndexType": {
"type": "string",
"enum": [
"geo"
]
},
"TextIndexParams": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"$ref": "#/components/schemas/TextIndexType"
},
"tokenizer": {
"$ref": "#/components/schemas/TokenizerType"
},
"min_token_len": {
"description": "Minimum characters to be tokenized.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"max_token_len": {
"description": "Maximum characters to be tokenized.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"lowercase": {
"description": "If true, lowercase all tokens. Default: true.",
"type": "boolean",
"nullable": true
},
"on_disk": {
"description": "If true, store the index on disk. Default: false.",
"type": "boolean",
"nullable": true
}
}
},
"TextIndexType": {
"type": "string",
"enum": [
"text"
]
},
"TokenizerType": {
"type": "string",
"enum": [
"prefix",
"whitespace",
"word",
"multilingual"
]
},
"BoolIndexParams": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"$ref": "#/components/schemas/BoolIndexType"
},
"on_disk": {
"description": "If true, store the index on disk. Default: false.",
"type": "boolean",
"nullable": true
}
}
},
"BoolIndexType": {
"type": "string",
"enum": [
"bool"
]
},
"DatetimeIndexParams": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"$ref": "#/components/schemas/DatetimeIndexType"
},
"is_principal": {
"description": "If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.",
"type": "boolean",
"nullable": true
},
"on_disk": {
"description": "If true, store the index on disk. Default: false.",
"type": "boolean",
"nullable": true
}
}
},
"DatetimeIndexType": {
"type": "string",
"enum": [
"datetime"
]
},
"UuidIndexParams": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"$ref": "#/components/schemas/UuidIndexType"
},
"is_tenant": {
"description": "If true - used for tenant optimization.",
"type": "boolean",
"nullable": true
},
"on_disk": {
"description": "If true, store the index on disk. Default: false.",
"type": "boolean",
"nullable": true
}
}
},
"UuidIndexType": {
"type": "string",
"enum": [
"uuid"
]
},
"PointRequest": {
"type": "object",
"required": [
"ids"
],
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"ids": {
"description": "Look for points with ids",
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtendedPointId"
}
},
"with_payload": {
"description": "Select which payload to return with the response. Default is true.",
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"with_vector": {
"$ref": "#/components/schemas/WithVector"
}
}
},
"ShardKeySelector": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKey"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/ShardKey"
}
}
]
},
"ShardKey": {
"anyOf": [
{
"type": "string",
"example": "region_1"
},
{
"type": "integer",
"format": "uint64",
"minimum": 0,
"example": 12
}
]
},
"ExtendedPointId": {
"description": "Type, used for specifying point ID in user interface",
"anyOf": [
{
"type": "integer",
"format": "uint64",
"minimum": 0,
"example": 42
},
{
"type": "string",
"format": "uuid",
"example": "550e8400-e29b-41d4-a716-446655440000"
}
]
},
"WithPayloadInterface": {
"description": "Options for specifying which payload to include or not",
"anyOf": [
{
"description": "If \`true\` - return all payload, If \`false\` - do not return payload",
"type": "boolean"
},
{
"description": "Specify which fields to return",
"type": "array",
"items": {
"type": "string"
}
},
{
"$ref": "#/components/schemas/PayloadSelector"
}
]
},
"PayloadSelector": {
"description": "Specifies how to treat payload selector",
"anyOf": [
{
"$ref": "#/components/schemas/PayloadSelectorInclude"
},
{
"$ref": "#/components/schemas/PayloadSelectorExclude"
}
]
},
"PayloadSelectorInclude": {
"type": "object",
"required": [
"include"
],
"properties": {
"include": {
"description": "Only include this payload keys",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"PayloadSelectorExclude": {
"type": "object",
"required": [
"exclude"
],
"properties": {
"exclude": {
"description": "Exclude this fields from returning payload",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"WithVector": {
"description": "Options for specifying which vector to include",
"anyOf": [
{
"description": "If \`true\` - return all vector, If \`false\` - do not return vector",
"type": "boolean"
},
{
"description": "Specify which vector to return",
"type": "array",
"items": {
"type": "string"
}
}
]
},
"Record": {
"description": "Point data",
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"payload": {
"description": "Payload - values assigned to the point",
"anyOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"nullable": true
}
]
},
"vector": {
"description": "Vector of the point",
"anyOf": [
{
"$ref": "#/components/schemas/VectorStructOutput"
},
{
"nullable": true
}
]
},
"shard_key": {
"description": "Shard Key",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKey"
},
{
"nullable": true
}
]
},
"order_value": {
"anyOf": [
{
"$ref": "#/components/schemas/OrderValue"
},
{
"nullable": true
}
]
}
}
},
"Payload": {
"type": "object",
"additionalProperties": true,
"example": {
"city": "London",
"color": "green"
}
},
"VectorStructOutput": {
"description": "Vector data stored in Point",
"anyOf": [
{
"type": "array",
"items": {
"type": "number",
"format": "float"
},
"example": [
0.875,
0.140625,
0.897599995136261
]
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number",
"format": "float"
}
},
"example": [
[
0.875,
0.140625,
0.11020000278949738
],
[
0.7580000162124634,
0.28126001358032227,
0.9687100052833557
],
[
0.6209999918937683,
0.42187801003456116,
0.9375
]
]
},
{
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/VectorOutput"
},
"example": {
"image-embeddings": [
0.8730000257492065,
0.140625,
0.897599995136261
]
}
}
]
},
"VectorOutput": {
"description": "Vector Data stored in Point",
"anyOf": [
{
"type": "array",
"items": {
"type": "number",
"format": "float"
}
},
{
"$ref": "#/components/schemas/SparseVector"
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
}
]
},
"SparseVector": {
"description": "Sparse vector structure",
"type": "object",
"required": [
"indices",
"values"
],
"properties": {
"indices": {
"description": "Indices must be unique",
"type": "array",
"items": {
"type": "integer",
"format": "uint32",
"minimum": 0
}
},
"values": {
"description": "Values and indices must be the same length",
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
}
},
"OrderValue": {
"anyOf": [
{
"type": "integer",
"format": "int64",
"example": 42
},
{
"type": "number",
"format": "double",
"example": 42.5
}
]
},
"SearchRequest": {
"description": "Search request. Holds all conditions and parameters for the search of most similar points by vector similarity given the filtering restrictions.",
"type": "object",
"required": [
"limit",
"vector"
],
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"vector": {
"$ref": "#/components/schemas/NamedVectorStruct"
},
"filter": {
"description": "Look only for points which satisfies this conditions",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"params": {
"description": "Additional search params",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"limit": {
"description": "Max number of result to return",
"type": "integer",
"format": "uint",
"minimum": 1
},
"offset": {
"description": "Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"with_payload": {
"description": "Select which payload to return with the response. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"with_vector": {
"description": "Options for specifying which vectors to include into response. Default is false.",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/WithVector"
},
{
"nullable": true
}
]
},
"score_threshold": {
"description": "Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.",
"type": "number",
"format": "float",
"nullable": true
}
}
},
"NamedVectorStruct": {
"description": "Vector data separator for named and unnamed modes Unnamed mode:\\n\\n{ \\"vector\\": [1.0, 2.0, 3.0] }\\n\\nor named mode:\\n\\n{ \\"vector\\": { \\"vector\\": [1.0, 2.0, 3.0], \\"name\\": \\"image-embeddings\\" } }",
"anyOf": [
{
"type": "array",
"items": {
"type": "number",
"format": "float"
}
},
{
"$ref": "#/components/schemas/NamedVector"
},
{
"$ref": "#/components/schemas/NamedSparseVector"
}
]
},
"NamedVector": {
"description": "Dense vector data with name",
"type": "object",
"required": [
"name",
"vector"
],
"properties": {
"name": {
"description": "Name of vector data",
"type": "string"
},
"vector": {
"description": "Vector data",
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
}
},
"NamedSparseVector": {
"description": "Sparse vector data with name",
"type": "object",
"required": [
"name",
"vector"
],
"properties": {
"name": {
"description": "Name of vector data",
"type": "string"
},
"vector": {
"$ref": "#/components/schemas/SparseVector"
}
}
},
"Filter": {
"type": "object",
"properties": {
"should": {
"description": "At least one of those conditions should match",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/Condition"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/Condition"
}
},
{
"nullable": true
}
]
},
"min_should": {
"description": "At least minimum amount of given conditions should match",
"anyOf": [
{
"$ref": "#/components/schemas/MinShould"
},
{
"nullable": true
}
]
},
"must": {
"description": "All conditions must match",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/Condition"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/Condition"
}
},
{
"nullable": true
}
]
},
"must_not": {
"description": "All conditions must NOT match",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/Condition"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/Condition"
}
},
{
"nullable": true
}
]
}
},
"additionalProperties": false
},
"Condition": {
"anyOf": [
{
"$ref": "#/components/schemas/FieldCondition"
},
{
"$ref": "#/components/schemas/IsEmptyCondition"
},
{
"$ref": "#/components/schemas/IsNullCondition"
},
{
"$ref": "#/components/schemas/HasIdCondition"
},
{
"$ref": "#/components/schemas/HasVectorCondition"
},
{
"$ref": "#/components/schemas/NestedCondition"
},
{
"$ref": "#/components/schemas/Filter"
}
]
},
"FieldCondition": {
"description": "All possible payload filtering conditions",
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"description": "Payload key",
"type": "string"
},
"match": {
"description": "Check if point has field with a given value",
"anyOf": [
{
"$ref": "#/components/schemas/Match"
},
{
"nullable": true
}
]
},
"range": {
"description": "Check if points value lies in a given range",
"anyOf": [
{
"$ref": "#/components/schemas/RangeInterface"
},
{
"nullable": true
}
]
},
"geo_bounding_box": {
"description": "Check if points geo location lies in a given area",
"anyOf": [
{
"$ref": "#/components/schemas/GeoBoundingBox"
},
{
"nullable": true
}
]
},
"geo_radius": {
"description": "Check if geo point is within a given radius",
"anyOf": [
{
"$ref": "#/components/schemas/GeoRadius"
},
{
"nullable": true
}
]
},
"geo_polygon": {
"description": "Check if geo point is within a given polygon",
"anyOf": [
{
"$ref": "#/components/schemas/GeoPolygon"
},
{
"nullable": true
}
]
},
"values_count": {
"description": "Check number of values of the field",
"anyOf": [
{
"$ref": "#/components/schemas/ValuesCount"
},
{
"nullable": true
}
]
}
}
},
"Match": {
"description": "Match filter request",
"anyOf": [
{
"$ref": "#/components/schemas/MatchValue"
},
{
"$ref": "#/components/schemas/MatchText"
},
{
"$ref": "#/components/schemas/MatchAny"
},
{
"$ref": "#/components/schemas/MatchExcept"
}
]
},
"MatchValue": {
"description": "Exact match of the given value",
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"$ref": "#/components/schemas/ValueVariants"
}
}
},
"ValueVariants": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer",
"format": "int64"
},
{
"type": "boolean"
}
]
},
"MatchText": {
"description": "Full-text match of the strings.",
"type": "object",
"required": [
"text"
],
"properties": {
"text": {
"type": "string"
}
}
},
"MatchAny": {
"description": "Exact match on any of the given values",
"type": "object",
"required": [
"any"
],
"properties": {
"any": {
"$ref": "#/components/schemas/AnyVariants"
}
}
},
"AnyVariants": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
{
"type": "array",
"items": {
"type": "integer",
"format": "int64"
},
"uniqueItems": true
}
]
},
"MatchExcept": {
"description": "Should have at least one value not matching the any given values",
"type": "object",
"required": [
"except"
],
"properties": {
"except": {
"$ref": "#/components/schemas/AnyVariants"
}
}
},
"RangeInterface": {
"anyOf": [
{
"$ref": "#/components/schemas/Range"
},
{
"$ref": "#/components/schemas/DatetimeRange"
}
]
},
"Range": {
"description": "Range filter request",
"type": "object",
"properties": {
"lt": {
"description": "point.key < range.lt",
"type": "number",
"format": "double",
"nullable": true
},
"gt": {
"description": "point.key > range.gt",
"type": "number",
"format": "double",
"nullable": true
},
"gte": {
"description": "point.key >= range.gte",
"type": "number",
"format": "double",
"nullable": true
},
"lte": {
"description": "point.key <= range.lte",
"type": "number",
"format": "double",
"nullable": true
}
}
},
"DatetimeRange": {
"description": "Range filter request",
"type": "object",
"properties": {
"lt": {
"description": "point.key < range.lt",
"type": "string",
"format": "date-time",
"nullable": true
},
"gt": {
"description": "point.key > range.gt",
"type": "string",
"format": "date-time",
"nullable": true
},
"gte": {
"description": "point.key >= range.gte",
"type": "string",
"format": "date-time",
"nullable": true
},
"lte": {
"description": "point.key <= range.lte",
"type": "string",
"format": "date-time",
"nullable": true
}
}
},
"GeoBoundingBox": {
"description": "Geo filter request\\n\\nMatches coordinates inside the rectangle, described by coordinates of lop-left and bottom-right edges",
"type": "object",
"required": [
"bottom_right",
"top_left"
],
"properties": {
"top_left": {
"$ref": "#/components/schemas/GeoPoint"
},
"bottom_right": {
"$ref": "#/components/schemas/GeoPoint"
}
}
},
"GeoPoint": {
"description": "Geo point payload schema",
"type": "object",
"required": [
"lat",
"lon"
],
"properties": {
"lon": {
"type": "number",
"format": "double"
},
"lat": {
"type": "number",
"format": "double"
}
}
},
"GeoRadius": {
"description": "Geo filter request\\n\\nMatches coordinates inside the circle of \`radius\` and center with coordinates \`center\`",
"type": "object",
"required": [
"center",
"radius"
],
"properties": {
"center": {
"$ref": "#/components/schemas/GeoPoint"
},
"radius": {
"description": "Radius of the area in meters",
"type": "number",
"format": "double"
}
}
},
"GeoPolygon": {
"description": "Geo filter request\\n\\nMatches coordinates inside the polygon, defined by \`exterior\` and \`interiors\`",
"type": "object",
"required": [
"exterior"
],
"properties": {
"exterior": {
"$ref": "#/components/schemas/GeoLineString"
},
"interiors": {
"description": "Interior lines (if present) bound holes within the surface each GeoLineString must consist of a minimum of 4 points, and the first and last points must be the same.",
"type": "array",
"items": {
"$ref": "#/components/schemas/GeoLineString"
},
"nullable": true
}
}
},
"GeoLineString": {
"description": "Ordered sequence of GeoPoints representing the line",
"type": "object",
"required": [
"points"
],
"properties": {
"points": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GeoPoint"
}
}
}
},
"ValuesCount": {
"description": "Values count filter request",
"type": "object",
"properties": {
"lt": {
"description": "point.key.length() < values_count.lt",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"gt": {
"description": "point.key.length() > values_count.gt",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"gte": {
"description": "point.key.length() >= values_count.gte",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"lte": {
"description": "point.key.length() <= values_count.lte",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
}
}
},
"IsEmptyCondition": {
"description": "Select points with empty payload for a specified field",
"type": "object",
"required": [
"is_empty"
],
"properties": {
"is_empty": {
"$ref": "#/components/schemas/PayloadField"
}
}
},
"PayloadField": {
"description": "Payload field",
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"description": "Payload field name",
"type": "string"
}
}
},
"IsNullCondition": {
"description": "Select points with null payload for a specified field",
"type": "object",
"required": [
"is_null"
],
"properties": {
"is_null": {
"$ref": "#/components/schemas/PayloadField"
}
}
},
"HasIdCondition": {
"description": "ID-based filtering condition",
"type": "object",
"required": [
"has_id"
],
"properties": {
"has_id": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"uniqueItems": true
}
}
},
"HasVectorCondition": {
"description": "Filter points which have specific vector assigned",
"type": "object",
"required": [
"has_vector"
],
"properties": {
"has_vector": {
"type": "string"
}
}
},
"NestedCondition": {
"type": "object",
"required": [
"nested"
],
"properties": {
"nested": {
"$ref": "#/components/schemas/Nested"
}
}
},
"Nested": {
"description": "Select points with payload for a specified nested field",
"type": "object",
"required": [
"filter",
"key"
],
"properties": {
"key": {
"type": "string"
},
"filter": {
"$ref": "#/components/schemas/Filter"
}
}
},
"MinShould": {
"type": "object",
"required": [
"conditions",
"min_count"
],
"properties": {
"conditions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Condition"
}
},
"min_count": {
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"SearchParams": {
"description": "Additional parameters of the search",
"type": "object",
"properties": {
"hnsw_ef": {
"description": "Params relevant to HNSW index Size of the beam in a beam-search. Larger the value - more accurate the result, more time required for search.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"exact": {
"description": "Search without approximation. If set to true, search may run long but with exact results.",
"default": false,
"type": "boolean"
},
"quantization": {
"description": "Quantization params",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/QuantizationSearchParams"
},
{
"nullable": true
}
]
},
"indexed_only": {
"description": "If enabled, the engine will only perform search among indexed or small segments. Using this option prevents slow searches in case of delayed index, but does not guarantee that all uploaded vectors will be included in search results",
"default": false,
"type": "boolean"
}
}
},
"QuantizationSearchParams": {
"description": "Additional parameters of the search",
"type": "object",
"properties": {
"ignore": {
"description": "If true, quantized vectors are ignored. Default is false.",
"default": false,
"type": "boolean"
},
"rescore": {
"description": "If true, use original vectors to re-score top-k results. Might require more time in case if original vectors are stored on disk. If not set, qdrant decides automatically apply rescoring or not.",
"default": null,
"type": "boolean",
"nullable": true
},
"oversampling": {
"description": "Oversampling factor for quantization. Default is 1.0.\\n\\nDefines how many extra vectors should be pre-selected using quantized index, and then re-scored using original vectors.\\n\\nFor example, if \`oversampling\` is 2.4 and \`limit\` is 100, then 240 vectors will be pre-selected using quantized index, and then top-100 will be returned after re-scoring.",
"default": null,
"type": "number",
"format": "double",
"minimum": 1,
"nullable": true
}
}
},
"ScoredPoint": {
"description": "Search result",
"type": "object",
"required": [
"id",
"score",
"version"
],
"properties": {
"id": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"version": {
"description": "Point version",
"type": "integer",
"format": "uint64",
"minimum": 0,
"example": 3
},
"score": {
"description": "Points vector distance to the query vector",
"type": "number",
"format": "float",
"example": 0.75
},
"payload": {
"description": "Payload - values assigned to the point",
"anyOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"nullable": true
}
]
},
"vector": {
"description": "Vector of the point",
"anyOf": [
{
"$ref": "#/components/schemas/VectorStructOutput"
},
{
"nullable": true
}
]
},
"shard_key": {
"description": "Shard Key",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKey"
},
{
"nullable": true
}
]
},
"order_value": {
"description": "Order-by value",
"anyOf": [
{
"$ref": "#/components/schemas/OrderValue"
},
{
"nullable": true
}
]
}
}
},
"UpdateResult": {
"type": "object",
"required": [
"status"
],
"properties": {
"operation_id": {
"description": "Sequential number of the operation",
"type": "integer",
"format": "uint64",
"minimum": 0,
"nullable": true
},
"status": {
"$ref": "#/components/schemas/UpdateStatus"
}
}
},
"UpdateStatus": {
"description": "\`Acknowledged\` - Request is saved to WAL and will be process in a queue. \`Completed\` - Request is completed, changes are actual.",
"type": "string",
"enum": [
"acknowledged",
"completed"
]
},
"RecommendRequest": {
"description": "Recommendation request. Provides positive and negative examples of the vectors, which can be ids of points that are already stored in the collection, raw vectors, or even ids and vectors combined.\\n\\nService should look for the points which are closer to positive examples and at the same time further to negative examples. The concrete way of how to compare negative and positive distances is up to the \`strategy\` chosen.",
"type": "object",
"required": [
"limit"
],
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"positive": {
"description": "Look for vectors closest to those",
"default": [],
"type": "array",
"items": {
"$ref": "#/components/schemas/RecommendExample"
}
},
"negative": {
"description": "Try to avoid vectors like this",
"default": [],
"type": "array",
"items": {
"$ref": "#/components/schemas/RecommendExample"
}
},
"strategy": {
"description": "How to use positive and negative examples to find the results",
"anyOf": [
{
"$ref": "#/components/schemas/RecommendStrategy"
},
{
"nullable": true
}
]
},
"filter": {
"description": "Look only for points which satisfies this conditions",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"params": {
"description": "Additional search params",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"limit": {
"description": "Max number of result to return",
"type": "integer",
"format": "uint",
"minimum": 1
},
"offset": {
"description": "Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"with_payload": {
"description": "Select which payload to return with the response. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"with_vector": {
"description": "Options for specifying which vectors to include into response. Default is false.",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/WithVector"
},
{
"nullable": true
}
]
},
"score_threshold": {
"description": "Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.",
"type": "number",
"format": "float",
"nullable": true
},
"using": {
"description": "Define which vector to use for recommendation, if not specified - try to use default vector",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/UsingVector"
},
{
"nullable": true
}
]
},
"lookup_from": {
"description": "The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/LookupLocation"
},
{
"nullable": true
}
]
}
}
},
"RecommendExample": {
"anyOf": [
{
"$ref": "#/components/schemas/ExtendedPointId"
},
{
"type": "array",
"items": {
"type": "number",
"format": "float"
}
},
{
"$ref": "#/components/schemas/SparseVector"
}
]
},
"RecommendStrategy": {
"description": "How to use positive and negative examples to find the results, default is \`average_vector\`:\\n\\n* \`average_vector\` - Average positive and negative vectors and create a single query with the formula \`query = avg_pos + avg_pos - avg_neg\`. Then performs normal search.\\n\\n* \`best_score\` - Uses custom search objective. Each candidate is compared against all examples, its score is then chosen from the \`max(max_pos_score, max_neg_score)\`. If the \`max_neg_score\` is chosen then it is squared and negated, otherwise it is just the \`max_pos_score\`.",
"type": "string",
"enum": [
"average_vector",
"best_score"
]
},
"UsingVector": {
"anyOf": [
{
"type": "string"
}
]
},
"LookupLocation": {
"description": "Defines a location to use for looking up the vector. Specifies collection and vector field name.",
"type": "object",
"required": [
"collection"
],
"properties": {
"collection": {
"description": "Name of the collection used for lookup",
"type": "string"
},
"vector": {
"description": "Optional name of the vector field within the collection. If not provided, the default vector field will be used.",
"default": null,
"type": "string",
"nullable": true
},
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
}
}
},
"ScrollRequest": {
"description": "Scroll request - paginate over all points which matches given condition",
"type": "object",
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"offset": {
"description": "Start ID to read points from.",
"anyOf": [
{
"$ref": "#/components/schemas/ExtendedPointId"
},
{
"nullable": true
}
]
},
"limit": {
"description": "Page size. Default: 10",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"filter": {
"description": "Look only for points which satisfies this conditions. If not provided - all points.",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"with_payload": {
"description": "Select which payload to return with the response. Default is true.",
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"with_vector": {
"$ref": "#/components/schemas/WithVector"
},
"order_by": {
"description": "Order the records by a payload field.",
"anyOf": [
{
"$ref": "#/components/schemas/OrderByInterface"
},
{
"nullable": true
}
]
}
}
},
"OrderByInterface": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/OrderBy"
}
]
},
"OrderBy": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"description": "Payload key to order by",
"type": "string"
},
"direction": {
"description": "Direction of ordering: \`asc\` or \`desc\`. Default is ascending.",
"anyOf": [
{
"$ref": "#/components/schemas/Direction"
},
{
"nullable": true
}
]
},
"start_from": {
"description": "Which payload value to start scrolling from. Default is the lowest value for \`asc\` and the highest for \`desc\`",
"anyOf": [
{
"$ref": "#/components/schemas/StartFrom"
},
{
"nullable": true
}
]
}
}
},
"Direction": {
"type": "string",
"enum": [
"asc",
"desc"
]
},
"StartFrom": {
"anyOf": [
{
"type": "integer",
"format": "int64"
},
{
"type": "number",
"format": "double"
},
{
"type": "string",
"format": "date-time"
}
]
},
"ScrollResult": {
"description": "Result of the points read request",
"type": "object",
"required": [
"points"
],
"properties": {
"points": {
"description": "List of retrieved points",
"type": "array",
"items": {
"$ref": "#/components/schemas/Record"
},
"example": [
{
"id": 40,
"payload": {
"city": "London",
"color": "green"
},
"vector": [
0.875,
0.140625,
0.897599995136261
],
"shard_key": "region_1"
},
{
"id": 41,
"payload": {
"city": "Paris",
"color": "red"
},
"vector": [
0.75,
0.640625,
0.8945000171661377
],
"shard_key": "region_1"
}
]
},
"next_page_offset": {
"description": "Offset which should be used to retrieve a next page result",
"anyOf": [
{
"$ref": "#/components/schemas/ExtendedPointId"
},
{
"nullable": true
}
]
}
}
},
"CreateCollection": {
"description": "Operation for creating new collection and (optionally) specify index params",
"type": "object",
"properties": {
"vectors": {
"$ref": "#/components/schemas/VectorsConfig"
},
"shard_number": {
"description": "For auto sharding: Number of shards in collection. - Default is 1 for standalone, otherwise equal to the number of nodes - Minimum is 1\\n\\nFor custom sharding: Number of shards in collection per shard group. - Default is 1, meaning that each shard key will be mapped to a single shard - Minimum is 1",
"default": null,
"type": "integer",
"format": "uint32",
"minimum": 1,
"nullable": true
},
"sharding_method": {
"description": "Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/ShardingMethod"
},
{
"nullable": true
}
]
},
"replication_factor": {
"description": "Number of shards replicas. Default is 1 Minimum is 1",
"default": null,
"type": "integer",
"format": "uint32",
"minimum": 1,
"nullable": true
},
"write_consistency_factor": {
"description": "Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact.",
"default": null,
"type": "integer",
"format": "uint32",
"minimum": 1,
"nullable": true
},
"on_disk_payload": {
"description": "If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM.\\n\\nDefault: true",
"default": null,
"type": "boolean",
"nullable": true
},
"hnsw_config": {
"description": "Custom params for HNSW index. If none - values from service configuration file are used.",
"anyOf": [
{
"$ref": "#/components/schemas/HnswConfigDiff"
},
{
"nullable": true
}
]
},
"wal_config": {
"description": "Custom params for WAL. If none - values from service configuration file are used.",
"anyOf": [
{
"$ref": "#/components/schemas/WalConfigDiff"
},
{
"nullable": true
}
]
},
"optimizers_config": {
"description": "Custom params for Optimizers. If none - values from service configuration file are used.",
"anyOf": [
{
"$ref": "#/components/schemas/OptimizersConfigDiff"
},
{
"nullable": true
}
]
},
"init_from": {
"description": "Specify other collection to copy data from.",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/InitFrom"
},
{
"nullable": true
}
]
},
"quantization_config": {
"description": "Quantization parameters. If none - quantization is disabled.",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/QuantizationConfig"
},
{
"nullable": true
}
]
},
"sparse_vectors": {
"description": "Sparse vector data config.",
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/SparseVectorParams"
},
"nullable": true
},
"strict_mode_config": {
"description": "Strict-mode config.",
"anyOf": [
{
"$ref": "#/components/schemas/StrictModeConfig"
},
{
"nullable": true
}
]
}
}
},
"WalConfigDiff": {
"type": "object",
"properties": {
"wal_capacity_mb": {
"description": "Size of a single WAL segment in MB",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"wal_segments_ahead": {
"description": "Number of WAL segments to create ahead of actually used ones",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
}
}
},
"OptimizersConfigDiff": {
"type": "object",
"properties": {
"deleted_threshold": {
"description": "The minimal fraction of deleted vectors in a segment, required to perform segment optimization",
"type": "number",
"format": "double",
"nullable": true
},
"vacuum_min_vector_number": {
"description": "The minimal number of vectors in a segment, required to perform segment optimization",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"default_segment_number": {
"description": "Target amount of segments optimizer will try to keep. Real amount of segments may vary depending on multiple parameters: - Amount of stored points - Current write RPS\\n\\nIt is recommended to select default number of segments as a factor of the number of search threads, so that each segment would be handled evenly by one of the threads If \`default_segment_number = 0\`, will be automatically selected by the number of available CPUs",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"max_segment_size": {
"description": "Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments.\\n\\nIf indexation speed have more priority for your - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"memmap_threshold": {
"description": "Maximum size (in kilobytes) of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmapped file.\\n\\nMemmap storage is disabled by default, to enable it, set this threshold to a reasonable value.\\n\\nTo disable memmap storage, set this to \`0\`.\\n\\nNote: 1Kb = 1 vector of size 256",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"indexing_threshold": {
"description": "Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing\\n\\nDefault value is 20,000, based on <https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md>.\\n\\nTo disable vector indexing, set to \`0\`.\\n\\nNote: 1kB = 1 vector of size 256.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"flush_interval_sec": {
"description": "Minimum interval between forced flushes.",
"type": "integer",
"format": "uint64",
"minimum": 0,
"nullable": true
},
"max_optimization_threads": {
"description": "Max number of threads (jobs) for running optimizations per shard. Note: each optimization job will also use \`max_indexing_threads\` threads by itself for index building. If \\"auto\\" - have no limit and choose dynamically to saturate CPU. If 0 - no optimization threads, optimizations will be disabled.",
"anyOf": [
{
"$ref": "#/components/schemas/MaxOptimizationThreads"
},
{
"nullable": true
}
]
}
}
},
"MaxOptimizationThreads": {
"anyOf": [
{
"$ref": "#/components/schemas/MaxOptimizationThreadsSetting"
},
{
"type": "integer",
"format": "uint",
"minimum": 0
}
]
},
"MaxOptimizationThreadsSetting": {
"type": "string",
"enum": [
"auto"
]
},
"InitFrom": {
"description": "Operation for creating new collection and (optionally) specify index params",
"type": "object",
"required": [
"collection"
],
"properties": {
"collection": {
"type": "string"
}
}
},
"UpdateCollection": {
"description": "Operation for updating parameters of the existing collection",
"type": "object",
"properties": {
"vectors": {
"description": "Map of vector data parameters to update for each named vector. To update parameters in a collection having a single unnamed vector, use an empty string as name.",
"anyOf": [
{
"$ref": "#/components/schemas/VectorsConfigDiff"
},
{
"nullable": true
}
]
},
"optimizers_config": {
"description": "Custom params for Optimizers. If none - it is left unchanged. This operation is blocking, it will only proceed once all current optimizations are complete",
"anyOf": [
{
"$ref": "#/components/schemas/OptimizersConfigDiff"
},
{
"nullable": true
}
]
},
"params": {
"description": "Collection base params. If none - it is left unchanged.",
"anyOf": [
{
"$ref": "#/components/schemas/CollectionParamsDiff"
},
{
"nullable": true
}
]
},
"hnsw_config": {
"description": "HNSW parameters to update for the collection index. If none - it is left unchanged.",
"anyOf": [
{
"$ref": "#/components/schemas/HnswConfigDiff"
},
{
"nullable": true
}
]
},
"quantization_config": {
"description": "Quantization parameters to update. If none - it is left unchanged.",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/QuantizationConfigDiff"
},
{
"nullable": true
}
]
},
"sparse_vectors": {
"description": "Map of sparse vector data parameters to update for each sparse vector.",
"anyOf": [
{
"$ref": "#/components/schemas/SparseVectorsConfig"
},
{
"nullable": true
}
]
},
"strict_mode_config": {
"anyOf": [
{
"$ref": "#/components/schemas/StrictModeConfig"
},
{
"nullable": true
}
]
}
}
},
"VectorsConfigDiff": {
"description": "Vector update params for multiple vectors\\n\\n{ \\"vector_name\\": { \\"hnsw_config\\": { \\"m\\": 8 } } }",
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/VectorParamsDiff"
}
},
"VectorParamsDiff": {
"type": "object",
"properties": {
"hnsw_config": {
"description": "Update params for HNSW index. If empty object - it will be unset.",
"anyOf": [
{
"$ref": "#/components/schemas/HnswConfigDiff"
},
{
"nullable": true
}
]
},
"quantization_config": {
"description": "Update params for quantization. If none - it is left unchanged.",
"anyOf": [
{
"$ref": "#/components/schemas/QuantizationConfigDiff"
},
{
"nullable": true
}
]
},
"on_disk": {
"description": "If true, vectors are served from disk, improving RAM usage at the cost of latency",
"type": "boolean",
"nullable": true
}
}
},
"QuantizationConfigDiff": {
"anyOf": [
{
"$ref": "#/components/schemas/ScalarQuantization"
},
{
"$ref": "#/components/schemas/ProductQuantization"
},
{
"$ref": "#/components/schemas/BinaryQuantization"
},
{
"$ref": "#/components/schemas/Disabled"
}
]
},
"Disabled": {
"type": "string",
"enum": [
"Disabled"
]
},
"CollectionParamsDiff": {
"type": "object",
"properties": {
"replication_factor": {
"description": "Number of replicas for each shard",
"type": "integer",
"format": "uint32",
"minimum": 1,
"nullable": true
},
"write_consistency_factor": {
"description": "Minimal number successful responses from replicas to consider operation successful",
"type": "integer",
"format": "uint32",
"minimum": 1,
"nullable": true
},
"read_fan_out_factor": {
"description": "Fan-out every read request to these many additional remote nodes (and return first available response)",
"type": "integer",
"format": "uint32",
"minimum": 0,
"nullable": true
},
"on_disk_payload": {
"description": "If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM.",
"default": null,
"type": "boolean",
"nullable": true
}
}
},
"SparseVectorsConfig": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/SparseVectorParams"
}
},
"ChangeAliasesOperation": {
"description": "Operation for performing changes of collection aliases. Alias changes are atomic, meaning that no collection modifications can happen between alias operations.",
"type": "object",
"required": [
"actions"
],
"properties": {
"actions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AliasOperations"
}
}
}
},
"AliasOperations": {
"description": "Group of all the possible operations related to collection aliases",
"anyOf": [
{
"$ref": "#/components/schemas/CreateAliasOperation"
},
{
"$ref": "#/components/schemas/DeleteAliasOperation"
},
{
"$ref": "#/components/schemas/RenameAliasOperation"
}
]
},
"CreateAliasOperation": {
"type": "object",
"required": [
"create_alias"
],
"properties": {
"create_alias": {
"$ref": "#/components/schemas/CreateAlias"
}
}
},
"CreateAlias": {
"description": "Create alternative name for a collection. Collection will be available under both names for search, retrieve,",
"type": "object",
"required": [
"alias_name",
"collection_name"
],
"properties": {
"collection_name": {
"type": "string"
},
"alias_name": {
"type": "string"
}
}
},
"DeleteAliasOperation": {
"description": "Delete alias if exists",
"type": "object",
"required": [
"delete_alias"
],
"properties": {
"delete_alias": {
"$ref": "#/components/schemas/DeleteAlias"
}
}
},
"DeleteAlias": {
"description": "Delete alias if exists",
"type": "object",
"required": [
"alias_name"
],
"properties": {
"alias_name": {
"type": "string"
}
}
},
"RenameAliasOperation": {
"description": "Change alias to a new one",
"type": "object",
"required": [
"rename_alias"
],
"properties": {
"rename_alias": {
"$ref": "#/components/schemas/RenameAlias"
}
}
},
"RenameAlias": {
"description": "Change alias to a new one",
"type": "object",
"required": [
"new_alias_name",
"old_alias_name"
],
"properties": {
"old_alias_name": {
"type": "string"
},
"new_alias_name": {
"type": "string"
}
}
},
"CreateFieldIndex": {
"type": "object",
"required": [
"field_name"
],
"properties": {
"field_name": {
"type": "string"
},
"field_schema": {
"anyOf": [
{
"$ref": "#/components/schemas/PayloadFieldSchema"
},
{
"nullable": true
}
]
}
}
},
"PayloadFieldSchema": {
"anyOf": [
{
"$ref": "#/components/schemas/PayloadSchemaType"
},
{
"$ref": "#/components/schemas/PayloadSchemaParams"
}
]
},
"PointsSelector": {
"anyOf": [
{
"$ref": "#/components/schemas/PointIdsList"
},
{
"$ref": "#/components/schemas/FilterSelector"
}
]
},
"PointIdsList": {
"type": "object",
"required": [
"points"
],
"properties": {
"points": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtendedPointId"
}
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
}
}
},
"FilterSelector": {
"type": "object",
"required": [
"filter"
],
"properties": {
"filter": {
"$ref": "#/components/schemas/Filter"
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
}
}
},
"PointInsertOperations": {
"anyOf": [
{
"$ref": "#/components/schemas/PointsBatch"
},
{
"$ref": "#/components/schemas/PointsList"
}
]
},
"PointsBatch": {
"type": "object",
"required": [
"batch"
],
"properties": {
"batch": {
"$ref": "#/components/schemas/Batch"
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
}
}
},
"Batch": {
"type": "object",
"required": [
"ids",
"vectors"
],
"properties": {
"ids": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtendedPointId"
}
},
"vectors": {
"$ref": "#/components/schemas/BatchVectorStruct"
},
"payloads": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"nullable": true
}
]
},
"nullable": true
}
}
},
"BatchVectorStruct": {
"anyOf": [
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
}
},
{
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Vector"
}
}
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/Document"
}
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/Image"
}
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/InferenceObject"
}
}
]
},
"Vector": {
"description": "Vector Data Vectors can be described directly with values Or specified with source \\"objects\\" for inference",
"anyOf": [
{
"type": "array",
"items": {
"type": "number",
"format": "float"
}
},
{
"$ref": "#/components/schemas/SparseVector"
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
},
{
"$ref": "#/components/schemas/Document"
},
{
"$ref": "#/components/schemas/Image"
},
{
"$ref": "#/components/schemas/InferenceObject"
}
]
},
"Document": {
"description": "WARN: Work-in-progress, unimplemented\\n\\nText document for embedding. Requires inference infrastructure, unimplemented.",
"type": "object",
"required": [
"model",
"text"
],
"properties": {
"text": {
"description": "Text of the document This field will be used as input for the embedding model",
"type": "string",
"example": "This is a document text"
},
"model": {
"description": "Name of the model used to generate the vector List of available models depends on a provider",
"type": "string",
"minLength": 1,
"example": "jinaai/jina-embeddings-v2-base-en"
},
"options": {
"description": "Parameters for the model Values of the parameters are model-specific",
"type": "object",
"additionalProperties": true,
"nullable": true
}
}
},
"Image": {
"description": "WARN: Work-in-progress, unimplemented\\n\\nImage object for embedding. Requires inference infrastructure, unimplemented.",
"type": "object",
"required": [
"image",
"model"
],
"properties": {
"image": {
"description": "Image data: base64 encoded image or an URL",
"example": "https://example.com/image.jpg"
},
"model": {
"description": "Name of the model used to generate the vector List of available models depends on a provider",
"type": "string",
"minLength": 1,
"example": "Qdrant/clip-ViT-B-32-vision"
},
"options": {
"description": "Parameters for the model Values of the parameters are model-specific",
"type": "object",
"additionalProperties": true,
"nullable": true
}
}
},
"InferenceObject": {
"description": "WARN: Work-in-progress, unimplemented\\n\\nCustom object for embedding. Requires inference infrastructure, unimplemented.",
"type": "object",
"required": [
"model",
"object"
],
"properties": {
"object": {
"description": "Arbitrary data, used as input for the embedding model Used if the model requires more than one input or a custom input"
},
"model": {
"description": "Name of the model used to generate the vector List of available models depends on a provider",
"type": "string",
"minLength": 1,
"example": "jinaai/jina-embeddings-v2-base-en"
},
"options": {
"description": "Parameters for the model Values of the parameters are model-specific",
"type": "object",
"additionalProperties": true,
"nullable": true
}
}
},
"PointsList": {
"type": "object",
"required": [
"points"
],
"properties": {
"points": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PointStruct"
}
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
}
}
},
"PointStruct": {
"type": "object",
"required": [
"id",
"vector"
],
"properties": {
"id": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"vector": {
"$ref": "#/components/schemas/VectorStruct"
},
"payload": {
"description": "Payload values (optional)",
"anyOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"nullable": true
}
]
}
}
},
"VectorStruct": {
"description": "Full vector data per point separator with single and multiple vector modes",
"anyOf": [
{
"type": "array",
"items": {
"type": "number",
"format": "float"
},
"example": [
0.875,
0.140625,
0.897599995136261
]
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number",
"format": "float"
}
},
"example": [
[
0.875,
0.140625,
0.11020000278949738
],
[
0.7580000162124634,
0.28126001358032227,
0.9687100052833557
],
[
0.6209999918937683,
0.42187801003456116,
0.9375
]
]
},
{
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/Vector"
},
"example": {
"image-embeddings": [
0.8730000257492065,
0.140625,
0.897599995136261
]
}
},
{
"$ref": "#/components/schemas/Document"
},
{
"$ref": "#/components/schemas/Image"
},
{
"$ref": "#/components/schemas/InferenceObject"
}
]
},
"SetPayload": {
"description": "This data structure is used in API interface and applied across multiple shards",
"type": "object",
"required": [
"payload"
],
"properties": {
"payload": {
"$ref": "#/components/schemas/Payload"
},
"points": {
"description": "Assigns payload to each point in this list",
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"nullable": true
},
"filter": {
"description": "Assigns payload to each point that satisfy this filter condition",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"key": {
"description": "Assigns payload to each point that satisfy this path of property",
"type": "string",
"nullable": true
}
}
},
"DeletePayload": {
"description": "This data structure is used in API interface and applied across multiple shards",
"type": "object",
"required": [
"keys"
],
"properties": {
"keys": {
"description": "List of payload keys to remove from payload",
"type": "array",
"items": {
"type": "string"
}
},
"points": {
"description": "Deletes values from each point in this list",
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"nullable": true
},
"filter": {
"description": "Deletes values from points that satisfy this filter condition",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
}
}
},
"ClusterStatus": {
"description": "Information about current cluster status and structure",
"oneOf": [
{
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"type": "string",
"enum": [
"disabled"
]
}
}
},
{
"description": "Description of enabled cluster",
"type": "object",
"required": [
"consensus_thread_status",
"message_send_failures",
"peer_id",
"peers",
"raft_info",
"status"
],
"properties": {
"status": {
"type": "string",
"enum": [
"enabled"
]
},
"peer_id": {
"description": "ID of this peer",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"peers": {
"description": "Peers composition of the cluster with main information",
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/PeerInfo"
}
},
"raft_info": {
"$ref": "#/components/schemas/RaftInfo"
},
"consensus_thread_status": {
"$ref": "#/components/schemas/ConsensusThreadStatus"
},
"message_send_failures": {
"description": "Consequent failures of message send operations in consensus by peer address. On the first success to send to that peer - entry is removed from this hashmap.",
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/MessageSendErrors"
}
}
}
}
]
},
"PeerInfo": {
"description": "Information of a peer in the cluster",
"type": "object",
"required": [
"uri"
],
"properties": {
"uri": {
"type": "string"
}
}
},
"RaftInfo": {
"description": "Summary information about the current raft state",
"type": "object",
"required": [
"commit",
"is_voter",
"pending_operations",
"term"
],
"properties": {
"term": {
"description": "Raft divides time into terms of arbitrary length, each beginning with an election. If a candidate wins the election, it remains the leader for the rest of the term. The term number increases monotonically. Each server stores the current term number which is also exchanged in every communication.",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"commit": {
"description": "The index of the latest committed (finalized) operation that this peer is aware of.",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"pending_operations": {
"description": "Number of consensus operations pending to be applied on this peer",
"type": "integer",
"format": "uint",
"minimum": 0
},
"leader": {
"description": "Leader of the current term",
"type": "integer",
"format": "uint64",
"minimum": 0,
"nullable": true
},
"role": {
"description": "Role of this peer in the current term",
"anyOf": [
{
"$ref": "#/components/schemas/StateRole"
},
{
"nullable": true
}
]
},
"is_voter": {
"description": "Is this peer a voter or a learner",
"type": "boolean"
}
}
},
"StateRole": {
"description": "Role of the peer in the consensus",
"type": "string",
"enum": [
"Follower",
"Candidate",
"Leader",
"PreCandidate"
]
},
"ConsensusThreadStatus": {
"description": "Information about current consensus thread status",
"oneOf": [
{
"type": "object",
"required": [
"consensus_thread_status",
"last_update"
],
"properties": {
"consensus_thread_status": {
"type": "string",
"enum": [
"working"
]
},
"last_update": {
"type": "string",
"format": "date-time"
}
}
},
{
"type": "object",
"required": [
"consensus_thread_status"
],
"properties": {
"consensus_thread_status": {
"type": "string",
"enum": [
"stopped"
]
}
}
},
{
"type": "object",
"required": [
"consensus_thread_status",
"err"
],
"properties": {
"consensus_thread_status": {
"type": "string",
"enum": [
"stopped_with_err"
]
},
"err": {
"type": "string"
}
}
}
]
},
"MessageSendErrors": {
"description": "Message send failures for a particular peer",
"type": "object",
"required": [
"count"
],
"properties": {
"count": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"latest_error": {
"type": "string",
"nullable": true
},
"latest_error_timestamp": {
"description": "Timestamp of the latest error",
"type": "string",
"format": "date-time",
"nullable": true
}
}
},
"SnapshotDescription": {
"type": "object",
"required": [
"name",
"size"
],
"properties": {
"name": {
"type": "string"
},
"creation_time": {
"type": "string",
"format": "partial-date-time",
"nullable": true
},
"size": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"checksum": {
"type": "string",
"nullable": true
}
},
"example": {
"name": "my-collection-3766212330831337-2024-07-22-08-31-55.snapshot",
"creation_time": "2022-08-04T10:49:10",
"size": 1000000,
"checksum": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0"
}
},
"CountRequest": {
"description": "Count Request Counts the number of points which satisfy the given filter. If filter is not provided, the count of all points in the collection will be returned.",
"type": "object",
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"filter": {
"description": "Look only for points which satisfies this conditions",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"exact": {
"description": "If true, count exact number of points. If false, count approximate number of points faster. Approximate count might be unreliable during the indexing process. Default: true",
"default": true,
"type": "boolean"
}
}
},
"CountResult": {
"type": "object",
"required": [
"count"
],
"properties": {
"count": {
"description": "Number of points which satisfy the conditions",
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"CollectionClusterInfo": {
"description": "Current clustering distribution for the collection",
"type": "object",
"required": [
"local_shards",
"peer_id",
"remote_shards",
"shard_count",
"shard_transfers"
],
"properties": {
"peer_id": {
"description": "ID of this peer",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"shard_count": {
"description": "Total number of shards",
"type": "integer",
"format": "uint",
"minimum": 0
},
"local_shards": {
"description": "Local shards",
"type": "array",
"items": {
"$ref": "#/components/schemas/LocalShardInfo"
}
},
"remote_shards": {
"description": "Remote shards",
"type": "array",
"items": {
"$ref": "#/components/schemas/RemoteShardInfo"
}
},
"shard_transfers": {
"description": "Shard transfers",
"type": "array",
"items": {
"$ref": "#/components/schemas/ShardTransferInfo"
}
},
"resharding_operations": {
"description": "Resharding operations",
"type": "array",
"items": {
"$ref": "#/components/schemas/ReshardingInfo"
},
"nullable": true
}
}
},
"LocalShardInfo": {
"type": "object",
"required": [
"points_count",
"shard_id",
"state"
],
"properties": {
"shard_id": {
"description": "Local shard id",
"type": "integer",
"format": "uint32",
"minimum": 0
},
"shard_key": {
"description": "User-defined sharding key",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKey"
},
{
"nullable": true
}
]
},
"points_count": {
"description": "Number of points in the shard",
"type": "integer",
"format": "uint",
"minimum": 0
},
"state": {
"$ref": "#/components/schemas/ReplicaState"
}
}
},
"ReplicaState": {
"description": "State of the single shard within a replica set.",
"type": "string",
"enum": [
"Active",
"Dead",
"Partial",
"Initializing",
"Listener",
"PartialSnapshot",
"Recovery",
"Resharding",
"ReshardingScaleDown"
]
},
"RemoteShardInfo": {
"type": "object",
"required": [
"peer_id",
"shard_id",
"state"
],
"properties": {
"shard_id": {
"description": "Remote shard id",
"type": "integer",
"format": "uint32",
"minimum": 0
},
"shard_key": {
"description": "User-defined sharding key",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKey"
},
{
"nullable": true
}
]
},
"peer_id": {
"description": "Remote peer id",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"state": {
"$ref": "#/components/schemas/ReplicaState"
}
}
},
"ShardTransferInfo": {
"type": "object",
"required": [
"from",
"shard_id",
"sync",
"to"
],
"properties": {
"shard_id": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"to_shard_id": {
"description": "Target shard ID if different than source shard ID\\n\\nUsed exclusively with \`ReshardStreamRecords\` transfer method.",
"type": "integer",
"format": "uint32",
"minimum": 0,
"nullable": true
},
"from": {
"description": "Source peer id",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"to": {
"description": "Destination peer id",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"sync": {
"description": "If \`true\` transfer is a synchronization of a replicas If \`false\` transfer is a moving of a shard from one peer to another",
"type": "boolean"
},
"method": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardTransferMethod"
},
{
"nullable": true
}
]
},
"comment": {
"description": "A human-readable report of the transfer progress. Available only on the source peer.",
"type": "string",
"nullable": true
}
}
},
"ShardTransferMethod": {
"description": "Methods for transferring a shard from one node to another.",
"oneOf": [
{
"description": "Stream all shard records in batches until the whole shard is transferred.",
"type": "string",
"enum": [
"stream_records"
]
},
{
"description": "Snapshot the shard, transfer and restore it on the receiver.",
"type": "string",
"enum": [
"snapshot"
]
},
{
"description": "Attempt to transfer shard difference by WAL delta.",
"type": "string",
"enum": [
"wal_delta"
]
},
{
"description": "Shard transfer for resharding: stream all records in batches until all points are transferred.",
"type": "string",
"enum": [
"resharding_stream_records"
]
}
]
},
"ReshardingInfo": {
"type": "object",
"required": [
"direction",
"peer_id",
"shard_id"
],
"properties": {
"direction": {
"$ref": "#/components/schemas/ReshardingDirection"
},
"shard_id": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKey"
},
{
"nullable": true
}
]
}
}
},
"ReshardingDirection": {
"description": "Resharding direction, scale up or down in number of shards",
"oneOf": [
{
"description": "Scale up, add a new shard",
"type": "string",
"enum": [
"up"
]
},
{
"description": "Scale down, remove a shard",
"type": "string",
"enum": [
"down"
]
}
]
},
"TelemetryData": {
"type": "object",
"required": [
"app",
"collections",
"id"
],
"properties": {
"id": {
"type": "string"
},
"app": {
"$ref": "#/components/schemas/AppBuildTelemetry"
},
"collections": {
"$ref": "#/components/schemas/CollectionsTelemetry"
},
"cluster": {
"anyOf": [
{
"$ref": "#/components/schemas/ClusterTelemetry"
},
{
"nullable": true
}
]
},
"requests": {
"anyOf": [
{
"$ref": "#/components/schemas/RequestsTelemetry"
},
{
"nullable": true
}
]
},
"memory": {
"anyOf": [
{
"$ref": "#/components/schemas/MemoryTelemetry"
},
{
"nullable": true
}
]
},
"hardware": {
"anyOf": [
{
"$ref": "#/components/schemas/HardwareTelemetry"
},
{
"nullable": true
}
]
}
}
},
"AppBuildTelemetry": {
"type": "object",
"required": [
"name",
"startup",
"version"
],
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
},
"features": {
"anyOf": [
{
"$ref": "#/components/schemas/AppFeaturesTelemetry"
},
{
"nullable": true
}
]
},
"system": {
"anyOf": [
{
"$ref": "#/components/schemas/RunningEnvironmentTelemetry"
},
{
"nullable": true
}
]
},
"jwt_rbac": {
"type": "boolean",
"nullable": true
},
"hide_jwt_dashboard": {
"type": "boolean",
"nullable": true
},
"startup": {
"type": "string",
"format": "date-time"
}
}
},
"AppFeaturesTelemetry": {
"type": "object",
"required": [
"debug",
"gpu",
"recovery_mode",
"service_debug_feature",
"web_feature"
],
"properties": {
"debug": {
"type": "boolean"
},
"web_feature": {
"type": "boolean"
},
"service_debug_feature": {
"type": "boolean"
},
"recovery_mode": {
"type": "boolean"
},
"gpu": {
"type": "boolean"
}
}
},
"RunningEnvironmentTelemetry": {
"type": "object",
"required": [
"cpu_flags",
"is_docker"
],
"properties": {
"distribution": {
"type": "string",
"nullable": true
},
"distribution_version": {
"type": "string",
"nullable": true
},
"is_docker": {
"type": "boolean"
},
"cores": {
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"ram_size": {
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"disk_size": {
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"cpu_flags": {
"type": "string"
},
"cpu_endian": {
"anyOf": [
{
"$ref": "#/components/schemas/CpuEndian"
},
{
"nullable": true
}
]
},
"gpu_devices": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GpuDeviceTelemetry"
},
"nullable": true
}
}
},
"CpuEndian": {
"type": "string",
"enum": [
"little",
"big",
"other"
]
},
"GpuDeviceTelemetry": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
},
"CollectionsTelemetry": {
"type": "object",
"required": [
"number_of_collections"
],
"properties": {
"number_of_collections": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"collections": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CollectionTelemetryEnum"
},
"nullable": true
}
}
},
"CollectionTelemetryEnum": {
"anyOf": [
{
"$ref": "#/components/schemas/CollectionTelemetry"
},
{
"$ref": "#/components/schemas/CollectionsAggregatedTelemetry"
}
]
},
"CollectionTelemetry": {
"type": "object",
"required": [
"config",
"id",
"init_time_ms",
"resharding",
"shard_clean_tasks",
"shards",
"transfers"
],
"properties": {
"id": {
"type": "string"
},
"init_time_ms": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"config": {
"$ref": "#/components/schemas/CollectionConfigInternal"
},
"shards": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ReplicaSetTelemetry"
}
},
"transfers": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ShardTransferInfo"
}
},
"resharding": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ReshardingInfo"
}
},
"shard_clean_tasks": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/ShardCleanStatusTelemetry"
}
}
}
},
"CollectionConfigInternal": {
"type": "object",
"required": [
"hnsw_config",
"optimizer_config",
"params",
"wal_config"
],
"properties": {
"params": {
"$ref": "#/components/schemas/CollectionParams"
},
"hnsw_config": {
"$ref": "#/components/schemas/HnswConfig"
},
"optimizer_config": {
"$ref": "#/components/schemas/OptimizersConfig"
},
"wal_config": {
"$ref": "#/components/schemas/WalConfig"
},
"quantization_config": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/QuantizationConfig"
},
{
"nullable": true
}
]
},
"strict_mode_config": {
"anyOf": [
{
"$ref": "#/components/schemas/StrictModeConfig"
},
{
"nullable": true
}
]
},
"uuid": {
"default": null,
"type": "string",
"format": "uuid",
"nullable": true
}
}
},
"ReplicaSetTelemetry": {
"type": "object",
"required": [
"id",
"remote",
"replicate_states"
],
"properties": {
"id": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKey"
},
{
"nullable": true
}
]
},
"local": {
"anyOf": [
{
"$ref": "#/components/schemas/LocalShardTelemetry"
},
{
"nullable": true
}
]
},
"remote": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RemoteShardTelemetry"
}
},
"replicate_states": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/ReplicaState"
}
}
}
},
"LocalShardTelemetry": {
"type": "object",
"required": [
"optimizations",
"segments",
"total_optimized_points"
],
"properties": {
"variant_name": {
"type": "string",
"nullable": true
},
"status": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardStatus"
},
{
"nullable": true
}
]
},
"total_optimized_points": {
"description": "Total number of optimized points since the last start.",
"type": "integer",
"format": "uint",
"minimum": 0
},
"segments": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SegmentTelemetry"
}
},
"optimizations": {
"$ref": "#/components/schemas/OptimizerTelemetry"
},
"async_scorer": {
"type": "boolean",
"nullable": true
}
}
},
"ShardStatus": {
"description": "Current state of the shard (supports same states as the collection)\\n\\n\`Green\` - all good. \`Yellow\` - optimization is running, 'Grey' - optimizations are possible but not triggered, \`Red\` - some operations failed and was not recovered",
"type": "string",
"enum": [
"green",
"yellow",
"grey",
"red"
]
},
"SegmentTelemetry": {
"type": "object",
"required": [
"config",
"info",
"payload_field_indices",
"vector_index_searches"
],
"properties": {
"info": {
"$ref": "#/components/schemas/SegmentInfo"
},
"config": {
"$ref": "#/components/schemas/SegmentConfig"
},
"vector_index_searches": {
"type": "array",
"items": {
"$ref": "#/components/schemas/VectorIndexSearchesTelemetry"
}
},
"payload_field_indices": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PayloadIndexTelemetry"
}
}
}
},
"SegmentInfo": {
"description": "Aggregated information about segment",
"type": "object",
"required": [
"disk_usage_bytes",
"index_schema",
"is_appendable",
"num_deleted_vectors",
"num_indexed_vectors",
"num_points",
"num_vectors",
"payloads_size_bytes",
"ram_usage_bytes",
"segment_type",
"vector_data",
"vectors_size_bytes"
],
"properties": {
"segment_type": {
"$ref": "#/components/schemas/SegmentType"
},
"num_vectors": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"num_points": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"num_indexed_vectors": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"num_deleted_vectors": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"vectors_size_bytes": {
"description": "An ESTIMATION of effective amount of bytes used for vectors Do NOT rely on this number unless you know what you are doing",
"type": "integer",
"format": "uint",
"minimum": 0
},
"payloads_size_bytes": {
"description": "An estimation of the effective amount of bytes used for payloads",
"type": "integer",
"format": "uint",
"minimum": 0
},
"ram_usage_bytes": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"disk_usage_bytes": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"is_appendable": {
"type": "boolean"
},
"index_schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/PayloadIndexInfo"
}
},
"vector_data": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/VectorDataInfo"
}
}
}
},
"SegmentType": {
"description": "Type of segment",
"type": "string",
"enum": [
"plain",
"indexed",
"special"
]
},
"VectorDataInfo": {
"type": "object",
"required": [
"num_deleted_vectors",
"num_indexed_vectors",
"num_vectors"
],
"properties": {
"num_vectors": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"num_indexed_vectors": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"num_deleted_vectors": {
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"SegmentConfig": {
"type": "object",
"required": [
"payload_storage_type"
],
"properties": {
"vector_data": {
"default": {},
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/VectorDataConfig"
}
},
"sparse_vector_data": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/SparseVectorDataConfig"
}
},
"payload_storage_type": {
"$ref": "#/components/schemas/PayloadStorageType"
}
}
},
"VectorDataConfig": {
"description": "Config of single vector data storage",
"type": "object",
"required": [
"distance",
"index",
"size",
"storage_type"
],
"properties": {
"size": {
"description": "Size/dimensionality of the vectors used",
"type": "integer",
"format": "uint",
"minimum": 0
},
"distance": {
"$ref": "#/components/schemas/Distance"
},
"storage_type": {
"$ref": "#/components/schemas/VectorStorageType"
},
"index": {
"$ref": "#/components/schemas/Indexes"
},
"quantization_config": {
"description": "Vector specific quantization config that overrides collection config",
"anyOf": [
{
"$ref": "#/components/schemas/QuantizationConfig"
},
{
"nullable": true
}
]
},
"multivector_config": {
"description": "Vector specific configuration to enable multiple vectors per point",
"anyOf": [
{
"$ref": "#/components/schemas/MultiVectorConfig"
},
{
"nullable": true
}
]
},
"datatype": {
"description": "Vector specific configuration to set specific storage element type",
"anyOf": [
{
"$ref": "#/components/schemas/VectorStorageDatatype"
},
{
"nullable": true
}
]
}
}
},
"VectorStorageType": {
"description": "Storage types for vectors",
"oneOf": [
{
"description": "Storage in memory (RAM)\\n\\nWill be very fast at the cost of consuming a lot of memory.",
"type": "string",
"enum": [
"Memory"
]
},
{
"description": "Storage in mmap file, not appendable\\n\\nSearch performance is defined by disk speed and the fraction of vectors that fit in memory.",
"type": "string",
"enum": [
"Mmap"
]
},
{
"description": "Storage in chunked mmap files, appendable\\n\\nSearch performance is defined by disk speed and the fraction of vectors that fit in memory.",
"type": "string",
"enum": [
"ChunkedMmap"
]
},
{
"description": "Same as \`ChunkedMmap\`, but vectors are forced to be locked in RAM In this way we avoid cold requests to disk, but risk to run out of memory\\n\\nDesigned as a replacement for \`Memory\`, which doesn't depend on RocksDB",
"type": "string",
"enum": [
"InRamChunkedMmap"
]
}
]
},
"Indexes": {
"description": "Vector index configuration",
"oneOf": [
{
"description": "Do not use any index, scan whole vector collection during search. Guarantee 100% precision, but may be time consuming on large collections.",
"type": "object",
"required": [
"options",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"plain"
]
},
"options": {
"type": "object"
}
}
},
{
"description": "Use filterable HNSW index for approximate search. Is very fast even on a very huge collections, but require additional space to store index and additional time to build it.",
"type": "object",
"required": [
"options",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"hnsw"
]
},
"options": {
"$ref": "#/components/schemas/HnswConfig"
}
}
}
]
},
"VectorStorageDatatype": {
"description": "Storage types for vectors",
"type": "string",
"enum": [
"float32",
"float16",
"uint8"
]
},
"SparseVectorDataConfig": {
"description": "Config of single sparse vector data storage",
"type": "object",
"required": [
"index"
],
"properties": {
"index": {
"$ref": "#/components/schemas/SparseIndexConfig"
},
"storage_type": {
"$ref": "#/components/schemas/SparseVectorStorageType"
}
}
},
"SparseIndexConfig": {
"description": "Configuration for sparse inverted index.",
"type": "object",
"required": [
"index_type"
],
"properties": {
"full_scan_threshold": {
"description": "We prefer a full scan search upto (excluding) this number of vectors.\\n\\nNote: this is number of vectors, not KiloBytes.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"index_type": {
"$ref": "#/components/schemas/SparseIndexType"
},
"datatype": {
"description": "Datatype used to store weights in the index.",
"anyOf": [
{
"$ref": "#/components/schemas/VectorStorageDatatype"
},
{
"nullable": true
}
]
}
}
},
"SparseIndexType": {
"description": "Sparse index types",
"oneOf": [
{
"description": "Mutable RAM sparse index",
"type": "string",
"enum": [
"MutableRam"
]
},
{
"description": "Immutable RAM sparse index",
"type": "string",
"enum": [
"ImmutableRam"
]
},
{
"description": "Mmap sparse index",
"type": "string",
"enum": [
"Mmap"
]
}
]
},
"SparseVectorStorageType": {
"oneOf": [
{
"description": "Storage on disk",
"type": "string",
"enum": [
"on_disk"
]
},
{
"description": "Storage in memory maps",
"type": "string",
"enum": [
"mmap"
]
}
]
},
"PayloadStorageType": {
"description": "Type of payload storage",
"oneOf": [
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"in_memory"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"on_disk"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"mmap"
]
}
}
}
]
},
"VectorIndexSearchesTelemetry": {
"type": "object",
"required": [
"filtered_exact",
"filtered_large_cardinality",
"filtered_plain",
"filtered_small_cardinality",
"filtered_sparse",
"unfiltered_exact",
"unfiltered_hnsw",
"unfiltered_plain",
"unfiltered_sparse"
],
"properties": {
"index_name": {
"type": "string",
"nullable": true
},
"unfiltered_plain": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"unfiltered_hnsw": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"unfiltered_sparse": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"filtered_plain": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"filtered_small_cardinality": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"filtered_large_cardinality": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"filtered_exact": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"filtered_sparse": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"unfiltered_exact": {
"$ref": "#/components/schemas/OperationDurationStatistics"
}
}
},
"OperationDurationStatistics": {
"type": "object",
"required": [
"count",
"total_duration_micros"
],
"properties": {
"count": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"fail_count": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"avg_duration_micros": {
"description": "The average time taken by 128 latest operations, calculated as a weighted mean.",
"type": "number",
"format": "float",
"nullable": true
},
"min_duration_micros": {
"description": "The minimum duration of the operations across all the measurements.",
"type": "number",
"format": "float",
"nullable": true
},
"max_duration_micros": {
"description": "The maximum duration of the operations across all the measurements.",
"type": "number",
"format": "float",
"nullable": true
},
"total_duration_micros": {
"description": "The total duration of all operations in microseconds.",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"last_responded": {
"type": "string",
"format": "date-time",
"nullable": true
}
}
},
"PayloadIndexTelemetry": {
"type": "object",
"required": [
"points_count",
"points_values_count"
],
"properties": {
"field_name": {
"type": "string",
"nullable": true
},
"points_values_count": {
"description": "The amount of values indexed for all points.",
"type": "integer",
"format": "uint",
"minimum": 0
},
"points_count": {
"description": "The amount of points that have at least one value indexed.",
"type": "integer",
"format": "uint",
"minimum": 0
},
"histogram_bucket_size": {
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
}
}
},
"OptimizerTelemetry": {
"type": "object",
"required": [
"log",
"optimizations",
"status"
],
"properties": {
"status": {
"$ref": "#/components/schemas/OptimizersStatus"
},
"optimizations": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"log": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TrackerTelemetry"
}
}
}
},
"TrackerTelemetry": {
"description": "Tracker object used in telemetry",
"type": "object",
"required": [
"name",
"segment_ids",
"start_at",
"status"
],
"properties": {
"name": {
"description": "Name of the optimizer",
"type": "string"
},
"segment_ids": {
"description": "Segment IDs being optimized",
"type": "array",
"items": {
"type": "integer",
"format": "uint",
"minimum": 0
}
},
"status": {
"$ref": "#/components/schemas/TrackerStatus"
},
"start_at": {
"description": "Start time of the optimizer",
"type": "string",
"format": "date-time"
},
"end_at": {
"description": "End time of the optimizer",
"type": "string",
"format": "date-time",
"nullable": true
}
}
},
"TrackerStatus": {
"description": "Represents the current state of the optimizer being tracked",
"oneOf": [
{
"type": "string",
"enum": [
"optimizing",
"done"
]
},
{
"type": "object",
"required": [
"cancelled"
],
"properties": {
"cancelled": {
"type": "string"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "string"
}
},
"additionalProperties": false
}
]
},
"RemoteShardTelemetry": {
"type": "object",
"required": [
"searches",
"shard_id",
"updates"
],
"properties": {
"shard_id": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0,
"nullable": true
},
"searches": {
"$ref": "#/components/schemas/OperationDurationStatistics"
},
"updates": {
"$ref": "#/components/schemas/OperationDurationStatistics"
}
}
},
"ShardCleanStatusTelemetry": {
"oneOf": [
{
"type": "string",
"enum": [
"started",
"done",
"cancelled"
]
},
{
"type": "object",
"required": [
"progress"
],
"properties": {
"progress": {
"$ref": "#/components/schemas/ShardCleanStatusProgressTelemetry"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"failed"
],
"properties": {
"failed": {
"$ref": "#/components/schemas/ShardCleanStatusFailedTelemetry"
}
},
"additionalProperties": false
}
]
},
"ShardCleanStatusProgressTelemetry": {
"type": "object",
"required": [
"deleted_points"
],
"properties": {
"deleted_points": {
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"ShardCleanStatusFailedTelemetry": {
"type": "object",
"required": [
"reason"
],
"properties": {
"reason": {
"type": "string"
}
}
},
"CollectionsAggregatedTelemetry": {
"type": "object",
"required": [
"optimizers_status",
"params",
"vectors"
],
"properties": {
"vectors": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"optimizers_status": {
"$ref": "#/components/schemas/OptimizersStatus"
},
"params": {
"$ref": "#/components/schemas/CollectionParams"
}
}
},
"ClusterTelemetry": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
},
"status": {
"anyOf": [
{
"$ref": "#/components/schemas/ClusterStatusTelemetry"
},
{
"nullable": true
}
]
},
"config": {
"anyOf": [
{
"$ref": "#/components/schemas/ClusterConfigTelemetry"
},
{
"nullable": true
}
]
},
"peers": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/PeerInfo"
},
"nullable": true
},
"metadata": {
"type": "object",
"additionalProperties": true,
"nullable": true
}
}
},
"ClusterStatusTelemetry": {
"type": "object",
"required": [
"commit",
"consensus_thread_status",
"is_voter",
"number_of_peers",
"pending_operations",
"term"
],
"properties": {
"number_of_peers": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"term": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"commit": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"pending_operations": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"role": {
"anyOf": [
{
"$ref": "#/components/schemas/StateRole"
},
{
"nullable": true
}
]
},
"is_voter": {
"type": "boolean"
},
"peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0,
"nullable": true
},
"consensus_thread_status": {
"$ref": "#/components/schemas/ConsensusThreadStatus"
}
}
},
"ClusterConfigTelemetry": {
"type": "object",
"required": [
"consensus",
"grpc_timeout_ms",
"p2p"
],
"properties": {
"grpc_timeout_ms": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"p2p": {
"$ref": "#/components/schemas/P2pConfigTelemetry"
},
"consensus": {
"$ref": "#/components/schemas/ConsensusConfigTelemetry"
}
}
},
"P2pConfigTelemetry": {
"type": "object",
"required": [
"connection_pool_size"
],
"properties": {
"connection_pool_size": {
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"ConsensusConfigTelemetry": {
"type": "object",
"required": [
"bootstrap_timeout_sec",
"max_message_queue_size",
"tick_period_ms"
],
"properties": {
"max_message_queue_size": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"tick_period_ms": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"bootstrap_timeout_sec": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
}
},
"RequestsTelemetry": {
"type": "object",
"required": [
"grpc",
"rest"
],
"properties": {
"rest": {
"$ref": "#/components/schemas/WebApiTelemetry"
},
"grpc": {
"$ref": "#/components/schemas/GrpcTelemetry"
}
}
},
"WebApiTelemetry": {
"type": "object",
"required": [
"responses"
],
"properties": {
"responses": {
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/OperationDurationStatistics"
}
}
}
}
},
"GrpcTelemetry": {
"type": "object",
"required": [
"responses"
],
"properties": {
"responses": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/OperationDurationStatistics"
}
}
}
},
"MemoryTelemetry": {
"type": "object",
"required": [
"active_bytes",
"allocated_bytes",
"metadata_bytes",
"resident_bytes",
"retained_bytes"
],
"properties": {
"active_bytes": {
"description": "Total number of bytes in active pages allocated by the application",
"type": "integer",
"format": "uint",
"minimum": 0
},
"allocated_bytes": {
"description": "Total number of bytes allocated by the application",
"type": "integer",
"format": "uint",
"minimum": 0
},
"metadata_bytes": {
"description": "Total number of bytes dedicated to metadata",
"type": "integer",
"format": "uint",
"minimum": 0
},
"resident_bytes": {
"description": "Maximum number of bytes in physically resident data pages mapped",
"type": "integer",
"format": "uint",
"minimum": 0
},
"retained_bytes": {
"description": "Total number of bytes in virtual memory mappings",
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"HardwareTelemetry": {
"type": "object",
"required": [
"collection_data"
],
"properties": {
"collection_data": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/HardwareUsage"
}
}
}
},
"HardwareUsage": {
"description": "Usage of the hardware resources, spent to process the request",
"type": "object",
"required": [
"cpu",
"io_read",
"io_write"
],
"properties": {
"cpu": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"io_read": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"io_write": {
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"ClusterOperations": {
"anyOf": [
{
"$ref": "#/components/schemas/MoveShardOperation"
},
{
"$ref": "#/components/schemas/ReplicateShardOperation"
},
{
"$ref": "#/components/schemas/AbortTransferOperation"
},
{
"$ref": "#/components/schemas/DropReplicaOperation"
},
{
"$ref": "#/components/schemas/CreateShardingKeyOperation"
},
{
"$ref": "#/components/schemas/DropShardingKeyOperation"
},
{
"$ref": "#/components/schemas/RestartTransferOperation"
},
{
"$ref": "#/components/schemas/StartReshardingOperation"
},
{
"$ref": "#/components/schemas/AbortReshardingOperation"
}
]
},
"MoveShardOperation": {
"type": "object",
"required": [
"move_shard"
],
"properties": {
"move_shard": {
"$ref": "#/components/schemas/MoveShard"
}
}
},
"MoveShard": {
"type": "object",
"required": [
"from_peer_id",
"shard_id",
"to_peer_id"
],
"properties": {
"shard_id": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"to_peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"from_peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"method": {
"description": "Method for transferring the shard from one node to another",
"anyOf": [
{
"$ref": "#/components/schemas/ShardTransferMethod"
},
{
"nullable": true
}
]
}
}
},
"ReplicateShardOperation": {
"type": "object",
"required": [
"replicate_shard"
],
"properties": {
"replicate_shard": {
"$ref": "#/components/schemas/ReplicateShard"
}
}
},
"ReplicateShard": {
"type": "object",
"required": [
"from_peer_id",
"shard_id",
"to_peer_id"
],
"properties": {
"shard_id": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"to_peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"from_peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"method": {
"description": "Method for transferring the shard from one node to another",
"anyOf": [
{
"$ref": "#/components/schemas/ShardTransferMethod"
},
{
"nullable": true
}
]
}
}
},
"AbortTransferOperation": {
"type": "object",
"required": [
"abort_transfer"
],
"properties": {
"abort_transfer": {
"$ref": "#/components/schemas/AbortShardTransfer"
}
}
},
"AbortShardTransfer": {
"type": "object",
"required": [
"from_peer_id",
"shard_id",
"to_peer_id"
],
"properties": {
"shard_id": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"to_peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"from_peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
}
},
"DropReplicaOperation": {
"type": "object",
"required": [
"drop_replica"
],
"properties": {
"drop_replica": {
"$ref": "#/components/schemas/Replica"
}
}
},
"Replica": {
"type": "object",
"required": [
"peer_id",
"shard_id"
],
"properties": {
"shard_id": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
}
},
"CreateShardingKeyOperation": {
"type": "object",
"required": [
"create_sharding_key"
],
"properties": {
"create_sharding_key": {
"$ref": "#/components/schemas/CreateShardingKey"
}
}
},
"CreateShardingKey": {
"type": "object",
"required": [
"shard_key"
],
"properties": {
"shard_key": {
"$ref": "#/components/schemas/ShardKey"
},
"shards_number": {
"description": "How many shards to create for this key If not specified, will use the default value from config",
"type": "integer",
"format": "uint32",
"minimum": 1,
"nullable": true
},
"replication_factor": {
"description": "How many replicas to create for each shard If not specified, will use the default value from config",
"type": "integer",
"format": "uint32",
"minimum": 1,
"nullable": true
},
"placement": {
"description": "Placement of shards for this key List of peer ids, that can be used to place shards for this key If not specified, will be randomly placed among all peers",
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"nullable": true
}
}
},
"DropShardingKeyOperation": {
"type": "object",
"required": [
"drop_sharding_key"
],
"properties": {
"drop_sharding_key": {
"$ref": "#/components/schemas/DropShardingKey"
}
}
},
"DropShardingKey": {
"type": "object",
"required": [
"shard_key"
],
"properties": {
"shard_key": {
"$ref": "#/components/schemas/ShardKey"
}
}
},
"RestartTransferOperation": {
"type": "object",
"required": [
"restart_transfer"
],
"properties": {
"restart_transfer": {
"$ref": "#/components/schemas/RestartTransfer"
}
}
},
"RestartTransfer": {
"type": "object",
"required": [
"from_peer_id",
"method",
"shard_id",
"to_peer_id"
],
"properties": {
"shard_id": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"from_peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"to_peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"method": {
"$ref": "#/components/schemas/ShardTransferMethod"
}
}
},
"StartReshardingOperation": {
"type": "object",
"required": [
"start_resharding"
],
"properties": {
"start_resharding": {
"$ref": "#/components/schemas/StartResharding"
}
}
},
"StartResharding": {
"type": "object",
"required": [
"direction"
],
"properties": {
"direction": {
"$ref": "#/components/schemas/ReshardingDirection"
},
"peer_id": {
"type": "integer",
"format": "uint64",
"minimum": 0,
"nullable": true
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKey"
},
{
"nullable": true
}
]
}
}
},
"AbortReshardingOperation": {
"type": "object",
"required": [
"abort_resharding"
],
"properties": {
"abort_resharding": {
"$ref": "#/components/schemas/AbortResharding"
}
}
},
"AbortResharding": {
"type": "object"
},
"SearchRequestBatch": {
"type": "object",
"required": [
"searches"
],
"properties": {
"searches": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchRequest"
}
}
}
},
"RecommendRequestBatch": {
"type": "object",
"required": [
"searches"
],
"properties": {
"searches": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RecommendRequest"
}
}
}
},
"LocksOption": {
"type": "object",
"required": [
"write"
],
"properties": {
"error_message": {
"type": "string",
"nullable": true
},
"write": {
"type": "boolean"
}
}
},
"SnapshotRecover": {
"type": "object",
"required": [
"location"
],
"properties": {
"location": {
"description": "Examples: - URL \`http://localhost:8080/collections/my_collection/snapshots/my_snapshot\` - Local path \`file:///qdrant/snapshots/test_collection-2022-08-04-10-49-10.snapshot\`",
"type": "string",
"format": "uri"
},
"priority": {
"description": "Defines which data should be used as a source of truth if there are other replicas in the cluster. If set to \`Snapshot\`, the snapshot will be used as a source of truth, and the current state will be overwritten. If set to \`Replica\`, the current state will be used as a source of truth, and after recovery if will be synchronized with the snapshot.",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/SnapshotPriority"
},
{
"nullable": true
}
]
},
"checksum": {
"description": "Optional SHA256 checksum to verify snapshot integrity before recovery.",
"default": null,
"type": "string",
"nullable": true
},
"api_key": {
"description": "Optional API key used when fetching the snapshot from a remote URL.",
"default": null,
"type": "string",
"nullable": true
}
}
},
"SnapshotPriority": {
"description": "Defines source of truth for snapshot recovery:\\n\\n\`NoSync\` means - restore snapshot without *any* additional synchronization. \`Snapshot\` means - prefer snapshot data over the current state. \`Replica\` means - prefer existing data over the snapshot.",
"type": "string",
"enum": [
"no_sync",
"snapshot",
"replica"
]
},
"CollectionsAliasesResponse": {
"type": "object",
"required": [
"aliases"
],
"properties": {
"aliases": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AliasDescription"
}
}
}
},
"AliasDescription": {
"type": "object",
"required": [
"alias_name",
"collection_name"
],
"properties": {
"alias_name": {
"type": "string"
},
"collection_name": {
"type": "string"
}
},
"example": {
"alias_name": "blogs-title",
"collection_name": "arivx-title"
}
},
"WriteOrdering": {
"description": "Defines write ordering guarantees for collection operations\\n\\n* \`weak\` - write operations may be reordered, works faster, default\\n\\n* \`medium\` - write operations go through dynamically selected leader, may be inconsistent for a short period of time in case of leader change\\n\\n* \`strong\` - Write operations go through the permanent leader, consistent, but may be unavailable if leader is down",
"type": "string",
"enum": [
"weak",
"medium",
"strong"
]
},
"ReadConsistency": {
"description": "Read consistency parameter\\n\\nDefines how many replicas should be queried to get the result\\n\\n* \`N\` - send N random request and return points, which present on all of them\\n\\n* \`majority\` - send N/2+1 random request and return points, which present on all of them\\n\\n* \`quorum\` - send requests to all nodes and return points which present on majority of them\\n\\n* \`all\` - send requests to all nodes and return points which present on all of them\\n\\nDefault value is \`Factor(1)\`",
"anyOf": [
{
"type": "integer",
"format": "uint",
"minimum": 0
},
{
"$ref": "#/components/schemas/ReadConsistencyType"
}
]
},
"ReadConsistencyType": {
"description": "* \`majority\` - send N/2+1 random request and return points, which present on all of them\\n\\n* \`quorum\` - send requests to all nodes and return points which present on majority of nodes\\n\\n* \`all\` - send requests to all nodes and return points which present on all nodes",
"type": "string",
"enum": [
"majority",
"quorum",
"all"
]
},
"UpdateVectors": {
"type": "object",
"required": [
"points"
],
"properties": {
"points": {
"description": "Points with named vectors",
"type": "array",
"items": {
"$ref": "#/components/schemas/PointVectors"
},
"minItems": 1
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
}
}
},
"PointVectors": {
"type": "object",
"required": [
"id",
"vector"
],
"properties": {
"id": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"vector": {
"$ref": "#/components/schemas/VectorStruct"
}
}
},
"DeleteVectors": {
"type": "object",
"required": [
"vector"
],
"properties": {
"points": {
"description": "Deletes values from each point in this list",
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"nullable": true
},
"filter": {
"description": "Deletes values from points that satisfy this filter condition",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"vector": {
"description": "Vector names",
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
}
}
},
"PointGroup": {
"type": "object",
"required": [
"hits",
"id"
],
"properties": {
"hits": {
"description": "Scored points that have the same value of the group_by key",
"type": "array",
"items": {
"$ref": "#/components/schemas/ScoredPoint"
}
},
"id": {
"$ref": "#/components/schemas/GroupId"
},
"lookup": {
"description": "Record that has been looked up using the group id",
"anyOf": [
{
"$ref": "#/components/schemas/Record"
},
{
"nullable": true
}
]
}
}
},
"GroupId": {
"description": "Value of the group_by key, shared across all the hits in the group",
"anyOf": [
{
"type": "string"
},
{
"type": "integer",
"format": "uint64",
"minimum": 0
},
{
"type": "integer",
"format": "int64"
}
]
},
"SearchGroupsRequest": {
"type": "object",
"required": [
"group_by",
"group_size",
"limit",
"vector"
],
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"vector": {
"$ref": "#/components/schemas/NamedVectorStruct"
},
"filter": {
"description": "Look only for points which satisfies this conditions",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"params": {
"description": "Additional search params",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"with_payload": {
"description": "Select which payload to return with the response. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"with_vector": {
"description": "Options for specifying which vectors to include into response. Default is false.",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/WithVector"
},
{
"nullable": true
}
]
},
"score_threshold": {
"description": "Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.",
"type": "number",
"format": "float",
"nullable": true
},
"group_by": {
"description": "Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups.",
"type": "string",
"minLength": 1
},
"group_size": {
"description": "Maximum amount of points to return per group",
"type": "integer",
"format": "uint32",
"minimum": 1
},
"limit": {
"description": "Maximum amount of groups to return",
"type": "integer",
"format": "uint32",
"minimum": 1
},
"with_lookup": {
"description": "Look for points in another collection using the group ids",
"anyOf": [
{
"$ref": "#/components/schemas/WithLookupInterface"
},
{
"nullable": true
}
]
}
}
},
"WithLookupInterface": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/WithLookup"
}
]
},
"WithLookup": {
"type": "object",
"required": [
"collection"
],
"properties": {
"collection": {
"description": "Name of the collection to use for points lookup",
"type": "string"
},
"with_payload": {
"description": "Options for specifying which payload to include (or not)",
"default": true,
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"with_vectors": {
"description": "Options for specifying which vectors to include (or not)",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/WithVector"
},
{
"nullable": true
}
]
}
}
},
"RecommendGroupsRequest": {
"type": "object",
"required": [
"group_by",
"group_size",
"limit"
],
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"positive": {
"description": "Look for vectors closest to those",
"default": [],
"type": "array",
"items": {
"$ref": "#/components/schemas/RecommendExample"
}
},
"negative": {
"description": "Try to avoid vectors like this",
"default": [],
"type": "array",
"items": {
"$ref": "#/components/schemas/RecommendExample"
}
},
"strategy": {
"description": "How to use positive and negative examples to find the results",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/RecommendStrategy"
},
{
"nullable": true
}
]
},
"filter": {
"description": "Look only for points which satisfies this conditions",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"params": {
"description": "Additional search params",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"with_payload": {
"description": "Select which payload to return with the response. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"with_vector": {
"description": "Options for specifying which vectors to include into response. Default is false.",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/WithVector"
},
{
"nullable": true
}
]
},
"score_threshold": {
"description": "Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.",
"type": "number",
"format": "float",
"nullable": true
},
"using": {
"description": "Define which vector to use for recommendation, if not specified - try to use default vector",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/UsingVector"
},
{
"nullable": true
}
]
},
"lookup_from": {
"description": "The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/LookupLocation"
},
{
"nullable": true
}
]
},
"group_by": {
"description": "Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups.",
"type": "string",
"minLength": 1
},
"group_size": {
"description": "Maximum amount of points to return per group",
"type": "integer",
"format": "uint32",
"minimum": 1
},
"limit": {
"description": "Maximum amount of groups to return",
"type": "integer",
"format": "uint32",
"minimum": 1
},
"with_lookup": {
"description": "Look for points in another collection using the group ids",
"anyOf": [
{
"$ref": "#/components/schemas/WithLookupInterface"
},
{
"nullable": true
}
]
}
}
},
"GroupsResult": {
"type": "object",
"required": [
"groups"
],
"properties": {
"groups": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PointGroup"
}
}
}
},
"UpdateOperations": {
"type": "object",
"required": [
"operations"
],
"properties": {
"operations": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UpdateOperation"
}
}
}
},
"UpdateOperation": {
"anyOf": [
{
"$ref": "#/components/schemas/UpsertOperation"
},
{
"$ref": "#/components/schemas/DeleteOperation"
},
{
"$ref": "#/components/schemas/SetPayloadOperation"
},
{
"$ref": "#/components/schemas/OverwritePayloadOperation"
},
{
"$ref": "#/components/schemas/DeletePayloadOperation"
},
{
"$ref": "#/components/schemas/ClearPayloadOperation"
},
{
"$ref": "#/components/schemas/UpdateVectorsOperation"
},
{
"$ref": "#/components/schemas/DeleteVectorsOperation"
}
]
},
"UpsertOperation": {
"type": "object",
"required": [
"upsert"
],
"properties": {
"upsert": {
"$ref": "#/components/schemas/PointInsertOperations"
}
}
},
"DeleteOperation": {
"type": "object",
"required": [
"delete"
],
"properties": {
"delete": {
"$ref": "#/components/schemas/PointsSelector"
}
}
},
"SetPayloadOperation": {
"type": "object",
"required": [
"set_payload"
],
"properties": {
"set_payload": {
"$ref": "#/components/schemas/SetPayload"
}
}
},
"OverwritePayloadOperation": {
"type": "object",
"required": [
"overwrite_payload"
],
"properties": {
"overwrite_payload": {
"$ref": "#/components/schemas/SetPayload"
}
}
},
"DeletePayloadOperation": {
"type": "object",
"required": [
"delete_payload"
],
"properties": {
"delete_payload": {
"$ref": "#/components/schemas/DeletePayload"
}
}
},
"ClearPayloadOperation": {
"type": "object",
"required": [
"clear_payload"
],
"properties": {
"clear_payload": {
"$ref": "#/components/schemas/PointsSelector"
}
}
},
"UpdateVectorsOperation": {
"type": "object",
"required": [
"update_vectors"
],
"properties": {
"update_vectors": {
"$ref": "#/components/schemas/UpdateVectors"
}
}
},
"DeleteVectorsOperation": {
"type": "object",
"required": [
"delete_vectors"
],
"properties": {
"delete_vectors": {
"$ref": "#/components/schemas/DeleteVectors"
}
}
},
"ShardSnapshotRecover": {
"type": "object",
"required": [
"location"
],
"properties": {
"location": {
"$ref": "#/components/schemas/ShardSnapshotLocation"
},
"priority": {
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/SnapshotPriority"
},
{
"nullable": true
}
]
},
"checksum": {
"description": "Optional SHA256 checksum to verify snapshot integrity before recovery.",
"default": null,
"type": "string",
"nullable": true
},
"api_key": {
"description": "Optional API key used when fetching the snapshot from a remote URL.",
"default": null,
"type": "string",
"nullable": true
}
}
},
"ShardSnapshotLocation": {
"anyOf": [
{
"type": "string",
"format": "uri"
},
{
"type": "string"
}
]
},
"DiscoverRequest": {
"description": "Use context and a target to find the most similar points, constrained by the context.",
"type": "object",
"required": [
"limit"
],
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"target": {
"description": "Look for vectors closest to this.\\n\\nWhen using the target (with or without context), the integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target.",
"anyOf": [
{
"$ref": "#/components/schemas/RecommendExample"
},
{
"nullable": true
}
]
},
"context": {
"description": "Pairs of { positive, negative } examples to constrain the search.\\n\\nWhen using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair.\\n\\nSince the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0.\\n\\nFor discovery search (when including a target), the context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise.",
"type": "array",
"items": {
"$ref": "#/components/schemas/ContextExamplePair"
},
"nullable": true
},
"filter": {
"description": "Look only for points which satisfies this conditions",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"params": {
"description": "Additional search params",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"limit": {
"description": "Max number of result to return",
"type": "integer",
"format": "uint",
"minimum": 1
},
"offset": {
"description": "Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"with_payload": {
"description": "Select which payload to return with the response. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"with_vector": {
"description": "Options for specifying which vectors to include into response. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithVector"
},
{
"nullable": true
}
]
},
"using": {
"description": "Define which vector to use for recommendation, if not specified - try to use default vector",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/UsingVector"
},
{
"nullable": true
}
]
},
"lookup_from": {
"description": "The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/LookupLocation"
},
{
"nullable": true
}
]
}
}
},
"ContextExamplePair": {
"type": "object",
"required": [
"negative",
"positive"
],
"properties": {
"positive": {
"$ref": "#/components/schemas/RecommendExample"
},
"negative": {
"$ref": "#/components/schemas/RecommendExample"
}
}
},
"DiscoverRequestBatch": {
"type": "object",
"required": [
"searches"
],
"properties": {
"searches": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DiscoverRequest"
}
}
}
},
"VersionInfo": {
"type": "object",
"required": [
"title",
"version"
],
"properties": {
"title": {
"type": "string"
},
"version": {
"type": "string"
},
"commit": {
"type": "string",
"nullable": true
}
}
},
"CollectionExistence": {
"description": "State of existence of a collection, true = exists, false = does not exist",
"type": "object",
"required": [
"exists"
],
"properties": {
"exists": {
"type": "boolean"
}
}
},
"QueryRequest": {
"type": "object",
"properties": {
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"prefetch": {
"description": "Sub-requests to perform first. If present, the query will be performed on the results of the prefetch(es).",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/Prefetch"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/Prefetch"
}
},
{
"nullable": true
}
]
},
"query": {
"description": "Query to perform. If missing without prefetches, returns points ordered by their IDs.",
"anyOf": [
{
"$ref": "#/components/schemas/QueryInterface"
},
{
"nullable": true
}
]
},
"using": {
"description": "Define which vector name to use for querying. If missing, the default vector is used.",
"type": "string",
"nullable": true
},
"filter": {
"description": "Filter conditions - return only those points that satisfy the specified conditions.",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"params": {
"description": "Search params for when there is no prefetch",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"score_threshold": {
"description": "Return points with scores better than this threshold.",
"type": "number",
"format": "float",
"nullable": true
},
"limit": {
"description": "Max number of points to return. Default is 10.",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"offset": {
"description": "Offset of the result. Skip this many points. Default is 0",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"with_vector": {
"description": "Options for specifying which vectors to include into the response. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithVector"
},
{
"nullable": true
}
]
},
"with_payload": {
"description": "Options for specifying which payload to include or not. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"lookup_from": {
"description": "The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector Note: the other collection vectors should have the same vector size as the 'using' vector in the current collection",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/LookupLocation"
},
{
"nullable": true
}
]
}
}
},
"Prefetch": {
"type": "object",
"properties": {
"prefetch": {
"description": "Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/Prefetch"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/Prefetch"
}
},
{
"nullable": true
}
]
},
"query": {
"description": "Query to perform. If missing without prefetches, returns points ordered by their IDs.",
"anyOf": [
{
"$ref": "#/components/schemas/QueryInterface"
},
{
"nullable": true
}
]
},
"using": {
"description": "Define which vector name to use for querying. If missing, the default vector is used.",
"type": "string",
"nullable": true
},
"filter": {
"description": "Filter conditions - return only those points that satisfy the specified conditions.",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"params": {
"description": "Search params for when there is no prefetch",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"score_threshold": {
"description": "Return points with scores better than this threshold.",
"type": "number",
"format": "float",
"nullable": true
},
"limit": {
"description": "Max number of points to return. Default is 10.",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"lookup_from": {
"description": "The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector Note: the other collection vectors should have the same vector size as the 'using' vector in the current collection",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/LookupLocation"
},
{
"nullable": true
}
]
}
}
},
"QueryInterface": {
"anyOf": [
{
"$ref": "#/components/schemas/VectorInput"
},
{
"$ref": "#/components/schemas/Query"
}
]
},
"VectorInput": {
"anyOf": [
{
"type": "array",
"items": {
"type": "number",
"format": "float"
}
},
{
"$ref": "#/components/schemas/SparseVector"
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
},
{
"$ref": "#/components/schemas/ExtendedPointId"
},
{
"$ref": "#/components/schemas/Document"
},
{
"$ref": "#/components/schemas/Image"
},
{
"$ref": "#/components/schemas/InferenceObject"
}
]
},
"Query": {
"anyOf": [
{
"$ref": "#/components/schemas/NearestQuery"
},
{
"$ref": "#/components/schemas/RecommendQuery"
},
{
"$ref": "#/components/schemas/DiscoverQuery"
},
{
"$ref": "#/components/schemas/ContextQuery"
},
{
"$ref": "#/components/schemas/OrderByQuery"
},
{
"$ref": "#/components/schemas/FusionQuery"
},
{
"$ref": "#/components/schemas/SampleQuery"
}
]
},
"NearestQuery": {
"type": "object",
"required": [
"nearest"
],
"properties": {
"nearest": {
"$ref": "#/components/schemas/VectorInput"
}
}
},
"RecommendQuery": {
"type": "object",
"required": [
"recommend"
],
"properties": {
"recommend": {
"$ref": "#/components/schemas/RecommendInput"
}
}
},
"RecommendInput": {
"type": "object",
"properties": {
"positive": {
"description": "Look for vectors closest to the vectors from these points",
"type": "array",
"items": {
"$ref": "#/components/schemas/VectorInput"
},
"nullable": true
},
"negative": {
"description": "Try to avoid vectors like the vector from these points",
"type": "array",
"items": {
"$ref": "#/components/schemas/VectorInput"
},
"nullable": true
},
"strategy": {
"description": "How to use the provided vectors to find the results",
"anyOf": [
{
"$ref": "#/components/schemas/RecommendStrategy"
},
{
"nullable": true
}
]
}
}
},
"DiscoverQuery": {
"type": "object",
"required": [
"discover"
],
"properties": {
"discover": {
"$ref": "#/components/schemas/DiscoverInput"
}
}
},
"DiscoverInput": {
"type": "object",
"required": [
"context",
"target"
],
"properties": {
"target": {
"$ref": "#/components/schemas/VectorInput"
},
"context": {
"description": "Search space will be constrained by these pairs of vectors",
"anyOf": [
{
"$ref": "#/components/schemas/ContextPair"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/ContextPair"
}
},
{
"nullable": true
}
]
}
}
},
"ContextPair": {
"type": "object",
"required": [
"negative",
"positive"
],
"properties": {
"positive": {
"$ref": "#/components/schemas/VectorInput"
},
"negative": {
"$ref": "#/components/schemas/VectorInput"
}
}
},
"ContextQuery": {
"type": "object",
"required": [
"context"
],
"properties": {
"context": {
"$ref": "#/components/schemas/ContextInput"
}
}
},
"ContextInput": {
"anyOf": [
{
"$ref": "#/components/schemas/ContextPair"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/ContextPair"
}
},
{
"nullable": true
}
]
},
"OrderByQuery": {
"type": "object",
"required": [
"order_by"
],
"properties": {
"order_by": {
"$ref": "#/components/schemas/OrderByInterface"
}
}
},
"FusionQuery": {
"type": "object",
"required": [
"fusion"
],
"properties": {
"fusion": {
"$ref": "#/components/schemas/Fusion"
}
}
},
"Fusion": {
"description": "Fusion algorithm allows to combine results of multiple prefetches.\\n\\nAvailable fusion algorithms:\\n\\n* \`rrf\` - Reciprocal Rank Fusion * \`dbsf\` - Distribution-Based Score Fusion",
"type": "string",
"enum": [
"rrf",
"dbsf"
]
},
"SampleQuery": {
"type": "object",
"required": [
"sample"
],
"properties": {
"sample": {
"$ref": "#/components/schemas/Sample"
}
}
},
"Sample": {
"type": "string",
"enum": [
"random"
]
},
"QueryRequestBatch": {
"type": "object",
"required": [
"searches"
],
"properties": {
"searches": {
"type": "array",
"items": {
"$ref": "#/components/schemas/QueryRequest"
}
}
}
},
"QueryResponse": {
"type": "object",
"required": [
"points"
],
"properties": {
"points": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ScoredPoint"
}
}
}
},
"QueryGroupsRequest": {
"type": "object",
"required": [
"group_by"
],
"properties": {
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"prefetch": {
"description": "Sub-requests to perform first. If present, the query will be performed on the results of the prefetch(es).",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/Prefetch"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/Prefetch"
}
},
{
"nullable": true
}
]
},
"query": {
"description": "Query to perform. If missing without prefetches, returns points ordered by their IDs.",
"anyOf": [
{
"$ref": "#/components/schemas/QueryInterface"
},
{
"nullable": true
}
]
},
"using": {
"description": "Define which vector name to use for querying. If missing, the default vector is used.",
"type": "string",
"nullable": true
},
"filter": {
"description": "Filter conditions - return only those points that satisfy the specified conditions.",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"params": {
"description": "Search params for when there is no prefetch",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"score_threshold": {
"description": "Return points with scores better than this threshold.",
"type": "number",
"format": "float",
"nullable": true
},
"with_vector": {
"description": "Options for specifying which vectors to include into the response. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithVector"
},
{
"nullable": true
}
]
},
"with_payload": {
"description": "Options for specifying which payload to include or not. Default is false.",
"anyOf": [
{
"$ref": "#/components/schemas/WithPayloadInterface"
},
{
"nullable": true
}
]
},
"lookup_from": {
"description": "The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector Note: the other collection vectors should have the same vector size as the 'using' vector in the current collection",
"default": null,
"anyOf": [
{
"$ref": "#/components/schemas/LookupLocation"
},
{
"nullable": true
}
]
},
"group_by": {
"description": "Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups.",
"type": "string",
"minLength": 1
},
"group_size": {
"description": "Maximum amount of points to return per group. Default is 3.",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"limit": {
"description": "Maximum amount of groups to return. Default is 10.",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"with_lookup": {
"description": "Look for points in another collection using the group ids",
"anyOf": [
{
"$ref": "#/components/schemas/WithLookupInterface"
},
{
"nullable": true
}
]
}
}
},
"SearchMatrixRequest": {
"type": "object",
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"filter": {
"description": "Look only for points which satisfies this conditions",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"sample": {
"description": "How many points to select and search within. Default is 10.",
"type": "integer",
"format": "uint",
"minimum": 2,
"nullable": true
},
"limit": {
"description": "How many neighbours per sample to find. Default is 3.",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"using": {
"description": "Define which vector name to use for querying. If missing, the default vector is used.",
"type": "string",
"nullable": true
}
}
},
"SearchMatrixOffsetsResponse": {
"type": "object",
"required": [
"ids",
"offsets_col",
"offsets_row",
"scores"
],
"properties": {
"offsets_row": {
"description": "Row indices of the matrix",
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
"offsets_col": {
"description": "Column indices of the matrix",
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
"scores": {
"description": "Scores associated with matrix coordinates",
"type": "array",
"items": {
"type": "number",
"format": "float"
}
},
"ids": {
"description": "Ids of the points in order",
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtendedPointId"
}
}
}
},
"SearchMatrixPairsResponse": {
"type": "object",
"required": [
"pairs"
],
"properties": {
"pairs": {
"description": "List of pairs of points with scores",
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchMatrixPair"
}
}
}
},
"SearchMatrixPair": {
"description": "Pair of points (a, b) with score",
"type": "object",
"required": [
"a",
"b",
"score"
],
"properties": {
"a": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"b": {
"$ref": "#/components/schemas/ExtendedPointId"
},
"score": {
"type": "number",
"format": "float"
}
}
},
"FacetRequest": {
"type": "object",
"required": [
"key"
],
"properties": {
"shard_key": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardKeySelector"
},
{
"nullable": true
}
]
},
"key": {
"description": "Payload key to use for faceting.",
"type": "string"
},
"limit": {
"description": "Max number of hits to return. Default is 10.",
"type": "integer",
"format": "uint",
"minimum": 1,
"nullable": true
},
"filter": {
"description": "Filter conditions - only consider points that satisfy these conditions.",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"exact": {
"description": "Whether to do a more expensive exact count for each of the values in the facet. Default is false.",
"type": "boolean",
"nullable": true
}
}
},
"FacetResponse": {
"type": "object",
"required": [
"hits"
],
"properties": {
"hits": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FacetValueHit"
}
}
}
},
"FacetValueHit": {
"type": "object",
"required": [
"count",
"value"
],
"properties": {
"value": {
"$ref": "#/components/schemas/FacetValue"
},
"count": {
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"FacetValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer",
"format": "int64"
},
{
"type": "boolean"
}
]
}
}
}
}
`,t2e=["POST","GET","PUT","DELETE","PATCH","HEAD"],qnt="https://api.qdrant.tech/api-reference/",Knt=new Hnt(JSON.parse(Unt)),Gnt={Method:t2e,tokenizer:{root:[[/@?[a-zA-Z][\w$]*/,{cases:{"@Method":"keyword","@default":"variable"}}],[/".*?"/,"string"],[/\/\/.*/,"comment"]]}},Xnt={comments:{lineComment:"//",blockComment:["/*","*/"]},surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:'"',close:'"'}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"}],indentationRules:{increaseIndentPattern:/{\s*$/,decreaseIndentPattern:/^\s*}/}},Ynt={scrollBeyondLastLine:!1,readOnly:!1,fontSize:12,wordWrap:"on",minimap:{enabled:!1},automaticLayout:!0,mouseWheelZoom:!0,glyphMargin:!0,wordBasedSuggestions:!1,scrollbar:{verticalScrollbarSize:7,horizontalScrollbarSize:7}};function Znt(i,e,n){return{provideCodeLenses:function(r){const s=Sse(r.getValue()),o=[];for(let a=0;a<s.length;++a){const l={startLineNumber:s[a].blockStartLine,startColumn:1,endLineNumber:s[a].blockStartLine,endColumn:1};o.push({range:l,id:"RUN",command:{id:i,title:"▶ RUN",arguments:[s[a].blockText]}}),o.push({range:l,id:"BEAUTIFY",command:{id:e,title:"★ BEAUTIFY",arguments:[s[a]]}});const c=Knt.getRequestDocs(s[a].blockText.split(`
`)[0]);if(c){const u=c.operationId.replaceAll("_","-").toLowerCase(),d=c.tags[0].toLowerCase(),h=qnt+d+"/"+u;o.push({range:l,id:"DOCS",command:{id:n,title:"§ DOCS",arguments:[h]}})}}return{lenses:o,dispose:()=>{}}},resolveCodeLens:function(r,s){return s}}}function Qnt(i,e){for(let n=0;n<i.length;++n)if(i[n].blockStartLine<=e&&e<=i[n].blockEndLine)return i[n];return null}function Sse(i){const e=new Set(t2e),n=i.split(/\r?\n/),r=[],s=n.length;let o=0;for(;o<s;){const a=n[o].trim();if(a===""){o++;continue}const l=a.split(/\s+/)[0].toUpperCase();if(e.has(l)){const c=o+1;let u=n[o],d=c,h=o+1;if(h<s&&n[h].trim().startsWith("{")){const f=[];let p=0;for(;h<s;){const g=n[h];f.push(g);for(const m of g)m==="{"?p++:m==="}"&&p--;if(p===0)break;h++}if(p!==0){o++;continue}u+=`
`+f.join(`
`),d=h+1,o=h+1}else o++;r.push({blockText:u,blockStartLine:c,blockEndLine:d})}else o++}return r}const YN="f54f2be8-1df6-4427-9269-59fa39167783";function Jnt(i){for(var e=0,n=[];e<i.length;){var r=i[e];if(r==="\\"){e++;continue}if(r==="{"){n.push({type:"brace",value:"{"}),e++;continue}if(r==="}"){n.push({type:"brace",value:"}"}),e++;continue}if(r==="["){n.push({type:"paren",value:"["}),e++;continue}if(r==="]"){n.push({type:"paren",value:"]"}),e++;continue}if(r===":"){n.push({type:"separator",value:":"}),e++;continue}if(r===","){n.push({type:"delimiter",value:","}),e++;continue}if(r==='"'){var s="",o=!1;for(r=i[++e];r!=='"';){if(e===i.length){o=!0;break}if(r==="\\"){if(e++,e===i.length){o=!0;break}s+=r+i[e],r=i[++e]}else s+=r,r=i[++e]}r=i[++e],o?n.push({type:"unclosed-string",value:s}):n.push({type:"string",value:s});continue}var a=/\s/;if(a.test(r)){e++;continue}var l=/[0-9]/;if(l.test(r)||r==="-"||r==="."){var c="";for(r==="-"&&(c+=r,r=i[++e]);l.test(r)||r===".";)c+=r,r=i[++e];n.push({type:"number",value:c});continue}var u=/[a-z]/i;if(u.test(r)){for(var d="";u.test(r)&&e!==i.length;)d+=r,r=i[++e];if(d=="true"||d=="false")n.push({type:"name",value:d});else throw new Error("Invalid token:",d+" is not a valid token!");continue}e++}return n}function RC(i){if(i.length===0)return i;var e=i[i.length-1];switch(e.type){case"separator":return i=i.slice(0,i.length-1),RC(i);case"number":var n=e.value[e.value.length-1];if(n==="."||n==="-")return i=i.slice(0,i.length-1),RC(i);case"string":var r=i[i.length-2];if(r.type==="delimiter")return i=i.slice(0,i.length-1),RC(i);if(r.type==="brace"&&r.value==="{")return i=i.slice(0,i.length-1),RC(i);break;case"unclosed-string":return i=i.slice(0,i.length-1),RC(i);case"delimiter":return i=i.slice(0,i.length-1),RC(i)}return i}function eit(i){var e=[];if(i.map(function(n){n.type==="brace"&&(n.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0){let n=i[i.length-1],r=!1;(n.value==="{"||n.value==="[")&&(r=!0),e.reverse().map(function(s){s==="}"?(r||i.push({type:"delimiter",value:","}),i.push({type:"string",value:YN},{type:"separator",value:":"},{type:"string",value:""},{type:"brace",value:"}"})):s==="]"&&(r||i.push({type:"delimiter",value:","}),i.push({type:"string",value:YN},{type:"paren",value:"]"})),r=!1})}return i}function bfe(i){var e="";return i.map(function(n){switch(n.type){case"string":e+='"'+n.value+'"';break;case"unclosed-string":e+='"'+n.value;break;default:e+=n.value;break}}),e}function tit(i){let e=Jnt(i),n=e.length,r=RC(e),s=n-r.length,o=s>0?e.slice(-s):[],a=eit(r),l=bfe(a),c=bfe(o);return[JSON.parse(l),c]}class yfe{constructor(e,n,r){this.data=e,this.path=n,this.editedChunk=r}getObjectByPath(){if(this.path===null)return null;let e=this.data;for(let n=0;n<this.path.length;n++){let r=this.path[n];e=e[r]}return e}getEditedChunk(){let e=null,n=null,r=null,s=this.editedChunk,o=null,a=this.getObjectByPath();if(a instanceof Object&&Object.keys(a).length>0?o=null:o="key",!s)return{key:null,value:null,editing:o};if(s.startsWith(",")&&(s=s.slice(1).trim(),s===""))return{key:null,value:null,editing:"key"};if(s==="")return{key:null,value:null,editing:o};let l=s.split(":");return l.length===1&&(r=l[0].trim(),r.startsWith('"')&&(r=r.slice(1)),r.endsWith('"')?r=r.slice(0,-1):e="key"),l.length!==2?{key:r,value:n,editing:e}:(r=l[0].trim(),r.startsWith('"')&&(r=r.slice(1)),r.endsWith('"')&&(r=r.slice(0,-1)),n=l[1].trim(),e="value",n!==""?(n.startsWith('"')&&(n=n.slice(1)),n.endsWith('"')&&(e=null,n=n.slice(0,-1))):n=null,{key:r,value:n,editing:e})}}function eQ(i){if(i instanceof Array){let e=i.length;if(e===0||i[e-1]!==YN)return null;if(i.pop(),e===1)return[];let r=eQ(i[e-2]);return r!==null?[e-2,...r]:[]}if(i instanceof Object){if(!i.hasOwnProperty(YN))return null;delete i[YN];let e=Object.keys(i);for(let n=0;n<e.length;n++){let r=e[n],s=eQ(i[r]);if(s!==null)return[r,...s]}return[]}return null}function nit(i){let e=[{},"",""];try{e=tit(i)}catch{return new yfe(null,null,null)}let n=eQ(e[0]);return new yfe(e[0],n,e[1])}const iit=i=>{let e=1,n=`${i.method.toUpperCase()} `,r=i.path;const s=i.parameters;if(s){for(let o of s)if(o.in==="path"&&o.required){const a=new RegExp(`\\{${o.name}\\}`,"g");r=r.replace(a,`\${${e}:${o.name}}`),e++}}return n+=r,[n,e]},rit=(i,e)=>{let n="";if(i.required&&i.required.length>0){n+="{";for(let r=0;r<i.required.length;r++){const s=i.required[r];n+=`
"${s}": $${e}`,e++,r<i.required.length-1&&(n+=",")}n+=`
}`}else n+=`{
$${e}
}`;return n};class n2e{constructor(e,n){this.openapi=e,this.extractor=new JDe(e),this.methods=this.extractor.getAllMethods(),this.trieCompletion=new e2e;let r={"{collection_name}":[s=>s=="{collection_name}"||s.match(/\w+/),s=>n.filter(o=>o.startsWith(s))]};for(let s of this.methods){let o=`${s.method.toUpperCase()} ${s.path}`,a=XN(o);this.trieCompletion.addPath(a,r,s.body)}}completeRequestHeader(e){let n=XN(e);return this.trieCompletion.autocomplete(n)}completeRequestBody(e,n){let r=XN(e),s=this.trieCompletion.match(r);return this.completeRequestBodyByDataRef(s,n)}completeRequestBodyByDataRef(e,n){if(!e)return[];let r=nit(n),s=r.getEditedChunk();if(s.editing==="value"){let o=this.extractor.allEnumValues(e,r.path,s.key||"",s.value||"");return s.value===null?o=o.map(a=>'"'+a+'"'):o=o.map(a=>a+'"'),o}if(s.editing==="key"){let o=this.extractor.allProperties(e,r.path,s.key||"");return s.key===null?o=o.map(a=>'"'+a+'": '):o=o.map(a=>a+'": '),o}return[]}getSnippets(){let e=[];for(let n of this.methods){let[r,s]=iit(n);const o=n.body;if(o){let a=this.extractor.objectByRef(o);const l=rit(a,s);r+=`
`+l}e.push({label:n.operationId,documentation:n.summary,insertText:r})}return e}}const sit=(i,e)=>{let n=i;const r=n.match(/\$\{(\d+):collection_name\}/g);if(r)for(const s of r){const o=s.match(/\d+/)[0];if(e.length>0){const a=`\${${o}|${e.join(",")}|}`;n=n.replace(s,a)}}return n},oit=[{documentation:"Create Simple Collection",insertText:`PUT collections/\${1:new_collection_name}
{
"vectors": {
"size": \${2:768},
"distance": "\${3|Dot,Cosine,Euclid,Manhattan|}"
}
}`},{documentation:"Create Hybrid Collection",insertText:`PUT collections/\${1:new_collection_name}
{
"vectors": {
"\${2:dense_vector_name}": {
"size": \${3:768},
"distance": "\${4|Dot,Cosine,Euclid,Manhattan|}"
}
},
"sparse_vectors": {
"\${5:sparse_vector_name}": {
"modifier": "\${6|idf,none|}",
"index": {
"on_disk": \${7|true,false|}
}
}
}
}`}],ait=async(i,e)=>{const r=await(await fetch("/dashboard/./openapi.json")).json();let s=[];try{s=(await e.getCollections()).collections.map(l=>l.name)}catch(l){console.error(l)}const o=new n2e(r,s);let a=o.getSnippets();return a=[...a,...oit],a=a.map(l=>(l.insertText=sit(l.insertText,s),l)),{provideCompletionItems:(l,c)=>{let u=[];const d=i.editor.selectedCodeBlock;if(!d){u=[...u,{label:"POST",kind:17,insertText:"POST"},{label:"GET",kind:17,insertText:"GET"},{label:"PUT",kind:17,insertText:"PUT"},{label:"DELETE",kind:17,insertText:"DELETE"},{label:"PATCH",kind:17,insertText:"PATCH"}];const f=l.getWordUntilPosition(c);return a.forEach(p=>{u.push({label:p.documentation,kind:1,documentation:p.documentation,insertText:p.insertText,insertTextRules:4,range:{startLineNumber:c.lineNumber,endLineNumber:c.lineNumber,startColumn:0,endColumn:f.endColumn}})}),{suggestions:u}}const h=c.lineNumber-d.blockStartLine;if(h<0)return{suggestions:[]};if(h===0){const f=d.blockText.slice(0,c.column-1);return u=o.completeRequestHeader(f),u=u.filter(p=>p!=="").map(p=>({label:p,kind:17,insertText:p})),{suggestions:u}}else{const f=d.blockText.split(/\r?\n/),p=f[h].slice(0,c.column-1),g=f.shift(),m=f.slice(0,h-1);m.push(p);const _=m.join(`
`);let b=o.completeRequestBody(g,_);return b=b.reduce((y,x)=>(y.findIndex(k=>k.label===x)===-1&&y.push({label:x,kind:17,insertText:x}),y),[]),{suggestions:b}}},triggerCharacters:["/",'"',": "," "]}},lit=["POST","GET","PUT","DELETE","HEAD"];let tQ=[];function cit(i){const e=Sse(i);tQ=[];for(let n=0;n<e.length;++n){const r=e[n].blockText.split(/\r?\n/)[0].split(" ");lit.indexOf(r[0])<0&&tQ.push({startLineNumber:e[n].blockStartLine,endLineNumber:e[n].blockStartLine,startColumn:0,endColumn:r[0].length,message:"Expected one of GET/POST/PUT/DELETE/HEAD",severity:"monaco.MarkerSeverity.Error"})}}function uit(i,e=!1){const n=i.length;let r=0,s="",o=0,a=16,l=0,c=0,u=0,d=0,h=0;function f(x,k){let D=0,R=0;for(;D<x;){let E=i.charCodeAt(r);if(E>=48&&E<=57)R=R*16+E-48;else if(E>=65&&E<=70)R=R*16+E-65+10;else if(E>=97&&E<=102)R=R*16+E-97+10;else break;r++,D++}return D<x&&(R=-1),R}function p(x){r=x,s="",o=0,a=16,h=0}function g(){let x=r;if(i.charCodeAt(r)===48)r++;else for(r++;r<i.length&&qL(i.charCodeAt(r));)r++;if(r<i.length&&i.charCodeAt(r)===46)if(r++,r<i.length&&qL(i.charCodeAt(r)))for(r++;r<i.length&&qL(i.charCodeAt(r));)r++;else return h=3,i.substring(x,r);let k=r;if(r<i.length&&(i.charCodeAt(r)===69||i.charCodeAt(r)===101))if(r++,(r<i.length&&i.charCodeAt(r)===43||i.charCodeAt(r)===45)&&r++,r<i.length&&qL(i.charCodeAt(r))){for(r++;r<i.length&&qL(i.charCodeAt(r));)r++;k=r}else h=3;return i.substring(x,k)}function m(){let x="",k=r;for(;;){if(r>=n){x+=i.substring(k,r),h=2;break}const D=i.charCodeAt(r);if(D===34){x+=i.substring(k,r),r++;break}if(D===92){if(x+=i.substring(k,r),r++,r>=n){h=2;break}switch(i.charCodeAt(r++)){case 34:x+='"';break;case 92:x+="\\";break;case 47:x+="/";break;case 98:x+="\b";break;case 102:x+="\f";break;case 110:x+=`
`;break;case 114:x+="\r";break;case 116:x+=" ";break;case 117:const E=f(4);E>=0?x+=String.fromCharCode(E):h=4;break;default:h=5}k=r;continue}if(D>=0&&D<=31)if(FR(D)){x+=i.substring(k,r),h=2;break}else h=6;r++}return x}function _(){if(s="",h=0,o=r,c=l,d=u,r>=n)return o=n,a=17;let x=i.charCodeAt(r);if(MU(x)){do r++,s+=String.fromCharCode(x),x=i.charCodeAt(r);while(MU(x));return a=15}if(FR(x))return r++,s+=String.fromCharCode(x),x===13&&i.charCodeAt(r)===10&&(r++,s+=`
`),l++,u=r,a=14;switch(x){case 123:return r++,a=1;case 125:return r++,a=2;case 91:return r++,a=3;case 93:return r++,a=4;case 58:return r++,a=6;case 44:return r++,a=5;case 34:return r++,s=m(),a=10;case 47:const k=r-1;if(i.charCodeAt(r+1)===47){for(r+=2;r<n&&!FR(i.charCodeAt(r));)r++;return s=i.substring(k,r),a=12}if(i.charCodeAt(r+1)===42){r+=2;const D=n-1;let R=!1;for(;r<D;){const E=i.charCodeAt(r);if(E===42&&i.charCodeAt(r+1)===47){r+=2,R=!0;break}r++,FR(E)&&(E===13&&i.charCodeAt(r)===10&&r++,l++,u=r)}return R||(r++,h=1),s=i.substring(k,r),a=13}return s+=String.fromCharCode(x),r++,a=16;case 45:if(s+=String.fromCharCode(x),r++,r===n||!qL(i.charCodeAt(r)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return s+=g(),a=11;default:for(;r<n&&b(x);)r++,x=i.charCodeAt(r);if(o!==r){switch(s=i.substring(o,r),s){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return s+=String.fromCharCode(x),r++,a=16}}function b(x){if(MU(x)||FR(x))return!1;switch(x){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function y(){let x;do x=_();while(x>=12&&x<=15);return x}return{setPosition:p,getPosition:()=>r,scan:e?y:_,getToken:()=>a,getTokenValue:()=>s,getTokenOffset:()=>o,getTokenLength:()=>r-o,getTokenStartLine:()=>c,getTokenStartCharacter:()=>o-d,getTokenError:()=>h}}function MU(i){return i===32||i===9}function FR(i){return i===10||i===13}function qL(i){return i>=48&&i<=57}var wfe;(function(i){i[i.lineFeed=10]="lineFeed",i[i.carriageReturn=13]="carriageReturn",i[i.space=32]="space",i[i._0=48]="_0",i[i._1=49]="_1",i[i._2=50]="_2",i[i._3=51]="_3",i[i._4=52]="_4",i[i._5=53]="_5",i[i._6=54]="_6",i[i._7=55]="_7",i[i._8=56]="_8",i[i._9=57]="_9",i[i.a=97]="a",i[i.b=98]="b",i[i.c=99]="c",i[i.d=100]="d",i[i.e=101]="e",i[i.f=102]="f",i[i.g=103]="g",i[i.h=104]="h",i[i.i=105]="i",i[i.j=106]="j",i[i.k=107]="k",i[i.l=108]="l",i[i.m=109]="m",i[i.n=110]="n",i[i.o=111]="o",i[i.p=112]="p",i[i.q=113]="q",i[i.r=114]="r",i[i.s=115]="s",i[i.t=116]="t",i[i.u=117]="u",i[i.v=118]="v",i[i.w=119]="w",i[i.x=120]="x",i[i.y=121]="y",i[i.z=122]="z",i[i.A=65]="A",i[i.B=66]="B",i[i.C=67]="C",i[i.D=68]="D",i[i.E=69]="E",i[i.F=70]="F",i[i.G=71]="G",i[i.H=72]="H",i[i.I=73]="I",i[i.J=74]="J",i[i.K=75]="K",i[i.L=76]="L",i[i.M=77]="M",i[i.N=78]="N",i[i.O=79]="O",i[i.P=80]="P",i[i.Q=81]="Q",i[i.R=82]="R",i[i.S=83]="S",i[i.T=84]="T",i[i.U=85]="U",i[i.V=86]="V",i[i.W=87]="W",i[i.X=88]="X",i[i.Y=89]="Y",i[i.Z=90]="Z",i[i.asterisk=42]="asterisk",i[i.backslash=92]="backslash",i[i.closeBrace=125]="closeBrace",i[i.closeBracket=93]="closeBracket",i[i.colon=58]="colon",i[i.comma=44]="comma",i[i.dot=46]="dot",i[i.doubleQuote=34]="doubleQuote",i[i.minus=45]="minus",i[i.openBrace=123]="openBrace",i[i.openBracket=91]="openBracket",i[i.plus=43]="plus",i[i.slash=47]="slash",i[i.formFeed=12]="formFeed",i[i.tab=9]="tab"})(wfe||(wfe={}));new Array(20).fill(0).map((i,e)=>" ".repeat(e));const KL=200;new Array(KL).fill(0).map((i,e)=>`
`+" ".repeat(e)),new Array(KL).fill(0).map((i,e)=>"\r"+" ".repeat(e)),new Array(KL).fill(0).map((i,e)=>`\r
`+" ".repeat(e)),new Array(KL).fill(0).map((i,e)=>`
`+" ".repeat(e)),new Array(KL).fill(0).map((i,e)=>"\r"+" ".repeat(e)),new Array(KL).fill(0).map((i,e)=>`\r
`+" ".repeat(e));var Cfe;(function(i){i.DEFAULT={allowTrailingComma:!1}})(Cfe||(Cfe={}));function dit(i,e){let n=uit(i),r=[],s,o=0,a;do switch(a=n.getPosition(),s=n.scan(),s){case 12:case 13:case 17:o!==a&&r.push(i.substring(o,a)),e!==void 0&&r.push(n.getTokenValue().replace(/[^\r\n]/g,e)),o=n.getPosition();break}while(s!==17);return r.join("")}var Sfe;(function(i){i[i.None=0]="None",i[i.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",i[i.UnexpectedEndOfString=2]="UnexpectedEndOfString",i[i.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",i[i.InvalidUnicode=4]="InvalidUnicode",i[i.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",i[i.InvalidCharacter=6]="InvalidCharacter"})(Sfe||(Sfe={}));var xfe;(function(i){i[i.OpenBraceToken=1]="OpenBraceToken",i[i.CloseBraceToken=2]="CloseBraceToken",i[i.OpenBracketToken=3]="OpenBracketToken",i[i.CloseBracketToken=4]="CloseBracketToken",i[i.CommaToken=5]="CommaToken",i[i.ColonToken=6]="ColonToken",i[i.NullKeyword=7]="NullKeyword",i[i.TrueKeyword=8]="TrueKeyword",i[i.FalseKeyword=9]="FalseKeyword",i[i.StringLiteral=10]="StringLiteral",i[i.NumericLiteral=11]="NumericLiteral",i[i.LineCommentTrivia=12]="LineCommentTrivia",i[i.BlockCommentTrivia=13]="BlockCommentTrivia",i[i.LineBreakTrivia=14]="LineBreakTrivia",i[i.Trivia=15]="Trivia",i[i.Unknown=16]="Unknown",i[i.EOF=17]="EOF"})(xfe||(xfe={}));const hit=dit;var kfe;(function(i){i[i.InvalidSymbol=1]="InvalidSymbol",i[i.InvalidNumberFormat=2]="InvalidNumberFormat",i[i.PropertyNameExpected=3]="PropertyNameExpected",i[i.ValueExpected=4]="ValueExpected",i[i.ColonExpected=5]="ColonExpected",i[i.CommaExpected=6]="CommaExpected",i[i.CloseBraceExpected=7]="CloseBraceExpected",i[i.CloseBracketExpected=8]="CloseBracketExpected",i[i.EndOfFileExpected=9]="EndOfFileExpected",i[i.InvalidCommentToken=10]="InvalidCommentToken",i[i.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",i[i.UnexpectedEndOfString=12]="UnexpectedEndOfString",i[i.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",i[i.InvalidUnicode=14]="InvalidUnicode",i[i.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",i[i.InvalidCharacter=16]="InvalidCharacter"})(kfe||(kfe={}));function fit(i){const e=localStorage.getItem("history")?ls.parse(localStorage.getItem("history")):[];return e.length>=25&&e.pop(),e.unshift({idx:i.method+i.endpoint+Date.now(),code:i,time:new Date().toLocaleTimeString(),date:new Date().toLocaleDateString()}),localStorage.setItem("history",ls.stringify(e)),e}function nQ(i,e=!0){const n=i2e(i);return n.error?n:kE({method:n.method,url:n.endpoint,data:n.reqBody}).then(r=>(e&&fit(n),r.data)).catch(r=>{var s,o,a,l;return console.log(r),(o=(s=r.response)==null?void 0:s.data)!=null&&o.status?(l=(a=r.response)==null?void 0:a.data)==null?void 0:l.status:r})}function i2e(i){const e=i.split(/\r?\n/);let n=e.shift();n=n.replace(/\/\/.*$/gm,"");const r=e.join(`
`),s=n.split(" ")[0],o=n.split(" ")[1];let a={};if(r)try{a=r===`
`?{}:ls.parse(hit(r))}catch{return{method:null,endpoint:null,reqBody:null,error:"Fix the Position brackets to run & check the json"}}return s===""&&o===""?{method:null,endpoint:null,reqBody:a,error:"Add Headline or remove the line gap between json and headline (if any)"}:s===""?{method:null,endpoint:o,reqBody:a,error:"Add method"}:o===""?{method:s,endpoint:null,reqBody:a,error:"Add endpoint"}:{method:s,endpoint:o,reqBody:a,error:null}}function pit(i,e,n){return e in i?Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[e]=n,i}function Lfe(i,e){var n=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),n.push.apply(n,r)}return n}function Dfe(i){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Lfe(Object(n),!0).forEach(function(r){pit(i,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):Lfe(Object(n)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(n,r))})}return i}function git(i,e){if(i==null)return{};var n={},r=Object.keys(i),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(n[s]=i[s]);return n}function mit(i,e){if(i==null)return{};var n=git(i,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(i,r)&&(n[r]=i[r])}return n}function _it(i,e){return vit(i)||bit(i,e)||yit(i,e)||wit()}function vit(i){if(Array.isArray(i))return i}function bit(i,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(i)))){var n=[],r=!0,s=!1,o=void 0;try{for(var a=i[Symbol.iterator](),l;!(r=(l=a.next()).done)&&(n.push(l.value),!(e&&n.length===e));r=!0);}catch(c){s=!0,o=c}finally{try{!r&&a.return!=null&&a.return()}finally{if(s)throw o}}return n}}function yit(i,e){if(i){if(typeof i=="string")return Efe(i,e);var n=Object.prototype.toString.call(i).slice(8,-1);if(n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set")return Array.from(i);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Efe(i,e)}}function Efe(i,e){(e==null||e>i.length)&&(e=i.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=i[n];return r}function wit(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cit(i,e,n){return e in i?Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[e]=n,i}function Ife(i,e){var n=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),n.push.apply(n,r)}return n}function Tfe(i){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ife(Object(n),!0).forEach(function(r){Cit(i,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):Ife(Object(n)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(n,r))})}return i}function Sit(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++)e[n]=arguments[n];return function(r){return e.reduceRight(function(s,o){return o(s)},r)}}function rN(i){return function e(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=i.length?i.apply(this,s):function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return e.apply(n,[].concat(s,l))}}}function L9(i){return{}.toString.call(i).includes("Object")}function xit(i){return!Object.keys(i).length}function QM(i){return typeof i=="function"}function kit(i,e){return Object.prototype.hasOwnProperty.call(i,e)}function Lit(i,e){return L9(e)||Fy("changeType"),Object.keys(e).some(function(n){return!kit(i,n)})&&Fy("changeField"),e}function Dit(i){QM(i)||Fy("selectorType")}function Eit(i){QM(i)||L9(i)||Fy("handlerType"),L9(i)&&Object.values(i).some(function(e){return!QM(e)})&&Fy("handlersType")}function Iit(i){i||Fy("initialIsRequired"),L9(i)||Fy("initialType"),xit(i)&&Fy("initialContent")}function Tit(i,e){throw new Error(i[e]||i.default)}var Rit={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Fy=rN(Tit)(Rit),I3={changes:Lit,selector:Dit,handler:Eit,initial:Iit};function Ait(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};I3.initial(i),I3.handler(e);var n={current:i},r=rN(Pit)(n,e),s=rN(Mit)(n),o=rN(I3.changes)(i),a=rN(Nit)(n);function l(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return I3.selector(u),u(n.current)}function c(u){Sit(r,s,o,a)(u)}return[l,c]}function Nit(i,e){return QM(e)?e(i.current):e}function Mit(i,e){return i.current=Tfe(Tfe({},i.current),e),e}function Pit(i,e,n){return QM(e)?e(i.current):Object.keys(n).forEach(function(r){var s;return(s=e[r])===null||s===void 0?void 0:s.call(e,i.current[r])}),n}var Oit={create:Ait},Fit={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function Bit(i){return function e(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=i.length?i.apply(this,s):function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return e.apply(n,[].concat(s,l))}}}function jit(i){return{}.toString.call(i).includes("Object")}function Wit(i){return i||Rfe("configIsRequired"),jit(i)||Rfe("configType"),i.urls?($it(),{paths:{vs:i.urls.monacoBase}}):i}function $it(){console.warn(r2e.deprecation)}function zit(i,e){throw new Error(i[e]||i.default)}var r2e={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
You are using deprecated way of configuration.
Instead of using
monaco.config({ urls: { monacoBase: '...' } })
use
monaco.config({ paths: { vs: '...' } })
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
`},Rfe=Bit(zit)(r2e),Vit={config:Wit},Hit=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(o,a){return a(o)},s)}};function s2e(i,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&i[n]&&Object.assign(e[n],s2e(i[n],e[n]))}),Dfe(Dfe({},i),e)}var Uit={type:"cancelation",msg:"operation is manually canceled"};function PU(i){var e=!1,n=new Promise(function(r,s){i.then(function(o){return e?s(Uit):r(o)}),i.catch(s)});return n.cancel=function(){return e=!0},n}var qit=Oit.create({config:Fit,isInitialized:!1,resolve:null,reject:null,monaco:null}),o2e=_it(qit,2),y5=o2e[0],KW=o2e[1];function Kit(i){var e=Vit.config(i),n=e.monaco,r=mit(e,["monaco"]);KW(function(s){return{config:s2e(s.config,r),monaco:n}})}function Git(){var i=y5(function(e){var n=e.monaco,r=e.isInitialized,s=e.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!i.isInitialized){if(KW({isInitialized:!0}),i.monaco)return i.resolve(i.monaco),PU(OU);if(window.monaco&&window.monaco.editor)return a2e(window.monaco),i.resolve(window.monaco),PU(OU);Hit(Xit,Zit)(Qit)}return PU(OU)}function Xit(i){return document.body.appendChild(i)}function Yit(i){var e=document.createElement("script");return i&&(e.src=i),e}function Zit(i){var e=y5(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=Yit("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return i()},n.onerror=e.reject,n}function Qit(){var i=y5(function(n){var r=n.config,s=n.resolve,o=n.reject;return{config:r,resolve:s,reject:o}}),e=window.require;e.config(i.config),e(["vs/editor/editor.main"],function(n){a2e(n),i.resolve(n)},function(n){i.reject(n)})}function a2e(i){y5().monaco||KW({monaco:i})}function Jit(){return y5(function(i){var e=i.monaco;return e})}var OU=new Promise(function(i,e){return KW({resolve:i,reject:e})}),xse={config:Kit,init:Git,__getMonacoInstance:Jit},ert={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},FU=ert,trt={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},nrt=trt;function irt({children:i}){return nn.createElement("div",{style:nrt.container},i)}var rrt=irt,srt=rrt;function ort({width:i,height:e,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:a}){return nn.createElement("section",{style:{...FU.wrapper,width:i,height:e},...a},!n&&nn.createElement(srt,null,r),nn.createElement("div",{ref:s,style:{...FU.fullWidth,...!n&&FU.hide},className:o}))}var art=ort,l2e=$.memo(art);function lrt(i){$.useEffect(i,[])}var c2e=lrt;function crt(i,e,n=!0){let r=$.useRef(!0);$.useEffect(r.current||!n?()=>{r.current=!1}:i,e)}var Gd=crt;function ZN(){}function JD(i,e,n,r){return urt(i,r)||drt(i,e,n,r)}function urt(i,e){return i.editor.getModel(u2e(i,e))}function drt(i,e,n,r){return i.editor.createModel(e,n,r?u2e(i,r):void 0)}function u2e(i,e){return i.Uri.parse(e)}function hrt({original:i,modified:e,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:c=!1,theme:u="light",loading:d="Loading...",options:h={},height:f="100%",width:p="100%",className:g,wrapperProps:m={},beforeMount:_=ZN,onMount:b=ZN}){let[y,x]=$.useState(!1),[k,D]=$.useState(!0),R=$.useRef(null),E=$.useRef(null),A=$.useRef(null),M=$.useRef(b),N=$.useRef(_),P=$.useRef(!1);c2e(()=>{let z=xse.init();return z.then(H=>(E.current=H)&&D(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>R.current?j():z.cancel()}),Gd(()=>{if(R.current&&E.current){let z=R.current.getOriginalEditor(),H=JD(E.current,i||"",r||n||"text",o||"");H!==z.getModel()&&z.setModel(H)}},[o],y),Gd(()=>{if(R.current&&E.current){let z=R.current.getModifiedEditor(),H=JD(E.current,e||"",s||n||"text",a||"");H!==z.getModel()&&z.setModel(H)}},[a],y),Gd(()=>{let z=R.current.getModifiedEditor();z.getOption(E.current.editor.EditorOption.readOnly)?z.setValue(e||""):e!==z.getValue()&&(z.executeEdits("",[{range:z.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),z.pushUndoStop())},[e],y),Gd(()=>{var z,H;(H=(z=R.current)==null?void 0:z.getModel())==null||H.original.setValue(i||"")},[i],y),Gd(()=>{let{original:z,modified:H}=R.current.getModel();E.current.editor.setModelLanguage(z,r||n||"text"),E.current.editor.setModelLanguage(H,s||n||"text")},[n,r,s],y),Gd(()=>{var z;(z=E.current)==null||z.editor.setTheme(u)},[u],y),Gd(()=>{var z;(z=R.current)==null||z.updateOptions(h)},[h],y);let O=$.useCallback(()=>{var Y;if(!E.current)return;N.current(E.current);let z=JD(E.current,i||"",r||n||"text",o||""),H=JD(E.current,e||"",s||n||"text",a||"");(Y=R.current)==null||Y.setModel({original:z,modified:H})},[n,e,s,i,r,o,a]),B=$.useCallback(()=>{var z;!P.current&&A.current&&(R.current=E.current.editor.createDiffEditor(A.current,{automaticLayout:!0,...h}),O(),(z=E.current)==null||z.editor.setTheme(u),x(!0),P.current=!0)},[h,u,O]);$.useEffect(()=>{y&&M.current(R.current,E.current)},[y]),$.useEffect(()=>{!k&&!y&&B()},[k,y,B]);function j(){var H,Y,X,Q;let z=(H=R.current)==null?void 0:H.getModel();l||((Y=z==null?void 0:z.original)==null||Y.dispose()),c||((X=z==null?void 0:z.modified)==null||X.dispose()),(Q=R.current)==null||Q.dispose()}return nn.createElement(l2e,{width:p,height:f,isEditorReady:y,loading:d,_ref:A,className:g,wrapperProps:m})}var frt=hrt;$.memo(frt);function prt(i){let e=$.useRef();return $.useEffect(()=>{e.current=i},[i]),e.current}var grt=prt,T3=new Map;function mrt({defaultValue:i,defaultLanguage:e,defaultPath:n,value:r,language:s,path:o,theme:a="light",line:l,loading:c="Loading...",options:u={},overrideServices:d={},saveViewState:h=!0,keepCurrentModel:f=!1,width:p="100%",height:g="100%",className:m,wrapperProps:_={},beforeMount:b=ZN,onMount:y=ZN,onChange:x,onValidate:k=ZN}){let[D,R]=$.useState(!1),[E,A]=$.useState(!0),M=$.useRef(null),N=$.useRef(null),P=$.useRef(null),O=$.useRef(y),B=$.useRef(b),j=$.useRef(),z=$.useRef(r),H=grt(o),Y=$.useRef(!1),X=$.useRef(!1);c2e(()=>{let K=xse.init();return K.then(ee=>(M.current=ee)&&A(!1)).catch(ee=>(ee==null?void 0:ee.type)!=="cancelation"&&console.error("Monaco initialization: error:",ee)),()=>N.current?ie():K.cancel()}),Gd(()=>{var ee,le,ke,xe;let K=JD(M.current,i||r||"",e||s||"",o||n||"");K!==((ee=N.current)==null?void 0:ee.getModel())&&(h&&T3.set(H,(le=N.current)==null?void 0:le.saveViewState()),(ke=N.current)==null||ke.setModel(K),h&&((xe=N.current)==null||xe.restoreViewState(T3.get(o))))},[o],D),Gd(()=>{var K;(K=N.current)==null||K.updateOptions(u)},[u],D),Gd(()=>{!N.current||r===void 0||(N.current.getOption(M.current.editor.EditorOption.readOnly)?N.current.setValue(r):r!==N.current.getValue()&&(X.current=!0,N.current.executeEdits("",[{range:N.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),N.current.pushUndoStop(),X.current=!1))},[r],D),Gd(()=>{var ee,le;let K=(ee=N.current)==null?void 0:ee.getModel();K&&s&&((le=M.current)==null||le.editor.setModelLanguage(K,s))},[s],D),Gd(()=>{var K;l!==void 0&&((K=N.current)==null||K.revealLine(l))},[l],D),Gd(()=>{var K;(K=M.current)==null||K.editor.setTheme(a)},[a],D);let Q=$.useCallback(()=>{var K;if(!(!P.current||!M.current)&&!Y.current){B.current(M.current);let ee=o||n,le=JD(M.current,r||i||"",e||s||"",ee||"");N.current=(K=M.current)==null?void 0:K.editor.create(P.current,{model:le,automaticLayout:!0,...u},d),h&&N.current.restoreViewState(T3.get(ee)),M.current.editor.setTheme(a),l!==void 0&&N.current.revealLine(l),R(!0),Y.current=!0}},[i,e,n,r,s,o,u,d,h,a,l]);$.useEffect(()=>{D&&O.current(N.current,M.current)},[D]),$.useEffect(()=>{!E&&!D&&Q()},[E,D,Q]),z.current=r,$.useEffect(()=>{var K,ee;D&&x&&((K=j.current)==null||K.dispose(),j.current=(ee=N.current)==null?void 0:ee.onDidChangeModelContent(le=>{X.current||x(N.current.getValue(),le)}))},[D,x]),$.useEffect(()=>{if(D){let K=M.current.editor.onDidChangeMarkers(ee=>{var ke;let le=(ke=N.current.getModel())==null?void 0:ke.uri;if(le&&ee.find(xe=>xe.path===le.path)){let xe=M.current.editor.getModelMarkers({resource:le});k==null||k(xe)}});return()=>{K==null||K.dispose()}}return()=>{}},[D,k]);function ie(){var K,ee;(K=j.current)==null||K.dispose(),f?h&&T3.set(o,N.current.saveViewState()):(ee=N.current.getModel())==null||ee.dispose(),N.current.dispose()}return nn.createElement(l2e,{width:p,height:g,isEditorReady:D,loading:c,_ref:P,className:m,wrapperProps:_})}var _rt=mrt,vrt=$.memo(_rt),d2e=vrt;const R3=(i,e="custom-language-theme")=>i.palette.mode==="dark"?Afe[e](i).dark:Afe[e](i).light,Afe={"custom-language-theme":i=>({dark:{base:"vs-dark",rules:[{token:"keyword",foreground:"#007acc"},{token:"string.key",foreground:"#f14c4c"},{token:"string.value",foreground:"#3794ff"},{token:"number",foreground:"#098658"},{token:"comment",foreground:"#6A9955"},{token:"string",foreground:"#f14c4c"}],colors:{"editor.foreground":"#FFFFFF","editor.background":i.palette.background.default}},light:{base:"vs",rules:[{token:"keyword",foreground:"#0000FF"},{token:"string.key",foreground:"#A31515"},{token:"string.value",foreground:"#0451A5"},{token:"number",foreground:"#098658"},{token:"comment",foreground:"#008000"},{token:"string",foreground:"#A31515"}],colors:{"editor.foreground":"#000000","editor.background":i.palette.background.default}}}),"qdrant-theme":i=>{const e=i.palette.mode==="dark";return{dark:{base:"vs-dark",rules:[{token:"keyword",foreground:i.palette.warning.main},{token:"string.key",foreground:Yu[600]},{token:"string.value",foreground:tu[600]},{token:"number",foreground:tu[600]},{token:"comment",foreground:e?xi[500]:xi[400]},{token:"string",foreground:Yu[600]}],colors:{"editor.foreground":i.palette.text.primary,"editor.background":i.palette.background.code}},light:{base:"vs",rules:[{token:"keyword",foreground:i.palette.warning.main},{token:"string.key",foreground:Yu[600]},{token:"string.value",foreground:tu[600]},{token:"number",foreground:tu[600]},{token:"comment",foreground:e?xi[500]:xi[400]},{token:"string",foreground:Yu[600]}],colors:{"editor.foreground":i.palette.text.primary,"editor.background":i.palette.background.code}}}}},kse=()=>{const[i,e]=$.useState(!1),n=()=>e(!i);return $.useEffect(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)})),{width:window.innerWidth,height:window.innerHeight}};function Pd(i,e=0){return i[i.length-(1+e)]}function brt(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function ys(i,e,n=(r,s)=>r===s){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let r=0,s=i.length;r<s;r++)if(!n(i[r],e[r]))return!1;return!0}function yrt(i,e){const n=i.length-1;e<n&&(i[e]=i[n]),i.pop()}function JM(i,e,n){return wrt(i.length,r=>n(i[r],e))}function wrt(i,e){let n=0,r=i-1;for(;n<=r;){const s=(n+r)/2|0,o=e(s);if(o<0)n=s+1;else if(o>0)r=s-1;else return s}return-(n+1)}function iQ(i,e,n){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const r=e[Math.floor(e.length*Math.random())],s=[],o=[],a=[];for(const l of e){const c=n(l,r);c<0?s.push(l):c>0?o.push(l):a.push(l)}return i<s.length?iQ(i,s,n):i<s.length+a.length?a[0]:iQ(i-(s.length+a.length),o,n)}function Nfe(i,e){const n=[];let r;for(const s of i.slice(0).sort(e))!r||e(r[0],s)!==0?(r=[s],n.push(r)):r.push(s);return n}function*h2e(i,e){let n,r;for(const s of i)r!==void 0&&e(r,s)?n.push(s):(n&&(yield n),n=[s]),r=s;n&&(yield n)}function f2e(i,e){for(let n=0;n<=i.length;n++)e(n===0?void 0:i[n-1],n===i.length?void 0:i[n])}function Crt(i,e){for(let n=0;n<i.length;n++)e(n===0?void 0:i[n-1],i[n],n+1===i.length?void 0:i[n+1])}function Hm(i){return i.filter(e=>!!e)}function Mfe(i){let e=0;for(let n=0;n<i.length;n++)i[n]&&(i[e]=i[n],e+=1);i.length=e}function p2e(i){return!Array.isArray(i)||i.length===0}function Ka(i){return Array.isArray(i)&&i.length>0}function l1(i,e=n=>n){const n=new Set;return i.filter(r=>{const s=e(r);return n.has(s)?!1:(n.add(s),!0)})}function g2e(i,e){return i.length>0?i[0]:e}function Tl(i,e){let n=typeof e=="number"?i:0;typeof e=="number"?n=i:(n=0,e=i);const r=[];if(n<=e)for(let s=n;s<e;s++)r.push(s);else for(let s=n;s>e;s--)r.push(s);return r}function GW(i,e,n){const r=i.slice(0,e),s=i.slice(e);return r.concat(n,s)}function BU(i,e){const n=i.indexOf(e);n>-1&&(i.splice(n,1),i.unshift(e))}function A3(i,e){const n=i.indexOf(e);n>-1&&(i.splice(n,1),i.push(e))}function rQ(i,e){for(const n of e)i.push(n)}function Lse(i){return Array.isArray(i)?i:[i]}function Srt(i,e,n){const r=m2e(i,e),s=i.length,o=n.length;i.length=s+o;for(let a=s-1;a>=r;a--)i[a+o]=i[a];for(let a=0;a<o;a++)i[a+r]=n[a]}function Pfe(i,e,n,r){const s=m2e(i,e);let o=i.splice(s,n);return o===void 0&&(o=[]),Srt(i,s,r),o}function m2e(i,e){return e<0?Math.max(e+i.length,0):Math.min(e,i.length)}var eP;(function(i){function e(o){return o<0}i.isLessThan=e;function n(o){return o<=0}i.isLessThanOrEqual=n;function r(o){return o>0}i.isGreaterThan=r;function s(o){return o===0}i.isNeitherLessOrGreaterThan=s,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(eP||(eP={}));function ch(i,e){return(n,r)=>e(i(n),i(r))}function xrt(...i){return(e,n)=>{for(const r of i){const s=r(e,n);if(!eP.isNeitherLessOrGreaterThan(s))return s}return eP.neitherLessOrGreaterThan}}const fv=(i,e)=>i-e,krt=(i,e)=>fv(i?1:0,e?1:0);function _2e(i){return(e,n)=>-i(e,n)}class Ev{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let n=this.firstIdx;for(;n<this.items.length&&e(this.items[n]);)n++;const r=n===this.firstIdx?null:this.items.slice(this.firstIdx,n);return this.firstIdx=n,r}takeFromEndWhile(e){let n=this.lastIdx;for(;n>=0&&e(this.items[n]);)n--;const r=n===this.lastIdx?null:this.items.slice(n+1,this.lastIdx+1);return this.lastIdx=n,r}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const n=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,n}}class Rm{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new Rm(n=>this.iterate(r=>e(r)?n(r):!0))}map(e){return new Rm(n=>this.iterate(r=>n(e(r))))}findLast(e){let n;return this.iterate(r=>(e(r)&&(n=r),!0)),n}findLastMaxBy(e){let n,r=!0;return this.iterate(s=>((r||eP.isGreaterThan(e(s,n)))&&(r=!1,n=s),!0)),n}}Rm.empty=new Rm(i=>{});function zl(i){return typeof i=="string"}function Bl(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function Lrt(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function c1(i){return typeof i=="number"&&!isNaN(i)}function Ofe(i){return!!i&&typeof i[Symbol.iterator]=="function"}function v2e(i){return i===!0||i===!1}function nu(i){return typeof i>"u"}function tP(i){return!Hu(i)}function Hu(i){return nu(i)||i===null}function Ui(i,e){if(!i)throw new Error("Unexpected type")}function fS(i){if(Hu(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function nP(i){return typeof i=="function"}function Drt(i,e){const n=Math.min(i.length,e.length);for(let r=0;r<n;r++)Ert(i[r],e[r])}function Ert(i,e){if(zl(e)){if(typeof i!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(nP(e)){try{if(i instanceof e)return}catch{}if(!Hu(i)&&i.constructor===e||e.length===1&&e.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function T0(i){if(!i||typeof i!="object"||i instanceof RegExp)return i;const e=Array.isArray(i)?[]:{};return Object.entries(i).forEach(([n,r])=>{e[n]=r&&typeof r=="object"?T0(r):r}),e}function Irt(i){if(!i||typeof i!="object")return i;const e=[i];for(;e.length>0;){const n=e.shift();Object.freeze(n);for(const r in n)if(b2e.call(n,r)){const s=n[r];typeof s=="object"&&!Object.isFrozen(s)&&!Lrt(s)&&e.push(s)}}return i}const b2e=Object.prototype.hasOwnProperty;function y2e(i,e){return sQ(i,e,new Set)}function sQ(i,e,n){if(Hu(i))return i;const r=e(i);if(typeof r<"u")return r;if(Array.isArray(i)){const s=[];for(const o of i)s.push(sQ(o,e,n));return s}if(Bl(i)){if(n.has(i))throw new Error("Cannot clone recursive data-structure");n.add(i);const s={};for(const o in i)b2e.call(i,o)&&(s[o]=sQ(i[o],e,n));return n.delete(i),s}return i}function XW(i,e,n=!0){return Bl(i)?(Bl(e)&&Object.keys(e).forEach(r=>{r in i?n&&(Bl(i[r])&&Bl(e[r])?XW(i[r],e[r],n):i[r]=e[r]):i[r]=e[r]}),i):e}function od(i,e){if(i===e)return!0;if(i==null||e===null||e===void 0||typeof i!=typeof e||typeof i!="object"||Array.isArray(i)!==Array.isArray(e))return!1;let n,r;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(n=0;n<i.length;n++)if(!od(i[n],e[n]))return!1}else{const s=[];for(r in i)s.push(r);s.sort();const o=[];for(r in e)o.push(r);if(o.sort(),!od(s,o))return!1;for(n=0;n<s.length;n++)if(!od(i[s[n]],e[s[n]]))return!1}return!0}function Trt(i){let e=[];for(;Object.prototype!==i;)e=e.concat(Object.getOwnPropertyNames(i)),i=Object.getPrototypeOf(i);return e}function Dse(i){const e=[];for(const n of Trt(i))typeof i[n]=="function"&&e.push(n);return e}function Rrt(i,e){const n=s=>function(){const o=Array.prototype.slice.call(arguments,0);return e(s,o)},r={};for(const s of i)r[s]=n(s);return r}let Art=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function Nrt(i,e){let n;return e.length===0?n=i:n=i.replace(/\{(\d+)\}/g,(r,s)=>{const o=s[0],a=e[o];let l=r;return typeof a=="string"?l=a:(typeof a=="number"||typeof a=="boolean"||a===void 0||a===null)&&(l=String(a)),l}),Art&&(n="["+n.replace(/[aouei]/g,"$&$&")+"]"),n}function L(i,e,...n){return Nrt(e,n)}var jU;const e2="en";let D9=!1,E9=!1,t8=!1,w2e=!1,Ese=!1,Ise=!1,C2e=!1,N3,n8=e2,Ffe=e2,Mrt,lp;const Cf=typeof self=="object"?self:typeof global=="object"?global:{};let Nl;typeof Cf.vscode<"u"&&typeof Cf.vscode.process<"u"?Nl=Cf.vscode.process:typeof process<"u"&&(Nl=process);const Prt=typeof((jU=Nl==null?void 0:Nl.versions)===null||jU===void 0?void 0:jU.electron)=="string",Ort=Prt&&(Nl==null?void 0:Nl.type)==="renderer";if(typeof navigator=="object"&&!Ort)lp=navigator.userAgent,D9=lp.indexOf("Windows")>=0,E9=lp.indexOf("Macintosh")>=0,Ise=(lp.indexOf("Macintosh")>=0||lp.indexOf("iPad")>=0||lp.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,t8=lp.indexOf("Linux")>=0,C2e=(lp==null?void 0:lp.indexOf("Mobi"))>=0,Ese=!0,L({},"_"),N3=e2,n8=N3,Ffe=navigator.language;else if(typeof Nl=="object"){D9=Nl.platform==="win32",E9=Nl.platform==="darwin",t8=Nl.platform==="linux",t8&&Nl.env.SNAP&&Nl.env.SNAP_REVISION,Nl.env.CI||Nl.env.BUILD_ARTIFACTSTAGINGDIRECTORY,N3=e2,n8=e2;const i=Nl.env.VSCODE_NLS_CONFIG;if(i)try{const e=JSON.parse(i),n=e.availableLanguages["*"];N3=e.locale,Ffe=e.osLocale,n8=n||e2,Mrt=e._translationsConfigFile}catch{}w2e=!0}else console.error("Unable to resolve platform.");const Aa=D9,ri=E9,_l=t8,Um=w2e,H1=Ese,Frt=Ese&&typeof Cf.importScripts=="function",Kp=Ise,Brt=C2e,qm=lp,jrt=n8,Wrt=typeof Cf.postMessage=="function"&&!Cf.importScripts,S2e=(()=>{if(Wrt){const i=[];Cf.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=i.length;r<s;r++){const o=i[r];if(o.id===n.data.vscodeScheduleAsyncWork){i.splice(r,1),o.callback();return}}});let e=0;return n=>{const r=++e;i.push({id:r,callback:n}),Cf.postMessage({vscodeScheduleAsyncWork:r},"*")}}return i=>setTimeout(i)})(),Zu=E9||Ise?2:D9?1:3;let Bfe=!0,jfe=!1;function x2e(){if(!jfe){jfe=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,Bfe=new Uint16Array(i.buffer)[0]===513}return Bfe}const k2e=!!(qm&&qm.indexOf("Chrome")>=0),$rt=!!(qm&&qm.indexOf("Firefox")>=0),zrt=!!(!k2e&&qm&&qm.indexOf("Safari")>=0),Vrt=!!(qm&&qm.indexOf("Edg/")>=0);qm&&qm.indexOf("Android")>=0;const za={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var Vn;(function(i){function e(y){return y&&typeof y=="object"&&typeof y[Symbol.iterator]=="function"}i.is=e;const n=Object.freeze([]);function r(){return n}i.empty=r;function*s(y){yield y}i.single=s;function o(y){return e(y)?y:s(y)}i.wrap=o;function a(y){return y||n}i.from=a;function*l(y){for(let x=y.length-1;x>=0;x--)yield y[x]}i.reverse=l;function c(y){return!y||y[Symbol.iterator]().next().done===!0}i.isEmpty=c;function u(y){return y[Symbol.iterator]().next().value}i.first=u;function d(y,x){for(const k of y)if(x(k))return!0;return!1}i.some=d;function h(y,x){for(const k of y)if(x(k))return k}i.find=h;function*f(y,x){for(const k of y)x(k)&&(yield k)}i.filter=f;function*p(y,x){let k=0;for(const D of y)yield x(D,k++)}i.map=p;function*g(...y){for(const x of y)for(const k of x)yield k}i.concat=g;function m(y,x,k){let D=k;for(const R of y)D=x(D,R);return D}i.reduce=m;function*_(y,x,k=y.length){for(x<0&&(x+=y.length),k<0?k+=y.length:k>y.length&&(k=y.length);x<k;x++)yield y[x]}i.slice=_;function b(y,x=Number.POSITIVE_INFINITY){const k=[];if(x===0)return[k,y];const D=y[Symbol.iterator]();for(let R=0;R<x;R++){const E=D.next();if(E.done)return[k,i.empty()];k.push(E.value)}return[k,{[Symbol.iterator](){return D}}]}i.consume=b})(Vn||(Vn={}));let Qs=class oQ{constructor(e){this.element=e,this.next=oQ.Undefined,this.prev=oQ.Undefined}};Qs.Undefined=new Qs(void 0);class jl{constructor(){this._first=Qs.Undefined,this._last=Qs.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Qs.Undefined}clear(){let e=this._first;for(;e!==Qs.Undefined;){const n=e.next;e.prev=Qs.Undefined,e.next=Qs.Undefined,e=n}this._first=Qs.Undefined,this._last=Qs.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,n){const r=new Qs(e);if(this._first===Qs.Undefined)this._first=r,this._last=r;else if(n){const o=this._last;this._last=r,r.prev=o,o.next=r}else{const o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(r))}}shift(){if(this._first!==Qs.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Qs.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Qs.Undefined&&e.next!==Qs.Undefined){const n=e.prev;n.next=e.next,e.next.prev=n}else e.prev===Qs.Undefined&&e.next===Qs.Undefined?(this._first=Qs.Undefined,this._last=Qs.Undefined):e.next===Qs.Undefined?(this._last=this._last.prev,this._last.next=Qs.Undefined):e.prev===Qs.Undefined&&(this._first=this._first.next,this._first.prev=Qs.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Qs.Undefined;)yield e.element,e=e.next}}const L2e="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Hrt(i=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const n of L2e)i.indexOf(n)>=0||(e+="\\"+n);return e+="\\s]+)",new RegExp(e,"g")}const Tse=Hrt();function D2e(i){let e=Tse;if(i&&i instanceof RegExp)if(i.global)e=i;else{let n="g";i.ignoreCase&&(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),e=new RegExp(i.source,n)}return e.lastIndex=0,e}const E2e=new jl;E2e.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function iP(i,e,n,r,s){if(s||(s=Vn.first(E2e)),n.length>s.maxLen){let u=i-s.maxLen/2;return u<0?u=0:r+=u,n=n.substring(u,i+s.maxLen/2),iP(i,e,n,r,s)}const o=Date.now(),a=i-1-r;let l=-1,c=null;for(let u=1;!(Date.now()-o>=s.timeBudget);u++){const d=a-s.windowSize*u;e.lastIndex=Math.max(0,d);const h=Urt(e,n,a,l);if(!h&&c||(c=h,d<=0))break;l=d}if(c){const u={word:c[0],startColumn:r+1+c.index,endColumn:r+1+c.index+c[0].length};return e.lastIndex=0,u}return null}function Urt(i,e,n,r){let s;for(;s=i.exec(e);){const o=s.index||0;if(o<=n&&i.lastIndex>=n)return s;if(r>0&&o>r)return null}return null}const qb=8;class I2e{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class T2e{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class qr{constructor(e,n,r,s){this.id=e,this.name=n,this.defaultValue=r,this.schema=s}applyUpdate(e,n){return YW(e,n)}compute(e,n,r){return r}}class QN{constructor(e,n){this.newValue=e,this.didChange=n}}function YW(i,e){if(typeof i!="object"||typeof e!="object"||!i||!e)return new QN(e,i!==e);if(Array.isArray(i)||Array.isArray(e)){const r=Array.isArray(i)&&Array.isArray(e)&&ys(i,e);return new QN(e,!r)}let n=!1;for(const r in e)if(e.hasOwnProperty(r)){const s=YW(i[r],e[r]);s.didChange&&(i[r]=s.newValue,n=!0)}return new QN(i,n)}class w5{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,n){return YW(e,n)}validate(e){return this.defaultValue}}class MI{constructor(e,n,r,s){this.id=e,this.name=n,this.defaultValue=r,this.schema=s}applyUpdate(e,n){return YW(e,n)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,n,r){return r}}function Ut(i,e){return typeof i>"u"?e:i==="false"?!1:!!i}class li extends MI{constructor(e,n,r,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=r),super(e,n,r,s)}validate(e){return Ut(e,this.defaultValue)}}function AC(i,e,n,r){if(typeof i>"u")return e;let s=parseInt(i,10);return isNaN(s)?e:(s=Math.max(n,s),s=Math.min(r,s),s|0)}class ir extends MI{static clampedInt(e,n,r,s){return AC(e,n,r,s)}constructor(e,n,r,s,o,a=void 0){typeof a<"u"&&(a.type="integer",a.default=r,a.minimum=s,a.maximum=o),super(e,n,r,a),this.minimum=s,this.maximum=o}validate(e){return ir.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function qrt(i,e,n,r){if(typeof i>"u")return e;const s=mf.float(i,e);return mf.clamp(s,n,r)}class mf extends MI{static clamp(e,n,r){return e<n?n:e>r?r:e}static float(e,n){if(typeof e=="number")return e;if(typeof e>"u")return n;const r=parseFloat(e);return isNaN(r)?n:r}constructor(e,n,r,s,o){typeof o<"u"&&(o.type="number",o.default=r),super(e,n,r,o),this.validationFn=s}validate(e){return this.validationFn(mf.float(e,this.defaultValue))}}class Gc extends MI{static string(e,n){return typeof e!="string"?n:e}constructor(e,n,r,s=void 0){typeof s<"u"&&(s.type="string",s.default=r),super(e,n,r,s)}validate(e){return Gc.string(e,this.defaultValue)}}function Rs(i,e,n,r){return typeof i!="string"?e:r&&i in r?r[i]:n.indexOf(i)===-1?e:i}class ts extends MI{constructor(e,n,r,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s,o.default=r),super(e,n,r,o),this._allowedValues=s}validate(e){return Rs(e,this.defaultValue,this._allowedValues)}}class M3 extends qr{constructor(e,n,r,s,o,a,l=void 0){typeof l<"u"&&(l.type="string",l.enum=o,l.default=s),super(e,n,r,l),this._allowedValues=o,this._convert=a}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Krt(i){switch(i){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Grt extends qr{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[L("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),L("accessibilitySupport.on","Optimize for usage with a Screen Reader"),L("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:L("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,n,r){return r===0?e.accessibilitySupport:r}}class Xrt extends qr{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:L("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:L("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{insertSpace:Ut(n.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Ut(n.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Yrt(i){switch(i){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var na;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(na||(na={}));function Zrt(i){switch(i){case"line":return na.Line;case"block":return na.Block;case"underline":return na.Underline;case"line-thin":return na.LineThin;case"block-outline":return na.BlockOutline;case"underline-thin":return na.UnderlineThin}}class Qrt extends w5{constructor(){super(140)}compute(e,n,r){const s=["monaco-editor"];return n.get(39)&&s.push(n.get(39)),e.extraEditorClassName&&s.push(e.extraEditorClassName),n.get(73)==="default"?s.push("mouse-default"):n.get(73)==="copy"&&s.push("mouse-copy"),n.get(110)&&s.push("showUnused"),n.get(138)&&s.push("showDeprecated"),s.join(" ")}}class Jrt extends li{constructor(){super(37,"emptySelectionClipboard",!0,{description:L("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,n,r){return r&&e.emptySelectionClipboard}}class est extends qr{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:L("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[L("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),L("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),L("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:L("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[L("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),L("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),L("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:L("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:L("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:ri},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:L("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:L("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{cursorMoveOnType:Ut(n.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Rs(n.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Rs(n.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Ut(n.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Ut(n.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Ut(n.loop,this.defaultValue.loop)}}}class Uu extends qr{constructor(){super(51,"fontLigatures",Uu.OFF,{anyOf:[{type:"boolean",description:L("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:L("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:L("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Uu.OFF:e==="true"?Uu.ON:e:e?Uu.ON:Uu.OFF}}Uu.OFF='"liga" off, "calt" off';Uu.ON='"liga" on, "calt" on';class Ip extends qr{constructor(){super(54,"fontVariations",Ip.OFF,{anyOf:[{type:"boolean",description:L("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:L("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:L("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Ip.OFF:e==="true"?Ip.TRANSLATE:e:e?Ip.TRANSLATE:Ip.OFF}compute(e,n,r){return e.fontInfo.fontVariationSettings}}Ip.OFF="normal";Ip.TRANSLATE="translate";class tst extends w5{constructor(){super(50)}compute(e,n,r){return e.fontInfo}}class nst extends MI{constructor(){super(52,"fontSize",su.fontSize,{type:"number",minimum:6,maximum:100,default:su.fontSize,description:L("fontSize","Controls the font size in pixels.")})}validate(e){const n=mf.float(e,this.defaultValue);return n===0?su.fontSize:mf.clamp(n,6,100)}compute(e,n,r){return e.fontInfo.fontSize}}class lm extends qr{constructor(){super(53,"fontWeight",su.fontWeight,{anyOf:[{type:"number",minimum:lm.MINIMUM_VALUE,maximum:lm.MAXIMUM_VALUE,errorMessage:L("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:lm.SUGGESTION_VALUES}],default:su.fontWeight,description:L("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(ir.clampedInt(e,su.fontWeight,lm.MINIMUM_VALUE,lm.MAXIMUM_VALUE))}}lm.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];lm.MINIMUM_VALUE=1;lm.MAXIMUM_VALUE=1e3;class ist extends qr{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},n={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[L("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),L("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),L("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},r=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:L("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:L("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},n),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:L("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},n),"editor.gotoLocation.multipleDeclarations":Object.assign({description:L("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},n),"editor.gotoLocation.multipleImplementations":Object.assign({description:L("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},n),"editor.gotoLocation.multipleReferences":Object.assign({description:L("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},n),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:r,description:L("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:r,description:L("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:r,description:L("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:r,description:L("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:r,description:L("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var n,r,s,o,a;if(!e||typeof e!="object")return this.defaultValue;const l=e;return{multiple:Rs(l.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(n=l.multipleDefinitions)!==null&&n!==void 0?n:Rs(l.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(r=l.multipleTypeDefinitions)!==null&&r!==void 0?r:Rs(l.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=l.multipleDeclarations)!==null&&s!==void 0?s:Rs(l.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=l.multipleImplementations)!==null&&o!==void 0?o:Rs(l.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(a=l.multipleReferences)!==null&&a!==void 0?a:Rs(l.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Gc.string(l.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Gc.string(l.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Gc.string(l.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Gc.string(l.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Gc.string(l.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class rst extends qr{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:L("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:L("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:L("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:L("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:L("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Ut(n.enabled,this.defaultValue.enabled),delay:ir.clampedInt(n.delay,this.defaultValue.delay,0,1e4),sticky:Ut(n.sticky,this.defaultValue.sticky),hidingDelay:ir.clampedInt(n.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Ut(n.above,this.defaultValue.above)}}}class P2 extends w5{constructor(){super(143)}compute(e,n,r){return P2.computeLayout(n,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const n=e.height/e.lineHeight,r=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,n-1));const o=(r+e.viewLineCount+s)/(e.pixelRatio*e.height),a=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:n,extraLinesBeforeFirstLine:r,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:a}}static _computeMinimapLayout(e,n){const r=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const a=n.stableMinimapLayoutInput,l=a&&e.outerHeight===a.outerHeight&&e.lineHeight===a.lineHeight&&e.typicalHalfwidthCharacterWidth===a.typicalHalfwidthCharacterWidth&&e.pixelRatio===a.pixelRatio&&e.scrollBeyondLastLine===a.scrollBeyondLastLine&&e.paddingTop===a.paddingTop&&e.paddingBottom===a.paddingBottom&&e.minimap.enabled===a.minimap.enabled&&e.minimap.side===a.minimap.side&&e.minimap.size===a.minimap.size&&e.minimap.showSlider===a.minimap.showSlider&&e.minimap.renderCharacters===a.minimap.renderCharacters&&e.minimap.maxColumn===a.minimap.maxColumn&&e.minimap.scale===a.minimap.scale&&e.verticalScrollbarWidth===a.verticalScrollbarWidth&&e.isViewportWrapping===a.isViewportWrapping,c=e.lineHeight,u=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let f=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const p=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,_=e.verticalScrollbarWidth,b=e.viewLineCount,y=e.remainingWidth,x=e.isViewportWrapping,k=h?2:3;let D=Math.floor(o*s);const R=D/o;let E=!1,A=!1,M=k*f,N=f/o,P=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:X,extraLinesBeforeFirstLine:Q,extraLinesBeyondLastLine:ie,desiredRatio:K,minimapLineCount:ee}=P2.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:c,pixelRatio:o});if(b/ee>1)E=!0,A=!0,f=1,M=1,N=f/o;else{let ke=!1,xe=f+1;if(g==="fit"){const me=Math.ceil((Q+b+ie)*M);x&&l&&y<=n.stableFitRemainingWidth?(ke=!0,xe=n.stableFitMaxMinimapScale):ke=me>D}if(g==="fill"||ke){E=!0;const me=f;M=Math.min(c*o,Math.max(1,Math.floor(1/K))),x&&l&&y<=n.stableFitRemainingWidth&&(xe=n.stableFitMaxMinimapScale),f=Math.min(xe,Math.max(1,Math.floor(M/k))),f>me&&(P=Math.min(2,f/me)),N=f/o/P,D=Math.ceil(Math.max(X,Q+b+ie)*M),x?(n.stableMinimapLayoutInput=e,n.stableFitRemainingWidth=y,n.stableFitMaxMinimapScale=f):(n.stableMinimapLayoutInput=null,n.stableFitRemainingWidth=0)}}}const O=Math.floor(p*N),B=Math.min(O,Math.max(0,Math.floor((y-_-2)*N/(u+N)))+qb);let j=Math.floor(o*B);const z=j/o;j=Math.floor(j*P);const H=h?1:2,Y=m==="left"?0:r-B-_;return{renderMinimap:H,minimapLeft:Y,minimapWidth:B,minimapHeightIsEditorHeight:E,minimapIsSampling:A,minimapScale:f,minimapLineHeight:M,minimapCanvasInnerWidth:j,minimapCanvasInnerHeight:D,minimapCanvasOuterWidth:z,minimapCanvasOuterHeight:R}}static computeLayout(e,n){const r=n.outerWidth|0,s=n.outerHeight|0,o=n.lineHeight|0,a=n.lineNumbersDigitCount|0,l=n.typicalHalfwidthCharacterWidth,c=n.maxDigitWidth,u=n.pixelRatio,d=n.viewLineCount,h=e.get(135),f=h==="inherit"?e.get(134):h,p=f==="inherit"?e.get(130):f,g=e.get(133),m=n.isDominatedByLongLines,_=e.get(57),b=e.get(67).renderType!==0,y=e.get(68),x=e.get(104),k=e.get(83),D=e.get(72),R=e.get(102),E=R.verticalScrollbarSize,A=R.verticalHasArrows,M=R.arrowSize,N=R.horizontalScrollbarSize,P=e.get(43),O=e.get(109)!=="never";let B=e.get(65);P&&O&&(B+=16);let j=0;if(b){const je=Math.max(a,y);j=Math.round(je*c)}let z=0;_&&(z=o*n.glyphMarginDecorationLaneCount);let H=0,Y=H+z,X=Y+j,Q=X+B;const ie=r-z-j-B;let K=!1,ee=!1,le=-1;f==="inherit"&&m?(K=!0,ee=!0):p==="on"||p==="bounded"?ee=!0:p==="wordWrapColumn"&&(le=g);const ke=P2._computeMinimapLayout({outerWidth:r,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:l,pixelRatio:u,scrollBeyondLastLine:x,paddingTop:k.top,paddingBottom:k.bottom,minimap:D,verticalScrollbarWidth:E,viewLineCount:d,remainingWidth:ie,isViewportWrapping:ee},n.memory||new T2e);ke.renderMinimap!==0&&ke.minimapLeft===0&&(H+=ke.minimapWidth,Y+=ke.minimapWidth,X+=ke.minimapWidth,Q+=ke.minimapWidth);const xe=ie-ke.minimapWidth,me=Math.max(1,Math.floor((xe-E-2)/l)),Ee=A?M:0;return ee&&(le=Math.max(1,me),p==="bounded"&&(le=Math.min(le,g))),{width:r,height:s,glyphMarginLeft:H,glyphMarginWidth:z,glyphMarginDecorationLaneCount:n.glyphMarginDecorationLaneCount,lineNumbersLeft:Y,lineNumbersWidth:j,decorationsLeft:X,decorationsWidth:B,contentLeft:Q,contentWidth:xe,minimap:ke,viewportColumn:me,isWordWrapMinified:K,isViewportWrapping:ee,wrappingColumn:le,verticalScrollbarWidth:E,horizontalScrollbarHeight:N,overviewRuler:{top:Ee,width:E,height:s-2*Ee,right:0}}}}class sst extends qr{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[L("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),L("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:L("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Rs(e,"simple",["simple","advanced"])}compute(e,n,r){return n.get(2)===2?"advanced":r}}class ost extends qr{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:L("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Ut(e.enabled,this.defaultValue.enabled)}}}class ast extends qr{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:L("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:L("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:L("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:L("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Ut(n.enabled,this.defaultValue.enabled),maxLineCount:ir.clampedInt(n.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Rs(n.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Ut(n.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class lst extends qr{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:L("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[L("editor.inlayHints.on","Inlay hints are enabled"),L("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",ri?"Ctrl+Option":"Ctrl+Alt"),L("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",ri?"Ctrl+Option":"Ctrl+Alt"),L("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:L("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:L("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:L("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return typeof n.enabled=="boolean"&&(n.enabled=n.enabled?"on":"off"),{enabled:Rs(n.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:ir.clampedInt(n.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Gc.string(n.fontFamily,this.defaultValue.fontFamily),padding:Ut(n.padding,this.defaultValue.padding)}}}class cst extends qr{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):ir.clampedInt(e,this.defaultValue,0,1e3)}compute(e,n,r){return r<0?ir.clampedInt(-r*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):r}}class ust extends mf{constructor(){super(66,"lineHeight",su.lineHeight,e=>mf.clamp(e,0,150),{markdownDescription:L("lineHeight",`Controls the line height.
- Use 0 to automatically compute the line height from the font size.
- Values between 0 and 8 will be used as a multiplier with the font size.
- Values greater than or equal to 8 will be used as effective values.`)})}compute(e,n,r){return e.fontInfo.lineHeight}}class dst extends qr{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:L("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:L("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[L("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),L("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),L("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:L("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:L("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:L("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:L("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:L("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:L("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Ut(n.enabled,this.defaultValue.enabled),autohide:Ut(n.autohide,this.defaultValue.autohide),size:Rs(n.size,this.defaultValue.size,["proportional","fill","fit"]),side:Rs(n.side,this.defaultValue.side,["right","left"]),showSlider:Rs(n.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Ut(n.renderCharacters,this.defaultValue.renderCharacters),scale:ir.clampedInt(n.scale,1,1,3),maxColumn:ir.clampedInt(n.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function hst(i){return i==="ctrlCmd"?ri?"metaKey":"ctrlKey":"altKey"}class fst extends qr{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:L("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:L("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{top:ir.clampedInt(n.top,0,0,1e3),bottom:ir.clampedInt(n.bottom,0,0,1e3)}}}class pst extends qr{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:L("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:L("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Ut(n.enabled,this.defaultValue.enabled),cycle:Ut(n.cycle,this.defaultValue.cycle)}}}class gst extends w5{constructor(){super(141)}compute(e,n,r){return e.pixelRatio}}class mst extends qr{constructor(){const e={other:"on",comments:"off",strings:"off"},n=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[L("on","Quick suggestions show inside the suggest widget"),L("inline","Quick suggestions show as ghost text"),L("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:n,default:e.strings,description:L("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:n,default:e.comments,description:L("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:n,default:e.other,description:L("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:L("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const u=e?"on":"off";return{comments:u,strings:u,other:u}}if(!e||typeof e!="object")return this.defaultValue;const{other:n,comments:r,strings:s}=e,o=["on","inline","off"];let a,l,c;return typeof n=="boolean"?a=n?"on":"off":a=Rs(n,this.defaultValue.other,o),typeof r=="boolean"?l=r?"on":"off":l=Rs(r,this.defaultValue.comments,o),typeof s=="boolean"?c=s?"on":"off":c=Rs(s,this.defaultValue.strings,o),{other:a,comments:l,strings:c}}}class _st extends qr{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[L("lineNumbers.off","Line numbers are not rendered."),L("lineNumbers.on","Line numbers are rendered as absolute number."),L("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),L("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:L("lineNumbers","Controls the display of line numbers.")})}validate(e){let n=this.defaultValue.renderType,r=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(n=4,r=e):e==="interval"?n=3:e==="relative"?n=2:e==="on"?n=1:n=0),{renderType:n,renderFn:r}}}function I9(i){const e=i.get(97);return e==="editable"?i.get(90):e!=="on"}class vst extends qr{constructor(){const e=[],n={type:"number",description:L("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[n,{type:["object"],properties:{column:n,color:{type:"string",description:L("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:L("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const n=[];for(const r of e)if(typeof r=="number")n.push({column:ir.clampedInt(r,0,0,1e4),color:null});else if(r&&typeof r=="object"){const s=r;n.push({column:ir.clampedInt(s.column,0,0,1e4),color:s.color})}return n.sort((r,s)=>r.column-s.column),n}return this.defaultValue}}class bst extends qr{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function Wfe(i,e){if(typeof i!="string")return e;switch(i){case"hidden":return 2;case"visible":return 3;default:return 1}}let yst=class extends qr{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[L("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),L("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),L("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:L("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[L("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),L("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),L("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:L("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:L("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:L("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:L("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e,r=ir.clampedInt(n.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=ir.clampedInt(n.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:ir.clampedInt(n.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Wfe(n.vertical,this.defaultValue.vertical),horizontal:Wfe(n.horizontal,this.defaultValue.horizontal),useShadows:Ut(n.useShadows,this.defaultValue.useShadows),verticalHasArrows:Ut(n.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Ut(n.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Ut(n.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Ut(n.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:r,horizontalSliderSize:ir.clampedInt(n.horizontalSliderSize,r,0,1e3),verticalScrollbarSize:s,verticalSliderSize:ir.clampedInt(n.verticalSliderSize,s,0,1e3),scrollByPage:Ut(n.scrollByPage,this.defaultValue.scrollByPage)}}};const Bu="inUntrustedWorkspace",fc={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class wst extends qr{constructor(){const e={nonBasicASCII:Bu,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Bu,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[fc.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Bu],default:e.nonBasicASCII,description:L("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[fc.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:L("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[fc.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:L("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[fc.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Bu],default:e.includeComments,description:L("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[fc.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Bu],default:e.includeStrings,description:L("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[fc.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:L("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[fc.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:L("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,n){let r=!1;n.allowedCharacters&&e&&(od(e.allowedCharacters,n.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:n.allowedCharacters}),r=!0)),n.allowedLocales&&e&&(od(e.allowedLocales,n.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:n.allowedLocales}),r=!0));const s=super.applyUpdate(e,n);return r?new QN(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{nonBasicASCII:O2(n.nonBasicASCII,Bu,[!0,!1,Bu]),invisibleCharacters:Ut(n.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Ut(n.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:O2(n.includeComments,Bu,[!0,!1,Bu]),includeStrings:O2(n.includeStrings,Bu,[!0,!1,Bu]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,n){if(typeof e!="object"||!e)return n;const r={};for(const[s,o]of Object.entries(e))o===!0&&(r[s]=!0);return r}}class Cst extends qr{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:L("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[L("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),L("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:L("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:L("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Ut(n.enabled,this.defaultValue.enabled),mode:Rs(n.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Rs(n.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:Ut(n.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Ut(n.keepOnBlur,this.defaultValue.keepOnBlur)}}}class Sst extends qr{constructor(){const e={enabled:za.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:za.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:L("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:L("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Ut(n.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Ut(n.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class xst extends qr{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[L("editor.guides.bracketPairs.true","Enables bracket pair guides."),L("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),L("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:L("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[L("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),L("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),L("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:L("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:L("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:L("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[L("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),L("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),L("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:L("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{bracketPairs:O2(n.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:O2(n.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Ut(n.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Ut(n.indentation,this.defaultValue.indentation),highlightActiveIndentation:O2(n.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function O2(i,e,n){const r=n.indexOf(i);return r===-1?e:n[r]}class kst extends qr{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[L("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),L("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:L("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:L("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:L("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:L("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[L("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),L("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),L("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),L("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:L("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:L("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:L("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:L("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:L("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:L("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:L("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:L("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:L("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{insertMode:Rs(n.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Ut(n.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Ut(n.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Ut(n.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Ut(n.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Rs(n.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Ut(n.showIcons,this.defaultValue.showIcons),showStatusBar:Ut(n.showStatusBar,this.defaultValue.showStatusBar),preview:Ut(n.preview,this.defaultValue.preview),previewMode:Rs(n.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Ut(n.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Ut(n.showMethods,this.defaultValue.showMethods),showFunctions:Ut(n.showFunctions,this.defaultValue.showFunctions),showConstructors:Ut(n.showConstructors,this.defaultValue.showConstructors),showDeprecated:Ut(n.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Ut(n.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Ut(n.showFields,this.defaultValue.showFields),showVariables:Ut(n.showVariables,this.defaultValue.showVariables),showClasses:Ut(n.showClasses,this.defaultValue.showClasses),showStructs:Ut(n.showStructs,this.defaultValue.showStructs),showInterfaces:Ut(n.showInterfaces,this.defaultValue.showInterfaces),showModules:Ut(n.showModules,this.defaultValue.showModules),showProperties:Ut(n.showProperties,this.defaultValue.showProperties),showEvents:Ut(n.showEvents,this.defaultValue.showEvents),showOperators:Ut(n.showOperators,this.defaultValue.showOperators),showUnits:Ut(n.showUnits,this.defaultValue.showUnits),showValues:Ut(n.showValues,this.defaultValue.showValues),showConstants:Ut(n.showConstants,this.defaultValue.showConstants),showEnums:Ut(n.showEnums,this.defaultValue.showEnums),showEnumMembers:Ut(n.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Ut(n.showKeywords,this.defaultValue.showKeywords),showWords:Ut(n.showWords,this.defaultValue.showWords),showColors:Ut(n.showColors,this.defaultValue.showColors),showFiles:Ut(n.showFiles,this.defaultValue.showFiles),showReferences:Ut(n.showReferences,this.defaultValue.showReferences),showFolders:Ut(n.showFolders,this.defaultValue.showFolders),showTypeParameters:Ut(n.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Ut(n.showSnippets,this.defaultValue.showSnippets),showUsers:Ut(n.showUsers,this.defaultValue.showUsers),showIssues:Ut(n.showIssues,this.defaultValue.showIssues)}}}class Lst extends qr{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:L("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:L("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:Ut(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Ut(e.selectSubwords,this.defaultValue.selectSubwords)}}}class Dst extends qr{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[L("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),L("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),L("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),L("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:L("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,n,r){return n.get(2)===2?0:r}}class Est extends w5{constructor(){super(144)}compute(e,n,r){const s=n.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}class Ist extends qr{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:L("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:L("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[L("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),L("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Ut(n.enabled,this.defaultValue.enabled),showDropSelector:Rs(n.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class Tst extends qr{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:L("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:L("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[L("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),L("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Ut(n.enabled,this.defaultValue.enabled),showPasteSelector:Rs(n.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const Rst="Consolas, 'Courier New', monospace",Ast="Menlo, Monaco, 'Courier New', monospace",Nst="'Droid Sans Mono', 'monospace', monospace",su={fontFamily:ri?Ast:_l?Nst:Rst,fontWeight:"normal",fontSize:ri?12:14,lineHeight:0,letterSpacing:0},t2=[];function it(i){return t2[i.id]=i,i}const rg={acceptSuggestionOnCommitCharacter:it(new li(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:L("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:it(new ts(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",L("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:L("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:it(new Grt),accessibilityPageSize:it(new ir(3,"accessibilityPageSize",10,1,1073741824,{description:L("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:it(new Gc(4,"ariaLabel",L("editorViewAccessibleLabel","Editor content"))),ariaRequired:it(new li(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:it(new li(8,"screenReaderAnnounceInlineSuggestion",!0,{description:L("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:it(new ts(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",L("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),L("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:L("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:it(new ts(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",L("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),L("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:L("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:it(new ts(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",L("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:L("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:it(new ts(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",L("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:L("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:it(new ts(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",L("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),L("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:L("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:it(new M3(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Krt,{enumDescriptions:[L("editor.autoIndent.none","The editor will not insert indentation automatically."),L("editor.autoIndent.keep","The editor will keep the current line's indentation."),L("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),L("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),L("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:L("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:it(new li(13,"automaticLayout",!1)),autoSurround:it(new ts(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[L("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),L("editor.autoSurround.quotes","Surround with quotes but not brackets."),L("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:L("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:it(new Sst),bracketPairGuides:it(new xst),stickyTabStops:it(new li(115,"stickyTabStops",!1,{description:L("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:it(new li(17,"codeLens",!0,{description:L("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:it(new Gc(18,"codeLensFontFamily","",{description:L("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:it(new ir(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:L("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:it(new li(20,"colorDecorators",!0,{description:L("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:it(new ts(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[L("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),L("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),L("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:L("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:it(new ir(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:L("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:it(new li(22,"columnSelection",!1,{description:L("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:it(new Xrt),contextmenu:it(new li(24,"contextmenu",!0)),copyWithSyntaxHighlighting:it(new li(25,"copyWithSyntaxHighlighting",!0,{description:L("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:it(new M3(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],Yrt,{description:L("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:it(new ts(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[L("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),L("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),L("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:L("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:it(new M3(28,"cursorStyle",na.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Zrt,{description:L("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:it(new ir(29,"cursorSurroundingLines",0,0,1073741824,{description:L("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:it(new ts(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[L("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),L("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:L("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:it(new ir(31,"cursorWidth",0,0,1073741824,{markdownDescription:L("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:it(new li(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:it(new li(33,"disableMonospaceOptimizations",!1)),domReadOnly:it(new li(34,"domReadOnly",!1)),dragAndDrop:it(new li(35,"dragAndDrop",!0,{description:L("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:it(new Jrt),dropIntoEditor:it(new Ist),stickyScroll:it(new ast),experimentalWhitespaceRendering:it(new ts(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[L("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),L("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),L("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:L("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:it(new Gc(39,"extraEditorClassName","")),fastScrollSensitivity:it(new mf(40,"fastScrollSensitivity",5,i=>i<=0?5:i,{markdownDescription:L("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:it(new est),fixedOverflowWidgets:it(new li(42,"fixedOverflowWidgets",!1)),folding:it(new li(43,"folding",!0,{description:L("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:it(new ts(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[L("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),L("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:L("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:it(new li(45,"foldingHighlight",!0,{description:L("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:it(new li(46,"foldingImportsByDefault",!1,{description:L("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:it(new ir(47,"foldingMaximumRegions",5e3,10,65e3,{description:L("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:it(new li(48,"unfoldOnClickAfterEndOfLine",!1,{description:L("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:it(new Gc(49,"fontFamily",su.fontFamily,{description:L("fontFamily","Controls the font family.")})),fontInfo:it(new tst),fontLigatures2:it(new Uu),fontSize:it(new nst),fontWeight:it(new lm),fontVariations:it(new Ip),formatOnPaste:it(new li(55,"formatOnPaste",!1,{description:L("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:it(new li(56,"formatOnType",!1,{description:L("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:it(new li(57,"glyphMargin",!0,{description:L("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:it(new ist),hideCursorInOverviewRuler:it(new li(59,"hideCursorInOverviewRuler",!1,{description:L("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:it(new rst),inDiffEditor:it(new li(61,"inDiffEditor",!1)),letterSpacing:it(new mf(63,"letterSpacing",su.letterSpacing,i=>mf.clamp(i,-5,20),{description:L("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:it(new ost),lineDecorationsWidth:it(new cst),lineHeight:it(new ust),lineNumbers:it(new _st),lineNumbersMinChars:it(new ir(68,"lineNumbersMinChars",5,1,300)),linkedEditing:it(new li(69,"linkedEditing",!1,{description:L("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:it(new li(70,"links",!0,{description:L("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:it(new ts(71,"matchBrackets","always",["always","near","never"],{description:L("matchBrackets","Highlight matching brackets.")})),minimap:it(new dst),mouseStyle:it(new ts(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:it(new mf(74,"mouseWheelScrollSensitivity",1,i=>i===0?1:i,{markdownDescription:L("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:it(new li(75,"mouseWheelZoom",!1,{markdownDescription:L("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:it(new li(76,"multiCursorMergeOverlapping",!0,{description:L("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:it(new M3(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],hst,{markdownEnumDescriptions:[L("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),L("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:L({},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:it(new ts(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[L("multiCursorPaste.spread","Each cursor pastes a single line of the text."),L("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:L("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:it(new ir(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:L("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:it(new li(80,"occurrencesHighlight",!0,{description:L("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:it(new li(81,"overviewRulerBorder",!0,{description:L("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:it(new ir(82,"overviewRulerLanes",3,0,3)),padding:it(new fst),pasteAs:it(new Tst),parameterHints:it(new pst),peekWidgetDefaultFocus:it(new ts(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[L("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),L("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:L("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:it(new li(87,"definitionLinkOpensInPeek",!1,{description:L("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:it(new mst),quickSuggestionsDelay:it(new ir(89,"quickSuggestionsDelay",10,0,1073741824,{description:L("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:it(new li(90,"readOnly",!1)),readOnlyMessage:it(new bst),renameOnType:it(new li(92,"renameOnType",!1,{description:L("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:L("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:it(new li(93,"renderControlCharacters",!0,{description:L("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:it(new ts(94,"renderFinalNewline",_l?"dimmed":"on",["off","on","dimmed"],{description:L("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:it(new ts(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",L("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:L("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:it(new li(96,"renderLineHighlightOnlyWhenFocus",!1,{description:L("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:it(new ts(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:it(new ts(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",L("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),L("renderWhitespace.selection","Render whitespace characters only on selected text."),L("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:L("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:it(new ir(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:it(new li(100,"roundedSelection",!0,{description:L("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:it(new vst),scrollbar:it(new yst),scrollBeyondLastColumn:it(new ir(103,"scrollBeyondLastColumn",4,0,1073741824,{description:L("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:it(new li(104,"scrollBeyondLastLine",!0,{description:L("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:it(new li(105,"scrollPredominantAxis",!0,{description:L("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:it(new li(106,"selectionClipboard",!0,{description:L("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:_l})),selectionHighlight:it(new li(107,"selectionHighlight",!0,{description:L("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:it(new li(108,"selectOnLineNumbers",!0)),showFoldingControls:it(new ts(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[L("showFoldingControls.always","Always show the folding controls."),L("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),L("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:L("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:it(new li(110,"showUnused",!0,{description:L("showUnused","Controls fading out of unused code.")})),showDeprecated:it(new li(138,"showDeprecated",!0,{description:L("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:it(new lst),snippetSuggestions:it(new ts(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[L("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),L("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),L("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),L("snippetSuggestions.none","Do not show snippet suggestions.")],description:L("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:it(new Lst),smoothScrolling:it(new li(113,"smoothScrolling",!1,{description:L("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:it(new ir(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:it(new kst),inlineSuggest:it(new Cst),inlineCompletionsAccessibilityVerbose:it(new li(147,"inlineCompletionsAccessibilityVerbose",!1,{description:L("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:it(new ir(118,"suggestFontSize",0,0,1e3,{markdownDescription:L("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:it(new ir(119,"suggestLineHeight",0,0,1e3,{markdownDescription:L("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:it(new li(120,"suggestOnTriggerCharacters",!0,{description:L("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:it(new ts(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[L("suggestSelection.first","Always select the first suggestion."),L("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),L("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:L("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:it(new ts(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[L("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),L("tabCompletion.off","Disable tab completions."),L("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:L("tabCompletion","Enables tab completions.")})),tabIndex:it(new ir(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:it(new wst),unusualLineTerminators:it(new ts(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[L("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),L("unusualLineTerminators.off","Unusual line terminators are ignored."),L("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:L("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:it(new li(126,"useShadowDOM",!0)),useTabStops:it(new li(127,"useTabStops",!0,{description:L("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:it(new ts(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[L("wordBreak.normal","Use the default line break rule."),L("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:L("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:it(new Gc(129,"wordSeparators",L2e,{description:L("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:it(new ts(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[L("wordWrap.off","Lines will never wrap."),L("wordWrap.on","Lines will wrap at the viewport width."),L({},"Lines will wrap at `#editor.wordWrapColumn#`."),L({},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:L({},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:it(new Gc(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:it(new Gc(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:it(new ir(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:L({},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:it(new ts(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:it(new ts(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:it(new Qrt),defaultColorDecorators:it(new li(145,"defaultColorDecorators",!1,{markdownDescription:L("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:it(new gst),tabFocusMode:it(new li(142,"tabFocusMode",!1,{markdownDescription:L("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:it(new P2),wrappingInfo:it(new Est),wrappingIndent:it(new Dst),wrappingStrategy:it(new sst)};class Mst{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?DE.isErrorNoTelemetry(e)?new DE(e.message+`
`+e.stack):new Error(e.message+`
`+e.stack):e},0)}}emit(e){this.listeners.forEach(n=>{n(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const R2e=new Mst;function Ln(i){sg(i)||R2e.onUnexpectedError(i)}function Us(i){sg(i)||R2e.onUnexpectedExternalError(i)}function $fe(i){if(i instanceof Error){const{name:e,message:n}=i,r=i.stacktrace||i.stack;return{$isError:!0,name:e,message:n,stack:r,noTelemetry:DE.isErrorNoTelemetry(i)}}return i}const T9="Canceled";function sg(i){return i instanceof U1?!0:i instanceof Error&&i.name===T9&&i.message===T9}class U1 extends Error{constructor(){super(T9),this.name=this.message}}function Pst(){const i=new Error(T9);return i.name=i.message,i}function uh(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function Rse(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class Ost extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class DE extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof DE)return e;const n=new DE;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Vs extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Vs.prototype)}}function u1(i){const e=this;let n=!1,r;return function(){return n||(n=!0,r=i.apply(e,arguments)),r}}function Ase(i){return typeof i.dispose=="function"&&i.dispose.length===0}function Mi(i){if(Vn.is(i)){const e=[];for(const n of i)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function Sf(...i){return gn(()=>Mi(i))}function gn(i){return{dispose:u1(()=>{i()})}}class Xe{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{Mi(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?Xe.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}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}Xe.DISABLE_DISPOSED_WARNING=!1;class Le{constructor(){this._store=new Xe,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)}}Le.None=Object.freeze({dispose(){}});class ha{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var n;this._isDisposed||e===this._value||((n=this._value)===null||n===void 0||n.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class Fst{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class Bst{constructor(e){this.object=e}dispose(){}}class Nse{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Mi(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,n,r=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),r||(s=this._store.get(e))===null||s===void 0||s.dispose(),this._store.set(e,n)}deleteAndDispose(e){var n;(n=this._store.get(e))===null||n===void 0||n.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const jst=globalThis.performance&&typeof globalThis.performance.now=="function";class Xa{static create(e){return new Xa(e)}constructor(e){this._now=jst&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var _t;(function(i){i.None=()=>Le.None;function e(O,B){return h(O,()=>{},0,void 0,!0,void 0,B)}i.defer=e;function n(O){return(B,j=null,z)=>{let H=!1,Y;return Y=O(X=>{if(!H)return Y?Y.dispose():H=!0,B.call(j,X)},null,z),H&&Y.dispose(),Y}}i.once=n;function r(O,B,j){return u((z,H=null,Y)=>O(X=>z.call(H,B(X)),null,Y),j)}i.map=r;function s(O,B,j){return u((z,H=null,Y)=>O(X=>{B(X),z.call(H,X)},null,Y),j)}i.forEach=s;function o(O,B,j){return u((z,H=null,Y)=>O(X=>B(X)&&z.call(H,X),null,Y),j)}i.filter=o;function a(O){return O}i.signal=a;function l(...O){return(B,j=null,z)=>{const H=Sf(...O.map(Y=>Y(X=>B.call(j,X))));return d(H,z)}}i.any=l;function c(O,B,j,z){let H=j;return r(O,Y=>(H=B(H,Y),H),z)}i.reduce=c;function u(O,B){let j;const z={onWillAddFirstListener(){j=O(H.fire,H)},onDidRemoveLastListener(){j==null||j.dispose()}},H=new _e(z);return B==null||B.add(H),H.event}function d(O,B){return B instanceof Array?B.push(O):B&&B.add(O),O}function h(O,B,j=100,z=!1,H=!1,Y,X){let Q,ie,K,ee=0,le;const ke={leakWarningThreshold:Y,onWillAddFirstListener(){Q=O(me=>{ee++,ie=B(ie,me),z&&!K&&(xe.fire(ie),ie=void 0),le=()=>{const Ee=ie;ie=void 0,K=void 0,(!z||ee>1)&&xe.fire(Ee),ee=0},typeof j=="number"?(clearTimeout(K),K=setTimeout(le,j)):K===void 0&&(K=0,queueMicrotask(le))})},onWillRemoveListener(){H&&ee>0&&(le==null||le())},onDidRemoveLastListener(){le=void 0,Q.dispose()}},xe=new _e(ke);return X==null||X.add(xe),xe.event}i.debounce=h;function f(O,B=0,j){return i.debounce(O,(z,H)=>z?(z.push(H),z):[H],B,void 0,!0,void 0,j)}i.accumulate=f;function p(O,B=(z,H)=>z===H,j){let z=!0,H;return o(O,Y=>{const X=z||!B(Y,H);return z=!1,H=Y,X},j)}i.latch=p;function g(O,B,j){return[i.filter(O,B,j),i.filter(O,z=>!B(z),j)]}i.split=g;function m(O,B=!1,j=[],z){let H=j.slice(),Y=O(ie=>{H?H.push(ie):Q.fire(ie)});z&&z.add(Y);const X=()=>{H==null||H.forEach(ie=>Q.fire(ie)),H=null},Q=new _e({onWillAddFirstListener(){Y||(Y=O(ie=>Q.fire(ie)),z&&z.add(Y))},onDidAddFirstListener(){H&&(B?setTimeout(X):X())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return z&&z.add(Q),Q.event}i.buffer=m;function _(O,B){return(z,H,Y)=>{const X=B(new y);return O(function(Q){const ie=X.evaluate(Q);ie!==b&&z.call(H,ie)},void 0,Y)}}i.chain=_;const b=Symbol("HaltChainable");class y{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(j=>(B(j),j)),this}filter(B){return this.steps.push(j=>B(j)?j:b),this}reduce(B,j){let z=j;return this.steps.push(H=>(z=B(z,H),z)),this}latch(B=(j,z)=>j===z){let j=!0,z;return this.steps.push(H=>{const Y=j||!B(H,z);return j=!1,z=H,Y?H:b}),this}evaluate(B){for(const j of this.steps)if(B=j(B),B===b)break;return B}}function x(O,B,j=z=>z){const z=(...Q)=>X.fire(j(...Q)),H=()=>O.on(B,z),Y=()=>O.removeListener(B,z),X=new _e({onWillAddFirstListener:H,onDidRemoveLastListener:Y});return X.event}i.fromNodeEventEmitter=x;function k(O,B,j=z=>z){const z=(...Q)=>X.fire(j(...Q)),H=()=>O.addEventListener(B,z),Y=()=>O.removeEventListener(B,z),X=new _e({onWillAddFirstListener:H,onDidRemoveLastListener:Y});return X.event}i.fromDOMEventEmitter=k;function D(O){return new Promise(B=>n(O)(B))}i.toPromise=D;function R(O){const B=new _e;return O.then(j=>{B.fire(j)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}i.fromPromise=R;function E(O,B){return B(void 0),O(j=>B(j))}i.runAndSubscribe=E;function A(O,B){let j=null;function z(Y){j==null||j.dispose(),j=new Xe,B(Y,j)}z(void 0);const H=O(Y=>z(Y));return gn(()=>{H.dispose(),j==null||j.dispose()})}i.runAndSubscribeWithStore=A;class M{constructor(B,j){this._observable=B,this._counter=0,this._hasChanged=!1;const z={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new _e(z),j&&j.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,j){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function N(O,B){return new M(O,B).emitter.event}i.fromObservable=N;function P(O){return B=>{let j=0,z=!1;const H={beginUpdate(){j++},endUpdate(){j--,j===0&&(O.reportChanges(),z&&(z=!1,B()))},handlePossibleChange(){},handleChange(){z=!0}};return O.addObserver(H),O.reportChanges(),{dispose(){O.removeObserver(H)}}}}i.fromObservableLight=P})(_t||(_t={}));class EE{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${EE._idPool++}`,EE.all.add(this)}start(e){this._stopWatch=new Xa,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}EE.all=new Set;EE._idPool=0;let Wst=-1;class $st{constructor(e,n=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=n,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,n){const r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);const s=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let o,a=0;for(const[l,c]of this._stacks)(!o||a<c)&&(o=l,a=c);console.warn(`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${a}):`),console.warn(o)}return()=>{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class Mse{static create(){var e;return new Mse((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}}class WU{constructor(e){this.value=e}}const zst=2;let _e=class{constructor(e){var n,r,s,o,a;this._size=0,this._options=e,this._leakageMon=!((n=this._options)===null||n===void 0)&&n.leakWarningThreshold?new $st((s=(r=this._options)===null||r===void 0?void 0:r.leakWarningThreshold)!==null&&s!==void 0?s:Wst):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new EE(this._options._profName):void 0,this._deliveryQueue=(a=this._options)===null||a===void 0?void 0:a.deliveryQueue}dispose(){var e,n,r,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(n=this._options)===null||n===void 0?void 0:n.onDidRemoveLastListener)===null||r===void 0||r.call(n),(s=this._leakageMon)===null||s===void 0||s.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(n,r,s)=>{var o,a,l,c,u;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),Le.None;if(this._disposed)return Le.None;r&&(n=n.bind(r));const d=new WU(n);let h;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(d.stack=Mse.create(),h=this._leakageMon.check(d.stack,this._size+1)),this._listeners?this._listeners instanceof WU?((u=this._deliveryQueue)!==null&&u!==void 0||(this._deliveryQueue=new A2e),this._listeners=[this._listeners,d]):this._listeners.push(d):((a=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||a===void 0||a.call(o,this),this._listeners=d,(c=(l=this._options)===null||l===void 0?void 0:l.onDidAddFirstListener)===null||c===void 0||c.call(l,this)),this._size++;const f=gn(()=>{h==null||h(),this._removeListener(d)});return s instanceof Xe?s.add(f):Array.isArray(s)&&s.push(f),f}),this._event}_removeListener(e){var n,r,s,o;if((r=(n=this._options)===null||n===void 0?void 0:n.onWillRemoveListener)===null||r===void 0||r.call(n,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(s=this._options)===null||s===void 0?void 0:s.onDidRemoveLastListener)===null||o===void 0||o.call(s,this),this._size=0;return}const a=this._listeners,l=a.indexOf(e);if(l===-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--,a[l]=void 0;const c=this._deliveryQueue.current===this;if(this._size*zst<=a.length){let u=0;for(let d=0;d<a.length;d++)a[d]?a[u++]=a[d]:c&&(this._deliveryQueue.end--,u<this._deliveryQueue.i&&this._deliveryQueue.i--);a.length=u}}_deliver(e,n){var r;if(!e)return;const s=((r=this._options)===null||r===void 0?void 0:r.onListenerError)||Ln;if(!s){e.value(n);return}try{e.value(n)}catch(o){s(o)}}_deliverQueue(e){const n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){var n,r,s,o;if(!((n=this._deliveryQueue)===null||n===void 0)&&n.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)===null||r===void 0||r.stop()),(s=this._perfMon)===null||s===void 0||s.start(this._size),this._listeners)if(this._listeners instanceof WU)this._deliver(this._listeners,e);else{const a=this._deliveryQueue;a.enqueue(this,e,this._listeners.length),this._deliverQueue(a)}(o=this._perfMon)===null||o===void 0||o.stop()}hasListeners(){return this._size>0}};const Vst=()=>new A2e;class A2e{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class sx extends _e{constructor(e){super(e),this._isPaused=0,this._eventQueue=new jl,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class N2e extends sx{constructor(e){var n;super(e),this._delay=(n=e.delay)!==null&&n!==void 0?n:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class Hst extends _e{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(n=>super.fire(n)),this._queuedEvents=[]}))}}class Ust{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new _e({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const n={event:e,listener:null};return this.events.push(n),this.hasListeners&&this.hook(n),gn(u1(()=>{this.hasListeners&&this.unhook(n);const s=this.events.indexOf(n);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(n=>this.emitter.fire(n))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class Pse{constructor(){this.buffers=[]}wrapEvent(e){return(n,r,s)=>e(o=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>n.call(r,o)):n.call(r,o)},void 0,s)}bufferEvents(e){const n=[];this.buffers.push(n);const r=e();return this.buffers.pop(),n.forEach(s=>s()),r}}class zfe{constructor(){this.listening=!1,this.inputEvent=_t.None,this.inputEventListener=Le.None,this.emitter=new _e({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const M2e=Object.freeze(function(i,e){const n=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(n)}}});var Hn;(function(i){function e(n){return n===i.None||n===i.Cancelled||n instanceof i8?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:_t.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:M2e})})(Hn||(Hn={}));class i8{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?M2e:(this._emitter||(this._emitter=new _e),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Ns=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new i8),this._token}cancel(){this._token?this._token instanceof i8&&this._token.cancel():this._token=Hn.Cancelled}dispose(e=!1){var n;e&&this.cancel(),(n=this._parentListener)===null||n===void 0||n.dispose(),this._token?this._token instanceof i8&&this._token.dispose():this._token=Hn.None}};class Ose{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,n){this._keyCodeToStr[e]=n,this._strToKeyCode[n.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const r8=new Ose,aQ=new Ose,lQ=new Ose,P2e=new Array(230),qst=Object.create(null),Kst=Object.create(null),Fse=[];for(let i=0;i<=193;i++)Fse[i]=-1;(function(){const i="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",i,i],[1,1,"Hyper",0,i,0,i,i,i],[1,2,"Super",0,i,0,i,i,i],[1,3,"Fn",0,i,0,i,i,i],[1,4,"FnLock",0,i,0,i,i,i],[1,5,"Suspend",0,i,0,i,i,i],[1,6,"Resume",0,i,0,i,i,i],[1,7,"Turbo",0,i,0,i,i,i],[1,8,"Sleep",0,i,0,"VK_SLEEP",i,i],[1,9,"WakeUp",0,i,0,i,i,i],[0,10,"KeyA",31,"A",65,"VK_A",i,i],[0,11,"KeyB",32,"B",66,"VK_B",i,i],[0,12,"KeyC",33,"C",67,"VK_C",i,i],[0,13,"KeyD",34,"D",68,"VK_D",i,i],[0,14,"KeyE",35,"E",69,"VK_E",i,i],[0,15,"KeyF",36,"F",70,"VK_F",i,i],[0,16,"KeyG",37,"G",71,"VK_G",i,i],[0,17,"KeyH",38,"H",72,"VK_H",i,i],[0,18,"KeyI",39,"I",73,"VK_I",i,i],[0,19,"KeyJ",40,"J",74,"VK_J",i,i],[0,20,"KeyK",41,"K",75,"VK_K",i,i],[0,21,"KeyL",42,"L",76,"VK_L",i,i],[0,22,"KeyM",43,"M",77,"VK_M",i,i],[0,23,"KeyN",44,"N",78,"VK_N",i,i],[0,24,"KeyO",45,"O",79,"VK_O",i,i],[0,25,"KeyP",46,"P",80,"VK_P",i,i],[0,26,"KeyQ",47,"Q",81,"VK_Q",i,i],[0,27,"KeyR",48,"R",82,"VK_R",i,i],[0,28,"KeyS",49,"S",83,"VK_S",i,i],[0,29,"KeyT",50,"T",84,"VK_T",i,i],[0,30,"KeyU",51,"U",85,"VK_U",i,i],[0,31,"KeyV",52,"V",86,"VK_V",i,i],[0,32,"KeyW",53,"W",87,"VK_W",i,i],[0,33,"KeyX",54,"X",88,"VK_X",i,i],[0,34,"KeyY",55,"Y",89,"VK_Y",i,i],[0,35,"KeyZ",56,"Z",90,"VK_Z",i,i],[0,36,"Digit1",22,"1",49,"VK_1",i,i],[0,37,"Digit2",23,"2",50,"VK_2",i,i],[0,38,"Digit3",24,"3",51,"VK_3",i,i],[0,39,"Digit4",25,"4",52,"VK_4",i,i],[0,40,"Digit5",26,"5",53,"VK_5",i,i],[0,41,"Digit6",27,"6",54,"VK_6",i,i],[0,42,"Digit7",28,"7",55,"VK_7",i,i],[0,43,"Digit8",29,"8",56,"VK_8",i,i],[0,44,"Digit9",30,"9",57,"VK_9",i,i],[0,45,"Digit0",21,"0",48,"VK_0",i,i],[1,46,"Enter",3,"Enter",13,"VK_RETURN",i,i],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",i,i],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",i,i],[1,49,"Tab",2,"Tab",9,"VK_TAB",i,i],[1,50,"Space",10,"Space",32,"VK_SPACE",i,i],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,i,0,i,i,i],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",i,i],[1,64,"F1",59,"F1",112,"VK_F1",i,i],[1,65,"F2",60,"F2",113,"VK_F2",i,i],[1,66,"F3",61,"F3",114,"VK_F3",i,i],[1,67,"F4",62,"F4",115,"VK_F4",i,i],[1,68,"F5",63,"F5",116,"VK_F5",i,i],[1,69,"F6",64,"F6",117,"VK_F6",i,i],[1,70,"F7",65,"F7",118,"VK_F7",i,i],[1,71,"F8",66,"F8",119,"VK_F8",i,i],[1,72,"F9",67,"F9",120,"VK_F9",i,i],[1,73,"F10",68,"F10",121,"VK_F10",i,i],[1,74,"F11",69,"F11",122,"VK_F11",i,i],[1,75,"F12",70,"F12",123,"VK_F12",i,i],[1,76,"PrintScreen",0,i,0,i,i,i],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",i,i],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",i,i],[1,79,"Insert",19,"Insert",45,"VK_INSERT",i,i],[1,80,"Home",14,"Home",36,"VK_HOME",i,i],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",i,i],[1,82,"Delete",20,"Delete",46,"VK_DELETE",i,i],[1,83,"End",13,"End",35,"VK_END",i,i],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",i,i],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",i],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",i],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",i],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",i],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",i,i],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",i,i],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",i,i],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",i,i],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",i,i],[1,94,"NumpadEnter",3,i,0,i,i,i],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",i,i],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",i,i],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",i,i],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",i,i],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",i,i],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",i,i],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",i,i],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",i,i],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",i,i],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",i,i],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",i,i],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",i,i],[1,107,"ContextMenu",58,"ContextMenu",93,i,i,i],[1,108,"Power",0,i,0,i,i,i],[1,109,"NumpadEqual",0,i,0,i,i,i],[1,110,"F13",71,"F13",124,"VK_F13",i,i],[1,111,"F14",72,"F14",125,"VK_F14",i,i],[1,112,"F15",73,"F15",126,"VK_F15",i,i],[1,113,"F16",74,"F16",127,"VK_F16",i,i],[1,114,"F17",75,"F17",128,"VK_F17",i,i],[1,115,"F18",76,"F18",129,"VK_F18",i,i],[1,116,"F19",77,"F19",130,"VK_F19",i,i],[1,117,"F20",78,"F20",131,"VK_F20",i,i],[1,118,"F21",79,"F21",132,"VK_F21",i,i],[1,119,"F22",80,"F22",133,"VK_F22",i,i],[1,120,"F23",81,"F23",134,"VK_F23",i,i],[1,121,"F24",82,"F24",135,"VK_F24",i,i],[1,122,"Open",0,i,0,i,i,i],[1,123,"Help",0,i,0,i,i,i],[1,124,"Select",0,i,0,i,i,i],[1,125,"Again",0,i,0,i,i,i],[1,126,"Undo",0,i,0,i,i,i],[1,127,"Cut",0,i,0,i,i,i],[1,128,"Copy",0,i,0,i,i,i],[1,129,"Paste",0,i,0,i,i,i],[1,130,"Find",0,i,0,i,i,i],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",i,i],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",i,i],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",i,i],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",i,i],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",i,i],[1,136,"KanaMode",0,i,0,i,i,i],[0,137,"IntlYen",0,i,0,i,i,i],[1,138,"Convert",0,i,0,i,i,i],[1,139,"NonConvert",0,i,0,i,i,i],[1,140,"Lang1",0,i,0,i,i,i],[1,141,"Lang2",0,i,0,i,i,i],[1,142,"Lang3",0,i,0,i,i,i],[1,143,"Lang4",0,i,0,i,i,i],[1,144,"Lang5",0,i,0,i,i,i],[1,145,"Abort",0,i,0,i,i,i],[1,146,"Props",0,i,0,i,i,i],[1,147,"NumpadParenLeft",0,i,0,i,i,i],[1,148,"NumpadParenRight",0,i,0,i,i,i],[1,149,"NumpadBackspace",0,i,0,i,i,i],[1,150,"NumpadMemoryStore",0,i,0,i,i,i],[1,151,"NumpadMemoryRecall",0,i,0,i,i,i],[1,152,"NumpadMemoryClear",0,i,0,i,i,i],[1,153,"NumpadMemoryAdd",0,i,0,i,i,i],[1,154,"NumpadMemorySubtract",0,i,0,i,i,i],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",i,i],[1,156,"NumpadClearEntry",0,i,0,i,i,i],[1,0,i,5,"Ctrl",17,"VK_CONTROL",i,i],[1,0,i,4,"Shift",16,"VK_SHIFT",i,i],[1,0,i,6,"Alt",18,"VK_MENU",i,i],[1,0,i,57,"Meta",91,"VK_COMMAND",i,i],[1,157,"ControlLeft",5,i,0,"VK_LCONTROL",i,i],[1,158,"ShiftLeft",4,i,0,"VK_LSHIFT",i,i],[1,159,"AltLeft",6,i,0,"VK_LMENU",i,i],[1,160,"MetaLeft",57,i,0,"VK_LWIN",i,i],[1,161,"ControlRight",5,i,0,"VK_RCONTROL",i,i],[1,162,"ShiftRight",4,i,0,"VK_RSHIFT",i,i],[1,163,"AltRight",6,i,0,"VK_RMENU",i,i],[1,164,"MetaRight",57,i,0,"VK_RWIN",i,i],[1,165,"BrightnessUp",0,i,0,i,i,i],[1,166,"BrightnessDown",0,i,0,i,i,i],[1,167,"MediaPlay",0,i,0,i,i,i],[1,168,"MediaRecord",0,i,0,i,i,i],[1,169,"MediaFastForward",0,i,0,i,i,i],[1,170,"MediaRewind",0,i,0,i,i,i],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",i,i],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",i,i],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",i,i],[1,174,"Eject",0,i,0,i,i,i],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",i,i],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",i,i],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",i,i],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",i,i],[1,179,"LaunchApp1",0,i,0,"VK_MEDIA_LAUNCH_APP1",i,i],[1,180,"SelectTask",0,i,0,i,i,i],[1,181,"LaunchScreenSaver",0,i,0,i,i,i],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",i,i],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",i,i],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",i,i],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",i,i],[1,186,"BrowserStop",0,i,0,"VK_BROWSER_STOP",i,i],[1,187,"BrowserRefresh",0,i,0,"VK_BROWSER_REFRESH",i,i],[1,188,"BrowserFavorites",0,i,0,"VK_BROWSER_FAVORITES",i,i],[1,189,"ZoomToggle",0,i,0,i,i,i],[1,190,"MailReply",0,i,0,i,i,i],[1,191,"MailForward",0,i,0,i,i,i],[1,192,"MailSend",0,i,0,i,i,i],[1,0,i,114,"KeyInComposition",229,i,i,i],[1,0,i,116,"ABNT_C2",194,"VK_ABNT_C2",i,i],[1,0,i,96,"OEM_8",223,"VK_OEM_8",i,i],[1,0,i,0,i,0,"VK_KANA",i,i],[1,0,i,0,i,0,"VK_HANGUL",i,i],[1,0,i,0,i,0,"VK_JUNJA",i,i],[1,0,i,0,i,0,"VK_FINAL",i,i],[1,0,i,0,i,0,"VK_HANJA",i,i],[1,0,i,0,i,0,"VK_KANJI",i,i],[1,0,i,0,i,0,"VK_CONVERT",i,i],[1,0,i,0,i,0,"VK_NONCONVERT",i,i],[1,0,i,0,i,0,"VK_ACCEPT",i,i],[1,0,i,0,i,0,"VK_MODECHANGE",i,i],[1,0,i,0,i,0,"VK_SELECT",i,i],[1,0,i,0,i,0,"VK_PRINT",i,i],[1,0,i,0,i,0,"VK_EXECUTE",i,i],[1,0,i,0,i,0,"VK_SNAPSHOT",i,i],[1,0,i,0,i,0,"VK_HELP",i,i],[1,0,i,0,i,0,"VK_APPS",i,i],[1,0,i,0,i,0,"VK_PROCESSKEY",i,i],[1,0,i,0,i,0,"VK_PACKET",i,i],[1,0,i,0,i,0,"VK_DBE_SBCSCHAR",i,i],[1,0,i,0,i,0,"VK_DBE_DBCSCHAR",i,i],[1,0,i,0,i,0,"VK_ATTN",i,i],[1,0,i,0,i,0,"VK_CRSEL",i,i],[1,0,i,0,i,0,"VK_EXSEL",i,i],[1,0,i,0,i,0,"VK_EREOF",i,i],[1,0,i,0,i,0,"VK_PLAY",i,i],[1,0,i,0,i,0,"VK_ZOOM",i,i],[1,0,i,0,i,0,"VK_NONAME",i,i],[1,0,i,0,i,0,"VK_PA1",i,i],[1,0,i,0,i,0,"VK_OEM_CLEAR",i,i]],n=[],r=[];for(const s of e){const[o,a,l,c,u,d,h,f,p]=s;if(r[a]||(r[a]=!0,qst[l]=a,Kst[l.toLowerCase()]=a,o&&(Fse[a]=c)),!n[c]){if(n[c]=!0,!u)throw new Error(`String representation missing for key code ${c} around scan code ${l}`);r8.define(c,u),aQ.define(c,f||u),lQ.define(c,p||f||u)}d&&(P2e[d]=c)}})();var W0;(function(i){function e(l){return r8.keyCodeToStr(l)}i.toString=e;function n(l){return r8.strToKeyCode(l)}i.fromString=n;function r(l){return aQ.keyCodeToStr(l)}i.toUserSettingsUS=r;function s(l){return lQ.keyCodeToStr(l)}i.toUserSettingsGeneral=s;function o(l){return aQ.strToKeyCode(l)||lQ.strToKeyCode(l)}i.fromUserSettings=o;function a(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return r8.keyCodeToStr(l)}i.toElectronAccelerator=a})(W0||(W0={}));function ro(i,e){const n=(e&65535)<<16>>>0;return(i|n)>>>0}var Vfe={};let F2;if(typeof Cf.vscode<"u"&&typeof Cf.vscode.process<"u"){const i=Cf.vscode.process;F2={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process<"u"?F2={get platform(){return process.platform},get arch(){return process.arch},get env(){return Vfe},cwd(){return Vfe.VSCODE_CWD||process.cwd()}}:F2={get platform(){return Aa?"win32":ri?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const R9=F2.cwd,O2e=F2.env,Gst=F2.platform,Xst=65,Yst=97,Zst=90,Qst=122,By=46,cl=47,Fu=92,Mb=58,Jst=63;class F2e extends Error{constructor(e,n,r){let s;typeof n=="string"&&n.indexOf("not ")===0?(s="must not be",n=n.replace(/^not /,"")):s="must be";const o=e.indexOf(".")!==-1?"property":"argument";let a=`The "${e}" ${o} ${s} of type ${n}`;a+=`. Received type ${typeof r}`,super(a),this.code="ERR_INVALID_ARG_TYPE"}}function eot(i,e){if(i===null||typeof i!="object")throw new F2e(e,"Object",i)}function Bo(i,e){if(typeof i!="string")throw new F2e(e,"string",i)}const q1=Gst==="win32";function Bi(i){return i===cl||i===Fu}function cQ(i){return i===cl}function Pb(i){return i>=Xst&&i<=Zst||i>=Yst&&i<=Qst}function A9(i,e,n,r){let s="",o=0,a=-1,l=0,c=0;for(let u=0;u<=i.length;++u){if(u<i.length)c=i.charCodeAt(u);else{if(r(c))break;c=cl}if(r(c)){if(!(a===u-1||l===1))if(l===2){if(s.length<2||o!==2||s.charCodeAt(s.length-1)!==By||s.charCodeAt(s.length-2)!==By){if(s.length>2){const d=s.lastIndexOf(n);d===-1?(s="",o=0):(s=s.slice(0,d),o=s.length-1-s.lastIndexOf(n)),a=u,l=0;continue}else if(s.length!==0){s="",o=0,a=u,l=0;continue}}e&&(s+=s.length>0?`${n}..`:"..",o=2)}else s.length>0?s+=`${n}${i.slice(a+1,u)}`:s=i.slice(a+1,u),o=u-a-1;a=u,l=0}else c===By&&l!==-1?++l:l=-1}return s}function B2e(i,e){eot(e,"pathObject");const n=e.dir||e.root,r=e.base||`${e.name||""}${e.ext||""}`;return n?n===e.root?`${n}${r}`:`${n}${i}${r}`:r}const iu={resolve(...i){let e="",n="",r=!1;for(let s=i.length-1;s>=-1;s--){let o;if(s>=0){if(o=i[s],Bo(o,"path"),o.length===0)continue}else e.length===0?o=R9():(o=O2e[`=${e}`]||R9(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Fu)&&(o=`${e}\\`));const a=o.length;let l=0,c="",u=!1;const d=o.charCodeAt(0);if(a===1)Bi(d)&&(l=1,u=!0);else if(Bi(d))if(u=!0,Bi(o.charCodeAt(1))){let h=2,f=h;for(;h<a&&!Bi(o.charCodeAt(h));)h++;if(h<a&&h!==f){const p=o.slice(f,h);for(f=h;h<a&&Bi(o.charCodeAt(h));)h++;if(h<a&&h!==f){for(f=h;h<a&&!Bi(o.charCodeAt(h));)h++;(h===a||h!==f)&&(c=`\\\\${p}\\${o.slice(f,h)}`,l=h)}}}else l=1;else Pb(d)&&o.charCodeAt(1)===Mb&&(c=o.slice(0,2),l=2,a>2&&Bi(o.charCodeAt(2))&&(u=!0,l=3));if(c.length>0)if(e.length>0){if(c.toLowerCase()!==e.toLowerCase())continue}else e=c;if(r){if(e.length>0)break}else if(n=`${o.slice(l)}\\${n}`,r=u,u&&e.length>0)break}return n=A9(n,!r,"\\",Bi),r?`${e}\\${n}`:`${e}${n}`||"."},normalize(i){Bo(i,"path");const e=i.length;if(e===0)return".";let n=0,r,s=!1;const o=i.charCodeAt(0);if(e===1)return cQ(o)?"\\":i;if(Bi(o))if(s=!0,Bi(i.charCodeAt(1))){let l=2,c=l;for(;l<e&&!Bi(i.charCodeAt(l));)l++;if(l<e&&l!==c){const u=i.slice(c,l);for(c=l;l<e&&Bi(i.charCodeAt(l));)l++;if(l<e&&l!==c){for(c=l;l<e&&!Bi(i.charCodeAt(l));)l++;if(l===e)return`\\\\${u}\\${i.slice(c)}\\`;l!==c&&(r=`\\\\${u}\\${i.slice(c,l)}`,n=l)}}}else n=1;else Pb(o)&&i.charCodeAt(1)===Mb&&(r=i.slice(0,2),n=2,e>2&&Bi(i.charCodeAt(2))&&(s=!0,n=3));let a=n<e?A9(i.slice(n),!s,"\\",Bi):"";return a.length===0&&!s&&(a="."),a.length>0&&Bi(i.charCodeAt(e-1))&&(a+="\\"),r===void 0?s?`\\${a}`:a:s?`${r}\\${a}`:`${r}${a}`},isAbsolute(i){Bo(i,"path");const e=i.length;if(e===0)return!1;const n=i.charCodeAt(0);return Bi(n)||e>2&&Pb(n)&&i.charCodeAt(1)===Mb&&Bi(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,n;for(let o=0;o<i.length;++o){const a=i[o];Bo(a,"path"),a.length>0&&(e===void 0?e=n=a:e+=`\\${a}`)}if(e===void 0)return".";let r=!0,s=0;if(typeof n=="string"&&Bi(n.charCodeAt(0))){++s;const o=n.length;o>1&&Bi(n.charCodeAt(1))&&(++s,o>2&&(Bi(n.charCodeAt(2))?++s:r=!1))}if(r){for(;s<e.length&&Bi(e.charCodeAt(s));)s++;s>=2&&(e=`\\${e.slice(s)}`)}return iu.normalize(e)},relative(i,e){if(Bo(i,"from"),Bo(e,"to"),i===e)return"";const n=iu.resolve(i),r=iu.resolve(e);if(n===r||(i=n.toLowerCase(),e=r.toLowerCase(),i===e))return"";let s=0;for(;s<i.length&&i.charCodeAt(s)===Fu;)s++;let o=i.length;for(;o-1>s&&i.charCodeAt(o-1)===Fu;)o--;const a=o-s;let l=0;for(;l<e.length&&e.charCodeAt(l)===Fu;)l++;let c=e.length;for(;c-1>l&&e.charCodeAt(c-1)===Fu;)c--;const u=c-l,d=a<u?a:u;let h=-1,f=0;for(;f<d;f++){const g=i.charCodeAt(s+f);if(g!==e.charCodeAt(l+f))break;g===Fu&&(h=f)}if(f!==d){if(h===-1)return r}else{if(u>d){if(e.charCodeAt(l+f)===Fu)return r.slice(l+f+1);if(f===2)return r.slice(l+f)}a>d&&(i.charCodeAt(s+f)===Fu?h=f:f===2&&(h=3)),h===-1&&(h=0)}let p="";for(f=s+h+1;f<=o;++f)(f===o||i.charCodeAt(f)===Fu)&&(p+=p.length===0?"..":"\\..");return l+=h,p.length>0?`${p}${r.slice(l,c)}`:(r.charCodeAt(l)===Fu&&++l,r.slice(l,c))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=iu.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===Fu){if(e.charCodeAt(1)===Fu){const n=e.charCodeAt(2);if(n!==Jst&&n!==By)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Pb(e.charCodeAt(0))&&e.charCodeAt(1)===Mb&&e.charCodeAt(2)===Fu)return`\\\\?\\${e}`;return i},dirname(i){Bo(i,"path");const e=i.length;if(e===0)return".";let n=-1,r=0;const s=i.charCodeAt(0);if(e===1)return Bi(s)?i:".";if(Bi(s)){if(n=r=1,Bi(i.charCodeAt(1))){let l=2,c=l;for(;l<e&&!Bi(i.charCodeAt(l));)l++;if(l<e&&l!==c){for(c=l;l<e&&Bi(i.charCodeAt(l));)l++;if(l<e&&l!==c){for(c=l;l<e&&!Bi(i.charCodeAt(l));)l++;if(l===e)return i;l!==c&&(n=r=l+1)}}}}else Pb(s)&&i.charCodeAt(1)===Mb&&(n=e>2&&Bi(i.charCodeAt(2))?3:2,r=n);let o=-1,a=!0;for(let l=e-1;l>=r;--l)if(Bi(i.charCodeAt(l))){if(!a){o=l;break}}else a=!1;if(o===-1){if(n===-1)return".";o=n}return i.slice(0,o)},basename(i,e){e!==void 0&&Bo(e,"ext"),Bo(i,"path");let n=0,r=-1,s=!0,o;if(i.length>=2&&Pb(i.charCodeAt(0))&&i.charCodeAt(1)===Mb&&(n=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let a=e.length-1,l=-1;for(o=i.length-1;o>=n;--o){const c=i.charCodeAt(o);if(Bi(c)){if(!s){n=o+1;break}}else l===-1&&(s=!1,l=o+1),a>=0&&(c===e.charCodeAt(a)?--a===-1&&(r=o):(a=-1,r=l))}return n===r?r=l:r===-1&&(r=i.length),i.slice(n,r)}for(o=i.length-1;o>=n;--o)if(Bi(i.charCodeAt(o))){if(!s){n=o+1;break}}else r===-1&&(s=!1,r=o+1);return r===-1?"":i.slice(n,r)},extname(i){Bo(i,"path");let e=0,n=-1,r=0,s=-1,o=!0,a=0;i.length>=2&&i.charCodeAt(1)===Mb&&Pb(i.charCodeAt(0))&&(e=r=2);for(let l=i.length-1;l>=e;--l){const c=i.charCodeAt(l);if(Bi(c)){if(!o){r=l+1;break}continue}s===-1&&(o=!1,s=l+1),c===By?n===-1?n=l:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===r+1?"":i.slice(n,s)},format:B2e.bind(null,"\\"),parse(i){Bo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const n=i.length;let r=0,s=i.charCodeAt(0);if(n===1)return Bi(s)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(Bi(s)){if(r=1,Bi(i.charCodeAt(1))){let h=2,f=h;for(;h<n&&!Bi(i.charCodeAt(h));)h++;if(h<n&&h!==f){for(f=h;h<n&&Bi(i.charCodeAt(h));)h++;if(h<n&&h!==f){for(f=h;h<n&&!Bi(i.charCodeAt(h));)h++;h===n?r=h:h!==f&&(r=h+1)}}}}else if(Pb(s)&&i.charCodeAt(1)===Mb){if(n<=2)return e.root=e.dir=i,e;if(r=2,Bi(i.charCodeAt(2))){if(n===3)return e.root=e.dir=i,e;r=3}}r>0&&(e.root=i.slice(0,r));let o=-1,a=r,l=-1,c=!0,u=i.length-1,d=0;for(;u>=r;--u){if(s=i.charCodeAt(u),Bi(s)){if(!c){a=u+1;break}continue}l===-1&&(c=!1,l=u+1),s===By?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return l!==-1&&(o===-1||d===0||d===1&&o===l-1&&o===a+1?e.base=e.name=i.slice(a,l):(e.name=i.slice(a,o),e.base=i.slice(a,l),e.ext=i.slice(o,l))),a>0&&a!==r?e.dir=i.slice(0,a-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},tot=(()=>{if(q1){const i=/\\/g;return()=>{const e=R9().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>R9()})(),to={resolve(...i){let e="",n=!1;for(let r=i.length-1;r>=-1&&!n;r--){const s=r>=0?i[r]:tot();Bo(s,"path"),s.length!==0&&(e=`${s}/${e}`,n=s.charCodeAt(0)===cl)}return e=A9(e,!n,"/",cQ),n?`/${e}`:e.length>0?e:"."},normalize(i){if(Bo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===cl,n=i.charCodeAt(i.length-1)===cl;return i=A9(i,!e,"/",cQ),i.length===0?e?"/":n?"./":".":(n&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return Bo(i,"path"),i.length>0&&i.charCodeAt(0)===cl},join(...i){if(i.length===0)return".";let e;for(let n=0;n<i.length;++n){const r=i[n];Bo(r,"path"),r.length>0&&(e===void 0?e=r:e+=`/${r}`)}return e===void 0?".":to.normalize(e)},relative(i,e){if(Bo(i,"from"),Bo(e,"to"),i===e||(i=to.resolve(i),e=to.resolve(e),i===e))return"";const n=1,r=i.length,s=r-n,o=1,a=e.length-o,l=s<a?s:a;let c=-1,u=0;for(;u<l;u++){const h=i.charCodeAt(n+u);if(h!==e.charCodeAt(o+u))break;h===cl&&(c=u)}if(u===l)if(a>l){if(e.charCodeAt(o+u)===cl)return e.slice(o+u+1);if(u===0)return e.slice(o+u)}else s>l&&(i.charCodeAt(n+u)===cl?c=u:u===0&&(c=0));let d="";for(u=n+c+1;u<=r;++u)(u===r||i.charCodeAt(u)===cl)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+c)}`},toNamespacedPath(i){return i},dirname(i){if(Bo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===cl;let n=-1,r=!0;for(let s=i.length-1;s>=1;--s)if(i.charCodeAt(s)===cl){if(!r){n=s;break}}else r=!1;return n===-1?e?"/":".":e&&n===1?"//":i.slice(0,n)},basename(i,e){e!==void 0&&Bo(e,"ext"),Bo(i,"path");let n=0,r=-1,s=!0,o;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let a=e.length-1,l=-1;for(o=i.length-1;o>=0;--o){const c=i.charCodeAt(o);if(c===cl){if(!s){n=o+1;break}}else l===-1&&(s=!1,l=o+1),a>=0&&(c===e.charCodeAt(a)?--a===-1&&(r=o):(a=-1,r=l))}return n===r?r=l:r===-1&&(r=i.length),i.slice(n,r)}for(o=i.length-1;o>=0;--o)if(i.charCodeAt(o)===cl){if(!s){n=o+1;break}}else r===-1&&(s=!1,r=o+1);return r===-1?"":i.slice(n,r)},extname(i){Bo(i,"path");let e=-1,n=0,r=-1,s=!0,o=0;for(let a=i.length-1;a>=0;--a){const l=i.charCodeAt(a);if(l===cl){if(!s){n=a+1;break}continue}r===-1&&(s=!1,r=a+1),l===By?e===-1?e=a:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||r===-1||o===0||o===1&&e===r-1&&e===n+1?"":i.slice(e,r)},format:B2e.bind(null,"/"),parse(i){Bo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const n=i.charCodeAt(0)===cl;let r;n?(e.root="/",r=1):r=0;let s=-1,o=0,a=-1,l=!0,c=i.length-1,u=0;for(;c>=r;--c){const d=i.charCodeAt(c);if(d===cl){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),d===By?s===-1?s=c:u!==1&&(u=1):s!==-1&&(u=-1)}if(a!==-1){const d=o===0&&n?1:o;s===-1||u===0||u===1&&s===a-1&&s===o+1?e.base=e.name=i.slice(d,a):(e.name=i.slice(d,s),e.base=i.slice(d,a),e.ext=i.slice(s,a))}return o>0?e.dir=i.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};to.win32=iu.win32=iu;to.posix=iu.posix=to;const j2e=q1?iu.normalize:to.normalize,not=q1?iu.resolve:to.resolve,iot=q1?iu.relative:to.relative,W2e=q1?iu.dirname:to.dirname,jy=q1?iu.basename:to.basename,rot=q1?iu.extname:to.extname,Wp=q1?iu.sep:to.sep,sot=/^\w[\w\d+.-]*$/,oot=/^\//,aot=/^\/\//;function lot(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!sot.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!oot.test(i.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(aot.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function cot(i,e){return!i&&!e?"file":i}function uot(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==Sp&&(e=Sp+e):e=Sp;break}return e}const Es="",Sp="/",dot=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Jt{static isUri(e){return e instanceof Jt?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,n,r,s,o,a=!1){typeof e=="object"?(this.scheme=e.scheme||Es,this.authority=e.authority||Es,this.path=e.path||Es,this.query=e.query||Es,this.fragment=e.fragment||Es):(this.scheme=cot(e,a),this.authority=n||Es,this.path=uot(this.scheme,r||Es),this.query=s||Es,this.fragment=o||Es,lot(this,a))}get fsPath(){return N9(this,!1)}with(e){if(!e)return this;let{scheme:n,authority:r,path:s,query:o,fragment:a}=e;return n===void 0?n=this.scheme:n===null&&(n=Es),r===void 0?r=this.authority:r===null&&(r=Es),s===void 0?s=this.path:s===null&&(s=Es),o===void 0?o=this.query:o===null&&(o=Es),a===void 0?a=this.fragment:a===null&&(a=Es),n===this.scheme&&r===this.authority&&s===this.path&&o===this.query&&a===this.fragment?this:new GL(n,r,s,o,a)}static parse(e,n=!1){const r=dot.exec(e);return r?new GL(r[2]||Es,P3(r[4]||Es),P3(r[5]||Es),P3(r[7]||Es),P3(r[9]||Es),n):new GL(Es,Es,Es,Es,Es)}static file(e){let n=Es;if(Aa&&(e=e.replace(/\\/g,Sp)),e[0]===Sp&&e[1]===Sp){const r=e.indexOf(Sp,2);r===-1?(n=e.substring(2),e=Sp):(n=e.substring(2,r),e=e.substring(r)||Sp)}return new GL("file",n,e,Es,Es)}static from(e,n){return new GL(e.scheme,e.authority,e.path,e.query,e.fragment,n)}static joinPath(e,...n){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let r;return Aa&&e.scheme==="file"?r=Jt.file(iu.join(N9(e,!0),...n)).path:r=to.join(e.path,...n),e.with({path:r})}toString(e=!1){return uQ(this,e)}toJSON(){return this}static revive(e){var n,r;if(e){if(e instanceof Jt)return e;{const s=new GL(e);return s._formatted=(n=e.external)!==null&&n!==void 0?n:null,s._fsPath=e._sep===$2e&&(r=e.fsPath)!==null&&r!==void 0?r:null,s}}else return e}}const $2e=Aa?1:void 0;let GL=class extends Jt{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=N9(this,!1)),this._fsPath}toString(e=!1){return e?uQ(this,!0):(this._formatted||(this._formatted=uQ(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=$2e),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const z2e={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function Hfe(i,e,n){let r,s=-1;for(let o=0;o<i.length;o++){const a=i.charCodeAt(o);if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||a===45||a===46||a===95||a===126||e&&a===47||n&&a===91||n&&a===93||n&&a===58)s!==-1&&(r+=encodeURIComponent(i.substring(s,o)),s=-1),r!==void 0&&(r+=i.charAt(o));else{r===void 0&&(r=i.substr(0,o));const l=z2e[a];l!==void 0?(s!==-1&&(r+=encodeURIComponent(i.substring(s,o)),s=-1),r+=l):s===-1&&(s=o)}}return s!==-1&&(r+=encodeURIComponent(i.substring(s))),r!==void 0?r:i}function hot(i){let e;for(let n=0;n<i.length;n++){const r=i.charCodeAt(n);r===35||r===63?(e===void 0&&(e=i.substr(0,n)),e+=z2e[r]):e!==void 0&&(e+=i[n])}return e!==void 0?e:i}function N9(i,e){let n;return i.authority&&i.path.length>1&&i.scheme==="file"?n=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?n=i.path.substr(1):n=i.path[1].toLowerCase()+i.path.substr(2):n=i.path,Aa&&(n=n.replace(/\//g,"\\")),n}function uQ(i,e){const n=e?hot:Hfe;let r="",{scheme:s,authority:o,path:a,query:l,fragment:c}=i;if(s&&(r+=s,r+=":"),(o||s==="file")&&(r+=Sp,r+=Sp),o){let u=o.indexOf("@");if(u!==-1){const d=o.substr(0,u);o=o.substr(u+1),u=d.lastIndexOf(":"),u===-1?r+=n(d,!1,!1):(r+=n(d.substr(0,u),!1,!1),r+=":",r+=n(d.substr(u+1),!1,!0)),r+="@"}o=o.toLowerCase(),u=o.lastIndexOf(":"),u===-1?r+=n(o,!1,!0):(r+=n(o.substr(0,u),!1,!0),r+=o.substr(u))}if(a){if(a.length>=3&&a.charCodeAt(0)===47&&a.charCodeAt(2)===58){const u=a.charCodeAt(1);u>=65&&u<=90&&(a=`/${String.fromCharCode(u+32)}:${a.substr(3)}`)}else if(a.length>=2&&a.charCodeAt(1)===58){const u=a.charCodeAt(0);u>=65&&u<=90&&(a=`${String.fromCharCode(u+32)}:${a.substr(2)}`)}r+=n(a,!0,!1)}return l&&(r+="?",r+=n(l,!1,!1)),c&&(r+="#",r+=e?c:Hfe(c,!1,!1)),r}function V2e(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+V2e(i.substr(3)):i}}const Ufe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function P3(i){return i.match(Ufe)?i.replace(Ufe,e=>V2e(e)):i}let ve=class NC{constructor(e,n){this.lineNumber=e,this.column=n}with(e=this.lineNumber,n=this.column){return e===this.lineNumber&&n===this.column?this:new NC(e,n)}delta(e=0,n=0){return this.with(this.lineNumber+e,this.column+n)}equals(e){return NC.equals(this,e)}static equals(e,n){return!e&&!n?!0:!!e&&!!n&&e.lineNumber===n.lineNumber&&e.column===n.column}isBefore(e){return NC.isBefore(this,e)}static isBefore(e,n){return e.lineNumber<n.lineNumber?!0:n.lineNumber<e.lineNumber?!1:e.column<n.column}isBeforeOrEqual(e){return NC.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,n){return e.lineNumber<n.lineNumber?!0:n.lineNumber<e.lineNumber?!1:e.column<=n.column}static compare(e,n){const r=e.lineNumber|0,s=n.lineNumber|0;if(r===s){const o=e.column|0,a=n.column|0;return o-a}return r-s}clone(){return new NC(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new NC(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}},J=class Yo{constructor(e,n,r,s){e>r||e===r&&n>s?(this.startLineNumber=r,this.startColumn=s,this.endLineNumber=e,this.endColumn=n):(this.startLineNumber=e,this.startColumn=n,this.endLineNumber=r,this.endColumn=s)}isEmpty(){return Yo.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Yo.containsPosition(this,e)}static containsPosition(e,n){return!(n.lineNumber<e.startLineNumber||n.lineNumber>e.endLineNumber||n.lineNumber===e.startLineNumber&&n.column<e.startColumn||n.lineNumber===e.endLineNumber&&n.column>e.endColumn)}static strictContainsPosition(e,n){return!(n.lineNumber<e.startLineNumber||n.lineNumber>e.endLineNumber||n.lineNumber===e.startLineNumber&&n.column<=e.startColumn||n.lineNumber===e.endLineNumber&&n.column>=e.endColumn)}containsRange(e){return Yo.containsRange(this,e)}static containsRange(e,n){return!(n.startLineNumber<e.startLineNumber||n.endLineNumber<e.startLineNumber||n.startLineNumber>e.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumn<e.startColumn||n.endLineNumber===e.endLineNumber&&n.endColumn>e.endColumn)}strictContainsRange(e){return Yo.strictContainsRange(this,e)}static strictContainsRange(e,n){return!(n.startLineNumber<e.startLineNumber||n.endLineNumber<e.startLineNumber||n.startLineNumber>e.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumn<=e.startColumn||n.endLineNumber===e.endLineNumber&&n.endColumn>=e.endColumn)}plusRange(e){return Yo.plusRange(this,e)}static plusRange(e,n){let r,s,o,a;return n.startLineNumber<e.startLineNumber?(r=n.startLineNumber,s=n.startColumn):n.startLineNumber===e.startLineNumber?(r=n.startLineNumber,s=Math.min(n.startColumn,e.startColumn)):(r=e.startLineNumber,s=e.startColumn),n.endLineNumber>e.endLineNumber?(o=n.endLineNumber,a=n.endColumn):n.endLineNumber===e.endLineNumber?(o=n.endLineNumber,a=Math.max(n.endColumn,e.endColumn)):(o=e.endLineNumber,a=e.endColumn),new Yo(r,s,o,a)}intersectRanges(e){return Yo.intersectRanges(this,e)}static intersectRanges(e,n){let r=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,a=e.endColumn;const l=n.startLineNumber,c=n.startColumn,u=n.endLineNumber,d=n.endColumn;return r<l?(r=l,s=c):r===l&&(s=Math.max(s,c)),o>u?(o=u,a=d):o===u&&(a=Math.min(a,d)),r>o||r===o&&s>a?null:new Yo(r,s,o,a)}equalsRange(e){return Yo.equalsRange(this,e)}static equalsRange(e,n){return!e&&!n?!0:!!e&&!!n&&e.startLineNumber===n.startLineNumber&&e.startColumn===n.startColumn&&e.endLineNumber===n.endLineNumber&&e.endColumn===n.endColumn}getEndPosition(){return Yo.getEndPosition(this)}static getEndPosition(e){return new ve(e.endLineNumber,e.endColumn)}getStartPosition(){return Yo.getStartPosition(this)}static getStartPosition(e){return new ve(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,n){return new Yo(this.startLineNumber,this.startColumn,e,n)}setStartPosition(e,n){return new Yo(e,n,this.endLineNumber,this.endColumn)}collapseToStart(){return Yo.collapseToStart(this)}static collapseToStart(e){return new Yo(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Yo.collapseToEnd(this)}static collapseToEnd(e){return new Yo(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Yo(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,n=e){return new Yo(e.lineNumber,e.column,n.lineNumber,n.column)}static lift(e){return e?new Yo(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,n){return!(e.endLineNumber<n.startLineNumber||e.endLineNumber===n.startLineNumber&&e.endColumn<n.startColumn||n.endLineNumber<e.startLineNumber||n.endLineNumber===e.startLineNumber&&n.endColumn<e.startColumn)}static areIntersecting(e,n){return!(e.endLineNumber<n.startLineNumber||e.endLineNumber===n.startLineNumber&&e.endColumn<=n.startColumn||n.endLineNumber<e.startLineNumber||n.endLineNumber===e.startLineNumber&&n.endColumn<=e.startColumn)}static compareRangesUsingStarts(e,n){if(e&&n){const o=e.startLineNumber|0,a=n.startLineNumber|0;if(o===a){const l=e.startColumn|0,c=n.startColumn|0;if(l===c){const u=e.endLineNumber|0,d=n.endLineNumber|0;if(u===d){const h=e.endColumn|0,f=n.endColumn|0;return h-f}return u-d}return l-c}return o-a}return(e?1:0)-(n?1:0)}static compareRangesUsingEnds(e,n){return e.endLineNumber===n.endLineNumber?e.endColumn===n.endColumn?e.startLineNumber===n.startLineNumber?e.startColumn-n.startColumn:e.startLineNumber-n.startLineNumber:e.endColumn-n.endColumn:e.endLineNumber-n.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}},Ft=class Xh extends J{constructor(e,n,r,s){super(e,n,r,s),this.selectionStartLineNumber=e,this.selectionStartColumn=n,this.positionLineNumber=r,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Xh.selectionsEqual(this,e)}static selectionsEqual(e,n){return e.selectionStartLineNumber===n.selectionStartLineNumber&&e.selectionStartColumn===n.selectionStartColumn&&e.positionLineNumber===n.positionLineNumber&&e.positionColumn===n.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,n){return this.getDirection()===0?new Xh(this.startLineNumber,this.startColumn,e,n):new Xh(e,n,this.startLineNumber,this.startColumn)}getPosition(){return new ve(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new ve(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,n){return this.getDirection()===0?new Xh(e,n,this.endLineNumber,this.endColumn):new Xh(this.endLineNumber,this.endColumn,e,n)}static fromPositions(e,n=e){return new Xh(e.lineNumber,e.column,n.lineNumber,n.column)}static fromRange(e,n){return n===0?new Xh(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Xh(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Xh(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,n){if(e&&!n||!e&&n)return!1;if(!e&&!n)return!0;if(e.length!==n.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!this.selectionsEqual(e[r],n[r]))return!1;return!0}static isISelection(e){return e&&typeof e.selectionStartLineNumber=="number"&&typeof e.selectionStartColumn=="number"&&typeof e.positionLineNumber=="number"&&typeof e.positionColumn=="number"}static createWithDirection(e,n,r,s,o){return o===0?new Xh(e,n,r,s):new Xh(r,s,e,n)}};const dQ=Object.create(null);function G(i,e){if(zl(e)){const n=dQ[e];if(n===void 0)throw new Error(`${i} references an unknown codicon: ${e}`);e=n}return dQ[i]=e,{id:i}}function H2e(){return dQ}const lt={add:G("add",6e4),plus:G("plus",6e4),gistNew:G("gist-new",6e4),repoCreate:G("repo-create",6e4),lightbulb:G("lightbulb",60001),lightBulb:G("light-bulb",60001),repo:G("repo",60002),repoDelete:G("repo-delete",60002),gistFork:G("gist-fork",60003),repoForked:G("repo-forked",60003),gitPullRequest:G("git-pull-request",60004),gitPullRequestAbandoned:G("git-pull-request-abandoned",60004),recordKeys:G("record-keys",60005),keyboard:G("keyboard",60005),tag:G("tag",60006),tagAdd:G("tag-add",60006),tagRemove:G("tag-remove",60006),gitPullRequestLabel:G("git-pull-request-label",60006),person:G("person",60007),personFollow:G("person-follow",60007),personOutline:G("person-outline",60007),personFilled:G("person-filled",60007),gitBranch:G("git-branch",60008),gitBranchCreate:G("git-branch-create",60008),gitBranchDelete:G("git-branch-delete",60008),sourceControl:G("source-control",60008),mirror:G("mirror",60009),mirrorPublic:G("mirror-public",60009),star:G("star",60010),starAdd:G("star-add",60010),starDelete:G("star-delete",60010),starEmpty:G("star-empty",60010),comment:G("comment",60011),commentAdd:G("comment-add",60011),alert:G("alert",60012),warning:G("warning",60012),search:G("search",60013),searchSave:G("search-save",60013),logOut:G("log-out",60014),signOut:G("sign-out",60014),logIn:G("log-in",60015),signIn:G("sign-in",60015),eye:G("eye",60016),eyeUnwatch:G("eye-unwatch",60016),eyeWatch:G("eye-watch",60016),circleFilled:G("circle-filled",60017),primitiveDot:G("primitive-dot",60017),closeDirty:G("close-dirty",60017),debugBreakpoint:G("debug-breakpoint",60017),debugBreakpointDisabled:G("debug-breakpoint-disabled",60017),debugHint:G("debug-hint",60017),primitiveSquare:G("primitive-square",60018),edit:G("edit",60019),pencil:G("pencil",60019),info:G("info",60020),issueOpened:G("issue-opened",60020),gistPrivate:G("gist-private",60021),gitForkPrivate:G("git-fork-private",60021),lock:G("lock",60021),mirrorPrivate:G("mirror-private",60021),close:G("close",60022),removeClose:G("remove-close",60022),x:G("x",60022),repoSync:G("repo-sync",60023),sync:G("sync",60023),clone:G("clone",60024),desktopDownload:G("desktop-download",60024),beaker:G("beaker",60025),microscope:G("microscope",60025),vm:G("vm",60026),deviceDesktop:G("device-desktop",60026),file:G("file",60027),fileText:G("file-text",60027),more:G("more",60028),ellipsis:G("ellipsis",60028),kebabHorizontal:G("kebab-horizontal",60028),mailReply:G("mail-reply",60029),reply:G("reply",60029),organization:G("organization",60030),organizationFilled:G("organization-filled",60030),organizationOutline:G("organization-outline",60030),newFile:G("new-file",60031),fileAdd:G("file-add",60031),newFolder:G("new-folder",60032),fileDirectoryCreate:G("file-directory-create",60032),trash:G("trash",60033),trashcan:G("trashcan",60033),history:G("history",60034),clock:G("clock",60034),folder:G("folder",60035),fileDirectory:G("file-directory",60035),symbolFolder:G("symbol-folder",60035),logoGithub:G("logo-github",60036),markGithub:G("mark-github",60036),github:G("github",60036),terminal:G("terminal",60037),console:G("console",60037),repl:G("repl",60037),zap:G("zap",60038),symbolEvent:G("symbol-event",60038),error:G("error",60039),stop:G("stop",60039),variable:G("variable",60040),symbolVariable:G("symbol-variable",60040),array:G("array",60042),symbolArray:G("symbol-array",60042),symbolModule:G("symbol-module",60043),symbolPackage:G("symbol-package",60043),symbolNamespace:G("symbol-namespace",60043),symbolObject:G("symbol-object",60043),symbolMethod:G("symbol-method",60044),symbolFunction:G("symbol-function",60044),symbolConstructor:G("symbol-constructor",60044),symbolBoolean:G("symbol-boolean",60047),symbolNull:G("symbol-null",60047),symbolNumeric:G("symbol-numeric",60048),symbolNumber:G("symbol-number",60048),symbolStructure:G("symbol-structure",60049),symbolStruct:G("symbol-struct",60049),symbolParameter:G("symbol-parameter",60050),symbolTypeParameter:G("symbol-type-parameter",60050),symbolKey:G("symbol-key",60051),symbolText:G("symbol-text",60051),symbolReference:G("symbol-reference",60052),goToFile:G("go-to-file",60052),symbolEnum:G("symbol-enum",60053),symbolValue:G("symbol-value",60053),symbolRuler:G("symbol-ruler",60054),symbolUnit:G("symbol-unit",60054),activateBreakpoints:G("activate-breakpoints",60055),archive:G("archive",60056),arrowBoth:G("arrow-both",60057),arrowDown:G("arrow-down",60058),arrowLeft:G("arrow-left",60059),arrowRight:G("arrow-right",60060),arrowSmallDown:G("arrow-small-down",60061),arrowSmallLeft:G("arrow-small-left",60062),arrowSmallRight:G("arrow-small-right",60063),arrowSmallUp:G("arrow-small-up",60064),arrowUp:G("arrow-up",60065),bell:G("bell",60066),bold:G("bold",60067),book:G("book",60068),bookmark:G("bookmark",60069),debugBreakpointConditionalUnverified:G("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:G("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:G("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:G("debug-breakpoint-data-unverified",60072),debugBreakpointData:G("debug-breakpoint-data",60073),debugBreakpointDataDisabled:G("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:G("debug-breakpoint-log-unverified",60074),debugBreakpointLog:G("debug-breakpoint-log",60075),debugBreakpointLogDisabled:G("debug-breakpoint-log-disabled",60075),briefcase:G("briefcase",60076),broadcast:G("broadcast",60077),browser:G("browser",60078),bug:G("bug",60079),calendar:G("calendar",60080),caseSensitive:G("case-sensitive",60081),check:G("check",60082),checklist:G("checklist",60083),chevronDown:G("chevron-down",60084),dropDownButton:G("drop-down-button",60084),chevronLeft:G("chevron-left",60085),chevronRight:G("chevron-right",60086),chevronUp:G("chevron-up",60087),chromeClose:G("chrome-close",60088),chromeMaximize:G("chrome-maximize",60089),chromeMinimize:G("chrome-minimize",60090),chromeRestore:G("chrome-restore",60091),circle:G("circle",60092),circleOutline:G("circle-outline",60092),debugBreakpointUnverified:G("debug-breakpoint-unverified",60092),circleSlash:G("circle-slash",60093),circuitBoard:G("circuit-board",60094),clearAll:G("clear-all",60095),clippy:G("clippy",60096),closeAll:G("close-all",60097),cloudDownload:G("cloud-download",60098),cloudUpload:G("cloud-upload",60099),code:G("code",60100),collapseAll:G("collapse-all",60101),colorMode:G("color-mode",60102),commentDiscussion:G("comment-discussion",60103),compareChanges:G("compare-changes",60157),creditCard:G("credit-card",60105),dash:G("dash",60108),dashboard:G("dashboard",60109),database:G("database",60110),debugContinue:G("debug-continue",60111),debugDisconnect:G("debug-disconnect",60112),debugPause:G("debug-pause",60113),debugRestart:G("debug-restart",60114),debugStart:G("debug-start",60115),debugStepInto:G("debug-step-into",60116),debugStepOut:G("debug-step-out",60117),debugStepOver:G("debug-step-over",60118),debugStop:G("debug-stop",60119),debug:G("debug",60120),deviceCameraVideo:G("device-camera-video",60121),deviceCamera:G("device-camera",60122),deviceMobile:G("device-mobile",60123),diffAdded:G("diff-added",60124),diffIgnored:G("diff-ignored",60125),diffModified:G("diff-modified",60126),diffRemoved:G("diff-removed",60127),diffRenamed:G("diff-renamed",60128),diff:G("diff",60129),discard:G("discard",60130),editorLayout:G("editor-layout",60131),emptyWindow:G("empty-window",60132),exclude:G("exclude",60133),extensions:G("extensions",60134),eyeClosed:G("eye-closed",60135),fileBinary:G("file-binary",60136),fileCode:G("file-code",60137),fileMedia:G("file-media",60138),filePdf:G("file-pdf",60139),fileSubmodule:G("file-submodule",60140),fileSymlinkDirectory:G("file-symlink-directory",60141),fileSymlinkFile:G("file-symlink-file",60142),fileZip:G("file-zip",60143),files:G("files",60144),filter:G("filter",60145),flame:G("flame",60146),foldDown:G("fold-down",60147),foldUp:G("fold-up",60148),fold:G("fold",60149),folderActive:G("folder-active",60150),folderOpened:G("folder-opened",60151),gear:G("gear",60152),gift:G("gift",60153),gistSecret:G("gist-secret",60154),gist:G("gist",60155),gitCommit:G("git-commit",60156),gitCompare:G("git-compare",60157),gitMerge:G("git-merge",60158),githubAction:G("github-action",60159),githubAlt:G("github-alt",60160),globe:G("globe",60161),grabber:G("grabber",60162),graph:G("graph",60163),gripper:G("gripper",60164),heart:G("heart",60165),home:G("home",60166),horizontalRule:G("horizontal-rule",60167),hubot:G("hubot",60168),inbox:G("inbox",60169),issueClosed:G("issue-closed",60324),issueReopened:G("issue-reopened",60171),issues:G("issues",60172),italic:G("italic",60173),jersey:G("jersey",60174),json:G("json",60175),bracket:G("bracket",60175),kebabVertical:G("kebab-vertical",60176),key:G("key",60177),law:G("law",60178),lightbulbAutofix:G("lightbulb-autofix",60179),linkExternal:G("link-external",60180),link:G("link",60181),listOrdered:G("list-ordered",60182),listUnordered:G("list-unordered",60183),liveShare:G("live-share",60184),loading:G("loading",60185),location:G("location",60186),mailRead:G("mail-read",60187),mail:G("mail",60188),markdown:G("markdown",60189),megaphone:G("megaphone",60190),mention:G("mention",60191),milestone:G("milestone",60192),gitPullRequestMilestone:G("git-pull-request-milestone",60192),mortarBoard:G("mortar-board",60193),move:G("move",60194),multipleWindows:G("multiple-windows",60195),mute:G("mute",60196),noNewline:G("no-newline",60197),note:G("note",60198),octoface:G("octoface",60199),openPreview:G("open-preview",60200),package:G("package",60201),paintcan:G("paintcan",60202),pin:G("pin",60203),play:G("play",60204),run:G("run",60204),plug:G("plug",60205),preserveCase:G("preserve-case",60206),preview:G("preview",60207),project:G("project",60208),pulse:G("pulse",60209),question:G("question",60210),quote:G("quote",60211),radioTower:G("radio-tower",60212),reactions:G("reactions",60213),references:G("references",60214),refresh:G("refresh",60215),regex:G("regex",60216),remoteExplorer:G("remote-explorer",60217),remote:G("remote",60218),remove:G("remove",60219),replaceAll:G("replace-all",60220),replace:G("replace",60221),repoClone:G("repo-clone",60222),repoForcePush:G("repo-force-push",60223),repoPull:G("repo-pull",60224),repoPush:G("repo-push",60225),report:G("report",60226),requestChanges:G("request-changes",60227),rocket:G("rocket",60228),rootFolderOpened:G("root-folder-opened",60229),rootFolder:G("root-folder",60230),rss:G("rss",60231),ruby:G("ruby",60232),saveAll:G("save-all",60233),saveAs:G("save-as",60234),save:G("save",60235),screenFull:G("screen-full",60236),screenNormal:G("screen-normal",60237),searchStop:G("search-stop",60238),server:G("server",60240),settingsGear:G("settings-gear",60241),settings:G("settings",60242),shield:G("shield",60243),smiley:G("smiley",60244),sortPrecedence:G("sort-precedence",60245),splitHorizontal:G("split-horizontal",60246),splitVertical:G("split-vertical",60247),squirrel:G("squirrel",60248),starFull:G("star-full",60249),starHalf:G("star-half",60250),symbolClass:G("symbol-class",60251),symbolColor:G("symbol-color",60252),symbolCustomColor:G("symbol-customcolor",60252),symbolConstant:G("symbol-constant",60253),symbolEnumMember:G("symbol-enum-member",60254),symbolField:G("symbol-field",60255),symbolFile:G("symbol-file",60256),symbolInterface:G("symbol-interface",60257),symbolKeyword:G("symbol-keyword",60258),symbolMisc:G("symbol-misc",60259),symbolOperator:G("symbol-operator",60260),symbolProperty:G("symbol-property",60261),wrench:G("wrench",60261),wrenchSubaction:G("wrench-subaction",60261),symbolSnippet:G("symbol-snippet",60262),tasklist:G("tasklist",60263),telescope:G("telescope",60264),textSize:G("text-size",60265),threeBars:G("three-bars",60266),thumbsdown:G("thumbsdown",60267),thumbsup:G("thumbsup",60268),tools:G("tools",60269),triangleDown:G("triangle-down",60270),triangleLeft:G("triangle-left",60271),triangleRight:G("triangle-right",60272),triangleUp:G("triangle-up",60273),twitter:G("twitter",60274),unfold:G("unfold",60275),unlock:G("unlock",60276),unmute:G("unmute",60277),unverified:G("unverified",60278),verified:G("verified",60279),versions:G("versions",60280),vmActive:G("vm-active",60281),vmOutline:G("vm-outline",60282),vmRunning:G("vm-running",60283),watch:G("watch",60284),whitespace:G("whitespace",60285),wholeWord:G("whole-word",60286),window:G("window",60287),wordWrap:G("word-wrap",60288),zoomIn:G("zoom-in",60289),zoomOut:G("zoom-out",60290),listFilter:G("list-filter",60291),listFlat:G("list-flat",60292),listSelection:G("list-selection",60293),selection:G("selection",60293),listTree:G("list-tree",60294),debugBreakpointFunctionUnverified:G("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:G("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:G("debug-breakpoint-function-disabled",60296),debugStackframeActive:G("debug-stackframe-active",60297),circleSmallFilled:G("circle-small-filled",60298),debugStackframeDot:G("debug-stackframe-dot",60298),debugStackframe:G("debug-stackframe",60299),debugStackframeFocused:G("debug-stackframe-focused",60299),debugBreakpointUnsupported:G("debug-breakpoint-unsupported",60300),symbolString:G("symbol-string",60301),debugReverseContinue:G("debug-reverse-continue",60302),debugStepBack:G("debug-step-back",60303),debugRestartFrame:G("debug-restart-frame",60304),callIncoming:G("call-incoming",60306),callOutgoing:G("call-outgoing",60307),menu:G("menu",60308),expandAll:G("expand-all",60309),feedback:G("feedback",60310),gitPullRequestReviewer:G("git-pull-request-reviewer",60310),groupByRefType:G("group-by-ref-type",60311),ungroupByRefType:G("ungroup-by-ref-type",60312),account:G("account",60313),gitPullRequestAssignee:G("git-pull-request-assignee",60313),bellDot:G("bell-dot",60314),debugConsole:G("debug-console",60315),library:G("library",60316),output:G("output",60317),runAll:G("run-all",60318),syncIgnored:G("sync-ignored",60319),pinned:G("pinned",60320),githubInverted:G("github-inverted",60321),debugAlt:G("debug-alt",60305),serverProcess:G("server-process",60322),serverEnvironment:G("server-environment",60323),pass:G("pass",60324),stopCircle:G("stop-circle",60325),playCircle:G("play-circle",60326),record:G("record",60327),debugAltSmall:G("debug-alt-small",60328),vmConnect:G("vm-connect",60329),cloud:G("cloud",60330),merge:G("merge",60331),exportIcon:G("export",60332),graphLeft:G("graph-left",60333),magnet:G("magnet",60334),notebook:G("notebook",60335),redo:G("redo",60336),checkAll:G("check-all",60337),pinnedDirty:G("pinned-dirty",60338),passFilled:G("pass-filled",60339),circleLargeFilled:G("circle-large-filled",60340),circleLarge:G("circle-large",60341),circleLargeOutline:G("circle-large-outline",60341),combine:G("combine",60342),gather:G("gather",60342),table:G("table",60343),variableGroup:G("variable-group",60344),typeHierarchy:G("type-hierarchy",60345),typeHierarchySub:G("type-hierarchy-sub",60346),typeHierarchySuper:G("type-hierarchy-super",60347),gitPullRequestCreate:G("git-pull-request-create",60348),runAbove:G("run-above",60349),runBelow:G("run-below",60350),notebookTemplate:G("notebook-template",60351),debugRerun:G("debug-rerun",60352),workspaceTrusted:G("workspace-trusted",60353),workspaceUntrusted:G("workspace-untrusted",60354),workspaceUnspecified:G("workspace-unspecified",60355),terminalCmd:G("terminal-cmd",60356),terminalDebian:G("terminal-debian",60357),terminalLinux:G("terminal-linux",60358),terminalPowershell:G("terminal-powershell",60359),terminalTmux:G("terminal-tmux",60360),terminalUbuntu:G("terminal-ubuntu",60361),terminalBash:G("terminal-bash",60362),arrowSwap:G("arrow-swap",60363),copy:G("copy",60364),personAdd:G("person-add",60365),filterFilled:G("filter-filled",60366),wand:G("wand",60367),debugLineByLine:G("debug-line-by-line",60368),inspect:G("inspect",60369),layers:G("layers",60370),layersDot:G("layers-dot",60371),layersActive:G("layers-active",60372),compass:G("compass",60373),compassDot:G("compass-dot",60374),compassActive:G("compass-active",60375),azure:G("azure",60376),issueDraft:G("issue-draft",60377),gitPullRequestClosed:G("git-pull-request-closed",60378),gitPullRequestDraft:G("git-pull-request-draft",60379),debugAll:G("debug-all",60380),debugCoverage:G("debug-coverage",60381),runErrors:G("run-errors",60382),folderLibrary:G("folder-library",60383),debugContinueSmall:G("debug-continue-small",60384),beakerStop:G("beaker-stop",60385),graphLine:G("graph-line",60386),graphScatter:G("graph-scatter",60387),pieChart:G("pie-chart",60388),bracketDot:G("bracket-dot",60389),bracketError:G("bracket-error",60390),lockSmall:G("lock-small",60391),azureDevops:G("azure-devops",60392),verifiedFilled:G("verified-filled",60393),newLine:G("newline",60394),layout:G("layout",60395),layoutActivitybarLeft:G("layout-activitybar-left",60396),layoutActivitybarRight:G("layout-activitybar-right",60397),layoutPanelLeft:G("layout-panel-left",60398),layoutPanelCenter:G("layout-panel-center",60399),layoutPanelJustify:G("layout-panel-justify",60400),layoutPanelRight:G("layout-panel-right",60401),layoutPanel:G("layout-panel",60402),layoutSidebarLeft:G("layout-sidebar-left",60403),layoutSidebarRight:G("layout-sidebar-right",60404),layoutStatusbar:G("layout-statusbar",60405),layoutMenubar:G("layout-menubar",60406),layoutCentered:G("layout-centered",60407),layoutSidebarRightOff:G("layout-sidebar-right-off",60416),layoutPanelOff:G("layout-panel-off",60417),layoutSidebarLeftOff:G("layout-sidebar-left-off",60418),target:G("target",60408),indent:G("indent",60409),recordSmall:G("record-small",60410),errorSmall:G("error-small",60411),arrowCircleDown:G("arrow-circle-down",60412),arrowCircleLeft:G("arrow-circle-left",60413),arrowCircleRight:G("arrow-circle-right",60414),arrowCircleUp:G("arrow-circle-up",60415),heartFilled:G("heart-filled",60420),map:G("map",60421),mapFilled:G("map-filled",60422),circleSmall:G("circle-small",60423),bellSlash:G("bell-slash",60424),bellSlashDot:G("bell-slash-dot",60425),commentUnresolved:G("comment-unresolved",60426),gitPullRequestGoToChanges:G("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:G("git-pull-request-new-changes",60428),searchFuzzy:G("search-fuzzy",60429),commentDraft:G("comment-draft",60430),send:G("send",60431),sparkle:G("sparkle",60432),insert:G("insert",60433),mic:G("mic",60434),dialogError:G("dialog-error","error"),dialogWarning:G("dialog-warning","warning"),dialogInfo:G("dialog-info","info"),dialogClose:G("dialog-close","close"),treeItemExpanded:G("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:G("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:G("tree-filter-on-type-off","list-selection"),treeFilterClear:G("tree-filter-clear","close"),treeItemLoading:G("tree-item-loading","loading"),menuSelection:G("menu-selection","check"),menuSubmenu:G("menu-submenu","chevron-right"),menuBarMore:G("menubar-more","more"),scrollbarButtonLeft:G("scrollbar-button-left","triangle-left"),scrollbarButtonRight:G("scrollbar-button-right","triangle-right"),scrollbarButtonUp:G("scrollbar-button-up","triangle-up"),scrollbarButtonDown:G("scrollbar-button-down","triangle-down"),toolBarMore:G("toolbar-more","more"),quickInputBack:G("quick-input-back","arrow-left")};var hQ=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let fot=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new _e,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,n){return this._tokenizationSupports.set(e,n),this.handleChange([e]),gn(()=>{this._tokenizationSupports.get(e)===n&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,n){var r;(r=this._factories.get(e))===null||r===void 0||r.dispose();const s=new pot(this,e,n);return this._factories.set(e,s),gn(()=>{const o=this._factories.get(e);!o||o!==s||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return hQ(this,void 0,void 0,function*(){const n=this.get(e);if(n)return n;const r=this._factories.get(e);return!r||r.isResolved?null:(yield r.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const r=this._factories.get(e);return!!(!r||r.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class pot extends Le{get isResolved(){return this._isResolved}constructor(e,n,r){super(),this._registry=e,this._languageId=n,this._factory=r,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return hQ(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return hQ(this,void 0,void 0,function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))})}}let rP=class{constructor(e,n,r){this.offset=e,this.type=n,this.language=r,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class Bse{constructor(e,n){this.tokens=e,this.endState=n,this._tokenizationResultBrand=void 0}}class ZW{constructor(e,n){this.tokens=e,this.endState=n,this._encodedTokenizationResultBrand=void 0}}var sP;(function(i){const e=new Map;e.set(0,lt.symbolMethod),e.set(1,lt.symbolFunction),e.set(2,lt.symbolConstructor),e.set(3,lt.symbolField),e.set(4,lt.symbolVariable),e.set(5,lt.symbolClass),e.set(6,lt.symbolStruct),e.set(7,lt.symbolInterface),e.set(8,lt.symbolModule),e.set(9,lt.symbolProperty),e.set(10,lt.symbolEvent),e.set(11,lt.symbolOperator),e.set(12,lt.symbolUnit),e.set(13,lt.symbolValue),e.set(15,lt.symbolEnum),e.set(14,lt.symbolConstant),e.set(15,lt.symbolEnum),e.set(16,lt.symbolEnumMember),e.set(17,lt.symbolKeyword),e.set(27,lt.symbolSnippet),e.set(18,lt.symbolText),e.set(19,lt.symbolColor),e.set(20,lt.symbolFile),e.set(21,lt.symbolReference),e.set(22,lt.symbolCustomColor),e.set(23,lt.symbolFolder),e.set(24,lt.symbolTypeParameter),e.set(25,lt.account),e.set(26,lt.issues);function n(o){let a=e.get(o);return a||(console.info("No codicon found for CompletionItemKind "+o),a=lt.symbolProperty),a}i.toIcon=n;const r=new Map;r.set("method",0),r.set("function",1),r.set("constructor",2),r.set("field",3),r.set("variable",4),r.set("class",5),r.set("struct",6),r.set("interface",7),r.set("module",8),r.set("property",9),r.set("event",10),r.set("operator",11),r.set("unit",12),r.set("value",13),r.set("constant",14),r.set("enum",15),r.set("enum-member",16),r.set("enumMember",16),r.set("keyword",17),r.set("snippet",27),r.set("text",18),r.set("color",19),r.set("file",20),r.set("reference",21),r.set("customcolor",22),r.set("folder",23),r.set("type-parameter",24),r.set("typeParameter",24),r.set("account",25),r.set("issue",26);function s(o,a){let l=r.get(o);return typeof l>"u"&&!a&&(l=9),l}i.fromString=s})(sP||(sP={}));var pv;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(pv||(pv={}));class U2e{constructor(e,n,r,s){this.range=e,this.text=n,this.completionKind=r,this.isSnippetText=s}equals(e){return J.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Am;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(Am||(Am={}));var oP;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(oP||(oP={}));function got(i){return i&&Jt.isUri(i.uri)&&J.isIRange(i.range)&&(J.isIRange(i.originSelectionRange)||J.isIRange(i.targetSelectionRange))}const mot={17:L("Array","array"),16:L("Boolean","boolean"),4:L("Class","class"),13:L("Constant","constant"),8:L("Constructor","constructor"),9:L("Enum","enumeration"),21:L("EnumMember","enumeration member"),23:L("Event","event"),7:L("Field","field"),0:L("File","file"),11:L("Function","function"),10:L("Interface","interface"),19:L("Key","key"),5:L("Method","method"),1:L("Module","module"),2:L("Namespace","namespace"),20:L("Null","null"),15:L("Number","number"),18:L("Object","object"),24:L("Operator","operator"),3:L("Package","package"),6:L("Property","property"),14:L("String","string"),22:L("Struct","struct"),25:L("TypeParameter","type parameter"),12:L("Variable","variable")};function _ot(i,e){return L("symbolAriaLabel","{0} ({1})",i,mot[e])}var M9;(function(i){const e=new Map;e.set(0,lt.symbolFile),e.set(1,lt.symbolModule),e.set(2,lt.symbolNamespace),e.set(3,lt.symbolPackage),e.set(4,lt.symbolClass),e.set(5,lt.symbolMethod),e.set(6,lt.symbolProperty),e.set(7,lt.symbolField),e.set(8,lt.symbolConstructor),e.set(9,lt.symbolEnum),e.set(10,lt.symbolInterface),e.set(11,lt.symbolFunction),e.set(12,lt.symbolVariable),e.set(13,lt.symbolConstant),e.set(14,lt.symbolString),e.set(15,lt.symbolNumber),e.set(16,lt.symbolBoolean),e.set(17,lt.symbolArray),e.set(18,lt.symbolObject),e.set(19,lt.symbolKey),e.set(20,lt.symbolNull),e.set(21,lt.symbolEnumMember),e.set(22,lt.symbolStruct),e.set(23,lt.symbolEvent),e.set(24,lt.symbolOperator),e.set(25,lt.symbolTypeParameter);function n(r){let s=e.get(r);return s||(console.info("No codicon found for SymbolKind "+r),s=lt.symbolProperty),s}i.toIcon=n})(M9||(M9={}));class Wl{static fromValue(e){switch(e){case"comment":return Wl.Comment;case"imports":return Wl.Imports;case"region":return Wl.Region}return new Wl(e)}constructor(e){this.value=e}}Wl.Comment=new Wl("comment");Wl.Imports=new Wl("imports");Wl.Region=new Wl("region");var fQ;(function(i){function e(n){return!n||typeof n!="object"?!1:typeof n.id=="string"&&typeof n.title=="string"}i.is=e})(fQ||(fQ={}));var P9;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(P9||(P9={}));class vot{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const Zr=new fot;var pQ;(function(i){i[i.Unknown=0]="Unknown",i[i.Disabled=1]="Disabled",i[i.Enabled=2]="Enabled"})(pQ||(pQ={}));var gQ;(function(i){i[i.Invoke=1]="Invoke",i[i.Auto=2]="Auto"})(gQ||(gQ={}));var mQ;(function(i){i[i.None=0]="None",i[i.KeepWhitespace=1]="KeepWhitespace",i[i.InsertAsSnippet=4]="InsertAsSnippet"})(mQ||(mQ={}));var _Q;(function(i){i[i.Method=0]="Method",i[i.Function=1]="Function",i[i.Constructor=2]="Constructor",i[i.Field=3]="Field",i[i.Variable=4]="Variable",i[i.Class=5]="Class",i[i.Struct=6]="Struct",i[i.Interface=7]="Interface",i[i.Module=8]="Module",i[i.Property=9]="Property",i[i.Event=10]="Event",i[i.Operator=11]="Operator",i[i.Unit=12]="Unit",i[i.Value=13]="Value",i[i.Constant=14]="Constant",i[i.Enum=15]="Enum",i[i.EnumMember=16]="EnumMember",i[i.Keyword=17]="Keyword",i[i.Text=18]="Text",i[i.Color=19]="Color",i[i.File=20]="File",i[i.Reference=21]="Reference",i[i.Customcolor=22]="Customcolor",i[i.Folder=23]="Folder",i[i.TypeParameter=24]="TypeParameter",i[i.User=25]="User",i[i.Issue=26]="Issue",i[i.Snippet=27]="Snippet"})(_Q||(_Q={}));var vQ;(function(i){i[i.Deprecated=1]="Deprecated"})(vQ||(vQ={}));var bQ;(function(i){i[i.Invoke=0]="Invoke",i[i.TriggerCharacter=1]="TriggerCharacter",i[i.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(bQ||(bQ={}));var yQ;(function(i){i[i.EXACT=0]="EXACT",i[i.ABOVE=1]="ABOVE",i[i.BELOW=2]="BELOW"})(yQ||(yQ={}));var wQ;(function(i){i[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo"})(wQ||(wQ={}));var CQ;(function(i){i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(CQ||(CQ={}));var SQ;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(SQ||(SQ={}));var xQ;(function(i){i[i.None=0]="None",i[i.Keep=1]="Keep",i[i.Brackets=2]="Brackets",i[i.Advanced=3]="Advanced",i[i.Full=4]="Full"})(xQ||(xQ={}));var kQ;(function(i){i[i.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",i[i.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",i[i.accessibilitySupport=2]="accessibilitySupport",i[i.accessibilityPageSize=3]="accessibilityPageSize",i[i.ariaLabel=4]="ariaLabel",i[i.ariaRequired=5]="ariaRequired",i[i.autoClosingBrackets=6]="autoClosingBrackets",i[i.autoClosingComments=7]="autoClosingComments",i[i.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",i[i.autoClosingDelete=9]="autoClosingDelete",i[i.autoClosingOvertype=10]="autoClosingOvertype",i[i.autoClosingQuotes=11]="autoClosingQuotes",i[i.autoIndent=12]="autoIndent",i[i.automaticLayout=13]="automaticLayout",i[i.autoSurround=14]="autoSurround",i[i.bracketPairColorization=15]="bracketPairColorization",i[i.guides=16]="guides",i[i.codeLens=17]="codeLens",i[i.codeLensFontFamily=18]="codeLensFontFamily",i[i.codeLensFontSize=19]="codeLensFontSize",i[i.colorDecorators=20]="colorDecorators",i[i.colorDecoratorsLimit=21]="colorDecoratorsLimit",i[i.columnSelection=22]="columnSelection",i[i.comments=23]="comments",i[i.contextmenu=24]="contextmenu",i[i.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",i[i.cursorBlinking=26]="cursorBlinking",i[i.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",i[i.cursorStyle=28]="cursorStyle",i[i.cursorSurroundingLines=29]="cursorSurroundingLines",i[i.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",i[i.cursorWidth=31]="cursorWidth",i[i.disableLayerHinting=32]="disableLayerHinting",i[i.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",i[i.domReadOnly=34]="domReadOnly",i[i.dragAndDrop=35]="dragAndDrop",i[i.dropIntoEditor=36]="dropIntoEditor",i[i.emptySelectionClipboard=37]="emptySelectionClipboard",i[i.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",i[i.extraEditorClassName=39]="extraEditorClassName",i[i.fastScrollSensitivity=40]="fastScrollSensitivity",i[i.find=41]="find",i[i.fixedOverflowWidgets=42]="fixedOverflowWidgets",i[i.folding=43]="folding",i[i.foldingStrategy=44]="foldingStrategy",i[i.foldingHighlight=45]="foldingHighlight",i[i.foldingImportsByDefault=46]="foldingImportsByDefault",i[i.foldingMaximumRegions=47]="foldingMaximumRegions",i[i.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",i[i.fontFamily=49]="fontFamily",i[i.fontInfo=50]="fontInfo",i[i.fontLigatures=51]="fontLigatures",i[i.fontSize=52]="fontSize",i[i.fontWeight=53]="fontWeight",i[i.fontVariations=54]="fontVariations",i[i.formatOnPaste=55]="formatOnPaste",i[i.formatOnType=56]="formatOnType",i[i.glyphMargin=57]="glyphMargin",i[i.gotoLocation=58]="gotoLocation",i[i.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",i[i.hover=60]="hover",i[i.inDiffEditor=61]="inDiffEditor",i[i.inlineSuggest=62]="inlineSuggest",i[i.letterSpacing=63]="letterSpacing",i[i.lightbulb=64]="lightbulb",i[i.lineDecorationsWidth=65]="lineDecorationsWidth",i[i.lineHeight=66]="lineHeight",i[i.lineNumbers=67]="lineNumbers",i[i.lineNumbersMinChars=68]="lineNumbersMinChars",i[i.linkedEditing=69]="linkedEditing",i[i.links=70]="links",i[i.matchBrackets=71]="matchBrackets",i[i.minimap=72]="minimap",i[i.mouseStyle=73]="mouseStyle",i[i.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",i[i.mouseWheelZoom=75]="mouseWheelZoom",i[i.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",i[i.multiCursorModifier=77]="multiCursorModifier",i[i.multiCursorPaste=78]="multiCursorPaste",i[i.multiCursorLimit=79]="multiCursorLimit",i[i.occurrencesHighlight=80]="occurrencesHighlight",i[i.overviewRulerBorder=81]="overviewRulerBorder",i[i.overviewRulerLanes=82]="overviewRulerLanes",i[i.padding=83]="padding",i[i.pasteAs=84]="pasteAs",i[i.parameterHints=85]="parameterHints",i[i.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",i[i.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",i[i.quickSuggestions=88]="quickSuggestions",i[i.quickSuggestionsDelay=89]="quickSuggestionsDelay",i[i.readOnly=90]="readOnly",i[i.readOnlyMessage=91]="readOnlyMessage",i[i.renameOnType=92]="renameOnType",i[i.renderControlCharacters=93]="renderControlCharacters",i[i.renderFinalNewline=94]="renderFinalNewline",i[i.renderLineHighlight=95]="renderLineHighlight",i[i.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",i[i.renderValidationDecorations=97]="renderValidationDecorations",i[i.renderWhitespace=98]="renderWhitespace",i[i.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",i[i.roundedSelection=100]="roundedSelection",i[i.rulers=101]="rulers",i[i.scrollbar=102]="scrollbar",i[i.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",i[i.scrollBeyondLastLine=104]="scrollBeyondLastLine",i[i.scrollPredominantAxis=105]="scrollPredominantAxis",i[i.selectionClipboard=106]="selectionClipboard",i[i.selectionHighlight=107]="selectionHighlight",i[i.selectOnLineNumbers=108]="selectOnLineNumbers",i[i.showFoldingControls=109]="showFoldingControls",i[i.showUnused=110]="showUnused",i[i.snippetSuggestions=111]="snippetSuggestions",i[i.smartSelect=112]="smartSelect",i[i.smoothScrolling=113]="smoothScrolling",i[i.stickyScroll=114]="stickyScroll",i[i.stickyTabStops=115]="stickyTabStops",i[i.stopRenderingLineAfter=116]="stopRenderingLineAfter",i[i.suggest=117]="suggest",i[i.suggestFontSize=118]="suggestFontSize",i[i.suggestLineHeight=119]="suggestLineHeight",i[i.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",i[i.suggestSelection=121]="suggestSelection",i[i.tabCompletion=122]="tabCompletion",i[i.tabIndex=123]="tabIndex",i[i.unicodeHighlighting=124]="unicodeHighlighting",i[i.unusualLineTerminators=125]="unusualLineTerminators",i[i.useShadowDOM=126]="useShadowDOM",i[i.useTabStops=127]="useTabStops",i[i.wordBreak=128]="wordBreak",i[i.wordSeparators=129]="wordSeparators",i[i.wordWrap=130]="wordWrap",i[i.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",i[i.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",i[i.wordWrapColumn=133]="wordWrapColumn",i[i.wordWrapOverride1=134]="wordWrapOverride1",i[i.wordWrapOverride2=135]="wordWrapOverride2",i[i.wrappingIndent=136]="wrappingIndent",i[i.wrappingStrategy=137]="wrappingStrategy",i[i.showDeprecated=138]="showDeprecated",i[i.inlayHints=139]="inlayHints",i[i.editorClassName=140]="editorClassName",i[i.pixelRatio=141]="pixelRatio",i[i.tabFocusMode=142]="tabFocusMode",i[i.layoutInfo=143]="layoutInfo",i[i.wrappingInfo=144]="wrappingInfo",i[i.defaultColorDecorators=145]="defaultColorDecorators",i[i.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",i[i.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(kQ||(kQ={}));var LQ;(function(i){i[i.TextDefined=0]="TextDefined",i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(LQ||(LQ={}));var DQ;(function(i){i[i.LF=0]="LF",i[i.CRLF=1]="CRLF"})(DQ||(DQ={}));var EQ;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(EQ||(EQ={}));var IQ;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(IQ||(IQ={}));var TQ;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(TQ||(TQ={}));var RQ;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(RQ||(RQ={}));var AQ;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(AQ||(AQ={}));var NQ;(function(i){i[i.DependsOnKbLayout=-1]="DependsOnKbLayout",i[i.Unknown=0]="Unknown",i[i.Backspace=1]="Backspace",i[i.Tab=2]="Tab",i[i.Enter=3]="Enter",i[i.Shift=4]="Shift",i[i.Ctrl=5]="Ctrl",i[i.Alt=6]="Alt",i[i.PauseBreak=7]="PauseBreak",i[i.CapsLock=8]="CapsLock",i[i.Escape=9]="Escape",i[i.Space=10]="Space",i[i.PageUp=11]="PageUp",i[i.PageDown=12]="PageDown",i[i.End=13]="End",i[i.Home=14]="Home",i[i.LeftArrow=15]="LeftArrow",i[i.UpArrow=16]="UpArrow",i[i.RightArrow=17]="RightArrow",i[i.DownArrow=18]="DownArrow",i[i.Insert=19]="Insert",i[i.Delete=20]="Delete",i[i.Digit0=21]="Digit0",i[i.Digit1=22]="Digit1",i[i.Digit2=23]="Digit2",i[i.Digit3=24]="Digit3",i[i.Digit4=25]="Digit4",i[i.Digit5=26]="Digit5",i[i.Digit6=27]="Digit6",i[i.Digit7=28]="Digit7",i[i.Digit8=29]="Digit8",i[i.Digit9=30]="Digit9",i[i.KeyA=31]="KeyA",i[i.KeyB=32]="KeyB",i[i.KeyC=33]="KeyC",i[i.KeyD=34]="KeyD",i[i.KeyE=35]="KeyE",i[i.KeyF=36]="KeyF",i[i.KeyG=37]="KeyG",i[i.KeyH=38]="KeyH",i[i.KeyI=39]="KeyI",i[i.KeyJ=40]="KeyJ",i[i.KeyK=41]="KeyK",i[i.KeyL=42]="KeyL",i[i.KeyM=43]="KeyM",i[i.KeyN=44]="KeyN",i[i.KeyO=45]="KeyO",i[i.KeyP=46]="KeyP",i[i.KeyQ=47]="KeyQ",i[i.KeyR=48]="KeyR",i[i.KeyS=49]="KeyS",i[i.KeyT=50]="KeyT",i[i.KeyU=51]="KeyU",i[i.KeyV=52]="KeyV",i[i.KeyW=53]="KeyW",i[i.KeyX=54]="KeyX",i[i.KeyY=55]="KeyY",i[i.KeyZ=56]="KeyZ",i[i.Meta=57]="Meta",i[i.ContextMenu=58]="ContextMenu",i[i.F1=59]="F1",i[i.F2=60]="F2",i[i.F3=61]="F3",i[i.F4=62]="F4",i[i.F5=63]="F5",i[i.F6=64]="F6",i[i.F7=65]="F7",i[i.F8=66]="F8",i[i.F9=67]="F9",i[i.F10=68]="F10",i[i.F11=69]="F11",i[i.F12=70]="F12",i[i.F13=71]="F13",i[i.F14=72]="F14",i[i.F15=73]="F15",i[i.F16=74]="F16",i[i.F17=75]="F17",i[i.F18=76]="F18",i[i.F19=77]="F19",i[i.F20=78]="F20",i[i.F21=79]="F21",i[i.F22=80]="F22",i[i.F23=81]="F23",i[i.F24=82]="F24",i[i.NumLock=83]="NumLock",i[i.ScrollLock=84]="ScrollLock",i[i.Semicolon=85]="Semicolon",i[i.Equal=86]="Equal",i[i.Comma=87]="Comma",i[i.Minus=88]="Minus",i[i.Period=89]="Period",i[i.Slash=90]="Slash",i[i.Backquote=91]="Backquote",i[i.BracketLeft=92]="BracketLeft",i[i.Backslash=93]="Backslash",i[i.BracketRight=94]="BracketRight",i[i.Quote=95]="Quote",i[i.OEM_8=96]="OEM_8",i[i.IntlBackslash=97]="IntlBackslash",i[i.Numpad0=98]="Numpad0",i[i.Numpad1=99]="Numpad1",i[i.Numpad2=100]="Numpad2",i[i.Numpad3=101]="Numpad3",i[i.Numpad4=102]="Numpad4",i[i.Numpad5=103]="Numpad5",i[i.Numpad6=104]="Numpad6",i[i.Numpad7=105]="Numpad7",i[i.Numpad8=106]="Numpad8",i[i.Numpad9=107]="Numpad9",i[i.NumpadMultiply=108]="NumpadMultiply",i[i.NumpadAdd=109]="NumpadAdd",i[i.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",i[i.NumpadSubtract=111]="NumpadSubtract",i[i.NumpadDecimal=112]="NumpadDecimal",i[i.NumpadDivide=113]="NumpadDivide",i[i.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",i[i.ABNT_C1=115]="ABNT_C1",i[i.ABNT_C2=116]="ABNT_C2",i[i.AudioVolumeMute=117]="AudioVolumeMute",i[i.AudioVolumeUp=118]="AudioVolumeUp",i[i.AudioVolumeDown=119]="AudioVolumeDown",i[i.BrowserSearch=120]="BrowserSearch",i[i.BrowserHome=121]="BrowserHome",i[i.BrowserBack=122]="BrowserBack",i[i.BrowserForward=123]="BrowserForward",i[i.MediaTrackNext=124]="MediaTrackNext",i[i.MediaTrackPrevious=125]="MediaTrackPrevious",i[i.MediaStop=126]="MediaStop",i[i.MediaPlayPause=127]="MediaPlayPause",i[i.LaunchMediaPlayer=128]="LaunchMediaPlayer",i[i.LaunchMail=129]="LaunchMail",i[i.LaunchApp2=130]="LaunchApp2",i[i.Clear=131]="Clear",i[i.MAX_VALUE=132]="MAX_VALUE"})(NQ||(NQ={}));var MQ;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(MQ||(MQ={}));var PQ;(function(i){i[i.Unnecessary=1]="Unnecessary",i[i.Deprecated=2]="Deprecated"})(PQ||(PQ={}));var OQ;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(OQ||(OQ={}));var FQ;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.TEXTAREA=1]="TEXTAREA",i[i.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",i[i.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",i[i.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",i[i.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",i[i.CONTENT_TEXT=6]="CONTENT_TEXT",i[i.CONTENT_EMPTY=7]="CONTENT_EMPTY",i[i.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",i[i.CONTENT_WIDGET=9]="CONTENT_WIDGET",i[i.OVERVIEW_RULER=10]="OVERVIEW_RULER",i[i.SCROLLBAR=11]="SCROLLBAR",i[i.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",i[i.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(FQ||(FQ={}));var BQ;(function(i){i[i.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",i[i.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",i[i.TOP_CENTER=2]="TOP_CENTER"})(BQ||(BQ={}));var jQ;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(jQ||(jQ={}));var WQ;(function(i){i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.None=2]="None",i[i.LeftOfInjectedText=3]="LeftOfInjectedText",i[i.RightOfInjectedText=4]="RightOfInjectedText"})(WQ||(WQ={}));var $Q;(function(i){i[i.Off=0]="Off",i[i.On=1]="On",i[i.Relative=2]="Relative",i[i.Interval=3]="Interval",i[i.Custom=4]="Custom"})($Q||($Q={}));var zQ;(function(i){i[i.None=0]="None",i[i.Text=1]="Text",i[i.Blocks=2]="Blocks"})(zQ||(zQ={}));var VQ;(function(i){i[i.Smooth=0]="Smooth",i[i.Immediate=1]="Immediate"})(VQ||(VQ={}));var HQ;(function(i){i[i.Auto=1]="Auto",i[i.Hidden=2]="Hidden",i[i.Visible=3]="Visible"})(HQ||(HQ={}));var UQ;(function(i){i[i.LTR=0]="LTR",i[i.RTL=1]="RTL"})(UQ||(UQ={}));var qQ;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(qQ||(qQ={}));var KQ;(function(i){i[i.File=0]="File",i[i.Module=1]="Module",i[i.Namespace=2]="Namespace",i[i.Package=3]="Package",i[i.Class=4]="Class",i[i.Method=5]="Method",i[i.Property=6]="Property",i[i.Field=7]="Field",i[i.Constructor=8]="Constructor",i[i.Enum=9]="Enum",i[i.Interface=10]="Interface",i[i.Function=11]="Function",i[i.Variable=12]="Variable",i[i.Constant=13]="Constant",i[i.String=14]="String",i[i.Number=15]="Number",i[i.Boolean=16]="Boolean",i[i.Array=17]="Array",i[i.Object=18]="Object",i[i.Key=19]="Key",i[i.Null=20]="Null",i[i.EnumMember=21]="EnumMember",i[i.Struct=22]="Struct",i[i.Event=23]="Event",i[i.Operator=24]="Operator",i[i.TypeParameter=25]="TypeParameter"})(KQ||(KQ={}));var GQ;(function(i){i[i.Deprecated=1]="Deprecated"})(GQ||(GQ={}));var XQ;(function(i){i[i.Hidden=0]="Hidden",i[i.Blink=1]="Blink",i[i.Smooth=2]="Smooth",i[i.Phase=3]="Phase",i[i.Expand=4]="Expand",i[i.Solid=5]="Solid"})(XQ||(XQ={}));var YQ;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(YQ||(YQ={}));var ZQ;(function(i){i[i.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",i[i.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",i[i.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",i[i.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(ZQ||(ZQ={}));var QQ;(function(i){i[i.None=0]="None",i[i.Same=1]="Same",i[i.Indent=2]="Indent",i[i.DeepIndent=3]="DeepIndent"})(QQ||(QQ={}));let C5=class{static chord(e,n){return ro(e,n)}};C5.CtrlCmd=2048;C5.Shift=1024;C5.Alt=512;C5.WinCtrl=256;function q2e(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ns,Emitter:_e,KeyCode:NQ,KeyMod:C5,Position:ve,Range:J,Selection:Ft,SelectionDirection:UQ,MarkerSeverity:MQ,MarkerTag:PQ,Uri:Jt,Token:rP}}class bot{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const n=JSON.stringify(e);return this.lastArgKey!==n&&(this.lastArgKey=n,this.lastCache=this.fn(e)),this.lastCache}}class qfe{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const n=this.fn(e);return this._map.set(e,n),n}}class K1{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var IE;function K2e(i){return!i||typeof i!="string"?!0:i.trim().length===0}const yot=/{(\d+)}/g;function ox(i,...e){return e.length===0?i:i.replace(yot,function(n,r){const s=parseInt(r,10);return isNaN(s)||s<0||s>=e.length?n:e[s]})}function O9(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}})}function dd(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function wot(i,e=" "){const n=S5(i,e);return G2e(n,e)}function S5(i,e){if(!i||!e)return i;const n=e.length;if(n===0||i.length===0)return i;let r=0;for(;i.indexOf(e,r)===r;)r=r+n;return i.substring(r)}function G2e(i,e){if(!i||!e)return i;const n=e.length,r=i.length;if(n===0||r===0)return i;let s=r,o=-1;for(;o=i.lastIndexOf(e,s-1),!(o===-1||o+n!==s);){if(o===0)return"";s=o}return i.substring(0,s)}function Cot(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function Sot(i){return i.replace(/\*/g,"")}function X2e(i,e,n={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=dd(i)),n.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let r="";return n.global&&(r+="g"),n.matchCase||(r+="i"),n.multiline&&(r+="m"),n.unicode&&(r+="u"),new RegExp(i,r)}function xot(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function Km(i){return i.split(/\r\n|\r|\n/)}function ml(i){for(let e=0,n=i.length;e<n;e++){const r=i.charCodeAt(e);if(r!==32&&r!==9)return e}return-1}function ar(i,e=0,n=i.length){for(let r=e;r<n;r++){const s=i.charCodeAt(r);if(s!==32&&s!==9)return i.substring(e,r)}return i.substring(e,n)}function $p(i,e=i.length-1){for(let n=e;n>=0;n--){const r=i.charCodeAt(n);if(r!==32&&r!==9)return n}return-1}function aP(i,e){return i<e?-1:i>e?1:0}function jse(i,e,n=0,r=i.length,s=0,o=e.length){for(;n<r&&s<o;n++,s++){const c=i.charCodeAt(n),u=e.charCodeAt(s);if(c<u)return-1;if(c>u)return 1}const a=r-n,l=o-s;return a<l?-1:a>l?1:0}function JQ(i,e){return x5(i,e,0,i.length,0,e.length)}function x5(i,e,n=0,r=i.length,s=0,o=e.length){for(;n<r&&s<o;n++,s++){let c=i.charCodeAt(n),u=e.charCodeAt(s);if(c===u)continue;if(c>=128||u>=128)return jse(i.toLowerCase(),e.toLowerCase(),n,r,s,o);gy(c)&&(c-=32),gy(u)&&(u-=32);const d=c-u;if(d!==0)return d}const a=r-n,l=o-s;return a<l?-1:a>l?1:0}function O3(i){return i>=48&&i<=57}function gy(i){return i>=97&&i<=122}function nm(i){return i>=65&&i<=90}function n2(i,e){return i.length===e.length&&x5(i,e)===0}function Wse(i,e){const n=e.length;return e.length>i.length?!1:x5(i,e,0,n)===0}function ax(i,e){const n=Math.min(i.length,e.length);let r;for(r=0;r<n;r++)if(i.charCodeAt(r)!==e.charCodeAt(r))return r;return n}function F9(i,e){const n=Math.min(i.length,e.length);let r;const s=i.length-1,o=e.length-1;for(r=0;r<n;r++)if(i.charCodeAt(s-r)!==e.charCodeAt(o-r))return r;return n}function xo(i){return 55296<=i&&i<=56319}function lx(i){return 56320<=i&&i<=57343}function $se(i,e){return(i-55296<<10)+(e-56320)+65536}function B9(i,e,n){const r=i.charCodeAt(n);if(xo(r)&&n+1<e){const s=i.charCodeAt(n+1);if(lx(s))return $se(r,s)}return r}function kot(i,e){const n=i.charCodeAt(e-1);if(lx(n)&&e>1){const r=i.charCodeAt(e-2);if(xo(r))return $se(r,n)}return n}class zse{get offset(){return this._offset}constructor(e,n=0){this._str=e,this._len=e.length,this._offset=n}setOffset(e){this._offset=e}prevCodePoint(){const e=kot(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=B9(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class j9{get offset(){return this._iterator.offset}constructor(e,n=0){this._iterator=new zse(e,n)}nextGraphemeLength(){const e=my.getInstance(),n=this._iterator,r=n.offset;let s=e.getGraphemeBreakType(n.nextCodePoint());for(;!n.eol();){const o=n.offset,a=e.getGraphemeBreakType(n.nextCodePoint());if(Kfe(s,a)){n.setOffset(o);break}s=a}return n.offset-r}prevGraphemeLength(){const e=my.getInstance(),n=this._iterator,r=n.offset;let s=e.getGraphemeBreakType(n.prevCodePoint());for(;n.offset>0;){const o=n.offset,a=e.getGraphemeBreakType(n.prevCodePoint());if(Kfe(a,s)){n.setOffset(o);break}s=a}return r-n.offset}eol(){return this._iterator.eol()}}function Vse(i,e){return new j9(i,e).nextGraphemeLength()}function Y2e(i,e){return new j9(i,e).prevGraphemeLength()}function Lot(i,e){e>0&&lx(i.charCodeAt(e))&&e--;const n=e+Vse(i,e);return[n-Y2e(i,n),n]}let $U;function Dot(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function TE(i){return $U||($U=Dot()),$U.test(i)}const Eot=/^[\t\n\r\x20-\x7E]*$/;function k5(i){return Eot.test(i)}const Z2e=/[\u2028\u2029]/;function Q2e(i){return Z2e.test(i)}function d1(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function Hse(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const Iot="\uFEFF";function Use(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function Tot(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function J2e(i){return i=i%(2*26),i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function Kfe(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}class my{static getInstance(){return my._INSTANCE||(my._INSTANCE=new my),my._INSTANCE}constructor(){this._data=Rot()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const n=this._data,r=n.length/3;let s=1;for(;s<=r;)if(e<n[3*s])s=2*s;else if(e>n[3*s+1])s=2*s+1;else return n[3*s+2];return 0}}my._INSTANCE=null;function Rot(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function Aot(i,e){if(i===0)return 0;const n=Not(i,e);if(n!==void 0)return n;const r=new zse(e,i);return r.prevCodePoint(),r.offset}function Not(i,e){const n=new zse(e,i);let r=n.prevCodePoint();for(;Mot(r)||r===65039||r===8419;){if(n.offset===0)return;r=n.prevCodePoint()}if(!Hse(r))return;let s=n.offset;return s>0&&n.prevCodePoint()===8205&&(s=n.offset),s}function Mot(i){return 127995<=i&&i<=127999}const eEe=" ";class cx{static getInstance(e){return IE.cache.get(Array.from(e))}static getLocales(){return IE._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}IE=cx;cx.ambiguousCharacterData=new K1(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));cx.cache=new bot(i=>{function e(u){const d=new Map;for(let h=0;h<u.length;h+=2)d.set(u[h],u[h+1]);return d}function n(u,d){const h=new Map(u);for(const[f,p]of d)h.set(f,p);return h}function r(u,d){if(!u)return d;const h=new Map;for(const[f,p]of u)d.has(f)&&h.set(f,p);return h}const s=IE.ambiguousCharacterData.value;let o=i.filter(u=>!u.startsWith("_")&&u in s);o.length===0&&(o=["_default"]);let a;for(const u of o){const d=e(s[u]);a=r(a,d)}const l=e(s._common),c=n(l,a);return new IE(c)});cx._locales=new K1(()=>Object.keys(IE.ambiguousCharacterData.value).filter(i=>!i.startsWith("_")));class Nm{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(Nm.getRawData())),this._data}static isInvisibleCharacter(e){return Nm.getData().has(e)}static get codePoints(){return Nm.getData()}}Nm._data=void 0;class eJ{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}eJ.INSTANCE=new eJ;class Pot extends Le{constructor(){super(),this._onDidChange=this._register(new _e),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var n;(n=this._mediaQueryList)===null||n===void 0||n.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class Oot extends Le{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new _e),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new Pot);this._register(e.onDidChange(()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)}))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d"),n=window.devicePixelRatio||1,r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/r}}class Fot{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new Oot),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function tEe(i,e){typeof i=="string"&&(i=window.matchMedia(i)),i.addEventListener("change",e)}const lP=new Fot;function Bot(){return eJ.INSTANCE.getZoomFactor()}const PI=navigator.userAgent,gh=PI.indexOf("Firefox")>=0,QW=PI.indexOf("AppleWebKit")>=0,qse=PI.indexOf("Chrome")>=0,h1=!qse&&PI.indexOf("Safari")>=0,nEe=!qse&&!h1&&QW;PI.indexOf("Electron/")>=0;const Gfe=PI.indexOf("Android")>=0;let zU=!1;if(window.matchMedia){const i=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");zU=i.matches,tEe(i,({matches:n})=>{zU&&e.matches||(zU=n)})}class iEe{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const n=sp(e);this._maxWidth!==n&&(this._maxWidth=n,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const n=sp(e);this._width!==n&&(this._width=n,this.domNode.style.width=this._width)}setHeight(e){const n=sp(e);this._height!==n&&(this._height=n,this.domNode.style.height=this._height)}setTop(e){const n=sp(e);this._top!==n&&(this._top=n,this.domNode.style.top=this._top)}setLeft(e){const n=sp(e);this._left!==n&&(this._left=n,this.domNode.style.left=this._left)}setBottom(e){const n=sp(e);this._bottom!==n&&(this._bottom=n,this.domNode.style.bottom=this._bottom)}setRight(e){const n=sp(e);this._right!==n&&(this._right=n,this.domNode.style.right=this._right)}setPaddingLeft(e){const n=sp(e);this._paddingLeft!==n&&(this._paddingLeft=n,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const n=sp(e);this._fontSize!==n&&(this._fontSize=n,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const n=sp(e);this._lineHeight!==n&&(this._lineHeight=n,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const n=sp(e);this._letterSpacing!==n&&(this._letterSpacing=n,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,n){this.domNode.classList.toggle(e,n),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,n){this.domNode.setAttribute(e,n)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function sp(i){return typeof i=="number"?`${i}px`:i}function Di(i){return new iEe(i)}function Ta(i,e){i instanceof iEe?(i.setFontFamily(e.getMassagedFontFamily()),i.setFontWeight(e.fontWeight),i.setFontSize(e.fontSize),i.setFontFeatureSettings(e.fontFeatureSettings),i.setFontVariationSettings(e.fontVariationSettings),i.setLineHeight(e.lineHeight),i.setLetterSpacing(e.letterSpacing)):(i.style.fontFamily=e.getMassagedFontFamily(),i.style.fontWeight=e.fontWeight,i.style.fontSize=e.fontSize+"px",i.style.fontFeatureSettings=e.fontFeatureSettings,i.style.fontVariationSettings=e.fontVariationSettings,i.style.lineHeight=e.lineHeight+"px",i.style.letterSpacing=e.letterSpacing+"px")}class jot{constructor(e,n){this.chr=e,this.type=n,this.width=0}fulfill(e){this.width=e}}class Kse{constructor(e,n){this._bareFontInfo=e,this._requests=n,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const n=document.createElement("div");Ta(n,this._bareFontInfo),e.appendChild(n);const r=document.createElement("div");Ta(r,this._bareFontInfo),r.style.fontWeight="bold",e.appendChild(r);const s=document.createElement("div");Ta(s,this._bareFontInfo),s.style.fontStyle="italic",e.appendChild(s);const o=[];for(const a of this._requests){let l;a.type===0&&(l=n),a.type===2&&(l=r),a.type===1&&(l=s),l.appendChild(document.createElement("br"));const c=document.createElement("span");Kse._render(c,a),l.appendChild(c),o.push(c)}this._container=e,this._testElements=o}static _render(e,n){if(n.chr===" "){let r=" ";for(let s=0;s<8;s++)r+=r;e.innerText=r}else{let r=n.chr;for(let s=0;s<8;s++)r+=r;e.textContent=r}}_readFromDomElements(){for(let e=0,n=this._requests.length;e<n;e++){const r=this._requests[e],s=this._testElements[e];r.fulfill(s.offsetWidth/256)}}}function Wot(i,e){new Kse(i,e).read()}const eh=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new _e,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(i){i=Math.min(Math.max(-5,i),20),this._zoomLevel!==i&&(this._zoomLevel=i,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},$ot=ri?1.5:1.35,VU=8;class NS{static createFromValidatedSettings(e,n,r){const s=e.get(49),o=e.get(53),a=e.get(52),l=e.get(51),c=e.get(54),u=e.get(66),d=e.get(63);return NS._create(s,o,a,l,c,u,d,n,r)}static _create(e,n,r,s,o,a,l,c,u){a===0?a=$ot*r:a<VU&&(a=a*r),a=Math.round(a),a<VU&&(a=VU);const d=1+(u?0:eh.getZoomLevel()*.1);return r*=d,a*=d,o===Ip.TRANSLATE&&(n==="normal"||n==="bold"?o=Ip.OFF:(o=`'wght' ${parseInt(n,10)}`,n="normal")),new NS({pixelRatio:c,fontFamily:e,fontWeight:n,fontSize:r,fontFeatureSettings:s,fontVariationSettings:o,lineHeight:a,letterSpacing:l})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=su.fontFamily,n=NS._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${n}, ${e}`:n}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const zot=2;class tJ extends NS{constructor(e,n){super(e),this._editorStylingBrand=void 0,this.version=zot,this.isTrusted=n,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}class Vot extends Le{constructor(){super(),this._onDidChange=this._register(new _e),this.onDidChange=this._onDidChange.event,this._cache=new Xfe,this._evictUntrustedReadingsTimeout=-1}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new Xfe,this._onDidChange.fire()}_writeToCache(e,n){this._cache.put(e,n),!n.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=window.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let n=!1;for(const r of e)r.isTrusted||(n=!0,this._cache.remove(r));n&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let n=this._actualReadFontInfo(e);(n.typicalHalfwidthCharacterWidth<=2||n.typicalFullwidthCharacterWidth<=2||n.spaceWidth<=2||n.maxDigitWidth<=2)&&(n=new tJ({pixelRatio:lP.value,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontSize:n.fontSize,fontFeatureSettings:n.fontFeatureSettings,fontVariationSettings:n.fontVariationSettings,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,isMonospace:n.isMonospace,typicalHalfwidthCharacterWidth:Math.max(n.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(n.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:n.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(n.spaceWidth,5),middotWidth:Math.max(n.middotWidth,5),wsmiddotWidth:Math.max(n.wsmiddotWidth,5),maxDigitWidth:Math.max(n.maxDigitWidth,5)},!1)),this._writeToCache(e,n)}return this._cache.get(e)}_createRequest(e,n,r,s){const o=new jot(e,n);return r.push(o),s==null||s.push(o),o}_actualReadFontInfo(e){const n=[],r=[],s=this._createRequest("n",0,n,r),o=this._createRequest("m",0,n,null),a=this._createRequest(" ",0,n,r),l=this._createRequest("0",0,n,r),c=this._createRequest("1",0,n,r),u=this._createRequest("2",0,n,r),d=this._createRequest("3",0,n,r),h=this._createRequest("4",0,n,r),f=this._createRequest("5",0,n,r),p=this._createRequest("6",0,n,r),g=this._createRequest("7",0,n,r),m=this._createRequest("8",0,n,r),_=this._createRequest("9",0,n,r),b=this._createRequest("→",0,n,r),y=this._createRequest("→",0,n,null),x=this._createRequest("·",0,n,r),k=this._createRequest("⸱",0,n,null),D="|/-_ilm%";for(let N=0,P=D.length;N<P;N++)this._createRequest(D.charAt(N),0,n,r),this._createRequest(D.charAt(N),1,n,r),this._createRequest(D.charAt(N),2,n,r);Wot(e,n);const R=Math.max(l.width,c.width,u.width,d.width,h.width,f.width,p.width,g.width,m.width,_.width);let E=e.fontFeatureSettings===Uu.OFF;const A=r[0].width;for(let N=1,P=r.length;E&&N<P;N++){const O=A-r[N].width;if(O<-.001||O>.001){E=!1;break}}let M=!0;return E&&y.width!==A&&(M=!1),y.width>b.width&&(M=!1),new tJ({pixelRatio:lP.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:E,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:M,spaceWidth:a.width,middotWidth:x.width,wsmiddotWidth:k.width,maxDigitWidth:R},!0)}}class Xfe{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const n=e.getId();return!!this._values[n]}get(e){const n=e.getId();return this._values[n]}put(e,n){const r=e.getId();this._keys[r]=e,this._values[r]=n}remove(e){const n=e.getId();delete this._keys[n],delete this._values[n]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const nJ=new Vot;var Np;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(n){return n[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(Np||(Np={}));const hn=qn("instantiationService");function Hot(i,e,n){e[Np.DI_TARGET]===e?e[Np.DI_DEPENDENCIES].push({id:i,index:n}):(e[Np.DI_DEPENDENCIES]=[{id:i,index:n}],e[Np.DI_TARGET]=e)}function qn(i){if(Np.serviceIds.has(i))return Np.serviceIds.get(i);const e=function(n,r,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Hot(e,n,s)};return e.toString=()=>i,Np.serviceIds.set(i,e),e}const Si=qn("codeEditorService"),Fr=qn("modelService"),Ec=qn("textModelService");var RE=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class Vl extends Le{constructor(e,n="",r="",s=!0,o){super(),this._onDidChange=this._register(new _e),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=n,this._cssClass=r,this._enabled=s,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,n){return RE(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class AE extends Le{constructor(){super(...arguments),this._onWillRun=this._register(new _e),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new _e),this.onDidRun=this._onDidRun.event}run(e,n){return RE(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let r;try{yield this.runAction(e,n)}catch(s){r=s}this._onDidRun.fire({action:e,error:r})})}runAction(e,n){return RE(this,void 0,void 0,function*(){yield e.run(n)})}}class Vo{constructor(){this.id=Vo.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let n=[];for(const r of e)r.length&&(n.length?n=[...n,new Vo,...r]:n=r);return n}run(){return RE(this,void 0,void 0,function*(){})}}Vo.ID="vs.actions.separator";class NE{get actions(){return this._actions}constructor(e,n,r,s){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=n,this.class=s,this._actions=r}run(){return RE(this,void 0,void 0,function*(){})}}class JW extends Vl{constructor(){super(JW.ID,L("submenu.empty","(empty)"),void 0,!1)}}JW.ID="vs.actions.empty";function B2(i){var e,n;return{id:i.id,label:i.label,class:void 0,enabled:(e=i.enabled)!==null&&e!==void 0?e:!0,checked:(n=i.checked)!==null&&n!==void 0?n:!1,run:(...r)=>RE(this,void 0,void 0,function*(){return i.run(...r)}),tooltip:i.label}}var iJ;(function(i){function e(n){return n&&typeof n=="object"&&typeof n.id=="string"}i.isThemeColor=e})(iJ||(iJ={}));var en;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function n(f){const p=e.exec(f.id);if(!p)return n(lt.error);const[,g,m]=p,_=["codicon","codicon-"+g];return m&&_.push("codicon-modifier-"+m.substring(1)),_}i.asClassNameArray=n;function r(f){return n(f).join(" ")}i.asClassName=r;function s(f){return"."+n(f).join(".")}i.asCSSSelector=s;function o(f){return f&&typeof f=="object"&&typeof f.id=="string"&&(typeof f.color>"u"||iJ.isThemeColor(f.color))}i.isThemeIcon=o;const a=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function l(f){const p=a.exec(f);if(!p)return;const[,g]=p;return{id:g}}i.fromString=l;function c(f){return{id:f}}i.fromId=c;function u(f,p){let g=f.id;const m=g.lastIndexOf("~");return m!==-1&&(g=g.substring(0,m)),p&&(g=`${g}~${p}`),{id:g}}i.modify=u;function d(f){const p=f.id.lastIndexOf("~");if(p!==-1)return f.id.substring(p+1)}i.getModifier=d;function h(f,p){var g,m;return f.id===p.id&&((g=f.color)===null||g===void 0?void 0:g.id)===((m=p.color)===null||m===void 0?void 0:m.id)}i.isEqual=h})(en||(en={}));const us=qn("commandService"),si=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new _e,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.description){const a=[];for(const c of i.description.args)a.push(c.constraint);const l=i.handler;i.handler=function(c,...u){return Drt(u,a),l(c,...u)}}const{id:n}=i;let r=this._commands.get(n);r||(r=new jl,this._commands.set(n,r));const s=r.unshift(i),o=gn(()=>{s();const a=this._commands.get(n);a!=null&&a.isEmpty()&&this._commands.delete(n)});return this._onDidRegisterCommand.fire(n),o}registerCommandAlias(i,e){return si.registerCommand(i,(n,...r)=>n.get(us).executeCommand(e,...r))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return Vn.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const n=this.getCommand(e);n&&i.set(e,n)}return i}};si.registerCommand("noop",()=>{});function HU(...i){switch(i.length){case 1:return L("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",i[0]);case 2:return L("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",i[0],i[1]);case 3:return L("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const Uot=L("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),qot=L("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let HC=class rJ{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw Rse(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const n=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:n})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const n=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:n})}else this._match(126)?this._addToken(9):this._error(HU("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(HU("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(HU("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const n=this._start,r=this._input.substring(this._start,this._current),s={type:19,offset:this._start,lexeme:r};this._errors.push({offset:n,lexeme:r,additionalInfo:e}),this._tokens.push(s)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const n=this._input.substring(this._start,this._current),r=rJ._keywords.get(n);r?this._addToken(r):this._tokens.push({type:17,lexeme:n,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(Uot);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,n=!1,r=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(qot);return}const o=this._input.charCodeAt(e);if(n)n=!1;else if(o===47&&!r){e++;break}else o===91?r=!0:o===92?n=!0:o===93&&(r=!1);e++}for(;e<this._input.length&&rJ._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;const s=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:s,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}};HC._regexFlags=new Set(["i","g","s","m","y","u"].map(i=>i.charCodeAt(0)));HC._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Ya=new Map;Ya.set("false",!1);Ya.set("true",!0);Ya.set("isMac",ri);Ya.set("isLinux",_l);Ya.set("isWindows",Aa);Ya.set("isWeb",H1);Ya.set("isMacNative",ri&&!H1);Ya.set("isEdge",Vrt);Ya.set("isFirefox",$rt);Ya.set("isChrome",k2e);Ya.set("isSafari",zrt);const Kot=Object.prototype.hasOwnProperty,Got={regexParsingWithErrorRecovery:!0},Xot=L("contextkey.parser.error.emptyString","Empty context key expression"),Yot=L("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),Zot=L("contextkey.parser.error.noInAfterNot","'in' after 'not'."),Yfe=L("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),Qot=L("contextkey.parser.error.unexpectedToken","Unexpected token"),Jot=L("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),eat=L("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),tat=L("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let rEe=class sN{constructor(e=Got){this._config=e,this._scanner=new HC,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:Xot,offset:0,lexeme:"",additionalInfo:Yot});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const n=this._expr();if(!this._isAtEnd()){const r=this._peek(),s=r.type===17?Jot:void 0;throw this._parsingErrors.push({message:Qot,offset:r.offset,lexeme:HC.getLexeme(r),additionalInfo:s}),sN._parseError}return n}catch(n){if(n!==sN._parseError)throw n;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const n=this._and();e.push(n)}return e.length===1?e[0]:ze.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const n=this._term();e.push(n)}return e.length===1?e[0]:ze.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Hl.INSTANCE;case 12:return this._advance(),Cc.INSTANCE;case 0:{this._advance();const n=this._expr();return this._consume(1,Yfe),n==null?void 0:n.negate()}case 17:return this._advance(),Gx.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),ze.true();case 12:return this._advance(),ze.false();case 0:{this._advance();const n=this._expr();return this._consume(1,Yfe),n}case 17:{const n=e.lexeme;if(this._advance(),this._matchOne(9)){const s=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),s.type!==10)throw this._errExpectedButGot("REGEX",s);const o=s.lexeme,a=o.lastIndexOf("/"),l=a===o.length-1?void 0:this._removeFlagsGY(o.substring(a+1));let c;try{c=new RegExp(o.substring(1,a),l)}catch{throw this._errExpectedButGot("REGEX",s)}return cP.create(n,c)}switch(s.type){case 10:case 19:{const o=[s.lexeme];this._advance();let a=this._peek(),l=0;for(let f=0;f<s.lexeme.length;f++)s.lexeme.charCodeAt(f)===40?l++:s.lexeme.charCodeAt(f)===41&&l--;for(;!this._isAtEnd()&&a.type!==15&&a.type!==16;){switch(a.type){case 0:l++;break;case 1:l--;break;case 10:case 18:for(let f=0;f<a.lexeme.length;f++)a.lexeme.charCodeAt(f)===40?l++:s.lexeme.charCodeAt(f)===41&&l--}if(l<0)break;o.push(HC.getLexeme(a)),this._advance(),a=this._peek()}const c=o.join(""),u=c.lastIndexOf("/"),d=u===c.length-1?void 0:this._removeFlagsGY(c.substring(u+1));let h;try{h=new RegExp(c.substring(1,u),d)}catch{throw this._errExpectedButGot("REGEX",s)}return ze.regex(n,h)}case 18:{const o=s.lexeme;this._advance();let a=null;if(!K2e(o)){const l=o.indexOf("/"),c=o.lastIndexOf("/");if(l!==c&&l>=0){const u=o.slice(l+1,c),d=o[c+1]==="i"?"i":"";try{a=new RegExp(u,d)}catch{throw this._errExpectedButGot("REGEX",s)}}}if(a===null)throw this._errExpectedButGot("REGEX",s);return cP.create(n,a)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Zot);const s=this._value();return ze.notIn(n,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return ze.equals(n,s);switch(s){case"true":return ze.has(n);case"false":return ze.not(n);default:return ze.equals(n,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return ze.notEquals(n,s);switch(s){case"true":return ze.not(n);case"false":return ze.has(n);default:return ze.notEquals(n,s)}}case 5:return this._advance(),o$.create(n,this._value());case 6:return this._advance(),a$.create(n,this._value());case 7:return this._advance(),r$.create(n,this._value());case 8:return this._advance(),s$.create(n,this._value());case 13:return this._advance(),ze.in(n,this._value());default:return ze.has(n)}}case 20:throw this._parsingErrors.push({message:eat,offset:e.offset,lexeme:"",additionalInfo:tat}),sN._parseError;default:throw this._errExpectedButGot(`true | false | KEY
| KEY '=~' REGEX
| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,n){if(this._check(e))return this._advance();throw this._errExpectedButGot(n,this._peek())}_errExpectedButGot(e,n,r){const s=L("contextkey.parser.error.expectedButGot",`Expected: {0}
Received: '{1}'.`,e,HC.getLexeme(n)),o=n.offset,a=HC.getLexeme(n);return this._parsingErrors.push({message:s,offset:o,lexeme:a,additionalInfo:r}),sN._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};rEe._parseError=new Error;class ze{static false(){return Hl.INSTANCE}static true(){return Cc.INSTANCE}static has(e){return Kx.create(e)}static equals(e,n){return OI.create(e,n)}static notEquals(e,n){return n$.create(e,n)}static regex(e,n){return cP.create(e,n)}static in(e,n){return e$.create(e,n)}static notIn(e,n){return t$.create(e,n)}static not(e){return Gx.create(e)}static and(...e){return pS.create(e,null,!0)}static or(...e){return $0.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}ze._parser=new rEe({regexParsingWithErrorRecovery:!1});function nat(i,e){const n=i?i.substituteConstants():void 0,r=e?e.substituteConstants():void 0;return!n&&!r?!0:!n||!r?!1:n.equals(r)}function JN(i,e){return i.cmp(e)}class Hl{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Cc.INSTANCE}}Hl.INSTANCE=new Hl;class Cc{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return Hl.INSTANCE}}Cc.INSTANCE=new Cc;class Kx{static create(e,n=null){const r=Ya.get(e);return typeof r=="boolean"?r?Cc.INSTANCE:Hl.INSTANCE:new Kx(e,n)}constructor(e,n){this.key=e,this.negated=n,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:oEe(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Ya.get(this.key);return typeof e=="boolean"?e?Cc.INSTANCE:Hl.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Gx.create(this.key,this)),this.negated}}class OI{static create(e,n,r=null){if(typeof n=="boolean")return n?Kx.create(e,r):Gx.create(e,r);const s=Ya.get(e);return typeof s=="boolean"?n===(s?"true":"false")?Cc.INSTANCE:Hl.INSTANCE:new OI(e,n,r)}constructor(e,n,r){this.key=e,this.value=n,this.negated=r,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Xx(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Ya.get(this.key);if(typeof e=="boolean"){const n=e?"true":"false";return this.value===n?Cc.INSTANCE:Hl.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n$.create(this.key,this.value,this)),this.negated}}class e${static create(e,n){return new e$(e,n)}constructor(e,n){this.key=e,this.valueKey=n,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Xx(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const n=e.getValue(this.valueKey),r=e.getValue(this.key);return Array.isArray(n)?n.includes(r):typeof r=="string"&&typeof n=="object"&&n!==null?Kot.call(n,r):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=t$.create(this.key,this.valueKey)),this.negated}}class t${static create(e,n){return new t$(e,n)}constructor(e,n){this.key=e,this.valueKey=n,this.type=11,this._negated=e$.create(e,n)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class n${static create(e,n,r=null){if(typeof n=="boolean")return n?Gx.create(e,r):Kx.create(e,r);const s=Ya.get(e);return typeof s=="boolean"?n===(s?"true":"false")?Hl.INSTANCE:Cc.INSTANCE:new n$(e,n,r)}constructor(e,n,r){this.key=e,this.value=n,this.negated=r,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Xx(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Ya.get(this.key);if(typeof e=="boolean"){const n=e?"true":"false";return this.value===n?Hl.INSTANCE:Cc.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=OI.create(this.key,this.value,this)),this.negated}}class Gx{static create(e,n=null){const r=Ya.get(e);return typeof r=="boolean"?r?Hl.INSTANCE:Cc.INSTANCE:new Gx(e,n)}constructor(e,n){this.key=e,this.negated=n,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:oEe(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Ya.get(this.key);return typeof e=="boolean"?e?Hl.INSTANCE:Cc.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Kx.create(this.key,this)),this.negated}}function i$(i,e){if(typeof i=="string"){const n=parseFloat(i);isNaN(n)||(i=n)}return typeof i=="string"||typeof i=="number"?e(i):Hl.INSTANCE}class r${static create(e,n,r=null){return i$(n,s=>new r$(e,s,r))}constructor(e,n,r){this.key=e,this.value=n,this.negated=r,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Xx(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a$.create(this.key,this.value,this)),this.negated}}class s${static create(e,n,r=null){return i$(n,s=>new s$(e,s,r))}constructor(e,n,r){this.key=e,this.value=n,this.negated=r,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Xx(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o$.create(this.key,this.value,this)),this.negated}}class o${static create(e,n,r=null){return i$(n,s=>new o$(e,s,r))}constructor(e,n,r){this.key=e,this.value=n,this.negated=r,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Xx(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s$.create(this.key,this.value,this)),this.negated}}class a${static create(e,n,r=null){return i$(n,s=>new a$(e,s,r))}constructor(e,n,r){this.key=e,this.value=n,this.negated=r,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Xx(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r$.create(this.key,this.value,this)),this.negated}}class cP{static create(e,n){return new cP(e,n)}constructor(e,n){this.key=e,this.regexp=n,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const n=this.regexp?this.regexp.source:"",r=e.regexp?e.regexp.source:"";return n<r?-1:n>r?1:0}equals(e){if(e.type===this.type){const n=this.regexp?this.regexp.source:"",r=e.regexp?e.regexp.source:"";return this.key===e.key&&n===r}return!1}substituteConstants(){return this}evaluate(e){const n=e.getValue(this.key);return this.regexp?this.regexp.test(n):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Gse.create(this)),this.negated}}class Gse{static create(e){return new Gse(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function sEe(i){let e=null;for(let n=0,r=i.length;n<r;n++){const s=i[n].substituteConstants();if(i[n]!==s&&e===null){e=[];for(let o=0;o<n;o++)e[o]=i[o]}e!==null&&(e[n]=s)}return e===null?i:e}class pS{static create(e,n,r){return pS._normalizeArr(e,n,r)}constructor(e,n){this.expr=e,this.negated=n,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let n=0,r=this.expr.length;n<r;n++){const s=JN(this.expr[n],e.expr[n]);if(s!==0)return s}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let n=0,r=this.expr.length;n<r;n++)if(!this.expr[n].equals(e.expr[n]))return!1;return!0}return!1}substituteConstants(){const e=sEe(this.expr);return e===this.expr?this:pS.create(e,this.negated,!1)}evaluate(e){for(let n=0,r=this.expr.length;n<r;n++)if(!this.expr[n].evaluate(e))return!1;return!0}static _normalizeArr(e,n,r){const s=[];let o=!1;for(const a of e)if(a){if(a.type===1){o=!0;continue}if(a.type===0)return Hl.INSTANCE;if(a.type===6){s.push(...a.expr);continue}s.push(a)}if(s.length===0&&o)return Cc.INSTANCE;if(s.length!==0){if(s.length===1)return s[0];s.sort(JN);for(let a=1;a<s.length;a++)s[a-1].equals(s[a])&&(s.splice(a,1),a--);if(s.length===1)return s[0];for(;s.length>1;){const a=s[s.length-1];if(a.type!==9)break;s.pop();const l=s.pop(),c=s.length===0,u=$0.create(a.expr.map(d=>pS.create([d,l],null,r)),null,c);u&&(s.push(u),s.sort(JN))}if(s.length===1)return s[0];if(r){for(let a=0;a<s.length;a++)for(let l=a+1;l<s.length;l++)if(s[a].negate().equals(s[l]))return Hl.INSTANCE;if(s.length===1)return s[0]}return new pS(s,n)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(const n of this.expr)e.push(...n.keys());return e}negate(){if(!this.negated){const e=[];for(const n of this.expr)e.push(n.negate());this.negated=$0.create(e,this,!0)}return this.negated}}class $0{static create(e,n,r){return $0._normalizeArr(e,n,r)}constructor(e,n){this.expr=e,this.negated=n,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let n=0,r=this.expr.length;n<r;n++){const s=JN(this.expr[n],e.expr[n]);if(s!==0)return s}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let n=0,r=this.expr.length;n<r;n++)if(!this.expr[n].equals(e.expr[n]))return!1;return!0}return!1}substituteConstants(){const e=sEe(this.expr);return e===this.expr?this:$0.create(e,this.negated,!1)}evaluate(e){for(let n=0,r=this.expr.length;n<r;n++)if(this.expr[n].evaluate(e))return!0;return!1}static _normalizeArr(e,n,r){let s=[],o=!1;if(e){for(let a=0,l=e.length;a<l;a++){const c=e[a];if(c){if(c.type===0){o=!0;continue}if(c.type===1)return Cc.INSTANCE;if(c.type===9){s=s.concat(c.expr);continue}s.push(c)}}if(s.length===0&&o)return Hl.INSTANCE;s.sort(JN)}if(s.length!==0){if(s.length===1)return s[0];for(let a=1;a<s.length;a++)s[a-1].equals(s[a])&&(s.splice(a,1),a--);if(s.length===1)return s[0];if(r){for(let a=0;a<s.length;a++)for(let l=a+1;l<s.length;l++)if(s[a].negate().equals(s[l]))return Cc.INSTANCE;if(s.length===1)return s[0]}return new $0(s,n)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(const n of this.expr)e.push(...n.keys());return e}negate(){if(!this.negated){const e=[];for(const n of this.expr)e.push(n.negate());for(;e.length>1;){const n=e.shift(),r=e.shift(),s=[];for(const o of Qfe(n))for(const a of Qfe(r))s.push(pS.create([o,a],null,!1));e.unshift($0.create(s,null,!1))}this.negated=$0.create(e,this,!0)}return this.negated}}class yt extends Kx{static all(){return yt._info.values()}constructor(e,n,r){super(e,null),this._defaultValue=n,typeof r=="object"?yt._info.push(Object.assign(Object.assign({},r),{key:e})):r!==!0&&yt._info.push({key:e,description:r,type:n!=null?typeof n:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return OI.create(this.key,e)}}yt._info=[];const mn=qn("contextKeyService");function oEe(i,e){return i<e?-1:i>e?1:0}function Xx(i,e,n,r){return i<n?-1:i>n?1:e<r?-1:e>r?1:0}function sJ(i,e){if(i.type===0||e.type===1)return!0;if(i.type===9)return e.type===9?Zfe(i.expr,e.expr):!1;if(e.type===9){for(const n of e.expr)if(sJ(i,n))return!0;return!1}if(i.type===6){if(e.type===6)return Zfe(e.expr,i.expr);for(const n of i.expr)if(sJ(n,e))return!0;return!1}return i.equals(e)}function Zfe(i,e){let n=0,r=0;for(;n<i.length&&r<e.length;){const s=i[n].cmp(e[r]);if(s<0)return!1;s===0&&n++,r++}return n===i.length}function Qfe(i){return i.type===9?i.expr:[i]}function oJ(i,e){if(typeof i=="number"){if(i===0)return null;const n=(i&65535)>>>0,r=(i&4294901760)>>>16;return r!==0?new UU([F3(n,e),F3(r,e)]):new UU([F3(n,e)])}else{const n=[];for(let r=0;r<i.length;r++)n.push(F3(i[r],e));return new UU(n)}}function F3(i,e){const n=!!(i&2048),r=!!(i&256),s=e===2?r:n,o=!!(i&1024),a=!!(i&512),l=e===2?n:r,c=i&255;return new Iv(s,o,a,l,c)}class Iv{constructor(e,n,r,s,o){this.ctrlKey=e,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=o}equals(e){return e instanceof Iv&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}}class UU{constructor(e){if(e.length===0)throw uh("chords");this.chords=e}}class iat{constructor(e,n,r,s,o,a){this.ctrlKey=e,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyLabel=o,this.keyAriaLabel=a}}class rat{}function qU(i,e){if(!i)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function l$(i,e="Unreachable"){throw new Error(e)}function uP(i){if(!i()){debugger;i(),Ln(new Vs("Assertion Failed"))}}function aEe(i,e){let n=0;for(;n<i.length-1;){const r=i[n],s=i[n+1];if(!e(r,s))return!1;n++}return!0}class sat{constructor(){this.data=new Map}add(e,n){qU(zl(e)),qU(Bl(n)),qU(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,n)}as(e){return this.data.get(e)||null}}const Kr=new sat;class Xse{constructor(){this._coreKeybindings=new jl,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(Zu===1){if(e&&e.win)return e.win}else if(Zu===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const n=Xse.bindToCurrentPlatform(e),r=new Xe;if(n&&n.primary){const s=oJ(n.primary,Zu);s&&r.add(this._registerDefaultKeybinding(s,e.id,e.args,e.weight,0,e.when))}if(n&&Array.isArray(n.secondary))for(let s=0,o=n.secondary.length;s<o;s++){const a=n.secondary[s],l=oJ(a,Zu);l&&r.add(this._registerDefaultKeybinding(l,e.id,e.args,e.weight,-s-1,e.when))}return r}registerCommandAndKeybindingRule(e){return Sf(this.registerKeybindingRule(e),si.registerCommand(e))}_registerDefaultKeybinding(e,n,r,s,o,a){const l=this._coreKeybindings.push({keybinding:e,command:n,commandArgs:r,when:a,weight1:s,weight2:o,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,gn(()=>{l(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(aat)),this._cachedMergedKeybindings.slice(0)}}const Sc=new Xse,oat={EditorModes:"platform.keybindingsRegistry"};Kr.add(oat.EditorModes,Sc);function aat(i,e){if(i.weight1!==e.weight1)return i.weight1-e.weight1;if(i.command&&e.command){if(i.command<e.command)return-1;if(i.command>e.command)return 1}return i.weight2-e.weight2}var lat=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Jfe=function(i,e){return function(n,r){e(n,r,i)}},cat=function(i,e){var n={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&e.indexOf(r)<0&&(n[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(i);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(i,r[s])&&(n[r[s]]=i[r[s]]);return n},s8;function i2(i){return i.command!==void 0}function uat(i){return i.submenu!==void 0}class se{constructor(e){if(se._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);se._instances.set(e,this),this.id=e}}se._instances=new Map;se.CommandPalette=new se("CommandPalette");se.DebugBreakpointsContext=new se("DebugBreakpointsContext");se.DebugCallStackContext=new se("DebugCallStackContext");se.DebugConsoleContext=new se("DebugConsoleContext");se.DebugVariablesContext=new se("DebugVariablesContext");se.DebugWatchContext=new se("DebugWatchContext");se.DebugToolBar=new se("DebugToolBar");se.DebugToolBarStop=new se("DebugToolBarStop");se.EditorContext=new se("EditorContext");se.SimpleEditorContext=new se("SimpleEditorContext");se.EditorContent=new se("EditorContent");se.EditorLineNumberContext=new se("EditorLineNumberContext");se.EditorContextCopy=new se("EditorContextCopy");se.EditorContextPeek=new se("EditorContextPeek");se.EditorContextShare=new se("EditorContextShare");se.EditorTitle=new se("EditorTitle");se.EditorTitleRun=new se("EditorTitleRun");se.EditorTitleContext=new se("EditorTitleContext");se.EditorTitleContextShare=new se("EditorTitleContextShare");se.EmptyEditorGroup=new se("EmptyEditorGroup");se.EmptyEditorGroupContext=new se("EmptyEditorGroupContext");se.EditorTabsBarContext=new se("EditorTabsBarContext");se.ExplorerContext=new se("ExplorerContext");se.ExplorerContextShare=new se("ExplorerContextShare");se.ExtensionContext=new se("ExtensionContext");se.GlobalActivity=new se("GlobalActivity");se.CommandCenter=new se("CommandCenter");se.CommandCenterCenter=new se("CommandCenterCenter");se.LayoutControlMenuSubmenu=new se("LayoutControlMenuSubmenu");se.LayoutControlMenu=new se("LayoutControlMenu");se.MenubarMainMenu=new se("MenubarMainMenu");se.MenubarAppearanceMenu=new se("MenubarAppearanceMenu");se.MenubarDebugMenu=new se("MenubarDebugMenu");se.MenubarEditMenu=new se("MenubarEditMenu");se.MenubarCopy=new se("MenubarCopy");se.MenubarFileMenu=new se("MenubarFileMenu");se.MenubarGoMenu=new se("MenubarGoMenu");se.MenubarHelpMenu=new se("MenubarHelpMenu");se.MenubarLayoutMenu=new se("MenubarLayoutMenu");se.MenubarNewBreakpointMenu=new se("MenubarNewBreakpointMenu");se.PanelAlignmentMenu=new se("PanelAlignmentMenu");se.PanelPositionMenu=new se("PanelPositionMenu");se.MenubarPreferencesMenu=new se("MenubarPreferencesMenu");se.MenubarRecentMenu=new se("MenubarRecentMenu");se.MenubarSelectionMenu=new se("MenubarSelectionMenu");se.MenubarShare=new se("MenubarShare");se.MenubarSwitchEditorMenu=new se("MenubarSwitchEditorMenu");se.MenubarSwitchGroupMenu=new se("MenubarSwitchGroupMenu");se.MenubarTerminalMenu=new se("MenubarTerminalMenu");se.MenubarViewMenu=new se("MenubarViewMenu");se.MenubarHomeMenu=new se("MenubarHomeMenu");se.OpenEditorsContext=new se("OpenEditorsContext");se.OpenEditorsContextShare=new se("OpenEditorsContextShare");se.ProblemsPanelContext=new se("ProblemsPanelContext");se.SCMChangeContext=new se("SCMChangeContext");se.SCMResourceContext=new se("SCMResourceContext");se.SCMResourceContextShare=new se("SCMResourceContextShare");se.SCMResourceFolderContext=new se("SCMResourceFolderContext");se.SCMResourceGroupContext=new se("SCMResourceGroupContext");se.SCMSourceControl=new se("SCMSourceControl");se.SCMTitle=new se("SCMTitle");se.SearchContext=new se("SearchContext");se.SearchActionMenu=new se("SearchActionContext");se.StatusBarWindowIndicatorMenu=new se("StatusBarWindowIndicatorMenu");se.StatusBarRemoteIndicatorMenu=new se("StatusBarRemoteIndicatorMenu");se.StickyScrollContext=new se("StickyScrollContext");se.TestItem=new se("TestItem");se.TestItemGutter=new se("TestItemGutter");se.TestMessageContext=new se("TestMessageContext");se.TestMessageContent=new se("TestMessageContent");se.TestPeekElement=new se("TestPeekElement");se.TestPeekTitle=new se("TestPeekTitle");se.TouchBarContext=new se("TouchBarContext");se.TitleBarContext=new se("TitleBarContext");se.TitleBarTitleContext=new se("TitleBarTitleContext");se.TunnelContext=new se("TunnelContext");se.TunnelPrivacy=new se("TunnelPrivacy");se.TunnelProtocol=new se("TunnelProtocol");se.TunnelPortInline=new se("TunnelInline");se.TunnelTitle=new se("TunnelTitle");se.TunnelLocalAddressInline=new se("TunnelLocalAddressInline");se.TunnelOriginInline=new se("TunnelOriginInline");se.ViewItemContext=new se("ViewItemContext");se.ViewContainerTitle=new se("ViewContainerTitle");se.ViewContainerTitleContext=new se("ViewContainerTitleContext");se.ViewTitle=new se("ViewTitle");se.ViewTitleContext=new se("ViewTitleContext");se.CommentEditorActions=new se("CommentEditorActions");se.CommentThreadTitle=new se("CommentThreadTitle");se.CommentThreadActions=new se("CommentThreadActions");se.CommentThreadAdditionalActions=new se("CommentThreadAdditionalActions");se.CommentThreadTitleContext=new se("CommentThreadTitleContext");se.CommentThreadCommentContext=new se("CommentThreadCommentContext");se.CommentTitle=new se("CommentTitle");se.CommentActions=new se("CommentActions");se.InteractiveToolbar=new se("InteractiveToolbar");se.InteractiveCellTitle=new se("InteractiveCellTitle");se.InteractiveCellDelete=new se("InteractiveCellDelete");se.InteractiveCellExecute=new se("InteractiveCellExecute");se.InteractiveInputExecute=new se("InteractiveInputExecute");se.NotebookToolbar=new se("NotebookToolbar");se.NotebookStickyScrollContext=new se("NotebookStickyScrollContext");se.NotebookCellTitle=new se("NotebookCellTitle");se.NotebookCellDelete=new se("NotebookCellDelete");se.NotebookCellInsert=new se("NotebookCellInsert");se.NotebookCellBetween=new se("NotebookCellBetween");se.NotebookCellListTop=new se("NotebookCellTop");se.NotebookCellExecute=new se("NotebookCellExecute");se.NotebookCellExecutePrimary=new se("NotebookCellExecutePrimary");se.NotebookDiffCellInputTitle=new se("NotebookDiffCellInputTitle");se.NotebookDiffCellMetadataTitle=new se("NotebookDiffCellMetadataTitle");se.NotebookDiffCellOutputsTitle=new se("NotebookDiffCellOutputsTitle");se.NotebookOutputToolbar=new se("NotebookOutputToolbar");se.NotebookEditorLayoutConfigure=new se("NotebookEditorLayoutConfigure");se.NotebookKernelSource=new se("NotebookKernelSource");se.BulkEditTitle=new se("BulkEditTitle");se.BulkEditContext=new se("BulkEditContext");se.TimelineItemContext=new se("TimelineItemContext");se.TimelineTitle=new se("TimelineTitle");se.TimelineTitleContext=new se("TimelineTitleContext");se.TimelineFilterSubMenu=new se("TimelineFilterSubMenu");se.AccountsContext=new se("AccountsContext");se.PanelTitle=new se("PanelTitle");se.AuxiliaryBarTitle=new se("AuxiliaryBarTitle");se.TerminalInstanceContext=new se("TerminalInstanceContext");se.TerminalEditorInstanceContext=new se("TerminalEditorInstanceContext");se.TerminalNewDropdownContext=new se("TerminalNewDropdownContext");se.TerminalTabContext=new se("TerminalTabContext");se.TerminalTabEmptyAreaContext=new se("TerminalTabEmptyAreaContext");se.WebviewContext=new se("WebviewContext");se.InlineCompletionsActions=new se("InlineCompletionsActions");se.NewFile=new se("NewFile");se.MergeInput1Toolbar=new se("MergeToolbar1Toolbar");se.MergeInput2Toolbar=new se("MergeToolbar2Toolbar");se.MergeBaseToolbar=new se("MergeBaseToolbar");se.MergeInputResultToolbar=new se("MergeToolbarResultToolbar");se.InlineSuggestionToolbar=new se("InlineSuggestionToolbar");se.ChatContext=new se("ChatContext");se.ChatCodeBlock=new se("ChatCodeblock");se.ChatMessageTitle=new se("ChatMessageTitle");se.ChatExecute=new se("ChatExecute");se.ChatInputSide=new se("ChatInputSide");se.AccessibleView=new se("AccessibleView");const c_=qn("menuService");class z0{static for(e){let n=this._all.get(e);return n||(n=new z0(e),this._all.set(e,n)),n}static merge(e){const n=new Set;for(const r of e)r instanceof z0&&n.add(r.id);return n}constructor(e){this.id=e,this.has=n=>n===e}}z0._all=new Map;const sa=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Hst({merge:z0.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(i){return this._commands.set(i.id,i),this._onDidChangeMenu.fire(z0.for(se.CommandPalette)),gn(()=>{this._commands.delete(i.id)&&this._onDidChangeMenu.fire(z0.for(se.CommandPalette))})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((e,n)=>i.set(n,e)),i}appendMenuItem(i,e){let n=this._menuItems.get(i);n||(n=new jl,this._menuItems.set(i,n));const r=n.push(e);return this._onDidChangeMenu.fire(z0.for(i)),gn(()=>{r(),this._onDidChangeMenu.fire(z0.for(i))})}appendMenuItems(i){const e=new Xe;for(const{id:n,item:r}of i)e.add(this.appendMenuItem(n,r));return e}getMenuItems(i){let e;return this._menuItems.has(i)?e=[...this._menuItems.get(i)]:e=[],i===se.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(i){const e=new Set;for(const n of i)i2(n)&&(e.add(n.command.id),n.alt&&e.add(n.alt.id));this._commands.forEach((n,r)=>{e.has(r)||i.push({command:n})})}};class dP extends NE{constructor(e,n,r){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,r,"submenu"),this.item=e,this.hideActions=n}}let If=s8=class{static label(e,n){return n!=null&&n.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,n,r,s,o,a){var l,c;this.hideActions=s,this._commandService=a,this.id=e.id,this.label=s8.label(e,r),this.tooltip=(c=typeof e.tooltip=="string"?e.tooltip:(l=e.tooltip)===null||l===void 0?void 0:l.value)!==null&&c!==void 0?c:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let u;if(e.toggled){const d=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(d.condition),this.checked&&d.tooltip&&(this.tooltip=typeof d.tooltip=="string"?d.tooltip:d.tooltip.value),this.checked&&en.isThemeIcon(d.icon)&&(u=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}u||(u=en.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=n?new s8(n,void 0,r,s,o,a):void 0,this._options=r,this.class=u&&en.asClassName(u)}run(...e){var n,r;let s=[];return!((n=this._options)===null||n===void 0)&&n.arg&&(s=[...s,this._options.arg]),!((r=this._options)===null||r===void 0)&&r.shouldForwardArgs&&(s=[...s,...e]),this._commandService.executeCommand(this.id,...s)}};If=s8=lat([Jfe(4,mn),Jfe(5,us)],If);class md{constructor(e){this.desc=e}}function Ir(i){const e=new Xe,n=new i,r=n.desc,{f1:s,menu:o,keybinding:a,description:l}=r,c=cat(r,["f1","menu","keybinding","description"]);if(e.add(si.registerCommand({id:c.id,handler:(u,...d)=>n.run(u,...d),description:l})),Array.isArray(o))for(const u of o)e.add(sa.appendMenuItem(u.id,Object.assign({command:Object.assign(Object.assign({},c),{precondition:u.precondition===null?void 0:c.precondition})},u)));else o&&e.add(sa.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},c),{precondition:o.precondition===null?void 0:c.precondition})},o)));if(s&&(e.add(sa.appendMenuItem(se.CommandPalette,{command:c,when:c.precondition})),e.add(sa.addCommand(c))),Array.isArray(a))for(const u of a)e.add(Sc.registerKeybindingRule(Object.assign(Object.assign({},u),{id:c.id,when:c.precondition?ze.and(c.precondition,u.when):u.when})));else a&&e.add(Sc.registerKeybindingRule(Object.assign(Object.assign({},a),{id:c.id,when:c.precondition?ze.and(c.precondition,a.when):a.when})));return e}const _d=qn("telemetryService"),vd=qn("logService");var La;(function(i){i[i.Off=0]="Off",i[i.Trace=1]="Trace",i[i.Debug=2]="Debug",i[i.Info=3]="Info",i[i.Warning=4]="Warning",i[i.Error=5]="Error"})(La||(La={}));const lEe=La.Info;class cEe extends Le{constructor(){super(...arguments),this.level=lEe,this._onDidChangeLogLevel=this._register(new _e),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==La.Off&&this.level<=e}}class dat extends cEe{constructor(e=lEe,n=!0){super(),this.useColors=n,this.setLevel(e)}trace(e,...n){this.checkLogLevel(La.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...n):console.log(e,...n))}debug(e,...n){this.checkLogLevel(La.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...n):console.log(e,...n))}info(e,...n){this.checkLogLevel(La.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...n):console.log(e,...n))}warn(e,...n){this.checkLogLevel(La.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...n):console.log(e,...n))}error(e,...n){this.checkLogLevel(La.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...n):console.error(e,...n))}dispose(){}}class hat extends cEe{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const n of this.loggers)n.setLevel(e);super.setLevel(e)}trace(e,...n){for(const r of this.loggers)r.trace(e,...n)}debug(e,...n){for(const r of this.loggers)r.debug(e,...n)}info(e,...n){for(const r of this.loggers)r.info(e,...n)}warn(e,...n){for(const r of this.loggers)r.warn(e,...n)}error(e,...n){for(const r of this.loggers)r.error(e,...n)}dispose(){for(const e of this.loggers)e.dispose()}}function fat(i){switch(i){case La.Trace:return"trace";case La.Debug:return"debug";case La.Info:return"info";case La.Warning:return"warn";case La.Error:return"error";case La.Off:return"off"}}new yt("logLevel",fat(La.Info));const Yse={clipboard:{writeText:Um||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Um||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function pat(i){if(i.charCode){const n=String.fromCharCode(i.charCode).toUpperCase();return W0.fromString(n)}const e=i.keyCode;if(e===3)return 7;if(gh)switch(e){case 59:return 85;case 60:if(_l)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ri)return 57;break}else if(QW){if(ri&&e===93)return 57;if(!ri&&e===92)return 57}return P2e[e]||0}const gat=ri?256:2048,mat=512,_at=1024,vat=ri?2048:256;class yr{constructor(e){this._standardKeyboardEventBrand=!0;const n=e;this.browserEvent=n,this.target=n.target,this.ctrlKey=n.ctrlKey,this.shiftKey=n.shiftKey,this.altKey=n.altKey,this.metaKey=n.metaKey,this.altGraphKey=n.getModifierState("AltGraph"),this.keyCode=pat(n),this.code=n.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let n=0;return this.ctrlKey&&(n|=gat),this.altKey&&(n|=mat),this.shiftKey&&(n|=_at),this.metaKey&&(n|=vat),n|=e,n}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Iv(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let epe=!1,BR=null;function bat(i){if(!i.parent||i.parent===i)return null;try{const e=i.location,n=i.parent.location;if(e.origin!=="null"&&n.origin!=="null"&&e.origin!==n.origin)return epe=!0,null}catch{return epe=!0,null}return i.parent}class yat{static getSameOriginWindowChain(){if(!BR){BR=[];let e=window,n;do n=bat(e),n?BR.push({window:e,iframeElement:e.frameElement||null}):BR.push({window:e,iframeElement:null}),e=n;while(e)}return BR.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,n){if(!n||e===n)return{top:0,left:0};let r=0,s=0;const o=this.getSameOriginWindowChain();for(const a of o){if(r+=a.window.scrollY,s+=a.window.scrollX,a.window===n||!a.iframeElement)break;const l=a.iframeElement.getBoundingClientRect();r+=l.top,s+=l.left}return{top:r,left:s}}}class rh{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const n=yat.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class ux{constructor(e,n=0,r=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=n,e){const s=e,o=e;if(typeof s.wheelDeltaY<"u")this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const a=e;a.deltaMode===a.DOM_DELTA_LINE?gh&&!ri?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")h1&&Aa?this.deltaX=-(s.wheelDeltaX/120):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const a=e;a.deltaMode===a.DOM_DELTA_LINE?gh&&!ri?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)===null||e===void 0||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)===null||e===void 0||e.stopPropagation()}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:uEe,setPrototypeOf:tpe,isFrozen:wat,getPrototypeOf:Cat,getOwnPropertyDescriptor:Sat}=Object;let{freeze:cu,seal:Gp,create:xat}=Object,{apply:aJ,construct:lJ}=typeof Reflect<"u"&&Reflect;aJ||(aJ=function(e,n,r){return e.apply(n,r)});cu||(cu=function(e){return e});Gp||(Gp=function(e){return e});lJ||(lJ=function(e,n){return new e(...n)});const kat=Tf(Array.prototype.forEach),npe=Tf(Array.prototype.pop),jR=Tf(Array.prototype.push),o8=Tf(String.prototype.toLowerCase),KU=Tf(String.prototype.toString),Lat=Tf(String.prototype.match),op=Tf(String.prototype.replace),Dat=Tf(String.prototype.indexOf),Eat=Tf(String.prototype.trim),Od=Tf(RegExp.prototype.test),WR=Iat(TypeError);function Tf(i){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return aJ(i,e,r)}}function Iat(i){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return lJ(i,n)}}function Vi(i,e,n){var r;n=(r=n)!==null&&r!==void 0?r:o8,tpe&&tpe(i,null);let s=e.length;for(;s--;){let o=e[s];if(typeof o=="string"){const a=n(o);a!==o&&(wat(e)||(e[s]=a),o=a)}i[o]=!0}return i}function XL(i){const e=xat(null);for(const[n,r]of uEe(i))e[n]=r;return e}function B3(i,e){for(;i!==null;){const r=Sat(i,e);if(r){if(r.get)return Tf(r.get);if(typeof r.value=="function")return Tf(r.value)}i=Cat(i)}function n(r){return console.warn("fallback value for",r),null}return n}const ipe=cu(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),GU=cu(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),XU=cu(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Tat=cu(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),YU=cu(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Rat=cu(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),rpe=cu(["#text"]),spe=cu(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),ZU=cu(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ope=cu(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),j3=cu(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Aat=Gp(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nat=Gp(/<%[\w\W]*|[\w\W]*%>/gm),Mat=Gp(/\${[\w\W]*}/gm),Pat=Gp(/^data-[\-\w.\u00B7-\uFFFF]/),Oat=Gp(/^aria-[\-\w]+$/),dEe=Gp(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fat=Gp(/^(?:\w+script|data):/i),Bat=Gp(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hEe=Gp(/^html$/i);var ape=Object.freeze({__proto__:null,MUSTACHE_EXPR:Aat,ERB_EXPR:Nat,TMPLIT_EXPR:Mat,DATA_ATTR:Pat,ARIA_ATTR:Oat,IS_ALLOWED_URI:dEe,IS_SCRIPT_OR_DATA:Fat,ATTR_WHITESPACE:Bat,DOCTYPE_NAME:hEe});const jat=()=>typeof window>"u"?null:window,Wat=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function fEe(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jat();const e=yn=>fEe(yn);if(e.version="3.0.5",e.removed=[],!i||!i.document||i.document.nodeType!==9)return e.isSupported=!1,e;const n=i.document,r=n.currentScript;let{document:s}=i;const{DocumentFragment:o,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:p}=i,g=c.prototype,m=B3(g,"cloneNode"),_=B3(g,"nextSibling"),b=B3(g,"childNodes"),y=B3(g,"parentNode");if(typeof a=="function"){const yn=s.createElement("template");yn.content&&yn.content.ownerDocument&&(s=yn.content.ownerDocument)}let x,k="";const{implementation:D,createNodeIterator:R,createDocumentFragment:E,getElementsByTagName:A}=s,{importNode:M}=n;let N={};e.isSupported=typeof uEe=="function"&&typeof y=="function"&&D&&D.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:P,ERB_EXPR:O,TMPLIT_EXPR:B,DATA_ATTR:j,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:Y}=ape;let{IS_ALLOWED_URI:X}=ape,Q=null;const ie=Vi({},[...ipe,...GU,...XU,...YU,...rpe]);let K=null;const ee=Vi({},[...spe,...ZU,...ope,...j3]);let le=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ke=null,xe=null,me=!0,Ee=!0,je=!1,qe=!0,Ze=!1,We=!1,ut=!1,st=!1,mt=!1,Rt=!1,Vt=!1,Ot=!0,vt=!1;const wn="user-content-";let Ce=!0,ge=!1,pe={},ne=null;const ae=Vi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const de=Vi({},["audio","video","img","source","image","track"]);let Se=null;const Ie=Vi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",Oe="http://www.w3.org/2000/svg",Ve="http://www.w3.org/1999/xhtml";let gt=Ve,$t=!1,Mt=null;const Bt=Vi({},[nt,Oe,Ve],KU);let jn;const Dt=["application/xhtml+xml","text/html"],Fn="text/html";let tn,pi=null;const Pi=s.createElement("form"),ti=function(Pe){return Pe instanceof RegExp||Pe instanceof Function},mi=function(Pe){if(!(pi&&pi===Pe)){if((!Pe||typeof Pe!="object")&&(Pe={}),Pe=XL(Pe),jn=Dt.indexOf(Pe.PARSER_MEDIA_TYPE)===-1?jn=Fn:jn=Pe.PARSER_MEDIA_TYPE,tn=jn==="application/xhtml+xml"?KU:o8,Q="ALLOWED_TAGS"in Pe?Vi({},Pe.ALLOWED_TAGS,tn):ie,K="ALLOWED_ATTR"in Pe?Vi({},Pe.ALLOWED_ATTR,tn):ee,Mt="ALLOWED_NAMESPACES"in Pe?Vi({},Pe.ALLOWED_NAMESPACES,KU):Bt,Se="ADD_URI_SAFE_ATTR"in Pe?Vi(XL(Ie),Pe.ADD_URI_SAFE_ATTR,tn):Ie,ue="ADD_DATA_URI_TAGS"in Pe?Vi(XL(de),Pe.ADD_DATA_URI_TAGS,tn):de,ne="FORBID_CONTENTS"in Pe?Vi({},Pe.FORBID_CONTENTS,tn):ae,ke="FORBID_TAGS"in Pe?Vi({},Pe.FORBID_TAGS,tn):{},xe="FORBID_ATTR"in Pe?Vi({},Pe.FORBID_ATTR,tn):{},pe="USE_PROFILES"in Pe?Pe.USE_PROFILES:!1,me=Pe.ALLOW_ARIA_ATTR!==!1,Ee=Pe.ALLOW_DATA_ATTR!==!1,je=Pe.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=Pe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ze=Pe.SAFE_FOR_TEMPLATES||!1,We=Pe.WHOLE_DOCUMENT||!1,mt=Pe.RETURN_DOM||!1,Rt=Pe.RETURN_DOM_FRAGMENT||!1,Vt=Pe.RETURN_TRUSTED_TYPE||!1,st=Pe.FORCE_BODY||!1,Ot=Pe.SANITIZE_DOM!==!1,vt=Pe.SANITIZE_NAMED_PROPS||!1,Ce=Pe.KEEP_CONTENT!==!1,ge=Pe.IN_PLACE||!1,X=Pe.ALLOWED_URI_REGEXP||dEe,gt=Pe.NAMESPACE||Ve,le=Pe.CUSTOM_ELEMENT_HANDLING||{},Pe.CUSTOM_ELEMENT_HANDLING&&ti(Pe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=Pe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Pe.CUSTOM_ELEMENT_HANDLING&&ti(Pe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=Pe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Pe.CUSTOM_ELEMENT_HANDLING&&typeof Pe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=Pe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ze&&(Ee=!1),Rt&&(mt=!0),pe&&(Q=Vi({},[...rpe]),K=[],pe.html===!0&&(Vi(Q,ipe),Vi(K,spe)),pe.svg===!0&&(Vi(Q,GU),Vi(K,ZU),Vi(K,j3)),pe.svgFilters===!0&&(Vi(Q,XU),Vi(K,ZU),Vi(K,j3)),pe.mathMl===!0&&(Vi(Q,YU),Vi(K,ope),Vi(K,j3))),Pe.ADD_TAGS&&(Q===ie&&(Q=XL(Q)),Vi(Q,Pe.ADD_TAGS,tn)),Pe.ADD_ATTR&&(K===ee&&(K=XL(K)),Vi(K,Pe.ADD_ATTR,tn)),Pe.ADD_URI_SAFE_ATTR&&Vi(Se,Pe.ADD_URI_SAFE_ATTR,tn),Pe.FORBID_CONTENTS&&(ne===ae&&(ne=XL(ne)),Vi(ne,Pe.FORBID_CONTENTS,tn)),Ce&&(Q["#text"]=!0),We&&Vi(Q,["html","head","body"]),Q.table&&(Vi(Q,["tbody"]),delete ke.tbody),Pe.TRUSTED_TYPES_POLICY){if(typeof Pe.TRUSTED_TYPES_POLICY.createHTML!="function")throw WR('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Pe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw WR('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=Pe.TRUSTED_TYPES_POLICY,k=x.createHTML("")}else x===void 0&&(x=Wat(p,r)),x!==null&&typeof k=="string"&&(k=x.createHTML(""));cu&&cu(Pe),pi=Pe}},ds=Vi({},["mi","mo","mn","ms","mtext"]),Nr=Vi({},["foreignobject","desc","title","annotation-xml"]),Br=Vi({},["title","style","font","a","script"]),Mn=Vi({},GU);Vi(Mn,XU),Vi(Mn,Tat);const hr=Vi({},YU);Vi(hr,Rat);const rn=function(Pe){let De=y(Pe);(!De||!De.tagName)&&(De={namespaceURI:gt,tagName:"template"});const Ne=o8(Pe.tagName),At=o8(De.tagName);return Mt[Pe.namespaceURI]?Pe.namespaceURI===Oe?De.namespaceURI===Ve?Ne==="svg":De.namespaceURI===nt?Ne==="svg"&&(At==="annotation-xml"||ds[At]):!!Mn[Ne]:Pe.namespaceURI===nt?De.namespaceURI===Ve?Ne==="math":De.namespaceURI===Oe?Ne==="math"&&Nr[At]:!!hr[Ne]:Pe.namespaceURI===Ve?De.namespaceURI===Oe&&!Nr[At]||De.namespaceURI===nt&&!ds[At]?!1:!hr[Ne]&&(Br[Ne]||!Mn[Ne]):!!(jn==="application/xhtml+xml"&&Mt[Pe.namespaceURI]):!1},sn=function(Pe){jR(e.removed,{element:Pe});try{Pe.parentNode.removeChild(Pe)}catch{Pe.remove()}},Kn=function(Pe,De){try{jR(e.removed,{attribute:De.getAttributeNode(Pe),from:De})}catch{jR(e.removed,{attribute:null,from:De})}if(De.removeAttribute(Pe),Pe==="is"&&!K[Pe])if(mt||Rt)try{sn(De)}catch{}else try{De.setAttribute(Pe,"")}catch{}},ai=function(Pe){let De,Ne;if(st)Pe="<remove></remove>"+Pe;else{const bn=Lat(Pe,/^[\r\n\t ]+/);Ne=bn&&bn[0]}jn==="application/xhtml+xml"&&gt===Ve&&(Pe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Pe+"</body></html>");const At=x?x.createHTML(Pe):Pe;if(gt===Ve)try{De=new f().parseFromString(At,jn)}catch{}if(!De||!De.documentElement){De=D.createDocument(gt,"template",null);try{De.documentElement.innerHTML=$t?k:At}catch{}}const En=De.body||De.documentElement;return Pe&&Ne&&En.insertBefore(s.createTextNode(Ne),En.childNodes[0]||null),gt===Ve?A.call(De,We?"html":"body")[0]:We?De.documentElement:En},Ki=function(Pe){return R.call(Pe.ownerDocument||Pe,Pe,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},so=function(Pe){return Pe instanceof h&&(typeof Pe.nodeName!="string"||typeof Pe.textContent!="string"||typeof Pe.removeChild!="function"||!(Pe.attributes instanceof d)||typeof Pe.removeAttribute!="function"||typeof Pe.setAttribute!="function"||typeof Pe.namespaceURI!="string"||typeof Pe.insertBefore!="function"||typeof Pe.hasChildNodes!="function")},_o=function(Pe){return typeof l=="object"?Pe instanceof l:Pe&&typeof Pe=="object"&&typeof Pe.nodeType=="number"&&typeof Pe.nodeName=="string"},Cs=function(Pe,De,Ne){N[Pe]&&kat(N[Pe],At=>{At.call(e,De,Ne,pi)})},_u=function(Pe){let De;if(Cs("beforeSanitizeElements",Pe,null),so(Pe))return sn(Pe),!0;const Ne=tn(Pe.nodeName);if(Cs("uponSanitizeElement",Pe,{tagName:Ne,allowedTags:Q}),Pe.hasChildNodes()&&!_o(Pe.firstElementChild)&&(!_o(Pe.content)||!_o(Pe.content.firstElementChild))&&Od(/<[/\w]/g,Pe.innerHTML)&&Od(/<[/\w]/g,Pe.textContent))return sn(Pe),!0;if(!Q[Ne]||ke[Ne]){if(!ke[Ne]&&qs(Ne)&&(le.tagNameCheck instanceof RegExp&&Od(le.tagNameCheck,Ne)||le.tagNameCheck instanceof Function&&le.tagNameCheck(Ne)))return!1;if(Ce&&!ne[Ne]){const At=y(Pe)||Pe.parentNode,En=b(Pe)||Pe.childNodes;if(En&&At){const bn=En.length;for(let Yn=bn-1;Yn>=0;--Yn)At.insertBefore(m(En[Yn],!0),_(Pe))}}return sn(Pe),!0}return Pe instanceof c&&!rn(Pe)||(Ne==="noscript"||Ne==="noembed"||Ne==="noframes")&&Od(/<\/no(script|embed|frames)/i,Pe.innerHTML)?(sn(Pe),!0):(Ze&&Pe.nodeType===3&&(De=Pe.textContent,De=op(De,P," "),De=op(De,O," "),De=op(De,B," "),Pe.textContent!==De&&(jR(e.removed,{element:Pe.cloneNode()}),Pe.textContent=De)),Cs("afterSanitizeElements",Pe,null),!1)},yl=function(Pe,De,Ne){if(Ot&&(De==="id"||De==="name")&&(Ne in s||Ne in Pi))return!1;if(!(Ee&&!xe[De]&&Od(j,De))){if(!(me&&Od(z,De))){if(!K[De]||xe[De]){if(!(qs(Pe)&&(le.tagNameCheck instanceof RegExp&&Od(le.tagNameCheck,Pe)||le.tagNameCheck instanceof Function&&le.tagNameCheck(Pe))&&(le.attributeNameCheck instanceof RegExp&&Od(le.attributeNameCheck,De)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(De))||De==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&Od(le.tagNameCheck,Ne)||le.tagNameCheck instanceof Function&&le.tagNameCheck(Ne))))return!1}else if(!Se[De]){if(!Od(X,op(Ne,Y,""))){if(!((De==="src"||De==="xlink:href"||De==="href")&&Pe!=="script"&&Dat(Ne,"data:")===0&&ue[Pe])){if(!(je&&!Od(H,op(Ne,Y,"")))){if(Ne)return!1}}}}}}return!0},qs=function(Pe){return Pe.indexOf("-")>0},Ks=function(Pe){let De,Ne,At,En;Cs("beforeSanitizeAttributes",Pe,null);const{attributes:bn}=Pe;if(!bn)return;const Yn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K};for(En=bn.length;En--;){De=bn[En];const{name:fr,namespaceURI:Ei}=De;if(Ne=fr==="value"?De.value:Eat(De.value),At=tn(fr),Yn.attrName=At,Yn.attrValue=Ne,Yn.keepAttr=!0,Yn.forceKeepAttr=void 0,Cs("uponSanitizeAttribute",Pe,Yn),Ne=Yn.attrValue,Yn.forceKeepAttr||(Kn(fr,Pe),!Yn.keepAttr))continue;if(!qe&&Od(/\/>/i,Ne)){Kn(fr,Pe);continue}Ze&&(Ne=op(Ne,P," "),Ne=op(Ne,O," "),Ne=op(Ne,B," "));const dg=tn(Pe.nodeName);if(yl(dg,At,Ne)){if(vt&&(At==="id"||At==="name")&&(Kn(fr,Pe),Ne=wn+Ne),x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Ei)switch(p.getAttributeType(dg,At)){case"TrustedHTML":{Ne=x.createHTML(Ne);break}case"TrustedScriptURL":{Ne=x.createScriptURL(Ne);break}}try{Ei?Pe.setAttributeNS(Ei,fr,Ne):Pe.setAttribute(fr,Ne),npe(e.removed)}catch{}}}Cs("afterSanitizeAttributes",Pe,null)},ma=function yn(Pe){let De;const Ne=Ki(Pe);for(Cs("beforeSanitizeShadowDOM",Pe,null);De=Ne.nextNode();)Cs("uponSanitizeShadowNode",De,null),!_u(De)&&(De.content instanceof o&&yn(De.content),Ks(De));Cs("afterSanitizeShadowDOM",Pe,null)};return e.sanitize=function(yn){let Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},De,Ne,At,En;if($t=!yn,$t&&(yn="<!-->"),typeof yn!="string"&&!_o(yn))if(typeof yn.toString=="function"){if(yn=yn.toString(),typeof yn!="string")throw WR("dirty is not a string, aborting")}else throw WR("toString is not a function");if(!e.isSupported)return yn;if(ut||mi(Pe),e.removed=[],typeof yn=="string"&&(ge=!1),ge){if(yn.nodeName){const fr=tn(yn.nodeName);if(!Q[fr]||ke[fr])throw WR("root node is forbidden and cannot be sanitized in-place")}}else if(yn instanceof l)De=ai("<!---->"),Ne=De.ownerDocument.importNode(yn,!0),Ne.nodeType===1&&Ne.nodeName==="BODY"||Ne.nodeName==="HTML"?De=Ne:De.appendChild(Ne);else{if(!mt&&!Ze&&!We&&yn.indexOf("<")===-1)return x&&Vt?x.createHTML(yn):yn;if(De=ai(yn),!De)return mt?null:Vt?k:""}De&&st&&sn(De.firstChild);const bn=Ki(ge?yn:De);for(;At=bn.nextNode();)_u(At)||(At.content instanceof o&&ma(At.content),Ks(At));if(ge)return yn;if(mt){if(Rt)for(En=E.call(De.ownerDocument);De.firstChild;)En.appendChild(De.firstChild);else En=De;return(K.shadowroot||K.shadowrootmode)&&(En=M.call(n,En,!0)),En}let Yn=We?De.outerHTML:De.innerHTML;return We&&Q["!doctype"]&&De.ownerDocument&&De.ownerDocument.doctype&&De.ownerDocument.doctype.name&&Od(hEe,De.ownerDocument.doctype.name)&&(Yn="<!DOCTYPE "+De.ownerDocument.doctype.name+`>
`+Yn),Ze&&(Yn=op(Yn,P," "),Yn=op(Yn,O," "),Yn=op(Yn,B," ")),x&&Vt?x.createHTML(Yn):Yn},e.setConfig=function(yn){mi(yn),ut=!0},e.clearConfig=function(){pi=null,ut=!1},e.isValidAttribute=function(yn,Pe,De){pi||mi({});const Ne=tn(yn),At=tn(Pe);return yl(Ne,At,De)},e.addHook=function(yn,Pe){typeof Pe=="function"&&(N[yn]=N[yn]||[],jR(N[yn],Pe))},e.removeHook=function(yn){if(N[yn])return npe(N[yn])},e.removeHooks=function(yn){N[yn]&&(N[yn]=[])},e.removeAllHooks=function(){N={}},e}var u_=fEe();u_.version;u_.isSupported;const pEe=u_.sanitize;u_.setConfig;u_.clearConfig;u_.isValidAttribute;const gEe=u_.addHook,mEe=u_.removeHook;u_.removeHooks;u_.removeAllHooks;var Pn;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatSesssion="vscode-chat-editor",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm"})(Pn||(Pn={}));const $at="tkn";class zat{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${Pn.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(l){return Ln(l),e}const n=e.authority;let r=this._hosts[n];r&&r.indexOf(":")!==-1&&r.indexOf("[")===-1&&(r=`[${r}]`);const s=this._ports[n],o=this._connectionTokens[n];let a=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(a+=`&${$at}=${encodeURIComponent(o)}`),Jt.from({scheme:H1?this._preferredWebSchema:Pn.vscodeRemoteResource,authority:`${r}:${s}`,path:this._remoteResourcesPath,query:a})}}const _Ee=new zat;class hP{uriToBrowserUri(e){return e.scheme===Pn.vscodeRemote?_Ee.rewrite(e):e.scheme===Pn.file&&(Um||Frt&&Cf.origin===`${Pn.vscodeFileResource}://${hP.FALLBACK_AUTHORITY}`)?e.with({scheme:Pn.vscodeFileResource,authority:e.authority||hP.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}hP.FALLBACK_AUTHORITY="vscode-app";const vEe=new hP;var lpe;(function(i){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const n="vscode-coi";function r(o){let a;typeof o=="string"?a=new URL(o).searchParams:o instanceof URL?a=o.searchParams:Jt.isUri(o)&&(a=new URL(o.toString(!0)).searchParams);const l=a==null?void 0:a.get(n);if(l)return e.get(l)}i.getHeadersFromQuery=r;function s(o,a,l){if(!globalThis.crossOriginIsolated)return;const c=a&&l?"3":l?"2":"1";o instanceof URLSearchParams?o.set(n,c):o[n]=c}i.addSearchParam=s})(lpe||(lpe={}));const{getWindows:Vat}=function(){const i=[],e=new _e;return{onDidCreateWindow:e.event,registerWindow(n){i.push(n);const r=new Xe;return r.add(gn(()=>{const s=i.indexOf(n);s!==-1&&i.splice(s,1)})),e.fire({window:n,disposableStore:r}),r},getWindows(){return i}}}();function la(i){for(;i.firstChild;)i.firstChild.remove()}function Zse(i){var e;return(e=i==null?void 0:i.isConnected)!==null&&e!==void 0?e:!1}class Hat{constructor(e,n,r,s){this._node=e,this._type=n,this._handler=r,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function Be(i,e,n,r){return new Hat(i,e,n,r)}function bEe(i){return function(e){return i(new rh(e))}}function Uat(i){return function(e){return i(new yr(e))}}const As=function(e,n,r,s){let o=r;return n==="click"||n==="mousedown"?o=bEe(r):(n==="keydown"||n==="keypress"||n==="keyup")&&(o=Uat(r)),Be(e,n,o,s)},qat=function(e,n,r){const s=bEe(n);return Kat(e,s,r)};function Kat(i,e,n){return Be(i,Kp&&Yse.pointerEvents?ht.POINTER_DOWN:ht.MOUSE_DOWN,e,n)}let W9,mh;class QU{constructor(e,n=0){this._runner=e,this.priority=n,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Ln(e)}}static sort(e,n){return n.priority-e.priority}}(function(){let i=[],e=null,n=!1,r=!1;const s=()=>{for(n=!1,e=i,i=[],r=!0;e.length>0;)e.sort(QU.sort),e.shift().execute();r=!1};mh=(o,a=0)=>{const l=new QU(o,a);return i.push(l),n||(n=!0,requestAnimationFrame(s)),l},W9=(o,a)=>{if(r){const l=new QU(o,a);return e.push(l),l}else return mh(o,a)}})();function c$(i){return i.ownerDocument.defaultView.getComputedStyle(i,null)}function FI(i){var e;const n=i.ownerDocument,r=(e=n.defaultView)===null||e===void 0?void 0:e.window;if(i!==n.body)return new bi(i.clientWidth,i.clientHeight);if(Kp&&(r!=null&&r.visualViewport))return new bi(r.visualViewport.width,r.visualViewport.height);if(r!=null&&r.innerWidth&&r.innerHeight)return new bi(r.innerWidth,r.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new bi(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new bi(n.documentElement.clientWidth,n.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class _s{static convertToPixels(e,n){return parseFloat(n)||0}static getDimension(e,n,r){const s=c$(e),o=s?s.getPropertyValue(n):"0";return _s.convertToPixels(e,o)}static getBorderLeftWidth(e){return _s.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return _s.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return _s.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return _s.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return _s.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return _s.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return _s.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return _s.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return _s.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return _s.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return _s.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return _s.getDimension(e,"margin-bottom","marginBottom")}}class bi{constructor(e,n){this.width=e,this.height=n}with(e=this.width,n=this.height){return e!==this.width||n!==this.height?new bi(e,n):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof bi?e:new bi(e.width,e.height)}static equals(e,n){return e===n?!0:!e||!n?!1:e.width===n.width&&e.height===n.height}}bi.None=new bi(0,0);function yEe(i){let e=i.offsetParent,n=i.offsetTop,r=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){n-=i.scrollTop;const s=wEe(i)?null:c$(i);s&&(r-=s.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(r+=_s.getBorderLeftWidth(i),n+=_s.getBorderTopWidth(i),n+=i.offsetTop,r+=i.offsetLeft,e=i.offsetParent)}return{left:r,top:n}}function Gat(i,e,n){typeof e=="number"&&(i.style.width=`${e}px`),typeof n=="number"&&(i.style.height=`${n}px`)}function no(i){var e,n,r,s;const o=i.getBoundingClientRect();return{left:o.left+((n=(e=i.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&n!==void 0?n:0),top:o.top+((s=(r=i.ownerDocument.defaultView)===null||r===void 0?void 0:r.scrollY)!==null&&s!==void 0?s:0),width:o.width,height:o.height}}function Xat(i){let e=i,n=1;do{const r=c$(e).zoom;r!=null&&r!=="1"&&(n*=r),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return n}function dc(i){const e=_s.getMarginLeft(i)+_s.getMarginRight(i);return i.offsetWidth+e}function JU(i){const e=_s.getBorderLeftWidth(i)+_s.getBorderRightWidth(i),n=_s.getPaddingLeft(i)+_s.getPaddingRight(i);return i.offsetWidth-e-n}function Yat(i){const e=_s.getBorderTopWidth(i)+_s.getBorderBottomWidth(i),n=_s.getPaddingTop(i)+_s.getPaddingBottom(i);return i.offsetHeight-e-n}function gS(i){const e=_s.getMarginTop(i)+_s.getMarginBottom(i);return i.offsetHeight+e}function Ia(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function Zat(i,e,n){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(n){if(typeof n=="string"){if(i.classList.contains(n))return null}else if(i===n)return null}i=i.parentNode}return null}function eq(i,e,n){return!!Zat(i,e,n)}function wEe(i){return i&&!!i.host&&!!i.mode}function $9(i){return!!dx(i)}function dx(i){for(var e;i.parentNode;){if(i===((e=i.ownerDocument)===null||e===void 0?void 0:e.body))return null;i=i.parentNode}return wEe(i)?i:null}function xf(){let i=u$().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function u$(){var i;return(i=[document,...Vat().map(n=>n.document)].find(n=>n.hasFocus()))!==null&&i!==void 0?i:document}function _h(i=document.getElementsByTagName("head")[0],e){const n=document.createElement("style");return n.type="text/css",n.media="screen",e==null||e(n),i.appendChild(n),n}let tq=null;function CEe(){return tq||(tq=_h()),tq}function Qat(i){var e,n;return!((e=i==null?void 0:i.sheet)===null||e===void 0)&&e.rules?i.sheet.rules:!((n=i==null?void 0:i.sheet)===null||n===void 0)&&n.cssRules?i.sheet.cssRules:[]}function cJ(i,e,n=CEe()){!n||!e||n.sheet.insertRule(i+"{"+e+"}",0)}function cpe(i,e=CEe()){if(!e)return;const n=Qat(e),r=[];for(let s=0;s<n.length;s++)n[s].selectorText.indexOf(i)!==-1&&r.push(s);for(let s=r.length-1;s>=0;s--)e.sheet.deleteRule(r[s])}function Qse(i){return typeof HTMLElement=="object"?i instanceof HTMLElement:i&&typeof i=="object"&&i.nodeType===1&&typeof i.nodeName=="string"}const ht={CLICK:"click",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",KEY_DOWN:"keydown",KEY_UP:"keyup",CHANGE:"change",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",DRAG_START:"dragstart",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend"};function Jat(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const Nn={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function elt(i){const e=[];for(let n=0;i&&i.nodeType===i.ELEMENT_NODE;n++)e[n]=i.scrollTop,i=i.parentNode;return e}function tlt(i,e){for(let n=0;i&&i.nodeType===i.ELEMENT_NODE;n++)i.scrollTop!==e[n]&&(i.scrollTop=e[n]),i=i.parentNode}class z9 extends Le{static hasFocusWithin(e){if(Qse(e)){const n=dx(e),r=n?n.activeElement:e.ownerDocument.activeElement;return Ia(r,e)}else return Ia(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new _e),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new _e),this.onDidBlur=this._onDidBlur.event;let n=z9.hasFocusWithin(e),r=!1;const s=()=>{r=!1,n||(n=!0,this._onDidFocus.fire())},o=()=>{n&&(r=!0,window.setTimeout(()=>{r&&(r=!1,n=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{z9.hasFocusWithin(e)!==n&&(n?o():s())},this._register(Be(e,ht.FOCUS,s,!0)),this._register(Be(e,ht.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(Be(e,ht.FOCUS_IN,()=>this._refreshStateHandler())),this._register(Be(e,ht.FOCUS_OUT,()=>this._refreshStateHandler())))}}function Gm(i){return new z9(i)}function He(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function SEe(i,e){return i.insertBefore(e,i.firstChild),e}function ca(i,...e){i.innerText="",He(i,...e)}const nlt=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var fP;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(fP||(fP={}));function xEe(i,e,n,...r){const s=nlt.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let a;return i!==fP.HTML?a=document.createElementNS(i,o):a=document.createElement(o),s[3]&&(a.id=s[3]),s[4]&&(a.className=s[4].replace(/\./g," ").trim()),n&&Object.entries(n).forEach(([l,c])=>{typeof c>"u"||(/^on\w+$/.test(l)?a[l]=c:l==="selected"?c&&a.setAttribute(l,"true"):a.setAttribute(l,c))}),a.append(...r),a}function tt(i,e,...n){return xEe(fP.HTML,i,e,...n)}tt.SVG=function(i,e,...n){return xEe(fP.SVG,i,e,...n)};function ilt(i,...e){i?Jc(...e):Pl(...e)}function Jc(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function Pl(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function upe(i){const e=window.devicePixelRatio*i;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function kEe(i){window.open(i,"_blank","noopener")}function rlt(i){const e=()=>{i(),n=mh(e)};let n=mh(e);return gn(()=>n.dispose())}_Ee.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function f1(i){return i?`url('${vEe.uriToBrowserUri(i).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function dpe(i){return`'${i.replace(/'/g,"%27")}'`}function MS(i,e){if(i!==void 0){const n=i.match(/^\s*var\((.+)\)$/);if(n){const r=n[1].split(",",2);return r.length===2&&(e=MS(r[1].trim(),e)),`var(${r[0]}, ${e})`}return i}return e}function slt(i,e=!1){const n=document.createElement("a");return gEe("afterSanitizeAttributes",r=>{for(const s of["href","src"])if(r.hasAttribute(s)){const o=r.getAttribute(s);if(s==="href"&&o.startsWith("#"))continue;if(n.href=o,!i.includes(n.protocol.replace(/:$/,""))){if(e&&s==="src"&&n.href.startsWith("data:"))continue;r.removeAttribute(s)}}}),gn(()=>{mEe("afterSanitizeAttributes")})}const olt=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class Y0 extends _e{constructor(){super(),this._subscriptions=new Xe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(Be(window,"keydown",e=>{if(e.defaultPrevented)return;const n=new yr(e);if(!(n.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(n.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(Be(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(Be(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(Be(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(Be(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(Be(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Y0.instance||(Y0.instance=new Y0),Y0.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class alt extends Le{constructor(e,n){super(),this.element=e,this.callbacks=n,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(Be(this.element,ht.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(Be(this.element,ht.DRAG_OVER,e=>{var n,r;e.preventDefault(),(r=(n=this.callbacks).onDragOver)===null||r===void 0||r.call(n,e,e.timeStamp-this.dragStartTime)})),this._register(Be(this.element,ht.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(Be(this.element,ht.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(Be(this.element,ht.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const llt=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function Jo(i,...e){let n,r;Array.isArray(e[0])?(n={},r=e[0]):(n=e[0]||{},r=e[1]);const s=llt.exec(i);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",a=document.createElement(o);s.groups.id&&(a.id=s.groups.id);const l=[];if(s.groups.class)for(const u of s.groups.class.split("."))u!==""&&l.push(u);if(n.className!==void 0)for(const u of n.className.split("."))u!==""&&l.push(u);l.length>0&&(a.className=l.join(" "));const c={};if(s.groups.name&&(c[s.groups.name]=a),r)for(const u of r)u instanceof HTMLElement?a.appendChild(u):typeof u=="string"?a.append(u):"root"in u&&(Object.assign(c,u),a.appendChild(u.root));for(const[u,d]of Object.entries(n))if(u!=="className")if(u==="style")for(const[h,f]of Object.entries(d))a.style.setProperty(hpe(h),typeof f=="number"?f+"px":""+f);else u==="tabIndex"?a.tabIndex=d:a.setAttribute(hpe(u),d.toString());return c.root=a,c}function hpe(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class d${constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const n of e){let r=n.kbExpr;this.precondition&&(r?r=ze.and(r,this.precondition):r=this.precondition);const s={id:this.id,weight:n.weight,args:n.args,when:r,primary:n.primary,secondary:n.secondary,win:n.win,linux:n.linux,mac:n.mac};Sc.registerKeybindingRule(s)}}si.registerCommand({id:this.id,handler:(e,n)=>this.runCommand(e,n),description:this._description})}_registerMenuItem(e){sa.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class BI extends d${constructor(){super(...arguments),this._implementations=[]}addImplementation(e,n,r,s){return this._implementations.push({priority:e,name:n,implementation:r,when:s}),this._implementations.sort((o,a)=>a.priority-o.priority),{dispose:()=>{for(let o=0;o<this._implementations.length;o++)if(this._implementations[o].implementation===r){this._implementations.splice(o,1);return}}}}runCommand(e,n){const r=e.get(vd),s=e.get(mn);r.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const o of this._implementations){if(o.when){const l=s.getContext(xf());if(!o.when.evaluate(l))continue}const a=o.implementation(e,n);if(a)return r.trace(`Command '${this.id}' was handled by '${o.name}'.`),typeof a=="boolean"?void 0:a}r.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class LEe extends d${constructor(e,n){super(n),this.command=e}runCommand(e,n){return this.command.runCommand(e,n)}}class Ho extends d${static bindToContribution(e){return class extends Ho{constructor(r){super(r),this._callback=r.handler}runEditorCommand(r,s,o){const a=e(s);a&&this._callback(a,o)}}}static runEditorCommand(e,n,r,s){const o=e.get(Si),a=o.getFocusedCodeEditor()||o.getActiveCodeEditor();if(a)return a.invokeWithinContext(l=>{if(l.get(mn).contextMatchesRules(r??void 0))return s(l,a,n)})}runCommand(e,n){return Ho.runEditorCommand(e,n,this.precondition,(r,s,o)=>this.runEditorCommand(r,s,o))}}class kt extends Ho{static convertOptions(e){let n;Array.isArray(e.menuOpts)?n=e.menuOpts:e.menuOpts?n=[e.menuOpts]:n=[];function r(s){return s.menuId||(s.menuId=se.EditorContext),s.title||(s.title=e.label),s.when=ze.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?n.push(...e.contextMenuOpts.map(r)):e.contextMenuOpts&&n.push(r(e.contextMenuOpts)),e.menuOpts=n,e}constructor(e){super(kt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,n,r){return this.reportTelemetry(e,n),this.run(e,n,r||{})}reportTelemetry(e,n){e.get(_d).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class DEe extends kt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,n){return this._implementations.push([e,n]),this._implementations.sort((r,s)=>s[0]-r[0]),{dispose:()=>{for(let r=0;r<this._implementations.length;r++)if(this._implementations[r][1]===n){this._implementations.splice(r,1);return}}}}run(e,n,r){for(const s of this._implementations){const o=s[1](e,n,r);if(o)return typeof o=="boolean"?void 0:o}}}class og extends md{run(e,...n){const r=e.get(Si),s=r.getFocusedCodeEditor()||r.getActiveCodeEditor();if(s)return s.invokeWithinContext(o=>{var a,l;const c=o.get(mn),u=o.get(vd);if(!c.contextMatchesRules((a=this.desc.precondition)!==null&&a!==void 0?a:void 0)){u.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(l=this.desc.precondition)===null||l===void 0?void 0:l.serialize());return}return this.runEditorCommand(o,s,...n)})}}function d_(i,e){si.registerCommand(i,function(n,...r){const s=n.get(hn),[o,a]=r;Ui(Jt.isUri(o)),Ui(ve.isIPosition(a));const l=n.get(Fr).getModel(o);if(l){const c=ve.lift(a);return s.invokeFunction(e,l,c,...r.slice(2))}return n.get(Ec).createModelReference(o).then(c=>new Promise((u,d)=>{try{const h=s.invokeFunction(e,c.object.textEditorModel,ve.lift(a),r.slice(2));u(h)}catch(h){d(h)}}).finally(()=>{c.dispose()}))})}function ct(i){return th.INSTANCE.registerEditorCommand(i),i}function rt(i){const e=new i;return th.INSTANCE.registerEditorAction(e),e}function EEe(i){return th.INSTANCE.registerEditorAction(i),i}function clt(i){th.INSTANCE.registerEditorAction(i)}function _i(i,e,n){th.INSTANCE.registerEditorContribution(i,e,n)}var j2;(function(i){function e(a){return th.INSTANCE.getEditorCommand(a)}i.getEditorCommand=e;function n(){return th.INSTANCE.getEditorActions()}i.getEditorActions=n;function r(){return th.INSTANCE.getEditorContributions()}i.getEditorContributions=r;function s(a){return th.INSTANCE.getEditorContributions().filter(l=>a.indexOf(l.id)>=0)}i.getSomeEditorContributions=s;function o(){return th.INSTANCE.getDiffEditorContributions()}i.getDiffEditorContributions=o})(j2||(j2={}));const ult={EditorCommonContributions:"editor.contributions"};class th{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,n,r){this.editorContributions.push({id:e,ctor:n,instantiation:r})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}th.INSTANCE=new th;Kr.add(ult.EditorCommonContributions,th.INSTANCE);function L5(i){return i.register(),i}const IEe=L5(new BI({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:se.MenubarEditMenu,group:"1_do",title:L({},"&&Undo"),order:1},{menuId:se.CommandPalette,group:"",title:L("undo","Undo"),order:1}]}));L5(new LEe(IEe,{id:"default:undo",precondition:void 0}));const TEe=L5(new BI({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:se.MenubarEditMenu,group:"1_do",title:L({},"&&Redo"),order:2},{menuId:se.CommandPalette,group:"",title:L("redo","Redo"),order:1}]}));L5(new LEe(TEe,{id:"default:redo",precondition:void 0}));const dlt=L5(new BI({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:se.MenubarSelectionMenu,group:"1_basic",title:L({},"&&Select All"),order:1},{menuId:se.CommandPalette,group:"",title:L("selectAll","Select All"),order:1}]})),REe=Symbol("MicrotaskDelay");var $d=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},oN=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],n;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=i[o]&&function(a){return new Promise(function(l,c){a=i[o](a),s(l,c,a.done,a.value)})}}function s(o,a,l,c){Promise.resolve(c).then(function(u){o({value:u,done:l})},a)}};function uJ(i){return!!i&&typeof i.then=="function"}function go(i){const e=new Ns,n=i(e.token),r=new Promise((s,o)=>{const a=e.token.onCancellationRequested(()=>{a.dispose(),e.dispose(),o(new U1)});Promise.resolve(n).then(l=>{a.dispose(),e.dispose(),s(l)},l=>{a.dispose(),e.dispose(),o(l)})});return new class{cancel(){e.cancel()}then(s,o){return r.then(s,o)}catch(s){return this.then(void 0,s)}finally(s){return r.finally(s)}}}function h$(i,e,n){return new Promise((r,s)=>{const o=e.onCancellationRequested(()=>{o.dispose(),r(n)});i.then(r,s).finally(()=>o.dispose())})}class hlt{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const n=()=>{if(this.queuedPromise=null,this.isDisposed)return;const r=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,r};this.queuedPromise=new Promise(r=>{this.activePromise.then(n,n).then(r)})}return new Promise((n,r)=>{this.queuedPromise.then(n,r)})}return this.activePromise=e(),new Promise((n,r)=>{this.activePromise.then(s=>{this.activePromise=null,n(s)},s=>{this.activePromise=null,r(s)})})}dispose(){this.isDisposed=!0}}const flt=(i,e)=>{let n=!0;const r=setTimeout(()=>{n=!1,e()},i);return{isTriggered:()=>n,dispose:()=>{clearTimeout(r),n=!1}}},plt=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Rf{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,n=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((s,o)=>{this.doResolve=s,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const s=this.task;return this.task=null,s()}}));const r=()=>{var s;this.deferred=null,(s=this.doResolve)===null||s===void 0||s.call(this,null)};return this.deferred=n===REe?plt(r):flt(n,r),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new U1),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class AEe{constructor(e){this.delayer=new Rf(e),this.throttler=new hlt}trigger(e,n){return this.delayer.trigger(()=>this.throttler.queue(e),n)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function p1(i,e){return e?new Promise((n,r)=>{const s=setTimeout(()=>{o.dispose(),n()},i),o=e.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),r(new U1)})}):go(n=>p1(i,n))}function g1(i,e=0,n){const r=setTimeout(()=>{i(),n&&s.dispose()},e),s=gn(()=>{clearTimeout(r),n==null||n.deleteAndLeak(s)});return n==null||n.add(s),s}function NEe(i,e=r=>!!r,n=null){let r=0;const s=i.length,o=()=>{if(r>=s)return Promise.resolve(n);const a=i[r++];return Promise.resolve(a()).then(c=>e(c)?Promise.resolve(c):o())};return o()}class Mf{constructor(e,n){this._token=-1,typeof e=="function"&&typeof n=="number"&&this.setIfNotSet(e,n)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,n){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},n)}setIfNotSet(e,n){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},n))}}class D5{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,n){this.cancel(),this._token=setInterval(()=>{e()},n)}}class Ji{constructor(e,n){this.timeoutToken=-1,this.runner=e,this.timeout=n,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let Z0;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?Z0=i=>{S2e(()=>{if(e)return;const n=Date.now()+15;i(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,n-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:Z0=(i,e)=>{const n=requestIdleCallback(i,typeof e=="number"?{timeout:e}:void 0);let r=!1;return{dispose(){r||(r=!0,cancelIdleCallback(n))}}}})();class a8{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=Z0(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class f${get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,n)=>{this.completeCallback=e,this.errorCallback=n})}complete(e){return new Promise(n=>{this.completeCallback(e),this.outcome={outcome:0,value:e},n()})}error(e){return new Promise(n=>{this.errorCallback(e),this.outcome={outcome:1,value:e},n()})}cancel(){return this.error(new U1)}}var dJ;(function(i){function e(r){return $d(this,void 0,void 0,function*(){let s;const o=yield Promise.all(r.map(a=>a.then(l=>l,l=>{s||(s=l)})));if(typeof s<"u")throw s;return o})}i.settled=e;function n(r){return new Promise((s,o)=>$d(this,void 0,void 0,function*(){try{yield r(s,o)}catch(a){o(a)}}))}i.withAsyncBody=n})(dJ||(dJ={}));class zs{static fromArray(e){return new zs(n=>{n.emitMany(e)})}static fromPromise(e){return new zs(n=>$d(this,void 0,void 0,function*(){n.emitMany(yield e)}))}static fromPromises(e){return new zs(n=>$d(this,void 0,void 0,function*(){yield Promise.all(e.map(r=>$d(this,void 0,void 0,function*(){return n.emitOne(yield r)})))}))}static merge(e){return new zs(n=>$d(this,void 0,void 0,function*(){yield Promise.all(e.map(r=>{var s,o,a;return $d(this,void 0,void 0,function*(){var l,c,u,d;try{for(s=!0,o=oN(r);a=yield o.next(),l=a.done,!l;s=!0){d=a.value,s=!1;const h=d;n.emitOne(h)}}catch(h){c={error:h}}finally{try{!s&&!l&&(u=o.return)&&(yield u.call(o))}finally{if(c)throw c.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new _e,queueMicrotask(()=>$d(this,void 0,void 0,function*(){const n={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{yield Promise.resolve(e(n)),this.resolve()}catch(r){this.reject(r)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>$d(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};yield _t.toPromise(this._onStateChanged.event)}while(!0)})}}static map(e,n){return new zs(r=>$d(this,void 0,void 0,function*(){var s,o,a,l;try{for(var c=!0,u=oN(e),d;d=yield u.next(),s=d.done,!s;c=!0){l=d.value,c=!1;const h=l;r.emitOne(n(h))}}catch(h){o={error:h}}finally{try{!c&&!s&&(a=u.return)&&(yield a.call(u))}finally{if(o)throw o.error}}}))}map(e){return zs.map(this,e)}static filter(e,n){return new zs(r=>$d(this,void 0,void 0,function*(){var s,o,a,l;try{for(var c=!0,u=oN(e),d;d=yield u.next(),s=d.done,!s;c=!0){l=d.value,c=!1;const h=l;n(h)&&r.emitOne(h)}}catch(h){o={error:h}}finally{try{!c&&!s&&(a=u.return)&&(yield a.call(u))}finally{if(o)throw o.error}}}))}filter(e){return zs.filter(this,e)}static coalesce(e){return zs.filter(e,n=>!!n)}coalesce(){return zs.coalesce(this)}static toPromise(e){var n,r,s,o,a,l,c;return $d(this,void 0,void 0,function*(){const u=[];try{for(n=!0,r=oN(e);s=yield r.next(),o=s.done,!o;n=!0){c=s.value,n=!1;const d=c;u.push(d)}}catch(d){a={error:d}}finally{try{!n&&!o&&(l=r.return)&&(yield l.call(r))}finally{if(a)throw a.error}}return u})}toPromise(){return zs.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}zs.EMPTY=zs.fromArray([]);class glt extends zs{constructor(e,n){super(n),this._source=e}cancel(){this._source.cancel()}}function mlt(i){const e=new Ns,n=i(e.token);return new glt(e,r=>$d(this,void 0,void 0,function*(){var s,o,a,l;const c=e.token.onCancellationRequested(()=>{c.dispose(),e.dispose(),r.reject(new U1)});try{try{for(var u=!0,d=oN(n),h;h=yield d.next(),s=h.done,!s;u=!0){l=h.value,u=!1;const f=l;if(e.token.isCancellationRequested)return;r.emitOne(f)}}catch(f){o={error:f}}finally{try{!u&&!s&&(a=d.return)&&(yield a.call(d))}finally{if(o)throw o.error}}c.dispose(),e.dispose()}catch(f){c.dispose(),e.dispose(),r.reject(f)}}))}const _lt="$initialize";let fpe=!1;function hJ(i){H1&&(fpe||(fpe=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(i.message))}class vlt{constructor(e,n,r,s){this.vsWorker=e,this.req=n,this.method=r,this.args=s,this.type=0}}class ppe{constructor(e,n,r,s){this.vsWorker=e,this.seq=n,this.res=r,this.err=s,this.type=1}}class blt{constructor(e,n,r,s){this.vsWorker=e,this.req=n,this.eventName=r,this.arg=s,this.type=2}}class ylt{constructor(e,n,r){this.vsWorker=e,this.req=n,this.event=r,this.type=3}}class wlt{constructor(e,n){this.vsWorker=e,this.req=n,this.type=4}}class Clt{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,n){const r=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[r]={resolve:s,reject:o},this._send(new vlt(this._workerId,r,e,n))})}listen(e,n){let r=null;const s=new _e({onWillAddFirstListener:()=>{r=String(++this._lastSentReq),this._pendingEmitters.set(r,s),this._send(new blt(this._workerId,r,e,n))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(r),this._send(new wlt(this._workerId,r)),r=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const n=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let r=e.err;e.err.$isError&&(r=new Error,r.name=e.err.name,r.message=e.err.message,r.stack=e.err.stack),n.reject(r);return}n.resolve(e.res)}_handleRequestMessage(e){const n=e.req;this._handler.handleMessage(e.method,e.args).then(s=>{this._send(new ppe(this._workerId,n,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=$fe(s.detail)),this._send(new ppe(this._workerId,n,void 0,$fe(s)))})}_handleSubscribeEventMessage(e){const n=e.req,r=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new ylt(this._workerId,n,s))});this._pendingEvents.set(n,r)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const n=[];if(e.type===0)for(let r=0;r<e.args.length;r++)e.args[r]instanceof ArrayBuffer&&n.push(e.args[r]);else e.type===1&&e.res instanceof ArrayBuffer&&n.push(e.res);this._handler.sendMessage(e,n)}}class Slt extends Le{constructor(e,n,r){super();let s=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",d=>{this._protocol.handleMessage(d)},d=>{s==null||s(d)})),this._protocol=new Clt({sendMessage:(d,h)=>{this._worker.postMessage(d,h)},handleMessage:(d,h)=>{if(typeof r[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(r[d].apply(r,h))}catch(f){return Promise.reject(f)}},handleEvent:(d,h)=>{if(PEe(d)){const f=r[d].call(r,h);if(typeof f!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return f}if(MEe(d)){const f=r[d];if(typeof f!="function")throw new Error(`Missing event ${d} on main thread host.`);return f}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const a=globalThis.require;typeof a<"u"&&typeof a.getConfig=="function"?o=a.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const l=Dse(r);this._onModuleLoaded=this._protocol.sendMessage(_lt,[this._worker.getId(),JSON.parse(JSON.stringify(o)),n,l]);const c=(d,h)=>this._request(d,h),u=(d,h)=>this._protocol.listen(d,h);this._lazyProxy=new Promise((d,h)=>{s=h,this._onModuleLoaded.then(f=>{d(xlt(f,c,u))},f=>{h(f),this._onError("Worker failed to load "+n,f)})})}getProxyObject(){return this._lazyProxy}_request(e,n){return new Promise((r,s)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,n).then(r,s)},s)})}_onError(e,n){console.error(e),console.info(n)}}function MEe(i){return i[0]==="o"&&i[1]==="n"&&nm(i.charCodeAt(2))}function PEe(i){return/^onDynamic/.test(i)&&nm(i.charCodeAt(9))}function xlt(i,e,n){const r=a=>function(){const l=Array.prototype.slice.call(arguments,0);return e(a,l)},s=a=>function(l){return n(a,l)},o={};for(const a of i){if(PEe(a)){o[a]=s(a);continue}if(MEe(a)){o[a]=n(a,void 0);continue}o[a]=r(a)}return o}function $v(i,e){var n;const r=globalThis.MonacoEnvironment;if(r!=null&&r.createTrustedTypesPolicy)try{return r.createTrustedTypesPolicy(i,e)}catch(s){Ln(s);return}try{return(n=window.trustedTypes)===null||n===void 0?void 0:n.createPolicy(i,e)}catch(s){Ln(s);return}}const gpe=$v("defaultWorkerFactory",{createScriptURL:i=>i});function klt(i){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",i);if(typeof e.getWorkerUrl=="function"){const n=e.getWorkerUrl("workerMain.js",i);return new Worker(gpe?gpe.createScriptURL(n):n,{name:i})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Llt(i){return typeof i.then=="function"}class Dlt{constructor(e,n,r,s,o){this.id=n,this.label=r;const a=klt(r);Llt(a)?this.worker=a:this.worker=Promise.resolve(a),this.postMessage(e,[]),this.worker.then(l=>{l.onmessage=function(c){s(c.data)},l.onmessageerror=o,typeof l.addEventListener=="function"&&l.addEventListener("error",o)})}getId(){return this.id}postMessage(e,n){var r;(r=this.worker)===null||r===void 0||r.then(s=>{try{s.postMessage(e,n)}catch(o){Ln(o),Ln(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(n=>n.terminate()),this.worker=null}}class p${constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,n,r){const s=++p$.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new Dlt(e,s,this._label||"anonymous"+s,n,o=>{hJ(o),this._webWorkerFailedBeforeError=o,r(o)})}}p$.LAST_WORKER_ID=0;var Hs;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(Hs||(Hs={}));class nq{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let n=0,r=e.notIn.length;n<r;n++)switch(e.notIn[n]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1;break}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,n){if(e.getTokenCount()===0)return!0;const r=e.findTokenIndexAtOffset(n-2),s=e.getStandardTokenType(r);return this.isOK(s)}_findNeutralCharacterInRange(e,n){for(let r=e;r<=n;r++){const s=String.fromCharCode(r);if(!this.open.includes(s)&&!this.close.includes(s))return s}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class Elt{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const n of e)$R(this.autoClosingPairsOpenByStart,n.open.charAt(0),n),$R(this.autoClosingPairsOpenByEnd,n.open.charAt(n.open.length-1),n),$R(this.autoClosingPairsCloseByStart,n.close.charAt(0),n),$R(this.autoClosingPairsCloseByEnd,n.close.charAt(n.close.length-1),n),n.close.length===1&&n.open.length===1&&$R(this.autoClosingPairsCloseSingleChar,n.close,n)}}function $R(i,e,n){i.has(e)?i.get(e).push(n):i.set(e,[n])}function g$(i,e){const n=i.getCount(),r=i.findTokenIndexAtOffset(e),s=i.getLanguageId(r);let o=r;for(;o+1<n&&i.getLanguageId(o+1)===s;)o++;let a=r;for(;a>0&&i.getLanguageId(a-1)===s;)a--;return new Ilt(i,s,a,o+1,i.getStartOffset(a),i.getEndOffset(o))}class Ilt{constructor(e,n,r,s,o,a){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=n,this._firstTokenIndex=r,this._lastTokenIndex=s,this.firstCharOffset=o,this._lastCharOffset=a}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function Vg(i){return(i&3)!==0}class ME{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(n=>new nq(n)):e.brackets?this._autoClosingPairs=e.brackets.map(n=>new nq({open:n[0],close:n[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const n=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new nq({open:n.open,close:n.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:ME.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:ME.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}ME.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])>
`;ME.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
`;const mpe=typeof Buffer<"u";let iq;class m${static wrap(e){return mpe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new m$(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return mpe?this.buffer.toString():(iq||(iq=new TextDecoder),iq.decode(this.buffer))}}function Tlt(i,e){return i[e+0]<<0>>>0|i[e+1]<<8>>>0}function Rlt(i,e,n){i[n+0]=e&255,e=e>>>8,i[n+1]=e&255}function pp(i,e){return i[e]*Math.pow(2,24)+i[e+1]*Math.pow(2,16)+i[e+2]*Math.pow(2,8)+i[e+3]}function gp(i,e,n){i[n+3]=e,e=e>>>8,i[n+2]=e,e=e>>>8,i[n+1]=e,e=e>>>8,i[n]=e}function _pe(i,e){return i[e]}function vpe(i,e,n){i[n]=e}let rq;function OEe(){return rq||(rq=new TextDecoder("UTF-16LE")),rq}let sq;function Alt(){return sq||(sq=new TextDecoder("UTF-16BE")),sq}let oq;function FEe(){return oq||(oq=x2e()?OEe():Alt()),oq}function Nlt(i,e,n){const r=new Uint16Array(i.buffer,e,n);return n>0&&(r[0]===65279||r[0]===65534)?Mlt(i,e,n):OEe().decode(r)}function Mlt(i,e,n){const r=[];let s=0;for(let o=0;o<n;o++){const a=Tlt(i,e);e+=2,r[s++]=String.fromCharCode(a)}return r.join("")}class jI{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return FEe().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const n=this._capacity-this._bufferLength;n<=1&&(n===0||xo(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const n=e.length;if(this._bufferLength+n>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let r=0;r<n;r++)this._buffer[this._bufferLength++]=e.charCodeAt(r)}}class V9{constructor(e,n,r,s,o,a){this._richEditBracketBrand=void 0,this.languageId=e,this.index=n,this.open=r,this.close=s,this.forwardRegex=o,this.reversedRegex=a,this._openSet=V9._toSet(this.open),this._closeSet=V9._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const n=new Set;for(const r of e)n.add(r);return n}}function Plt(i){const e=i.length;i=i.map(a=>[a[0].toLowerCase(),a[1].toLowerCase()]);const n=[];for(let a=0;a<e;a++)n[a]=a;const r=(a,l)=>{const[c,u]=a,[d,h]=l;return c===d||c===h||u===d||u===h},s=(a,l)=>{const c=Math.min(a,l),u=Math.max(a,l);for(let d=0;d<e;d++)n[d]===u&&(n[d]=c)};for(let a=0;a<e;a++){const l=i[a];for(let c=a+1;c<e;c++){const u=i[c];r(l,u)&&s(n[a],n[c])}}const o=[];for(let a=0;a<e;a++){const l=[],c=[];for(let u=0;u<e;u++)if(n[u]===a){const[d,h]=i[u];l.push(d),c.push(h)}l.length>0&&o.push({open:l,close:c})}return o}class Olt{constructor(e,n){this._richEditBracketsBrand=void 0;const r=Plt(n);this.brackets=r.map((s,o)=>new V9(e,o,s.open,s.close,Flt(s.open,s.close,r,o),Blt(s.open,s.close,r,o))),this.forwardRegex=jlt(this.brackets),this.reversedRegex=Wlt(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const o of s.open)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of s.close)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function BEe(i,e,n,r){for(let s=0,o=e.length;s<o;s++){if(s===n)continue;const a=e[s];for(const l of a.open)l.indexOf(i)>=0&&r.push(l);for(const l of a.close)l.indexOf(i)>=0&&r.push(l)}}function jEe(i,e){return i.length-e.length}function _$(i){if(i.length<=1)return i;const e=[],n=new Set;for(const r of i)n.has(r)||(e.push(r),n.add(r));return e}function Flt(i,e,n,r){let s=[];s=s.concat(i),s=s.concat(e);for(let o=0,a=s.length;o<a;o++)BEe(s[o],n,r,s);return s=_$(s),s.sort(jEe),s.reverse(),v$(s)}function Blt(i,e,n,r){let s=[];s=s.concat(i),s=s.concat(e);for(let o=0,a=s.length;o<a;o++)BEe(s[o],n,r,s);return s=_$(s),s.sort(jEe),s.reverse(),v$(s.map(Jse))}function jlt(i){let e=[];for(const n of i){for(const r of n.open)e.push(r);for(const r of n.close)e.push(r)}return e=_$(e),v$(e)}function Wlt(i){let e=[];for(const n of i){for(const r of n.open)e.push(r);for(const r of n.close)e.push(r)}return e=_$(e),v$(e.map(Jse))}function $lt(i){const e=/^[\w ]+$/.test(i);return i=dd(i),e?`\\b${i}\\b`:i}function v$(i){const e=`(${i.map($lt).join(")|(")})`;return X2e(e,!0)}const Jse=function(){function i(r){const s=new Uint16Array(r.length);let o=0;for(let a=r.length-1;a>=0;a--)s[o++]=r.charCodeAt(a);return FEe().decode(s)}let e=null,n=null;return function(s){return e!==s&&(e=s,n=i(e)),n}}();class Yh{static _findPrevBracketInText(e,n,r,s){const o=r.match(e);if(!o)return null;const a=r.length-(o.index||0),l=o[0].length,c=s+a;return new J(n,c-l+1,n,c+1)}static findPrevBracketInRange(e,n,r,s,o){const l=Jse(r).substring(r.length-o,r.length-s);return this._findPrevBracketInText(e,n,l,s)}static findNextBracketInText(e,n,r,s){const o=r.match(e);if(!o)return null;const a=o.index||0,l=o[0].length;if(l===0)return null;const c=s+a;return new J(n,c+1,n,c+1+l)}static findNextBracketInRange(e,n,r,s,o){const a=r.substring(s,o);return this.findNextBracketInText(e,n,a,s)}}class zlt{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const n of this._richEditBrackets.brackets)for(const r of n.close){const s=r.charAt(r.length-1);e.push(s)}return l1(e)}onElectricCharacter(e,n,r){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=n.findTokenIndexAtOffset(r-1);if(Vg(n.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,a=n.getLineContent().substring(0,r-1)+e,l=Yh.findPrevBracketInRange(o,1,a,0,a.length);if(!l)return null;const c=a.substring(l.startColumn-1,l.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[c])return null;const d=n.getActualLineContentBefore(l.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:c}:null}}function W3(i){return i.global&&(i.lastIndex=0),!0}class Vlt{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&W3(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&W3(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&W3(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&W3(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let n=0;return this.shouldIncrease(e)&&(n+=1),this.shouldDecrease(e)&&(n+=2),this.shouldIndentNextLine(e)&&(n+=4),this.shouldIgnore(e)&&(n+=8),n}}class r2{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(n=>{const r=r2._createOpenBracketRegExp(n[0]),s=r2._createCloseBracketRegExp(n[1]);r&&s&&this._brackets.push({open:n[0],openRegExp:r,close:n[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,n,r,s){if(e>=3)for(let o=0,a=this._regExpRules.length;o<a;o++){const l=this._regExpRules[o];if([{reg:l.beforeText,text:r},{reg:l.afterText,text:s},{reg:l.previousLineText,text:n}].every(u=>u.reg?(u.reg.lastIndex=0,u.reg.test(u.text)):!0))return l.action}if(e>=2&&r.length>0&&s.length>0)for(let o=0,a=this._brackets.length;o<a;o++){const l=this._brackets[o];if(l.openRegExp.test(r)&&l.closeRegExp.test(s))return{indentAction:Hs.IndentOutdent}}if(e>=2&&r.length>0){for(let o=0,a=this._brackets.length;o<a;o++)if(this._brackets[o].openRegExp.test(r))return{indentAction:Hs.Indent}}return null}static _createOpenBracketRegExp(e){let n=dd(e);return/\B/.test(n.charAt(0))||(n="\\b"+n),n+="\\s*$",r2._safeRegExp(n)}static _createCloseBracketRegExp(e){let n=dd(e);return/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"),n="^\\s*"+n,r2._safeRegExp(n)}static _safeRegExp(e){try{return new RegExp(e)}catch(n){return Ln(n),null}}}const ei=qn("configurationService");function fJ(i,e){const n=Object.create(null);for(const r in i)WEe(n,r,i[r],e);return n}function WEe(i,e,n,r){const s=e.split("."),o=s.pop();let a=i;for(let l=0;l<s.length;l++){const c=s[l];let u=a[c];switch(typeof u){case"undefined":u=a[c]=Object.create(null);break;case"object":break;default:r(`Ignoring ${e} as ${s.slice(0,l+1).join(".")} is ${JSON.stringify(u)}`);return}a=u}if(typeof a=="object"&&a!==null)try{a[o]=n}catch{r(`Ignoring ${e} as ${s.join(".")} is ${JSON.stringify(a)}`)}else r(`Ignoring ${e} as ${s.join(".")} is ${JSON.stringify(a)}`)}function Hlt(i,e){const n=e.split(".");$Ee(i,n)}function $Ee(i,e){const n=e.shift();if(e.length===0){delete i[n];return}if(Object.keys(i).indexOf(n)!==-1){const r=i[n];typeof r=="object"&&!Array.isArray(r)&&($Ee(r,e),Object.keys(r).length===0&&delete i[n])}}function bpe(i,e,n){function r(a,l){let c=a;for(const u of l){if(typeof c!="object"||c===null)return;c=c[u]}return c}const s=e.split("."),o=r(i,s);return typeof o>"u"?n:o}function Ult(i){return i.replace(/[\[\]]/g,"")}const Ar=qn("languageService");class im{constructor(e,n=[],r=!1){this.ctor=e,this.staticArguments=n,this.supportsDelayedInstantiation=r}}const zEe=[];function oi(i,e,n){e instanceof im||(e=new im(e,[],!!n)),zEe.push([i,e])}function ype(){return zEe}const bs=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),b$={JSONContribution:"base.contributions.json"};function qlt(i){return i.length>0&&i.charAt(i.length-1)==="#"?i.substring(0,i.length-1):i}class Klt{constructor(){this._onDidChangeSchema=new _e,this.schemasById={}}registerSchema(e,n){this.schemasById[qlt(e)]=n,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Glt=new Klt;Kr.add(b$.JSONContribution,Glt);const ag={Configuration:"base.contributions.configuration"},$3="vscode://schemas/settings/resourceLanguage",wpe=Kr.as(b$.JSONContribution);class Xlt{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new _e,this._onDidUpdateConfiguration=new _e,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:L("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},wpe.registerSchema($3,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,n=!0){this.registerConfigurations([e],n)}registerConfigurations(e,n=!0){const r=new Set;this.doRegisterConfigurations(e,n,r),wpe.registerSchema($3,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:r})}registerDefaultConfigurations(e){const n=new Set;this.doRegisterDefaultConfigurations(e,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,n){var r;const s=[];for(const{overrides:o,source:a}of e)for(const l in o)if(n.add(l),m1.test(l)){const c=this.configurationDefaultsOverrides.get(l),u=(r=c==null?void 0:c.valuesSources)!==null&&r!==void 0?r:new Map;if(a)for(const p of Object.keys(o[l]))u.set(p,a);const d=Object.assign(Object.assign({},(c==null?void 0:c.value)||{}),o[l]);this.configurationDefaultsOverrides.set(l,{source:a,value:d,valuesSources:u});const h=Ult(l),f={type:"object",default:d,description:L("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",h),$ref:$3,defaultDefaultValue:d,source:zl(a)?void 0:a,defaultValueSource:a};s.push(...H9(l)),this.configurationProperties[l]=f,this.defaultLanguageConfigurationOverridesNode.properties[l]=f}else{this.configurationDefaultsOverrides.set(l,{value:o[l],source:a});const c=this.configurationProperties[l];c&&(this.updatePropertyDefaultValue(l,c),this.updateSchema(l,c))}this.doRegisterOverrideIdentifiers(s)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const n of e)this.overrideIdentifiers.add(n);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,n,r){e.forEach(s=>{this.validateAndRegisterProperties(s,n,s.extensionInfo,s.restrictedProperties,void 0,r),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}validateAndRegisterProperties(e,n=!0,r,s,o=3,a){var l;o=Hu(e.scope)?o:e.scope;const c=e.properties;if(c)for(const d in c){const h=c[d];if(n&&Qlt(d,h)){delete c[d];continue}if(h.source=r,h.defaultDefaultValue=c[d].default,this.updatePropertyDefaultValue(d,h),m1.test(d)?h.scope=void 0:(h.scope=Hu(h.scope)?o:h.scope,h.restricted=Hu(h.restricted)?!!(s!=null&&s.includes(d)):h.restricted),c[d].hasOwnProperty("included")&&!c[d].included){this.excludedConfigurationProperties[d]=c[d],delete c[d];continue}else this.configurationProperties[d]=c[d],!((l=c[d].policy)===null||l===void 0)&&l.name&&this.policyConfigurations.set(c[d].policy.name,d);!c[d].deprecationMessage&&c[d].markdownDeprecationMessage&&(c[d].deprecationMessage=c[d].markdownDeprecationMessage),a.add(d)}const u=e.allOf;if(u)for(const d of u)this.validateAndRegisterProperties(d,n,r,s,o,a)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const n=r=>{const s=r.properties;if(s)for(const a in s)this.updateSchema(a,s[a]);const o=r.allOf;o==null||o.forEach(n)};n(e)}updateSchema(e,n){switch(n.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=n;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const n=`[${e}]`,r={type:"object",description:L("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:L("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:$3};this.updatePropertyDefaultValue(n,r)}}registerOverridePropertyPatternKey(){L("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),L("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,n){const r=this.configurationDefaultsOverrides.get(e);let s=r==null?void 0:r.value,o=r==null?void 0:r.source;nu(s)&&(s=n.defaultDefaultValue,o=void 0),nu(s)&&(s=Zlt(n.type)),n.default=s,n.defaultValueSource=o}}const VEe="\\[([^\\]]+)\\]",Cpe=new RegExp(VEe,"g"),Ylt=`^(${VEe})+$`,m1=new RegExp(Ylt);function H9(i){const e=[];if(m1.test(i)){let n=Cpe.exec(i);for(;n!=null&&n.length;){const r=n[1].trim();r&&e.push(r),n=Cpe.exec(i)}}return l1(e)}function Zlt(i){switch(Array.isArray(i)?i[0]:i){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const l8=new Xlt;Kr.add(ag.Configuration,l8);function Qlt(i,e){var n,r,s,o;return i.trim()?m1.test(i)?L("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",i):l8.getConfigurationProperties()[i]!==void 0?L("config.property.duplicate","Cannot register '{0}'. This property is already registered.",i):!((n=e.policy)===null||n===void 0)&&n.name&&l8.getPolicyConfigurations().get((r=e.policy)===null||r===void 0?void 0:r.name)!==void 0?L("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",i,(s=e.policy)===null||s===void 0?void 0:s.name,l8.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:L("config.property.empty","Cannot register an empty property")}const Jlt={ModesRegistry:"editor.modesRegistry"};class ect{constructor(){this._onDidChangeLanguages=new _e,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let n=0,r=this._languages.length;n<r;n++)if(this._languages[n]===e){this._languages.splice(n,1);return}}}}getLanguages(){return this._languages}}const PE=new ect;Kr.add(Jlt.ModesRegistry,PE);const ad="plaintext",tct=".txt";PE.registerLanguage({id:ad,extensions:[tct],aliases:[L("plainText.alias","Plain Text"),"text"],mimetypes:[bs.text]});Kr.as(ag.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class nct{constructor(e,n){this.languageId=e;const r=n.brackets?Spe(n.brackets):[],s=new qfe(l=>{const c=new Set;return{info:new ict(this,l,c),closing:c}}),o=new qfe(l=>{const c=new Set,u=new Set;return{info:new rct(this,l,c,u),opening:c,openingColorized:u}});for(const[l,c]of r){const u=s.get(l),d=o.get(c);u.closing.add(d.info),d.opening.add(u.info)}const a=n.colorizedBracketPairs?Spe(n.colorizedBracketPairs):r.filter(l=>!(l[0]==="<"&&l[1]===">"));for(const[l,c]of a){const u=s.get(l),d=o.get(c);u.closing.add(d.info),d.openingColorized.add(u.info),d.opening.add(u.info)}this._openingBrackets=new Map([...s.cachedValues].map(([l,c])=>[l,c.info])),this._closingBrackets=new Map([...o.cachedValues].map(([l,c])=>[l,c.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function Spe(i){return i.filter(([e,n])=>e!==""&&n!=="")}class HEe{constructor(e,n){this.config=e,this.bracketText=n}get languageId(){return this.config.languageId}}class ict extends HEe{constructor(e,n,r){super(e,n),this.openedBrackets=r,this.isOpeningBracket=!0}}class rct extends HEe{constructor(e,n,r,s){super(e,n),this.openingBrackets=r,this.openingColorizedBrackets=s,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var sct=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},xpe=function(i,e){return function(n,r){e(n,r,i)}};class aq{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const dr=qn("languageConfigurationService");let pJ=class extends Le{constructor(e,n){super(),this.configurationService=e,this.languageService=n,this._registry=this._register(new cct),this.onDidChangeEmitter=this._register(new _e),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const r=new Set(Object.values(gJ));this._register(this.configurationService.onDidChangeConfiguration(s=>{const o=s.change.keys.some(l=>r.has(l)),a=s.change.overrides.filter(([l,c])=>c.some(u=>r.has(u))).map(([l])=>l);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new aq(void 0));else for(const l of a)this.languageService.isRegisteredLanguageId(l)&&(this.configurations.delete(l),this.onDidChangeEmitter.fire(new aq(l)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new aq(s.languageId))}))}register(e,n,r){return this._registry.register(e,n,r)}getLanguageConfiguration(e){let n=this.configurations.get(e);return n||(n=oct(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,n)),n}};pJ=sct([xpe(0,ei),xpe(1,Ar)],pJ);function oct(i,e,n,r){let s=e.getLanguageConfiguration(i);if(!s){if(!r.isRegisteredLanguageId(i))return new $2(i,{});s=new $2(i,{})}const o=act(s.languageId,n),a=qEe([s.underlyingConfig,o]);return new $2(s.languageId,a)}const gJ={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function act(i,e){const n=e.getValue(gJ.brackets,{overrideIdentifier:i}),r=e.getValue(gJ.colorizedBracketPairs,{overrideIdentifier:i});return{brackets:kpe(n),colorizedBracketPairs:kpe(r)}}function kpe(i){if(Array.isArray(i))return i.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function UEe(i,e,n){const r=i.getLineContent(e);let s=ar(r);return s.length>n-1&&(s=s.substring(0,n-1)),s}function W2(i,e,n){i.tokenization.forceTokenization(e);const r=i.tokenization.getLineTokens(e),s=typeof n>"u"?i.getLineMaxColumn(e)-1:n-1;return g$(r,s)}class lct{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,n){const r=new Lpe(e,n,++this._order);return this._entries.push(r),this._resolved=null,gn(()=>{for(let s=0;s<this._entries.length;s++)if(this._entries[s]===r){this._entries.splice(s,1),this._resolved=null;break}})}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new $2(this.languageId,e))}return this._resolved}_resolve(){return this._entries.length===0?null:(this._entries.sort(Lpe.cmp),qEe(this._entries.map(e=>e.configuration)))}}function qEe(i){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const n of i)e={comments:n.comments||e.comments,brackets:n.brackets||e.brackets,wordPattern:n.wordPattern||e.wordPattern,indentationRules:n.indentationRules||e.indentationRules,onEnterRules:n.onEnterRules||e.onEnterRules,autoClosingPairs:n.autoClosingPairs||e.autoClosingPairs,surroundingPairs:n.surroundingPairs||e.surroundingPairs,autoCloseBefore:n.autoCloseBefore||e.autoCloseBefore,folding:n.folding||e.folding,colorizedBracketPairs:n.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:n.__electricCharacterSupport||e.__electricCharacterSupport};return e}class Lpe{constructor(e,n,r){this.configuration=e,this.priority=n,this.order=r}static cmp(e,n){return e.priority===n.priority?e.order-n.order:e.priority-n.priority}}class Dpe{constructor(e){this.languageId=e}}class cct extends Le{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new _e),this.onDidChange=this._onDidChange.event,this._register(this.register(ad,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,n,r=0){let s=this._entries.get(e);s||(s=new lct(e),this._entries.set(e,s));const o=s.register(n,r);return this._onDidChange.fire(new Dpe(e)),gn(()=>{o.dispose(),this._onDidChange.fire(new Dpe(e))})}getLanguageConfiguration(e){const n=this._entries.get(e);return(n==null?void 0:n.getResolvedConfiguration())||null}}class $2{constructor(e,n){this.languageId=e,this.underlyingConfig=n,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new r2(this.underlyingConfig):null,this.comments=$2._handleComments(this.underlyingConfig),this.characterPair=new ME(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Tse,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Vlt(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new nct(e,this.underlyingConfig)}getWordDefinition(){return D2e(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Olt(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new zlt(this.brackets)),this._electricCharacter}onEnter(e,n,r,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,n,r,s):null}getAutoClosingPairs(){return new Elt(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const n=e.comments;if(!n)return null;const r={};if(n.lineComment&&(r.lineCommentToken=n.lineComment),n.blockComment){const[s,o]=n.blockComment;r.blockCommentStartToken=s,r.blockCommentEndToken=o}return r}}oi(dr,pJ,1);class Kb{constructor(e,n,r,s){this.originalStart=e,this.originalLength=n,this.modifiedStart=r,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function KEe(i){return y$(i,0)}function y$(i,e){switch(typeof i){case"object":return i===null?Q0(349,e):Array.isArray(i)?dct(i,e):hct(i,e);case"string":return eoe(i,e);case"boolean":return uct(i,e);case"number":return Q0(i,e);case"undefined":return Q0(937,e);default:return Q0(617,e)}}function Q0(i,e){return(e<<5)-e+i|0}function uct(i,e){return Q0(i?433:863,e)}function eoe(i,e){e=Q0(149417,e);for(let n=0,r=i.length;n<r;n++)e=Q0(i.charCodeAt(n),e);return e}function dct(i,e){return e=Q0(104579,e),i.reduce((n,r)=>y$(r,n),e)}function hct(i,e){return e=Q0(181387,e),Object.keys(i).sort().reduce((n,r)=>(n=eoe(r,n),y$(i[r],n)),e)}function lq(i,e,n=32){const r=n-e,s=~((1<<r)-1);return(i<<e|(s&i)>>>r)>>>0}function Epe(i,e=0,n=i.byteLength,r=0){for(let s=0;s<n;s++)i[e+s]=r}function fct(i,e,n="0"){for(;i.length<e;)i=n+i;return i}function zR(i,e=32){return i instanceof ArrayBuffer?Array.from(new Uint8Array(i)).map(n=>n.toString(16).padStart(2,"0")).join(""):fct((i>>>0).toString(16),e/4)}class w${constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const n=e.length;if(n===0)return;const r=this._buff;let s=this._buffLen,o=this._leftoverHighSurrogate,a,l;for(o!==0?(a=o,l=-1,o=0):(a=e.charCodeAt(0),l=0);;){let c=a;if(xo(a))if(l+1<n){const u=e.charCodeAt(l+1);lx(u)?(l++,c=$se(a,u)):c=65533}else{o=a;break}else lx(a)&&(c=65533);if(s=this._push(r,s,c),l++,l<n)a=e.charCodeAt(l);else break}this._buffLen=s,this._leftoverHighSurrogate=o}_push(e,n,r){return r<128?e[n++]=r:r<2048?(e[n++]=192|(r&1984)>>>6,e[n++]=128|(r&63)>>>0):r<65536?(e[n++]=224|(r&61440)>>>12,e[n++]=128|(r&4032)>>>6,e[n++]=128|(r&63)>>>0):(e[n++]=240|(r&1835008)>>>18,e[n++]=128|(r&258048)>>>12,e[n++]=128|(r&4032)>>>6,e[n++]=128|(r&63)>>>0),n>=64&&(this._step(),n-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),n}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),zR(this._h0)+zR(this._h1)+zR(this._h2)+zR(this._h3)+zR(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Epe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Epe(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=w$._bigBlock32,n=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,n.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,lq(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let r=this._h0,s=this._h1,o=this._h2,a=this._h3,l=this._h4,c,u,d;for(let h=0;h<80;h++)h<20?(c=s&o|~s&a,u=1518500249):h<40?(c=s^o^a,u=1859775393):h<60?(c=s&o|s&a|o&a,u=2400959708):(c=s^o^a,u=3395469782),d=lq(r,5)+c+l+u+e.getUint32(h*4,!1)&4294967295,l=a,a=o,o=lq(s,30),s=r,r=d;this._h0=this._h0+r&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+a&4294967295,this._h4=this._h4+l&4294967295}}w$._bigBlock32=new DataView(new ArrayBuffer(320));class Ipe{constructor(e){this.source=e}getElements(){const e=this.source,n=new Int32Array(e.length);for(let r=0,s=e.length;r<s;r++)n[r]=e.charCodeAt(r);return n}}function pct(i,e,n){return new cm(new Ipe(i),new Ipe(e)).ComputeDiff(n).changes}class YL{static Assert(e,n){if(!e)throw new Error(n)}}class ZL{static Copy(e,n,r,s,o){for(let a=0;a<o;a++)r[s+a]=e[n+a]}static Copy2(e,n,r,s,o){for(let a=0;a<o;a++)r[s+a]=e[n+a]}}class Tpe{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new Kb(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,n){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_originalCount++}AddModifiedElement(e,n){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class cm{constructor(e,n,r=null){this.ContinueProcessingPredicate=r,this._originalSequence=e,this._modifiedSequence=n;const[s,o,a]=cm._getElements(e),[l,c,u]=cm._getElements(n);this._hasStrings=a&&u,this._originalStringElements=s,this._originalElementsOrHash=o,this._modifiedStringElements=l,this._modifiedElementsOrHash=c,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const n=e.getElements();if(cm._isStringArray(n)){const r=new Int32Array(n.length);for(let s=0,o=n.length;s<o;s++)r[s]=eoe(n[s],0);return[n,r,!0]}return n instanceof Int32Array?[[],n,!1]:[[],new Int32Array(n),!1]}ElementsAreEqual(e,n){return this._originalElementsOrHash[e]!==this._modifiedElementsOrHash[n]?!1:this._hasStrings?this._originalStringElements[e]===this._modifiedStringElements[n]:!0}ElementsAreStrictEqual(e,n){if(!this.ElementsAreEqual(e,n))return!1;const r=cm._getStrictElement(this._originalSequence,e),s=cm._getStrictElement(this._modifiedSequence,n);return r===s}static _getStrictElement(e,n){return typeof e.getStrictElement=="function"?e.getStrictElement(n):null}OriginalElementsAreEqual(e,n){return this._originalElementsOrHash[e]!==this._originalElementsOrHash[n]?!1:this._hasStrings?this._originalStringElements[e]===this._originalStringElements[n]:!0}ModifiedElementsAreEqual(e,n){return this._modifiedElementsOrHash[e]!==this._modifiedElementsOrHash[n]?!1:this._hasStrings?this._modifiedStringElements[e]===this._modifiedStringElements[n]:!0}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,n,r,s,o){const a=[!1];let l=this.ComputeDiffRecursive(e,n,r,s,a);return o&&(l=this.PrettifyChanges(l)),{quitEarly:a[0],changes:l}}ComputeDiffRecursive(e,n,r,s,o){for(o[0]=!1;e<=n&&r<=s&&this.ElementsAreEqual(e,r);)e++,r++;for(;n>=e&&s>=r&&this.ElementsAreEqual(n,s);)n--,s--;if(e>n||r>s){let h;return r<=s?(YL.Assert(e===n+1,"originalStart should only be one more than originalEnd"),h=[new Kb(e,0,r,s-r+1)]):e<=n?(YL.Assert(r===s+1,"modifiedStart should only be one more than modifiedEnd"),h=[new Kb(e,n-e+1,r,0)]):(YL.Assert(e===n+1,"originalStart should only be one more than originalEnd"),YL.Assert(r===s+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const a=[0],l=[0],c=this.ComputeRecursionPoint(e,n,r,s,a,l,o),u=a[0],d=l[0];if(c!==null)return c;if(!o[0]){const h=this.ComputeDiffRecursive(e,u,r,d,o);let f=[];return o[0]?f=[new Kb(u+1,n-(u+1)+1,d+1,s-(d+1)+1)]:f=this.ComputeDiffRecursive(u+1,n,d+1,s,o),this.ConcatenateChanges(h,f)}return[new Kb(e,n-e+1,r,s-r+1)]}WALKTRACE(e,n,r,s,o,a,l,c,u,d,h,f,p,g,m,_,b,y){let x=null,k=null,D=new Tpe,R=n,E=r,A=p[0]-_[0]-s,M=-1073741824,N=this.m_forwardHistory.length-1;do{const P=A+e;P===R||P<E&&u[P-1]<u[P+1]?(h=u[P+1],g=h-A-s,h<M&&D.MarkNextChange(),M=h,D.AddModifiedElement(h+1,g),A=P+1-e):(h=u[P-1]+1,g=h-A-s,h<M&&D.MarkNextChange(),M=h-1,D.AddOriginalElement(h,g+1),A=P-1-e),N>=0&&(u=this.m_forwardHistory[N],e=u[0],R=1,E=u.length-1)}while(--N>=-1);if(x=D.getReverseChanges(),y[0]){let P=p[0]+1,O=_[0]+1;if(x!==null&&x.length>0){const B=x[x.length-1];P=Math.max(P,B.getOriginalEnd()),O=Math.max(O,B.getModifiedEnd())}k=[new Kb(P,f-P+1,O,m-O+1)]}else{D=new Tpe,R=a,E=l,A=p[0]-_[0]-c,M=1073741824,N=b?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const P=A+o;P===R||P<E&&d[P-1]>=d[P+1]?(h=d[P+1]-1,g=h-A-c,h>M&&D.MarkNextChange(),M=h+1,D.AddOriginalElement(h+1,g+1),A=P+1-o):(h=d[P-1],g=h-A-c,h>M&&D.MarkNextChange(),M=h,D.AddModifiedElement(h+1,g+1),A=P-1-o),N>=0&&(d=this.m_reverseHistory[N],o=d[0],R=1,E=d.length-1)}while(--N>=-1);k=D.getChanges()}return this.ConcatenateChanges(x,k)}ComputeRecursionPoint(e,n,r,s,o,a,l){let c=0,u=0,d=0,h=0,f=0,p=0;e--,r--,o[0]=0,a[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=n-e+(s-r),m=g+1,_=new Int32Array(m),b=new Int32Array(m),y=s-r,x=n-e,k=e-r,D=n-s,E=(x-y)%2===0;_[y]=e,b[x]=n,l[0]=!1;for(let A=1;A<=g/2+1;A++){let M=0,N=0;d=this.ClipDiagonalBound(y-A,A,y,m),h=this.ClipDiagonalBound(y+A,A,y,m);for(let O=d;O<=h;O+=2){O===d||O<h&&_[O-1]<_[O+1]?c=_[O+1]:c=_[O-1]+1,u=c-(O-y)-k;const B=c;for(;c<n&&u<s&&this.ElementsAreEqual(c+1,u+1);)c++,u++;if(_[O]=c,c+u>M+N&&(M=c,N=u),!E&&Math.abs(O-x)<=A-1&&c>=b[O])return o[0]=c,a[0]=u,B<=b[O]&&A<=1448?this.WALKTRACE(y,d,h,k,x,f,p,D,_,b,c,n,o,u,s,a,E,l):null}const P=(M-e+(N-r)-A)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(M,P))return l[0]=!0,o[0]=M,a[0]=N,P>0&&A<=1448?this.WALKTRACE(y,d,h,k,x,f,p,D,_,b,c,n,o,u,s,a,E,l):(e++,r++,[new Kb(e,n-e+1,r,s-r+1)]);f=this.ClipDiagonalBound(x-A,A,x,m),p=this.ClipDiagonalBound(x+A,A,x,m);for(let O=f;O<=p;O+=2){O===f||O<p&&b[O-1]>=b[O+1]?c=b[O+1]-1:c=b[O-1],u=c-(O-x)-D;const B=c;for(;c>e&&u>r&&this.ElementsAreEqual(c,u);)c--,u--;if(b[O]=c,E&&Math.abs(O-y)<=A&&c<=_[O])return o[0]=c,a[0]=u,B>=_[O]&&A<=1448?this.WALKTRACE(y,d,h,k,x,f,p,D,_,b,c,n,o,u,s,a,E,l):null}if(A<=1447){let O=new Int32Array(h-d+2);O[0]=y-d+1,ZL.Copy2(_,d,O,1,h-d+1),this.m_forwardHistory.push(O),O=new Int32Array(p-f+2),O[0]=x-f+1,ZL.Copy2(b,f,O,1,p-f+1),this.m_reverseHistory.push(O)}}return this.WALKTRACE(y,d,h,k,x,f,p,D,_,b,c,n,o,u,s,a,E,l)}PrettifyChanges(e){for(let n=0;n<e.length;n++){const r=e[n],s=n<e.length-1?e[n+1].originalStart:this._originalElementsOrHash.length,o=n<e.length-1?e[n+1].modifiedStart:this._modifiedElementsOrHash.length,a=r.originalLength>0,l=r.modifiedLength>0;for(;r.originalStart+r.originalLength<s&&r.modifiedStart+r.modifiedLength<o&&(!a||this.OriginalElementsAreEqual(r.originalStart,r.originalStart+r.originalLength))&&(!l||this.ModifiedElementsAreEqual(r.modifiedStart,r.modifiedStart+r.modifiedLength));){const u=this.ElementsAreStrictEqual(r.originalStart,r.modifiedStart);if(this.ElementsAreStrictEqual(r.originalStart+r.originalLength,r.modifiedStart+r.modifiedLength)&&!u)break;r.originalStart++,r.modifiedStart++}const c=[null];if(n<e.length-1&&this.ChangesOverlap(e[n],e[n+1],c)){e[n]=c[0],e.splice(n+1,1),n--;continue}}for(let n=e.length-1;n>=0;n--){const r=e[n];let s=0,o=0;if(n>0){const h=e[n-1];s=h.originalStart+h.originalLength,o=h.modifiedStart+h.modifiedLength}const a=r.originalLength>0,l=r.modifiedLength>0;let c=0,u=this._boundaryScore(r.originalStart,r.originalLength,r.modifiedStart,r.modifiedLength);for(let h=1;;h++){const f=r.originalStart-h,p=r.modifiedStart-h;if(f<s||p<o||a&&!this.OriginalElementsAreEqual(f,f+r.originalLength)||l&&!this.ModifiedElementsAreEqual(p,p+r.modifiedLength))break;const m=(f===s&&p===o?5:0)+this._boundaryScore(f,r.originalLength,p,r.modifiedLength);m>u&&(u=m,c=h)}r.originalStart-=c,r.modifiedStart-=c;const d=[null];if(n>0&&this.ChangesOverlap(e[n-1],e[n],d)){e[n-1]=d[0],e.splice(n,1),n++;continue}}if(this._hasStrings)for(let n=1,r=e.length;n<r;n++){const s=e[n-1],o=e[n],a=o.originalStart-s.originalStart-s.originalLength,l=s.originalStart,c=o.originalStart+o.originalLength,u=c-l,d=s.modifiedStart,h=o.modifiedStart+o.modifiedLength,f=h-d;if(a<5&&u<20&&f<20){const p=this._findBetterContiguousSequence(l,u,d,f,a);if(p){const[g,m]=p;(g!==s.originalStart+s.originalLength||m!==s.modifiedStart+s.modifiedLength)&&(s.originalLength=g-s.originalStart,s.modifiedLength=m-s.modifiedStart,o.originalStart=g+a,o.modifiedStart=m+a,o.originalLength=c-o.originalStart,o.modifiedLength=h-o.modifiedStart)}}}return e}_findBetterContiguousSequence(e,n,r,s,o){if(n<o||s<o)return null;const a=e+n-o+1,l=r+s-o+1;let c=0,u=0,d=0;for(let h=e;h<a;h++)for(let f=r;f<l;f++){const p=this._contiguousSequenceScore(h,f,o);p>0&&p>c&&(c=p,u=h,d=f)}return c>0?[u,d]:null}_contiguousSequenceScore(e,n,r){let s=0;for(let o=0;o<r;o++){if(!this.ElementsAreEqual(e+o,n+o))return 0;s+=this._originalStringElements[e+o].length}return s}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,n){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(n>0){const r=e+n;if(this._OriginalIsBoundary(r-1)||this._OriginalIsBoundary(r))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,n){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(n>0){const r=e+n;if(this._ModifiedIsBoundary(r-1)||this._ModifiedIsBoundary(r))return!0}return!1}_boundaryScore(e,n,r,s){const o=this._OriginalRegionIsBoundary(e,n)?1:0,a=this._ModifiedRegionIsBoundary(r,s)?1:0;return o+a}ConcatenateChanges(e,n){const r=[];if(e.length===0||n.length===0)return n.length>0?n:e;if(this.ChangesOverlap(e[e.length-1],n[0],r)){const s=new Array(e.length+n.length-1);return ZL.Copy(e,0,s,0,e.length-1),s[e.length-1]=r[0],ZL.Copy(n,1,s,e.length,n.length-1),s}else{const s=new Array(e.length+n.length);return ZL.Copy(e,0,s,0,e.length),ZL.Copy(n,0,s,e.length,n.length),s}}ChangesOverlap(e,n,r){if(YL.Assert(e.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),YL.Assert(e.modifiedStart<=n.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=n.originalStart||e.modifiedStart+e.modifiedLength>=n.modifiedStart){const s=e.originalStart;let o=e.originalLength;const a=e.modifiedStart;let l=e.modifiedLength;return e.originalStart+e.originalLength>=n.originalStart&&(o=n.originalStart+n.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=n.modifiedStart&&(l=n.modifiedStart+n.modifiedLength-e.modifiedStart),r[0]=new Kb(s,o,a,l),!0}else return r[0]=null,!1}ClipDiagonalBound(e,n,r,s){if(e>=0&&e<s)return e;const o=r,a=s-r-1,l=n%2===0;if(e<0){const c=o%2===0;return l===c?0:1}else{const c=a%2===0;return l===c?s-1:s-2}}}function U9(i){return i<0?0:i>255?255:i|0}function QL(i){return i<0?0:i>4294967295?4294967295:i|0}class gct{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,n){e=QL(e);const r=this.values,s=this.prefixSum,o=n.length;return o===0?!1:(this.values=new Uint32Array(r.length+o),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e),e+o),this.values.set(n,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,n){return e=QL(e),n=QL(n),this.values[e]===n?!1:(this.values[e]=n,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,n){e=QL(e),n=QL(n);const r=this.values,s=this.prefixSum;if(e>=r.length)return!1;const o=r.length-e;return n>=o&&(n=o),n===0?!1:(this.values=new Uint32Array(r.length-n),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e+n),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=QL(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let n=this.prefixSumValidIndex[0]+1;n===0&&(this.prefixSum[0]=this.values[0],n++),e>=this.values.length&&(e=this.values.length-1);for(let r=n;r<=e;r++)this.prefixSum[r]=this.prefixSum[r-1]+this.values[r];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let n=0,r=this.values.length-1,s=0,o=0,a=0;for(;n<=r;)if(s=n+(r-n)/2|0,o=this.prefixSum[s],a=o-this.values[s],e<a)r=s-1;else if(e>=o)n=s+1;else break;return new GEe(s,e-a)}}class mct{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const n=this._indexBySum[e],r=n>0?this._prefixSum[n-1]:0;return new GEe(n,e-r)}removeValues(e,n){this._values.splice(e,n),this._invalidate(e)}insertValues(e,n){this._values=GW(this._values,e,n),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,n=this._values.length;e<n;e++){const r=this._values[e],s=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=s+r;for(let o=0;o<r;o++)this._indexBySum[s+o]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,n){this._values[e]!==n&&(this._values[e]=n,this._invalidate(e))}}class GEe{constructor(e,n){this.index=e,this.remainder=n,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=n}}class _ct{constructor(e,n,r,s){this._uri=e,this._lines=n,this._eol=r,this._versionId=s,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const n=e.changes;for(const r of n)this._acceptDeleteRange(r.range),this._acceptInsertText(new ve(r.range.startLineNumber,r.range.startColumn),r.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,n=this._lines.length,r=new Uint32Array(n);for(let s=0;s<n;s++)r[s]=this._lines[s].length+e;this._lineStarts=new gct(r)}}_setLineText(e,n){this._lines[e]=n,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1));return}this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,n){if(n.length===0)return;const r=Km(n);if(r.length===1){this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+r[0]+this._lines[e.lineNumber-1].substring(e.column-1));return}r[r.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+r[0]);const s=new Uint32Array(r.length-1);for(let o=1;o<r.length;o++)this._lines.splice(e.lineNumber+o-1,0,r[o]),s[o-1]=r[o].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,s)}}class WI{constructor(e){const n=U9(e);this._defaultValue=n,this._asciiMap=WI._createAsciiMap(n),this._map=new Map}static _createAsciiMap(e){const n=new Uint8Array(256);return n.fill(e),n}set(e,n){const r=U9(n);e>=0&&e<256?this._asciiMap[e]=r:this._map.set(e,r)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class q9{constructor(){this._actual=new WI(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class vct{constructor(e,n,r){const s=new Uint8Array(e*n);for(let o=0,a=e*n;o<a;o++)s[o]=r;this._data=s,this.rows=e,this.cols=n}get(e,n){return this._data[e*this.cols+n]}set(e,n,r){this._data[e*this.cols+n]=r}}class bct{constructor(e){let n=0,r=0;for(let o=0,a=e.length;o<a;o++){const[l,c,u]=e[o];c>n&&(n=c),l>r&&(r=l),u>r&&(r=u)}n++,r++;const s=new vct(r,n,0);for(let o=0,a=e.length;o<a;o++){const[l,c,u]=e[o];s.set(l,c,u)}this._states=s,this._maxCharCode=n}nextState(e,n){return n<0||n>=this._maxCharCode?0:this._states.get(e,n)}}let cq=null;function yct(){return cq===null&&(cq=new bct([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),cq}let VR=null;function wct(){if(VR===null){VR=new WI(0);const i=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let n=0;n<i.length;n++)VR.set(i.charCodeAt(n),1);const e=".,;:";for(let n=0;n<e.length;n++)VR.set(e.charCodeAt(n),2)}return VR}class K9{static _createLink(e,n,r,s,o){let a=o-1;do{const l=n.charCodeAt(a);if(e.get(l)!==2)break;a--}while(a>s);if(s>0){const l=n.charCodeAt(s-1),c=n.charCodeAt(a);(l===40&&c===41||l===91&&c===93||l===123&&c===125)&&a--}return{range:{startLineNumber:r,startColumn:s+1,endLineNumber:r,endColumn:a+2},url:n.substring(s,a+1)}}static computeLinks(e,n=yct()){const r=wct(),s=[];for(let o=1,a=e.getLineCount();o<=a;o++){const l=e.getLineContent(o),c=l.length;let u=0,d=0,h=0,f=1,p=!1,g=!1,m=!1,_=!1;for(;u<c;){let b=!1;const y=l.charCodeAt(u);if(f===13){let x;switch(y){case 40:p=!0,x=0;break;case 41:x=p?0:1;break;case 91:m=!0,g=!0,x=0;break;case 93:m=!1,x=g?0:1;break;case 123:_=!0,x=0;break;case 125:x=_?0:1;break;case 39:case 34:case 96:h===y?x=1:h===39||h===34||h===96?x=0:x=1;break;case 42:x=h===42?1:0;break;case 124:x=h===124?1:0;break;case 32:x=m?0:1;break;default:x=r.get(y)}x===1&&(s.push(K9._createLink(r,l,o,d,u)),b=!0)}else if(f===12){let x;y===91?(g=!0,x=0):x=r.get(y),x===1?b=!0:f=13}else f=n.nextState(f,y),f===0&&(b=!0);b&&(f=1,p=!1,g=!1,_=!1,d=u+1,h=y),u++}f===13&&s.push(K9._createLink(r,l,o,d,c))}return s}}function Cct(i){return!i||typeof i.getLineCount!="function"||typeof i.getLineContent!="function"?[]:K9.computeLinks(i)}class mJ{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,n,r,s,o){if(e&&n){const a=this.doNavigateValueSet(n,o);if(a)return{range:e,value:a}}if(r&&s){const a=this.doNavigateValueSet(s,o);if(a)return{range:r,value:a}}return null}doNavigateValueSet(e,n){const r=this.numberReplace(e,n);return r!==null?r:this.textReplace(e,n)}numberReplace(e,n){const r=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let s=Number(e);const o=parseFloat(e);return!isNaN(s)&&!isNaN(o)&&s===o?s===0&&!n?null:(s=Math.floor(s*r),s+=n?r:-r,String(s/r)):null}textReplace(e,n){return this.valueSetsReplace(this._defaultValueSet,e,n)}valueSetsReplace(e,n,r){let s=null;for(let o=0,a=e.length;s===null&&o<a;o++)s=this.valueSetReplace(e[o],n,r);return s}valueSetReplace(e,n,r){let s=e.indexOf(n);return s>=0?(s+=r?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}}mJ.INSTANCE=new mJ;class Sct extends WI{constructor(e){super(0);for(let n=0,r=e.length;n<r;n++)this.set(e.charCodeAt(n),2);this.set(32,1),this.set(9,1)}}function xct(i){const e={};return n=>(e.hasOwnProperty(n)||(e[n]=i(n)),e[n])}const vh=xct(i=>new Sct(i));var hd;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(hd||(hd={}));var z2;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(z2||(z2={}));var ou;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(ou||(ou={}));var Mp;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(Mp||(Mp={}));class c8{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&od(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class pP{constructor(e,n){this._findMatchBrand=void 0,this.range=e,this.matches=n}}function kct(i){return i&&typeof i.read=="function"}class uq{constructor(e,n,r,s,o,a){this.identifier=e,this.range=n,this.text=r,this.forceMoveMarkers=s,this.isAutoWhitespaceEdit=o,this._isTracked=a}}class Lct{constructor(e,n,r){this.regex=e,this.wordSeparators=n,this.simpleSearch=r}}class Dct{constructor(e,n,r){this.reverseEdits=e,this.changes=n,this.trimAutoWhitespaceLineNumbers=r}}function Ect(i){return!i.isTooLargeForSyncing()&&!i.isForSimpleWidget}const Ict=999;class MC{constructor(e,n,r,s){this.searchString=e,this.isRegex=n,this.matchCase=r,this.wordSeparators=s}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=Tct(this.searchString):e=this.searchString.indexOf(`
`)>=0;let n=null;try{n=X2e(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!n)return null;let r=!this.isRegex&&!e;return r&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(r=this.matchCase),new Lct(n,this.wordSeparators?vh(this.wordSeparators):null,r?this.searchString:null)}}function Tct(i){if(!i||i.length===0)return!1;for(let e=0,n=i.length;e<n;e++){const r=i.charCodeAt(e);if(r===10)return!0;if(r===92){if(e++,e>=n)break;const s=i.charCodeAt(e);if(s===110||s===114||s===87)return!0}}return!1}function UC(i,e,n){if(!n)return new pP(i,null);const r=[];for(let s=0,o=e.length;s<o;s++)r[s]=e[s];return new pP(i,r)}class Rpe{constructor(e){const n=[];let r=0;for(let s=0,o=e.length;s<o;s++)e.charCodeAt(s)===10&&(n[r++]=s);this._lineFeedsOffsets=n}findLineFeedCountBeforeOffset(e){const n=this._lineFeedsOffsets;let r=0,s=n.length-1;if(s===-1||e<=n[0])return 0;for(;r<s;){const o=r+((s-r)/2>>0);n[o]>=e?s=o-1:n[o+1]>=e?(r=o,s=o):r=o+1}return r+1}}class z3{static findMatches(e,n,r,s,o){const a=n.parseSearchRequest();return a?a.regex.multiline?this._doFindMatchesMultiline(e,r,new s2(a.wordSeparators,a.regex),s,o):this._doFindMatchesLineByLine(e,r,a,s,o):[]}static _getMultilineMatchRange(e,n,r,s,o,a){let l,c=0;s?(c=s.findLineFeedCountBeforeOffset(o),l=n+o+c):l=n+o;let u;if(s){const p=s.findLineFeedCountBeforeOffset(o+a.length)-c;u=l+a.length+p}else u=l+a.length;const d=e.getPositionAt(l),h=e.getPositionAt(u);return new J(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,n,r,s,o){const a=e.getOffsetAt(n.getStartPosition()),l=e.getValueInRange(n,1),c=e.getEOL()===`\r
`?new Rpe(l):null,u=[];let d=0,h;for(r.reset(0);h=r.next(l);)if(u[d++]=UC(this._getMultilineMatchRange(e,a,l,c,h.index,h[0]),h,s),d>=o)return u;return u}static _doFindMatchesLineByLine(e,n,r,s,o){const a=[];let l=0;if(n.startLineNumber===n.endLineNumber){const u=e.getLineContent(n.startLineNumber).substring(n.startColumn-1,n.endColumn-1);return l=this._findMatchesInLine(r,u,n.startLineNumber,n.startColumn-1,l,a,s,o),a}const c=e.getLineContent(n.startLineNumber).substring(n.startColumn-1);l=this._findMatchesInLine(r,c,n.startLineNumber,n.startColumn-1,l,a,s,o);for(let u=n.startLineNumber+1;u<n.endLineNumber&&l<o;u++)l=this._findMatchesInLine(r,e.getLineContent(u),u,0,l,a,s,o);if(l<o){const u=e.getLineContent(n.endLineNumber).substring(0,n.endColumn-1);l=this._findMatchesInLine(r,u,n.endLineNumber,0,l,a,s,o)}return a}static _findMatchesInLine(e,n,r,s,o,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const f=e.simpleSearch,p=f.length,g=n.length;let m=-p;for(;(m=n.indexOf(f,m+p))!==-1;)if((!u||toe(u,n,g,m,p))&&(a[o++]=new pP(new J(r,m+1+s,r,m+1+p+s),null),o>=c))return o;return o}const d=new s2(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(n),h&&(a[o++]=UC(new J(r,h.index+1+s,r,h.index+1+h[0].length+s),h,l),o>=c))return o;while(h);return o}static findNextMatch(e,n,r,s){const o=n.parseSearchRequest();if(!o)return null;const a=new s2(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,r,a,s):this._doFindNextMatchLineByLine(e,r,a,s)}static _doFindNextMatchMultiline(e,n,r,s){const o=new ve(n.lineNumber,1),a=e.getOffsetAt(o),l=e.getLineCount(),c=e.getValueInRange(new J(o.lineNumber,o.column,l,e.getLineMaxColumn(l)),1),u=e.getEOL()===`\r
`?new Rpe(c):null;r.reset(n.column-1);const d=r.next(c);return d?UC(this._getMultilineMatchRange(e,a,c,u,d.index,d[0]),d,s):n.lineNumber!==1||n.column!==1?this._doFindNextMatchMultiline(e,new ve(1,1),r,s):null}static _doFindNextMatchLineByLine(e,n,r,s){const o=e.getLineCount(),a=n.lineNumber,l=e.getLineContent(a),c=this._findFirstMatchInLine(r,l,a,n.column,s);if(c)return c;for(let u=1;u<=o;u++){const d=(a+u-1)%o,h=e.getLineContent(d+1),f=this._findFirstMatchInLine(r,h,d+1,1,s);if(f)return f}return null}static _findFirstMatchInLine(e,n,r,s,o){e.reset(s-1);const a=e.next(n);return a?UC(new J(r,a.index+1,r,a.index+1+a[0].length),a,o):null}static findPreviousMatch(e,n,r,s){const o=n.parseSearchRequest();if(!o)return null;const a=new s2(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,r,a,s):this._doFindPreviousMatchLineByLine(e,r,a,s)}static _doFindPreviousMatchMultiline(e,n,r,s){const o=this._doFindMatchesMultiline(e,new J(1,1,n.lineNumber,n.column),r,s,10*Ict);if(o.length>0)return o[o.length-1];const a=e.getLineCount();return n.lineNumber!==a||n.column!==e.getLineMaxColumn(a)?this._doFindPreviousMatchMultiline(e,new ve(a,e.getLineMaxColumn(a)),r,s):null}static _doFindPreviousMatchLineByLine(e,n,r,s){const o=e.getLineCount(),a=n.lineNumber,l=e.getLineContent(a).substring(0,n.column-1),c=this._findLastMatchInLine(r,l,a,s);if(c)return c;for(let u=1;u<=o;u++){const d=(o+a-u-1)%o,h=e.getLineContent(d+1),f=this._findLastMatchInLine(r,h,d+1,s);if(f)return f}return null}static _findLastMatchInLine(e,n,r,s){let o=null,a;for(e.reset(0);a=e.next(n);)o=UC(new J(r,a.index+1,r,a.index+1+a[0].length),a,s);return o}}function Rct(i,e,n,r,s){if(r===0)return!0;const o=e.charCodeAt(r-1);if(i.get(o)!==0||o===13||o===10)return!0;if(s>0){const a=e.charCodeAt(r);if(i.get(a)!==0)return!0}return!1}function Act(i,e,n,r,s){if(r+s===n)return!0;const o=e.charCodeAt(r+s);if(i.get(o)!==0||o===13||o===10)return!0;if(s>0){const a=e.charCodeAt(r+s-1);if(i.get(a)!==0)return!0}return!1}function toe(i,e,n,r,s){return Rct(i,e,n,r,s)&&Act(i,e,n,r,s)}class s2{constructor(e,n){this._wordSeparators=e,this._searchRegex=n,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const n=e.length;let r;do{if(this._prevMatchStartIndex+this._prevMatchLength===n||(r=this._searchRegex.exec(e),!r))return null;const s=r.index,o=r[0].length;if(s===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){B9(e,n,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=o,!this._wordSeparators||toe(this._wordSeparators,e,n,s,o))return r}while(r);return null}}class noe{static computeUnicodeHighlights(e,n,r){const s=r?r.startLineNumber:1,o=r?r.endLineNumber:e.getLineCount(),a=new Ape(n),l=a.getCandidateCodePoints();let c;l==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${Nct(Array.from(l))}`,"g");const u=new s2(null,c),d=[];let h=!1,f,p=0,g=0,m=0;e:for(let _=s,b=o;_<=b;_++){const y=e.getLineContent(_),x=y.length;u.reset(0);do if(f=u.next(y),f){let k=f.index,D=f.index+f[0].length;if(k>0){const M=y.charCodeAt(k-1);xo(M)&&k--}if(D+1<x){const M=y.charCodeAt(D-1);xo(M)&&D++}const R=y.substring(k,D);let E=iP(k+1,Tse,y,0);E&&E.endColumn<=k+1&&(E=null);const A=a.shouldHighlightNonBasicASCII(R,E?E.word:null);if(A!==0){if(A===3?p++:A===2?g++:A===1?m++:l$(),d.length>=1e3){h=!0;break e}d.push(new J(_,k+1,_,D+1))}}while(f)}return{ranges:d,hasMore:h,ambiguousCharacterCount:p,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,n){const r=new Ape(n);switch(r.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),a=r.ambiguousCharacters.getPrimaryConfusable(o),l=cx.getLocales().filter(c=>!cx.getInstance(new Set([...n.allowedLocales,c])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(a),notAmbiguousInLocales:l}}case 1:return{kind:2}}}}function Nct(i,e){return`[${dd(i.map(r=>String.fromCodePoint(r)).join(""))}]`}class Ape{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=cx.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const n of Nm.codePoints)Npe(String.fromCodePoint(n))||e.add(n);if(this.options.ambiguousCharacters)for(const n of this.ambiguousCharacters.getConfusableCodePoints())e.add(n);for(const n of this.allowedCodePoints)e.delete(n);return e}shouldHighlightNonBasicASCII(e,n){const r=e.codePointAt(0);if(this.allowedCodePoints.has(r))return 0;if(this.options.nonBasicASCII)return 1;let s=!1,o=!1;if(n)for(const a of n){const l=a.codePointAt(0),c=k5(a);s=s||c,!c&&!this.ambiguousCharacters.isAmbiguous(l)&&!Nm.isInvisibleCharacter(l)&&(o=!0)}return!s&&o?0:this.options.invisibleCharacters&&!Npe(e)&&Nm.isInvisibleCharacter(r)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(r)?3:0}}function Npe(i){return i===" "||i===`
`||i===" "}class u8{constructor(e,n,r){this.changes=e,this.moves=n,this.hitTimeout=r}}class XEe{constructor(e,n){this.lineRangeMapping=e,this.changes=n}}class Un{static addRange(e,n){let r=0;for(;r<n.length&&n[r].endExclusive<e.start;)r++;let s=r;for(;s<n.length&&n[s].start<=e.endExclusive;)s++;if(r===s)n.splice(r,0,e);else{const o=Math.min(e.start,n[r].start),a=Math.max(e.endExclusive,n[s-1].endExclusive);n.splice(r,s-r,new Un(o,a))}}static tryCreate(e,n){if(!(e>n))return new Un(e,n)}static ofLength(e){return new Un(0,e)}constructor(e,n){if(this.start=e,this.endExclusive=n,e>n)throw new Vs(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Un(this.start+e,this.endExclusive+e)}deltaStart(e){return new Un(this.start+e,this.endExclusive)}deltaEnd(e){return new Un(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new Un(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);if(n<=r)return new Un(n,r)}slice(e){return e.slice(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Vs(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Vs(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let n=this.start;n<this.endExclusive;n++)e(n)}}class ioe{constructor(){this._sortedRanges=[]}addRange(e){let n=0;for(;n<this._sortedRanges.length&&this._sortedRanges[n].endExclusive<e.start;)n++;let r=n;for(;r<this._sortedRanges.length&&this._sortedRanges[r].start<=e.endExclusive;)r++;if(n===r)this._sortedRanges.splice(n,0,e);else{const s=Math.min(e.start,this._sortedRanges[n].start),o=Math.max(e.endExclusive,this._sortedRanges[r-1].endExclusive);this._sortedRanges.splice(n,r-n,new Un(s,o))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(", ")}intersectsStrict(e){let n=0;for(;n<this._sortedRanges.length&&this._sortedRanges[n].endExclusive<=e.start;)n++;return n<this._sortedRanges.length&&this._sortedRanges[n].start<e.endExclusive}intersectWithRange(e){const n=new ioe;for(const r of this._sortedRanges){const s=r.intersect(e);s&&n.addRange(s)}return n}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,n)=>e+n.length,0)}}function G9(i,e,n){const r=Mct(i,e);if(r!==-1)return i[r]}function Mct(i,e,n=i.length-1){for(let r=n;r>=0;r--){const s=i[r];if(e(s))return r}return-1}function gP(i,e){const n=mP(i,e);return n===-1?void 0:i[n]}function mP(i,e,n=0,r=i.length){let s=n,o=r;for(;s<o;){const a=Math.floor((s+o)/2);e(i[a])?s=a+1:o=a}return s-1}function Pct(i,e){const n=_P(i,e);return n===i.length?void 0:i[n]}function _P(i,e,n=0,r=i.length){let s=n,o=r;for(;s<o;){const a=Math.floor((s+o)/2);e(i[a])?o=a:s=a+1}return s}class E5{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(E5.assertInvariants){if(this._prevFindLastPredicate){for(const r of this._array)if(this._prevFindLastPredicate(r)&&!e(r))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const n=mP(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}}E5.assertInvariants=!1;function YEe(i,e){if(i.length===0)return;let n=i[0];for(let r=1;r<i.length;r++){const s=i[r];e(s,n)>0&&(n=s)}return n}function Oct(i,e){if(i.length===0)return;let n=i[0];for(let r=1;r<i.length;r++){const s=i[r];e(s,n)>=0&&(n=s)}return n}function Fct(i,e){return YEe(i,(n,r)=>-e(n,r))}function Bct(i,e){if(i.length===0)return-1;let n=0;for(let r=1;r<i.length;r++){const s=i[r];e(s,i[n])>0&&(n=r)}return n}function jct(i,e){for(const n of i){const r=e(n);if(r!==void 0)return r}}let Qn=class Gb{static fromRange(e){return new Gb(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let n=new um(e[0].slice());for(let r=1;r<e.length;r++)n=n.getUnion(new um(e[r].slice()));return n.ranges}static ofLength(e,n){return new Gb(e,e+n)}static deserialize(e){return new Gb(e[0],e[1])}constructor(e,n){if(e>n)throw new Vs(`startLineNumber ${e} cannot be after endLineNumberExclusive ${n}`);this.startLineNumber=e,this.endLineNumberExclusive=n}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new Gb(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new Gb(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new Gb(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}intersect(e){const n=Math.max(this.startLineNumber,e.startLineNumber),r=Math.min(this.endLineNumberExclusive,e.endLineNumberExclusive);if(n<=r)return new Gb(n,r)}intersectsStrict(e){return this.startLineNumber<e.endLineNumberExclusive&&e.startLineNumber<this.endLineNumberExclusive}overlapOrTouch(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}equals(e){return this.startLineNumber===e.startLineNumber&&this.endLineNumberExclusive===e.endLineNumberExclusive}toInclusiveRange(){return this.isEmpty?null:new J(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new J(this.startLineNumber,1,this.endLineNumberExclusive,1)}mapToLineArray(e){const n=[];for(let r=this.startLineNumber;r<this.endLineNumberExclusive;r++)n.push(e(r));return n}forEach(e){for(let n=this.startLineNumber;n<this.endLineNumberExclusive;n++)e(n)}serialize(){return[this.startLineNumber,this.endLineNumberExclusive]}includes(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}toOffsetRange(){return new Un(this.startLineNumber-1,this.endLineNumberExclusive-1)}};class um{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(e.length===0)return;const n=_P(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),r=mP(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(n===r)this._normalizedRanges.splice(n,0,e);else if(n===r-1){const s=this._normalizedRanges[n];this._normalizedRanges[n]=s.join(e)}else{const s=this._normalizedRanges[n].join(this._normalizedRanges[r-1]).join(e);this._normalizedRanges.splice(n,r-n,s)}}contains(e){const n=gP(this._normalizedRanges,r=>r.startLineNumber<=e);return!!n&&n.endLineNumberExclusive>e}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const n=[];let r=0,s=0,o=null;for(;r<this._normalizedRanges.length||s<e._normalizedRanges.length;){let a=null;if(r<this._normalizedRanges.length&&s<e._normalizedRanges.length){const l=this._normalizedRanges[r],c=e._normalizedRanges[s];l.startLineNumber<c.startLineNumber?(a=l,r++):(a=c,s++)}else r<this._normalizedRanges.length?(a=this._normalizedRanges[r],r++):(a=e._normalizedRanges[s],s++);o===null?o=a:o.endLineNumberExclusive>=a.startLineNumber?o=new Qn(o.startLineNumber,Math.max(o.endLineNumberExclusive,a.endLineNumberExclusive)):(n.push(o),o=a)}return o!==null&&n.push(o),new um(n)}subtractFrom(e){const n=_P(this._normalizedRanges,a=>a.endLineNumberExclusive>=e.startLineNumber),r=mP(this._normalizedRanges,a=>a.startLineNumber<=e.endLineNumberExclusive)+1;if(n===r)return new um([e]);const s=[];let o=e.startLineNumber;for(let a=n;a<r;a++){const l=this._normalizedRanges[a];l.startLineNumber>o&&s.push(new Qn(o,l.startLineNumber)),o=l.endLineNumberExclusive}return o<e.endLineNumberExclusive&&s.push(new Qn(o,e.endLineNumberExclusive)),new um(s)}toString(){return this._normalizedRanges.map(e=>e.toString()).join(", ")}getIntersection(e){const n=[];let r=0,s=0;for(;r<this._normalizedRanges.length&&s<e._normalizedRanges.length;){const o=this._normalizedRanges[r],a=e._normalizedRanges[s],l=o.intersect(a);l&&!l.isEmpty&&n.push(l),o.endLineNumberExclusive<a.endLineNumberExclusive?r++:s++}return new um(n)}getWithDelta(e){return new um(this._normalizedRanges.map(n=>n.delta(e)))}}class Xm{static inverse(e,n,r){const s=[];let o=1,a=1;for(const c of e){const u=new bh(new Qn(o,c.original.startLineNumber),new Qn(a,c.modified.startLineNumber),void 0);u.modified.isEmpty||s.push(u),o=c.original.endLineNumberExclusive,a=c.modified.endLineNumberExclusive}const l=new bh(new Qn(o,n+1),new Qn(a,r+1),void 0);return l.modified.isEmpty||s.push(l),s}constructor(e,n){this.original=e,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Xm(this.modified,this.original)}join(e){return new Xm(this.original.join(e.original),this.modified.join(e.modified))}}class bh extends Xm{constructor(e,n,r){super(e,n),this.innerChanges=r}flip(){var e;return new bh(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(n=>n.flip()))}}class _1{constructor(e,n){this.originalRange=e,this.modifiedRange=n}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new _1(this.modifiedRange,this.originalRange)}}const Wct=3;class $ct{computeDiff(e,n,r){var s;const a=new Hct(e,n,{maxComputationTime:r.maxComputationTimeMs,shouldIgnoreTrimWhitespace:r.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),l=[];let c=null;for(const u of a.changes){let d;u.originalEndLineNumber===0?d=new Qn(u.originalStartLineNumber+1,u.originalStartLineNumber+1):d=new Qn(u.originalStartLineNumber,u.originalEndLineNumber+1);let h;u.modifiedEndLineNumber===0?h=new Qn(u.modifiedStartLineNumber+1,u.modifiedStartLineNumber+1):h=new Qn(u.modifiedStartLineNumber,u.modifiedEndLineNumber+1);let f=new bh(d,h,(s=u.charChanges)===null||s===void 0?void 0:s.map(p=>new _1(new J(p.originalStartLineNumber,p.originalStartColumn,p.originalEndLineNumber,p.originalEndColumn),new J(p.modifiedStartLineNumber,p.modifiedStartColumn,p.modifiedEndLineNumber,p.modifiedEndColumn))));c&&(c.modified.endLineNumberExclusive===f.modified.startLineNumber||c.original.endLineNumberExclusive===f.original.startLineNumber)&&(f=new bh(c.original.join(f.original),c.modified.join(f.modified),c.innerChanges&&f.innerChanges?c.innerChanges.concat(f.innerChanges):void 0),l.pop()),l.push(f),c=f}return uP(()=>aEe(l,(u,d)=>d.original.startLineNumber-u.original.endLineNumberExclusive===d.modified.startLineNumber-u.modified.endLineNumberExclusive&&u.original.endLineNumberExclusive<d.original.startLineNumber&&u.modified.endLineNumberExclusive<d.modified.startLineNumber)),new u8(l,[],a.quitEarly)}}function ZEe(i,e,n,r){return new cm(i,e,n).ComputeDiff(r)}let Mpe=class{constructor(e){const n=[],r=[];for(let s=0,o=e.length;s<o;s++)n[s]=_J(e[s],1),r[s]=vJ(e[s],1);this.lines=e,this._startColumns=n,this._endColumns=r}getElements(){const e=[];for(let n=0,r=this.lines.length;n<r;n++)e[n]=this.lines[n].substring(this._startColumns[n]-1,this._endColumns[n]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,n,r){const s=[],o=[],a=[];let l=0;for(let c=n;c<=r;c++){const u=this.lines[c],d=e?this._startColumns[c]:1,h=e?this._endColumns[c]:u.length+1;for(let f=d;f<h;f++)s[l]=u.charCodeAt(f-1),o[l]=c+1,a[l]=f,l++;!e&&c<r&&(s[l]=10,o[l]=c+1,a[l]=u.length+1,l++)}return new zct(s,o,a)}};class zct{constructor(e,n,r){this._charCodes=e,this._lineNumbers=n,this._columns=r}toString(){return"["+this._charCodes.map((e,n)=>(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[n]},${this._columns[n]})`).join(", ")+"]"}_assertIndex(e,n){if(e<0||e>=n.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class V2{constructor(e,n,r,s,o,a,l,c){this.originalStartLineNumber=e,this.originalStartColumn=n,this.originalEndLineNumber=r,this.originalEndColumn=s,this.modifiedStartLineNumber=o,this.modifiedStartColumn=a,this.modifiedEndLineNumber=l,this.modifiedEndColumn=c}static createFromDiffChange(e,n,r){const s=n.getStartLineNumber(e.originalStart),o=n.getStartColumn(e.originalStart),a=n.getEndLineNumber(e.originalStart+e.originalLength-1),l=n.getEndColumn(e.originalStart+e.originalLength-1),c=r.getStartLineNumber(e.modifiedStart),u=r.getStartColumn(e.modifiedStart),d=r.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=r.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new V2(s,o,a,l,c,u,d,h)}}function Vct(i){if(i.length<=1)return i;const e=[i[0]];let n=e[0];for(let r=1,s=i.length;r<s;r++){const o=i[r],a=o.originalStart-(n.originalStart+n.originalLength),l=o.modifiedStart-(n.modifiedStart+n.modifiedLength);Math.min(a,l)<Wct?(n.originalLength=o.originalStart+o.originalLength-n.originalStart,n.modifiedLength=o.modifiedStart+o.modifiedLength-n.modifiedStart):(e.push(o),n=o)}return e}class eM{constructor(e,n,r,s,o){this.originalStartLineNumber=e,this.originalEndLineNumber=n,this.modifiedStartLineNumber=r,this.modifiedEndLineNumber=s,this.charChanges=o}static createFromDiffResult(e,n,r,s,o,a,l){let c,u,d,h,f;if(n.originalLength===0?(c=r.getStartLineNumber(n.originalStart)-1,u=0):(c=r.getStartLineNumber(n.originalStart),u=r.getEndLineNumber(n.originalStart+n.originalLength-1)),n.modifiedLength===0?(d=s.getStartLineNumber(n.modifiedStart)-1,h=0):(d=s.getStartLineNumber(n.modifiedStart),h=s.getEndLineNumber(n.modifiedStart+n.modifiedLength-1)),a&&n.originalLength>0&&n.originalLength<20&&n.modifiedLength>0&&n.modifiedLength<20&&o()){const p=r.createCharSequence(e,n.originalStart,n.originalStart+n.originalLength-1),g=s.createCharSequence(e,n.modifiedStart,n.modifiedStart+n.modifiedLength-1);if(p.getElements().length>0&&g.getElements().length>0){let m=ZEe(p,g,o,!0).changes;l&&(m=Vct(m)),f=[];for(let _=0,b=m.length;_<b;_++)f.push(V2.createFromDiffChange(m[_],p,g))}}return new eM(c,u,d,h,f)}}class Hct{constructor(e,n,r){this.shouldComputeCharChanges=r.shouldComputeCharChanges,this.shouldPostProcessCharChanges=r.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=r.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=r.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=n,this.original=new Mpe(e),this.modified=new Mpe(n),this.continueLineDiff=Ppe(r.maxComputationTime),this.continueCharDiff=Ppe(r.maxComputationTime===0?0:Math.min(r.maxComputationTime,5e3))}computeDiff(){if(this.original.lines.length===1&&this.original.lines[0].length===0)return this.modified.lines.length===1&&this.modified.lines[0].length===0?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(this.modified.lines.length===1&&this.modified.lines[0].length===0)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};const e=ZEe(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),n=e.changes,r=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const l=[];for(let c=0,u=n.length;c<u;c++)l.push(eM.createFromDiffResult(this.shouldIgnoreTrimWhitespace,n[c],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:r,changes:l}}const s=[];let o=0,a=0;for(let l=-1,c=n.length;l<c;l++){const u=l+1<c?n[l+1]:null,d=u?u.originalStart:this.originalLines.length,h=u?u.modifiedStart:this.modifiedLines.length;for(;o<d&&a<h;){const f=this.originalLines[o],p=this.modifiedLines[a];if(f!==p){{let g=_J(f,1),m=_J(p,1);for(;g>1&&m>1;){const _=f.charCodeAt(g-2),b=p.charCodeAt(m-2);if(_!==b)break;g--,m--}(g>1||m>1)&&this._pushTrimWhitespaceCharChange(s,o+1,1,g,a+1,1,m)}{let g=vJ(f,1),m=vJ(p,1);const _=f.length+1,b=p.length+1;for(;g<_&&m<b;){const y=f.charCodeAt(g-1),x=f.charCodeAt(m-1);if(y!==x)break;g++,m++}(g<_||m<b)&&this._pushTrimWhitespaceCharChange(s,o+1,g,_,a+1,m,b)}}o++,a++}u&&(s.push(eM.createFromDiffResult(this.shouldIgnoreTrimWhitespace,u,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=u.originalLength,a+=u.modifiedLength)}return{quitEarly:r,changes:s}}_pushTrimWhitespaceCharChange(e,n,r,s,o,a,l){if(this._mergeTrimWhitespaceCharChange(e,n,r,s,o,a,l))return;let c;this.shouldComputeCharChanges&&(c=[new V2(n,r,n,s,o,a,o,l)]),e.push(new eM(n,n,o,o,c))}_mergeTrimWhitespaceCharChange(e,n,r,s,o,a,l){const c=e.length;if(c===0)return!1;const u=e[c-1];return u.originalEndLineNumber===0||u.modifiedEndLineNumber===0?!1:u.originalEndLineNumber===n&&u.modifiedEndLineNumber===o?(this.shouldComputeCharChanges&&u.charChanges&&u.charChanges.push(new V2(n,r,n,s,o,a,o,l)),!0):u.originalEndLineNumber+1===n&&u.modifiedEndLineNumber+1===o?(u.originalEndLineNumber=n,u.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&u.charChanges&&u.charChanges.push(new V2(n,r,n,s,o,a,o,l)),!0):!1}}function _J(i,e){const n=ml(i);return n===-1?e:n+1}function vJ(i,e){const n=$p(i);return n===-1?e:n+2}function Ppe(i){if(i===0)return()=>!0;const e=Date.now();return()=>Date.now()-e<i}class gv{static trivial(e,n){return new gv([new ea(Un.ofLength(e.length),Un.ofLength(n.length))],!1)}static trivialTimedOut(e,n){return new gv([new ea(Un.ofLength(e.length),Un.ofLength(n.length))],!0)}constructor(e,n){this.diffs=e,this.hitTimeout=n}}class ea{static invert(e,n){const r=[];return f2e(e,(s,o)=>{r.push(ea.fromOffsetPairs(s?s.getEndExclusives():_m.zero,o?o.getStarts():new _m(n,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+n)))}),r}static fromOffsetPairs(e,n){return new ea(new Un(e.offset1,n.offset1),new Un(e.offset2,n.offset2))}constructor(e,n){this.seq1Range=e,this.seq2Range=n}swap(){return new ea(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new ea(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new ea(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new ea(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new ea(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const n=this.seq1Range.intersect(e.seq1Range),r=this.seq2Range.intersect(e.seq2Range);if(!(!n||!r))return new ea(n,r)}getStarts(){return new _m(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new _m(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class _m{constructor(e,n){this.offset1=e,this.offset2=n}toString(){return`${this.offset1} <-> ${this.offset2}`}}_m.zero=new _m(0,0);_m.max=new _m(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class vP{isValid(){return!0}}vP.instance=new vP;class Uct{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Vs("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime<this.timeout)&&this.valid){this.valid=!1;debugger}return this.valid}}class dq{constructor(e,n){this.width=e,this.height=n,this.array=[],this.array=new Array(e*n)}get(e,n){return this.array[e+n*this.width]}set(e,n,r){this.array[e+n*this.width]=r}}function bJ(i){return i===32||i===9}class OE{static getKey(e){let n=this.chrKeys.get(e);return n===void 0&&(n=this.chrKeys.size,this.chrKeys.set(e,n)),n}constructor(e,n,r){this.range=e,this.lines=n,this.source=r,this.histogram=[];let s=0;for(let o=e.startLineNumber-1;o<e.endLineNumberExclusive-1;o++){const a=n[o];for(let c=0;c<a.length;c++){s++;const u=a[c],d=OE.getKey(u);this.histogram[d]=(this.histogram[d]||0)+1}s++;const l=OE.getKey(`
`);this.histogram[l]=(this.histogram[l]||0)+1}this.totalCount=s}computeSimilarity(e){var n,r;let s=0;const o=Math.max(this.histogram.length,e.histogram.length);for(let a=0;a<o;a++)s+=Math.abs(((n=this.histogram[a])!==null&&n!==void 0?n:0)-((r=e.histogram[a])!==null&&r!==void 0?r:0));return 1-s/(this.totalCount+e.totalCount)}}OE.chrKeys=new Map;class qct{compute(e,n,r=vP.instance,s){if(e.length===0||n.length===0)return gv.trivial(e,n);const o=new dq(e.length,n.length),a=new dq(e.length,n.length),l=new dq(e.length,n.length);for(let g=0;g<e.length;g++)for(let m=0;m<n.length;m++){if(!r.isValid())return gv.trivialTimedOut(e,n);const _=g===0?0:o.get(g-1,m),b=m===0?0:o.get(g,m-1);let y;e.getElement(g)===n.getElement(m)?(g===0||m===0?y=0:y=o.get(g-1,m-1),g>0&&m>0&&a.get(g-1,m-1)===3&&(y+=l.get(g-1,m-1)),y+=s?s(g,m):1):y=-1;const x=Math.max(_,b,y);if(x===y){const k=g>0&&m>0?l.get(g-1,m-1):0;l.set(g,m,k+1),a.set(g,m,3)}else x===_?(l.set(g,m,0),a.set(g,m,1)):x===b&&(l.set(g,m,0),a.set(g,m,2));o.set(g,m,x)}const c=[];let u=e.length,d=n.length;function h(g,m){(g+1!==u||m+1!==d)&&c.push(new ea(new Un(g+1,u),new Un(m+1,d))),u=g,d=m}let f=e.length-1,p=n.length-1;for(;f>=0&&p>=0;)a.get(f,p)===3?(h(f,p),f--,p--):a.get(f,p)===1?f--:p--;return h(-1,-1),c.reverse(),new gv(c,!1)}}class QEe{compute(e,n,r=vP.instance){if(e.length===0||n.length===0)return gv.trivial(e,n);const s=e,o=n;function a(m,_){for(;m<s.length&&_<o.length&&s.getElement(m)===o.getElement(_);)m++,_++;return m}let l=0;const c=new Kct;c.set(0,a(0,0));const u=new Gct;u.set(0,c.get(0)===0?null:new Ope(null,0,0,c.get(0)));let d=0;e:for(;;){if(l++,!r.isValid())return gv.trivialTimedOut(s,o);const m=-Math.min(l,o.length+l%2),_=Math.min(l,s.length+l%2);for(d=m;d<=_;d+=2){const b=d===_?-1:c.get(d+1),y=d===m?-1:c.get(d-1)+1,x=Math.min(Math.max(b,y),s.length),k=x-d;if(x>s.length||k>o.length)continue;const D=a(x,k);c.set(d,D);const R=x===b?u.get(d+1):u.get(d-1);if(u.set(d,D!==x?new Ope(R,x,k,D-x):R),c.get(d)===s.length&&c.get(d)-d===o.length)break e}}let h=u.get(d);const f=[];let p=s.length,g=o.length;for(;;){const m=h?h.x+h.length:0,_=h?h.y+h.length:0;if((m!==p||_!==g)&&f.push(new ea(new Un(m,p),new Un(_,g))),!h)break;p=h.x,g=h.y,h=h.prev}return f.reverse(),new gv(f,!1)}}class Ope{constructor(e,n,r,s){this.prev=e,this.x=n,this.y=r,this.length=s}}class Kct{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const r=this.negativeArr;this.negativeArr=new Int32Array(r.length*2),this.negativeArr.set(r)}this.negativeArr[e]=n}else{if(e>=this.positiveArr.length){const r=this.positiveArr;this.positiveArr=new Int32Array(r.length*2),this.positiveArr.set(r)}this.positiveArr[e]=n}}}class Gct{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){e<0?(e=-e-1,this.negativeArr[e]=n):this.positiveArr[e]=n}}var Fpe,Bpe;class Xct{constructor(e,n){this.uri=e,this.value=n}}function Yct(i){return Array.isArray(i)}class Va{constructor(e,n){if(this[Fpe]="ResourceMap",e instanceof Va)this.map=new Map(e.map),this.toKey=n??Va.defaultToKey;else if(Yct(e)){this.map=new Map,this.toKey=n??Va.defaultToKey;for(const[r,s]of e)this.set(r,s)}else this.map=new Map,this.toKey=e??Va.defaultToKey}set(e,n){return this.map.set(this.toKey(e),new Xct(e,n)),this}get(e){var n;return(n=this.map.get(this.toKey(e)))===null||n===void 0?void 0:n.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,n){typeof n<"u"&&(e=e.bind(n));for(const[r,s]of this.map)e(s.value,s.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(Fpe=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Va.defaultToKey=i=>i.toString();class Zct{constructor(){this[Bpe]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,n=0){const r=this._map.get(e);if(r)return n!==0&&this.touch(r,n),r.value}set(e,n,r=0){let s=this._map.get(e);if(s)s.value=n,r!==0&&this.touch(s,r);else{switch(s={key:e,value:n,next:void 0,previous:void 0},r){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){const r=this._state;let s=this._head;for(;s;){if(n?e.bind(n)(s.value,s.key,this):e(s.value,s.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const e=this,n=this._state;let r=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){const o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return s}values(){const e=this,n=this._state;let r=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){const o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return s}entries(){const e=this,n=this._state;let r=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){const o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return s}[(Bpe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==1&&n!==2)){if(n===1){if(e===this._head)return;const r=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(r.previous=s,s.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===2){if(e===this._tail)return;const r=e.next,s=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=s,s.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(const[n,r]of e)this.set(n,r)}}class G1 extends Zct{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,n=2){return super.get(e,n)}peek(e){return super.get(e,0)}set(e,n){return super.set(e,n,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class Qct{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this._m1.clear(),this._m2.clear()}set(e,n){this._m1.set(e,n),this._m2.set(n,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const n=this._m1.get(e);return n===void 0?!1:(this._m1.delete(e),this._m2.delete(n),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class roe{constructor(){this.map=new Map}add(e,n){let r=this.map.get(e);r||(r=new Set,this.map.set(e,r)),r.add(n)}delete(e,n){const r=this.map.get(e);r&&(r.delete(n),r.size===0&&this.map.delete(e))}forEach(e,n){const r=this.map.get(e);r&&r.forEach(n)}get(e){const n=this.map.get(e);return n||new Set}}class X9{constructor(e,n,r){this.lines=e,this.considerWhitespaceChanges=r,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let s=!1;n.start>0&&n.endExclusive>=e.length&&(n=new Un(n.start-1,n.endExclusive),s=!0),this.lineRange=n,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;o<this.lineRange.endExclusive;o++){let a=e[o],l=0;if(s)l=a.length,a="",s=!1;else if(!r){const c=a.trimStart();l=a.length-c.length,a=c.trimEnd()}this.additionalOffsetByLine.push(l);for(let c=0;c<a.length;c++)this.elements.push(a.charCodeAt(c));o<e.length-1&&(this.elements.push(10),this.firstCharOffsetByLine[o-this.lineRange.start+1]=this.elements.length)}this.additionalOffsetByLine.push(0)}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new Un(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(n=>String.fromCharCode(n)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const n=Wpe(e>0?this.elements[e-1]:-1),r=Wpe(e<this.elements.length?this.elements[e]:-1);if(n===6&&r===7)return 0;let s=0;return n!==r&&(s+=10,n===0&&r===1&&(s+=1)),s+=jpe(n),s+=jpe(r),s}translateOffset(e){if(this.lineRange.isEmpty)return new ve(this.lineRange.start+1,1);const n=mP(this.firstCharOffsetByLine,r=>r<=e);return new ve(this.lineRange.start+n+1,e-this.firstCharOffsetByLine[n]+this.additionalOffsetByLine[n]+1)}translateRange(e){return J.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!hq(this.elements[e]))return;let n=e;for(;n>0&&hq(this.elements[n-1]);)n--;let r=e;for(;r<this.elements.length&&hq(this.elements[r]);)r++;return new Un(n,r)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,n){return this.elements[e]===this.elements[n]}extendToFullLines(e){var n,r;const s=(n=gP(this.firstCharOffsetByLine,a=>a<=e.start))!==null&&n!==void 0?n:0,o=(r=Pct(this.firstCharOffsetByLine,a=>e.endExclusive<=a))!==null&&r!==void 0?r:this.elements.length;return new Un(s,o)}}function hq(i){return i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57}const Jct={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function jpe(i){return Jct[i]}function Wpe(i){return i===10?7:i===13?6:bJ(i)?5:i>=97&&i<=122?0:i>=65&&i<=90?1:i>=48&&i<=57?2:i===-1?3:4}function eut(i,e,n,r,s,o){let{moves:a,excludedChanges:l}=tut(i,e,n,o);if(!o.isValid())return[];const c=i.filter(d=>!l.has(d)),u=nut(c,r,s,e,n,o);return rQ(a,u),a=iut(a),a=a.filter(d=>d.original.toOffsetRange().slice(e).map(f=>f.trim()).join(`
`).length>=10),a=rut(i,a),a}function tut(i,e,n,r){const s=[],o=i.filter(c=>c.modified.isEmpty&&c.original.length>=3).map(c=>new OE(c.original,e,c)),a=new Set(i.filter(c=>c.original.isEmpty&&c.modified.length>=3).map(c=>new OE(c.modified,n,c))),l=new Set;for(const c of o){let u=-1,d;for(const h of a){const f=c.computeSimilarity(h);f>u&&(u=f,d=h)}if(u>.9&&d&&(a.delete(d),s.push(new Xm(c.range,d.range)),l.add(c.source),l.add(d.source)),!r.isValid())return{moves:s,excludedChanges:l}}return{moves:s,excludedChanges:l}}function nut(i,e,n,r,s,o){const a=[],l=new roe;for(const f of i)for(let p=f.original.startLineNumber;p<f.original.endLineNumberExclusive-2;p++){const g=`${e[p-1]}:${e[p+1-1]}:${e[p+2-1]}`;l.add(g,{range:new Qn(p,p+3)})}const c=[];i.sort(ch(f=>f.modified.startLineNumber,fv));for(const f of i){let p=[];for(let g=f.modified.startLineNumber;g<f.modified.endLineNumberExclusive-2;g++){const m=`${n[g-1]}:${n[g+1-1]}:${n[g+2-1]}`,_=new Qn(g,g+3),b=[];l.forEach(m,({range:y})=>{for(const k of p)if(k.originalLineRange.endLineNumberExclusive+1===y.endLineNumberExclusive&&k.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){k.originalLineRange=new Qn(k.originalLineRange.startLineNumber,y.endLineNumberExclusive),k.modifiedLineRange=new Qn(k.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),b.push(k);return}const x={modifiedLineRange:_,originalLineRange:y};c.push(x),b.push(x)}),p=b}if(!o.isValid())return[]}c.sort(_2e(ch(f=>f.modifiedLineRange.length,fv)));const u=new um,d=new um;for(const f of c){const p=f.modifiedLineRange.startLineNumber-f.originalLineRange.startLineNumber,g=u.subtractFrom(f.modifiedLineRange),m=d.subtractFrom(f.originalLineRange).getWithDelta(p),_=g.getIntersection(m);for(const b of _.ranges){if(b.length<3)continue;const y=b,x=b.delta(-p);a.push(new Xm(x,y)),u.addRange(y),d.addRange(x)}}a.sort(ch(f=>f.original.startLineNumber,fv));const h=new E5(i);for(let f=0;f<a.length;f++){const p=a[f],g=h.findLastMonotonous(R=>R.original.startLineNumber<=p.original.startLineNumber),m=gP(i,R=>R.modified.startLineNumber<=p.modified.startLineNumber),_=Math.max(p.original.startLineNumber-g.original.startLineNumber,p.modified.startLineNumber-m.modified.startLineNumber),b=h.findLastMonotonous(R=>R.original.startLineNumber<p.original.endLineNumberExclusive),y=gP(i,R=>R.modified.startLineNumber<p.modified.endLineNumberExclusive),x=Math.max(b.original.endLineNumberExclusive-p.original.endLineNumberExclusive,y.modified.endLineNumberExclusive-p.modified.endLineNumberExclusive);let k;for(k=0;k<_;k++){const R=p.original.startLineNumber-k-1,E=p.modified.startLineNumber-k-1;if(R>r.length||E>s.length||u.contains(E)||d.contains(R)||!$pe(r[R-1],s[E-1],o))break}k>0&&(d.addRange(new Qn(p.original.startLineNumber-k,p.original.startLineNumber)),u.addRange(new Qn(p.modified.startLineNumber-k,p.modified.startLineNumber)));let D;for(D=0;D<x;D++){const R=p.original.endLineNumberExclusive+D,E=p.modified.endLineNumberExclusive+D;if(R>r.length||E>s.length||u.contains(E)||d.contains(R)||!$pe(r[R-1],s[E-1],o))break}D>0&&(d.addRange(new Qn(p.original.endLineNumberExclusive,p.original.endLineNumberExclusive+D)),u.addRange(new Qn(p.modified.endLineNumberExclusive,p.modified.endLineNumberExclusive+D))),(k>0||D>0)&&(a[f]=new Xm(new Qn(p.original.startLineNumber-k,p.original.endLineNumberExclusive+D),new Qn(p.modified.startLineNumber-k,p.modified.endLineNumberExclusive+D)))}return a}function $pe(i,e,n){if(i.trim()===e.trim())return!0;if(i.length>300&&e.length>300)return!1;const s=new QEe().compute(new X9([i],new Un(0,1),!1),new X9([e],new Un(0,1),!1),n);let o=0;const a=ea.invert(s.diffs,i.length);for(const d of a)d.seq1Range.forEach(h=>{bJ(i.charCodeAt(h))||o++});function l(d){let h=0;for(let f=0;f<i.length;f++)bJ(d.charCodeAt(f))||h++;return h}const c=l(i.length>e.length?i:e);return o/c>.6&&c>10}function iut(i){if(i.length===0)return i;i.sort(ch(n=>n.original.startLineNumber,fv));const e=[i[0]];for(let n=1;n<i.length;n++){const r=e[e.length-1],s=i[n],o=s.original.startLineNumber-r.original.endLineNumberExclusive,a=s.modified.startLineNumber-r.modified.endLineNumberExclusive;if(o>=0&&a>=0&&o+a<=2){e[e.length-1]=r.join(s);continue}e.push(s)}return e}function rut(i,e){const n=new E5(i);return e=e.filter(r=>{const s=n.findLastMonotonous(l=>l.original.endLineNumberExclusive<r.original.endLineNumberExclusive)||new Xm(new Qn(1,1),new Qn(1,1)),o=gP(i,l=>l.modified.endLineNumberExclusive<r.modified.endLineNumberExclusive);return s!==o}),e}function yJ(i,e,n){let r=n;return r=sut(i,e,r),r=out(i,e,r),r}function sut(i,e,n){if(n.length===0)return n;const r=[];r.push(n[0]);for(let o=1;o<n.length;o++){const a=r[r.length-1];let l=n[o];if(l.seq1Range.isEmpty||l.seq2Range.isEmpty){const c=l.seq1Range.start-a.seq1Range.endExclusive;let u;for(u=1;u<=c&&!(i.getElement(l.seq1Range.start-u)!==i.getElement(l.seq1Range.endExclusive-u)||e.getElement(l.seq2Range.start-u)!==e.getElement(l.seq2Range.endExclusive-u));u++);if(u--,u===c){r[r.length-1]=new ea(new Un(a.seq1Range.start,l.seq1Range.endExclusive-c),new Un(a.seq2Range.start,l.seq2Range.endExclusive-c));continue}l=l.delta(-u)}r.push(l)}const s=[];for(let o=0;o<r.length-1;o++){const a=r[o+1];let l=r[o];if(l.seq1Range.isEmpty||l.seq2Range.isEmpty){const c=a.seq1Range.start-l.seq1Range.endExclusive;let u;for(u=0;u<c&&!(!i.isStronglyEqual(l.seq1Range.start+u,l.seq1Range.endExclusive+u)||!e.isStronglyEqual(l.seq2Range.start+u,l.seq2Range.endExclusive+u));u++);if(u===c){r[o+1]=new ea(new Un(l.seq1Range.start+c,a.seq1Range.endExclusive),new Un(l.seq2Range.start+c,a.seq2Range.endExclusive));continue}u>0&&(l=l.delta(u))}s.push(l)}return r.length>0&&s.push(r[r.length-1]),s}function out(i,e,n){if(!i.getBoundaryScore||!e.getBoundaryScore)return n;for(let r=0;r<n.length;r++){const s=r>0?n[r-1]:void 0,o=n[r],a=r+1<n.length?n[r+1]:void 0,l=new Un(s?s.seq1Range.start+1:0,a?a.seq1Range.endExclusive-1:i.length),c=new Un(s?s.seq2Range.start+1:0,a?a.seq2Range.endExclusive-1:e.length);o.seq1Range.isEmpty?n[r]=zpe(o,i,e,l,c):o.seq2Range.isEmpty&&(n[r]=zpe(o.swap(),e,i,c,l).swap())}return n}function zpe(i,e,n,r,s){let a=1;for(;i.seq1Range.start-a>=r.start&&i.seq2Range.start-a>=s.start&&n.isStronglyEqual(i.seq2Range.start-a,i.seq2Range.endExclusive-a)&&a<100;)a++;a--;let l=0;for(;i.seq1Range.start+l<r.endExclusive&&i.seq2Range.endExclusive+l<s.endExclusive&&n.isStronglyEqual(i.seq2Range.start+l,i.seq2Range.endExclusive+l)&&l<100;)l++;if(a===0&&l===0)return i;let c=0,u=-1;for(let d=-a;d<=l;d++){const h=i.seq2Range.start+d,f=i.seq2Range.endExclusive+d,p=i.seq1Range.start+d,g=e.getBoundaryScore(p)+n.getBoundaryScore(h)+n.getBoundaryScore(f);g>u&&(u=g,c=d)}return i.delta(c)}function aut(i,e,n){const r=[];for(const s of n){const o=r[r.length-1];if(!o){r.push(s);continue}s.seq1Range.start-o.seq1Range.endExclusive<=2||s.seq2Range.start-o.seq2Range.endExclusive<=2?r[r.length-1]=new ea(o.seq1Range.join(s.seq1Range),o.seq2Range.join(s.seq2Range)):r.push(s)}return r}function lut(i,e,n){const r=[];let s;function o(){if(!s)return;const l=s.s1Range.length-s.deleted;s.s2Range.length-s.added,Math.max(s.deleted,s.added)+(s.count-1)>l&&r.push(new ea(s.s1Range,s.s2Range)),s=void 0}for(const l of n){let c=function(p,g){var m,_,b,y;if(!s||!s.s1Range.containsRange(p)||!s.s2Range.containsRange(g))if(s&&!(s.s1Range.endExclusive<p.start&&s.s2Range.endExclusive<g.start)){const D=Un.tryCreate(s.s1Range.endExclusive,p.start),R=Un.tryCreate(s.s2Range.endExclusive,g.start);s.deleted+=(m=D==null?void 0:D.length)!==null&&m!==void 0?m:0,s.added+=(_=R==null?void 0:R.length)!==null&&_!==void 0?_:0,s.s1Range=s.s1Range.join(p),s.s2Range=s.s2Range.join(g)}else o(),s={added:0,deleted:0,count:0,s1Range:p,s2Range:g};const x=p.intersect(l.seq1Range),k=g.intersect(l.seq2Range);s.count++,s.deleted+=(b=x==null?void 0:x.length)!==null&&b!==void 0?b:0,s.added+=(y=k==null?void 0:k.length)!==null&&y!==void 0?y:0};const u=i.findWordContaining(l.seq1Range.start-1),d=e.findWordContaining(l.seq2Range.start-1),h=i.findWordContaining(l.seq1Range.endExclusive),f=e.findWordContaining(l.seq2Range.endExclusive);u&&h&&d&&f&&u.equals(h)&&d.equals(f)?c(u,d):(u&&d&&c(u,d),h&&f&&c(h,f))}return o(),cut(n,r)}function cut(i,e){const n=[];for(;i.length>0||e.length>0;){const r=i[0],s=e[0];let o;r&&(!s||r.seq1Range.start<s.seq1Range.start)?o=i.shift():o=e.shift(),n.length>0&&n[n.length-1].seq1Range.endExclusive>=o.seq1Range.start?n[n.length-1]=n[n.length-1].join(o):n.push(o)}return n}function uut(i,e,n){let r=n;if(r.length===0)return r;let s=0,o;do{o=!1;const a=[r[0]];for(let l=1;l<r.length;l++){let d=function(f,p){const g=new Un(u.seq1Range.endExclusive,c.seq1Range.start);return i.getText(g).replace(/\s/g,"").length<=4&&(f.seq1Range.length+f.seq2Range.length>5||p.seq1Range.length+p.seq2Range.length>5)};const c=r[l],u=a[a.length-1];d(u,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}r=a}while(s++<10&&o);return r}function dut(i,e,n){let r=n;if(r.length===0)return r;let s=0,o;do{o=!1;const l=[r[0]];for(let c=1;c<r.length;c++){let h=function(p,g){const m=new Un(d.seq1Range.endExclusive,u.seq1Range.start);if(i.countLinesIn(m)>5||m.length>500)return!1;const b=i.getText(m).trim();if(b.length>20||b.split(/\r\n|\r|\n/).length>1)return!1;const y=i.countLinesIn(p.seq1Range),x=p.seq1Range.length,k=e.countLinesIn(p.seq2Range),D=p.seq2Range.length,R=i.countLinesIn(g.seq1Range),E=g.seq1Range.length,A=e.countLinesIn(g.seq2Range),M=g.seq2Range.length,N=2*40+50;function P(O){return Math.min(O,N)}return Math.pow(Math.pow(P(y*40+x),1.5)+Math.pow(P(k*40+D),1.5),1.5)+Math.pow(Math.pow(P(R*40+E),1.5)+Math.pow(P(A*40+M),1.5),1.5)>Math.pow(Math.pow(N,1.5),1.5)*1.3};const u=r[c],d=l[l.length-1];h(d,u)?(o=!0,l[l.length-1]=l[l.length-1].join(u)):l.push(u)}r=l}while(s++<10&&o);const a=[];return Crt(r,(l,c,u)=>{let d=c;function h(b){return b.length>0&&b.trim().length<=3&&c.seq1Range.length+c.seq2Range.length>100}const f=i.extendToFullLines(c.seq1Range),p=i.getText(new Un(f.start,c.seq1Range.start));h(p)&&(d=d.deltaStart(-p.length));const g=i.getText(new Un(c.seq1Range.endExclusive,f.endExclusive));h(g)&&(d=d.deltaEnd(g.length));const m=ea.fromOffsetPairs(l?l.getEndExclusives():_m.zero,u?u.getStarts():_m.max),_=d.intersect(m);a.push(_)}),a}class Vpe{constructor(e,n){this.trimmedHash=e,this.lines=n}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const n=e===0?0:Hpe(this.lines[e-1]),r=e===this.lines.length?0:Hpe(this.lines[e]);return 1e3-(n+r)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(`
`)}isStronglyEqual(e,n){return this.lines[e]===this.lines[n]}}function Hpe(i){let e=0;for(;e<i.length&&(i.charCodeAt(e)===32||i.charCodeAt(e)===9);)e++;return e}class JEe{constructor(){this.dynamicProgrammingDiffing=new qct,this.myersDiffingAlgorithm=new QEe}computeDiff(e,n,r){if(e.length<=1&&ys(e,n,(D,R)=>D===R))return new u8([],[],!1);if(e.length===1&&e[0].length===0||n.length===1&&n[0].length===0)return new u8([new bh(new Qn(1,e.length+1),new Qn(1,n.length+1),[new _1(new J(1,1,e.length,e[0].length+1),new J(1,1,n.length,n[0].length+1))])],[],!1);const s=r.maxComputationTimeMs===0?vP.instance:new Uct(r.maxComputationTimeMs),o=!r.ignoreTrimWhitespace,a=new Map;function l(D){let R=a.get(D);return R===void 0&&(R=a.size,a.set(D,R)),R}const c=e.map(D=>l(D.trim())),u=n.map(D=>l(D.trim())),d=new Vpe(c,e),h=new Vpe(u,n),f=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,s,(D,R)=>e[D]===n[R]?n[R].length===0?.1:1+Math.log(1+n[R].length):.99):this.myersDiffingAlgorithm.compute(d,h);let p=f.diffs,g=f.hitTimeout;p=yJ(d,h,p),p=uut(d,h,p);const m=[],_=D=>{if(o)for(let R=0;R<D;R++){const E=b+R,A=y+R;if(e[E]!==n[A]){const M=this.refineDiff(e,n,new ea(new Un(E,E+1),new Un(A,A+1)),s,o);for(const N of M.mappings)m.push(N);M.hitTimeout&&(g=!0)}}};let b=0,y=0;for(const D of p){uP(()=>D.seq1Range.start-b===D.seq2Range.start-y);const R=D.seq1Range.start-b;_(R),b=D.seq1Range.endExclusive,y=D.seq2Range.endExclusive;const E=this.refineDiff(e,n,D,s,o);E.hitTimeout&&(g=!0);for(const A of E.mappings)m.push(A)}_(e.length-b);const x=Upe(m,e,n);let k=[];return r.computeMoves&&(k=this.computeMoves(x,e,n,c,u,s,o)),uP(()=>{function D(E,A){if(E.lineNumber<1||E.lineNumber>A.length)return!1;const M=A[E.lineNumber-1];return!(E.column<1||E.column>M.length+1)}function R(E,A){return!(E.startLineNumber<1||E.startLineNumber>A.length+1||E.endLineNumberExclusive<1||E.endLineNumberExclusive>A.length+1)}for(const E of x){if(!E.innerChanges)return!1;for(const A of E.innerChanges)if(!(D(A.modifiedRange.getStartPosition(),n)&&D(A.modifiedRange.getEndPosition(),n)&&D(A.originalRange.getStartPosition(),e)&&D(A.originalRange.getEndPosition(),e)))return!1;if(!R(E.modified,n)||!R(E.original,e))return!1}return!0}),new u8(x,k,g)}computeMoves(e,n,r,s,o,a,l){return eut(e,n,r,s,o,a).map(d=>{const h=this.refineDiff(n,r,new ea(d.original.toOffsetRange(),d.modified.toOffsetRange()),a,l),f=Upe(h.mappings,n,r,!0);return new XEe(d,f)})}refineDiff(e,n,r,s,o){const a=new X9(e,r.seq1Range,o),l=new X9(n,r.seq2Range,o),c=a.length+l.length<500?this.dynamicProgrammingDiffing.compute(a,l,s):this.myersDiffingAlgorithm.compute(a,l,s);let u=c.diffs;return u=yJ(a,l,u),u=lut(a,l,u),u=aut(a,l,u),u=dut(a,l,u),{mappings:u.map(h=>new _1(a.translateRange(h.seq1Range),l.translateRange(h.seq2Range))),hitTimeout:c.hitTimeout}}}function Upe(i,e,n,r=!1){const s=[];for(const o of h2e(i.map(a=>hut(a,e,n)),(a,l)=>a.original.overlapOrTouch(l.original)||a.modified.overlapOrTouch(l.modified))){const a=o[0],l=o[o.length-1];s.push(new bh(a.original.join(l.original),a.modified.join(l.modified),o.map(c=>c.innerChanges[0])))}return uP(()=>!r&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber?!1:aEe(s,(o,a)=>a.original.startLineNumber-o.original.endLineNumberExclusive===a.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive<a.original.startLineNumber&&o.modified.endLineNumberExclusive<a.modified.startLineNumber)),s}function hut(i,e,n){let r=0,s=0;i.modifiedRange.endColumn===1&&i.originalRange.endColumn===1&&i.originalRange.startLineNumber+r<=i.originalRange.endLineNumber&&i.modifiedRange.startLineNumber+r<=i.modifiedRange.endLineNumber&&(s=-1),i.modifiedRange.startColumn-1>=n[i.modifiedRange.startLineNumber-1].length&&i.originalRange.startColumn-1>=e[i.originalRange.startLineNumber-1].length&&i.originalRange.startLineNumber<=i.originalRange.endLineNumber+s&&i.modifiedRange.startLineNumber<=i.modifiedRange.endLineNumber+s&&(r=1);const o=new Qn(i.originalRange.startLineNumber+r,i.originalRange.endLineNumber+1+s),a=new Qn(i.modifiedRange.startLineNumber+r,i.modifiedRange.endLineNumber+1+s);return new bh(o,a,[i])}const qpe={getLegacy:()=>new $ct,getDefault:()=>new JEe};function Wy(i,e){const n=Math.pow(10,e);return Math.round(i*n)/n}class ii{constructor(e,n,r,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,n))|0,this.b=Math.min(255,Math.max(0,r))|0,this.a=Wy(Math.max(Math.min(1,s),0),3)}static equals(e,n){return e.r===n.r&&e.g===n.g&&e.b===n.b&&e.a===n.a}}class lf{constructor(e,n,r,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Wy(Math.max(Math.min(1,n),0),3),this.l=Wy(Math.max(Math.min(1,r),0),3),this.a=Wy(Math.max(Math.min(1,s),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.l===n.l&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,s=e.b/255,o=e.a,a=Math.max(n,r,s),l=Math.min(n,r,s);let c=0,u=0;const d=(l+a)/2,h=a-l;if(h>0){switch(u=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),a){case n:c=(r-s)/h+(r<s?6:0);break;case r:c=(s-n)/h+2;break;case s:c=(n-r)/h+4;break}c*=60,c=Math.round(c)}return new lf(c,u,d,o)}static _hue2rgb(e,n,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}static toRGBA(e){const n=e.h/360,{s:r,l:s,a:o}=e;let a,l,c;if(r===0)a=l=c=s;else{const u=s<.5?s*(1+r):s+r-s*r,d=2*s-u;a=lf._hue2rgb(d,u,n+1/3),l=lf._hue2rgb(d,u,n),c=lf._hue2rgb(d,u,n-1/3)}return new ii(Math.round(a*255),Math.round(l*255),Math.round(c*255),o)}}class vm{constructor(e,n,r,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Wy(Math.max(Math.min(1,n),0),3),this.v=Wy(Math.max(Math.min(1,r),0),3),this.a=Wy(Math.max(Math.min(1,s),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.v===n.v&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,s=e.b/255,o=Math.max(n,r,s),a=Math.min(n,r,s),l=o-a,c=o===0?0:l/o;let u;return l===0?u=0:o===n?u=((r-s)/l%6+6)%6:o===r?u=(s-n)/l+2:u=(n-r)/l+4,new vm(Math.round(u*60),c,o,e.a)}static toRGBA(e){const{h:n,s:r,v:s,a:o}=e,a=s*r,l=a*(1-Math.abs(n/60%2-1)),c=s-a;let[u,d,h]=[0,0,0];return n<60?(u=a,d=l):n<120?(u=l,d=a):n<180?(d=a,h=l):n<240?(d=l,h=a):n<300?(u=l,h=a):n<=360&&(u=a,h=l),u=Math.round((u+c)*255),d=Math.round((d+c)*255),h=Math.round((h+c)*255),new ii(u,d,h,o)}}let Te=class Zh{static fromHex(e){return Zh.Format.CSS.parseHex(e)||Zh.red}static equals(e,n){return!e&&!n?!0:!e||!n?!1:e.equals(n)}get hsla(){return this._hsla?this._hsla:lf.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:vm.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof ii)this.rgba=e;else if(e instanceof lf)this._hsla=e,this.rgba=lf.toRGBA(e);else if(e instanceof vm)this._hsva=e,this.rgba=vm.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&ii.equals(this.rgba,e.rgba)&&lf.equals(this.hsla,e.hsla)&&vm.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=Zh._relativeLuminanceForComponent(this.rgba.r),n=Zh._relativeLuminanceForComponent(this.rgba.g),r=Zh._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*n+.0722*r;return Wy(s,4)}static _relativeLuminanceForComponent(e){const n=e/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const n=this.getRelativeLuminance(),r=e.getRelativeLuminance();return n>r}isDarkerThan(e){const n=this.getRelativeLuminance(),r=e.getRelativeLuminance();return n<r}lighten(e){return new Zh(new lf(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new Zh(new lf(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:n,g:r,b:s,a:o}=this.rgba;return new Zh(new ii(n,r,s,o*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new Zh(new ii(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}makeOpaque(e){if(this.isOpaque()||e.rgba.a!==1)return this;const{r:n,g:r,b:s,a:o}=this.rgba;return new Zh(new ii(e.rgba.r-o*(e.rgba.r-n),e.rgba.g-o*(e.rgba.g-r),e.rgba.b-o*(e.rgba.b-s),1))}toString(){return this._toString||(this._toString=Zh.Format.CSS.format(this)),this._toString}static getLighterColor(e,n,r){if(e.isLighterThan(n))return e;r=r||.5;const s=e.getRelativeLuminance(),o=n.getRelativeLuminance();return r=r*(o-s)/o,e.lighten(r)}static getDarkerColor(e,n,r){if(e.isDarkerThan(n))return e;r=r||.5;const s=e.getRelativeLuminance(),o=n.getRelativeLuminance();return r=r*(s-o)/s,e.darken(r)}};Te.white=new Te(new ii(255,255,255,1));Te.black=new Te(new ii(0,0,0,1));Te.red=new Te(new ii(255,0,0,1));Te.blue=new Te(new ii(0,0,255,1));Te.green=new Te(new ii(0,255,0,1));Te.cyan=new Te(new ii(0,255,255,1));Te.lightgrey=new Te(new ii(211,211,211,1));Te.transparent=new Te(new ii(0,0,0,0));(function(i){(function(e){(function(n){function r(p){return p.rgba.a===1?`rgb(${p.rgba.r}, ${p.rgba.g}, ${p.rgba.b})`:i.Format.CSS.formatRGBA(p)}n.formatRGB=r;function s(p){return`rgba(${p.rgba.r}, ${p.rgba.g}, ${p.rgba.b}, ${+p.rgba.a.toFixed(2)})`}n.formatRGBA=s;function o(p){return p.hsla.a===1?`hsl(${p.hsla.h}, ${(p.hsla.s*100).toFixed(2)}%, ${(p.hsla.l*100).toFixed(2)}%)`:i.Format.CSS.formatHSLA(p)}n.formatHSL=o;function a(p){return`hsla(${p.hsla.h}, ${(p.hsla.s*100).toFixed(2)}%, ${(p.hsla.l*100).toFixed(2)}%, ${p.hsla.a.toFixed(2)})`}n.formatHSLA=a;function l(p){const g=p.toString(16);return g.length!==2?"0"+g:g}function c(p){return`#${l(p.rgba.r)}${l(p.rgba.g)}${l(p.rgba.b)}`}n.formatHex=c;function u(p,g=!1){return g&&p.rgba.a===1?i.Format.CSS.formatHex(p):`#${l(p.rgba.r)}${l(p.rgba.g)}${l(p.rgba.b)}${l(Math.round(p.rgba.a*255))}`}n.formatHexA=u;function d(p){return p.isOpaque()?i.Format.CSS.formatHex(p):i.Format.CSS.formatRGBA(p)}n.format=d;function h(p){const g=p.length;if(g===0||p.charCodeAt(0)!==35)return null;if(g===7){const m=16*f(p.charCodeAt(1))+f(p.charCodeAt(2)),_=16*f(p.charCodeAt(3))+f(p.charCodeAt(4)),b=16*f(p.charCodeAt(5))+f(p.charCodeAt(6));return new i(new ii(m,_,b,1))}if(g===9){const m=16*f(p.charCodeAt(1))+f(p.charCodeAt(2)),_=16*f(p.charCodeAt(3))+f(p.charCodeAt(4)),b=16*f(p.charCodeAt(5))+f(p.charCodeAt(6)),y=16*f(p.charCodeAt(7))+f(p.charCodeAt(8));return new i(new ii(m,_,b,y/255))}if(g===4){const m=f(p.charCodeAt(1)),_=f(p.charCodeAt(2)),b=f(p.charCodeAt(3));return new i(new ii(16*m+m,16*_+_,16*b+b))}if(g===5){const m=f(p.charCodeAt(1)),_=f(p.charCodeAt(2)),b=f(p.charCodeAt(3)),y=f(p.charCodeAt(4));return new i(new ii(16*m+m,16*_+_,16*b+b,(16*y+y)/255))}return null}n.parseHex=h;function f(p){switch(p){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(e.CSS||(e.CSS={}))})(i.Format||(i.Format={}))})(Te||(Te={}));function eIe(i){const e=[];for(const n of i){const r=Number(n);(r||r===0&&n.replace(/\s/g,"")!=="")&&e.push(r)}return e}function soe(i,e,n,r){return{red:i/255,blue:n/255,green:e/255,alpha:r}}function HR(i,e){const n=e.index,r=e[0].length;if(!n)return;const s=i.positionAt(n);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+r}}function fut(i,e){if(!i)return;const n=Te.Format.CSS.parseHex(e);if(n)return{range:i,color:soe(n.rgba.r,n.rgba.g,n.rgba.b,n.rgba.a)}}function Kpe(i,e,n){if(!i||e.length!==1)return;const s=e[0].values(),o=eIe(s);return{range:i,color:soe(o[0],o[1],o[2],n?o[3]:1)}}function Gpe(i,e,n){if(!i||e.length!==1)return;const s=e[0].values(),o=eIe(s),a=new Te(new lf(o[0],o[1]/100,o[2]/100,n?o[3]:1));return{range:i,color:soe(a.rgba.r,a.rgba.g,a.rgba.b,a.rgba.a)}}function UR(i,e){return typeof i=="string"?[...i.matchAll(e)]:i.findMatches(e)}function put(i){const e=[],r=UR(i,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(r.length>0)for(const s of r){const o=s.filter(u=>u!==void 0),a=o[1],l=o[2];if(!l)continue;let c;if(a==="rgb"){const u=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;c=Kpe(HR(i,s),UR(l,u),!1)}else if(a==="rgba"){const u=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=Kpe(HR(i,s),UR(l,u),!0)}else if(a==="hsl"){const u=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;c=Gpe(HR(i,s),UR(l,u),!1)}else if(a==="hsla"){const u=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=Gpe(HR(i,s),UR(l,u),!0)}else a==="#"&&(c=fut(HR(i,s),a+l));c&&e.push(c)}return e}function gut(i){return!i||typeof i.getValue!="function"||typeof i.positionAt!="function"?[]:put(i)}var Ob=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class mut extends _ct{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const n=[];for(let r=0;r<this._lines.length;r++){const s=this._lines[r],o=this.offsetAt(new ve(r+1,1)),a=s.matchAll(e);for(const l of a)(l.index||l.index===0)&&(l.index=l.index+o),n.push(l)}return n}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,n){const r=iP(e.column,D2e(n),this._lines[e.lineNumber-1],0);return r?new J(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn):null}words(e){const n=this._lines,r=this._wordenize.bind(this);let s=0,o="",a=0,l=[];return{*[Symbol.iterator](){for(;;)if(a<l.length){const c=o.substring(l[a].start,l[a].end);a+=1,yield c}else if(s<n.length)o=n[s],l=r(o,e),a=0,s+=1;else break}}}getLineWords(e,n){const r=this._lines[e-1],s=this._wordenize(r,n),o=[];for(const a of s)o.push({word:r.substring(a.start,a.end),startColumn:a.start+1,endColumn:a.end+1});return o}_wordenize(e,n){const r=[];let s;for(n.lastIndex=0;(s=n.exec(e))&&s[0].length!==0;)r.push({start:s.index,end:s.index+s[0].length});return r}getValueInRange(e){if(e=this._validateRange(e),e.startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const n=this._eol,r=e.startLineNumber-1,s=e.endLineNumber-1,o=[];o.push(this._lines[r].substring(e.startColumn-1));for(let a=r+1;a<s;a++)o.push(this._lines[a]);return o.push(this._lines[s].substring(0,e.endColumn-1)),o.join(n)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const n=this._lineStarts.getIndexOf(e),r=this._lines[n.index].length;return{lineNumber:1+n.index,column:1+Math.min(n.remainder,r)}}_validateRange(e){const n=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),r=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return n.lineNumber!==e.startLineNumber||n.column!==e.startColumn||r.lineNumber!==e.endLineNumber||r.column!==e.endColumn?{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:r.lineNumber,endColumn:r.column}:e}_validatePosition(e){if(!ve.isIPosition(e))throw new Error("bad position");let{lineNumber:n,column:r}=e,s=!1;if(n<1)n=1,r=1,s=!0;else if(n>this._lines.length)n=this._lines.length,r=this._lines[n-1].length+1,s=!0;else{const o=this._lines[n-1].length+1;r<1?(r=1,s=!0):r>o&&(r=o,s=!0)}return s?{lineNumber:n,column:r}:e}}class $y{constructor(e,n){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=n,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(n=>e.push(this._models[n])),e}acceptNewModel(e){this._models[e.url]=new mut(Jt.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,n){if(!this._models[e])return;this._models[e].onEvents(n)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,n,r){return Ob(this,void 0,void 0,function*(){const s=this._getModel(e);return s?noe.computeUnicodeHighlights(s,n,r):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,n,r,s){return Ob(this,void 0,void 0,function*(){const o=this._getModel(e),a=this._getModel(n);return!o||!a?null:$y.computeDiff(o,a,r,s)})}static computeDiff(e,n,r,s){const o=s==="advanced"?qpe.getDefault():qpe.getLegacy(),a=e.getLinesContent(),l=n.getLinesContent(),c=o.computeDiff(a,l,r),u=c.changes.length>0?!1:this._modelsAreIdentical(e,n);function d(h){return h.map(f=>{var p;return[f.original.startLineNumber,f.original.endLineNumberExclusive,f.modified.startLineNumber,f.modified.endLineNumberExclusive,(p=f.innerChanges)===null||p===void 0?void 0:p.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:u,quitEarly:c.hitTimeout,changes:d(c.changes),moves:c.moves.map(h=>[h.lineRangeMapping.original.startLineNumber,h.lineRangeMapping.original.endLineNumberExclusive,h.lineRangeMapping.modified.startLineNumber,h.lineRangeMapping.modified.endLineNumberExclusive,d(h.changes)])}}static _modelsAreIdentical(e,n){const r=e.getLineCount(),s=n.getLineCount();if(r!==s)return!1;for(let o=1;o<=r;o++){const a=e.getLineContent(o),l=n.getLineContent(o);if(a!==l)return!1}return!0}computeMoreMinimalEdits(e,n,r){return Ob(this,void 0,void 0,function*(){const s=this._getModel(e);if(!s)return n;const o=[];let a;n=n.slice(0).sort((c,u)=>{if(c.range&&u.range)return J.compareRangesUsingStarts(c.range,u.range);const d=c.range?0:1,h=u.range?0:1;return d-h});let l=0;for(let c=1;c<n.length;c++)J.getEndPosition(n[l].range).equals(J.getStartPosition(n[c].range))?(n[l].range=J.fromPositions(J.getStartPosition(n[l].range),J.getEndPosition(n[c].range)),n[l].text+=n[c].text):(l++,n[l]=n[c]);n.length=l+1;for(let{range:c,text:u,eol:d}of n){if(typeof d=="number"&&(a=d),J.isEmpty(c)&&!u)continue;const h=s.getValueInRange(c);if(u=u.replace(/\r\n|\n|\r/g,s.eol),h===u)continue;if(Math.max(u.length,h.length)>$y._diffLimit){o.push({range:c,text:u});continue}const f=pct(h,u,r),p=s.offsetAt(J.lift(c).getStartPosition());for(const g of f){const m=s.positionAt(p+g.originalStart),_=s.positionAt(p+g.originalStart+g.originalLength),b={text:u.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:_.lineNumber,endColumn:_.column}};s.getValueInRange(b.range)!==b.text&&o.push(b)}}return typeof a=="number"&&o.push({eol:a,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o})}computeLinks(e){return Ob(this,void 0,void 0,function*(){const n=this._getModel(e);return n?Cct(n):null})}computeDefaultDocumentColors(e){return Ob(this,void 0,void 0,function*(){const n=this._getModel(e);return n?gut(n):null})}textualSuggest(e,n,r,s){return Ob(this,void 0,void 0,function*(){const o=new Xa,a=new RegExp(r,s),l=new Set;e:for(const c of e){const u=this._getModel(c);if(u){for(const d of u.words(a))if(!(d===n||!isNaN(Number(d)))&&(l.add(d),l.size>$y._suggestionsLimit))break e}}return{words:Array.from(l),duration:o.elapsed()}})}computeWordRanges(e,n,r,s){return Ob(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return Object.create(null);const a=new RegExp(r,s),l=Object.create(null);for(let c=n.startLineNumber;c<n.endLineNumber;c++){const u=o.getLineWords(c,a);for(const d of u){if(!isNaN(Number(d.word)))continue;let h=l[d.word];h||(h=[],l[d.word]=h),h.push({startLineNumber:c,startColumn:d.startColumn,endLineNumber:c,endColumn:d.endColumn})}}return l})}navigateValueSet(e,n,r,s,o){return Ob(this,void 0,void 0,function*(){const a=this._getModel(e);if(!a)return null;const l=new RegExp(s,o);n.startColumn===n.endColumn&&(n={startLineNumber:n.startLineNumber,startColumn:n.startColumn,endLineNumber:n.endLineNumber,endColumn:n.endColumn+1});const c=a.getValueInRange(n),u=a.getWordAtPosition({lineNumber:n.startLineNumber,column:n.startColumn},l);if(!u)return null;const d=a.getValueInRange(u);return mJ.INSTANCE.navigateValueSet(n,c,u,d,r)})}loadForeignModule(e,n,r){const a={host:Rrt(r,(l,c)=>this._host.fhr(l,c)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(a,n),Promise.resolve(Dse(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,n){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,n))}catch(r){return Promise.reject(r)}}}$y._diffLimit=1e5;$y._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=q2e());const ooe=qn("textResourceConfigurationService"),tIe=qn("textResourcePropertiesService"),Et=qn("ILanguageFeaturesService");var _ut=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},qR=function(i,e){return function(n,r){e(n,r,i)}},Y9=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const Xpe=60*1e3,Ype=5*60*1e3;function qC(i,e){const n=i.getModel(e);return!(!n||n.isTooLargeForSyncing())}let wJ=class extends Le{constructor(e,n,r,s,o){super(),this._modelService=e,this._workerManager=this._register(new but(this._modelService,s)),this._logService=r,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(a,l)=>qC(this._modelService,a.uri)?this._workerManager.withWorker().then(c=>c.computeLinks(a.uri)).then(c=>c&&{links:c}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new vut(this._workerManager,n,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return qC(this._modelService,e)}computedUnicodeHighlights(e,n,r){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,n,r))}computeDiff(e,n,r,s){return Y9(this,void 0,void 0,function*(){const o=yield this._workerManager.withWorker().then(c=>c.computeDiff(e,n,r,s));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:l(o.changes),moves:o.moves.map(c=>new XEe(new Xm(new Qn(c[0],c[1]),new Qn(c[2],c[3])),l(c[4])))};function l(c){return c.map(u=>{var d;return new bh(new Qn(u[0],u[1]),new Qn(u[2],u[3]),(d=u[4])===null||d===void 0?void 0:d.map(h=>new _1(new J(h[0],h[1],h[2],h[3]),new J(h[4],h[5],h[6],h[7]))))})}})}computeMoreMinimalEdits(e,n,r=!1){if(Ka(n)){if(!qC(this._modelService,e))return Promise.resolve(n);const s=Xa.create(),o=this._workerManager.withWorker().then(a=>a.computeMoreMinimalEdits(e,n,r));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),s.elapsed())),Promise.race([o,p1(1e3).then(()=>n)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return qC(this._modelService,e)}navigateValueSet(e,n,r){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,n,r))}canComputeWordRanges(e){return qC(this._modelService,e)}computeWordRanges(e,n){return this._workerManager.withWorker().then(r=>r.computeWordRanges(e,n))}};wJ=_ut([qR(0,Fr),qR(1,ooe),qR(2,vd),qR(3,dr),qR(4,Et)],wJ);class vut{constructor(e,n,r,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=n,this._modelService=r}provideCompletionItems(e,n){return Y9(this,void 0,void 0,function*(){const r=this._configurationService.getValue(e.uri,n,"editor");if(!r.wordBasedSuggestions)return;const s=[];if(r.wordBasedSuggestionsMode==="currentDocument")qC(this._modelService,e.uri)&&s.push(e.uri);else for(const h of this._modelService.getModels())qC(this._modelService,h.uri)&&(h===e?s.unshift(h.uri):(r.wordBasedSuggestionsMode==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&s.push(h.uri));if(s.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),a=e.getWordAtPosition(n),l=a?new J(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn):J.fromPositions(n),c=l.setEndPosition(n.lineNumber,n.column),d=yield(yield this._workerManager.withWorker()).textualSuggest(s,a==null?void 0:a.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:18,label:h,insertText:h,range:{insert:c,replace:l}}))}})}}class but extends Le{constructor(e,n){super(),this.languageConfigurationService=n,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new D5).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(Ype/2)),this._register(this._modelService.onModelRemoved(s=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>Ype&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new aoe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class yut extends Le{constructor(e,n,r){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=n,!r){const s=new D5;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(Xpe/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)Mi(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,n){for(const r of e){const s=r.toString();this._syncedModels[s]||this._beginModelSync(r,n),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),n=[];for(const r in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[r]>Xpe&&n.push(r);for(const r of n)this._stopModelSync(r)}_beginModelSync(e,n){const r=this._modelService.getModel(e);if(!r||!n&&r.isTooLargeForSyncing())return;const s=e.toString();this._proxy.acceptNewModel({url:r.uri.toString(),lines:r.getLinesContent(),EOL:r.getEOL(),versionId:r.getVersionId()});const o=new Xe;o.add(r.onDidChangeContent(a=>{this._proxy.acceptModelChanged(s.toString(),a)})),o.add(r.onWillDispose(()=>{this._stopModelSync(s)})),o.add(gn(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const n=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Mi(n)}}class Zpe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class fq{constructor(e){this._workerClient=e}fhr(e,n){return this._workerClient.fhr(e,n)}}class aoe extends Le{constructor(e,n,r,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=n,this._workerFactory=new p$(r),this._worker=null,this._modelManager=null}fhr(e,n){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new Slt(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new fq(this)))}catch(e){hJ(e),this._worker=new Zpe(new $y(new fq(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(hJ(e),this._worker=new Zpe(new $y(new fq(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new yut(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,n=!1){return Y9(this,void 0,void 0,function*(){return this._disposed?Promise.reject(Pst()):this._getProxy().then(r=>(this._getOrCreateModelManager(r).ensureSyncedResources(e,n),r))})}computedUnicodeHighlights(e,n,r){return this._withSyncedResources([e]).then(s=>s.computeUnicodeHighlights(e.toString(),n,r))}computeDiff(e,n,r,s){return this._withSyncedResources([e,n],!0).then(o=>o.computeDiff(e.toString(),n.toString(),r,s))}computeMoreMinimalEdits(e,n,r){return this._withSyncedResources([e]).then(s=>s.computeMoreMinimalEdits(e.toString(),n,r))}computeLinks(e){return this._withSyncedResources([e]).then(n=>n.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(n=>n.computeDefaultDocumentColors(e.toString()))}textualSuggest(e,n,r){return Y9(this,void 0,void 0,function*(){const s=yield this._withSyncedResources(e),o=r.source,a=r.flags;return s.textualSuggest(e.map(l=>l.toString()),n,o,a)})}computeWordRanges(e,n){return this._withSyncedResources([e]).then(r=>{const s=this._modelService.getModel(e);if(!s)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),a=o.source,l=o.flags;return r.computeWordRanges(e.toString(),n,a,l)})}navigateValueSet(e,n,r){return this._withSyncedResources([e]).then(s=>{const o=this._modelService.getModel(e);if(!o)return null;const a=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),l=a.source,c=a.flags;return s.navigateValueSet(e.toString(),n,r,l,c)})}dispose(){super.dispose(),this._disposed=!0}}function wut(i,e,n){return new Cut(i,e,n)}class Cut extends aoe{constructor(e,n,r){super(e,r.keepIdleModels||!1,r.label,n),this._foreignModuleId=r.moduleId,this._foreignModuleCreateData=r.createData||null,this._foreignModuleHost=r.host||null,this._foreignProxy=null}fhr(e,n){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,n))}catch(r){return Promise.reject(r)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const n=this._foreignModuleHost?Dse(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,n).then(r=>{this._foreignModuleCreateData=null;const s=(l,c)=>e.fmr(l,c),o=(l,c)=>function(){const u=Array.prototype.slice.call(arguments,0);return c(l,u)},a={};for(const l of r)a[l]=o(l,s);return a})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(n=>this.getProxy())}}const I5={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},FE=new class{clone(){return this}equals(i){return this===i}};function loe(i,e){return new Bse([new rP(0,"",i)],e)}function C$(i,e){const n=new Uint32Array(2);return n[0]=0,n[1]=(i<<0|0|0|32768|2<<24)>>>0,new ZW(n,e===null?FE:e)}class Da{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let r="mtk"+this.getForeground(e);const s=this.getFontStyle(e);return s&1&&(r+=" mtki"),s&2&&(r+=" mtkb"),s&4&&(r+=" mtku"),s&8&&(r+=" mtks"),r}static getInlineStyleFromMetadata(e,n){const r=this.getForeground(e),s=this.getFontStyle(e);let o=`color: ${n[r]};`;s&1&&(o+="font-style: italic;"),s&2&&(o+="font-weight: bold;");let a="";return s&4&&(a+=" underline"),s&8&&(a+=" line-through"),a&&(o+=`text-decoration:${a};`),o}static getPresentationFromMetadata(e){const n=this.getForeground(e),r=this.getFontStyle(e);return{foreground:n,italic:!!(r&1),bold:!!(r&2),underline:!!(r&4),strikethrough:!!(r&8)}}}class ko{static createEmpty(e,n){const r=ko.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=r,new ko(s,e,n)}constructor(e,n,r){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=n,this._languageIdCodec=r}equals(e){return e instanceof ko?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,n,r){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=n<<1,o=s+(r<<1);for(let a=s;a<o;a++)if(this._tokens[a]!==e._tokens[a])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const n=this._tokens[(e<<1)+1],r=Da.getLanguageId(n);return this._languageIdCodec.decodeLanguageId(r)}getStandardTokenType(e){const n=this._tokens[(e<<1)+1];return Da.getTokenType(n)}getForeground(e){const n=this._tokens[(e<<1)+1];return Da.getForeground(n)}getClassName(e){const n=this._tokens[(e<<1)+1];return Da.getClassNameFromMetadata(n)}getInlineStyle(e,n){const r=this._tokens[(e<<1)+1];return Da.getInlineStyleFromMetadata(r,n)}getPresentation(e){const n=this._tokens[(e<<1)+1];return Da.getPresentationFromMetadata(n)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return ko.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,n,r){return new coe(this,e,n,r)}static convertToEndOffset(e,n){const s=(e.length>>>1)-1;for(let o=0;o<s;o++)e[o<<1]=e[o+1<<1];e[s<<1]=n}static findIndexInTokensArray(e,n){if(e.length<=2)return 0;let r=0,s=(e.length>>>1)-1;for(;r<s;){const o=r+Math.floor((s-r)/2),a=e[o<<1];if(a===n)return o+1;a<n?r=o+1:a>n&&(s=o)}return r}withInserted(e){if(e.length===0)return this;let n=0,r=0,s="";const o=new Array;let a=0;for(;;){const l=n<this._tokensCount?this._tokens[n<<1]:-1,c=r<e.length?e[r]:null;if(l!==-1&&(c===null||l<=c.offset)){s+=this._text.substring(a,l);const u=this._tokens[(n<<1)+1];o.push(s.length,u),n++,a=l}else if(c){if(c.offset>a){s+=this._text.substring(a,c.offset);const u=this._tokens[(n<<1)+1];o.push(s.length,u),a=c.offset}s+=c.text,o.push(s.length,c.tokenMetadata),r++}else break}return new ko(new Uint32Array(o),s,this._languageIdCodec)}}ko.defaultTokenMetadata=(32768|2<<24)>>>0;class coe{constructor(e,n,r,s){this._source=e,this._startOffset=n,this._endOffset=r,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(n),this._tokensCount=0;for(let o=this._firstTokenIndex,a=e.getCount();o<a&&!(e.getStartOffset(o)>=r);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof coe?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const n=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,n)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,n){return this._source.getInlineStyle(this._firstTokenIndex+e,n)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class ru{constructor(e,n,r,s){this.startColumn=e,this.endColumn=n,this.className=r,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,n){return e.startColumn===n.startColumn&&e.endColumn===n.endColumn&&e.className===n.className&&e.type===n.type}static equalsArr(e,n){const r=e.length,s=n.length;if(r!==s)return!1;for(let o=0;o<r;o++)if(!ru._equals(e[o],n[o]))return!1;return!0}static extractWrapped(e,n,r){if(e.length===0)return e;const s=n+1,o=r+1,a=r-n,l=[];let c=0;for(const u of e)u.endColumn<=s||u.startColumn>=o||(l[c++]=new ru(Math.max(1,u.startColumn-s+1),Math.min(a+1,u.endColumn-s+1),u.className,u.type));return l}static filter(e,n,r,s){if(e.length===0)return[];const o=[];let a=0;for(let l=0,c=e.length;l<c;l++){const u=e[l],d=u.range;if(d.endLineNumber<n||d.startLineNumber>n||d.isEmpty()&&(u.type===0||u.type===3))continue;const h=d.startLineNumber===n?d.startColumn:r,f=d.endLineNumber===n?d.endColumn:s;o[a++]=new ru(h,f,u.inlineClassName,u.type)}return o}static _typeCompare(e,n){const r=[2,0,1,3];return r[e]-r[n]}static compare(e,n){if(e.startColumn!==n.startColumn)return e.startColumn-n.startColumn;if(e.endColumn!==n.endColumn)return e.endColumn-n.endColumn;const r=ru._typeCompare(e.type,n.type);return r!==0?r:e.className!==n.className?e.className<n.className?-1:1:0}}class Qpe{constructor(e,n,r,s){this.startOffset=e,this.endOffset=n,this.className=r,this.metadata=s}}class Z9{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let n=0;for(let r=0,s=e.length;r<s;r++)n|=e[r];return n}consumeLowerThan(e,n,r){for(;this.count>0&&this.stopOffsets[0]<e;){let s=0;for(;s+1<this.count&&this.stopOffsets[s]===this.stopOffsets[s+1];)s++;r.push(new Qpe(n,this.stopOffsets[s],this.classNames.join(" "),Z9._metadata(this.metadata))),n=this.stopOffsets[s]+1,this.stopOffsets.splice(0,s+1),this.classNames.splice(0,s+1),this.metadata.splice(0,s+1),this.count-=s+1}return this.count>0&&n<e&&(r.push(new Qpe(n,e-1,this.classNames.join(" "),Z9._metadata(this.metadata))),n=e),n}insert(e,n,r){if(this.count===0||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(n),this.metadata.push(r);else for(let s=0;s<this.count;s++)if(this.stopOffsets[s]>=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,n),this.metadata.splice(s,0,r);break}this.count++}}class Sut{static normalize(e,n){if(n.length===0)return[];const r=[],s=new Z9;let o=0;for(let a=0,l=n.length;a<l;a++){const c=n[a];let u=c.startColumn,d=c.endColumn;const h=c.className,f=c.type===1?2:c.type===2?4:0;if(u>1){const m=e.charCodeAt(u-2);xo(m)&&u--}if(d>1){const m=e.charCodeAt(d-2);xo(m)&&d--}const p=u-1,g=d-2;o=s.consumeLowerThan(p,o,r),s.count===0&&(o=p),s.insert(g,h,f)}return s.consumeLowerThan(1073741824,o,r),r}}class Wo{constructor(e,n,r,s){this.endIndex=e,this.type=n,this.metadata=r,this.containsRTL=s,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class nIe{constructor(e,n){this.startOffset=e,this.endOffset=n}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class X1{constructor(e,n,r,s,o,a,l,c,u,d,h,f,p,g,m,_,b,y,x){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=n,this.lineContent=r,this.continuesWithWrappedLine=s,this.isBasicASCII=o,this.containsRTL=a,this.fauxIndentLength=l,this.lineTokens=c,this.lineDecorations=u.sort(ru.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=f,this.stopRenderingLineAfter=m,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=b,this.fontLigatures=y,this.selectionsOnLine=x&&x.sort((R,E)=>R.startOffset<E.startOffset?-1:1);const k=Math.abs(g-f),D=Math.abs(p-f);k<D?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=p,this.renderSpaceCharCode=183)}sameSelection(e){if(this.selectionsOnLine===null)return e===null;if(e===null||e.length!==this.selectionsOnLine.length)return!1;for(let n=0;n<this.selectionsOnLine.length;n++)if(!this.selectionsOnLine[n].equals(e[n]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&ru.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class iIe{constructor(e,n){this.partIndex=e,this.charIndex=n}}class rm{static getPartIndex(e){return(e&4294901760)>>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,n){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,n,r,s){const o=(n<<16|r<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=s}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const n=this.charOffsetToPartData(e-1),r=rm.getPartIndex(n),s=rm.getCharIndex(n);return new iIe(r,s)}getColumn(e,n){return this.partDataToCharOffset(e.partIndex,n,e.charIndex)+1}partDataToCharOffset(e,n,r){if(this.length===0)return 0;const s=(e<<16|r<<0)>>>0;let o=0,a=this.length-1;for(;o+1<a;){const m=o+a>>>1,_=this._data[m];if(_===s)return m;_>s?a=m:o=m}if(o===a)return o;const l=this._data[o],c=this._data[a];if(l===s)return o;if(c===s)return a;const u=rm.getPartIndex(l),d=rm.getCharIndex(l),h=rm.getPartIndex(c);let f;u!==h?f=n:f=rm.getCharIndex(c);const p=r-d,g=f-r;return p<=g?o:a}}class CJ{constructor(e,n,r){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=n,this.containsForeignElements=r}}function T5(i,e){if(i.lineContent.length===0){if(i.lineDecorations.length>0){e.appendString("<span>");let n=0,r=0,s=0;for(const a of i.lineDecorations)(a.type===1||a.type===2)&&(e.appendString('<span class="'),e.appendString(a.className),e.appendString('"></span>'),a.type===1&&(s|=1,n++),a.type===2&&(s|=2,r++));e.appendString("</span>");const o=new rm(1,n+r);return o.setColumnInfo(1,n,0,0),new CJ(o,!1,s)}return e.appendString("<span><span></span></span>"),new CJ(new rm(0,0),!1,0)}return Aut(Lut(i),e)}class xut{constructor(e,n,r,s){this.characterMapping=e,this.html=n,this.containsRTL=r,this.containsForeignElements=s}}function S$(i){const e=new jI(1e4),n=T5(i,e);return new xut(n.characterMapping,e.build(),n.containsRTL,n.containsForeignElements)}class kut{constructor(e,n,r,s,o,a,l,c,u,d,h,f,p,g,m,_){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=n,this.lineContent=r,this.len=s,this.isOverflowing=o,this.overflowingCharCount=a,this.parts=l,this.containsForeignElements=c,this.fauxIndentLength=u,this.tabSize=d,this.startVisibleColumn=h,this.containsRTL=f,this.spaceWidth=p,this.renderSpaceCharCode=g,this.renderWhitespace=m,this.renderControlCharacters=_}}function Lut(i){const e=i.lineContent;let n,r,s;i.stopRenderingLineAfter!==-1&&i.stopRenderingLineAfter<e.length?(n=!0,r=e.length-i.stopRenderingLineAfter,s=i.stopRenderingLineAfter):(n=!1,r=0,s=e.length);let o=Dut(e,i.containsRTL,i.lineTokens,i.fauxIndentLength,s);i.renderControlCharacters&&!i.isBasicASCII&&(o=Iut(e,o)),(i.renderWhitespace===4||i.renderWhitespace===1||i.renderWhitespace===2&&i.selectionsOnLine||i.renderWhitespace===3&&!i.continuesWithWrappedLine)&&(o=Tut(i,e,s,o));let a=0;if(i.lineDecorations.length>0){for(let l=0,c=i.lineDecorations.length;l<c;l++){const u=i.lineDecorations[l];u.type===3||u.type===1?a|=1:u.type===2&&(a|=2)}o=Rut(e,s,o,i.lineDecorations)}return i.containsRTL||(o=Eut(e,o,!i.isBasicASCII||i.fontLigatures)),new kut(i.useMonospaceOptimizations,i.canUseHalfwidthRightwardsArrow,e,s,n,r,o,a,i.fauxIndentLength,i.tabSize,i.startVisibleColumn,i.containsRTL,i.spaceWidth,i.renderSpaceCharCode,i.renderWhitespace,i.renderControlCharacters)}function Dut(i,e,n,r,s){const o=[];let a=0;r>0&&(o[a++]=new Wo(r,"",0,!1));let l=r;for(let c=0,u=n.getCount();c<u;c++){const d=n.getEndOffset(c);if(d<=r)continue;const h=n.getClassName(c);if(d>=s){const p=e?TE(i.substring(l,s)):!1;o[a++]=new Wo(s,h,0,p);break}const f=e?TE(i.substring(l,d)):!1;o[a++]=new Wo(d,h,0,f),l=d}return o}function Eut(i,e,n){let r=0;const s=[];let o=0;if(n)for(let a=0,l=e.length;a<l;a++){const c=e[a],u=c.endIndex;if(r+50<u){const d=c.type,h=c.metadata,f=c.containsRTL;let p=-1,g=r;for(let m=r;m<u;m++)i.charCodeAt(m)===32&&(p=m),p!==-1&&m-g>=50&&(s[o++]=new Wo(p+1,d,h,f),g=p+1,p=-1);g!==u&&(s[o++]=new Wo(u,d,h,f))}else s[o++]=c;r=u}else for(let a=0,l=e.length;a<l;a++){const c=e[a],u=c.endIndex,d=u-r;if(d>50){const h=c.type,f=c.metadata,p=c.containsRTL,g=Math.ceil(d/50);for(let m=1;m<g;m++){const _=r+m*50;s[o++]=new Wo(_,h,f,p)}s[o++]=new Wo(u,h,f,p)}else s[o++]=c;r=u}return s}function rIe(i){return i<32?i!==9:i===127||i>=8234&&i<=8238||i>=8294&&i<=8297||i>=8206&&i<=8207||i===1564}function Iut(i,e){const n=[];let r=new Wo(0,"",0,!1),s=0;for(const o of e){const a=o.endIndex;for(;s<a;s++){const l=i.charCodeAt(s);rIe(l)&&(s>r.endIndex&&(r=new Wo(s,o.type,o.metadata,o.containsRTL),n.push(r)),r=new Wo(s+1,"mtkcontrol",o.metadata,!1),n.push(r))}s>r.endIndex&&(r=new Wo(a,o.type,o.metadata,o.containsRTL),n.push(r))}return n}function Tut(i,e,n,r){const s=i.continuesWithWrappedLine,o=i.fauxIndentLength,a=i.tabSize,l=i.startVisibleColumn,c=i.useMonospaceOptimizations,u=i.selectionsOnLine,d=i.renderWhitespace===1,h=i.renderWhitespace===3,f=i.renderSpaceWidth!==i.spaceWidth,p=[];let g=0,m=0,_=r[m].type,b=r[m].containsRTL,y=r[m].endIndex;const x=r.length;let k=!1,D=ml(e),R;D===-1?(k=!0,D=n,R=n):R=$p(e);let E=!1,A=0,M=u&&u[A],N=l%a;for(let O=o;O<n;O++){const B=e.charCodeAt(O);M&&O>=M.endOffset&&(A++,M=u&&u[A]);let j;if(O<D||O>R)j=!0;else if(B===9)j=!0;else if(B===32)if(d)if(E)j=!0;else{const z=O+1<n?e.charCodeAt(O+1):0;j=z===32||z===9}else j=!0;else j=!1;if(j&&u&&(j=!!M&&M.startOffset<=O&&M.endOffset>O),j&&h&&(j=k||O>R),j&&b&&O>=D&&O<=R&&(j=!1),E){if(!j||!c&&N>=a){if(f){const z=g>0?p[g-1].endIndex:o;for(let H=z+1;H<=O;H++)p[g++]=new Wo(H,"mtkw",1,!1)}else p[g++]=new Wo(O,"mtkw",1,!1);N=N%a}}else(O===y||j&&O>o)&&(p[g++]=new Wo(O,_,0,b),N=N%a);for(B===9?N=a:d1(B)?N+=2:N++,E=j;O===y&&(m++,m<x);)_=r[m].type,b=r[m].containsRTL,y=r[m].endIndex}let P=!1;if(E)if(s&&d){const O=n>0?e.charCodeAt(n-1):0,B=n>1?e.charCodeAt(n-2):0;O===32&&B!==32&&B!==9||(P=!0)}else P=!0;if(P)if(f){const O=g>0?p[g-1].endIndex:o;for(let B=O+1;B<=n;B++)p[g++]=new Wo(B,"mtkw",1,!1)}else p[g++]=new Wo(n,"mtkw",1,!1);else p[g++]=new Wo(n,_,0,b);return p}function Rut(i,e,n,r){r.sort(ru.compare);const s=Sut.normalize(i,r),o=s.length;let a=0;const l=[];let c=0,u=0;for(let h=0,f=n.length;h<f;h++){const p=n[h],g=p.endIndex,m=p.type,_=p.metadata,b=p.containsRTL;for(;a<o&&s[a].startOffset<g;){const y=s[a];if(y.startOffset>u&&(u=y.startOffset,l[c++]=new Wo(u,m,_,b)),y.endOffset+1<=g)u=y.endOffset+1,l[c++]=new Wo(u,m+" "+y.className,_|y.metadata,b),a++;else{u=g,l[c++]=new Wo(u,m+" "+y.className,_|y.metadata,b);break}}g>u&&(u=g,l[c++]=new Wo(u,m,_,b))}const d=n[n.length-1].endIndex;if(a<o&&s[a].startOffset===d)for(;a<o&&s[a].startOffset===d;){const h=s[a];l[c++]=new Wo(u,h.className,h.metadata,!1),a++}return l}function Aut(i,e){const n=i.fontIsMonospace,r=i.canUseHalfwidthRightwardsArrow,s=i.containsForeignElements,o=i.lineContent,a=i.len,l=i.isOverflowing,c=i.overflowingCharCount,u=i.parts,d=i.fauxIndentLength,h=i.tabSize,f=i.startVisibleColumn,p=i.containsRTL,g=i.spaceWidth,m=i.renderSpaceCharCode,_=i.renderWhitespace,b=i.renderControlCharacters,y=new rm(a+1,u.length);let x=!1,k=0,D=f,R=0,E=0,A=0;p?e.appendString('<span dir="ltr">'):e.appendString("<span>");for(let M=0,N=u.length;M<N;M++){const P=u[M],O=P.endIndex,B=P.type,j=P.containsRTL,z=_!==0&&P.isWhitespace(),H=z&&!n&&(B==="mtkw"||!s),Y=k===O&&P.isPseudoAfter();if(R=0,e.appendString("<span "),j&&e.appendString('style="unicode-bidi:isolate" '),e.appendString('class="'),e.appendString(H?"mtkz":B),e.appendASCIICharCode(34),z){let X=0;{let Q=k,ie=D;for(;Q<O;Q++){const ee=(o.charCodeAt(Q)===9?h-ie%h:1)|0;X+=ee,Q>=d&&(ie+=ee)}}for(H&&(e.appendString(' style="width:'),e.appendString(String(g*X)),e.appendString('px"')),e.appendASCIICharCode(62);k<O;k++){y.setColumnInfo(k+1,M-A,R,E),A=0;const Q=o.charCodeAt(k);let ie,K;if(Q===9){ie=h-D%h|0,K=ie,!r||K>1?e.appendCharCode(8594):e.appendCharCode(65515);for(let ee=2;ee<=K;ee++)e.appendCharCode(160)}else ie=2,K=1,e.appendCharCode(m),e.appendCharCode(8204);R+=ie,E+=K,k>=d&&(D+=K)}}else for(e.appendASCIICharCode(62);k<O;k++){y.setColumnInfo(k+1,M-A,R,E),A=0;const X=o.charCodeAt(k);let Q=1,ie=1;switch(X){case 9:Q=h-D%h,ie=Q;for(let K=1;K<=Q;K++)e.appendCharCode(160);break;case 32:e.appendCharCode(160);break;case 60:e.appendString("&lt;");break;case 62:e.appendString("&gt;");break;case 38:e.appendString("&amp;");break;case 0:b?e.appendCharCode(9216):e.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:e.appendCharCode(65533);break;default:d1(X)&&ie++,b&&X<32?e.appendCharCode(9216+X):b&&X===127?e.appendCharCode(9249):b&&rIe(X)?(e.appendString("[U+"),e.appendString(Nut(X)),e.appendString("]"),Q=8,ie=Q):e.appendCharCode(X)}R+=Q,E+=ie,k>=d&&(D+=ie)}Y?A++:A=0,k>=a&&!x&&P.isPseudoAfter()&&(x=!0,y.setColumnInfo(k+1,M,R,E)),e.appendString("</span>")}return x||y.setColumnInfo(a+1,u.length-1,R,E),l&&(e.appendString('<span class="mtkoverflow">'),e.appendString(L("showMore","Show more ({0})",Mut(c))),e.appendString("</span>")),e.appendString("</span>"),new CJ(y,p,s)}function Nut(i){return i.toString(16).toUpperCase().padStart(4,"0")}function Mut(i){return i<1024?L("overflow.chars","{0} chars",i):i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`}class Jpe{constructor(e,n,r,s){this._viewportBrand=void 0,this.top=e|0,this.left=n|0,this.width=r|0,this.height=s|0}}class Put{constructor(e,n){this.tabSize=e,this.data=n}}class uoe{constructor(e,n,r,s,o,a,l){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=n,this.minColumn=r,this.maxColumn=s,this.startVisibleColumn=o,this.tokens=a,this.inlineDecorations=l}}class fd{constructor(e,n,r,s,o,a,l,c,u,d){this.minColumn=e,this.maxColumn=n,this.content=r,this.continuesWithWrappedLine=s,this.isBasicASCII=fd.isBasicASCII(r,a),this.containsRTL=fd.containsRTL(r,this.isBasicASCII,o),this.tokens=l,this.inlineDecorations=c,this.tabSize=u,this.startVisibleColumn=d}static isBasicASCII(e,n){return n?k5(e):!0}static containsRTL(e,n,r){return!n&&r?TE(e):!1}}class tM{constructor(e,n,r){this.range=e,this.inlineClassName=n,this.type=r}}class Out{constructor(e,n,r,s){this.startOffset=e,this.endOffset=n,this.inlineClassName=r,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new tM(new J(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class sIe{constructor(e,n){this._viewModelDecorationBrand=void 0,this.range=e,this.options=n}}class bP{constructor(e,n,r){this.color=e,this.zIndex=n,this.data=r}static compareByRenderingProps(e,n){return e.zIndex===n.zIndex?e.color<n.color?-1:e.color>n.color?1:0:e.zIndex-n.zIndex}static equals(e,n){return e.color===n.color&&e.zIndex===n.zIndex&&ys(e.data,n.data)}static equalsArr(e,n){return ys(e,n,bP.equals)}}function Fut(i){return Array.isArray(i)}function But(i){return!Fut(i)}function oIe(i){return typeof i=="string"}function ege(i){return!oIe(i)}function WD(i){return!i}function zy(i,e){return i.ignoreCase&&e?e.toLowerCase():e}function tge(i){return i.replace(/[&<>'"_]/g,"-")}function jut(i,e){console.log(`${i.languageId}: ${e}`)}function Lr(i,e){return new Error(`${i.languageId}: ${e}`)}function oy(i,e,n,r,s){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let a=null;return e.replace(o,function(l,c,u,d,h,f,p,g,m){return WD(u)?WD(d)?!WD(h)&&h<r.length?zy(i,r[h]):!WD(p)&&i&&typeof i[p]=="string"?i[p]:(a===null&&(a=s.split("."),a.unshift(s)),!WD(f)&&f<a.length?zy(i,a[f]):""):zy(i,n):"$"})}function V3(i,e){let n=e;for(;n&&n.length>0;){const r=i.tokenizer[n];if(r)return r;const s=n.lastIndexOf(".");s<0?n=null:n=n.substr(0,s)}return null}function Wut(i,e){let n=e;for(;n&&n.length>0;){if(i.stateNames[n])return!0;const s=n.lastIndexOf(".");s<0?n=null:n=n.substr(0,s)}return!1}var $ut=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},zut=function(i,e){return function(n,r){e(n,r,i)}},SJ;const aIe=5;class yP{static create(e,n){return this._INSTANCE.create(e,n)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,n){if(e!==null&&e.depth>=this._maxCacheDepth)return new H2(e,n);let r=H2.getStackElementId(e);r.length>0&&(r+="|"),r+=n;let s=this._entries[r];return s||(s=new H2(e,n),this._entries[r]=s,s)}}yP._INSTANCE=new yP(aIe);class H2{constructor(e,n){this.parent=e,this.state=n,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let n="";for(;e!==null;)n.length>0&&(n+="|"),n+=e.state,e=e.parent;return n}static _equals(e,n){for(;e!==null&&n!==null;){if(e===n)return!0;if(e.state!==n.state)return!1;e=e.parent,n=n.parent}return e===null&&n===null}equals(e){return H2._equals(this,e)}push(e){return yP.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return yP.create(this.parent,e)}}class o2{constructor(e,n){this.languageId=e,this.state=n}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new o2(this.languageId,this.state)}}class ay{static create(e,n){return this._INSTANCE.create(e,n)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,n){if(n!==null)return new nM(e,n);if(e!==null&&e.depth>=this._maxCacheDepth)return new nM(e,n);const r=H2.getStackElementId(e);let s=this._entries[r];return s||(s=new nM(e,null),this._entries[r]=s,s)}}ay._INSTANCE=new ay(aIe);class nM{constructor(e,n){this.stack=e,this.embeddedLanguageData=n}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:ay.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof nM)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class Vut{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,n){this._lastTokenType===n&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=n,this._lastTokenLanguage=this._languageId,this._tokens.push(new rP(e,n,this._languageId)))}nestedLanguageTokenize(e,n,r,s){const o=r.languageId,a=r.state,l=Zr.get(o);if(!l)return this.enterLanguage(o),this.emit(s,""),a;const c=l.tokenize(e,n,a);if(s!==0)for(const u of c.tokens)this._tokens.push(new rP(u.offset+s,u.type,u.language));else this._tokens=this._tokens.concat(c.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,c.endState}finalize(e){return new Bse(this._tokens,e)}}class Q9{constructor(e,n){this._languageService=e,this._theme=n,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,n){const r=this._theme.match(this._currentLanguageId,n)|1024;this._lastTokenMetadata!==r&&(this._lastTokenMetadata=r,this._tokens.push(e),this._tokens.push(r))}static _merge(e,n,r){const s=e!==null?e.length:0,o=n.length,a=r!==null?r.length:0;if(s===0&&o===0&&a===0)return new Uint32Array(0);if(s===0&&o===0)return r;if(o===0&&a===0)return e;const l=new Uint32Array(s+o+a);e!==null&&l.set(e);for(let c=0;c<o;c++)l[s+c]=n[c];return r!==null&&l.set(r,s+o),l}nestedLanguageTokenize(e,n,r,s){const o=r.languageId,a=r.state,l=Zr.get(o);if(!l)return this.enterLanguage(o),this.emit(s,""),a;const c=l.tokenizeEncoded(e,n,a);if(s!==0)for(let u=0,d=c.tokens.length;u<d;u+=2)c.tokens[u]+=s;return this._prependTokens=Q9._merge(this._prependTokens,this._tokens,c.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,c.endState}finalize(e){return new ZW(Q9._merge(this._prependTokens,this._tokens,null),e)}}let wP=SJ=class extends Le{constructor(e,n,r,s,o){super(),this._configurationService=o,this._languageService=e,this._standaloneThemeService=n,this._languageId=r,this._lexer=s,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let a=!1;this._register(Zr.onDidChange(l=>{if(a)return;let c=!1;for(let u=0,d=l.changedLanguages.length;u<d;u++){const h=l.changedLanguages[u];if(this._embeddedLanguages[h]){c=!0;break}}c&&(a=!0,Zr.handleChange([this._languageId]),a=!1)})),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const n in this._embeddedLanguages){const r=Zr.get(n);if(r){if(r instanceof SJ){const s=r.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}Zr.isResolved(n)||e.push(Zr.getOrCreate(n))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(n=>{})}}getInitialState(){const e=yP.create(null,this._lexer.start);return ay.create(e,null)}tokenize(e,n,r){if(e.length>=this._maxTokenizationLineLength)return loe(this._languageId,r);const s=new Vut,o=this._tokenize(e,n,r,s);return s.finalize(o)}tokenizeEncoded(e,n,r){if(e.length>=this._maxTokenizationLineLength)return C$(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),r);const s=new Q9(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,n,r,s);return s.finalize(o)}_tokenize(e,n,r,s){return r.embeddedLanguageData?this._nestedTokenize(e,n,r,0,s):this._myTokenize(e,n,r,0,s)}_findLeavingNestedLanguageOffset(e,n){let r=this._lexer.tokenizer[n.stack.state];if(!r&&(r=V3(this._lexer,n.stack.state),!r))throw Lr(this._lexer,"tokenizer state is not defined: "+n.stack.state);let s=-1,o=!1;for(const a of r){if(!ege(a.action)||a.action.nextEmbedded!=="@pop")continue;o=!0;let l=a.regex;const c=a.regex.source;if(c.substr(0,4)==="^(?:"&&c.substr(c.length-1,1)===")"){const d=(l.ignoreCase?"i":"")+(l.unicode?"u":"");l=new RegExp(c.substr(4,c.length-5),d)}const u=e.search(l);u===-1||u!==0&&a.matchOnlyAtLineStart||(s===-1||u<s)&&(s=u)}if(!o)throw Lr(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+n.stack.state);return s}_nestedTokenize(e,n,r,s,o){const a=this._findLeavingNestedLanguageOffset(e,r);if(a===-1){const u=o.nestedLanguageTokenize(e,n,r.embeddedLanguageData,s);return ay.create(r.stack,new o2(r.embeddedLanguageData.languageId,u))}const l=e.substring(0,a);l.length>0&&o.nestedLanguageTokenize(l,!1,r.embeddedLanguageData,s);const c=e.substring(a);return this._myTokenize(c,n,r,s+a,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,n,r,s,o){o.enterLanguage(this._languageId);const a=e.length,l=n&&this._lexer.includeLF?e+`
`:e,c=l.length;let u=r.embeddedLanguageData,d=r.stack,h=0,f=null,p=!0;for(;p||h<c;){const g=h,m=d.depth,_=f?f.groups.length:0,b=d.state;let y=null,x=null,k=null,D=null,R=null;if(f){y=f.matches;const M=f.groups.shift();x=M.matched,k=M.action,D=f.rule,f.groups.length===0&&(f=null)}else{if(!p&&h>=c)break;p=!1;let M=this._lexer.tokenizer[b];if(!M&&(M=V3(this._lexer,b),!M))throw Lr(this._lexer,"tokenizer state is not defined: "+b);const N=l.substr(h);for(const P of M)if((h===0||!P.matchOnlyAtLineStart)&&(y=N.match(P.regex),y)){x=y[0],k=P.action;break}}if(y||(y=[""],x=""),k||(h<c&&(y=[l.charAt(h)],x=y[0]),k=this._lexer.defaultToken),x===null)break;for(h+=x.length;But(k)&&ege(k)&&k.test;)k=k.test(x,y,b,h===c);let E=null;if(typeof k=="string"||Array.isArray(k))E=k;else if(k.group)E=k.group;else if(k.token!==null&&k.token!==void 0){if(k.tokenSubst?E=oy(this._lexer,k.token,x,y,b):E=k.token,k.nextEmbedded)if(k.nextEmbedded==="@pop"){if(!u)throw Lr(this._lexer,"cannot pop embedded language if not inside one");u=null}else{if(u)throw Lr(this._lexer,"cannot enter embedded language from within an embedded language");R=oy(this._lexer,k.nextEmbedded,x,y,b)}if(k.goBack&&(h=Math.max(0,h-k.goBack)),k.switchTo&&typeof k.switchTo=="string"){let M=oy(this._lexer,k.switchTo,x,y,b);if(M[0]==="@"&&(M=M.substr(1)),V3(this._lexer,M))d=d.switchTo(M);else throw Lr(this._lexer,"trying to switch to a state '"+M+"' that is undefined in rule: "+this._safeRuleName(D))}else{if(k.transform&&typeof k.transform=="function")throw Lr(this._lexer,"action.transform not supported");if(k.next)if(k.next==="@push"){if(d.depth>=this._lexer.maxStack)throw Lr(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(b)}else if(k.next==="@pop"){if(d.depth<=1)throw Lr(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(D));d=d.pop()}else if(k.next==="@popall")d=d.popall();else{let M=oy(this._lexer,k.next,x,y,b);if(M[0]==="@"&&(M=M.substr(1)),V3(this._lexer,M))d=d.push(M);else throw Lr(this._lexer,"trying to set a next state '"+M+"' that is undefined in rule: "+this._safeRuleName(D))}}k.log&&typeof k.log=="string"&&jut(this._lexer,this._lexer.languageId+": "+oy(this._lexer,k.log,x,y,b))}if(E===null)throw Lr(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(D));const A=M=>{const N=this._languageService.getLanguageIdByLanguageName(M)||this._languageService.getLanguageIdByMimeType(M)||M,P=this._getNestedEmbeddedLanguageData(N);if(h<c){const O=e.substr(h);return this._nestedTokenize(O,n,ay.create(d,P),s+h,o)}else return ay.create(d,P)};if(Array.isArray(E)){if(f&&f.groups.length>0)throw Lr(this._lexer,"groups cannot be nested: "+this._safeRuleName(D));if(y.length!==E.length+1)throw Lr(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(D));let M=0;for(let N=1;N<y.length;N++)M+=y[N].length;if(M!==x.length)throw Lr(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(D));f={rule:D,matches:y,groups:[]};for(let N=0;N<E.length;N++)f.groups[N]={action:E[N],matched:y[N+1]};h-=x.length;continue}else{if(E==="@rematch"&&(h-=x.length,x="",y=null,E="",R!==null))return A(R);if(x.length===0){if(c===0||m!==d.depth||b!==d.state||(f?f.groups.length:0)!==_)continue;throw Lr(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(D))}let M=null;if(oIe(E)&&E.indexOf("@brackets")===0){const N=E.substr(9),P=Hut(this._lexer,x);if(!P)throw Lr(this._lexer,"@brackets token returned but no bracket defined as: "+x);M=tge(P.token+N)}else{const N=E===""?"":E+this._lexer.tokenPostfix;M=tge(N)}g<a&&o.emit(g+s,M)}if(R!==null)return A(R)}return ay.create(d,u)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new o2(e,FE);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),Zr.getOrCreate(e),this._embeddedLanguages[e]=!0);const n=Zr.get(e);return n?new o2(e,n.getInitialState()):new o2(e,FE)}};wP=SJ=$ut([zut(4,ei)],wP);function Hut(i,e){if(!e)return null;e=zy(i,e);const n=i.brackets;for(const r of n){if(r.open===e)return{token:r.token,bracketType:1};if(r.close===e)return{token:r.token,bracketType:-1}}return null}var Uut=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const pq=$v("standaloneColorizer",{createHTML:i=>i});class doe{static colorizeElement(e,n,r,s){s=s||{};const o=s.theme||"vs",a=s.mimeType||r.getAttribute("lang")||r.getAttribute("data-lang");if(!a)return console.error("Mode not detected"),Promise.resolve();const l=n.getLanguageIdByMimeType(a)||a;e.setTheme(o);const c=r.firstChild?r.firstChild.nodeValue:"";r.className+=" "+o;const u=d=>{var h;const f=(h=pq==null?void 0:pq.createHTML(d))!==null&&h!==void 0?h:d;r.innerHTML=f};return this.colorize(n,c||"",l,s).then(u,d=>console.error(d))}static colorize(e,n,r,s){return Uut(this,void 0,void 0,function*(){const o=e.languageIdCodec;let a=4;s&&typeof s.tabSize=="number"&&(a=s.tabSize),Use(n)&&(n=n.substr(1));const l=Km(n);if(!e.isRegisteredLanguageId(r))return nge(l,a,o);const c=yield Zr.getOrCreate(r);return c?qut(l,a,c,o):nge(l,a,o)})}static colorizeLine(e,n,r,s,o=4){const a=fd.isBasicASCII(e,n),l=fd.containsRTL(e,a,r);return S$(new X1(!1,!0,e,!1,a,l,0,s,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,n,r=4){const s=e.getLineContent(n);e.tokenization.forceTokenization(n);const a=e.tokenization.getLineTokens(n).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),a,r)}}function qut(i,e,n,r){return new Promise((s,o)=>{const a=()=>{const l=Kut(i,e,n,r);if(n instanceof wP){const c=n.getLoadStatus();if(c.loaded===!1){c.promise.then(a,o);return}}s(l)};a()})}function nge(i,e,n){let r=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let a=0,l=i.length;a<l;a++){const c=i[a];o[0]=c.length;const u=new ko(o,c,n),d=fd.isBasicASCII(c,!0),h=fd.containsRTL(c,d,!0),f=S$(new X1(!1,!0,c,!1,d,h,0,u,[],e,0,0,0,0,-1,"none",!1,!1,null));r=r.concat(f.html),r.push("<br/>")}return r.join("")}function Kut(i,e,n,r){let s=[],o=n.getInitialState();for(let a=0,l=i.length;a<l;a++){const c=i[a],u=n.tokenizeEncoded(c,!0,o);ko.convertToEndOffset(u.tokens,c.length);const d=new ko(u.tokens,c,r),h=fd.isBasicASCII(c,!0),f=fd.containsRTL(c,h,!0),p=S$(new X1(!1,!0,c,!1,h,f,0,d.inflate(),[],e,0,0,0,0,-1,"none",!1,!1,null));s=s.concat(p.html),s.push("<br/>"),o=u.endState}return s.join("")}const ige=2e4;let KC,d8,xJ,h8,kJ;function Gut(i){KC=document.createElement("div"),KC.className="monaco-aria-container";const e=()=>{const r=document.createElement("div");return r.className="monaco-alert",r.setAttribute("role","alert"),r.setAttribute("aria-atomic","true"),KC.appendChild(r),r};d8=e(),xJ=e();const n=()=>{const r=document.createElement("div");return r.className="monaco-status",r.setAttribute("aria-live","polite"),r.setAttribute("aria-atomic","true"),KC.appendChild(r),r};h8=n(),kJ=n(),i.appendChild(KC)}function Ua(i){KC&&(d8.textContent!==i?(la(xJ),J9(d8,i)):(la(d8),J9(xJ,i)))}function v1(i){KC&&(h8.textContent!==i?(la(kJ),J9(h8,i)):(la(h8),J9(kJ,i)))}function J9(i,e){la(i),e.length>ige&&(e=e.substr(0,ige)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}const hoe=qn("markerDecorationsService");var Xut=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Yut=function(i,e){return function(n,r){e(n,r,i)}};let CP=class{constructor(e,n){}dispose(){}};CP.ID="editor.contrib.markerDecorations";CP=Xut([Yut(1,hoe)],CP);_i(CP.ID,CP,0);class lIe extends Le{constructor(e,n){super(),this._onDidChange=this._register(new _e),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,n)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const n=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let r=!1,s=!1;const o=()=>{if(r&&!s)try{r=!1,s=!0,n()}finally{requestAnimationFrame(()=>{s=!1,o()})}};this._resizeObserver=new ResizeObserver(a=>{e=a&&a[0]&&a[0].contentRect?a[0].contentRect:null,r=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,n){let r=0,s=0;n?(r=n.width,s=n.height):this._referenceDomElement&&(r=this._referenceDomElement.clientWidth,s=this._referenceDomElement.clientHeight),r=Math.max(5,r),s=Math.max(5,s),(this._width!==r||this._height!==s)&&(this._width=r,this._height=s,e&&this._onDidChange.fire())}}class Vy{constructor(e,n){this.key=e,this.migrate=n}apply(e){const n=Vy._read(e,this.key),r=o=>Vy._read(e,o),s=(o,a)=>Vy._write(e,o,a);this.migrate(n,r,s)}static _read(e,n){if(typeof e>"u")return;const r=n.indexOf(".");if(r>=0){const s=n.substring(0,r);return this._read(e[s],n.substring(r+1))}return e[n]}static _write(e,n,r){const s=n.indexOf(".");if(s>=0){const o=n.substring(0,s);e[o]=e[o]||{},this._write(e[o],n.substring(s+1),r);return}e[n]=r}}Vy.items=[];function Y1(i,e){Vy.items.push(new Vy(i,e))}function Sh(i,e){Y1(i,(n,r,s)=>{if(typeof n<"u"){for(const[o,a]of e)if(n===o){s(i,a);return}}})}function Zut(i){Vy.items.forEach(e=>e.apply(i))}Sh("wordWrap",[[!0,"on"],[!1,"off"]]);Sh("lineNumbers",[[!0,"on"],[!1,"off"]]);Sh("cursorBlinking",[["visible","solid"]]);Sh("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Sh("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Sh("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Sh("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Sh("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Sh("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Sh("autoIndent",[[!1,"advanced"],[!0,"full"]]);Sh("matchBrackets",[[!0,"always"],[!1,"never"]]);Sh("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Sh("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Y1("autoClosingBrackets",(i,e,n)=>{i===!1&&(n("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&n("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&n("autoSurround","never"))});Y1("renderIndentGuides",(i,e,n)=>{typeof i<"u"&&(n("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&n("guides.indentation",!!i))});Y1("highlightActiveIndentGuide",(i,e,n)=>{typeof i<"u"&&(n("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&n("guides.highlightActiveIndentation",!!i))});const Qut={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};Y1("suggest.filteredTypes",(i,e,n)=>{if(i&&typeof i=="object"){for(const r of Object.entries(Qut))i[r[0]]===!1&&typeof e(`suggest.${r[1]}`)>"u"&&n(`suggest.${r[1]}`,!1);n("suggest.filteredTypes",void 0)}});Y1("quickSuggestions",(i,e,n)=>{if(typeof i=="boolean"){const r=i?"on":"off";n("quickSuggestions",{comments:r,strings:r,other:r})}});Y1("experimental.stickyScroll.enabled",(i,e,n)=>{typeof i=="boolean"&&(n("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&n("stickyScroll.enabled",i))});Y1("experimental.stickyScroll.maxLineCount",(i,e,n)=>{typeof i=="number"&&(n("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&n("stickyScroll.maxLineCount",i))});class Jut{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new _e,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const BE=new Jut,zv=qn("accessibilityService"),R5=new yt("accessibilityModeEnabled",!1);var edt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},tdt=function(i,e){return function(n,r){e(n,r,i)}};let LJ=class extends Le{constructor(e,n,r,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new _e),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new _e),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new T2e,this.isSimpleWidget=e,this._containerObserver=this._register(new lIe(r,n.dimension)),this._rawOptions=rge(n),this._validatedOptions=ly.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(eh.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(BE.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(nJ.onDidChange(()=>this._recomputeOptions())),this._register(lP.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),n=ly.checkEquals(this.options,e);n!==null&&(this.options=e,this._onDidChangeFast.fire(n),this._onDidChange.fire(n))}_computeOptions(){const e=this._readEnvConfiguration(),n=NS.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),r=this._readFontInfo(n),s={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:r,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:BE.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return ly.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:idt(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:QW||gh,pixelRatio:lP.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return nJ.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const n=rge(e);ly.applyUpdate(this._rawOptions,n)&&(this._validatedOptions=ly.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const n=ndt(e);this._lineNumbersDigitCount!==n&&(this._lineNumbersDigitCount=n,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};LJ=edt([tdt(3,zv)],LJ);function ndt(i){let e=0;for(;i;)i=Math.floor(i/10),e++;return e||1}function idt(){let i="";return!h1&&!nEe&&(i+="no-user-select "),h1&&(i+="no-minimap-shadow ",i+="enable-user-select "),ri&&(i+="mac "),i}class rdt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,n){this._values[e]=n}}class sdt{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,n){this._values[e]=n}}class ly{static validateOptions(e){const n=new rdt;for(const r of t2){const s=r.name==="_never_"?void 0:e[r.name];n._write(r.id,r.validate(s))}return n}static computeOptions(e,n){const r=new sdt;for(const s of t2)r._write(s.id,s.compute(n,r,e._read(s.id)));return r}static _deepEquals(e,n){if(typeof e!="object"||typeof n!="object"||!e||!n)return e===n;if(Array.isArray(e)||Array.isArray(n))return Array.isArray(e)&&Array.isArray(n)?ys(e,n):!1;if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(!ly._deepEquals(e[r],n[r]))return!1;return!0}static checkEquals(e,n){const r=[];let s=!1;for(const o of t2){const a=!ly._deepEquals(e._read(o.id),n._read(o.id));r[o.id]=a,a&&(s=!0)}return s?new I2e(r):null}static applyUpdate(e,n){let r=!1;for(const s of t2)if(n.hasOwnProperty(s.name)){const o=s.applyUpdate(e[s.name],n[s.name]);e[s.name]=o.newValue,r=r||o.didChange}return r}}function rge(i){const e=T0(i);return Zut(e),e}function Ms(i,e,n){let r=null,s=null;if(typeof n.value=="function"?(r="value",s=n.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",s=n.get),!s)throw new Error("not supported");const o=`$memoize$${e}`;n[r]=function(...a){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,a)}),this[o]}}var odt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},lr;(function(i){i.Tap="-monaco-gesturetap",i.Change="-monaco-gesturechange",i.Start="-monaco-gesturestart",i.End="-monaco-gesturesend",i.Contextmenu="-monaco-gesturecontextmenu"})(lr||(lr={}));class or extends Le{constructor(){super(),this.dispatched=!1,this.targets=new jl,this.ignoreTargets=new jl,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Be(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(Be(document,"touchend",e=>this.onTouchEnd(e))),this._register(Be(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!or.isTouchDevice())return Le.None;or.INSTANCE||(or.INSTANCE=new or);const n=or.INSTANCE.targets.push(e);return gn(n)}static ignoreTarget(e){if(!or.isTouchDevice())return Le.None;or.INSTANCE||(or.INSTANCE=new or);const n=or.INSTANCE.ignoreTargets.push(e);return gn(n)}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,s=e.targetTouches.length;r<s;r++){const o=e.targetTouches.item(r);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:n,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[n],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};const a=this.newGestureEvent(lr.Start,o.target);a.pageX=o.pageX,a.pageY=o.pageY,this.dispatchEvent(a)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e){const n=Date.now(),r=Object.keys(this.activeTouches).length;for(let s=0,o=e.changedTouches.length;s<o;s++){const a=e.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}const l=this.activeTouches[a.identifier],c=Date.now()-l.initialTimeStamp;if(c<or.HOLD_DELAY&&Math.abs(l.initialPageX-Pd(l.rollingPageX))<30&&Math.abs(l.initialPageY-Pd(l.rollingPageY))<30){const u=this.newGestureEvent(lr.Tap,l.initialTarget);u.pageX=Pd(l.rollingPageX),u.pageY=Pd(l.rollingPageY),this.dispatchEvent(u)}else if(c>=or.HOLD_DELAY&&Math.abs(l.initialPageX-Pd(l.rollingPageX))<30&&Math.abs(l.initialPageY-Pd(l.rollingPageY))<30){const u=this.newGestureEvent(lr.Contextmenu,l.initialTarget);u.pageX=Pd(l.rollingPageX),u.pageY=Pd(l.rollingPageY),this.dispatchEvent(u)}else if(r===1){const u=Pd(l.rollingPageX),d=Pd(l.rollingPageY),h=Pd(l.rollingTimestamps)-l.rollingTimestamps[0],f=u-l.rollingPageX[0],p=d-l.rollingPageY[0],g=[...this.targets].filter(m=>l.initialTarget instanceof Node&&m.contains(l.initialTarget));this.inertia(g,n,Math.abs(f)/h,f>0?1:-1,u,Math.abs(p)/h,p>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(lr.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,n){const r=document.createEvent("CustomEvent");return r.initEvent(e,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(e){if(e.type===lr.Tap){const n=new Date().getTime();let r=0;n-this._lastSetTapCountTime>or.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,e.tapCount=r}else(e.type===lr.Change||e.type===lr.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const n of this.ignoreTargets)if(n.contains(e.initialTarget))return;for(const n of this.targets)n.contains(e.initialTarget)&&(n.dispatchEvent(e),this.dispatched=!0)}}inertia(e,n,r,s,o,a,l,c){this.handle=mh(()=>{const u=Date.now(),d=u-n;let h=0,f=0,p=!0;r+=or.SCROLL_FRICTION*d,a+=or.SCROLL_FRICTION*d,r>0&&(p=!1,h=s*r*d),a>0&&(p=!1,f=l*a*d);const g=this.newGestureEvent(lr.Change);g.translationX=h,g.translationY=f,e.forEach(m=>m.dispatchEvent(g)),p||this.inertia(e,u,r,s,o+h,a,l,c+f)})}onTouchMove(e){const n=Date.now();for(let r=0,s=e.changedTouches.length;r<s;r++){const o=e.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}const a=this.activeTouches[o.identifier],l=this.newGestureEvent(lr.Change,a.initialTarget);l.translationX=o.pageX-Pd(a.rollingPageX),l.translationY=o.pageY-Pd(a.rollingPageY),l.pageX=o.pageX,l.pageY=o.pageY,this.dispatchEvent(l),a.rollingPageX.length>3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(o.pageX),a.rollingPageY.push(o.pageY),a.rollingTimestamps.push(n)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}or.SCROLL_FRICTION=-.005;or.HOLD_DELAY=700;or.CLEAR_TAP_COUNT_TIME=400;odt([Ms],or,"isTouchDevice",null);class $I{constructor(){this._hooks=new Xe,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,n){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(n)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,n,r,s,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=o;let a=e;try{e.setPointerCapture(n),this._hooks.add(gn(()=>{try{e.releasePointerCapture(n)}catch{}}))}catch{a=window}this._hooks.add(Be(a,ht.POINTER_MOVE,l=>{if(l.buttons!==r){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Be(a,ht.POINTER_UP,l=>this.stopMonitoring(!0)))}}function foe(i){return`--vscode-${i.replace(/\./g,"-")}`}function wt(i){return`var(${foe(i)})`}function adt(i,e){return`var(${foe(i)}, ${e})`}const cIe={ColorContribution:"base.contributions.colors"};class ldt{constructor(){this._onDidChangeSchema=new _e,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,n,r,s=!1,o){const a={id:e,description:r,defaults:n,needsTransparency:s,deprecationMessage:o};this.colorsById[e]=a;const l={type:"string",description:r,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(l.deprecationMessage=o),this.colorSchema.properties[e]=l,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(r),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,n){const r=this.colorsById[e];if(r&&r.defaults){const s=r.defaults[n.type];return cp(s,n)}}getColorSchema(){return this.colorSchema}toString(){const e=(n,r)=>{const s=n.indexOf(".")===-1?0:1,o=r.indexOf(".")===-1?0:1;return s!==o?s-o:n.localeCompare(r)};return Object.keys(this.colorsById).sort(e).map(n=>`- \`${n}\`: ${this.colorsById[n].description}`).join(`
`)}}const x$=new ldt;Kr.add(cIe.ColorContribution,x$);function ce(i,e,n,r,s){return x$.registerColor(i,e,n,r,s)}const ot=ce("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},L("foreground","Overall foreground color. This color is only used if not overridden by a component."));ce("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},L("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const cdt=ce("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},L("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));ce("descriptionForeground",{light:"#717171",dark:Ht(ot,.7),hcDark:Ht(ot,.7),hcLight:Ht(ot,.7)},L("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const _y=ce("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},L("iconForeground","The default color for icons in the workbench.")),Qu=ce("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},L("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Jn=ce("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},L("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Dr=ce("contrastActiveBorder",{light:null,dark:null,hcDark:Qu,hcLight:Qu},L("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));ce("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},L("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));ce("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:Te.black,hcLight:"#292929"},L("textSeparatorForeground","Color for text separators."));const udt=ce("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},L("textLinkForeground","Foreground color for links in text."));ce("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},L("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));ce("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},L("textPreformatForeground","Foreground color for preformatted text segments."));ce("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},L("textBlockQuoteBackground","Background color for block quotes in text."));ce("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:Te.white,hcLight:"#292929"},L("textBlockQuoteBorder","Border color for block quotes in text."));ce("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:Te.black,hcLight:"#F2F2F2"},L("textCodeBlockBackground","Background color for code blocks in text."));const bm=ce("widget.shadow",{dark:Ht(Te.black,.36),light:Ht(Te.black,.16),hcDark:null,hcLight:null},L("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),poe=ce("widget.border",{dark:null,light:null,hcDark:Jn,hcLight:Jn},L("widgetBorder","Border color of widgets such as find/replace inside the editor.")),uIe=ce("input.background",{dark:"#3C3C3C",light:Te.white,hcDark:Te.black,hcLight:Te.white},L("inputBoxBackground","Input box background.")),dIe=ce("input.foreground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("inputBoxForeground","Input box foreground.")),hIe=ce("input.border",{dark:null,light:null,hcDark:Jn,hcLight:Jn},L("inputBoxBorder","Input box border.")),goe=ce("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Jn,hcLight:Jn},L("inputBoxActiveOptionBorder","Border color of activated options in input fields."));ce("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},L("inputOption.hoverBackground","Background color of activated options in input fields."));const mS=ce("inputOption.activeBackground",{dark:Ht(Qu,.4),light:Ht(Qu,.2),hcDark:Te.transparent,hcLight:Te.transparent},L("inputOption.activeBackground","Background hover color of options in input fields.")),moe=ce("inputOption.activeForeground",{dark:Te.white,light:Te.black,hcDark:ot,hcLight:ot},L("inputOption.activeForeground","Foreground color of activated options in input fields."));ce("input.placeholderForeground",{light:Ht(ot,.5),dark:Ht(ot,.5),hcDark:Ht(ot,.7),hcLight:Ht(ot,.7)},L("inputPlaceholderForeground","Input box foreground color for placeholder text."));const ddt=ce("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:Te.black,hcLight:Te.white},L("inputValidationInfoBackground","Input validation background color for information severity.")),hdt=ce("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:ot},L("inputValidationInfoForeground","Input validation foreground color for information severity.")),fdt=ce("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Jn,hcLight:Jn},L("inputValidationInfoBorder","Input validation border color for information severity.")),pdt=ce("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:Te.black,hcLight:Te.white},L("inputValidationWarningBackground","Input validation background color for warning severity.")),gdt=ce("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:ot},L("inputValidationWarningForeground","Input validation foreground color for warning severity.")),mdt=ce("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Jn,hcLight:Jn},L("inputValidationWarningBorder","Input validation border color for warning severity.")),_dt=ce("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:Te.black,hcLight:Te.white},L("inputValidationErrorBackground","Input validation background color for error severity.")),vdt=ce("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:ot},L("inputValidationErrorForeground","Input validation foreground color for error severity.")),bdt=ce("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Jn,hcLight:Jn},L("inputValidationErrorBorder","Input validation border color for error severity.")),ym=ce("dropdown.background",{dark:"#3C3C3C",light:Te.white,hcDark:Te.black,hcLight:Te.white},L("dropdownBackground","Dropdown background.")),ydt=ce("dropdown.listBackground",{dark:null,light:null,hcDark:Te.black,hcLight:Te.white},L("dropdownListBackground","Dropdown list background.")),J0=ce("dropdown.foreground",{dark:"#F0F0F0",light:ot,hcDark:Te.white,hcLight:ot},L("dropdownForeground","Dropdown foreground.")),a2=ce("dropdown.border",{dark:ym,light:"#CECECE",hcDark:Jn,hcLight:Jn},L("dropdownBorder","Dropdown border.")),aN=ce("button.foreground",{dark:Te.white,light:Te.white,hcDark:Te.white,hcLight:Te.white},L("buttonForeground","Button foreground color.")),wdt=ce("button.separator",{dark:Ht(aN,.4),light:Ht(aN,.4),hcDark:Ht(aN,.4),hcLight:Ht(aN,.4)},L("buttonSeparator","Button separator color.")),lN=ce("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},L("buttonBackground","Button background color.")),Cdt=ce("button.hoverBackground",{dark:zp(lN,.2),light:Yx(lN,.2),hcDark:lN,hcLight:lN},L("buttonHoverBackground","Button background color when hovering.")),Sdt=ce("button.border",{dark:Jn,light:Jn,hcDark:Jn,hcLight:Jn},L("buttonBorder","Button border color.")),xdt=ce("button.secondaryForeground",{dark:Te.white,light:Te.white,hcDark:Te.white,hcLight:ot},L("buttonSecondaryForeground","Secondary button foreground color.")),DJ=ce("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:Te.white},L("buttonSecondaryBackground","Secondary button background color.")),kdt=ce("button.secondaryHoverBackground",{dark:zp(DJ,.2),light:Yx(DJ,.2),hcDark:null,hcLight:null},L("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),f8=ce("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:Te.black,hcLight:"#0F4A85"},L("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Ldt=ce("badge.foreground",{dark:Te.white,light:"#333",hcDark:Te.white,hcLight:Te.white},L("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Ddt=ce("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},L("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),cN=ce("scrollbarSlider.background",{dark:Te.fromHex("#797979").transparent(.4),light:Te.fromHex("#646464").transparent(.4),hcDark:Ht(Jn,.6),hcLight:Ht(Jn,.4)},L("scrollbarSliderBackground","Scrollbar slider background color.")),uN=ce("scrollbarSlider.hoverBackground",{dark:Te.fromHex("#646464").transparent(.7),light:Te.fromHex("#646464").transparent(.7),hcDark:Ht(Jn,.8),hcLight:Ht(Jn,.8)},L("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),dN=ce("scrollbarSlider.activeBackground",{dark:Te.fromHex("#BFBFBF").transparent(.4),light:Te.fromHex("#000000").transparent(.6),hcDark:Jn,hcLight:Jn},L("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),Edt=ce("progressBar.background",{dark:Te.fromHex("#0E70C0"),light:Te.fromHex("#0E70C0"),hcDark:Jn,hcLight:Jn},L("progressBarBackground","Background color of the progress bar that can show for long running operations."));ce("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},L("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const wm=ce("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},L("editorError.foreground","Foreground color of error squigglies in the editor.")),Idt=ce("editorError.border",{dark:null,light:null,hcDark:Te.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},L("errorBorder","If set, color of double underlines for errors in the editor."));ce("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},L("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Ju=ce("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},L("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),SP=ce("editorWarning.border",{dark:null,light:null,hcDark:Te.fromHex("#FFCC00").transparent(.8),hcLight:Te.fromHex("#FFCC00").transparent(.8)},L("warningBorder","If set, color of double underlines for warnings in the editor."));ce("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},L("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const _c=ce("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},L("editorInfo.foreground","Foreground color of info squigglies in the editor.")),xP=ce("editorInfo.border",{dark:null,light:null,hcDark:Te.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},L("infoBorder","If set, color of double underlines for infos in the editor.")),Tdt=ce("editorHint.foreground",{dark:Te.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},L("editorHint.foreground","Foreground color of hint squigglies in the editor."));ce("editorHint.border",{dark:null,light:null,hcDark:Te.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},L("hintBorder","If set, color of double underlines for hints in the editor."));ce("sash.hoverBorder",{dark:Qu,light:Qu,hcDark:Qu,hcLight:Qu},L("sashActiveBorder","Border color of active sashes."));const Lo=ce("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:Te.black,hcLight:Te.white},L("editorBackground","Editor background color.")),_f=ce("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:Te.white,hcLight:ot},L("editorForeground","Editor default foreground color."));ce("editorStickyScroll.background",{light:Lo,dark:Lo,hcDark:Lo,hcLight:Lo},L("editorStickyScrollBackground","Sticky scroll background color for the editor"));ce("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:Te.fromHex("#0F4A85").transparent(.1)},L("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const cs=ce("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:Te.white},L("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Cm=ce("editorWidget.foreground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Sm=ce("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Jn,hcLight:Jn},L("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),Rdt=ce("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},L("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),sge=ce("quickInput.background",{dark:cs,light:cs,hcDark:cs,hcLight:cs},L("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Adt=ce("quickInput.foreground",{dark:Cm,light:Cm,hcDark:Cm,hcLight:Cm},L("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Ndt=ce("quickInputTitle.background",{dark:new Te(new ii(255,255,255,.105)),light:new Te(new ii(0,0,0,.06)),hcDark:"#000000",hcLight:Te.white},L("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),fIe=ce("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:Te.white,hcLight:"#0F4A85"},L("pickerGroupForeground","Quick picker color for grouping labels.")),Mdt=ce("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:Te.white,hcLight:"#0F4A85"},L("pickerGroupBorder","Quick picker color for grouping borders.")),Pdt=ce("keybindingLabel.background",{dark:new Te(new ii(128,128,128,.17)),light:new Te(new ii(221,221,221,.4)),hcDark:Te.transparent,hcLight:Te.transparent},L("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Odt=ce("keybindingLabel.foreground",{dark:Te.fromHex("#CCCCCC"),light:Te.fromHex("#555555"),hcDark:Te.white,hcLight:ot},L("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Fdt=ce("keybindingLabel.border",{dark:new Te(new ii(51,51,51,.6)),light:new Te(new ii(204,204,204,.4)),hcDark:new Te(new ii(111,195,223)),hcLight:Jn},L("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Bdt=ce("keybindingLabel.bottomBorder",{dark:new Te(new ii(68,68,68,.6)),light:new Te(new ii(187,187,187,.4)),hcDark:new Te(new ii(111,195,223)),hcLight:ot},L("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),vy=ce("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},L("editorSelectionBackground","Color of the editor selection.")),jdt=ce("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:Te.white},L("editorSelectionForeground","Color of the selected text for high contrast.")),pIe=ce("editor.inactiveSelectionBackground",{light:Ht(vy,.5),dark:Ht(vy,.5),hcDark:Ht(vy,.7),hcLight:Ht(vy,.5)},L("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),_oe=ce("editor.selectionHighlightBackground",{light:hge(vy,Lo,.3,.6),dark:hge(vy,Lo,.3,.6),hcDark:null,hcLight:null},L("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);ce("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Dr,hcLight:Dr},L("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const Wdt=ce("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},L("editorFindMatch","Color of the current search match.")),xm=ce("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},L("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),$dt=ce("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},L("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),zdt=ce("editor.findMatchBorder",{light:null,dark:null,hcDark:Dr,hcLight:Dr},L("editorFindMatchBorder","Border color of the current search match.")),by=ce("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Dr,hcLight:Dr},L("findMatchHighlightBorder","Border color of the other search matches.")),Vdt=ce("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Ht(Dr,.4),hcLight:Ht(Dr,.4)},L("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);ce("searchEditor.findMatchBackground",{light:Ht(xm,.66),dark:Ht(xm,.66),hcDark:xm,hcLight:xm},L("searchEditor.queryMatch","Color of the Search Editor query matches."));ce("searchEditor.findMatchBorder",{light:Ht(by,.66),dark:Ht(by,.66),hcDark:by,hcLight:by},L("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));ce("search.resultsInfoForeground",{light:ot,dark:Ht(ot,.65),hcDark:ot,hcLight:ot},L("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));ce("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},L("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const e7=ce("editorHoverWidget.background",{light:cs,dark:cs,hcDark:cs,hcLight:cs},L("hoverBackground","Background color of the editor hover."));ce("editorHoverWidget.foreground",{light:Cm,dark:Cm,hcDark:Cm,hcLight:Cm},L("hoverForeground","Foreground color of the editor hover."));const Hdt=ce("editorHoverWidget.border",{light:Sm,dark:Sm,hcDark:Sm,hcLight:Sm},L("hoverBorder","Border color of the editor hover."));ce("editorHoverWidget.statusBarBackground",{dark:zp(e7,.2),light:Yx(e7,.05),hcDark:cs,hcLight:cs},L("statusBarBackground","Background color of the editor hover status bar."));const Udt=ce("editorLink.activeForeground",{dark:"#4E94CE",light:Te.blue,hcDark:Te.cyan,hcLight:"#292929"},L("activeLinkForeground","Color of active links.")),ev=ce("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:Te.white,hcLight:Te.black},L("editorInlayHintForeground","Foreground color of inline hints")),tv=ce("editorInlayHint.background",{dark:Ht(f8,.1),light:Ht(f8,.1),hcDark:Ht(Te.white,.1),hcLight:Ht(f8,.1)},L("editorInlayHintBackground","Background color of inline hints")),qdt=ce("editorInlayHint.typeForeground",{dark:ev,light:ev,hcDark:ev,hcLight:ev},L("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Kdt=ce("editorInlayHint.typeBackground",{dark:tv,light:tv,hcDark:tv,hcLight:tv},L("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Gdt=ce("editorInlayHint.parameterForeground",{dark:ev,light:ev,hcDark:ev,hcLight:ev},L("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Xdt=ce("editorInlayHint.parameterBackground",{dark:tv,light:tv,hcDark:tv,hcLight:tv},L("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));ce("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},L("editorLightBulbForeground","The color used for the lightbulb actions icon."));ce("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},L("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const EJ=new Te(new ii(155,185,85,.2)),IJ=new Te(new ii(255,0,0,.2)),Ydt=ce("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},L("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Zdt=ce("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},L("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);ce("diffEditor.insertedLineBackground",{dark:EJ,light:EJ,hcDark:null,hcLight:null},L("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);ce("diffEditor.removedLineBackground",{dark:IJ,light:IJ,hcDark:null,hcLight:null},L("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);ce("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},L("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));ce("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},L("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const Qdt=ce("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},L("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Jdt=ce("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},L("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));ce("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},L("diffEditorInsertedOutline","Outline color for the text that got inserted."));ce("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},L("diffEditorRemovedOutline","Outline color for text that got removed."));ce("diffEditor.border",{dark:null,light:null,hcDark:Jn,hcLight:Jn},L("diffEditorBorder","Border color between the two text editors."));ce("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},L("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));ce("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},L("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));ce("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},L("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));ce("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},L("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const eht=ce("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},L("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),tht=ce("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},L("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),nht=ce("list.focusOutline",{dark:Qu,light:Qu,hcDark:Dr,hcLight:Dr},L("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),iht=ce("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},L("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),nv=ce("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:Te.fromHex("#0F4A85").transparent(.1)},L("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),km=ce("list.activeSelectionForeground",{dark:Te.white,light:Te.white,hcDark:null,hcLight:null},L("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),hN=ce("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},L("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),rht=ce("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:Te.fromHex("#0F4A85").transparent(.1)},L("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),sht=ce("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},L("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),oht=ce("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},L("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),aht=ce("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},L("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),lht=ce("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},L("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),gIe=ce("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:Te.white.transparent(.1),hcLight:Te.fromHex("#0F4A85").transparent(.1)},L("listHoverBackground","List/Tree background when hovering over items using the mouse.")),mIe=ce("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},L("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),cht=ce("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},L("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),vf=ce("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Qu,hcLight:Qu},L("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),H3=ce("list.focusHighlightForeground",{dark:vf,light:jht(nv,vf,"#BBE7FF"),hcDark:vf,hcLight:vf},L("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));ce("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},L("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));ce("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},L("listErrorForeground","Foreground color of list items containing errors."));ce("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},L("listWarningForeground","Foreground color of list items containing warnings."));const uht=ce("listFilterWidget.background",{light:Yx(cs,0),dark:zp(cs,0),hcDark:cs,hcLight:cs},L("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),dht=ce("listFilterWidget.outline",{dark:Te.transparent,light:Te.transparent,hcDark:"#f38518",hcLight:"#007ACC"},L("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),hht=ce("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Jn,hcLight:Jn},L("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),fht=ce("listFilterWidget.shadow",{dark:bm,light:bm,hcDark:bm,hcLight:bm},L("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));ce("list.filterMatchBackground",{dark:xm,light:xm,hcDark:null,hcLight:null},L("listFilterMatchHighlight","Background color of the filtered match."));ce("list.filterMatchBorder",{dark:by,light:by,hcDark:Jn,hcLight:Dr},L("listFilterMatchHighlightBorder","Border color of the filtered match."));const fN=ce("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},L("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),pht=ce("tree.inactiveIndentGuidesStroke",{dark:Ht(fN,.4),light:Ht(fN,.4),hcDark:Ht(fN,.4),hcLight:Ht(fN,.4)},L("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),ght=ce("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},L("tableColumnsBorder","Table border color between columns.")),mht=ce("tree.tableOddRowsBackground",{dark:Ht(ot,.04),light:Ht(ot,.04),hcDark:null,hcLight:null},L("tableOddRowsBackgroundColor","Background color for odd table rows."));ce("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},L("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const _ht=ce("checkbox.background",{dark:ym,light:ym,hcDark:ym,hcLight:ym},L("checkbox.background","Background color of checkbox widget."));ce("checkbox.selectBackground",{dark:cs,light:cs,hcDark:cs,hcLight:cs},L("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const vht=ce("checkbox.foreground",{dark:J0,light:J0,hcDark:J0,hcLight:J0},L("checkbox.foreground","Foreground color of checkbox widget.")),bht=ce("checkbox.border",{dark:a2,light:a2,hcDark:a2,hcLight:a2},L("checkbox.border","Border color of checkbox widget."));ce("checkbox.selectBorder",{dark:_y,light:_y,hcDark:_y,hcLight:_y},L("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const oge=ce("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,L("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),_S=ce("quickInputList.focusForeground",{dark:km,light:km,hcDark:km,hcLight:km},L("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),l2=ce("quickInputList.focusIconForeground",{dark:hN,light:hN,hcDark:hN,hcLight:hN},L("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),vS=ce("quickInputList.focusBackground",{dark:kP(oge,nv),light:kP(oge,nv),hcDark:null,hcLight:null},L("quickInput.listFocusBackground","Quick picker background color for the focused item.")),yht=ce("menu.border",{dark:null,light:null,hcDark:Jn,hcLight:Jn},L("menuBorder","Border color of menus.")),wht=ce("menu.foreground",{dark:J0,light:J0,hcDark:J0,hcLight:J0},L("menuForeground","Foreground color of menu items.")),Cht=ce("menu.background",{dark:ym,light:ym,hcDark:ym,hcLight:ym},L("menuBackground","Background color of menu items.")),Sht=ce("menu.selectionForeground",{dark:km,light:km,hcDark:km,hcLight:km},L("menuSelectionForeground","Foreground color of the selected menu item in menus.")),xht=ce("menu.selectionBackground",{dark:nv,light:nv,hcDark:nv,hcLight:nv},L("menuSelectionBackground","Background color of the selected menu item in menus.")),kht=ce("menu.selectionBorder",{dark:null,light:null,hcDark:Dr,hcLight:Dr},L("menuSelectionBorder","Border color of the selected menu item in menus.")),Lht=ce("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Jn,hcLight:Jn},L("menuSeparatorBackground","Color of a separator menu item in menus.")),TJ=ce("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},L("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));ce("toolbar.hoverOutline",{dark:null,light:null,hcDark:Dr,hcLight:Dr},L("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));ce("toolbar.activeBackground",{dark:zp(TJ,.1),light:Yx(TJ,.1),hcDark:null,hcLight:null},L("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));ce("editor.snippetTabstopHighlightBackground",{dark:new Te(new ii(124,124,124,.3)),light:new Te(new ii(10,50,100,.2)),hcDark:new Te(new ii(124,124,124,.3)),hcLight:new Te(new ii(10,50,100,.2))},L("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));ce("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},L("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));ce("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},L("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));ce("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Te(new ii(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},L("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const Dht=ce("breadcrumb.foreground",{light:Ht(ot,.8),dark:Ht(ot,.8),hcDark:Ht(ot,.8),hcLight:Ht(ot,.8)},L("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Eht=ce("breadcrumb.background",{light:Lo,dark:Lo,hcDark:Lo,hcLight:Lo},L("breadcrumbsBackground","Background color of breadcrumb items.")),age=ce("breadcrumb.focusForeground",{light:Yx(ot,.2),dark:zp(ot,.1),hcDark:zp(ot,.1),hcLight:zp(ot,.1)},L("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Iht=ce("breadcrumb.activeSelectionForeground",{light:Yx(ot,.2),dark:zp(ot,.1),hcDark:zp(ot,.1),hcLight:zp(ot,.1)},L("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));ce("breadcrumbPicker.background",{light:cs,dark:cs,hcDark:cs,hcLight:cs},L("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const _Ie=.5,lge=Te.fromHex("#40C8AE").transparent(_Ie),cge=Te.fromHex("#40A6FF").transparent(_Ie),uge=Te.fromHex("#606060").transparent(.4),bf=.4,jE=1,c2=ce("merge.currentHeaderBackground",{dark:lge,light:lge,hcDark:null,hcLight:null},L("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);ce("merge.currentContentBackground",{dark:Ht(c2,bf),light:Ht(c2,bf),hcDark:Ht(c2,bf),hcLight:Ht(c2,bf)},L("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const u2=ce("merge.incomingHeaderBackground",{dark:cge,light:cge,hcDark:null,hcLight:null},L("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);ce("merge.incomingContentBackground",{dark:Ht(u2,bf),light:Ht(u2,bf),hcDark:Ht(u2,bf),hcLight:Ht(u2,bf)},L("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const d2=ce("merge.commonHeaderBackground",{dark:uge,light:uge,hcDark:null,hcLight:null},L("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);ce("merge.commonContentBackground",{dark:Ht(d2,bf),light:Ht(d2,bf),hcDark:Ht(d2,bf),hcLight:Ht(d2,bf)},L("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const WE=ce("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},L("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));ce("editorOverviewRuler.currentContentForeground",{dark:Ht(c2,jE),light:Ht(c2,jE),hcDark:WE,hcLight:WE},L("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));ce("editorOverviewRuler.incomingContentForeground",{dark:Ht(u2,jE),light:Ht(u2,jE),hcDark:WE,hcLight:WE},L("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));ce("editorOverviewRuler.commonContentForeground",{dark:Ht(d2,jE),light:Ht(d2,jE),hcDark:WE,hcLight:WE},L("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const voe=ce("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},L("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),pN=ce("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},L("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),h2=ce("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},L("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),k$=ce("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},L("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),dge=ce("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},L("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Tht=ce("minimap.infoHighlight",{dark:_c,light:_c,hcDark:xP,hcLight:xP},L("minimapInfo","Minimap marker color for infos.")),Rht=ce("minimap.warningHighlight",{dark:Ju,light:Ju,hcDark:SP,hcLight:SP},L("overviewRuleWarning","Minimap marker color for warnings.")),Aht=ce("minimap.errorHighlight",{dark:new Te(new ii(255,18,18,.7)),light:new Te(new ii(255,18,18,.7)),hcDark:new Te(new ii(255,50,50,1)),hcLight:"#B5200D"},L("minimapError","Minimap marker color for errors.")),Nht=ce("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},L("minimapBackground","Minimap background color.")),Mht=ce("minimap.foregroundOpacity",{dark:Te.fromHex("#000f"),light:Te.fromHex("#000f"),hcDark:Te.fromHex("#000f"),hcLight:Te.fromHex("#000f")},L("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));ce("minimapSlider.background",{light:Ht(cN,.5),dark:Ht(cN,.5),hcDark:Ht(cN,.5),hcLight:Ht(cN,.5)},L("minimapSliderBackground","Minimap slider background color."));ce("minimapSlider.hoverBackground",{light:Ht(uN,.5),dark:Ht(uN,.5),hcDark:Ht(uN,.5),hcLight:Ht(uN,.5)},L("minimapSliderHoverBackground","Minimap slider background color when hovering."));ce("minimapSlider.activeBackground",{light:Ht(dN,.5),dark:Ht(dN,.5),hcDark:Ht(dN,.5),hcLight:Ht(dN,.5)},L("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const Pht=ce("problemsErrorIcon.foreground",{dark:wm,light:wm,hcDark:wm,hcLight:wm},L("problemsErrorIconForeground","The color used for the problems error icon.")),Oht=ce("problemsWarningIcon.foreground",{dark:Ju,light:Ju,hcDark:Ju,hcLight:Ju},L("problemsWarningIconForeground","The color used for the problems warning icon.")),Fht=ce("problemsInfoIcon.foreground",{dark:_c,light:_c,hcDark:_c,hcLight:_c},L("problemsInfoIconForeground","The color used for the problems info icon."));ce("charts.foreground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("chartsForeground","The foreground color used in charts."));ce("charts.lines",{dark:Ht(ot,.5),light:Ht(ot,.5),hcDark:Ht(ot,.5),hcLight:Ht(ot,.5)},L("chartsLines","The color used for horizontal lines in charts."));ce("charts.red",{dark:wm,light:wm,hcDark:wm,hcLight:wm},L("chartsRed","The red color used in chart visualizations."));ce("charts.blue",{dark:_c,light:_c,hcDark:_c,hcLight:_c},L("chartsBlue","The blue color used in chart visualizations."));ce("charts.yellow",{dark:Ju,light:Ju,hcDark:Ju,hcLight:Ju},L("chartsYellow","The yellow color used in chart visualizations."));ce("charts.orange",{dark:h2,light:h2,hcDark:h2,hcLight:h2},L("chartsOrange","The orange color used in chart visualizations."));ce("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},L("chartsGreen","The green color used in chart visualizations."));ce("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},L("chartsPurple","The purple color used in chart visualizations."));function Bht(i,e){var n,r,s,o;switch(i.op){case 0:return(n=cp(i.value,e))===null||n===void 0?void 0:n.darken(i.factor);case 1:return(r=cp(i.value,e))===null||r===void 0?void 0:r.lighten(i.factor);case 2:return(s=cp(i.value,e))===null||s===void 0?void 0:s.transparent(i.factor);case 3:{const a=cp(i.background,e);return a?(o=cp(i.value,e))===null||o===void 0?void 0:o.makeOpaque(a):cp(i.value,e)}case 4:for(const a of i.values){const l=cp(a,e);if(l)return l}return;case 6:return cp(e.defines(i.if)?i.then:i.else,e);case 5:{const a=cp(i.value,e);if(!a)return;const l=cp(i.background,e);return l?a.isDarkerThan(l)?Te.getLighterColor(a,l,i.factor).transparent(i.transparency):Te.getDarkerColor(a,l,i.factor).transparent(i.transparency):a.transparent(i.factor*i.transparency)}default:throw l$()}}function Yx(i,e){return{op:0,value:i,factor:e}}function zp(i,e){return{op:1,value:i,factor:e}}function Ht(i,e){return{op:2,value:i,factor:e}}function kP(...i){return{op:4,values:i}}function jht(i,e,n){return{op:6,if:i,then:e,else:n}}function hge(i,e,n,r){return{op:5,value:i,background:e,factor:n,transparency:r}}function cp(i,e){if(i!==null){if(typeof i=="string")return i[0]==="#"?Te.fromHex(i):e.getColor(i);if(i instanceof Te)return i;if(typeof i=="object")return Bht(i,e)}}const vIe="vscode://schemas/workbench-colors",bIe=Kr.as(b$.JSONContribution);bIe.registerSchema(vIe,x$.getColorSchema());const fge=new Ji(()=>bIe.notifySchemaChanged(vIe),200);x$.onDidChangeSchema(()=>{fge.isScheduled()||fge.schedule()});class L${constructor(e,n){this.x=e,this.y=n,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new yIe(this.x-window.scrollX,this.y-window.scrollY)}}class yIe{constructor(e,n){this.clientX=e,this.clientY=n,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new L$(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class Wht{constructor(e,n,r,s){this.x=e,this.y=n,this.width=r,this.height=s,this._editorPagePositionBrand=void 0}}class $ht{constructor(e,n){this.x=e,this.y=n,this._positionRelativeToEditorBrand=void 0}}function boe(i){const e=no(i);return new Wht(e.left,e.top,e.width,e.height)}function yoe(i,e,n){const r=e.width/i.offsetWidth,s=e.height/i.offsetHeight,o=(n.x-e.x)/r,a=(n.y-e.y)/s;return new $ht(o,a)}class b1 extends rh{constructor(e,n,r){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=n,this.pos=new L$(this.posx,this.posy),this.editorPos=boe(r),this.relativePos=yoe(r,this.editorPos,this.pos)}}class zht{constructor(e){this._editorViewDomNode=e}_create(e){return new b1(e,!1,this._editorViewDomNode)}onContextMenu(e,n){return Be(e,"contextmenu",r=>{n(this._create(r))})}onMouseUp(e,n){return Be(e,"mouseup",r=>{n(this._create(r))})}onMouseDown(e,n){return Be(e,ht.MOUSE_DOWN,r=>{n(this._create(r))})}onPointerDown(e,n){return Be(e,ht.POINTER_DOWN,r=>{n(this._create(r),r.pointerId)})}onMouseLeave(e,n){return Be(e,ht.MOUSE_LEAVE,r=>{n(this._create(r))})}onMouseMove(e,n){return Be(e,"mousemove",r=>n(this._create(r)))}}class Vht{constructor(e){this._editorViewDomNode=e}_create(e){return new b1(e,!1,this._editorViewDomNode)}onPointerUp(e,n){return Be(e,"pointerup",r=>{n(this._create(r))})}onPointerDown(e,n){return Be(e,ht.POINTER_DOWN,r=>{n(this._create(r),r.pointerId)})}onPointerLeave(e,n){return Be(e,ht.POINTER_LEAVE,r=>{n(this._create(r))})}onPointerMove(e,n){return Be(e,"pointermove",r=>n(this._create(r)))}}class Hht extends Le{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new $I),this._keydownListener=null}startMonitoring(e,n,r,s,o){this._keydownListener=As(e.ownerDocument,"keydown",a=>{a.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,a.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,n,r,a=>{s(new b1(a,!0,this._editorViewDomNode))},a=>{this._keydownListener.dispose(),o(a)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class A5{constructor(e){this._editor=e,this._instanceId=++A5._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new Ji(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const n=this.getOrCreateRule(e);return n.increaseRefCount(),{className:n.className,dispose:()=>{n.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const n=this.computeUniqueKey(e);let r=this._rules.get(n);if(!r){const s=this._counter++;r=new Uht(n,`dyn-rule-${this._instanceId}-${s}`,$9(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(n,r)}return r}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}A5._idPool=0;class Uht{constructor(e,n,r,s){this.key=e,this.className=n,this.properties=s,this._referenceCount=0,this._styleElement=_h(r),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,n){let r=`.${e} {`;for(const s in n){const o=n[s];let a;typeof o=="object"?a=wt(o.id):a=o;const l=qht(s);r+=`
${l}: ${a};`}return r+=`
}`,r}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function qht(i){return i.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class N5 extends Le{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let n=!1;for(let r=0,s=e.length;r<s;r++){const o=e[r];switch(o.type){case 0:this.onCompositionStart(o)&&(n=!0);break;case 1:this.onCompositionEnd(o)&&(n=!0);break;case 2:this.onConfigurationChanged(o)&&(n=!0);break;case 3:this.onCursorStateChanged(o)&&(n=!0);break;case 4:this.onDecorationsChanged(o)&&(n=!0);break;case 5:this.onFlushed(o)&&(n=!0);break;case 6:this.onFocusChanged(o)&&(n=!0);break;case 7:this.onLanguageConfigurationChanged(o)&&(n=!0);break;case 8:this.onLineMappingChanged(o)&&(n=!0);break;case 9:this.onLinesChanged(o)&&(n=!0);break;case 10:this.onLinesDeleted(o)&&(n=!0);break;case 11:this.onLinesInserted(o)&&(n=!0);break;case 12:this.onRevealRangeRequest(o)&&(n=!0);break;case 13:this.onScrollChanged(o)&&(n=!0);break;case 15:this.onTokensChanged(o)&&(n=!0);break;case 14:this.onThemeChanged(o)&&(n=!0);break;case 16:this.onTokensColorsChanged(o)&&(n=!0);break;case 17:this.onZonesChanged(o)&&(n=!0);break;default:console.info("View received unknown event: "),console.info(o)}}n&&(this._shouldRender=!0)}}class hu extends N5{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class Ym{static write(e,n){e.setAttribute("data-mprt",String(n))}static read(e){const n=e.getAttribute("data-mprt");return n===null?0:parseInt(n,10)}static collect(e,n){const r=[];let s=0;for(;e&&e!==e.ownerDocument.body&&e!==n;)e.nodeType===e.ELEMENT_NODE&&(r[s++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(s);for(let a=0;a<s;a++)o[a]=r[s-a-1];return o}}class Kht{constructor(e,n){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=n,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const r=this._viewLayout.getCurrentViewport();this.scrollTop=r.top,this.scrollLeft=r.left,this.viewportWidth=r.width,this.viewportHeight=r.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,n){return this._viewLayout.getVerticalOffsetForLineNumber(e,n)}getVerticalOffsetAfterLineNumber(e,n){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,n)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class Ght extends Kht{constructor(e,n,r){super(e,n),this._renderingContextBrand=void 0,this._viewLines=r}linesVisibleRangesForRange(e,n){return this._viewLines.linesVisibleRangesForRange(e,n)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class Xht{constructor(e,n,r,s){this.outsideRenderedLine=e,this.lineNumber=n,this.ranges=r,this.continuesOnNextLine=s}}class D${static from(e){const n=new Array(e.length);for(let r=0,s=e.length;r<s;r++){const o=e[r];n[r]=new D$(o.left,o.width)}return n}constructor(e,n){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(n)}toString(){return`[${this.left},${this.width}]`}}class PS{constructor(e,n){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=n}toString(){return`[${this.left},${this.width}]`}static compare(e,n){return e.left-n.left}}class Yht{constructor(e,n){this.outsideRenderedLine=e,this.originalLeft=n,this.left=Math.round(this.originalLeft)}}class pge{constructor(e,n){this.outsideRenderedLine=e,this.ranges=n}}class p8{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,n){e.selectNodeContents(n)}static _readClientRects(e,n,r,s,o){const a=this._createRange();try{return a.setStart(e,n),a.setEnd(r,s),a.getClientRects()}catch{return null}finally{this._detachRange(a,o)}}static _mergeAdjacentRanges(e){if(e.length===1)return e;e.sort(PS.compare);const n=[];let r=0,s=e[0];for(let o=1,a=e.length;o<a;o++){const l=e[o];s.left+s.width+.9>=l.left?s.width=Math.max(s.width,l.left+l.width-s.left):(n[r++]=s,s=l)}return n[r++]=s,n}static _createHorizontalRangesFromClientRects(e,n,r){if(!e||e.length===0)return null;const s=[];for(let o=0,a=e.length;o<a;o++){const l=e[o];s[o]=new PS(Math.max(0,(l.left-n)/r),l.width/r)}return this._mergeAdjacentRanges(s)}static readHorizontalRanges(e,n,r,s,o,a){const c=e.children.length-1;if(0>c)return null;if(n=Math.min(c,Math.max(0,n)),s=Math.min(c,Math.max(0,s)),n===s&&r===o&&r===0&&!e.children[n].firstChild){const f=e.children[n].getClientRects();return a.markDidDomLayout(),this._createHorizontalRangesFromClientRects(f,a.clientRectDeltaLeft,a.clientRectScale)}n!==s&&s>0&&o===0&&(s--,o=1073741824);let u=e.children[n].firstChild,d=e.children[s].firstChild;if((!u||!d)&&(!u&&r===0&&n>0&&(u=e.children[n-1].firstChild,r=1073741824),!d&&o===0&&s>0&&(d=e.children[s-1].firstChild,o=1073741824)),!u||!d)return null;r=Math.min(u.textContent.length,Math.max(0,r)),o=Math.min(d.textContent.length,Math.max(0,o));const h=this._readClientRects(u,r,d,o,a.endNode);return a.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,a.clientRectDeltaLeft,a.clientRectScale)}}var sh;(function(i){i.DARK="dark",i.LIGHT="light",i.HIGH_CONTRAST_DARK="hcDark",i.HIGH_CONTRAST_LIGHT="hcLight"})(sh||(sh={}));function Vp(i){return i===sh.HIGH_CONTRAST_DARK||i===sh.HIGH_CONTRAST_LIGHT}function $E(i){return i===sh.DARK||i===sh.HIGH_CONTRAST_DARK}const Zht=function(){return Um?!0:!(_l||gh||h1)}();let U2=!0;class gge{constructor(e,n){this.themeType=n;const r=e.options,s=r.get(50);r.get(38)==="off"?this.renderWhitespace=r.get(98):this.renderWhitespace="none",this.renderControlCharacters=r.get(93),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!r.get(33),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=r.get(66),this.stopRenderingLineAfter=r.get(116),this.fontLigatures=r.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class dm{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=Di(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return Vp(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,n,r,s){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=r.getViewLineRenderingData(e),a=this._options,l=ru.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let c=null;if(Vp(a.themeType)||this._options.renderWhitespace==="selection"){const f=r.selections;for(const p of f){if(p.endLineNumber<e||p.startLineNumber>e)continue;const g=p.startLineNumber===e?p.startColumn:o.minColumn,m=p.endLineNumber===e?p.endColumn:o.maxColumn;g<m&&(Vp(a.themeType)&&l.push(new ru(g,m,"inline-selected-text",0)),this._options.renderWhitespace==="selection"&&(c||(c=[]),c.push(new nIe(g-1,m-1))))}}const u=new X1(a.useMonospaceOptimizations,a.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,l,o.tabSize,o.startVisibleColumn,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,a.stopRenderingLineAfter,a.renderWhitespace,a.renderControlCharacters,a.fontLigatures!==Uu.OFF,c);if(this._renderedViewLine&&this._renderedViewLine.input.equals(u))return!1;s.appendString('<div style="top:'),s.appendString(String(n)),s.appendString("px;height:"),s.appendString(String(this._options.lineHeight)),s.appendString('px;" class="'),s.appendString(dm.CLASS_NAME),s.appendString('">');const d=T5(u,s);s.appendString("</div>");let h=null;return U2&&Zht&&o.isBasicASCII&&a.useMonospaceOptimizations&&d.containsForeignElements===0&&(h=new U3(this._renderedViewLine?this._renderedViewLine.domNode:null,u,d.characterMapping)),h||(h=CIe(this._renderedViewLine?this._renderedViewLine.domNode:null,u,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=h,!0}layoutLine(e,n){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(n),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof U3:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof U3?this._renderedViewLine.monospaceAssumptionsAreValid():U2}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof U3&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,n,r,s){if(!this._renderedViewLine)return null;n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n)),r=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,r));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&n>o+1&&r>o+1)return new pge(!0,[new PS(this.getWidth(s),0)]);o!==-1&&n>o+1&&(n=o+1),o!==-1&&r>o+1&&(r=o+1);const a=this._renderedViewLine.getVisibleRangesForRange(e,n,r,s);return a&&a.length>0?new pge(!1,a):null}getColumnOfNodeOffset(e,n){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,n):1}}dm.CLASS_NAME="view-line";class U3{constructor(e,n,r){this._cachedWidth=-1,this.domNode=e,this.input=n;const s=Math.floor(n.lineContent.length/300);if(s>0){this._keyColumnPixelOffsetCache=new Float32Array(s);for(let o=0;o<s;o++)this._keyColumnPixelOffsetCache[o]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=r,this._charWidth=n.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){const n=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*n)}return this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||this._cachedWidth!==-1}monospaceAssumptionsAreValid(){if(!this.domNode)return U2;if(this.input.lineContent.length<300){const e=this.getWidth(null),n=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-n)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),U2=!1)}return U2}toSlowRenderedLine(){return CIe(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,n,r,s){const o=this._getColumnPixelOffset(e,n,s),a=this._getColumnPixelOffset(e,r,s);return[new PS(o,a-o)]}_getColumnPixelOffset(e,n,r){if(n<=300){const u=this._characterMapping.getHorizontalOffset(n);return this._charWidth*u}const s=Math.floor((n-1)/300)-1,o=(s+1)*300+1;let a=-1;if(this._keyColumnPixelOffsetCache&&(a=this._keyColumnPixelOffsetCache[s],a===-1&&(a=this._actualReadPixelOffset(e,o,r),this._keyColumnPixelOffsetCache[s]=a)),a===-1){const u=this._characterMapping.getHorizontalOffset(n);return this._charWidth*u}const l=this._characterMapping.getHorizontalOffset(o),c=this._characterMapping.getHorizontalOffset(n);return a+this._charWidth*(c-l)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,n,r){if(!this.domNode)return-1;const s=this._characterMapping.getDomPosition(n),o=p8.readHorizontalRanges(this._getReadingTarget(this.domNode),s.partIndex,s.charIndex,s.partIndex,s.charIndex,r);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,n){return woe(this._characterMapping,e,n)}}class wIe{constructor(e,n,r,s,o){if(this.domNode=e,this.input=n,this._characterMapping=r,this._isWhitespaceOnly=/^\s*$/.test(n.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let a=0,l=this._characterMapping.length;a<=l;a++)this._pixelOffsetCache[a]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,n,r,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,n,s);if(o===-1)return null;const a=this._readPixelOffset(this.domNode,e,r,s);return a===-1?null:[new PS(o,a-o)]}return this._readVisibleRangesForRange(this.domNode,e,n,r,s)}_readVisibleRangesForRange(e,n,r,s,o){if(r===s){const a=this._readPixelOffset(e,n,r,o);return a===-1?null:[new PS(a,0)]}else return this._readRawVisibleRangesForRange(e,r,s,o)}_readPixelOffset(e,n,r,s){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(s);const o=this._getReadingTarget(e);return o.firstChild?(s.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[r];if(o!==-1)return o;const a=this._actualReadPixelOffset(e,n,r,s);return this._pixelOffsetCache[r]=a,a}return this._actualReadPixelOffset(e,n,r,s)}_actualReadPixelOffset(e,n,r,s){if(this._characterMapping.length===0){const c=p8.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s);return!c||c.length===0?-1:c[0].left}if(r===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(s);const o=this._characterMapping.getDomPosition(r),a=p8.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,s);if(!a||a.length===0)return-1;const l=a[0].left;if(this.input.isBasicASCII){const c=this._characterMapping.getHorizontalOffset(r),u=Math.round(this.input.spaceWidth*c);if(Math.abs(u-l)<=1)return u}return l}_readRawVisibleRangesForRange(e,n,r,s){if(n===1&&r===this._characterMapping.length)return[new PS(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(n),a=this._characterMapping.getDomPosition(r);return p8.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,a.partIndex,a.charIndex,s)}getColumnOfNodeOffset(e,n){return woe(this._characterMapping,e,n)}}class Qht extends wIe{_readVisibleRangesForRange(e,n,r,s,o){const a=super._readVisibleRangesForRange(e,n,r,s,o);if(!a||a.length===0||r===s||r===1&&s===this._characterMapping.length)return a;if(!this.input.containsRTL){const l=this._readPixelOffset(e,n,s,o);if(l!==-1){const c=a[a.length-1];c.left<l&&(c.width=l-c.left)}}return a}}const CIe=function(){return QW?Jht:eft}();function Jht(i,e,n,r,s){return new Qht(i,e,n,r,s)}function eft(i,e,n,r,s){return new wIe(i,e,n,r,s)}function woe(i,e,n){const r=e.textContent.length;let s=-1;for(;e;)e=e.previousSibling,s++;return i.getColumn(new iIe(s,n),r)}class ho{static _nextVisibleColumn(e,n,r){return e===9?ho.nextRenderTabStop(n,r):d1(e)||Hse(e)?n+2:n+1}static visibleColumnFromColumn(e,n,r){const s=Math.min(n-1,e.length),o=e.substring(0,s),a=new j9(o);let l=0;for(;!a.eol();){const c=B9(o,s,a.offset);a.nextGraphemeLength(),l=this._nextVisibleColumn(c,l,r)}return l}static columnFromVisibleColumn(e,n,r){if(n<=0)return 1;const s=e.length,o=new j9(e);let a=0,l=1;for(;!o.eol();){const c=B9(e,s,o.offset);o.nextGraphemeLength();const u=this._nextVisibleColumn(c,a,r),d=o.offset+1;if(u>=n){const h=n-a;return u-n<h?d:l}a=u,l=d}return s+1}static nextRenderTabStop(e,n){return e+n-e%n}static nextIndentTabStop(e,n){return e+n-e%n}static prevRenderTabStop(e,n){return Math.max(0,e-1-(e-1)%n)}static prevIndentTabStop(e,n){return Math.max(0,e-1-(e-1)%n)}}class LP{static whitespaceVisibleColumn(e,n,r){const s=e.length;let o=0,a=-1,l=-1;for(let c=0;c<s;c++){if(c===n)return[a,l,o];switch(o%r===0&&(a=c,l=o),e.charCodeAt(c)){case 32:o+=1;break;case 9:o=ho.nextRenderTabStop(o,r);break;default:return[-1,-1,-1]}}return n===s?[a,l,o]:[-1,-1,-1]}static atomicPosition(e,n,r,s){const o=e.length,[a,l,c]=LP.whitespaceVisibleColumn(e,n,r);if(c===-1)return-1;let u;switch(s){case 0:u=!0;break;case 1:u=!1;break;case 2:if(c%r===0)return n;u=c%r<=r/2;break}if(u){if(a===-1)return-1;let f=l;for(let p=a;p<o;++p){if(f===l+r)return a;switch(e.charCodeAt(p)){case 32:f+=1;break;case 9:f=ho.nextRenderTabStop(f,r);break;default:return-1}}return f===l+r?a:-1}const d=ho.nextRenderTabStop(c,r);let h=c;for(let f=n;f<o;f++){if(h===d)return f;switch(e.charCodeAt(f)){case 32:h+=1;break;case 9:h=ho.nextRenderTabStop(h,r);break;default:return-1}}return h===d?o:-1}}class Xb{constructor(e=null){this.hitTarget=e,this.type=0}}class SIe{constructor(e,n,r){this.position=e,this.spanNode=n,this.injectedText=r,this.type=1}}var GC;(function(i){function e(n,r,s){const o=n.getPositionFromDOMInfo(r,s);return o?new SIe(o,r,null):new Xb(r)}i.createFromDOMInfo=e})(GC||(GC={}));class tft{constructor(e,n){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=n}}class dl{static _deduceRage(e,n=null){return!n&&e?new J(e.lineNumber,e.column,e.lineNumber,e.column):n??null}static createUnknown(e,n,r){return{type:0,element:e,mouseColumn:n,position:r,range:this._deduceRage(r)}}static createTextarea(e,n){return{type:1,element:e,mouseColumn:n,position:null,range:null}}static createMargin(e,n,r,s,o,a){return{type:e,element:n,mouseColumn:r,position:s,range:o,detail:a}}static createViewZone(e,n,r,s,o){return{type:e,element:n,mouseColumn:r,position:s,range:this._deduceRage(s),detail:o}}static createContentText(e,n,r,s,o){return{type:6,element:e,mouseColumn:n,position:r,range:this._deduceRage(r,s),detail:o}}static createContentEmpty(e,n,r,s){return{type:7,element:e,mouseColumn:n,position:r,range:this._deduceRage(r),detail:s}}static createContentWidget(e,n,r){return{type:9,element:e,mouseColumn:n,position:null,range:null,detail:r}}static createScrollbar(e,n,r){return{type:11,element:e,mouseColumn:n,position:r,range:this._deduceRage(r)}}static createOverlayWidget(e,n,r){return{type:12,element:e,mouseColumn:n,position:null,range:null,detail:r}}static createOutsideEditor(e,n,r,s){return{type:13,element:null,mouseColumn:e,position:n,range:this._deduceRage(n),outsidePosition:r,outsideDistance:s}}static _typeToString(e){return e===1?"TEXTAREA":e===2?"GUTTER_GLYPH_MARGIN":e===3?"GUTTER_LINE_NUMBERS":e===4?"GUTTER_LINE_DECORATIONS":e===5?"GUTTER_VIEW_ZONE":e===6?"CONTENT_TEXT":e===7?"CONTENT_EMPTY":e===8?"CONTENT_VIEW_ZONE":e===9?"CONTENT_WIDGET":e===10?"OVERVIEW_RULER":e===11?"SCROLLBAR":e===12?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class Mu{static isTextArea(e){return e.length===2&&e[0]===3&&e[1]===6}static isChildOfViewLines(e){return e.length>=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class zE{constructor(e,n,r){this.viewModel=e.viewModel;const s=e.configuration.options;this.layoutInfo=s.get(143),this.viewDomNode=n.viewDomNode,this.lineHeight=s.get(66),this.stickyTabStops=s.get(115),this.typicalHalfwidthCharacterWidth=s.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=r,this._context=e,this._viewHelper=n}getZoneAtCoord(e){return zE.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,n){const r=e.viewLayout.getWhitespaceAtVerticalOffset(n);if(r){const s=r.verticalOffset+r.height/2,o=e.viewModel.getLineCount();let a=null,l,c=null;return r.afterLineNumber!==o&&(c=new ve(r.afterLineNumber+1,1)),r.afterLineNumber>0&&(a=new ve(r.afterLineNumber,e.viewModel.getLineMaxColumn(r.afterLineNumber))),c===null?l=a:a===null?l=c:n<s?l=a:l=c,{viewZoneId:r.id,afterLineNumber:r.afterLineNumber,positionBefore:a,positionAfter:c,position:l}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const s=this._context.viewModel.getLineCount(),o=this._context.viewModel.getLineMaxColumn(s);return{range:new J(s,o,s,o),isAfterLines:!0}}const n=this._context.viewLayout.getLineNumberAtVerticalOffset(e),r=this._context.viewModel.getLineMaxColumn(n);return{range:new J(n,1,n,r),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,n){return zE._findAttribute(e,n,this._viewHelper.viewDomNode)}static _findAttribute(e,n,r){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(n))return e.getAttribute(n);if(e===r)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,n){return this._viewHelper.visibleRangeForPosition(e,n)}getPositionFromDOMInfo(e,n){return this._viewHelper.getPositionFromDOMInfo(e,n)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class nft{constructor(e,n,r,s){this.editorPos=n,this.pos=r,this.relativePos=s,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Ca._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class Coe extends nft{constructor(e,n,r,s,o){super(e,n,r,s),this._ctx=e,o?(this.target=o,this.targetPath=Ym.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}
target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?ho.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return dl.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return dl.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,n,r,s){return dl.createMargin(e,this.target,this._getMouseColumn(n),n,r,s)}fulfillViewZone(e,n,r){return dl.createViewZone(e,this.target,this._getMouseColumn(n),n,r)}fulfillContentText(e,n,r){return dl.createContentText(this.target,this._getMouseColumn(e),e,n,r)}fulfillContentEmpty(e,n){return dl.createContentEmpty(this.target,this._getMouseColumn(e),e,n)}fulfillContentWidget(e){return dl.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return dl.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return dl.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new Coe(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const mge={isAfterLines:!0};function gq(i){return{isAfterLines:!1,horizontalDistanceToText:i}}class Ca{constructor(e,n){this._context=e,this._viewHelper=n}mouseTargetIsWidget(e){const n=e.target,r=Ym.collect(n,this._viewHelper.viewDomNode);return!!(Mu.isChildOfContentWidgets(r)||Mu.isChildOfOverflowingContentWidgets(r)||Mu.isChildOfOverlayWidgets(r))}createMouseTarget(e,n,r,s,o){const a=new zE(this._context,this._viewHelper,e),l=new Coe(a,n,r,s,o);try{const c=Ca._createMouseTarget(a,l,!1);if(c.type===6&&a.stickyTabStops&&c.position!==null){const u=Ca._snapToSoftTabBoundary(c.position,a.viewModel),d=J.fromPositions(u,u).plusRange(c.range);return l.fulfillContentText(u,d,c.detail)}return c}catch{return l.fulfillUnknown()}}static _createMouseTarget(e,n,r){if(n.target===null){if(r)return n.fulfillUnknown();const a=Ca._doHitTest(e,n);return a.type===1?Ca.createMouseTargetFromHitTestPosition(e,n,a.spanNode,a.position,a.injectedText):this._createMouseTarget(e,n.withTarget(a.hitTarget),!0)}const s=n;let o=null;return!Mu.isChildOfOverflowGuard(n.targetPath)&&!Mu.isChildOfOverflowingContentWidgets(n.targetPath)&&(o=o||n.fulfillUnknown()),o=o||Ca._hitTestContentWidget(e,s),o=o||Ca._hitTestOverlayWidget(e,s),o=o||Ca._hitTestMinimap(e,s),o=o||Ca._hitTestScrollbarSlider(e,s),o=o||Ca._hitTestViewZone(e,s),o=o||Ca._hitTestMargin(e,s),o=o||Ca._hitTestViewCursor(e,s),o=o||Ca._hitTestTextArea(e,s),o=o||Ca._hitTestViewLines(e,s,r),o=o||Ca._hitTestScrollbar(e,s),o||n.fulfillUnknown()}static _hitTestContentWidget(e,n){if(Mu.isChildOfContentWidgets(n.targetPath)||Mu.isChildOfOverflowingContentWidgets(n.targetPath)){const r=e.findAttribute(n.target,"widgetId");return r?n.fulfillContentWidget(r):n.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,n){if(Mu.isChildOfOverlayWidgets(n.targetPath)){const r=e.findAttribute(n.target,"widgetId");return r?n.fulfillOverlayWidget(r):n.fulfillUnknown()}return null}static _hitTestViewCursor(e,n){if(n.target){const r=e.lastRenderData.lastViewCursorsRenderData;for(const s of r)if(n.target===s.domNode)return n.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}if(n.isInContentArea){const r=e.lastRenderData.lastViewCursorsRenderData,s=n.mouseContentHorizontalOffset,o=n.mouseVerticalOffset;for(const a of r){if(s<a.contentLeft||s>a.contentLeft+a.width)continue;const l=e.getVerticalOffsetForLineNumber(a.position.lineNumber);if(l<=o&&o<=l+a.height)return n.fulfillContentText(a.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,n){const r=e.getZoneAtCoord(n.mouseVerticalOffset);if(r){const s=n.isInContentArea?8:5;return n.fulfillViewZone(s,r.position,r)}return null}static _hitTestTextArea(e,n){return Mu.isTextArea(n.targetPath)?e.lastRenderData.lastTextareaPosition?n.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):n.fulfillTextarea():null}static _hitTestMargin(e,n){if(n.isInMarginArea){const r=e.getFullLineRangeAtCoord(n.mouseVerticalOffset),s=r.range.getStartPosition();let o=Math.abs(n.relativePos.x);const a={isAfterLines:r.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?n.fulfillMargin(2,s,r.range,a):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?n.fulfillMargin(3,s,r.range,a):(o-=e.layoutInfo.lineNumbersWidth,n.fulfillMargin(4,s,r.range,a)))}return null}static _hitTestViewLines(e,n,r){if(!Mu.isChildOfViewLines(n.targetPath))return null;if(e.isInTopPadding(n.mouseVerticalOffset))return n.fulfillContentEmpty(new ve(1,1),mge);if(e.isAfterLines(n.mouseVerticalOffset)||e.isInBottomPadding(n.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),a=e.viewModel.getLineMaxColumn(o);return n.fulfillContentEmpty(new ve(o,a),mge)}if(r){if(Mu.isStrictChildOfViewLines(n.targetPath)){const o=e.getLineNumberAtVerticalOffset(n.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const l=e.getLineWidth(o),c=gq(n.mouseContentHorizontalOffset-l);return n.fulfillContentEmpty(new ve(o,1),c)}const a=e.getLineWidth(o);if(n.mouseContentHorizontalOffset>=a){const l=gq(n.mouseContentHorizontalOffset-a),c=new ve(o,e.viewModel.getLineMaxColumn(o));return n.fulfillContentEmpty(c,l)}}return n.fulfillUnknown()}const s=Ca._doHitTest(e,n);return s.type===1?Ca.createMouseTargetFromHitTestPosition(e,n,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,n.withTarget(s.hitTarget),!0)}static _hitTestMinimap(e,n){if(Mu.isChildOfMinimap(n.targetPath)){const r=e.getLineNumberAtVerticalOffset(n.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(r);return n.fulfillScrollbar(new ve(r,s))}return null}static _hitTestScrollbarSlider(e,n){if(Mu.isChildOfScrollableElement(n.targetPath)&&n.target&&n.target.nodeType===1){const r=n.target.className;if(r&&/\b(slider|scrollbar)\b/.test(r)){const s=e.getLineNumberAtVerticalOffset(n.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(s);return n.fulfillScrollbar(new ve(s,o))}}return null}static _hitTestScrollbar(e,n){if(Mu.isChildOfScrollableElement(n.targetPath)){const r=e.getLineNumberAtVerticalOffset(n.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(r);return n.fulfillScrollbar(new ve(r,s))}return null}getMouseColumn(e){const n=this._context.configuration.options,r=n.get(143),s=this._context.viewLayout.getCurrentScrollLeft()+e.x-r.contentLeft;return Ca._getMouseColumn(s,n.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,n){return e<0?1:Math.round(e/n)+1}static createMouseTargetFromHitTestPosition(e,n,r,s,o){const a=s.lineNumber,l=s.column,c=e.getLineWidth(a);if(n.mouseContentHorizontalOffset>c){const b=gq(n.mouseContentHorizontalOffset-c);return n.fulfillContentEmpty(s,b)}const u=e.visibleRangeForPosition(a,l);if(!u)return n.fulfillUnknown(s);const d=u.left;if(Math.abs(n.mouseContentHorizontalOffset-d)<1)return n.fulfillContentText(s,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:u.left,column:l}),l>1){const b=e.visibleRangeForPosition(a,l-1);b&&h.push({offset:b.left,column:l-1})}const f=e.viewModel.getLineMaxColumn(a);if(l<f){const b=e.visibleRangeForPosition(a,l+1);b&&h.push({offset:b.left,column:l+1})}h.sort((b,y)=>b.offset-y.offset);const p=n.pos.toClientCoordinates(),g=r.getBoundingClientRect(),m=g.left<=p.clientX&&p.clientX<=g.right;let _=null;for(let b=1;b<h.length;b++){const y=h[b-1],x=h[b];if(y.offset<=n.mouseContentHorizontalOffset&&n.mouseContentHorizontalOffset<=x.offset){_=new J(a,y.column,a,x.column);const k=Math.abs(y.offset-n.mouseContentHorizontalOffset),D=Math.abs(x.offset-n.mouseContentHorizontalOffset);s=k<D?new ve(a,y.column):new ve(a,x.column);break}}return n.fulfillContentText(s,_,{mightBeForeignElement:!m||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,n){const r=e.getLineNumberAtVerticalOffset(n.mouseVerticalOffset),s=e.getVerticalOffsetForLineNumber(r),o=s+e.lineHeight;if(!(r===e.viewModel.getLineCount()&&n.mouseVerticalOffset>o)){const l=Math.floor((s+o)/2);let c=n.pos.y+(l-n.mouseVerticalOffset);c<=n.editorPos.y&&(c=n.editorPos.y+1),c>=n.editorPos.y+n.editorPos.height&&(c=n.editorPos.y+n.editorPos.height-1);const u=new L$(n.pos.x,c),d=this._actualDoHitTestWithCaretRangeFromPoint(e,u.toClientCoordinates());if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,n.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,n){const r=dx(e.viewDomNode);let s;if(r?typeof r.caretRangeFromPoint>"u"?s=ift(r,n.clientX,n.clientY):s=r.caretRangeFromPoint(n.clientX,n.clientY):s=e.viewDomNode.ownerDocument.caretRangeFromPoint(n.clientX,n.clientY),!s||!s.startContainer)return new Xb;const o=s.startContainer;if(o.nodeType===o.TEXT_NODE){const a=o.parentNode,l=a?a.parentNode:null,c=l?l.parentNode:null;return(c&&c.nodeType===c.ELEMENT_NODE?c.className:null)===dm.CLASS_NAME?GC.createFromDOMInfo(e,a,s.startOffset):new Xb(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const a=o.parentNode,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===dm.CLASS_NAME?GC.createFromDOMInfo(e,o,o.textContent.length):new Xb(o)}return new Xb}static _doHitTestWithCaretPositionFromPoint(e,n){const r=e.viewDomNode.ownerDocument.caretPositionFromPoint(n.clientX,n.clientY);if(r.offsetNode.nodeType===r.offsetNode.TEXT_NODE){const s=r.offsetNode.parentNode,o=s?s.parentNode:null,a=o?o.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===dm.CLASS_NAME?GC.createFromDOMInfo(e,r.offsetNode.parentNode,r.offset):new Xb(r.offsetNode.parentNode)}if(r.offsetNode.nodeType===r.offsetNode.ELEMENT_NODE){const s=r.offsetNode.parentNode,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,a=s?s.parentNode:null,l=a&&a.nodeType===a.ELEMENT_NODE?a.className:null;if(o===dm.CLASS_NAME){const c=r.offsetNode.childNodes[Math.min(r.offset,r.offsetNode.childNodes.length-1)];if(c)return GC.createFromDOMInfo(e,c,0)}else if(l===dm.CLASS_NAME)return GC.createFromDOMInfo(e,r.offsetNode,0)}return new Xb(r.offsetNode)}static _snapToSoftTabBoundary(e,n){const r=n.getLineContent(e.lineNumber),{tabSize:s}=n.model.getOptions(),o=LP.atomicPosition(r,e.column-1,s,2);return o!==-1?new ve(e.lineNumber,o+1):e}static _doHitTest(e,n){let r=new Xb;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?r=this._doHitTestWithCaretRangeFromPoint(e,n):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(r=this._doHitTestWithCaretPositionFromPoint(e,n.pos.toClientCoordinates())),r.type===1){const s=e.viewModel.getInjectedTextAt(r.position),o=e.viewModel.normalizePosition(r.position,2);(s||!o.equals(r.position))&&(r=new SIe(o,r.spanNode,s))}return r}}function ift(i,e,n){const r=document.createRange();let s=i.elementFromPoint(e,n);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const o=s.getBoundingClientRect(),a=window.getComputedStyle(s,null).getPropertyValue("font-style"),l=window.getComputedStyle(s,null).getPropertyValue("font-variant"),c=window.getComputedStyle(s,null).getPropertyValue("font-weight"),u=window.getComputedStyle(s,null).getPropertyValue("font-size"),d=window.getComputedStyle(s,null).getPropertyValue("line-height"),h=window.getComputedStyle(s,null).getPropertyValue("font-family"),f=`${a} ${l} ${c} ${u}/${d} ${h}`,p=s.innerText;let g=o.left,m=0,_;if(e>o.left+o.width)m=p.length;else{const b=bS.getInstance();for(let y=0;y<p.length+1;y++){if(_=b.getCharWidth(p.charAt(y),f)/2,g+=_,e<g){m=y;break}g+=_}}r.setStart(s.firstChild,m),r.setEnd(s.firstChild,m)}return r}class bS{static getInstance(){return bS._INSTANCE||(bS._INSTANCE=new bS),bS._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,n){const r=e+n;if(this._cache[r])return this._cache[r];const s=this._canvas.getContext("2d");s.font=n;const a=s.measureText(e).width;return this._cache[r]=a,a}}bS._INSTANCE=null;let Pf=class extends Le{onclick(e,n){this._register(Be(e,ht.CLICK,r=>n(new rh(r))))}onmousedown(e,n){this._register(Be(e,ht.MOUSE_DOWN,r=>n(new rh(r))))}onmouseover(e,n){this._register(Be(e,ht.MOUSE_OVER,r=>n(new rh(r))))}onmouseleave(e,n){this._register(Be(e,ht.MOUSE_LEAVE,r=>n(new rh(r))))}onkeydown(e,n){this._register(Be(e,ht.KEY_DOWN,r=>n(new yr(r))))}onkeyup(e,n){this._register(Be(e,ht.KEY_UP,r=>n(new yr(r))))}oninput(e,n){this._register(Be(e,ht.INPUT,n))}onblur(e,n){this._register(Be(e,ht.BLUR,n))}onfocus(e,n){this._register(Be(e,ht.FOCUS,n))}ignoreGesture(e){return or.ignoreTarget(e)}};const VE=11;class rft extends Pf{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...en.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=VE+"px",this.domNode.style.height=VE+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new $I),this._register(As(this.bgDomNode,ht.POINTER_DOWN,n=>this._arrowPointerDown(n))),this._register(As(this.domNode,ht.POINTER_DOWN,n=>this._arrowPointerDown(n))),this._pointerdownRepeatTimer=this._register(new D5),this._pointerdownScheduleRepeatTimer=this._register(new Mf)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const n=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(n,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class sft extends Le{constructor(e,n,r){super(),this._visibility=e,this._visibleClassName=n,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Mf)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var n;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(n=this._domNode)===null||n===void 0||n.setClassName(this._invisibleClassName+(e?" fade":"")))}}const oft=140;class xIe extends Pf{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new sft(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new $I),this._shouldRender=!0,this.domNode=Di(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Be(this.domNode.domNode,ht.POINTER_DOWN,n=>this._domNodePointerDown(n)))}_createArrow(e){const n=this._register(new rft(e));this.domNode.domNode.appendChild(n.bgDomNode),this.domNode.domNode.appendChild(n.domNode)}_createSlider(e,n,r,s){this.slider=Di(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(n),typeof r=="number"&&this.slider.setWidth(r),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Be(this.slider.domNode,ht.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const n=this.domNode.domNode.getClientRects()[0].top,r=n+this._scrollbarState.getSliderPosition(),s=n+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);r<=o&&o<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let n,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")n=e.offsetX,r=e.offsetY;else{const o=no(this.domNode.domNode);n=e.pageX-o.left,r=e.pageY-o.top}const s=this._pointerDownRelativePosition(n,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const n=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const a=this._sliderOrthogonalPointerPosition(o),l=Math.abs(a-r);if(Aa&&l>oft){this._setDesiredScrollPositionNow(s.getScrollPosition());return}const u=this._sliderPointerPosition(o)-n;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(u))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const n={};this.writeScrollPosition(n,e),this._scrollable.setScrollPositionNow(n)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const aft=20;class HE{constructor(e,n,r,s,o,a){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new HE(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const n=Math.round(e);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(e){const n=Math.round(e);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const n=Math.round(e);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,n,r,s,o){const a=Math.max(0,r-e),l=Math.max(0,a-2*n),c=s>0&&s>r;if(!c)return{computedAvailableSize:Math.round(a),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};const u=Math.round(Math.max(aft,Math.floor(r*l/s))),d=(l-u)/(s-r),h=o*d;return{computedAvailableSize:Math.round(a),computedIsNeeded:c,computedSliderSize:Math.round(u),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=HE._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const n=e-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const n=e-this._arrowSize;let r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const n=this._computedSliderPosition+e;return Math.round(n/this._computedSliderRatio)}}class lft extends xIe{constructor(e,n,r){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:n.lazyRender,host:r,scrollbarState:new HE(n.horizontalHasArrows?n.arrowSize:0,n.horizontal===2?0:n.horizontalScrollbarSize,n.vertical===2?0:n.verticalScrollbarSize,s.width,s.scrollWidth,o.scrollLeft),visibility:n.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:n.scrollByPage}),n.horizontalHasArrows){const a=(n.arrowSize-VE)/2,l=(n.horizontalScrollbarSize-VE)/2;this._createArrow({className:"scra",icon:lt.scrollbarButtonLeft,top:l,left:a,bottom:void 0,right:void 0,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new ux(null,1,0))}),this._createArrow({className:"scra",icon:lt.scrollbarButtonRight,top:l,left:void 0,bottom:void 0,right:a,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new ux(null,-1,0))})}this._createSlider(Math.floor((n.horizontalScrollbarSize-n.horizontalSliderSize)/2),0,void 0,n.horizontalSliderSize)}_updateSlider(e,n){this.slider.setWidth(e),this.slider.setLeft(n)}_renderDomNode(e,n){this.domNode.setWidth(e),this.domNode.setHeight(n),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,n){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,n){e.scrollLeft=n}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class cft extends xIe{constructor(e,n,r){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:n.lazyRender,host:r,scrollbarState:new HE(n.verticalHasArrows?n.arrowSize:0,n.vertical===2?0:n.verticalScrollbarSize,0,s.height,s.scrollHeight,o.scrollTop),visibility:n.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:n.scrollByPage}),n.verticalHasArrows){const a=(n.arrowSize-VE)/2,l=(n.verticalScrollbarSize-VE)/2;this._createArrow({className:"scra",icon:lt.scrollbarButtonUp,top:a,left:l,bottom:void 0,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:()=>this._host.onMouseWheel(new ux(null,0,1))}),this._createArrow({className:"scra",icon:lt.scrollbarButtonDown,top:void 0,left:l,bottom:a,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:()=>this._host.onMouseWheel(new ux(null,0,-1))})}this._createSlider(0,Math.floor((n.verticalScrollbarSize-n.verticalSliderSize)/2),n.verticalSliderSize,void 0)}_updateSlider(e,n){this.slider.setHeight(e),this.slider.setTop(n)}_renderDomNode(e,n){this.domNode.setWidth(n),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,n){return n}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,n){e.scrollTop=n}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class t7{constructor(e,n,r,s,o,a,l){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,o=o|0,a=a|0,l=l|0),this.rawScrollLeft=s,this.rawScrollTop=l,n<0&&(n=0),s+n>r&&(s=r-n),s<0&&(s=0),o<0&&(o=0),l+o>a&&(l=a-o),l<0&&(l=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=o,this.scrollHeight=a,this.scrollTop=l}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,n){return new t7(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new t7(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,n){const r=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,l=this.scrollHeight!==e.scrollHeight,c=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:n,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:s,scrollLeftChanged:o,heightChanged:a,scrollHeightChanged:l,scrollTopChanged:c}}}class M5 extends Le{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new t7(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,n){var r;const s=this._state.withScrollDimensions(e,n);this._setState(s,!!this._smoothScrolling),(r=this._smoothScrolling)===null||r===void 0||r.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const n=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(n,!1)}setScrollPositionSmooth(e,n){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let s;n?s=new DP(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{const r=this._state.withScrollPosition(e);this._smoothScrolling=DP.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),n=this._state.withScrollPosition(e);if(this._setState(n,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,n){const r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,n)))}}class _ge{constructor(e,n,r){this.scrollLeft=e,this.scrollTop=n,this.isDone=r}}function mq(i,e){const n=e-i;return function(r){return i+n*hft(r)}}function uft(i,e,n){return function(r){return r<n?i(r/n):e((r-n)/(1-n))}}class DP{constructor(e,n,r,s){this.from=e,this.to=n,this.duration=s,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,n,r){if(Math.abs(e-n)>2.5*r){let o,a;return e<n?(o=e+.75*r,a=n-.75*r):(o=e-.75*r,a=n+.75*r),uft(mq(e,o),mq(a,n),.33)}return mq(e,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const n=(e-this.startTime)/this.duration;if(n<1){const r=this.scrollLeft(n),s=this.scrollTop(n);return new _ge(r,s,!1)}return new _ge(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,n,r){return DP.start(e,n,r)}static start(e,n,r){r=r+10;const s=Date.now()-10;return new DP(e,n,s,r)}}function dft(i){return Math.pow(i,3)}function hft(i){return 1-dft(1-i)}const fft=500,vge=50;class pft{constructor(e,n,r){this.timestamp=e,this.deltaX=n,this.deltaY=r,this.score=0}}class n7{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,n=0,r=1,s=this._rear;do{const o=s===this._front?e:Math.pow(2,-r);if(e-=o,n+=this._memory[s].score*o,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(e){const n=window.devicePixelRatio/Bot();Aa||_l?this.accept(Date.now(),e.deltaX/n,e.deltaY/n):this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,n,r){const s=new pft(e,n,r);s.score=this._computeScore(s),this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}n7.INSTANCE=new n7;class Soe extends Pf{get options(){return this._options}constructor(e,n,r){super(),this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new _e),e.style.overflow="hidden",this._options=gft(n),this._scrollable=r,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const s={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new cft(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new lft(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Di(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Di(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Di(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Mf),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Mi(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ri&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new ux(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Mi(this._mouseWheelToDispose),e)){const r=s=>{this._onMouseWheel(new ux(s))};this._mouseWheelToDispose.push(Be(this._listenOnDomNode,ht.MOUSE_WHEEL,r,{passive:!1}))}}_onMouseWheel(e){var n;if(!((n=e.browserEvent)===null||n===void 0)&&n.defaultPrevented)return;const r=n7.INSTANCE;r.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);const c=!ri&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||c)&&!l&&(l=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);const u=this._scrollable.getFutureScrollPosition();let d={};if(a){const h=vge*a,f=u.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(d,f)}if(l){const h=vge*l,f=u.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(d,f)}d=this._scrollable.validateScrollPosition(d),(u.scrollLeft!==d.scrollLeft||u.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&r.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),s=!0)}let o=s;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),n=e.scrollTop>0,r=e.scrollLeft>0,s=r?" left":"",o=n?" top":"",a=r||n?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${o}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),fft)}}class kIe extends Soe{constructor(e,n){n=n||{},n.mouseWheelSmoothScroll=!1;const r=new M5({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>mh(s)});super(e,n,r),this._register(r)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class xoe extends Soe{constructor(e,n,r){super(e,n,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class P5 extends Soe{constructor(e,n){n=n||{},n.mouseWheelSmoothScroll=!1;const r=new M5({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>mh(s)});super(e,n,r),this._register(r),this._element=e,this._register(this.onScroll(s=>{s.scrollTopChanged&&(this._element.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this._element.scrollLeft=s.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function gft(i){const e={lazyRender:typeof i.lazyRender<"u"?i.lazyRender:!1,className:typeof i.className<"u"?i.className:"",useShadows:typeof i.useShadows<"u"?i.useShadows:!0,handleMouseWheel:typeof i.handleMouseWheel<"u"?i.handleMouseWheel:!0,flipAxes:typeof i.flipAxes<"u"?i.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof i.consumeMouseWheelIfScrollbarIsNeeded<"u"?i.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof i.alwaysConsumeMouseWheel<"u"?i.alwaysConsumeMouseWheel:!1,scrollYToX:typeof i.scrollYToX<"u"?i.scrollYToX:!1,mouseWheelScrollSensitivity:typeof i.mouseWheelScrollSensitivity<"u"?i.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof i.fastScrollSensitivity<"u"?i.fastScrollSensitivity:5,scrollPredominantAxis:typeof i.scrollPredominantAxis<"u"?i.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof i.mouseWheelSmoothScroll<"u"?i.mouseWheelSmoothScroll:!0,arrowSize:typeof i.arrowSize<"u"?i.arrowSize:11,listenOnDomNode:typeof i.listenOnDomNode<"u"?i.listenOnDomNode:null,horizontal:typeof i.horizontal<"u"?i.horizontal:1,horizontalScrollbarSize:typeof i.horizontalScrollbarSize<"u"?i.horizontalScrollbarSize:10,horizontalSliderSize:typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:0,horizontalHasArrows:typeof i.horizontalHasArrows<"u"?i.horizontalHasArrows:!1,vertical:typeof i.vertical<"u"?i.vertical:1,verticalScrollbarSize:typeof i.verticalScrollbarSize<"u"?i.verticalScrollbarSize:10,verticalHasArrows:typeof i.verticalHasArrows<"u"?i.verticalHasArrows:!1,verticalSliderSize:typeof i.verticalSliderSize<"u"?i.verticalSliderSize:0,scrollByPage:typeof i.scrollByPage<"u"?i.scrollByPage:!1};return e.horizontalSliderSize=typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof i.verticalSliderSize<"u"?i.verticalSliderSize:e.verticalScrollbarSize,ri&&(e.className+=" mac"),e}class koe extends N5{constructor(e,n,r){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=n,this.viewHelper=r,this.mouseTargetFactory=new Ca(this._context,r),this._mouseDownOperation=this._register(new mft(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(a,l)=>this._createMouseTarget(a,l),a=>this._getMouseColumn(a))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const s=new zht(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,a=>this._onContextMenu(a,!0))),this._register(s.onMouseMove(this.viewHelper.viewDomNode,a=>{this._onMouseMove(a),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=Be(this.viewHelper.viewDomNode.ownerDocument,"mousemove",l=>{this.viewHelper.viewDomNode.contains(l.target)||this._onMouseLeave(new b1(l,!1,this.viewHelper.viewDomNode))}))})),this._register(s.onMouseUp(this.viewHelper.viewDomNode,a=>this._onMouseUp(a))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,a=>this._onMouseLeave(a)));let o=0;this._register(s.onPointerDown(this.viewHelper.viewDomNode,(a,l)=>{o=l})),this._register(Be(this.viewHelper.viewDomNode,ht.POINTER_UP,a=>{this._mouseDownOperation.onPointerUp()})),this._register(s.onMouseDown(this.viewHelper.viewDomNode,a=>this._onMouseDown(a,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=n7.INSTANCE;let n=0,r=eh.getZoomLevel(),s=!1,o=0;const a=c=>{if(this.viewController.emitMouseWheel(c),!this._context.configuration.options.get(75))return;const u=new ux(c);if(e.acceptStandardWheelEvent(u),e.isPhysicalMouseWheel()){if(l(c)){const d=eh.getZoomLevel(),h=u.deltaY>0?1:-1;eh.setZoomLevel(d+h),u.preventDefault(),u.stopPropagation()}}else Date.now()-n>50&&(r=eh.getZoomLevel(),s=l(c),o=0),n=Date.now(),o+=u.deltaY,s&&(eh.setZoomLevel(r+o/5),u.preventDefault(),u.stopPropagation())};this._register(Be(this.viewHelper.viewDomNode,ht.MOUSE_WHEEL,a,{capture:!0,passive:!1}));function l(c){return ri?(c.metaKey||c.ctrlKey)&&!c.shiftKey&&!c.altKey:c.ctrlKey&&!c.metaKey&&!c.shiftKey&&!c.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const n=this._context.configuration.options.get(143).height;this._height!==n&&(this._height=n,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,n){const s=new yIe(e,n).toPageCoordinates(),o=boe(this.viewHelper.viewDomNode);if(s.y<o.y||s.y>o.y+o.height||s.x<o.x||s.x>o.x+o.width)return null;const a=yoe(this.viewHelper.viewDomNode,o,s);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,s,a,null)}_createMouseTarget(e,n){let r=e.target;if(!this.viewHelper.viewDomNode.contains(r)){const s=dx(this.viewHelper.viewDomNode);s&&(r=s.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,n?r:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,n){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,n)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime)&&this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=new Date().getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,n){const r=this._createMouseTarget(e,!0),s=r.type===6||r.type===7,o=r.type===2||r.type===3||r.type===4,a=r.type===3,l=this._context.configuration.options.get(108),c=r.type===8||r.type===5,u=r.type===9;let d=e.leftButton||e.middleButton;ri&&e.leftButton&&e.ctrlKey&&(d=!1);const h=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(s||a&&l))h(),this._mouseDownOperation.start(r.type,e,n);else if(o)e.preventDefault();else if(c){const f=r.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(f.viewZoneId)&&(h(),this._mouseDownOperation.start(r.type,e,n),e.preventDefault())}else u&&this.viewHelper.shouldSuppressMouseDownOnWidget(r.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:r})}}class mft extends Le{constructor(e,n,r,s,o,a){super(),this._context=e,this._viewController=n,this._viewHelper=r,this._mouseTargetFactory=s,this._createMouseTarget=o,this._getMouseColumn=a,this._mouseMoveMonitor=this._register(new Hht(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new _ft(this._context,this._viewHelper,this._mouseTargetFactory,(l,c,u)=>this._dispatchMouse(l,c,u))),this._mouseState=new E$,this._currentSelection=new Ft(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const n=this._findMousePosition(e,!1);n&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:n}):n.type===13&&(n.outsidePosition==="above"||n.outsidePosition==="below")?this._topBottomDragScrolling.start(n,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(n,!0,1)))}start(e,n,r){this._lastMouseEvent=n,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(n),this._mouseState.setModifiers(n);const s=this._findMousePosition(n,!0);if(!s||!s.position)return;this._mouseState.trySetCount(n.detail,s.position),n.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(90)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&n.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&s.type===6&&s.position&&this._currentSelection.containsPosition(s.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,r,n.buttons,a=>this._onMouseDownThenMove(a),a=>{const l=this._findMousePosition(this._lastMouseEvent,!1);a&&a instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:l?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(s,n.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,r,n.buttons,a=>this._onMouseDownThenMove(a),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const n=e.editorPos,r=this._context.viewModel,s=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<n.y){const l=n.y-e.posy,c=Math.max(s.getCurrentScrollTop()-l,0),u=zE.getZoneAtCoord(this._context,c);if(u){const h=this._helpPositionJumpOverViewZone(u);if(h)return dl.createOutsideEditor(o,h,"above",l)}const d=s.getLineNumberAtVerticalOffset(c);return dl.createOutsideEditor(o,new ve(d,1),"above",l)}if(e.posy>n.y+n.height){const l=e.posy-n.y-n.height,c=s.getCurrentScrollTop()+e.relativePos.y,u=zE.getZoneAtCoord(this._context,c);if(u){const h=this._helpPositionJumpOverViewZone(u);if(h)return dl.createOutsideEditor(o,h,"below",l)}const d=s.getLineNumberAtVerticalOffset(c);return dl.createOutsideEditor(o,new ve(d,r.getLineMaxColumn(d)),"below",l)}const a=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+e.relativePos.y);if(e.posx<n.x){const l=n.x-e.posx;return dl.createOutsideEditor(o,new ve(a,1),"left",l)}if(e.posx>n.x+n.width){const l=e.posx-n.x-n.width;return dl.createOutsideEditor(o,new ve(a,r.getLineMaxColumn(a)),"right",l)}return null}_findMousePosition(e,n){const r=this._getPositionOutsideEditor(e);if(r)return r;const s=this._createMouseTarget(e,n);if(!s.position)return null;if(s.type===8||s.type===5){const a=this._helpPositionJumpOverViewZone(s.detail);if(a)return dl.createViewZone(s.type,s.element,s.mouseColumn,a,s.detail)}return s}_helpPositionJumpOverViewZone(e){const n=new ve(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),r=e.positionBefore,s=e.positionAfter;return r&&s?r.isBefore(n)?r:s:null}_dispatchMouse(e,n,r){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:r,inSelectionMode:n,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class _ft extends Le{constructor(e,n,r,s){super(),this._context=e,this._viewHelper=n,this._mouseTargetFactory=r,this._dispatchMouse=s,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,n){this._operation?this._operation.setPosition(e,n):this._operation=new vft(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,n)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class vft extends Le{constructor(e,n,r,s,o,a){super(),this._context=e,this._viewHelper=n,this._mouseTargetFactory=r,this._dispatchMouse=s,this._position=o,this._mouseEvent=a,this._lastTime=Date.now(),this._animationFrameDisposable=mh(()=>this._execute())}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,n){this._position=e,this._mouseEvent=n}_tick(){const e=Date.now(),n=e-this._lastTime;return this._lastTime=e,n}_getScrollSpeed(){const e=this._context.configuration.options.get(66),n=this._context.configuration.options.get(143).height/e,r=this._position.outsideDistance/e;return r<=1.5?Math.max(30,n*(1+r)):r<=3?Math.max(60,n*(2+r)):Math.max(200,n*(7+r))}_execute(){const e=this._context.configuration.options.get(66),n=this._getScrollSpeed(),r=this._tick(),s=n*(r/1e3)*e,o=this._position.outsidePosition==="above"?-s:s;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const a=this._context.viewLayout.getLinesViewportData(),l=this._position.outsidePosition==="above"?a.startLineNumber:a.endLineNumber;let c;{const u=boe(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(143).horizontalScrollbarHeight,h=new L$(this._mouseEvent.pos.x,u.y+u.height-d-.1),f=yoe(this._viewHelper.viewDomNode,u,h);c=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),u,h,f,null)}(!c.position||c.position.lineNumber!==l)&&(this._position.outsidePosition==="above"?c=dl.createOutsideEditor(this._position.mouseColumn,new ve(l,1),"above",this._position.outsideDistance):c=dl.createOutsideEditor(this._position.mouseColumn,new ve(l,this._context.viewModel.getLineMaxColumn(l)),"below",this._position.outsideDistance)),this._dispatchMouse(c,!0,2),this._animationFrameDisposable=mh(()=>this._execute())}}class E${get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,n){const r=new Date().getTime();r-this._lastSetMouseDownCountTime>E$.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=r,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(n)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=n,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}E$.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class Xn{get event(){return this.emitter.event}constructor(e,n,r){const s=o=>this.emitter.fire(o);this.emitter=new _e({onWillAddFirstListener:()=>e.addEventListener(n,s,r),onDidRemoveLastListener:()=>e.removeEventListener(n,s,r)})}dispose(){this.emitter.dispose()}}var yy;(function(i){const e={total:0,min:Number.MAX_VALUE,max:0},n=Object.assign({},e),r=Object.assign({},e),s=Object.assign({},e);let o=0;const a={keydown:0,input:0,render:0};function l(){b(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),a.keydown=1,queueMicrotask(c)}i.onKeyDown=l;function c(){a.keydown===1&&(performance.mark("keydown/end"),a.keydown=2)}function u(){performance.mark("input/start"),a.input=1,_()}i.onBeforeInput=u;function d(){a.input===0&&u(),queueMicrotask(h)}i.onInput=d;function h(){a.input===1&&(performance.mark("input/end"),a.input=2)}function f(){b()}i.onKeyUp=f;function p(){b()}i.onSelectionChange=p;function g(){a.keydown===2&&a.input===2&&a.render===0&&(performance.mark("render/start"),a.render=1,queueMicrotask(m),_())}i.onRenderStart=g;function m(){a.render===1&&(performance.mark("render/end"),a.render=2)}function _(){setTimeout(b)}function b(){a.keydown===2&&a.input===2&&a.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),y("keydown",e),y("input",n),y("render",r),y("inputlatency",s),o++,x())}function y(E,A){const M=performance.getEntriesByName(E)[0].duration;A.total+=M,A.min=Math.min(A.min,M),A.max=Math.max(A.max,M)}function x(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),a.keydown=0,a.input=0,a.render=0}function k(){if(o===0)return;const E={keydown:D(e),input:D(n),render:D(r),total:D(s),sampleCount:o};return R(e),R(n),R(r),R(s),o=0,E}i.getAndClearMeasurements=k;function D(E){return{average:E.total/o,max:E.max,min:E.min}}function R(E){E.total=0,E.min=Number.MAX_VALUE,E.max=0}})(yy||(yy={}));class Qo{constructor(e,n,r,s,o){this.value=e,this.selectionStart=n,this.selectionEnd=r,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,n){const r=e.getValue(),s=e.getSelectionStart(),o=e.getSelectionEnd();let a;if(n){const l=r.substring(0,s),c=n.value.substring(0,n.selectionStart);l===c&&(a=n.newlineCountBeforeSelection)}return new Qo(r,s,o,null,a)}collapseSelection(){return this.selectionStart===this.value.length?this:new Qo(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,n,r){n.setValue(e,this.value),r&&n.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var n,r,s,o,a,l,c,u;if(e<=this.selectionStart){const f=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((r=(n=this.selection)===null||n===void 0?void 0:n.getStartPosition())!==null&&r!==void 0?r:null,f,-1)}if(e>=this.selectionEnd){const f=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(s=this.selection)===null||s===void 0?void 0:s.getEndPosition())!==null&&o!==void 0?o:null,f,1)}const d=this.value.substring(this.selectionStart,e);if(d.indexOf("…")===-1)return this._finishDeduceEditorPosition((l=(a=this.selection)===null||a===void 0?void 0:a.getStartPosition())!==null&&l!==void 0?l:null,d,1);const h=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((u=(c=this.selection)===null||c===void 0?void 0:c.getEndPosition())!==null&&u!==void 0?u:null,h,-1)}_finishDeduceEditorPosition(e,n,r){let s=0,o=-1;for(;(o=n.indexOf(`
`,o+1))!==-1;)s++;return[e,r*n.length,s]}static deduceInput(e,n,r){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const s=Math.min(ax(e.value,n.value),e.selectionStart,n.selectionStart),o=Math.min(F9(e.value,n.value),e.value.length-e.selectionEnd,n.value.length-n.selectionEnd);e.value.substring(s,e.value.length-o);const a=n.value.substring(s,n.value.length-o),l=e.selectionStart-s,c=e.selectionEnd-s,u=n.selectionStart-s,d=n.selectionEnd-s;if(u===d){const f=e.selectionStart-s;return{text:a,replacePrevCharCnt:f,replaceNextCharCnt:0,positionDelta:0}}const h=c-l;return{text:a,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===n.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:n.selectionEnd-e.selectionEnd};const r=Math.min(ax(e.value,n.value),e.selectionEnd),s=Math.min(F9(e.value,n.value),e.value.length-e.selectionEnd),o=e.value.substring(r,e.value.length-s),a=n.value.substring(r,n.value.length-s);e.selectionStart-r;const l=e.selectionEnd-r;n.selectionStart-r;const c=n.selectionEnd-r;return{text:a,replacePrevCharCnt:l,replaceNextCharCnt:o.length-l,positionDelta:c-a.length}}}Qo.EMPTY=new Qo("",0,0,null,void 0);class f2{static _getPageOfLine(e,n){return Math.floor((e-1)/n)}static _getRangeForPage(e,n){const r=e*n,s=r+1,o=r+n;return new J(s,1,o+1,1)}static fromEditorSelection(e,n,r,s){const a=f2._getPageOfLine(n.startLineNumber,r),l=f2._getRangeForPage(a,r),c=f2._getPageOfLine(n.endLineNumber,r),u=f2._getRangeForPage(c,r);let d=l.intersectRanges(new J(1,1,n.startLineNumber,n.startColumn));if(s&&e.getValueLengthInRange(d,1)>500){const b=e.modifyPosition(d.getEndPosition(),-500);d=J.fromPositions(b,d.getEndPosition())}const h=e.getValueInRange(d,1),f=e.getLineCount(),p=e.getLineMaxColumn(f);let g=u.intersectRanges(new J(n.endLineNumber,n.endColumn,f,p));if(s&&e.getValueLengthInRange(g,1)>500){const b=e.modifyPosition(g.getStartPosition(),500);g=J.fromPositions(g.getStartPosition(),b)}const m=e.getValueInRange(g,1);let _;if(a===c||a+1===c)_=e.getValueInRange(n,1);else{const b=l.intersectRanges(n),y=u.intersectRanges(n);_=e.getValueInRange(b,1)+"…"+e.getValueInRange(y,1)}return s&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new Qo(h+_+m,h.length,h.length+_.length,n,d.endLineNumber-d.startLineNumber)}}var i7;(function(i){i.Tap="-monaco-textarea-synthetic-tap"})(i7||(i7={}));const RJ={forceCopyWithSyntaxHighlighting:!1};class EP{constructor(){this._lastState=null}set(e,n){this._lastState={lastCopiedValue:e,data:n}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}EP.INSTANCE=new EP;class bft{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const n={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,n}}class yft extends Le{get textAreaState(){return this._textAreaState}constructor(e,n,r,s){super(),this._host=e,this._textArea=n,this._OS=r,this._browser=s,this._onFocus=this._register(new _e),this.onFocus=this._onFocus.event,this._onBlur=this._register(new _e),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new _e),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new _e),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new _e),this.onCut=this._onCut.event,this._onPaste=this._register(new _e),this.onPaste=this._onPaste.event,this._onType=this._register(new _e),this.onType=this._onType.event,this._onCompositionStart=this._register(new _e),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new _e),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new _e),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new _e),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new Ji(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Ji(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=Qo.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(a=>{const l=new yr(a);(l.keyCode===114||this._currentComposition&&l.keyCode===1)&&l.stopPropagation(),l.equals(9)&&l.preventDefault(),o=l,this._onKeyDown.fire(l)})),this._register(this._textArea.onKeyUp(a=>{const l=new yr(a);this._onKeyUp.fire(l)})),this._register(this._textArea.onCompositionStart(a=>{const l=new bft;if(this._currentComposition){this._currentComposition=l;return}if(this._currentComposition=l,this._OS===2&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===a.data&&(o.code==="ArrowRight"||o.code==="ArrowLeft")){l.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:a.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:a.data});return}this._onCompositionStart.fire({data:a.data})})),this._register(this._textArea.onCompositionUpdate(a=>{const l=this._currentComposition;if(!l)return;if(this._browser.isAndroid){const u=Qo.readFromTextArea(this._textArea,this._textAreaState),d=Qo.deduceAndroidCompositionInput(this._textAreaState,u);this._textAreaState=u,this._onType.fire(d),this._onCompositionUpdate.fire(a);return}const c=l.handleCompositionUpdate(a.data);this._textAreaState=Qo.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(c),this._onCompositionUpdate.fire(a)})),this._register(this._textArea.onCompositionEnd(a=>{const l=this._currentComposition;if(!l)return;if(this._currentComposition=null,this._browser.isAndroid){const u=Qo.readFromTextArea(this._textArea,this._textAreaState),d=Qo.deduceAndroidCompositionInput(this._textAreaState,u);this._textAreaState=u,this._onType.fire(d),this._onCompositionEnd.fire();return}const c=l.handleCompositionUpdate(a.data);this._textAreaState=Qo.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(c),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(a=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const l=Qo.readFromTextArea(this._textArea,this._textAreaState),c=Qo.deduceInput(this._textAreaState,l,this._OS===2);c.replacePrevCharCnt===0&&c.text.length===1&&(xo(c.text.charCodeAt(0))||c.text.charCodeAt(0)===127)||(this._textAreaState=l,(c.text!==""||c.replacePrevCharCnt!==0||c.replaceNextCharCnt!==0||c.positionDelta!==0)&&this._onType.fire(c))})),this._register(this._textArea.onCut(a=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(a),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(a=>{this._ensureClipboardGetsEditorSelection(a)})),this._register(this._textArea.onPaste(a=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),a.preventDefault(),!a.clipboardData)return;let[l,c]=AJ.getTextData(a.clipboardData);l&&(c=c||EP.INSTANCE.get(l),this._onPaste.fire({text:l,metadata:c}))})),this._register(this._textArea.onFocus(()=>{const a=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!a&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return Be(this._textArea.ownerDocument,"selectionchange",n=>{if(yy.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const r=Date.now(),s=r-e;if(e=r,s<5)return;const o=r-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const a=this._textArea.getValue();if(this._textAreaState.value!==a)return;const l=this._textArea.getSelectionStart(),c=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===l&&this._textAreaState.selectionEnd===c)return;const u=this._textAreaState.deduceEditorPosition(l),d=this._host.deduceModelPosition(u[0],u[1],u[2]),h=this._textAreaState.deduceEditorPosition(c),f=this._host.deduceModelPosition(h[0],h[1],h[2]),p=new Ft(d.lineNumber,d.column,f.lineNumber,f.column);this._onSelectionChangeRequest.fire(p)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,n){this._hasFocus||(n=n.collapseSelection()),n.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=n}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const n=this._host.getDataToCopy(),r={version:1,isFromEmptySelection:n.isFromEmptySelection,multicursorText:n.multicursorText,mode:n.mode};EP.INSTANCE.set(this._browser.isFirefox?n.text.replace(/\r\n/g,`
`):n.text,r),e.preventDefault(),e.clipboardData&&AJ.setTextData(e.clipboardData,n.text,n.html,r)}}const AJ={getTextData(i){const e=i.getData(bs.text);let n=null;const r=i.getData("vscode-editor-data");if(typeof r=="string")try{n=JSON.parse(r),n.version!==1&&(n=null)}catch{}return e.length===0&&n===null&&i.files.length>0?[Array.prototype.slice.call(i.files,0).map(o=>o.name).join(`
`),null]:[e,n]},setTextData(i,e,n,r){i.setData(bs.text,e),typeof n=="string"&&i.setData("text/html",n),i.setData("vscode-editor-data",JSON.stringify(r))}};class wft extends Le{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Xn(this._actual,"keydown")).event,this.onKeyUp=this._register(new Xn(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Xn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Xn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Xn(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Xn(this._actual,"beforeinput")).event,this.onInput=this._register(new Xn(this._actual,"input")).event,this.onCut=this._register(new Xn(this._actual,"cut")).event,this.onCopy=this._register(new Xn(this._actual,"copy")).event,this.onPaste=this._register(new Xn(this._actual,"paste")).event,this.onFocus=this._register(new Xn(this._actual,"focus")).event,this.onBlur=this._register(new Xn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new _e),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>yy.onKeyDown())),this._register(this.onBeforeInput(()=>yy.onBeforeInput())),this._register(this.onInput(()=>yy.onInput())),this._register(this.onKeyUp(()=>yy.onKeyUp())),this._register(Be(this._actual,i7.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=dx(this._actual);return e?e.activeElement===this._actual:Zse(this._actual)?this._actual.ownerDocument.activeElement===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,n){const r=this._actual;r.value!==n&&(this.setIgnoreSelectionChangeTime("setValue"),r.value=n)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,n,r){const s=this._actual;let o=null;const a=dx(s);a?o=a.activeElement:o=s.ownerDocument.activeElement;const l=o===s,c=s.selectionStart,u=s.selectionEnd;if(l&&c===n&&u===r){gh&&window.parent!==window&&s.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(n,r),gh&&window.parent!==window&&s.focus();return}try{const d=elt(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(n,r),tlt(s,d)}catch{}}}class Cft extends koe{constructor(e,n,r){super(e,n,r),this._register(or.addTarget(this.viewHelper.linesContentDomNode)),this._register(Be(this.viewHelper.linesContentDomNode,lr.Tap,o=>this.onTap(o))),this._register(Be(this.viewHelper.linesContentDomNode,lr.Change,o=>this.onChange(o))),this._register(Be(this.viewHelper.linesContentDomNode,lr.Contextmenu,o=>this._onContextMenu(new b1(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(Be(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const a=o.pointerType;if(a==="mouse"){this._lastPointerType="mouse";return}else a==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new Vht(this.viewHelper.viewDomNode);this._register(s.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(s.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,(o,a)=>this._onMouseDown(o,a)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const n=this._createMouseTarget(new b1(e,!1,this.viewHelper.viewDomNode),!1);n.position&&this.viewController.dispatchMouse({position:n.position,mouseColumn:n.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:n.type===6&&n.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,n){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,n)}}class Sft extends koe{constructor(e,n,r){super(e,n,r),this._register(or.addTarget(this.viewHelper.linesContentDomNode)),this._register(Be(this.viewHelper.linesContentDomNode,lr.Tap,s=>this.onTap(s))),this._register(Be(this.viewHelper.linesContentDomNode,lr.Change,s=>this.onChange(s))),this._register(Be(this.viewHelper.linesContentDomNode,lr.Contextmenu,s=>this._onContextMenu(new b1(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const n=this._createMouseTarget(new b1(e,!1,this.viewHelper.viewDomNode),!1);if(n.position){const r=document.createEvent("CustomEvent");r.initEvent(i7.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(r),this.viewController.moveTo(n.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class xft extends Le{constructor(e,n,r){super(),Kp&&Yse.pointerEvents?this.handler=this._register(new Cft(e,n,r)):window.TouchEvent?this.handler=this._register(new Sft(e,n,r)):this.handler=this._register(new koe(e,n,r))}getTargetAtClientPoint(e,n){return this.handler.getTargetAtClientPoint(e,n)}}class Zx extends N5{}const Do=qn("themeService");function Qr(i){return{id:i}}function NJ(i){switch(i){case sh.DARK:return"vs-dark";case sh.HIGH_CONTRAST_DARK:return"hc-black";case sh.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const LIe={ThemingContribution:"base.contributions.theming"};class kft{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new _e}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),gn(()=>{const n=this.themingParticipants.indexOf(e);this.themingParticipants.splice(n,1)})}getThemingParticipants(){return this.themingParticipants}}const DIe=new kft;Kr.add(LIe.ThemingContribution,DIe);function Of(i){return DIe.onColorThemeChange(i)}class Lft extends Le{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(n=>this.onThemeChange(n)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const EIe=ce("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},L("lineHighlight","Background color for the highlight of line at the cursor position.")),bge=ce("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Jn},L("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));ce("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},L("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);ce("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Dr,hcLight:Dr},L("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);ce("editor.symbolHighlightBackground",{dark:xm,light:xm,hcDark:null,hcLight:null},L("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);ce("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Dr,hcLight:Dr},L("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const IIe=ce("editorCursor.foreground",{dark:"#AEAFAD",light:Te.black,hcDark:Te.white,hcLight:"#0F4A85"},L("caret","Color of the editor cursor.")),Dft=ce("editorCursor.background",null,L("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),iv=ce("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},L("editorWhitespaces","Color of whitespace characters in the editor.")),Eft=ce("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:Te.white,hcLight:"#292929"},L("editorLineNumbers","Color of editor line numbers.")),q3=ce("editorIndentGuide.background",{dark:iv,light:iv,hcDark:iv,hcLight:iv},L("editorIndentGuides","Color of the editor indentation guides."),!1,L("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),K3=ce("editorIndentGuide.activeBackground",{dark:iv,light:iv,hcDark:iv,hcLight:iv},L("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,L("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),O5=ce("editorIndentGuide.background1",{dark:q3,light:q3,hcDark:q3,hcLight:q3},L("editorIndentGuides1","Color of the editor indentation guides (1).")),Ift=ce("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorIndentGuides2","Color of the editor indentation guides (2).")),Tft=ce("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorIndentGuides3","Color of the editor indentation guides (3).")),Rft=ce("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorIndentGuides4","Color of the editor indentation guides (4).")),Aft=ce("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorIndentGuides5","Color of the editor indentation guides (5).")),Nft=ce("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorIndentGuides6","Color of the editor indentation guides (6).")),F5=ce("editorIndentGuide.activeBackground1",{dark:K3,light:K3,hcDark:K3,hcLight:K3},L("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Mft=ce("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Pft=ce("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Oft=ce("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),Fft=ce("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Bft=ce("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),G3=ce("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Dr,hcLight:Dr},L("editorActiveLineNumber","Color of editor active line number"),!1,L("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));ce("editorLineNumber.activeForeground",{dark:G3,light:G3,hcDark:G3,hcLight:G3},L("editorActiveLineNumber","Color of editor active line number"));const jft=ce("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},L("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));ce("editorRuler.foreground",{dark:"#5A5A5A",light:Te.lightgrey,hcDark:Te.white,hcLight:"#292929"},L("editorRuler","Color of the editor rulers."));ce("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},L("editorCodeLensForeground","Foreground color of editor CodeLens"));ce("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},L("editorBracketMatchBackground","Background color behind matching brackets"));ce("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Jn,hcLight:Jn},L("editorBracketMatchBorder","Color for matching brackets boxes"));const Wft=ce("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},L("editorOverviewRulerBorder","Color of the overview ruler border.")),$ft=ce("editorOverviewRuler.background",null,L("editorOverviewRulerBackground","Background color of the editor overview ruler."));ce("editorGutter.background",{dark:Lo,light:Lo,hcDark:Lo,hcLight:Lo},L("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));ce("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:Te.fromHex("#fff").transparent(.8),hcLight:Jn},L("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const zft=ce("editorUnnecessaryCode.opacity",{dark:Te.fromHex("#000a"),light:Te.fromHex("#0007"),hcDark:null,hcLight:null},L("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));ce("editorGhostText.border",{dark:null,light:null,hcDark:Te.fromHex("#fff").transparent(.8),hcLight:Te.fromHex("#292929").transparent(.8)},L("editorGhostTextBorder","Border color of ghost text in the editor."));ce("editorGhostText.foreground",{dark:Te.fromHex("#ffffff56"),light:Te.fromHex("#0007"),hcDark:null,hcLight:null},L("editorGhostTextForeground","Foreground color of the ghost text in the editor."));ce("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},L("editorGhostTextBackground","Background color of the ghost text in the editor."));const X3=new Te(new ii(0,122,204,.6)),TIe=ce("editorOverviewRuler.rangeHighlightForeground",{dark:X3,light:X3,hcDark:X3,hcLight:X3},L("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Vft=ce("editorOverviewRuler.errorForeground",{dark:new Te(new ii(255,18,18,.7)),light:new Te(new ii(255,18,18,.7)),hcDark:new Te(new ii(255,50,50,1)),hcLight:"#B5200D"},L("overviewRuleError","Overview ruler marker color for errors.")),Hft=ce("editorOverviewRuler.warningForeground",{dark:Ju,light:Ju,hcDark:SP,hcLight:SP},L("overviewRuleWarning","Overview ruler marker color for warnings.")),Uft=ce("editorOverviewRuler.infoForeground",{dark:_c,light:_c,hcDark:xP,hcLight:xP},L("overviewRuleInfo","Overview ruler marker color for infos.")),RIe=ce("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},L("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),AIe=ce("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},L("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),NIe=ce("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},L("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),MIe=ce("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),PIe=ce("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),OIe=ce("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),qft=ce("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Te(new ii(255,18,18,.8)),light:new Te(new ii(255,18,18,.8)),hcDark:new Te(new ii(255,50,50,1)),hcLight:""},L("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Kft=ce("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Gft=ce("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Xft=ce("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Yft=ce("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Zft=ce("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Qft=ce("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Jft=ce("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),ept=ce("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),tpt=ce("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),npt=ce("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),ipt=ce("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),rpt=ce("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},L("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));ce("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},L("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));ce("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},L("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));Of((i,e)=>{const n=i.getColor(Lo),r=i.getColor(EIe),s=r&&!r.isTransparent()?r:n;s&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});class B5 extends Zx{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ve(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const n=e.get(67);this._renderLineNumbers=n.renderType,this._renderCustomLineNumbers=n.renderFn,this._renderFinalNewline=e.get(94);const r=e.get(143);this._lineNumbersLeft=r.lineNumbersLeft,this._lineNumbersWidth=r.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const n=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(n);let r=!1;return this._activeLineNumber!==n.lineNumber&&(this._activeLineNumber=n.lineNumber,r=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(r=!0),r}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const n=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ve(e,1));if(n.column!==1)return"";const r=n.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(r);if(this._renderLineNumbers===2){const s=Math.abs(this._lastCursorModelPosition.lineNumber-r);return s===0?'<span class="relative-current-line-number">'+r+"</span>":String(s)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===r||r%10===0?String(r):"":String(r)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const n=_l?this._lineHeight%2===0?" lh-even":" lh-odd":"",r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),a=[];for(let l=r;l<=s;l++){const c=l-r,u=this._getLineRenderLineNumber(l);if(!u){a[c]="";continue}let d="";if(l===o&&this._context.viewModel.getLineLength(l)===0){if(this._renderFinalNewline==="off"){a[c]="";continue}this._renderFinalNewline==="dimmed"&&(d=" dimmed-line-number")}l===this._activeLineNumber&&(d=" active-line-number"),a[c]=`<div class="${B5.CLASS_NAME}${n}${d}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${u}</div>`}this._renderResult=a}render(e,n){if(!this._renderResult)return"";const r=n-e;return r<0||r>=this._renderResult.length?"":this._renderResult[r]}}B5.CLASS_NAME="line-numbers";Of((i,e)=>{const n=i.getColor(Eft),r=i.getColor(jft);r?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${r}; }`):n&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n.transparent(.4)}; }`)});class hx extends hu{constructor(e){super(e);const n=this._context.configuration.options,r=n.get(143);this._canUseLayerHinting=!n.get(32),this._contentLeft=r.contentLeft,this._glyphMarginLeft=r.glyphMarginLeft,this._glyphMarginWidth=r.glyphMarginWidth,this._domNode=Di(document.createElement("div")),this._domNode.setClassName(hx.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Di(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(hx.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const n=this._context.configuration.options,r=n.get(143);return this._canUseLayerHinting=!n.get(32),this._contentLeft=r.contentLeft,this._glyphMarginLeft=r.glyphMarginLeft,this._glyphMarginWidth=r.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const n=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-n);const r=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(r),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(r)}}hx.CLASS_NAME="glyph-margin";hx.OUTER_CLASS_NAME="margin";const q2="monaco-mouse-cursor-text";class spt{constructor(){this._onDidChange=new _e,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const iM=new spt,sr=qn("keybindingService");var opt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},apt=function(i,e){return function(n,r){e(n,r,i)}};class lpt{constructor(e,n,r,s,o){this._context=e,this.modelLineNumber=n,this.distanceToModelLineStart=r,this.widthOfHiddenLineTextBefore=s,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const n=new ve(this.modelLineNumber,this.distanceToModelLineStart+1),r=new ve(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const _q=gh;let MJ=class extends hu{constructor(e,n,r,s){super(e),this._keybindingService=s,this._primaryCursorPosition=new ve(1,1),this._primaryCursorVisibleRange=null,this._viewController=n,this._visibleRangeProvider=r,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,a=o.get(143);this._setAccessibilityOptions(o),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=o.get(50),this._lineHeight=o.get(66),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new Ft(1,1,1,1)],this._modelSelections=[new Ft(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Di(document.createElement("textarea")),Ym.write(this.textArea,6),this.textArea.setClassName(`inputarea ${q2}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${l*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("aria-required",o.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",L("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Di(document.createElement("div")),this.textAreaCover.setPosition("absolute");const c={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:h=>this._context.viewModel.getLineMaxColumn(h),getValueInRange:(h,f)=>this._context.viewModel.getValueInRange(h,f),getValueLengthInRange:(h,f)=>this._context.viewModel.getValueLengthInRange(h,f),modifyPosition:(h,f)=>this._context.viewModel.modifyPosition(h,f)},u={getDataToCopy:()=>{const h=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Aa),f=this._context.viewModel.model.getEOL(),p=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(h)?h:null,m=Array.isArray(h)?h.join(f):h;let _,b=null;if(RJ.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&m.length<65536){const y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(_=y.html,b=y.mode)}return{isFromEmptySelection:p,multicursorText:g,text:m,html:_,mode:b}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const h=this._selections[0];if(ri&&h.isEmpty()){const p=h.getStartPosition();let g=this._getWordBeforePosition(p);if(g.length===0&&(g=this._getCharacterBeforePosition(p)),g.length>0)return new Qo(g,g.length,g.length,J.fromPositions(p),0)}if(ri&&!h.isEmpty()&&c.getValueLengthInRange(h,0)<500){const p=c.getValueInRange(h,0);return new Qo(p,0,p.length,h,0)}if(h1&&!h.isEmpty()){const p="vscode-placeholder";return new Qo(p,0,p.length,null,void 0)}return Qo.EMPTY}if(Gfe){const h=this._selections[0];if(h.isEmpty()){const f=h.getStartPosition(),[p,g]=this._getAndroidWordAtPosition(f);if(p.length>0)return new Qo(p,g,g,J.fromPositions(f),0)}return Qo.EMPTY}return f2.fromEditorSelection(c,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(h,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(h,f,p)},d=this._register(new wft(this.textArea.domNode));this._textAreaInput=this._register(new yft(u,d,Zu,{isAndroid:Gfe,isChrome:qse,isFirefox:gh,isSafari:h1})),this._register(this._textAreaInput.onKeyDown(h=>{this._viewController.emitKeyDown(h)})),this._register(this._textAreaInput.onKeyUp(h=>{this._viewController.emitKeyUp(h)})),this._register(this._textAreaInput.onPaste(h=>{let f=!1,p=null,g=null;h.metadata&&(f=this._emptySelectionClipboard&&!!h.metadata.isFromEmptySelection,p=typeof h.metadata.multicursorText<"u"?h.metadata.multicursorText:null,g=h.metadata.mode),this._viewController.paste(h.text,f,p,g)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(h=>{h.replacePrevCharCnt||h.replaceNextCharCnt||h.positionDelta?this._viewController.compositionType(h.text,h.replacePrevCharCnt,h.replaceNextCharCnt,h.positionDelta):this._viewController.type(h.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(h=>{this._viewController.setSelection(h)})),this._register(this._textAreaInput.onCompositionStart(h=>{const f=this.textArea.domNode,p=this._modelSelections[0],{distanceToModelLineStart:g,widthOfHiddenTextBefore:m}=(()=>{const b=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),y=b.lastIndexOf(`
`),x=b.substring(y+1),k=x.lastIndexOf(" "),D=x.length-k-1,R=p.getStartPosition(),E=Math.min(R.column-1,D),A=R.column-1-E,M=x.substring(0,x.length-E),{tabSize:N}=this._context.viewModel.model.getOptions(),P=cpt(this.textArea.domNode.ownerDocument,M,this._fontInfo,N);return{distanceToModelLineStart:A,widthOfHiddenTextBefore:P}})(),{distanceToModelLineEnd:_}=(()=>{const b=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),y=b.indexOf(`
`),x=y===-1?b:b.substring(0,y),k=x.indexOf(" "),D=k===-1?x.length:x.length-k-1,R=p.getEndPosition(),E=Math.min(this._context.viewModel.model.getLineMaxColumn(R.lineNumber)-R.column,D);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(R.lineNumber)-R.column-E}})();this._context.viewModel.revealRange("keyboard",!0,J.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new lpt(this._context,p.startLineNumber,g,m,_),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${q2} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(h=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${q2}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(iM.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const n='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',r=this._context.viewModel.getLineContent(e.lineNumber),s=vh(n);let o=!0,a=e.column,l=!0,c=e.column,u=0;for(;u<50&&(o||l);){if(o&&a<=1&&(o=!1),o){const d=r.charCodeAt(a-2);s.get(d)!==0?o=!1:a--}if(l&&c>r.length&&(l=!1),l){const d=r.charCodeAt(c-1);s.get(d)!==0?l=!1:c++}u++}return[r.substring(a-1,c-1),e.column-a]}_getWordBeforePosition(e){const n=this._context.viewModel.getLineContent(e.lineNumber),r=vh(this._context.configuration.options.get(129));let s=e.column,o=0;for(;s>1;){const a=n.charCodeAt(s-2);if(r.get(a)!==0||o>50)return n.substring(s-1,e.column-1);o++,s--}return n.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const r=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!xo(r.charCodeAt(0)))return r}return""}_getAriaLabel(e){var n,r,s;if(e.get(2)===1){const a=(n=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||n===void 0?void 0:n.getAriaLabel(),l=(r=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||r===void 0?void 0:r.getAriaLabel(),c=(s=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||s===void 0?void 0:s.getAriaLabel(),u=L("accessibilityModeOff","The editor is not accessible at this time.");return a?L("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",u,a):l?L("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",u,l):c?L("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",u,c):u}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const n=e.get(3);this._accessibilitySupport===2&&n===rg.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=n;const s=e.get(143).wrappingColumn;if(s!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(s*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=_q?0:1}onConfigurationChanged(e){const n=this._context.configuration.options,r=n.get(143);this._setAccessibilityOptions(n),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=n.get(50),this._lineHeight=n.get(66),this._emptySelectionClipboard=n.get(37),this._copyWithSyntaxHighlighting=n.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:s}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${s*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(n)),this.textArea.setAttribute("aria-required",n.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(n.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!iM.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var n;this._primaryCursorPosition=new ve(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(n=this._visibleTextArea)===null||n===void 0||n.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const s=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,a=this._visibleTextArea.startPosition,l=this._visibleTextArea.endPosition;if(a&&l&&s&&o&&o.left>=this._scrollLeft&&s.left<=this._scrollLeft+this._contentWidth){const c=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,u=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let d=this._visibleTextArea.widthOfHiddenLineTextBefore,h=this._contentLeft+s.left-this._scrollLeft,f=o.left-s.left+1;if(h<this._contentLeft){const y=this._contentLeft-h;h+=y,d+=y,f-=y}f>this._contentWidth&&(f=this._contentWidth);const p=this._context.viewModel.getViewLineData(a.lineNumber),g=p.tokens.findTokenIndexAtOffset(a.column-1),m=p.tokens.findTokenIndexAtOffset(l.column-1),_=g===m,b=this._visibleTextArea.definePresentation(_?p.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=u*this._lineHeight,this.textArea.domNode.scrollLeft=d,this._doRender({lastRenderPosition:null,top:c,left:h,width:f,height:this._lineHeight,useCover:!1,color:(Zr.getColorMap()||[])[b.foreground],italic:b.italic,bold:b.bold,underline:b.underline,strikethrough:b.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const n=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(n<this._contentLeft||n>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const r=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(r<0||r>this._contentHeight){this._renderAtTopLeft();return}if(ri){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:r,left:this._textAreaWrapping?this._contentLeft:n,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const s=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=s*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:r,left:this._textAreaWrapping?this._contentLeft:n,width:this._textAreaWidth,height:_q?0:1,useCover:!1})}_newlinecount(e){let n=0,r=-1;do{if(r=e.indexOf(`
`,r+1),r===-1)break;n++}while(!0);return n}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:_q?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const n=this.textArea,r=this.textAreaCover;Ta(n,this._fontInfo),n.setTop(e.top),n.setLeft(e.left),n.setWidth(e.width),n.setHeight(e.height),n.setColor(e.color?Te.Format.CSS.formatHex(e.color):""),n.setFontStyle(e.italic?"italic":""),e.bold&&n.setFontWeight("bold"),n.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),r.setTop(e.useCover?e.top:0),r.setLeft(e.useCover?e.left:0),r.setWidth(e.useCover?e.width:0),r.setHeight(e.useCover?e.height:0);const s=this._context.configuration.options;s.get(57)?r.setClassName("monaco-editor-background textAreaCover "+hx.OUTER_CLASS_NAME):s.get(67).renderType!==0?r.setClassName("monaco-editor-background textAreaCover "+B5.CLASS_NAME):r.setClassName("monaco-editor-background textAreaCover")}};MJ=opt([apt(3,sr)],MJ);function cpt(i,e,n,r){if(e.length===0)return 0;const s=i.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=i.createElement("span");Ta(o,n),o.style.whiteSpace="pre",o.style.tabSize=`${r*n.spaceWidth}px`,o.append(e),s.appendChild(o),i.body.appendChild(s);const a=o.offsetWidth;return i.body.removeChild(s),a}function upt(i,e,n){let r=0;for(let o=0;o<i.length;o++)i.charAt(o)===" "?r=ho.nextIndentTabStop(r,e):r++;let s="";if(!n){const o=Math.floor(r/e);r=r%e;for(let a=0;a<o;a++)s+=" "}for(let o=0;o<r;o++)s+=" ";return s}function Loe(i,e,n){let r=ml(i);return r===-1&&(r=i.length),upt(i.substring(0,r),e,n)+i.substring(r)}const dpt=()=>!0,hpt=()=>!1,fpt=i=>i===" "||i===" ";class JL{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,n,r,s){var o;this.languageConfigurationService=s,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const a=r.options,l=a.get(143),c=a.get(50);this.readOnly=a.get(90),this.tabSize=n.tabSize,this.indentSize=n.indentSize,this.insertSpaces=n.insertSpaces,this.stickyTabStops=a.get(115),this.lineHeight=c.lineHeight,this.typicalHalfwidthCharacterWidth=c.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(l.height/this.lineHeight)-2),this.useTabStops=a.get(127),this.wordSeparators=a.get(129),this.emptySelectionClipboard=a.get(37),this.copyWithSyntaxHighlighting=a.get(25),this.multiCursorMergeOverlapping=a.get(76),this.multiCursorPaste=a.get(78),this.multiCursorLimit=a.get(79),this.autoClosingBrackets=a.get(6),this.autoClosingComments=a.get(7),this.autoClosingQuotes=a.get(11),this.autoClosingDelete=a.get(9),this.autoClosingOvertype=a.get(10),this.autoSurround=a.get(14),this.autoIndent=a.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const u=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(u)for(const h of u)this.surroundingPairs[h.open]=h.close;const d=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=d==null?void 0:d.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const n=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(n)for(const r of n)this._electricChars[r]=!0}return this._electricChars}onElectricCharacter(e,n,r){const s=g$(n,r-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,r-s.firstCharOffset):null}normalizeIndentation(e){return Loe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,n,r){switch(n){case"beforeWhitespace":return fpt;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,r);case"always":return dpt;case"never":return hpt}}_getLanguageDefinedShouldAutoClose(e,n){const r=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(n);return s=>r.indexOf(s)!==-1}visibleColumnFromColumn(e,n){return ho.visibleColumnFromColumn(e.getLineContent(n.lineNumber),n.column,this.tabSize)}columnFromVisibleColumn(e,n,r){const s=ho.columnFromVisibleColumn(e.getLineContent(n),r,this.tabSize),o=e.getLineMinColumn(n);if(s<o)return o;const a=e.getLineMaxColumn(n);return s>a?a:s}}let hi=class FIe{static fromModelState(e){return new ppt(e)}static fromViewState(e){return new gpt(e)}static fromModelSelection(e){const n=Ft.liftSelection(e),r=new ta(J.fromPositions(n.getSelectionStart()),0,0,n.getPosition(),0);return FIe.fromModelState(r)}static fromModelSelections(e){const n=[];for(let r=0,s=e.length;r<s;r++)n[r]=this.fromModelSelection(e[r]);return n}constructor(e,n){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=n}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}};class ppt{constructor(e){this.modelState=e,this.viewState=null}}class gpt{constructor(e){this.modelState=null,this.viewState=e}}class ta{constructor(e,n,r,s,o){this.selectionStart=e,this.selectionStartKind=n,this.selectionStartLeftoverVisibleColumns=r,this.position=s,this.leftoverVisibleColumns=o,this._singleCursorStateBrand=void 0,this.selection=ta._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,n,r,s){return e?new ta(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new ve(n,r),s):new ta(new J(n,r,n,r),0,s,new ve(n,r),s)}static _computeSelection(e,n){return e.isEmpty()||!n.isBeforeOrEqual(e.getStartPosition())?Ft.fromPositions(e.getStartPosition(),n):Ft.fromPositions(e.getEndPosition(),n)}}class lc{constructor(e,n,r){this._editOperationResultBrand=void 0,this.type=e,this.commands=n,this.shouldPushStackElementBefore=r.shouldPushStackElementBefore,this.shouldPushStackElementAfter=r.shouldPushStackElementAfter}}function Yb(i){return i==="'"||i==='"'||i==="`"}class XC{static columnSelect(e,n,r,s,o,a){const l=Math.abs(o-r)+1,c=r>o,u=s>a,d=s<a,h=[];for(let f=0;f<l;f++){const p=r+(c?-f:f),g=e.columnFromVisibleColumn(n,p,s),m=e.columnFromVisibleColumn(n,p,a),_=e.visibleColumnFromColumn(n,new ve(p,g)),b=e.visibleColumnFromColumn(n,new ve(p,m));d&&(_>a||b<s)||u&&(b>s||_<a)||h.push(new ta(new J(p,g,p,g),0,0,new ve(p,m),0))}if(h.length===0)for(let f=0;f<l;f++){const p=r+(c?-f:f),g=n.getLineMaxColumn(p);h.push(new ta(new J(p,g,p,g),0,0,new ve(p,g),0))}return{viewStates:h,reversed:c,fromLineNumber:r,fromVisualColumn:s,toLineNumber:o,toVisualColumn:a}}static columnSelectLeft(e,n,r){let s=r.toViewVisualColumn;return s>0&&s--,XC.columnSelect(e,n,r.fromViewLineNumber,r.fromViewVisualColumn,r.toViewLineNumber,s)}static columnSelectRight(e,n,r){let s=0;const o=Math.min(r.fromViewLineNumber,r.toViewLineNumber),a=Math.max(r.fromViewLineNumber,r.toViewLineNumber);for(let c=o;c<=a;c++){const u=n.getLineMaxColumn(c),d=e.visibleColumnFromColumn(n,new ve(c,u));s=Math.max(s,d)}let l=r.toViewVisualColumn;return l<s&&l++,this.columnSelect(e,n,r.fromViewLineNumber,r.fromViewVisualColumn,r.toViewLineNumber,l)}static columnSelectUp(e,n,r,s){const o=s?e.pageSize:1,a=Math.max(1,r.toViewLineNumber-o);return this.columnSelect(e,n,r.fromViewLineNumber,r.fromViewVisualColumn,a,r.toViewVisualColumn)}static columnSelectDown(e,n,r,s){const o=s?e.pageSize:1,a=Math.min(n.getLineCount(),r.toViewLineNumber+o);return this.columnSelect(e,n,r.fromViewLineNumber,r.fromViewVisualColumn,a,r.toViewVisualColumn)}}class Sa{constructor(e,n,r=!1){this._range=e,this._text=n,this.insertsAutoWhitespace=r}getEditOperations(e,n){n.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,n){const s=n.getInverseEditOperations()[0].range;return Ft.fromPositions(s.getEndPosition())}}class mpt{constructor(e,n){this._range=e,this._text=n}getEditOperations(e,n){n.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,n){const s=n.getInverseEditOperations()[0].range;return Ft.fromRange(s,0)}}class Y3{constructor(e,n,r=!1){this._range=e,this._text=n,this.insertsAutoWhitespace=r}getEditOperations(e,n){n.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,n){const s=n.getInverseEditOperations()[0].range;return Ft.fromPositions(s.getStartPosition())}}class g8{constructor(e,n,r,s,o=!1){this._range=e,this._text=n,this._columnDeltaOffset=s,this._lineNumberDeltaOffset=r,this.insertsAutoWhitespace=o}getEditOperations(e,n){n.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,n){const s=n.getInverseEditOperations()[0].range;return Ft.fromPositions(s.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class Doe{constructor(e,n,r,s=!1){this._range=e,this._text=n,this._initialSelection=r,this._forceMoveMarkers=s,this._selectionId=null}getEditOperations(e,n){n.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=n.trackSelection(this._initialSelection)}computeCursorState(e,n){return n.getTrackedSelection(this._selectionId)}}class vq{constructor(e,n,r){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=n,this.leftoverVisibleColumns=r}}class Ri{static leftPosition(e,n){if(n.column>e.getLineMinColumn(n.lineNumber))return n.delta(void 0,-Y2e(e.getLineContent(n.lineNumber),n.column-1));if(n.lineNumber>1){const r=n.lineNumber-1;return new ve(r,e.getLineMaxColumn(r))}else return n}static leftPositionAtomicSoftTabs(e,n,r){if(n.column<=e.getLineIndentColumn(n.lineNumber)){const s=e.getLineMinColumn(n.lineNumber),o=e.getLineContent(n.lineNumber),a=LP.atomicPosition(o,n.column-1,r,0);if(a!==-1&&a+1>=s)return new ve(n.lineNumber,a+1)}return this.leftPosition(e,n)}static left(e,n,r){const s=e.stickyTabStops?Ri.leftPositionAtomicSoftTabs(n,r,e.tabSize):Ri.leftPosition(n,r);return new vq(s.lineNumber,s.column,0)}static moveLeft(e,n,r,s,o){let a,l;if(r.hasSelection()&&!s)a=r.selection.startLineNumber,l=r.selection.startColumn;else{const c=r.position.delta(void 0,-(o-1)),u=n.normalizePosition(Ri.clipPositionColumn(c,n),0),d=Ri.left(e,n,u);a=d.lineNumber,l=d.column}return r.move(s,a,l,0)}static clipPositionColumn(e,n){return new ve(e.lineNumber,Ri.clipRange(e.column,n.getLineMinColumn(e.lineNumber),n.getLineMaxColumn(e.lineNumber)))}static clipRange(e,n,r){return e<n?n:e>r?r:e}static rightPosition(e,n,r){return r<e.getLineMaxColumn(n)?r=r+Vse(e.getLineContent(n),r-1):n<e.getLineCount()&&(n=n+1,r=e.getLineMinColumn(n)),new ve(n,r)}static rightPositionAtomicSoftTabs(e,n,r,s,o){if(r<e.getLineIndentColumn(n)){const a=e.getLineContent(n),l=LP.atomicPosition(a,r-1,s,1);if(l!==-1)return new ve(n,l+1)}return this.rightPosition(e,n,r)}static right(e,n,r){const s=e.stickyTabStops?Ri.rightPositionAtomicSoftTabs(n,r.lineNumber,r.column,e.tabSize,e.indentSize):Ri.rightPosition(n,r.lineNumber,r.column);return new vq(s.lineNumber,s.column,0)}static moveRight(e,n,r,s,o){let a,l;if(r.hasSelection()&&!s)a=r.selection.endLineNumber,l=r.selection.endColumn;else{const c=r.position.delta(void 0,o-1),u=n.normalizePosition(Ri.clipPositionColumn(c,n),1),d=Ri.right(e,n,u);a=d.lineNumber,l=d.column}return r.move(s,a,l,0)}static vertical(e,n,r,s,o,a,l,c){const u=ho.visibleColumnFromColumn(n.getLineContent(r),s,e.tabSize)+o,d=n.getLineCount(),h=r===1&&s===1,f=r===d&&s===n.getLineMaxColumn(r),p=a<r?h:f;if(r=a,r<1?(r=1,l?s=n.getLineMinColumn(r):s=Math.min(n.getLineMaxColumn(r),s)):r>d?(r=d,l?s=n.getLineMaxColumn(r):s=Math.min(n.getLineMaxColumn(r),s)):s=e.columnFromVisibleColumn(n,r,u),p?o=0:o=u-ho.visibleColumnFromColumn(n.getLineContent(r),s,e.tabSize),c!==void 0){const g=new ve(r,s),m=n.normalizePosition(g,c);o=o+(s-m.column),r=m.lineNumber,s=m.column}return new vq(r,s,o)}static down(e,n,r,s,o,a,l){return this.vertical(e,n,r,s,o,r+a,l,4)}static moveDown(e,n,r,s,o){let a,l;r.hasSelection()&&!s?(a=r.selection.endLineNumber,l=r.selection.endColumn):(a=r.position.lineNumber,l=r.position.column);let c=0,u;do if(u=Ri.down(e,n,a+c,l,r.leftoverVisibleColumns,o,!0),n.normalizePosition(new ve(u.lineNumber,u.column),2).lineNumber>a)break;while(c++<10&&a+c<n.getLineCount());return r.move(s,u.lineNumber,u.column,u.leftoverVisibleColumns)}static translateDown(e,n,r){const s=r.selection,o=Ri.down(e,n,s.selectionStartLineNumber,s.selectionStartColumn,r.selectionStartLeftoverVisibleColumns,1,!1),a=Ri.down(e,n,s.positionLineNumber,s.positionColumn,r.leftoverVisibleColumns,1,!1);return new ta(new J(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new ve(a.lineNumber,a.column),a.leftoverVisibleColumns)}static up(e,n,r,s,o,a,l){return this.vertical(e,n,r,s,o,r-a,l,3)}static moveUp(e,n,r,s,o){let a,l;r.hasSelection()&&!s?(a=r.selection.startLineNumber,l=r.selection.startColumn):(a=r.position.lineNumber,l=r.position.column);const c=Ri.up(e,n,a,l,r.leftoverVisibleColumns,o,!0);return r.move(s,c.lineNumber,c.column,c.leftoverVisibleColumns)}static translateUp(e,n,r){const s=r.selection,o=Ri.up(e,n,s.selectionStartLineNumber,s.selectionStartColumn,r.selectionStartLeftoverVisibleColumns,1,!1),a=Ri.up(e,n,s.positionLineNumber,s.positionColumn,r.leftoverVisibleColumns,1,!1);return new ta(new J(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new ve(a.lineNumber,a.column),a.leftoverVisibleColumns)}static _isBlankLine(e,n){return e.getLineFirstNonWhitespaceColumn(n)===0}static moveToPrevBlankLine(e,n,r,s){let o=r.position.lineNumber;for(;o>1&&this._isBlankLine(n,o);)o--;for(;o>1&&!this._isBlankLine(n,o);)o--;return r.move(s,o,n.getLineMinColumn(o),0)}static moveToNextBlankLine(e,n,r,s){const o=n.getLineCount();let a=r.position.lineNumber;for(;a<o&&this._isBlankLine(n,a);)a++;for(;a<o&&!this._isBlankLine(n,a);)a++;return r.move(s,a,n.getLineMinColumn(a),0)}static moveToBeginningOfLine(e,n,r,s){const o=r.position.lineNumber,a=n.getLineMinColumn(o),l=n.getLineFirstNonWhitespaceColumn(o)||a;let c;return r.position.column===l?c=a:c=l,r.move(s,o,c,0)}static moveToEndOfLine(e,n,r,s,o){const a=r.position.lineNumber,l=n.getLineMaxColumn(a);return r.move(s,a,l,o?1073741824-l:0)}static moveToBeginningOfBuffer(e,n,r,s){return r.move(s,1,1,0)}static moveToEndOfBuffer(e,n,r,s){const o=n.getLineCount(),a=n.getLineMaxColumn(o);return r.move(s,o,a,0)}}class fx{static deleteRight(e,n,r,s){const o=[];let a=e!==3;for(let l=0,c=s.length;l<c;l++){const u=s[l];let d=u;if(d.isEmpty()){const h=u.getPosition(),f=Ri.right(n,r,h);d=new J(f.lineNumber,f.column,h.lineNumber,h.column)}if(d.isEmpty()){o[l]=null;continue}d.startLineNumber!==d.endLineNumber&&(a=!0),o[l]=new Sa(d,"")}return[a,o]}static isAutoClosingPairDelete(e,n,r,s,o,a,l){if(n==="never"&&r==="never"||e==="never")return!1;for(let c=0,u=a.length;c<u;c++){const d=a[c],h=d.getPosition();if(!d.isEmpty())return!1;const f=o.getLineContent(h.lineNumber);if(h.column<2||h.column>=f.length+1)return!1;const p=f.charAt(h.column-2),g=s.get(p);if(!g)return!1;if(Yb(p)){if(r==="never")return!1}else if(n==="never")return!1;const m=f.charAt(h.column-1);let _=!1;for(const b of g)b.open===p&&b.close===m&&(_=!0);if(!_)return!1;if(e==="auto"){let b=!1;for(let y=0,x=l.length;y<x;y++){const k=l[y];if(h.lineNumber===k.startLineNumber&&h.column===k.startColumn){b=!0;break}}if(!b)return!1}}return!0}static _runAutoClosingPairDelete(e,n,r){const s=[];for(let o=0,a=r.length;o<a;o++){const l=r[o].getPosition(),c=new J(l.lineNumber,l.column-1,l.lineNumber,l.column+1);s[o]=new Sa(c,"")}return[!0,s]}static deleteLeft(e,n,r,s,o){if(this.isAutoClosingPairDelete(n.autoClosingDelete,n.autoClosingBrackets,n.autoClosingQuotes,n.autoClosingPairs.autoClosingPairsOpenByEnd,r,s,o))return this._runAutoClosingPairDelete(n,r,s);const a=[];let l=e!==2;for(let c=0,u=s.length;c<u;c++){const d=fx.getDeleteRange(s[c],r,n);if(d.isEmpty()){a[c]=null;continue}d.startLineNumber!==d.endLineNumber&&(l=!0),a[c]=new Sa(d,"")}return[l,a]}static getDeleteRange(e,n,r){if(!e.isEmpty())return e;const s=e.getPosition();if(r.useTabStops&&s.column>1){const o=n.getLineContent(s.lineNumber),a=ml(o),l=a===-1?o.length+1:a+1;if(s.column<=l){const c=r.visibleColumnFromColumn(n,s),u=ho.prevIndentTabStop(c,r.indentSize),d=r.columnFromVisibleColumn(n,s.lineNumber,u);return new J(s.lineNumber,d,s.lineNumber,s.column)}}return J.fromPositions(fx.getPositionAfterDeleteLeft(s,n),s)}static getPositionAfterDeleteLeft(e,n){if(e.column>1){const r=Aot(e.column-1,n.getLineContent(e.lineNumber));return e.with(void 0,r+1)}else if(e.lineNumber>1){const r=e.lineNumber-1;return new ve(r,n.getLineMaxColumn(r))}else return e}static cut(e,n,r){const s=[];let o=null;r.sort((a,l)=>ve.compare(a.getStartPosition(),l.getEndPosition()));for(let a=0,l=r.length;a<l;a++){const c=r[a];if(c.isEmpty())if(e.emptySelectionClipboard){const u=c.getPosition();let d,h,f,p;u.lineNumber<n.getLineCount()?(d=u.lineNumber,h=1,f=u.lineNumber+1,p=1):u.lineNumber>1&&(o==null?void 0:o.endLineNumber)!==u.lineNumber?(d=u.lineNumber-1,h=n.getLineMaxColumn(u.lineNumber-1),f=u.lineNumber,p=n.getLineMaxColumn(u.lineNumber)):(d=u.lineNumber,h=1,f=u.lineNumber,p=n.getLineMaxColumn(u.lineNumber));const g=new J(d,h,f,p);o=g,g.isEmpty()?s[a]=null:s[a]=new Sa(g,"")}else s[a]=null;else s[a]=new Sa(c,"")}return new lc(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class wi{static _createWord(e,n,r,s,o){return{start:s,end:o,wordType:n,nextCharClass:r}}static _findPreviousWordOnLine(e,n,r){const s=n.getLineContent(r.lineNumber);return this._doFindPreviousWordOnLine(s,e,r)}static _doFindPreviousWordOnLine(e,n,r){let s=0;for(let o=r.column-2;o>=0;o--){const a=e.charCodeAt(o),l=n.get(a);if(l===0){if(s===2)return this._createWord(e,s,l,o+1,this._findEndOfWord(e,n,s,o+1));s=1}else if(l===2){if(s===1)return this._createWord(e,s,l,o+1,this._findEndOfWord(e,n,s,o+1));s=2}else if(l===1&&s!==0)return this._createWord(e,s,l,o+1,this._findEndOfWord(e,n,s,o+1))}return s!==0?this._createWord(e,s,1,0,this._findEndOfWord(e,n,s,0)):null}static _findEndOfWord(e,n,r,s){const o=e.length;for(let a=s;a<o;a++){const l=e.charCodeAt(a),c=n.get(l);if(c===1||r===1&&c===2||r===2&&c===0)return a}return o}static _findNextWordOnLine(e,n,r){const s=n.getLineContent(r.lineNumber);return this._doFindNextWordOnLine(s,e,r)}static _doFindNextWordOnLine(e,n,r){let s=0;const o=e.length;for(let a=r.column-1;a<o;a++){const l=e.charCodeAt(a),c=n.get(l);if(c===0){if(s===2)return this._createWord(e,s,c,this._findStartOfWord(e,n,s,a-1),a);s=1}else if(c===2){if(s===1)return this._createWord(e,s,c,this._findStartOfWord(e,n,s,a-1),a);s=2}else if(c===1&&s!==0)return this._createWord(e,s,c,this._findStartOfWord(e,n,s,a-1),a)}return s!==0?this._createWord(e,s,1,this._findStartOfWord(e,n,s,o-1),o):null}static _findStartOfWord(e,n,r,s){for(let o=s;o>=0;o--){const a=e.charCodeAt(o),l=n.get(a);if(l===1||r===1&&l===2||r===2&&l===0)return o+1}return 0}static moveWordLeft(e,n,r,s){let o=r.lineNumber,a=r.column;a===1&&o>1&&(o=o-1,a=n.getLineMaxColumn(o));let l=wi._findPreviousWordOnLine(e,n,new ve(o,a));if(s===0)return new ve(o,l?l.start+1:1);if(s===1)return l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=wi._findPreviousWordOnLine(e,n,new ve(o,l.start+1))),new ve(o,l?l.start+1:1);if(s===3){for(;l&&l.wordType===2;)l=wi._findPreviousWordOnLine(e,n,new ve(o,l.start+1));return new ve(o,l?l.start+1:1)}return l&&a<=l.end+1&&(l=wi._findPreviousWordOnLine(e,n,new ve(o,l.start+1))),new ve(o,l?l.end+1:1)}static _moveWordPartLeft(e,n){const r=n.lineNumber,s=e.getLineMaxColumn(r);if(n.column===1)return r>1?new ve(r-1,e.getLineMaxColumn(r-1)):n;const o=e.getLineContent(r);for(let a=n.column-1;a>1;a--){const l=o.charCodeAt(a-2),c=o.charCodeAt(a-1);if(l===95&&c!==95)return new ve(r,a);if(l===45&&c!==45)return new ve(r,a);if((gy(l)||O3(l))&&nm(c))return new ve(r,a);if(nm(l)&&nm(c)&&a+1<s){const u=o.charCodeAt(a);if(gy(u)||O3(u))return new ve(r,a)}}return new ve(r,1)}static moveWordRight(e,n,r,s){let o=r.lineNumber,a=r.column,l=!1;a===n.getLineMaxColumn(o)&&o<n.getLineCount()&&(l=!0,o=o+1,a=1);let c=wi._findNextWordOnLine(e,n,new ve(o,a));if(s===2)c&&c.wordType===2&&c.end-c.start===1&&c.nextCharClass===0&&(c=wi._findNextWordOnLine(e,n,new ve(o,c.end+1))),c?a=c.end+1:a=n.getLineMaxColumn(o);else if(s===3){for(l&&(a=0);c&&(c.wordType===2||c.start+1<=a);)c=wi._findNextWordOnLine(e,n,new ve(o,c.end+1));c?a=c.start+1:a=n.getLineMaxColumn(o)}else c&&!l&&a>=c.start+1&&(c=wi._findNextWordOnLine(e,n,new ve(o,c.end+1))),c?a=c.start+1:a=n.getLineMaxColumn(o);return new ve(o,a)}static _moveWordPartRight(e,n){const r=n.lineNumber,s=e.getLineMaxColumn(r);if(n.column===s)return r<e.getLineCount()?new ve(r+1,1):n;const o=e.getLineContent(r);for(let a=n.column+1;a<s;a++){const l=o.charCodeAt(a-2),c=o.charCodeAt(a-1);if(l!==95&&c===95)return new ve(r,a);if(l!==45&&c===45)return new ve(r,a);if((gy(l)||O3(l))&&nm(c))return new ve(r,a);if(nm(l)&&nm(c)&&a+1<s){const u=o.charCodeAt(a);if(gy(u)||O3(u))return new ve(r,a)}}return new ve(r,s)}static _deleteWordLeftWhitespace(e,n){const r=e.getLineContent(n.lineNumber),s=n.column-2,o=$p(r,s);return o+1<s?new J(n.lineNumber,o+2,n.lineNumber,n.column):null}static deleteWordLeft(e,n){const r=e.wordSeparators,s=e.model,o=e.selection,a=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(fx.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const h=e.selection.getPosition();return new J(h.lineNumber,h.column-1,h.lineNumber,h.column+1)}const l=new ve(o.positionLineNumber,o.positionColumn);let c=l.lineNumber,u=l.column;if(c===1&&u===1)return null;if(a){const h=this._deleteWordLeftWhitespace(s,l);if(h)return h}let d=wi._findPreviousWordOnLine(r,s,l);return n===0?d?u=d.start+1:u>1?u=1:(c--,u=s.getLineMaxColumn(c)):(d&&u<=d.end+1&&(d=wi._findPreviousWordOnLine(r,s,new ve(c,d.start+1))),d?u=d.end+1:u>1?u=1:(c--,u=s.getLineMaxColumn(c))),new J(c,u,l.lineNumber,l.column)}static deleteInsideWord(e,n,r){if(!r.isEmpty())return r;const s=new ve(r.positionLineNumber,r.positionColumn),o=this._deleteInsideWordWhitespace(n,s);return o||this._deleteInsideWordDetermineDeleteRange(e,n,s)}static _charAtIsWhitespace(e,n){const r=e.charCodeAt(n);return r===32||r===9}static _deleteInsideWordWhitespace(e,n){const r=e.getLineContent(n.lineNumber),s=r.length;if(s===0)return null;let o=Math.max(n.column-2,0);if(!this._charAtIsWhitespace(r,o))return null;let a=Math.min(n.column-1,s-1);if(!this._charAtIsWhitespace(r,a))return null;for(;o>0&&this._charAtIsWhitespace(r,o-1);)o--;for(;a+1<s&&this._charAtIsWhitespace(r,a+1);)a++;return new J(n.lineNumber,o+1,n.lineNumber,a+2)}static _deleteInsideWordDetermineDeleteRange(e,n,r){const s=n.getLineContent(r.lineNumber),o=s.length;if(o===0)return r.lineNumber>1?new J(r.lineNumber-1,n.getLineMaxColumn(r.lineNumber-1),r.lineNumber,1):r.lineNumber<n.getLineCount()?new J(r.lineNumber,1,r.lineNumber+1,1):new J(r.lineNumber,1,r.lineNumber,1);const a=h=>h.start+1<=r.column&&r.column<=h.end+1,l=(h,f)=>(h=Math.min(h,r.column),f=Math.max(f,r.column),new J(r.lineNumber,h,r.lineNumber,f)),c=h=>{let f=h.start+1,p=h.end+1,g=!1;for(;p-1<o&&this._charAtIsWhitespace(s,p-1);)g=!0,p++;if(!g)for(;f>1&&this._charAtIsWhitespace(s,f-2);)f--;return l(f,p)},u=wi._findPreviousWordOnLine(e,n,r);if(u&&a(u))return c(u);const d=wi._findNextWordOnLine(e,n,r);return d&&a(d)?c(d):u&&d?l(u.end+1,d.start+1):u?l(u.start+1,u.end+1):d?l(d.start+1,d.end+1):l(1,o+1)}static _deleteWordPartLeft(e,n){if(!n.isEmpty())return n;const r=n.getPosition(),s=wi._moveWordPartLeft(e,r);return new J(r.lineNumber,r.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,n){const r=e.length;for(let s=n;s<r;s++){const o=e.charAt(s);if(o!==" "&&o!==" ")return s}return r}static _deleteWordRightWhitespace(e,n){const r=e.getLineContent(n.lineNumber),s=n.column-1,o=this._findFirstNonWhitespaceChar(r,s);return s+1<o?new J(n.lineNumber,n.column,n.lineNumber,o+1):null}static deleteWordRight(e,n){const r=e.wordSeparators,s=e.model,o=e.selection,a=e.whitespaceHeuristics;if(!o.isEmpty())return o;const l=new ve(o.positionLineNumber,o.positionColumn);let c=l.lineNumber,u=l.column;const d=s.getLineCount(),h=s.getLineMaxColumn(c);if(c===d&&u===h)return null;if(a){const p=this._deleteWordRightWhitespace(s,l);if(p)return p}let f=wi._findNextWordOnLine(r,s,l);return n===2?f?u=f.end+1:u<h||c===d?u=h:(c++,f=wi._findNextWordOnLine(r,s,new ve(c,1)),f?u=f.start+1:u=s.getLineMaxColumn(c)):(f&&u>=f.start+1&&(f=wi._findNextWordOnLine(r,s,new ve(c,f.end+1))),f?u=f.start+1:u<h||c===d?u=h:(c++,f=wi._findNextWordOnLine(r,s,new ve(c,1)),f?u=f.start+1:u=s.getLineMaxColumn(c))),new J(c,u,l.lineNumber,l.column)}static _deleteWordPartRight(e,n){if(!n.isEmpty())return n;const r=n.getPosition(),s=wi._moveWordPartRight(e,r);return new J(r.lineNumber,r.column,s.lineNumber,s.column)}static _createWordAtPosition(e,n,r){const s=new J(n,r.start+1,n,r.end+1);return{word:e.getValueInRange(s),startColumn:s.startColumn,endColumn:s.endColumn}}static getWordAtPosition(e,n,r){const s=vh(n),o=wi._findPreviousWordOnLine(s,e,r);if(o&&o.wordType===1&&o.start<=r.column-1&&r.column-1<=o.end)return wi._createWordAtPosition(e,r.lineNumber,o);const a=wi._findNextWordOnLine(s,e,r);return a&&a.wordType===1&&a.start<=r.column-1&&r.column-1<=a.end?wi._createWordAtPosition(e,r.lineNumber,a):null}static word(e,n,r,s,o){const a=vh(e.wordSeparators),l=wi._findPreviousWordOnLine(a,n,o),c=wi._findNextWordOnLine(a,n,o);if(!s){let p,g;return l&&l.wordType===1&&l.start<=o.column-1&&o.column-1<=l.end?(p=l.start+1,g=l.end+1):c&&c.wordType===1&&c.start<=o.column-1&&o.column-1<=c.end?(p=c.start+1,g=c.end+1):(l?p=l.end+1:p=1,c?g=c.start+1:g=n.getLineMaxColumn(o.lineNumber)),new ta(new J(o.lineNumber,p,o.lineNumber,g),1,0,new ve(o.lineNumber,g),0)}let u,d;l&&l.wordType===1&&l.start<o.column-1&&o.column-1<l.end?(u=l.start+1,d=l.end+1):c&&c.wordType===1&&c.start<o.column-1&&o.column-1<c.end?(u=c.start+1,d=c.end+1):(u=o.column,d=o.column);const h=o.lineNumber;let f;if(r.selectionStart.containsPosition(o))f=r.selectionStart.endColumn;else if(o.isBeforeOrEqual(r.selectionStart.getStartPosition())){f=u;const p=new ve(h,f);r.selectionStart.containsPosition(p)&&(f=r.selectionStart.endColumn)}else{f=d;const p=new ve(h,f);r.selectionStart.containsPosition(p)&&(f=r.selectionStart.startColumn)}return r.move(!0,h,f,0)}}class I$ extends wi{static deleteWordPartLeft(e){const n=Z3([wi.deleteWordLeft(e,0),wi.deleteWordLeft(e,2),wi._deleteWordPartLeft(e.model,e.selection)]);return n.sort(J.compareRangesUsingEnds),n[2]}static deleteWordPartRight(e){const n=Z3([wi.deleteWordRight(e,0),wi.deleteWordRight(e,2),wi._deleteWordPartRight(e.model,e.selection)]);return n.sort(J.compareRangesUsingStarts),n[0]}static moveWordPartLeft(e,n,r){const s=Z3([wi.moveWordLeft(e,n,r,0),wi.moveWordLeft(e,n,r,2),wi._moveWordPartLeft(n,r)]);return s.sort(ve.compare),s[2]}static moveWordPartRight(e,n,r){const s=Z3([wi.moveWordRight(e,n,r,0),wi.moveWordRight(e,n,r,2),wi._moveWordPartRight(n,r)]);return s.sort(ve.compare),s[0]}}function Z3(i){return i.filter(e=>!!e)}class Zo{static addCursorDown(e,n,r){const s=[];let o=0;for(let a=0,l=n.length;a<l;a++){const c=n[a];s[o++]=new hi(c.modelState,c.viewState),r?s[o++]=hi.fromModelState(Ri.translateDown(e.cursorConfig,e.model,c.modelState)):s[o++]=hi.fromViewState(Ri.translateDown(e.cursorConfig,e,c.viewState))}return s}static addCursorUp(e,n,r){const s=[];let o=0;for(let a=0,l=n.length;a<l;a++){const c=n[a];s[o++]=new hi(c.modelState,c.viewState),r?s[o++]=hi.fromModelState(Ri.translateUp(e.cursorConfig,e.model,c.modelState)):s[o++]=hi.fromViewState(Ri.translateUp(e.cursorConfig,e,c.viewState))}return s}static moveToBeginningOfLine(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o];s[o]=this._moveToLineStart(e,l,r)}return s}static _moveToLineStart(e,n,r){const s=n.viewState.position.column,o=n.modelState.position.column,a=s===o,l=n.viewState.position.lineNumber,c=e.getLineFirstNonWhitespaceColumn(l);return!a&&!(s===c)?this._moveToLineStartByView(e,n,r):this._moveToLineStartByModel(e,n,r)}static _moveToLineStartByView(e,n,r){return hi.fromViewState(Ri.moveToBeginningOfLine(e.cursorConfig,e,n.viewState,r))}static _moveToLineStartByModel(e,n,r){return hi.fromModelState(Ri.moveToBeginningOfLine(e.cursorConfig,e.model,n.modelState,r))}static moveToEndOfLine(e,n,r,s){const o=[];for(let a=0,l=n.length;a<l;a++){const c=n[a];o[a]=this._moveToLineEnd(e,c,r,s)}return o}static _moveToLineEnd(e,n,r,s){const o=n.viewState.position,a=e.getLineMaxColumn(o.lineNumber),l=o.column===a,c=n.modelState.position,u=e.model.getLineMaxColumn(c.lineNumber),d=a-o.column===u-c.column;return l||d?this._moveToLineEndByModel(e,n,r,s):this._moveToLineEndByView(e,n,r,s)}static _moveToLineEndByView(e,n,r,s){return hi.fromViewState(Ri.moveToEndOfLine(e.cursorConfig,e,n.viewState,r,s))}static _moveToLineEndByModel(e,n,r,s){return hi.fromModelState(Ri.moveToEndOfLine(e.cursorConfig,e.model,n.modelState,r,s))}static expandLineSelection(e,n){const r=[];for(let s=0,o=n.length;s<o;s++){const a=n[s],l=a.modelState.selection.startLineNumber,c=e.model.getLineCount();let u=a.modelState.selection.endLineNumber,d;u===c?d=e.model.getLineMaxColumn(c):(u++,d=1),r[s]=hi.fromModelState(new ta(new J(l,1,l,1),0,0,new ve(u,d),0))}return r}static moveToBeginningOfBuffer(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o];s[o]=hi.fromModelState(Ri.moveToBeginningOfBuffer(e.cursorConfig,e.model,l.modelState,r))}return s}static moveToEndOfBuffer(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o];s[o]=hi.fromModelState(Ri.moveToEndOfBuffer(e.cursorConfig,e.model,l.modelState,r))}return s}static selectAll(e,n){const r=e.model.getLineCount(),s=e.model.getLineMaxColumn(r);return hi.fromModelState(new ta(new J(1,1,1,1),0,0,new ve(r,s),0))}static line(e,n,r,s,o){const a=e.model.validatePosition(s),l=o?e.coordinatesConverter.validateViewPosition(new ve(o.lineNumber,o.column),a):e.coordinatesConverter.convertModelPositionToViewPosition(a);if(!r){const u=e.model.getLineCount();let d=a.lineNumber+1,h=1;return d>u&&(d=u,h=e.model.getLineMaxColumn(d)),hi.fromModelState(new ta(new J(a.lineNumber,1,d,h),2,0,new ve(d,h),0))}const c=n.modelState.selectionStart.getStartPosition().lineNumber;if(a.lineNumber<c)return hi.fromViewState(n.viewState.move(!0,l.lineNumber,1,0));if(a.lineNumber>c){const u=e.getLineCount();let d=l.lineNumber+1,h=1;return d>u&&(d=u,h=e.getLineMaxColumn(d)),hi.fromViewState(n.viewState.move(!0,d,h,0))}else{const u=n.modelState.selectionStart.getEndPosition();return hi.fromModelState(n.modelState.move(!0,u.lineNumber,u.column,0))}}static word(e,n,r,s){const o=e.model.validatePosition(s);return hi.fromModelState(wi.word(e.cursorConfig,e.model,n.modelState,r,o))}static cancelSelection(e,n){if(!n.modelState.hasSelection())return new hi(n.modelState,n.viewState);const r=n.viewState.position.lineNumber,s=n.viewState.position.column;return hi.fromViewState(new ta(new J(r,s,r,s),0,0,new ve(r,s),0))}static moveTo(e,n,r,s,o){if(r){if(n.modelState.selectionStartKind===1)return this.word(e,n,r,s);if(n.modelState.selectionStartKind===2)return this.line(e,n,r,s,o)}const a=e.model.validatePosition(s),l=o?e.coordinatesConverter.validateViewPosition(new ve(o.lineNumber,o.column),a):e.coordinatesConverter.convertModelPositionToViewPosition(a);return hi.fromViewState(n.viewState.move(r,l.lineNumber,l.column,0))}static simpleMove(e,n,r,s,o,a){switch(r){case 0:return a===4?this._moveHalfLineLeft(e,n,s):this._moveLeft(e,n,s,o);case 1:return a===4?this._moveHalfLineRight(e,n,s):this._moveRight(e,n,s,o);case 2:return a===2?this._moveUpByViewLines(e,n,s,o):this._moveUpByModelLines(e,n,s,o);case 3:return a===2?this._moveDownByViewLines(e,n,s,o):this._moveDownByModelLines(e,n,s,o);case 4:return a===2?n.map(l=>hi.fromViewState(Ri.moveToPrevBlankLine(e.cursorConfig,e,l.viewState,s))):n.map(l=>hi.fromModelState(Ri.moveToPrevBlankLine(e.cursorConfig,e.model,l.modelState,s)));case 5:return a===2?n.map(l=>hi.fromViewState(Ri.moveToNextBlankLine(e.cursorConfig,e,l.viewState,s))):n.map(l=>hi.fromModelState(Ri.moveToNextBlankLine(e.cursorConfig,e.model,l.modelState,s)));case 6:return this._moveToViewMinColumn(e,n,s);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,n,s);case 8:return this._moveToViewCenterColumn(e,n,s);case 9:return this._moveToViewMaxColumn(e,n,s);case 10:return this._moveToViewLastNonWhitespaceColumn(e,n,s);default:return null}}static viewportMove(e,n,r,s,o){const a=e.getCompletelyVisibleViewRange(),l=e.coordinatesConverter.convertViewRangeToModelRange(a);switch(r){case 11:{const c=this._firstLineNumberInRange(e.model,l,o),u=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,n[0],s,c,u)]}case 13:{const c=this._lastLineNumberInRange(e.model,l,o),u=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,n[0],s,c,u)]}case 12:{const c=Math.round((l.startLineNumber+l.endLineNumber)/2),u=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,n[0],s,c,u)]}case 14:{const c=[];for(let u=0,d=n.length;u<d;u++){const h=n[u];c[u]=this.findPositionInViewportIfOutside(e,h,a,s)}return c}default:return null}}static findPositionInViewportIfOutside(e,n,r,s){const o=n.viewState.position.lineNumber;if(r.startLineNumber<=o&&o<=r.endLineNumber-1)return new hi(n.modelState,n.viewState);{let a;o>r.endLineNumber-1?a=r.endLineNumber-1:o<r.startLineNumber?a=r.startLineNumber:a=o;const l=Ri.vertical(e.cursorConfig,e,o,n.viewState.position.column,n.viewState.leftoverVisibleColumns,a,!1);return hi.fromViewState(n.viewState.move(s,l.lineNumber,l.column,l.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,n,r){let s=n.startLineNumber;return n.startColumn!==e.getLineMinColumn(s)&&s++,Math.min(n.endLineNumber,s+r-1)}static _lastLineNumberInRange(e,n,r){let s=n.startLineNumber;return n.startColumn!==e.getLineMinColumn(s)&&s++,Math.max(s,n.endLineNumber-r+1)}static _moveLeft(e,n,r,s){return n.map(o=>hi.fromViewState(Ri.moveLeft(e.cursorConfig,e,o.viewState,r,s)))}static _moveHalfLineLeft(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o],c=l.viewState.position.lineNumber,u=Math.round(e.getLineContent(c).length/2);s[o]=hi.fromViewState(Ri.moveLeft(e.cursorConfig,e,l.viewState,r,u))}return s}static _moveRight(e,n,r,s){return n.map(o=>hi.fromViewState(Ri.moveRight(e.cursorConfig,e,o.viewState,r,s)))}static _moveHalfLineRight(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o],c=l.viewState.position.lineNumber,u=Math.round(e.getLineContent(c).length/2);s[o]=hi.fromViewState(Ri.moveRight(e.cursorConfig,e,l.viewState,r,u))}return s}static _moveDownByViewLines(e,n,r,s){const o=[];for(let a=0,l=n.length;a<l;a++){const c=n[a];o[a]=hi.fromViewState(Ri.moveDown(e.cursorConfig,e,c.viewState,r,s))}return o}static _moveDownByModelLines(e,n,r,s){const o=[];for(let a=0,l=n.length;a<l;a++){const c=n[a];o[a]=hi.fromModelState(Ri.moveDown(e.cursorConfig,e.model,c.modelState,r,s))}return o}static _moveUpByViewLines(e,n,r,s){const o=[];for(let a=0,l=n.length;a<l;a++){const c=n[a];o[a]=hi.fromViewState(Ri.moveUp(e.cursorConfig,e,c.viewState,r,s))}return o}static _moveUpByModelLines(e,n,r,s){const o=[];for(let a=0,l=n.length;a<l;a++){const c=n[a];o[a]=hi.fromModelState(Ri.moveUp(e.cursorConfig,e.model,c.modelState,r,s))}return o}static _moveToViewPosition(e,n,r,s,o){return hi.fromViewState(n.viewState.move(r,s,o,0))}static _moveToModelPosition(e,n,r,s,o){return hi.fromModelState(n.modelState.move(r,s,o,0))}static _moveToViewMinColumn(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o],c=l.viewState.position.lineNumber,u=e.getLineMinColumn(c);s[o]=this._moveToViewPosition(e,l,r,c,u)}return s}static _moveToViewFirstNonWhitespaceColumn(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o],c=l.viewState.position.lineNumber,u=e.getLineFirstNonWhitespaceColumn(c);s[o]=this._moveToViewPosition(e,l,r,c,u)}return s}static _moveToViewCenterColumn(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o],c=l.viewState.position.lineNumber,u=Math.round((e.getLineMaxColumn(c)+e.getLineMinColumn(c))/2);s[o]=this._moveToViewPosition(e,l,r,c,u)}return s}static _moveToViewMaxColumn(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o],c=l.viewState.position.lineNumber,u=e.getLineMaxColumn(c);s[o]=this._moveToViewPosition(e,l,r,c,u)}return s}static _moveToViewLastNonWhitespaceColumn(e,n,r){const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o],c=l.viewState.position.lineNumber,u=e.getLineLastNonWhitespaceColumn(c);s[o]=this._moveToViewPosition(e,l,r,c,u)}return s}}var r7;(function(i){const e=function(r){if(!Bl(r))return!1;const s=r;return!(!zl(s.to)||!nu(s.select)&&!v2e(s.select)||!nu(s.by)&&!zl(s.by)||!nu(s.value)&&!c1(s.value))};i.description={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:`Property-value pairs that can be passed through this argument:
* 'to': A mandatory logical position value providing where to move the cursor.
\`\`\`
'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
\`\`\`
* 'by': Unit to move. Default is computed based on 'to' value.
\`\`\`
'line', 'wrappedLine', 'character', 'halfLine'
\`\`\`
* 'value': Number of units to move. Default is '1'.
* 'select': If 'true' makes the selection. Default is 'false'.
`,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},i.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},i.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function n(r){if(!r.to)return null;let s;switch(r.to){case i.RawDirection.Left:s=0;break;case i.RawDirection.Right:s=1;break;case i.RawDirection.Up:s=2;break;case i.RawDirection.Down:s=3;break;case i.RawDirection.PrevBlankLine:s=4;break;case i.RawDirection.NextBlankLine:s=5;break;case i.RawDirection.WrappedLineStart:s=6;break;case i.RawDirection.WrappedLineFirstNonWhitespaceCharacter:s=7;break;case i.RawDirection.WrappedLineColumnCenter:s=8;break;case i.RawDirection.WrappedLineEnd:s=9;break;case i.RawDirection.WrappedLineLastNonWhitespaceCharacter:s=10;break;case i.RawDirection.ViewPortTop:s=11;break;case i.RawDirection.ViewPortBottom:s=13;break;case i.RawDirection.ViewPortCenter:s=12;break;case i.RawDirection.ViewPortIfOutside:s=14;break;default:return null}let o=0;switch(r.by){case i.RawUnit.Line:o=1;break;case i.RawUnit.WrappedLine:o=2;break;case i.RawUnit.Character:o=3;break;case i.RawUnit.HalfLine:o=4;break}return{direction:s,unit:o,select:!!r.select,value:r.value||1}}i.parse=n})(r7||(r7={}));function K2(i,e,n,r){const s=W2(e,n.startLineNumber,n.startColumn),o=r.getLanguageConfiguration(s.languageId);if(!o)return null;const a=s.getLineContent(),l=a.substr(0,n.startColumn-1-s.firstCharOffset);let c;n.isEmpty()?c=a.substr(n.startColumn-1-s.firstCharOffset):c=W2(e,n.endLineNumber,n.endColumn).getLineContent().substr(n.endColumn-1-s.firstCharOffset);let u="";if(n.startLineNumber>1&&s.firstCharOffset===0){const m=W2(e,n.startLineNumber-1);m.languageId===s.languageId&&(u=m.getLineContent())}const d=o.onEnter(i,u,l,c);if(!d)return null;const h=d.indentAction;let f=d.appendText;const p=d.removeText||0;f?h===Hs.Indent&&(f=" "+f):h===Hs.Indent||h===Hs.IndentOutdent?f=" ":f="";let g=UEe(e,n.startLineNumber,n.startColumn);return p&&(g=g.substring(0,g.length-p)),{indentAction:h,appendText:f,removeText:p,indentation:g}}var _pt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},vpt=function(i,e){return function(n,r){e(n,r,i)}},m8;const bq=Object.create(null);function tC(i,e){if(e<=0)return"";bq[i]||(bq[i]=["",i]);const n=bq[i];for(let r=n.length;r<=e;r++)n[r]=n[r-1]+i;return n[e]}let nh=m8=class{static unshiftIndent(e,n,r,s,o){const a=ho.visibleColumnFromColumn(e,n,r);if(o){const l=tC(" ",s),u=ho.prevIndentTabStop(a,s)/s;return tC(l,u)}else{const l=" ",u=ho.prevRenderTabStop(a,r)/r;return tC(l,u)}}static shiftIndent(e,n,r,s,o){const a=ho.visibleColumnFromColumn(e,n,r);if(o){const l=tC(" ",s),u=ho.nextIndentTabStop(a,s)/s;return tC(l,u)}else{const l=" ",u=ho.nextRenderTabStop(a,r)/r;return tC(l,u)}}constructor(e,n,r){this._languageConfigurationService=r,this._opts=n,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,n,r){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(n,r):e.addEditOperation(n,r)}getEditOperations(e,n){const r=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&r!==s&&(s=s-1);const{tabSize:o,indentSize:a,insertSpaces:l}=this._opts,c=r===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(r))&&(this._useLastEditRangeForCursorEndPosition=!0);let u=0,d=0;for(let h=r;h<=s;h++,u=d){d=0;const f=e.getLineContent(h);let p=ml(f);if(this._opts.isUnshift&&(f.length===0||p===0)||!c&&!this._opts.isUnshift&&f.length===0)continue;if(p===-1&&(p=f.length),h>1&&ho.visibleColumnFromColumn(f,p+1,o)%a!==0&&e.tokenization.isCheapToTokenize(h-1)){const _=K2(this._opts.autoIndent,e,new J(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(_){if(d=u,_.appendText)for(let b=0,y=_.appendText.length;b<y&&d<a&&_.appendText.charCodeAt(b)===32;b++)d++;_.removeText&&(d=Math.max(0,d-_.removeText));for(let b=0;b<d&&!(p===0||f.charCodeAt(p-1)!==32);b++)p--}}if(this._opts.isUnshift&&p===0)continue;let g;this._opts.isUnshift?g=m8.unshiftIndent(f,p+1,o,a,l):g=m8.shiftIndent(f,p+1,o,a,l),this._addEditOperation(n,new J(h,1,h,p+1),g),h===r&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn<=p+1)}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&e.getLineLength(r)===0&&(this._useLastEditRangeForCursorEndPosition=!0);const u=l?tC(" ",a):" ";for(let d=r;d<=s;d++){const h=e.getLineContent(d);let f=ml(h);if(!(this._opts.isUnshift&&(h.length===0||f===0))&&!(!c&&!this._opts.isUnshift&&h.length===0)&&(f===-1&&(f=h.length),!(this._opts.isUnshift&&f===0)))if(this._opts.isUnshift){f=Math.min(f,a);for(let p=0;p<f;p++)if(h.charCodeAt(p)===9){f=p+1;break}this._addEditOperation(n,new J(d,1,d,f+1),"")}else this._addEditOperation(n,new J(d,1,d,1),u),d===r&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn===1)}}this._selectionId=n.trackSelection(this._selection)}computeCursorState(e,n){if(this._useLastEditRangeForCursorEndPosition){const s=n.getInverseEditOperations()[0];return new Ft(s.range.endLineNumber,s.range.endColumn,s.range.endLineNumber,s.range.endColumn)}const r=n.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const s=this._selection.startColumn;return r.startColumn<=s?r:r.getDirection()===0?new Ft(r.startLineNumber,s,r.endLineNumber,r.endColumn):new Ft(r.endLineNumber,r.endColumn,r.startLineNumber,s)}return r}};nh=m8=_pt([vpt(2,dr)],nh);class bpt{constructor(e,n,r){this._range=e,this._charBeforeSelection=n,this._charAfterSelection=r}getEditOperations(e,n){n.addTrackedEditOperation(new J(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),n.addTrackedEditOperation(new J(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,n){const r=n.getInverseEditOperations(),s=r[0].range,o=r[1].range;return new Ft(s.endLineNumber,s.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class ypt{constructor(e,n,r){this._position=e,this._text=n,this._charAfter=r}getEditOperations(e,n){n.addTrackedEditOperation(new J(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,n){const s=n.getInverseEditOperations()[0].range;return new Ft(s.endLineNumber,s.startColumn,s.endLineNumber,s.endColumn-this._charAfter.length)}}function wpt(i,e,n){const r=i.tokenization.getLanguageIdAtPosition(e,0);if(e>1){let s,o=-1;for(s=e-1;s>=1;s--){if(i.tokenization.getLanguageIdAtPosition(s,0)!==r)return o;const a=i.getLineContent(s);if(n.shouldIgnore(a)||/^\s+$/.test(a)||a===""){o=s;continue}return s}}return-1}function T$(i,e,n,r=!0,s){if(i<4)return null;const o=s.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(n<=1)return{indentation:"",action:null};for(let c=n-1;c>0&&e.getLineContent(c)==="";c--)if(c===1)return{indentation:"",action:null};const a=wpt(e,n,o);if(a<0)return null;if(a<1)return{indentation:"",action:null};const l=e.getLineContent(a);if(o.shouldIncrease(l)||o.shouldIndentNextLine(l))return{indentation:ar(l),action:Hs.Indent,line:a};if(o.shouldDecrease(l))return{indentation:ar(l),action:null,line:a};{if(a===1)return{indentation:ar(e.getLineContent(a)),action:null,line:a};const c=a-1,u=o.getIndentMetadata(e.getLineContent(c));if(!(u&3)&&u&4){let d=0;for(let h=c-1;h>0;h--)if(!o.shouldIndentNextLine(e.getLineContent(h))){d=h;break}return{indentation:ar(e.getLineContent(d+1)),action:null,line:d+1}}if(r)return{indentation:ar(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){const h=e.getLineContent(d);if(o.shouldIncrease(h))return{indentation:ar(h),action:Hs.Indent,line:d};if(o.shouldIndentNextLine(h)){let f=0;for(let p=d-1;p>0;p--)if(!o.shouldIndentNextLine(e.getLineContent(d))){f=p;break}return{indentation:ar(e.getLineContent(f+1)),action:null,line:f+1}}else if(o.shouldDecrease(h))return{indentation:ar(h),action:null,line:d}}return{indentation:ar(e.getLineContent(1)),action:null,line:1}}}function rM(i,e,n,r,s,o){if(i<4)return null;const a=o.getLanguageConfiguration(n);if(!a)return null;const l=o.getLanguageConfiguration(n).indentRulesSupport;if(!l)return null;const c=T$(i,e,r,void 0,o),u=e.getLineContent(r);if(c){const d=c.line;if(d!==void 0){let h=!0;for(let f=d;f<r-1;f++)if(!/^\s*$/.test(e.getLineContent(f))){h=!1;break}if(h){const f=a.onEnter(i,"",e.getLineContent(d),"");if(f){let p=ar(e.getLineContent(d));return f.removeText&&(p=p.substring(0,p.length-f.removeText)),f.indentAction===Hs.Indent||f.indentAction===Hs.IndentOutdent?p=s.shiftIndent(p):f.indentAction===Hs.Outdent&&(p=s.unshiftIndent(p)),l.shouldDecrease(u)&&(p=s.unshiftIndent(p)),f.appendText&&(p+=f.appendText),ar(p)}}}return l.shouldDecrease(u)?c.action===Hs.Indent?c.indentation:s.unshiftIndent(c.indentation):c.action===Hs.Indent?s.shiftIndent(c.indentation):c.indentation}return null}function Cpt(i,e,n,r,s){if(i<4)return null;e.tokenization.forceTokenization(n.startLineNumber);const o=e.tokenization.getLineTokens(n.startLineNumber),a=g$(o,n.startColumn-1),l=a.getLineContent();let c=!1,u;a.firstCharOffset>0&&o.getLanguageId(0)!==a.languageId?(c=!0,u=l.substr(0,n.startColumn-1-a.firstCharOffset)):u=o.getLineContent().substring(0,n.startColumn-1);let d;n.isEmpty()?d=l.substr(n.startColumn-1-a.firstCharOffset):d=W2(e,n.endLineNumber,n.endColumn).getLineContent().substr(n.endColumn-1-a.firstCharOffset);const h=s.getLanguageConfiguration(a.languageId).indentRulesSupport;if(!h)return null;const f=u,p=ar(u),g={tokenization:{getLineTokens:y=>e.tokenization.getLineTokens(y),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(y,x)=>e.getLanguageIdAtPosition(y,x)},getLineContent:y=>y===n.startLineNumber?f:e.getLineContent(y)},m=ar(o.getLineContent()),_=T$(i,g,n.startLineNumber+1,void 0,s);if(!_){const y=c?m:p;return{beforeEnter:y,afterEnter:y}}let b=c?m:_.indentation;return _.action===Hs.Indent&&(b=r.shiftIndent(b)),h.shouldDecrease(d)&&(b=r.unshiftIndent(b)),{beforeEnter:c?m:p,afterEnter:b}}function Spt(i,e,n,r,s,o){if(i<4)return null;const a=W2(e,n.startLineNumber,n.startColumn);if(a.firstCharOffset)return null;const l=o.getLanguageConfiguration(a.languageId).indentRulesSupport;if(!l)return null;const c=a.getLineContent(),u=c.substr(0,n.startColumn-1-a.firstCharOffset);let d;if(n.isEmpty()?d=c.substr(n.startColumn-1-a.firstCharOffset):d=W2(e,n.endLineNumber,n.endColumn).getLineContent().substr(n.endColumn-1-a.firstCharOffset),!l.shouldDecrease(u+d)&&l.shouldDecrease(u+r+d)){const h=T$(i,e,n.startLineNumber,!1,o);if(!h)return null;let f=h.indentation;return h.action!==Hs.Indent&&(f=s.unshiftIndent(f)),f}return null}function BIe(i,e,n){const r=n.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;return!r||e<1||e>i.getLineCount()?null:r.getIndentMetadata(i.getLineContent(e))}class zr{static indent(e,n,r){if(n===null||r===null)return[];const s=[];for(let o=0,a=r.length;o<a;o++)s[o]=new nh(r[o],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return s}static outdent(e,n,r){const s=[];for(let o=0,a=r.length;o<a;o++)s[o]=new nh(r[o],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return s}static shiftIndent(e,n,r){return r=r||1,nh.shiftIndent(n,n.length+r,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,n,r){return r=r||1,nh.unshiftIndent(n,n.length+r,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,n,r,s){const o=[];for(let a=0,l=r.length;a<l;a++)o[a]=new Sa(r[a],s[a]);return new lc(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,n,r,s,o){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],d=u.getPosition();if(o&&!u.isEmpty()&&(o=!1),o&&s.indexOf(`
`)!==s.length-1&&(o=!1),o){const h=new J(d.lineNumber,1,d.lineNumber,1);a[l]=new Doe(h,s,u,!0)}else a[l]=new Sa(u,s)}return new lc(0,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,n,r,s,o){if(s||n.length===1)return null;if(o&&o.length===n.length)return o;if(e.multiCursorPaste==="spread"){r.charCodeAt(r.length-1)===10&&(r=r.substr(0,r.length-1)),r.charCodeAt(r.length-1)===13&&(r=r.substr(0,r.length-1));const a=Km(r);if(a.length===n.length)return a}return null}static paste(e,n,r,s,o,a){const l=this._distributePasteToCursors(e,r,s,o,a);return l?(r=r.sort(J.compareRangesUsingStarts),this._distributedPaste(e,n,r,l)):this._simplePaste(e,n,r,s,o)}static _goodIndentForLine(e,n,r){let s=null,o="";const a=T$(e.autoIndent,n,r,!1,e.languageConfigurationService);if(a)s=a.action,o=a.indentation;else if(r>1){let l;for(l=r-1;l>=1;l--){const d=n.getLineContent(l);if($p(d)>=0)break}if(l<1)return null;const c=n.getLineMaxColumn(l),u=K2(e.autoIndent,n,new J(l,c,l,c),e.languageConfigurationService);u&&(o=u.indentation+u.appendText)}return s&&(s===Hs.Indent&&(o=zr.shiftIndent(e,o)),s===Hs.Outdent&&(o=zr.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,n,r,s){let o="";const a=r.getStartPosition();if(e.insertSpaces){const l=e.visibleColumnFromColumn(n,a),c=e.indentSize,u=c-l%c;for(let d=0;d<u;d++)o+=" "}else o=" ";return new Sa(r,o,s)}static tab(e,n,r){const s=[];for(let o=0,a=r.length;o<a;o++){const l=r[o];if(l.isEmpty()){const c=n.getLineContent(l.startLineNumber);if(/^\s*$/.test(c)&&n.tokenization.isCheapToTokenize(l.startLineNumber)){let u=this._goodIndentForLine(e,n,l.startLineNumber);u=u||" ";const d=e.normalizeIndentation(u);if(!c.startsWith(d)){s[o]=new Sa(new J(l.startLineNumber,1,l.startLineNumber,c.length+1),d,!0);continue}}s[o]=this._replaceJumpToNextIndent(e,n,l,!0)}else{if(l.startLineNumber===l.endLineNumber){const c=n.getLineMaxColumn(l.startLineNumber);if(l.startColumn!==1||l.endColumn!==c){s[o]=this._replaceJumpToNextIndent(e,n,l,!1);continue}}s[o]=new nh(l,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return s}static compositionType(e,n,r,s,o,a,l,c){const u=s.map(d=>this._compositionType(r,d,o,a,l,c));return new lc(4,u,{shouldPushStackElementBefore:Q3(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,n,r,s,o,a){if(!n.isEmpty())return null;const l=n.getPosition(),c=Math.max(1,l.column-s),u=Math.min(e.getLineMaxColumn(l.lineNumber),l.column+o),d=new J(l.lineNumber,c,l.lineNumber,u);return e.getValueInRange(d)===r&&a===0?null:new g8(d,r,0,a)}static _typeCommand(e,n,r){return r?new Y3(e,n,!0):new Sa(e,n,!0)}static _enter(e,n,r,s){if(e.autoIndent===0)return zr._typeCommand(s,`
`,r);if(!n.tokenization.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===1){const c=n.getLineContent(s.startLineNumber),u=ar(c).substring(0,s.startColumn-1);return zr._typeCommand(s,`
`+e.normalizeIndentation(u),r)}const o=K2(e.autoIndent,n,s,e.languageConfigurationService);if(o){if(o.indentAction===Hs.None)return zr._typeCommand(s,`
`+e.normalizeIndentation(o.indentation+o.appendText),r);if(o.indentAction===Hs.Indent)return zr._typeCommand(s,`
`+e.normalizeIndentation(o.indentation+o.appendText),r);if(o.indentAction===Hs.IndentOutdent){const c=e.normalizeIndentation(o.indentation),u=e.normalizeIndentation(o.indentation+o.appendText),d=`
`+u+`
`+c;return r?new Y3(s,d,!0):new g8(s,d,-1,u.length-c.length,!0)}else if(o.indentAction===Hs.Outdent){const c=zr.unshiftIndent(e,o.indentation);return zr._typeCommand(s,`
`+e.normalizeIndentation(c+o.appendText),r)}}const a=n.getLineContent(s.startLineNumber),l=ar(a).substring(0,s.startColumn-1);if(e.autoIndent>=4){const c=Cpt(e.autoIndent,n,s,{unshiftIndent:u=>zr.unshiftIndent(e,u),shiftIndent:u=>zr.shiftIndent(e,u),normalizeIndentation:u=>e.normalizeIndentation(u)},e.languageConfigurationService);if(c){let u=e.visibleColumnFromColumn(n,s.getEndPosition());const d=s.endColumn,h=n.getLineContent(s.endLineNumber),f=ml(h);if(f>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,f+1)):s=s.setEndPosition(s.endLineNumber,n.getLineMaxColumn(s.endLineNumber)),r)return new Y3(s,`
`+e.normalizeIndentation(c.afterEnter),!0);{let p=0;return d<=f+1&&(e.insertSpaces||(u=Math.ceil(u/e.indentSize)),p=Math.min(u+1-e.normalizeIndentation(c.afterEnter).length-1,0)),new g8(s,`
`+e.normalizeIndentation(c.afterEnter),0,p,!0)}}}return zr._typeCommand(s,`
`+e.normalizeIndentation(l),r)}static _isAutoIndentType(e,n,r){if(e.autoIndent<4)return!1;for(let s=0,o=r.length;s<o;s++)if(!n.tokenization.isCheapToTokenize(r[s].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,n,r,s){const o=UEe(n,r.startLineNumber,r.startColumn),a=Spt(e.autoIndent,n,r,s,{shiftIndent:l=>zr.shiftIndent(e,l),unshiftIndent:l=>zr.unshiftIndent(e,l)},e.languageConfigurationService);if(a===null)return null;if(a!==e.normalizeIndentation(o)){const l=n.getLineFirstNonWhitespaceColumn(r.startLineNumber);return l===0?zr._typeCommand(new J(r.startLineNumber,1,r.endLineNumber,r.endColumn),e.normalizeIndentation(a)+s,!1):zr._typeCommand(new J(r.startLineNumber,1,r.endLineNumber,r.endColumn),e.normalizeIndentation(a)+n.getLineContent(r.startLineNumber).substring(l-1,r.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,n,r,s,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let a=0,l=r.length;a<l;a++){const c=r[a];if(!c.isEmpty())return!1;const u=c.getPosition(),d=n.getLineContent(u.lineNumber);if(d.charAt(u.column-1)!==o)return!1;const f=Yb(o);if((u.column>2?d.charCodeAt(u.column-2):0)===92&&f)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let m=0,_=s.length;m<_;m++){const b=s[m];if(u.lineNumber===b.startLineNumber&&u.column===b.startColumn){g=!0;break}}if(!g)return!1}}return!0}static _runAutoClosingOvertype(e,n,r,s,o){const a=[];for(let l=0,c=s.length;l<c;l++){const d=s[l].getPosition(),h=new J(d.lineNumber,d.column,d.lineNumber,d.column+1);a[l]=new Sa(h,o)}return new lc(4,a,{shouldPushStackElementBefore:Q3(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,n){const r=n.charAt(0),s=e.autoClosingPairs.autoClosingPairsOpenByStart.get(r)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(r)||[],a=s.some(c=>n.startsWith(c.open)),l=o.some(c=>n.startsWith(c.close));return!a&&l}static _findAutoClosingPairOpen(e,n,r,s){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!o)return null;let a=null;for(const l of o)if(a===null||l.open.length>a.open.length){let c=!0;for(const u of r)if(n.getValueInRange(new J(u.lineNumber,u.column-l.open.length+1,u.lineNumber,u.column))+s!==l.open){c=!1;break}c&&(a=l)}return a}static _findContainedAutoClosingPair(e,n){if(n.open.length<=1)return null;const r=n.close.charAt(n.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(r)||[];let o=null;for(const a of s)a.open!==n.open&&n.open.includes(a.open)&&n.close.endsWith(a.close)&&(!o||a.open.length>o.open.length)&&(o=a);return o}static _getAutoClosingPairClose(e,n,r,s,o){for(const g of r)if(!g.isEmpty())return null;const a=r.map(g=>{const m=g.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-s.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),l=this._findAutoClosingPairOpen(e,n,a.map(g=>new ve(g.lineNumber,g.beforeColumn)),s);if(!l)return null;let c,u;if(Yb(s)?(c=e.autoClosingQuotes,u=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?l.open.includes(e.blockCommentStartToken):!1)?(c=e.autoClosingComments,u=e.shouldAutoCloseBefore.comment):(c=e.autoClosingBrackets,u=e.shouldAutoCloseBefore.bracket),c==="never")return null;const h=this._findContainedAutoClosingPair(e,l),f=h?h.close:"";let p=!0;for(const g of a){const{lineNumber:m,beforeColumn:_,afterColumn:b}=g,y=n.getLineContent(m),x=y.substring(0,_-1),k=y.substring(b-1);if(k.startsWith(f)||(p=!1),k.length>0){const A=k.charAt(0);if(!zr._isBeforeClosingBrace(e,k)&&!u(A))return null}if(l.open.length===1&&(s==="'"||s==='"')&&c!=="always"){const A=vh(e.wordSeparators);if(x.length>0){const M=x.charCodeAt(x.length-1);if(A.get(M)===0)return null}}if(!n.tokenization.isCheapToTokenize(m))return null;n.tokenization.forceTokenization(m);const D=n.tokenization.getLineTokens(m),R=g$(D,_-1);if(!l.shouldAutoClose(R,_-R.firstCharOffset))return null;const E=l.findNeutralCharacter();if(E){const A=n.tokenization.getTokenTypeIfInsertingCharacter(m,_,E);if(!l.isOK(A))return null}}return p?l.close.substring(0,l.close.length-f.length):l.close}static _runAutoClosingOpenCharType(e,n,r,s,o,a,l){const c=[];for(let u=0,d=s.length;u<d;u++){const h=s[u];c[u]=new jIe(h,o,!a,l)}return new lc(4,c,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,n){return Yb(n)?e.autoSurround==="quotes"||e.autoSurround==="languageDefined":e.autoSurround==="brackets"||e.autoSurround==="languageDefined"}static _isSurroundSelectionType(e,n,r,s){if(!zr._shouldSurroundChar(e,s)||!e.surroundingPairs.hasOwnProperty(s))return!1;const o=Yb(s);for(const a of r){if(a.isEmpty())return!1;let l=!0;for(let c=a.startLineNumber;c<=a.endLineNumber;c++){const u=n.getLineContent(c),d=c===a.startLineNumber?a.startColumn-1:0,h=c===a.endLineNumber?a.endColumn-1:u.length,f=u.substring(d,h);if(/[^ \t]/.test(f)){l=!1;break}}if(l)return!1;if(o&&a.startLineNumber===a.endLineNumber&&a.startColumn+1===a.endColumn){const c=n.getValueInRange(a);if(Yb(c))return!1}}return!0}static _runSurroundSelectionType(e,n,r,s,o){const a=[];for(let l=0,c=s.length;l<c;l++){const u=s[l],d=n.surroundingPairs[o];a[l]=new bpt(u,o,d)}return new lc(0,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,n,r){return!!(r.length===1&&n.tokenization.isCheapToTokenize(r[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,n,r,s,o){if(!n.electricChars.hasOwnProperty(o)||!s.isEmpty())return null;const a=s.getPosition();r.tokenization.forceTokenization(a.lineNumber);const l=r.tokenization.getLineTokens(a.lineNumber);let c;try{c=n.onElectricCharacter(o,l,a.column)}catch(u){return Ln(u),null}if(!c)return null;if(c.matchOpenBracket){const u=(l.getLineContent()+o).lastIndexOf(c.matchOpenBracket)+1,d=r.bracketPairs.findMatchingBracketUp(c.matchOpenBracket,{lineNumber:a.lineNumber,column:u},500);if(d){if(d.startLineNumber===a.lineNumber)return null;const h=r.getLineContent(d.startLineNumber),f=ar(h),p=n.normalizeIndentation(f),g=r.getLineContent(a.lineNumber),m=r.getLineFirstNonWhitespaceColumn(a.lineNumber)||a.column,_=g.substring(m-1,a.column-1),b=p+_+o,y=new J(a.lineNumber,1,a.lineNumber,a.column),x=new Sa(y,b);return new lc(yq(b,e),[x],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,n,r,s,o,a){if(!s)return null;let l=null;for(const h of s)if(l===null)l=h.insertedText;else if(l!==h.insertedText)return null;if(!l||l.length!==1)return null;const c=l;let u=!1;for(const h of s)if(h.deletedText.length!==0){u=!0;break}if(u){if(!zr._shouldSurroundChar(n,c)||!n.surroundingPairs.hasOwnProperty(c))return null;const h=Yb(c);for(const g of s)if(g.deletedSelectionStart!==0||g.deletedSelectionEnd!==g.deletedText.length||/^[ \t]+$/.test(g.deletedText)||h&&Yb(g.deletedText))return null;const f=[];for(const g of o){if(!g.isEmpty())return null;f.push(g.getPosition())}if(f.length!==s.length)return null;const p=[];for(let g=0,m=f.length;g<m;g++)p.push(new ypt(f[g],s[g].deletedText,n.surroundingPairs[c]));return new lc(4,p,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(n,r,o,a,c)){const h=o.map(f=>new Sa(new J(f.positionLineNumber,f.positionColumn,f.positionLineNumber,f.positionColumn+1),"",!1));return new lc(4,h,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(n,r,o,c,!0);return d!==null?this._runAutoClosingOpenCharType(e,n,r,o,c,!0,d):null}static typeWithInterceptors(e,n,r,s,o,a,l){if(!e&&l===`
`){const d=[];for(let h=0,f=o.length;h<f;h++)d[h]=zr._enter(r,s,!1,o[h]);return new lc(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(r,s,o)){const d=[];let h=!1;for(let f=0,p=o.length;f<p;f++)if(d[f]=this._runAutoIndentType(r,s,o[f],l),!d[f]){h=!0;break}if(!h)return new lc(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(r,s,o,a,l))return this._runAutoClosingOvertype(n,r,s,o,l);if(!e){const d=this._getAutoClosingPairClose(r,s,o,l,!1);if(d)return this._runAutoClosingOpenCharType(n,r,s,o,l,!1,d)}if(!e&&this._isSurroundSelectionType(r,s,o,l))return this._runSurroundSelectionType(n,r,s,o,l);if(!e&&this._isTypeInterceptorElectricChar(r,s,o)){const d=this._typeInterceptorElectricChar(n,r,s,o[0],l);if(d)return d}const c=[];for(let d=0,h=o.length;d<h;d++)c[d]=new Sa(o[d],l);const u=yq(l,n);return new lc(u,c,{shouldPushStackElementBefore:Q3(n,u),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,n,r,s,o){const a=[];for(let c=0,u=s.length;c<u;c++)a[c]=new Sa(s[c],o);const l=yq(o,e);return new lc(l,a,{shouldPushStackElementBefore:Q3(e,l),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,n,r){if(n===null||r===null)return[];const s=[];for(let o=0,a=r.length;o<a;o++){let l=r[o].positionLineNumber;if(l===1)s[o]=new Y3(new J(1,1,1,1),`
`);else{l--;const c=n.getLineMaxColumn(l);s[o]=this._enter(e,n,!1,new J(l,c,l,c))}}return s}static lineInsertAfter(e,n,r){if(n===null||r===null)return[];const s=[];for(let o=0,a=r.length;o<a;o++){const l=r[o].positionLineNumber,c=n.getLineMaxColumn(l);s[o]=this._enter(e,n,!1,new J(l,c,l,c))}return s}static lineBreakInsert(e,n,r){const s=[];for(let o=0,a=r.length;o<a;o++)s[o]=this._enter(e,n,!0,r[o]);return s}}class jIe extends g8{constructor(e,n,r,s){super(e,(r?n:"")+s,0,-s.length),this._openCharacter=n,this._closeCharacter=s,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,n){const s=n.getInverseEditOperations()[0].range;return this.closeCharacterRange=new J(s.startLineNumber,s.endColumn-this._closeCharacter.length,s.endLineNumber,s.endColumn),this.enclosingRange=new J(s.startLineNumber,s.endColumn-this._openCharacter.length-this._closeCharacter.length,s.endLineNumber,s.endColumn),super.computeCursorState(e,n)}}class xpt{constructor(e,n,r,s,o,a){this.deletedText=e,this.deletedSelectionStart=n,this.deletedSelectionEnd=r,this.insertedText=s,this.insertedSelectionStart=o,this.insertedSelectionEnd=a}}function yq(i,e){return i===" "?e===5||e===6?6:5:4}function Q3(i,e){return wge(i)&&!wge(e)?!0:i===5?!1:yge(i)!==yge(e)}function yge(i){return i===6||i===5?"space":i}function wge(i){return i===4||i===5||i===6}var oe;(function(i){i.editorSimpleInput=new yt("editorSimpleInput",!1,!0),i.editorTextFocus=new yt("editorTextFocus",!1,L("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),i.focus=new yt("editorFocus",!1,L("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),i.textInputFocus=new yt("textInputFocus",!1,L("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),i.readOnly=new yt("editorReadonly",!1,L("editorReadonly","Whether the editor is read-only")),i.inDiffEditor=new yt("inDiffEditor",!1,L("inDiffEditor","Whether the context is a diff editor")),i.isEmbeddedDiffEditor=new yt("isEmbeddedDiffEditor",!1,L("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),i.comparingMovedCode=new yt("comparingMovedCode",!1,L("comparingMovedCode","Whether a moved code block is selected for comparison")),i.accessibleDiffViewerVisible=new yt("accessibleDiffViewerVisible",!1,L("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),i.diffEditorRenderSideBySideInlineBreakpointReached=new yt("diffEditorRenderSideBySideInlineBreakpointReached",!1,L("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),i.columnSelection=new yt("editorColumnSelection",!1,L("editorColumnSelection","Whether `editor.columnSelection` is enabled")),i.writable=i.readOnly.toNegated(),i.hasNonEmptySelection=new yt("editorHasSelection",!1,L("editorHasSelection","Whether the editor has text selected")),i.hasOnlyEmptySelection=i.hasNonEmptySelection.toNegated(),i.hasMultipleSelections=new yt("editorHasMultipleSelections",!1,L("editorHasMultipleSelections","Whether the editor has multiple selections")),i.hasSingleSelection=i.hasMultipleSelections.toNegated(),i.tabMovesFocus=new yt("editorTabMovesFocus",!1,L("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),i.tabDoesNotMoveFocus=i.tabMovesFocus.toNegated(),i.isInWalkThroughSnippet=new yt("isInEmbeddedEditor",!1,!0),i.canUndo=new yt("canUndo",!1,!0),i.canRedo=new yt("canRedo",!1,!0),i.hoverVisible=new yt("editorHoverVisible",!1,L("editorHoverVisible","Whether the editor hover is visible")),i.hoverFocused=new yt("editorHoverFocused",!1,L("editorHoverFocused","Whether the editor hover is focused")),i.stickyScrollFocused=new yt("stickyScrollFocused",!1,L("stickyScrollFocused","Whether the sticky scroll is focused")),i.stickyScrollVisible=new yt("stickyScrollVisible",!1,L("stickyScrollVisible","Whether the sticky scroll is visible")),i.standaloneColorPickerVisible=new yt("standaloneColorPickerVisible",!1,L("standaloneColorPickerVisible","Whether the standalone color picker is visible")),i.standaloneColorPickerFocused=new yt("standaloneColorPickerFocused",!1,L("standaloneColorPickerFocused","Whether the standalone color picker is focused")),i.inCompositeEditor=new yt("inCompositeEditor",void 0,L("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),i.notInCompositeEditor=i.inCompositeEditor.toNegated(),i.languageId=new yt("editorLangId","",L("editorLangId","The language identifier of the editor")),i.hasCompletionItemProvider=new yt("editorHasCompletionItemProvider",!1,L("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),i.hasCodeActionsProvider=new yt("editorHasCodeActionsProvider",!1,L("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),i.hasCodeLensProvider=new yt("editorHasCodeLensProvider",!1,L("editorHasCodeLensProvider","Whether the editor has a code lens provider")),i.hasDefinitionProvider=new yt("editorHasDefinitionProvider",!1,L("editorHasDefinitionProvider","Whether the editor has a definition provider")),i.hasDeclarationProvider=new yt("editorHasDeclarationProvider",!1,L("editorHasDeclarationProvider","Whether the editor has a declaration provider")),i.hasImplementationProvider=new yt("editorHasImplementationProvider",!1,L("editorHasImplementationProvider","Whether the editor has an implementation provider")),i.hasTypeDefinitionProvider=new yt("editorHasTypeDefinitionProvider",!1,L("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),i.hasHoverProvider=new yt("editorHasHoverProvider",!1,L("editorHasHoverProvider","Whether the editor has a hover provider")),i.hasDocumentHighlightProvider=new yt("editorHasDocumentHighlightProvider",!1,L("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),i.hasDocumentSymbolProvider=new yt("editorHasDocumentSymbolProvider",!1,L("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),i.hasReferenceProvider=new yt("editorHasReferenceProvider",!1,L("editorHasReferenceProvider","Whether the editor has a reference provider")),i.hasRenameProvider=new yt("editorHasRenameProvider",!1,L("editorHasRenameProvider","Whether the editor has a rename provider")),i.hasSignatureHelpProvider=new yt("editorHasSignatureHelpProvider",!1,L("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),i.hasInlayHintsProvider=new yt("editorHasInlayHintsProvider",!1,L("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),i.hasDocumentFormattingProvider=new yt("editorHasDocumentFormattingProvider",!1,L("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),i.hasDocumentSelectionFormattingProvider=new yt("editorHasDocumentSelectionFormattingProvider",!1,L("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),i.hasMultipleDocumentFormattingProvider=new yt("editorHasMultipleDocumentFormattingProvider",!1,L("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),i.hasMultipleDocumentSelectionFormattingProvider=new yt("editorHasMultipleDocumentSelectionFormattingProvider",!1,L("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(oe||(oe={}));const yi=0;class ns extends Ho{runEditorCommand(e,n,r){const s=n._getViewModel();s&&this.runCoreEditorCommand(s,r||{})}}var wa;(function(i){const e=function(r){if(!Bl(r))return!1;const s=r;return!(!zl(s.to)||!nu(s.by)&&!zl(s.by)||!nu(s.value)&&!c1(s.value)||!nu(s.revealCursor)&&!v2e(s.revealCursor))};i.description={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n * 'to': A mandatory direction value.\n ```\n 'up', 'down'\n ```\n * 'by': Unit to move. Default is computed based on 'to' value.\n ```\n 'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n ```\n * 'value': Number of units to move. Default is '1'.\n * 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n ",constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},i.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},i.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"};function n(r){let s;switch(r.to){case i.RawDirection.Up:s=1;break;case i.RawDirection.Right:s=2;break;case i.RawDirection.Down:s=3;break;case i.RawDirection.Left:s=4;break;default:return null}let o;switch(r.by){case i.RawUnit.Line:o=1;break;case i.RawUnit.WrappedLine:o=2;break;case i.RawUnit.Page:o=3;break;case i.RawUnit.HalfPage:o=4;break;case i.RawUnit.Editor:o=5;break;case i.RawUnit.Column:o=6;break;default:o=2}const a=Math.floor(r.value||1),l=!!r.revealCursor;return{direction:s,unit:o,value:a,revealCursor:l,select:!!r.select}}i.parse=n})(wa||(wa={}));var p2;(function(i){const e=function(n){if(!Bl(n))return!1;const r=n;return!(!c1(r.lineNumber)&&!zl(r.lineNumber)||!nu(r.at)&&!zl(r.at))};i.description={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n * 'lineNumber': A mandatory line number value.\n * 'at': Logical position at which line has to be revealed.\n ```\n 'top', 'center', 'bottom'\n ```\n ",constraint:e,schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},i.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}})(p2||(p2={}));class PJ{constructor(e){e.addImplementation(1e4,"code-editor",(n,r)=>{const s=n.get(Si).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(n,s,r):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(n,r)=>{const s=xf();return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(s),!0):!1}),e.addImplementation(0,"generic-dom",(n,r)=>{const s=n.get(Si).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(n,s,r)):!1})}_runEditorCommand(e,n,r){const s=this.runEditorCommand(e,n,r);return s||!0}}var Oo;(function(i){class e extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){if(!x.position)return;y.model.pushStackElement(),y.setCursorStates(x.source,3,[Zo.moveTo(y,y.getPrimaryCursorState(),this._inSelectionMode,x.position,x.viewPosition)])&&x.revealType!==2&&y.revealPrimaryCursor(x.source,!0,!0)}}i.MoveTo=ct(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),i.MoveToSelect=ct(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class n extends ns{runCoreEditorCommand(y,x){y.model.pushStackElement();const k=this._getColumnSelectResult(y,y.getPrimaryCursorState(),y.getCursorColumnSelectData(),x);k!==null&&(y.setCursorStates(x.source,3,k.viewStates.map(D=>hi.fromViewState(D))),y.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:k.fromLineNumber,fromViewVisualColumn:k.fromVisualColumn,toViewLineNumber:k.toLineNumber,toViewVisualColumn:k.toVisualColumn}),k.reversed?y.revealTopMostCursor(x.source):y.revealBottomMostCursor(x.source))}}i.ColumnSelect=ct(new class extends n{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(b,y,x,k){if(typeof k.position>"u"||typeof k.viewPosition>"u"||typeof k.mouseColumn>"u")return null;const D=b.model.validatePosition(k.position),R=b.coordinatesConverter.validateViewPosition(new ve(k.viewPosition.lineNumber,k.viewPosition.column),D),E=k.doColumnSelect?x.fromViewLineNumber:R.lineNumber,A=k.doColumnSelect?x.fromViewVisualColumn:k.mouseColumn-1;return XC.columnSelect(b.cursorConfig,b,E,A,R.lineNumber,k.mouseColumn-1)}}),i.CursorColumnSelectLeft=ct(new class extends n{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(b,y,x,k){return XC.columnSelectLeft(b.cursorConfig,b,x)}}),i.CursorColumnSelectRight=ct(new class extends n{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(b,y,x,k){return XC.columnSelectRight(b.cursorConfig,b,x)}});class r extends n{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,x,k,D){return XC.columnSelectUp(y.cursorConfig,y,k,this._isPaged)}}i.CursorColumnSelectUp=ct(new r({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:3600,linux:{primary:0}}})),i.CursorColumnSelectPageUp=ct(new r({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends n{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,x,k,D){return XC.columnSelectDown(y.cursorConfig,y,k,this._isPaged)}}i.CursorColumnSelectDown=ct(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:3602,linux:{primary:0}}})),i.CursorColumnSelectPageDown=ct(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends ns{constructor(){super({id:"cursorMove",precondition:void 0,description:r7.description})}runCoreEditorCommand(y,x){const k=r7.parse(x);k&&this._runCursorMove(y,x.source,k)}_runCursorMove(y,x,k){y.model.pushStackElement(),y.setCursorStates(x,3,o._move(y,y.getCursorStates(),k)),y.revealPrimaryCursor(x,!0)}static _move(y,x,k){const D=k.select,R=k.value;switch(k.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Zo.simpleMove(y,x,k.direction,D,R,k.unit);case 11:case 13:case 12:case 14:return Zo.viewportMove(y,x,k.direction,D,R);default:return null}}}i.CursorMoveImpl=o,i.CursorMove=ct(new o);class a extends ns{constructor(y){super(y),this._staticArgs=y.args}runCoreEditorCommand(y,x){let k=this._staticArgs;this._staticArgs.value===-1&&(k={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:x.pageSize||y.cursorConfig.pageSize}),y.model.pushStackElement(),y.setCursorStates(x.source,3,Zo.simpleMove(y,y.getCursorStates(),k.direction,k.select,k.value,k.unit)),y.revealPrimaryCursor(x.source,!0)}}i.CursorLeft=ct(new a({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),i.CursorLeftSelect=ct(new a({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:1039}})),i.CursorRight=ct(new a({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),i.CursorRightSelect=ct(new a({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:1041}})),i.CursorUp=ct(new a({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),i.CursorUpSelect=ct(new a({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),i.CursorPageUp=ct(new a({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:11}})),i.CursorPageUpSelect=ct(new a({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:1035}})),i.CursorDown=ct(new a({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),i.CursorDownSelect=ct(new a({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),i.CursorPageDown=ct(new a({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:12}})),i.CursorPageDownSelect=ct(new a({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:1036}})),i.CreateCursor=ct(new class extends ns{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(b,y){if(!y.position)return;let x;y.wholeLine?x=Zo.line(b,b.getPrimaryCursorState(),!1,y.position,y.viewPosition):x=Zo.moveTo(b,b.getPrimaryCursorState(),!1,y.position,y.viewPosition);const k=b.getCursorStates();if(k.length>1){const D=x.modelState?x.modelState.position:null,R=x.viewState?x.viewState.position:null;for(let E=0,A=k.length;E<A;E++){const M=k[E];if(!(D&&!M.modelState.selection.containsPosition(D))&&!(R&&!M.viewState.selection.containsPosition(R))){k.splice(E,1),b.model.pushStackElement(),b.setCursorStates(y.source,3,k);return}}}k.push(x),b.model.pushStackElement(),b.setCursorStates(y.source,3,k)}}),i.LastCursorMoveToSelect=ct(new class extends ns{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(b,y){if(!y.position)return;const x=b.getLastAddedCursorIndex(),k=b.getCursorStates(),D=k.slice(0);D[x]=Zo.moveTo(b,k[x],!0,y.position,y.viewPosition),b.model.pushStackElement(),b.setCursorStates(y.source,3,D)}});class l extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){y.model.pushStackElement(),y.setCursorStates(x.source,3,Zo.moveToBeginningOfLine(y,y.getCursorStates(),this._inSelectionMode)),y.revealPrimaryCursor(x.source,!0)}}i.CursorHome=ct(new l({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),i.CursorHomeSelect=ct(new l({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class c extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){y.model.pushStackElement(),y.setCursorStates(x.source,3,this._exec(y.getCursorStates())),y.revealPrimaryCursor(x.source,!0)}_exec(y){const x=[];for(let k=0,D=y.length;k<D;k++){const R=y[k],E=R.modelState.position.lineNumber;x[k]=hi.fromModelState(R.modelState.move(this._inSelectionMode,E,1,0))}return x}}i.CursorLineStart=ct(new c({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:0,mac:{primary:287}}})),i.CursorLineStartSelect=ct(new c({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:0,mac:{primary:1311}}}));class u extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){y.model.pushStackElement(),y.setCursorStates(x.source,3,Zo.moveToEndOfLine(y,y.getCursorStates(),this._inSelectionMode,x.sticky||!1)),y.revealPrimaryCursor(x.source,!0)}}i.CursorEnd=ct(new u({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:yi,kbExpr:oe.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:L("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),i.CursorEndSelect=ct(new u({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:yi,kbExpr:oe.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:L("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class d extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){y.model.pushStackElement(),y.setCursorStates(x.source,3,this._exec(y,y.getCursorStates())),y.revealPrimaryCursor(x.source,!0)}_exec(y,x){const k=[];for(let D=0,R=x.length;D<R;D++){const E=x[D],A=E.modelState.position.lineNumber,M=y.model.getLineMaxColumn(A);k[D]=hi.fromModelState(E.modelState.move(this._inSelectionMode,A,M,0))}return k}}i.CursorLineEnd=ct(new d({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:0,mac:{primary:291}}})),i.CursorLineEndSelect=ct(new d({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:0,mac:{primary:1315}}}));class h extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){y.model.pushStackElement(),y.setCursorStates(x.source,3,Zo.moveToBeginningOfBuffer(y,y.getCursorStates(),this._inSelectionMode)),y.revealPrimaryCursor(x.source,!0)}}i.CursorTop=ct(new h({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:2062,mac:{primary:2064}}})),i.CursorTopSelect=ct(new h({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:3086,mac:{primary:3088}}}));class f extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){y.model.pushStackElement(),y.setCursorStates(x.source,3,Zo.moveToEndOfBuffer(y,y.getCursorStates(),this._inSelectionMode)),y.revealPrimaryCursor(x.source,!0)}}i.CursorBottom=ct(new f({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:2061,mac:{primary:2066}}})),i.CursorBottomSelect=ct(new f({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:3085,mac:{primary:3090}}}));class p extends ns{constructor(){super({id:"editorScroll",precondition:void 0,description:wa.description})}determineScrollMethod(y){const x=[6],k=[1,2,3,4,5,6],D=[4,2],R=[1,3];return x.includes(y.unit)&&D.includes(y.direction)?this._runHorizontalEditorScroll.bind(this):k.includes(y.unit)&&R.includes(y.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(y,x){const k=wa.parse(x);if(!k)return;const D=this.determineScrollMethod(k);D&&D(y,x.source,k)}_runVerticalEditorScroll(y,x,k){const D=this._computeDesiredScrollTop(y,k);if(k.revealCursor){const R=y.getCompletelyVisibleViewRangeAtScrollTop(D);y.setCursorStates(x,3,[Zo.findPositionInViewportIfOutside(y,y.getPrimaryCursorState(),R,k.select)])}y.viewLayout.setScrollPosition({scrollTop:D},0)}_computeDesiredScrollTop(y,x){if(x.unit===1){const R=y.viewLayout.getFutureViewport(),E=y.getCompletelyVisibleViewRangeAtScrollTop(R.top),A=y.coordinatesConverter.convertViewRangeToModelRange(E);let M;x.direction===1?M=Math.max(1,A.startLineNumber-x.value):M=Math.min(y.model.getLineCount(),A.startLineNumber+x.value);const N=y.coordinatesConverter.convertModelPositionToViewPosition(new ve(M,1));return y.viewLayout.getVerticalOffsetForLineNumber(N.lineNumber)}if(x.unit===5){let R=0;return x.direction===3&&(R=y.model.getLineCount()-y.cursorConfig.pageSize),y.viewLayout.getVerticalOffsetForLineNumber(R)}let k;x.unit===3?k=y.cursorConfig.pageSize*x.value:x.unit===4?k=Math.round(y.cursorConfig.pageSize/2)*x.value:k=x.value;const D=(x.direction===1?-1:1)*k;return y.viewLayout.getCurrentScrollTop()+D*y.cursorConfig.lineHeight}_runHorizontalEditorScroll(y,x,k){const D=this._computeDesiredScrollLeft(y,k);y.viewLayout.setScrollPosition({scrollLeft:D},0)}_computeDesiredScrollLeft(y,x){const k=(x.direction===4?-1:1)*x.value;return y.viewLayout.getCurrentScrollLeft()+k*y.cursorConfig.typicalHalfwidthCharacterWidth}}i.EditorScrollImpl=p,i.EditorScroll=ct(new p),i.ScrollLineUp=ct(new class extends ns{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(b,y){i.EditorScroll.runCoreEditorCommand(b,{to:wa.RawDirection.Up,by:wa.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:y.source})}}),i.ScrollPageUp=ct(new class extends ns{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(b,y){i.EditorScroll.runCoreEditorCommand(b,{to:wa.RawDirection.Up,by:wa.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:y.source})}}),i.ScrollEditorTop=ct(new class extends ns{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus}})}runCoreEditorCommand(b,y){i.EditorScroll.runCoreEditorCommand(b,{to:wa.RawDirection.Up,by:wa.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:y.source})}}),i.ScrollLineDown=ct(new class extends ns{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(b,y){i.EditorScroll.runCoreEditorCommand(b,{to:wa.RawDirection.Down,by:wa.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:y.source})}}),i.ScrollPageDown=ct(new class extends ns{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(b,y){i.EditorScroll.runCoreEditorCommand(b,{to:wa.RawDirection.Down,by:wa.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:y.source})}}),i.ScrollEditorBottom=ct(new class extends ns{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus}})}runCoreEditorCommand(b,y){i.EditorScroll.runCoreEditorCommand(b,{to:wa.RawDirection.Down,by:wa.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:y.source})}}),i.ScrollLeft=ct(new class extends ns{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus}})}runCoreEditorCommand(b,y){i.EditorScroll.runCoreEditorCommand(b,{to:wa.RawDirection.Left,by:wa.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:y.source})}}),i.ScrollRight=ct(new class extends ns{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus}})}runCoreEditorCommand(b,y){i.EditorScroll.runCoreEditorCommand(b,{to:wa.RawDirection.Right,by:wa.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:y.source})}});class g extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){x.position&&(y.model.pushStackElement(),y.setCursorStates(x.source,3,[Zo.word(y,y.getPrimaryCursorState(),this._inSelectionMode,x.position)]),x.revealType!==2&&y.revealPrimaryCursor(x.source,!0,!0))}}i.WordSelect=ct(new g({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),i.WordSelectDrag=ct(new g({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),i.LastCursorWordSelect=ct(new class extends ns{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(b,y){if(!y.position)return;const x=b.getLastAddedCursorIndex(),k=b.getCursorStates(),D=k.slice(0),R=k[x];D[x]=Zo.word(b,R,R.modelState.hasSelection(),y.position),b.model.pushStackElement(),b.setCursorStates(y.source,3,D)}});class m extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){x.position&&(y.model.pushStackElement(),y.setCursorStates(x.source,3,[Zo.line(y,y.getPrimaryCursorState(),this._inSelectionMode,x.position,x.viewPosition)]),x.revealType!==2&&y.revealPrimaryCursor(x.source,!1,!0))}}i.LineSelect=ct(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),i.LineSelectDrag=ct(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class _ extends ns{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,x){if(!x.position)return;const k=y.getLastAddedCursorIndex(),D=y.getCursorStates(),R=D.slice(0);R[k]=Zo.line(y,D[k],this._inSelectionMode,x.position,x.viewPosition),y.model.pushStackElement(),y.setCursorStates(x.source,3,R)}}i.LastCursorLineSelect=ct(new _({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),i.LastCursorLineSelectDrag=ct(new _({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),i.CancelSelection=ct(new class extends ns{constructor(){super({id:"cancelSelection",precondition:oe.hasNonEmptySelection,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,[Zo.cancelSelection(b,b.getPrimaryCursorState())]),b.revealPrimaryCursor(y.source,!0)}}),i.RemoveSecondaryCursors=ct(new class extends ns{constructor(){super({id:"removeSecondaryCursors",precondition:oe.hasMultipleSelections,kbOpts:{weight:yi+1,kbExpr:oe.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,[b.getPrimaryCursorState()]),b.revealPrimaryCursor(y.source,!0),v1(L("removedCursor","Removed secondary cursors"))}}),i.RevealLine=ct(new class extends ns{constructor(){super({id:"revealLine",precondition:void 0,description:p2.description})}runCoreEditorCommand(b,y){const x=y,k=x.lineNumber||0;let D=typeof k=="number"?k+1:parseInt(k)+1;D<1&&(D=1);const R=b.model.getLineCount();D>R&&(D=R);const E=new J(D,1,D,b.model.getLineMaxColumn(D));let A=0;if(x.at)switch(x.at){case p2.RawAtArgument.Top:A=3;break;case p2.RawAtArgument.Center:A=1;break;case p2.RawAtArgument.Bottom:A=4;break}const M=b.coordinatesConverter.convertModelRangeToViewRange(E);b.revealRange(y.source,!1,M,A,0)}}),i.SelectAll=new class extends PJ{constructor(){super(dlt)}runDOMCommand(b){gh&&(b.focus(),b.select()),b.ownerDocument.execCommand("selectAll")}runEditorCommand(b,y,x){const k=y._getViewModel();k&&this.runCoreEditorCommand(k,x)}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates("keyboard",3,[Zo.selectAll(b,b.getPrimaryCursorState())])}},i.SetSelection=ct(new class extends ns{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(b,y){y.selection&&(b.model.pushStackElement(),b.setCursorStates(y.source,3,[hi.fromModelSelection(y.selection)]))}})})(Oo||(Oo={}));const kpt=ze.and(oe.textInputFocus,oe.columnSelection);function zI(i,e){Sc.registerKeybindingRule({id:i,primary:e,when:kpt,weight:yi+1})}zI(Oo.CursorColumnSelectLeft.id,1039);zI(Oo.CursorColumnSelectRight.id,1041);zI(Oo.CursorColumnSelectUp.id,1040);zI(Oo.CursorColumnSelectPageUp.id,1035);zI(Oo.CursorColumnSelectDown.id,1042);zI(Oo.CursorColumnSelectPageDown.id,1036);function Cge(i){return i.register(),i}var G2;(function(i){class e extends Ho{runEditorCommand(r,s,o){const a=s._getViewModel();a&&this.runCoreEditingCommand(s,a,o||{})}}i.CoreEditingCommand=e,i.LineBreakInsert=ct(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:oe.writable,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(n,r,s){n.pushUndoStop(),n.executeCommands(this.id,zr.lineBreakInsert(r.cursorConfig,r.model,r.getCursorStates().map(o=>o.modelState.selection)))}}),i.Outdent=ct(new class extends e{constructor(){super({id:"outdent",precondition:oe.writable,kbOpts:{weight:yi,kbExpr:ze.and(oe.editorTextFocus,oe.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(n,r,s){n.pushUndoStop(),n.executeCommands(this.id,zr.outdent(r.cursorConfig,r.model,r.getCursorStates().map(o=>o.modelState.selection))),n.pushUndoStop()}}),i.Tab=ct(new class extends e{constructor(){super({id:"tab",precondition:oe.writable,kbOpts:{weight:yi,kbExpr:ze.and(oe.editorTextFocus,oe.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(n,r,s){n.pushUndoStop(),n.executeCommands(this.id,zr.tab(r.cursorConfig,r.model,r.getCursorStates().map(o=>o.modelState.selection))),n.pushUndoStop()}}),i.DeleteLeft=ct(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(n,r,s){const[o,a]=fx.deleteLeft(r.getPrevEditOperationType(),r.cursorConfig,r.model,r.getCursorStates().map(l=>l.modelState.selection),r.getCursorAutoClosedCharacters());o&&n.pushUndoStop(),n.executeCommands(this.id,a),r.setPrevEditOperationType(2)}}),i.DeleteRight=ct(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:yi,kbExpr:oe.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(n,r,s){const[o,a]=fx.deleteRight(r.getPrevEditOperationType(),r.cursorConfig,r.model,r.getCursorStates().map(l=>l.modelState.selection));o&&n.pushUndoStop(),n.executeCommands(this.id,a),r.setPrevEditOperationType(3)}}),i.Undo=new class extends PJ{constructor(){super(IEe)}runDOMCommand(n){n.ownerDocument.execCommand("undo")}runEditorCommand(n,r,s){if(!(!r.hasModel()||r.getOption(90)===!0))return r.getModel().undo()}},i.Redo=new class extends PJ{constructor(){super(TEe)}runDOMCommand(n){n.ownerDocument.execCommand("redo")}runEditorCommand(n,r,s){if(!(!r.hasModel()||r.getOption(90)===!0))return r.getModel().redo()}}})(G2||(G2={}));class Sge extends d${constructor(e,n,r){super({id:e,precondition:void 0,description:r}),this._handlerId=n}runCommand(e,n){const r=e.get(Si).getFocusedCodeEditor();r&&r.trigger("keyboard",this._handlerId,n)}}function Qx(i,e){Cge(new Sge("default:"+i,i)),Cge(new Sge(i,i,e))}Qx("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Qx("replacePreviousChar");Qx("compositionType");Qx("compositionStart");Qx("compositionEnd");Qx("paste");Qx("cut");class Lpt{constructor(e,n,r,s){this.configuration=e,this.viewModel=n,this.userInputEvents=r,this.commandDelegate=s}paste(e,n,r,s){this.commandDelegate.paste(e,n,r,s)}type(e){this.commandDelegate.type(e)}compositionType(e,n,r,s){this.commandDelegate.compositionType(e,n,r,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Oo.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const n=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<n?new ve(e.lineNumber,n):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(77)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(77)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const n=this.configuration.options,r=_l&&n.get(106),s=n.get(22);e.middleButton&&!r?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,n){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:n}}moveTo(e,n){Oo.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_moveToSelect(e,n){Oo.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_columnSelect(e,n,r){e=this._validateViewColumn(e),Oo.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:n,doColumnSelect:r})}_createCursor(e,n){e=this._validateViewColumn(e),Oo.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:n})}_lastCursorMoveToSelect(e,n){Oo.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_wordSelect(e,n){Oo.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_wordSelectDrag(e,n){Oo.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_lastCursorWordSelect(e,n){Oo.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_lineSelect(e,n){Oo.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_lineSelectDrag(e,n){Oo.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_lastCursorLineSelect(e,n){Oo.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_lastCursorLineSelectDrag(e,n){Oo.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,n))}_selectAll(){Oo.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class R${constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var n;(n=this.onKeyDown)===null||n===void 0||n.call(this,e)}emitKeyUp(e){var n;(n=this.onKeyUp)===null||n===void 0||n.call(this,e)}emitContextMenu(e){var n;(n=this.onContextMenu)===null||n===void 0||n.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var n;(n=this.onMouseMove)===null||n===void 0||n.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var n;(n=this.onMouseLeave)===null||n===void 0||n.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var n;(n=this.onMouseDown)===null||n===void 0||n.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var n;(n=this.onMouseUp)===null||n===void 0||n.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var n;(n=this.onMouseDrag)===null||n===void 0||n.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var n;(n=this.onMouseDrop)===null||n===void 0||n.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var n;(n=this.onMouseWheel)===null||n===void 0||n.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return R$.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,n){const r=Object.assign({},e);return r.position&&(r.position=n.convertViewPositionToModelPosition(r.position)),r.range&&(r.range=n.convertViewRangeToModelRange(r.range)),(r.type===5||r.type===8)&&(r.detail=this.convertViewToModelViewZoneData(r.detail,n)),r}static convertViewToModelViewZoneData(e,n){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?n.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?n.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:n.convertViewPositionToModelPosition(e.position),afterLineNumber:n.convertViewPositionToModelPosition(new ve(e.afterLineNumber,1)).lineNumber}}}class WIe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,n){this._lines=n,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const n=e-this._rendLineNumberStart;if(n<0||n>=this._lines.length)throw new Vs("Illegal value for lineNumber");return this._lines[n]}onLinesDeleted(e,n){if(this.getCount()===0)return null;const r=this.getStartLineNumber(),s=this.getEndLineNumber();if(n<r){const c=n-e+1;return this._rendLineNumberStart-=c,null}if(e>s)return null;let o=0,a=0;for(let c=r;c<=s;c++){const u=c-this._rendLineNumberStart;e<=c&&c<=n&&(a===0?(o=u,a=1):a++)}if(e<r){let c=0;n<r?c=n-e+1:c=r-e,this._rendLineNumberStart-=c}return this._lines.splice(o,a)}onLinesChanged(e,n){const r=e+n-1;if(this.getCount()===0)return!1;const s=this.getStartLineNumber(),o=this.getEndLineNumber();let a=!1;for(let l=e;l<=r;l++)l>=s&&l<=o&&(this._lines[l-this._rendLineNumberStart].onContentChanged(),a=!0);return a}onLinesInserted(e,n){if(this.getCount()===0)return null;const r=n-e+1,s=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=r,null;if(e>o)return null;if(r+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const a=[];for(let h=0;h<r;h++)a[h]=this._createLine();const l=e-this._rendLineNumberStart,c=this._lines.slice(0,l),u=this._lines.slice(l,this._lines.length-r),d=this._lines.slice(this._lines.length-r,this._lines.length);return this._lines=c.concat(a).concat(u),d}onTokensChanged(e){if(this.getCount()===0)return!1;const n=this.getStartLineNumber(),r=this.getEndLineNumber();let s=!1;for(let o=0,a=e.length;o<a;o++){const l=e[o];if(l.toLineNumber<n||l.fromLineNumber>r)continue;const c=Math.max(n,l.fromLineNumber),u=Math.min(r,l.toLineNumber);for(let d=c;d<=u;d++){const h=d-this._rendLineNumberStart;this._lines[h].onTokensChanged(),s=!0}}return s}}class $Ie{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new WIe(()=>this._host.createVisibleLine())}_createDomNode(){const e=Di(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(143)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const n=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(n)for(let r=0,s=n.length;r<s;r++){const o=n[r].getDomNode();o&&this.domNode.domNode.removeChild(o)}return!0}onLinesInserted(e){const n=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(n)for(let r=0,s=n.length;r<s;r++){const o=n[r].getDomNode();o&&this.domNode.domNode.removeChild(o)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const n=this._linesCollection._get(),r=new V0(this.domNode.domNode,this._host,e),s={rendLineNumberStart:n.rendLineNumberStart,lines:n.lines,linesLength:n.lines.length},o=r.render(s,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class V0{constructor(e,n,r){this.domNode=e,this.host=n,this.viewportData=r}render(e,n,r,s){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<n||r<o.rendLineNumberStart){o.rendLineNumberStart=n,o.linesLength=r-n+1,o.lines=[];for(let a=n;a<=r;a++)o.lines[a-n]=this.host.createVisibleLine();return this._finishRendering(o,!0,s),o}if(this._renderUntouchedLines(o,Math.max(n-o.rendLineNumberStart,0),Math.min(r-o.rendLineNumberStart,o.linesLength-1),s,n),o.rendLineNumberStart>n){const a=n,l=Math.min(r,o.rendLineNumberStart-1);a<=l&&(this._insertLinesBefore(o,a,l,s,n),o.linesLength+=l-a+1)}else if(o.rendLineNumberStart<n){const a=Math.min(o.linesLength,n-o.rendLineNumberStart);a>0&&(this._removeLinesBefore(o,a),o.linesLength-=a)}if(o.rendLineNumberStart=n,o.rendLineNumberStart+o.linesLength-1<r){const a=o.rendLineNumberStart+o.linesLength,l=r;a<=l&&(this._insertLinesAfter(o,a,l,s,n),o.linesLength+=l-a+1)}else if(o.rendLineNumberStart+o.linesLength-1>r){const a=Math.max(0,r-o.rendLineNumberStart+1),c=o.linesLength-1-a+1;c>0&&(this._removeLinesAfter(o,c),o.linesLength-=c)}return this._finishRendering(o,!1,s),o}_renderUntouchedLines(e,n,r,s,o){const a=e.rendLineNumberStart,l=e.lines;for(let c=n;c<=r;c++){const u=a+c;l[c].layoutLine(u,s[u-o])}}_insertLinesBefore(e,n,r,s,o){const a=[];let l=0;for(let c=n;c<=r;c++)a[l++]=this.host.createVisibleLine();e.lines=a.concat(e.lines)}_removeLinesBefore(e,n){for(let r=0;r<n;r++){const s=e.lines[r].getDomNode();s&&this.domNode.removeChild(s)}e.lines.splice(0,n)}_insertLinesAfter(e,n,r,s,o){const a=[];let l=0;for(let c=n;c<=r;c++)a[l++]=this.host.createVisibleLine();e.lines=e.lines.concat(a)}_removeLinesAfter(e,n){const r=e.linesLength-n;for(let s=0;s<n;s++){const o=e.lines[r+s].getDomNode();o&&this.domNode.removeChild(o)}e.lines.splice(r,n)}_finishRenderingNewLines(e,n,r,s){V0._ttPolicy&&(r=V0._ttPolicy.createHTML(r));const o=this.domNode.lastChild;n||!o?this.domNode.innerHTML=r:o.insertAdjacentHTML("afterend",r);let a=this.domNode.lastChild;for(let l=e.linesLength-1;l>=0;l--){const c=e.lines[l];s[l]&&(c.setDomNode(a),a=a.previousSibling)}}_finishRenderingInvalidLines(e,n,r){const s=document.createElement("div");V0._ttPolicy&&(n=V0._ttPolicy.createHTML(n)),s.innerHTML=n;for(let o=0;o<e.linesLength;o++){const a=e.lines[o];if(r[o]){const l=s.firstChild,c=a.getDomNode();c.parentNode.replaceChild(l,c),a.setDomNode(l)}}}_finishRendering(e,n,r){const s=V0._sb,o=e.linesLength,a=e.lines,l=e.rendLineNumberStart,c=[];{s.reset();let u=!1;for(let d=0;d<o;d++){const h=a[d];c[d]=!1,!(h.getDomNode()||!h.renderLine(d+l,r[d],this.viewportData,s))&&(c[d]=!0,u=!0)}u&&this._finishRenderingNewLines(e,n,s.build(),c)}{s.reset();let u=!1;const d=[];for(let h=0;h<o;h++){const f=a[h];d[h]=!1,!(c[h]||!f.renderLine(h+l,r[h],this.viewportData,s))&&(d[h]=!0,u=!0)}u&&this._finishRenderingInvalidLines(e,s.build(),d)}}}V0._ttPolicy=$v("editorViewLayer",{createHTML:i=>i});V0._sb=new jI(1e5);class zIe extends hu{constructor(e){super(e),this._visibleLines=new $Ie(this),this.domNode=this._visibleLines.domNode;const r=this._context.configuration.options.get(50);Ta(this.domNode,r),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,n=this._dynamicOverlays.length;e<n;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,n=this._dynamicOverlays.length;e<n;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new Dpt(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let a=n;a<=r;a++)this._visibleLines.getVisibleLine(a).onConfigurationChanged(e);const o=this._context.configuration.options.get(50);return Ta(this.domNode,o),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const n=this._dynamicOverlays.filter(r=>r.shouldRender());for(let r=0,s=n.length;r<s;r++){const o=n[r];o.prepareRender(e),o.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class Dpt{constructor(e,n){this._configuration=e,this._lineHeight=this._configuration.options.get(66),this._dynamicOverlays=n,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=Di(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(66)}renderLine(e,n,r,s){let o="";for(let a=0,l=this._dynamicOverlays.length;a<l;a++){const c=this._dynamicOverlays[a];o+=c.render(r.startLineNumber,e)}return this._renderedContent===o?!1:(this._renderedContent=o,s.appendString('<div style="position:absolute;top:'),s.appendString(String(n)),s.appendString("px;width:100%;height:"),s.appendString(String(this._lineHeight)),s.appendString('px;">'),s.appendString(o),s.appendString("</div>"),!0)}layoutLine(e,n){this._domNode&&(this._domNode.setTop(n),this._domNode.setHeight(this._lineHeight))}}class Ept extends zIe{constructor(e){super(e);const r=this._context.configuration.options.get(143);this._contentWidth=r.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const r=this._context.configuration.options.get(143);return this._contentWidth=r.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class Ipt extends zIe{constructor(e){super(e);const n=this._context.configuration.options,r=n.get(143);this._contentLeft=r.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Ta(this.domNode,n.get(50))}onConfigurationChanged(e){const n=this._context.configuration.options;Ta(this.domNode,n.get(50));const r=n.get(143);return this._contentLeft=r.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const n=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(n),this.domNode.setWidth(this._contentLeft)}}class Tpt extends hu{constructor(e,n){super(e),this._viewDomNode=n,this._widgets={},this.domNode=Di(document.createElement("div")),Ym.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Di(document.createElement("div")),Ym.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const n=Object.keys(this._widgets);for(const r of n)this._widgets[r].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const n of e)this._widgets[n].updateAnchorViewPosition()}addWidget(e){const n=new Rpt(this._context,this._viewDomNode,e);this._widgets[n.id]=n,n.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(n.domNode):this.domNode.appendChild(n.domNode),this.setShouldRender()}setWidgetPosition(e,n,r,s,o){this._widgets[e.getId()].setPosition(n,r,s,o),this.setShouldRender()}removeWidget(e){const n=e.getId();if(this._widgets.hasOwnProperty(n)){const r=this._widgets[n];delete this._widgets[n];const s=r.domNode.domNode;s.parentNode.removeChild(s),s.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const n=Object.keys(this._widgets);for(const r of n)this._widgets[r].onBeforeRender(e)}prepareRender(e){const n=Object.keys(this._widgets);for(const r of n)this._widgets[r].prepareRender(e)}render(e){const n=Object.keys(this._widgets);for(const r of n)this._widgets[r].render(e)}}class Rpt{constructor(e,n,r){this._primaryAnchor=new KR(null,null),this._secondaryAnchor=new KR(null,null),this._context=e,this._viewDomNode=n,this._actual=r,this.domNode=Di(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const s=this._context.configuration.options,o=s.get(143);this._fixedOverflowWidgets=s.get(42),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=s.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const n=this._context.configuration.options;if(this._lineHeight=n.get(66),e.hasChanged(143)){const r=n.get(143);this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,n,r){this._affinity=e,this._primaryAnchor=s(n,this._context.viewModel,this._affinity),this._secondaryAnchor=s(r,this._context.viewModel,this._affinity);function s(o,a,l){if(!o)return new KR(null,null);const c=a.model.validatePosition(o);if(a.coordinatesConverter.modelPositionIsVisible(c)){const u=a.coordinatesConverter.convertModelPositionToViewPosition(c,l??void 0);return new KR(o,u)}return new KR(o,null)}}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,n=e.defaultView;return this.allowEditorOverflow?(n==null?void 0:n.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,n,r,s){this._setPosition(s,e,n),this._preference=r,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,n,r,s){const o=e.top,a=o,l=e.top+e.height,c=s.viewportHeight-l,u=o-r,d=a>=r,h=l,f=c>=r;let p=e.left;return p+n>s.scrollLeft+s.viewportWidth&&(p=s.scrollLeft+s.viewportWidth-n),p<s.scrollLeft&&(p=s.scrollLeft),{fitsAbove:d,aboveTop:u,fitsBelow:f,belowTop:h,left:p}}_layoutHorizontalSegmentInPage(e,n,r,s){var o;const c=Math.max(15,n.left-s),u=Math.min(n.left+n.width+s,e.width-15),h=this._viewDomNode.domNode.ownerDocument.defaultView;let f=n.left+r-((o=h==null?void 0:h.scrollX)!==null&&o!==void 0?o:0);if(f+s>u){const p=f-(u-s);f-=p,r-=p}if(f<c){const p=f-c;f-=p,r-=p}return[r,f]}_layoutBoxInPage(e,n,r,s){var o,a;const l=e.top-r,c=e.top+e.height,u=no(this._viewDomNode.domNode),d=this._viewDomNode.domNode.ownerDocument,h=d.defaultView,f=u.top+l-((o=h==null?void 0:h.scrollY)!==null&&o!==void 0?o:0),p=u.top+c-((a=h==null?void 0:h.scrollY)!==null&&a!==void 0?a:0),g=FI(d.body),[m,_]=this._layoutHorizontalSegmentInPage(g,u,e.left-s.scrollLeft+this._contentLeft,n),b=22,y=22,x=f>=b,k=p+r<=g.height-y;return this._fixedOverflowWidgets?{fitsAbove:x,aboveTop:Math.max(f,b),fitsBelow:k,belowTop:p,left:_}:{fitsAbove:x,aboveTop:l,fitsBelow:k,belowTop:c,left:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new GR(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var n,r;const s=l(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((n=this._secondaryAnchor.viewPosition)===null||n===void 0?void 0:n.lineNumber)===((r=this._primaryAnchor.viewPosition)===null||r===void 0?void 0:r.lineNumber)?this._secondaryAnchor.viewPosition:null,a=l(o,this._affinity,this._lineHeight);return{primary:s,secondary:a};function l(c,u,d){if(!c)return null;const h=e.visibleRangeForPosition(c);if(!h)return null;const f=c.column===1&&u===3?0:h.left,p=e.getVerticalOffsetForLineNumber(c.lineNumber)-e.scrollTop;return new xge(p,f,d)}}_reduceAnchorCoordinates(e,n,r){if(!n)return e;const s=this._context.configuration.options.get(50);let o=n.left;return o<e.left?o=Math.max(o,e.left-r+s.typicalFullwidthCharacterWidth):o=Math.min(o,e.left+r-s.typicalFullwidthCharacterWidth),new xge(e.top,o,e.height)}_prepareRenderWidget(e){if(!this._preference||this._preference.length===0)return null;const{primary:n,secondary:r}=this._getAnchorsCoordinates(e);if(!n)return null;if(this._cachedDomNodeOffsetWidth===-1||this._cachedDomNodeOffsetHeight===-1){let a=null;if(typeof this._actual.beforeRender=="function"&&(a=wq(this._actual.beforeRender,this._actual)),a)this._cachedDomNodeOffsetWidth=a.width,this._cachedDomNodeOffsetHeight=a.height;else{const c=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(c.width),this._cachedDomNodeOffsetHeight=Math.round(c.height)}}const s=this._reduceAnchorCoordinates(n,r,this._cachedDomNodeOffsetWidth);let o;this.allowEditorOverflow?o=this._layoutBoxInPage(s,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):o=this._layoutBoxInViewport(s,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let a=1;a<=2;a++)for(const l of this._preference)if(l===1){if(!o)return null;if(a===2||o.fitsAbove)return{coordinate:new GR(o.aboveTop,o.left),position:1}}else if(l===2){if(!o)return null;if(a===2||o.fitsBelow)return{coordinate:new GR(o.belowTop,o.left),position:2}}else return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new GR(s.top,s.left)),position:0}:{coordinate:new GR(s.top,s.left),position:0};return null}onBeforeRender(e){!this._primaryAnchor.viewPosition||!this._preference||this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&wq(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&wq(this._actual.afterRender,this._actual,this._renderData.position)}}class KR{constructor(e,n){this.modelPosition=e,this.viewPosition=n}}class GR{constructor(e,n){this.top=e,this.left=n,this._coordinateBrand=void 0}}class xge{constructor(e,n,r){this.top=e,this.left=n,this.height=r,this._anchorCoordinateBrand=void 0}}function wq(i,e,...n){try{return i.call(e,...n)}catch{return null}}class VIe extends Zx{constructor(e){super(),this._context=e;const n=this._context.configuration.options,r=n.get(143);this._lineHeight=n.get(66),this._renderLineHighlight=n.get(95),this._renderLineHighlightOnlyWhenFocus=n.get(96),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Ft(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const n=this._selections.map(s=>s.positionLineNumber);n.sort((s,o)=>s-o),ys(this._cursorLineNumbers,n)||(this._cursorLineNumbers=n,e=!0);const r=this._selections.every(s=>s.isEmpty());return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const n=this._context.configuration.options,r=n.get(143);return this._lineHeight=n.get(66),this._renderLineHighlight=n.get(95),this._renderLineHighlightOnlyWhenFocus=n.get(96),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const n=this._renderOne(e),r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let a=0;const l=[];for(let c=r;c<=s;c++){const u=c-r;for(;a<o&&this._cursorLineNumbers[a]<c;)a++;a<o&&this._cursorLineNumbers[a]===c?l[u]=n:l[u]=""}this._renderData=l}render(e,n){if(!this._renderData)return"";const r=n-e;return r>=this._renderData.length?"":this._renderData[r]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class Apt extends VIe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderOther()?" current-line-both":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Npt extends VIe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Of((i,e)=>{const n=i.getColor(EIe);if(n&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${n}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${n}; border: none; }`)),!n||n.isTransparent()||i.defines(bge)){const r=i.getColor(bge);r&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${r}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${r}; }`),Vp(i.type)&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class Mpt extends Zx{constructor(e){super(),this._context=e;const n=this._context.configuration.options;this._lineHeight=n.get(66),this._typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options;return this._lineHeight=n.get(66),this._typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const n=e.getDecorationsInViewport();let r=[],s=0;for(let c=0,u=n.length;c<u;c++){const d=n[c];d.options.className&&(r[s++]=d)}r=r.sort((c,u)=>{if(c.options.zIndex<u.options.zIndex)return-1;if(c.options.zIndex>u.options.zIndex)return 1;const d=c.options.className,h=u.options.className;return d<h?-1:d>h?1:J.compareRangesUsingStarts(c.range,u.range)});const o=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,l=[];for(let c=o;c<=a;c++){const u=c-o;l[u]=""}this._renderWholeLineDecorations(e,r,l),this._renderNormalDecorations(e,r,l),this._renderResult=l}_renderWholeLineDecorations(e,n,r){const s=String(this._lineHeight),o=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber;for(let l=0,c=n.length;l<c;l++){const u=n[l];if(!u.options.isWholeLine)continue;const d='<div class="cdr '+u.options.className+'" style="left:0;width:100%;height:'+s+'px;"></div>',h=Math.max(u.range.startLineNumber,o),f=Math.min(u.range.endLineNumber,a);for(let p=h;p<=f;p++){const g=p-o;r[g]+=d}}}_renderNormalDecorations(e,n,r){var s;const o=String(this._lineHeight),a=e.visibleRange.startLineNumber;let l=null,c=!1,u=null,d=!1;for(let h=0,f=n.length;h<f;h++){const p=n[h];if(p.options.isWholeLine)continue;const g=p.options.className,m=!!p.options.showIfCollapsed;let _=p.range;if(m&&_.endColumn===1&&_.endLineNumber!==_.startLineNumber&&(_=new J(_.startLineNumber,_.startColumn,_.endLineNumber-1,this._context.viewModel.getLineMaxColumn(_.endLineNumber-1))),l===g&&c===m&&J.areIntersectingOrTouching(u,_)){u=J.plusRange(u,_);continue}l!==null&&this._renderNormalDecoration(e,u,l,d,c,o,a,r),l=g,c=m,u=_,d=(s=p.options.shouldFillLineOnLineBreak)!==null&&s!==void 0?s:!1}l!==null&&this._renderNormalDecoration(e,u,l,d,c,o,a,r)}_renderNormalDecoration(e,n,r,s,o,a,l,c){const u=e.linesVisibleRangesForRange(n,r==="findMatch");if(u)for(let d=0,h=u.length;d<h;d++){const f=u[d];if(f.outsideRenderedLine)continue;const p=f.lineNumber-l;if(o&&f.ranges.length===1){const g=f.ranges[0];if(g.width<this._typicalHalfwidthCharacterWidth){const m=Math.round(g.left+g.width/2),_=Math.max(0,Math.round(m-this._typicalHalfwidthCharacterWidth/2));f.ranges[0]=new D$(_,this._typicalHalfwidthCharacterWidth)}}for(let g=0,m=f.ranges.length;g<m;g++){const _=s&&f.continuesOnNextLine&&m===1,b=f.ranges[g],y='<div class="cdr '+r+'" style="left:'+String(b.left)+(_?"px;width:100%;height:":"px;width:"+String(b.width)+"px;height:")+a+'px;"></div>';c[p]+=y}}}render(e,n){if(!this._renderResult)return"";const r=n-e;return r<0||r>=this._renderResult.length?"":this._renderResult[r]}}class Ppt extends hu{constructor(e,n,r,s){super(e);const o=this._context.configuration.options,a=o.get(102),l=o.get(74),c=o.get(40),u=o.get(105),d={listenOnDomNode:r.domNode,className:"editor-scrollable "+NJ(e.theme.type),useShadows:!1,lazyRender:!0,vertical:a.vertical,horizontal:a.horizontal,verticalHasArrows:a.verticalHasArrows,horizontalHasArrows:a.horizontalHasArrows,verticalScrollbarSize:a.verticalScrollbarSize,verticalSliderSize:a.verticalSliderSize,horizontalScrollbarSize:a.horizontalScrollbarSize,horizontalSliderSize:a.horizontalSliderSize,handleMouseWheel:a.handleMouseWheel,alwaysConsumeMouseWheel:a.alwaysConsumeMouseWheel,arrowSize:a.arrowSize,mouseWheelScrollSensitivity:l,fastScrollSensitivity:c,scrollPredominantAxis:u,scrollByPage:a.scrollByPage};this.scrollbar=this._register(new xoe(n.domNode,d,this._context.viewLayout.getScrollable())),Ym.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=Di(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const h=(f,p,g)=>{const m={};{const _=f.scrollTop;_&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,f.scrollTop=0)}if(g){const _=f.scrollLeft;_&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,f.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,1)};this._register(Be(r.domNode,"scroll",f=>h(r.domNode,!0,!0))),this._register(Be(n.domNode,"scroll",f=>h(n.domNode,!0,!1))),this._register(Be(s.domNode,"scroll",f=>h(s.domNode,!0,!1))),this._register(Be(this.scrollbarDomNode.domNode,"scroll",f=>h(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,n=e.get(143);this.scrollbarDomNode.setLeft(n.contentLeft),e.get(72).side==="right"?this.scrollbarDomNode.setWidth(n.contentWidth+n.minimap.minimapWidth):this.scrollbarDomNode.setWidth(n.contentWidth),this.scrollbarDomNode.setHeight(n.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(102)||e.hasChanged(74)||e.hasChanged(40)){const n=this._context.configuration.options,r=n.get(102),s=n.get(74),o=n.get(40),a=n.get(105),l={vertical:r.vertical,horizontal:r.horizontal,verticalScrollbarSize:r.verticalScrollbarSize,horizontalScrollbarSize:r.horizontalScrollbarSize,scrollByPage:r.scrollByPage,handleMouseWheel:r.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:o,scrollPredominantAxis:a};this.scrollbar.updateOptions(l)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+NJ(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class HIe extends Le{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function A$(i,e){let n=0,r=0;const s=i.length;for(;r<s;){const o=i.charCodeAt(r);if(o===32)n++;else if(o===9)n=n-n%e+e;else break;r++}return r===s?-1:n}var OS;(function(i){i[i.Disabled=0]="Disabled",i[i.EnabledForActive=1]="EnabledForActive",i[i.Enabled=2]="Enabled"})(OS||(OS={}));class yS{constructor(e,n,r,s,o,a){if(this.visibleColumn=e,this.column=n,this.className=r,this.horizontalLine=s,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=a,e!==-1==(n!==-1))throw new Error}}class sM{constructor(e,n){this.top=e,this.endColumn=n}}class Opt extends HIe{constructor(e,n){super(),this.textModel=e,this.languageConfigurationService=n}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return A$(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,n,r){this.assertNotDisposed();const s=this.textModel.getLineCount();if(e<1||e>s)throw new Vs("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=!!(o&&o.offSide);let l=-2,c=-1,u=-2,d=-1;const h=E=>{if(l!==-1&&(l===-2||l>E-1)){l=-1,c=-1;for(let A=E-2;A>=0;A--){const M=this._computeIndentLevel(A);if(M>=0){l=A,c=M;break}}}if(u===-2){u=-1,d=-1;for(let A=E;A<s;A++){const M=this._computeIndentLevel(A);if(M>=0){u=A,d=M;break}}}};let f=-2,p=-1,g=-2,m=-1;const _=E=>{if(f===-2){f=-1,p=-1;for(let A=E-2;A>=0;A--){const M=this._computeIndentLevel(A);if(M>=0){f=A,p=M;break}}}if(g!==-1&&(g===-2||g<E-1)){g=-1,m=-1;for(let A=E;A<s;A++){const M=this._computeIndentLevel(A);if(M>=0){g=A,m=M;break}}}};let b=0,y=!0,x=0,k=!0,D=0,R=0;for(let E=0;y||k;E++){const A=e-E,M=e+E;E>1&&(A<1||A<n)&&(y=!1),E>1&&(M>s||M>r)&&(k=!1),E>5e4&&(y=!1,k=!1);let N=-1;if(y&&A>=1){const O=this._computeIndentLevel(A-1);O>=0?(u=A-1,d=O,N=Math.ceil(O/this.textModel.getOptions().indentSize)):(h(A),N=this._getIndentLevelForWhitespaceLine(a,c,d))}let P=-1;if(k&&M<=s){const O=this._computeIndentLevel(M-1);O>=0?(f=M-1,p=O,P=Math.ceil(O/this.textModel.getOptions().indentSize)):(_(M),P=this._getIndentLevelForWhitespaceLine(a,p,m))}if(E===0){R=N;continue}if(E===1){if(M<=s&&P>=0&&R+1===P){y=!1,b=M,x=M,D=P;continue}if(A>=1&&N>=0&&N-1===R){k=!1,b=A,x=A,D=N;continue}if(b=e,x=e,D=R,D===0)return{startLineNumber:b,endLineNumber:x,indent:D}}y&&(N>=D?b=A:y=!1),k&&(P>=D?x=M:k=!1)}return{startLineNumber:b,endLineNumber:x,indent:D}}getLinesBracketGuides(e,n,r,s){var o;const a=[];for(let f=e;f<=n;f++)a.push([]);const l=!0,c=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new J(e,1,n,this.textModel.getLineMaxColumn(n))).toArray();let u;if(r&&c.length>0){const f=(e<=r.lineNumber&&r.lineNumber<=n?c:this.textModel.bracketPairs.getBracketPairsInRange(J.fromPositions(r)).toArray()).filter(p=>J.strictContainsPosition(p.range,r));u=(o=G9(f,p=>l))===null||o===void 0?void 0:o.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,h=new UIe;for(const f of c){if(!f.closingBracketRange)continue;const p=u&&f.range.equalsRange(u);if(!p&&!s.includeInactive)continue;const g=h.getInlineClassName(f.nestingLevel,f.nestingLevelOfEqualBracketType,d)+(s.highlightActive&&p?" "+h.activeClassName:""),m=f.openingBracketRange.getStartPosition(),_=f.closingBracketRange.getStartPosition(),b=s.horizontalGuides===OS.Enabled||s.horizontalGuides===OS.EnabledForActive&&p;if(f.range.startLineNumber===f.range.endLineNumber){b&&a[f.range.startLineNumber-e].push(new yS(-1,f.openingBracketRange.getEndPosition().column,g,new sM(!1,_.column),-1,-1));continue}const y=this.getVisibleColumnFromPosition(_),x=this.getVisibleColumnFromPosition(f.openingBracketRange.getStartPosition()),k=Math.min(x,y,f.minVisibleColumnIndentation+1);let D=!1;ml(this.textModel.getLineContent(f.closingBracketRange.startLineNumber))<f.closingBracketRange.startColumn-1&&(D=!0);const A=Math.max(m.lineNumber,e),M=Math.min(_.lineNumber,n),N=D?1:0;for(let P=A;P<M+N;P++)a[P-e].push(new yS(k,-1,g,null,P===m.lineNumber?m.column:-1,P===_.lineNumber?_.column:-1));b&&(m.lineNumber>=e&&x>k&&a[m.lineNumber-e].push(new yS(k,-1,g,new sM(!1,m.column),-1,-1)),_.lineNumber<=n&&y>k&&a[_.lineNumber-e].push(new yS(k,-1,g,new sM(!D,_.column),-1,-1)))}for(const f of a)f.sort((p,g)=>p.visibleColumn-g.visibleColumn);return a}getVisibleColumnFromPosition(e){return ho.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,n){this.assertNotDisposed();const r=this.textModel.getLineCount();if(e<1||e>r)throw new Error("Illegal value for startLineNumber");if(n<1||n>r)throw new Error("Illegal value for endLineNumber");const s=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=!!(o&&o.offSide),l=new Array(n-e+1);let c=-2,u=-1,d=-2,h=-1;for(let f=e;f<=n;f++){const p=f-e,g=this._computeIndentLevel(f-1);if(g>=0){c=f-1,u=g,l[p]=Math.ceil(g/s.indentSize);continue}if(c===-2){c=-1,u=-1;for(let m=f-2;m>=0;m--){const _=this._computeIndentLevel(m);if(_>=0){c=m,u=_;break}}}if(d!==-1&&(d===-2||d<f-1)){d=-1,h=-1;for(let m=f;m<r;m++){const _=this._computeIndentLevel(m);if(_>=0){d=m,h=_;break}}}l[p]=this._getIndentLevelForWhitespaceLine(a,u,h)}return l}_getIndentLevelForWhitespaceLine(e,n,r){const s=this.textModel.getOptions();return n===-1||r===-1?0:n<r?1+Math.floor(n/s.indentSize):n===r||e?Math.ceil(r/s.indentSize):1+Math.floor(r/s.indentSize)}}class UIe{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,n,r){return this.getInlineClassNameOfLevel(r?n:e)}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}}class Fpt extends Zx{constructor(e){super(),this._context=e,this._primaryPosition=null;const n=this._context.configuration.options,r=n.get(144),s=n.get(50);this._lineHeight=n.get(66),this._spaceWidth=s.spaceWidth,this._maxIndentLeft=r.wrappingColumn===-1?-1:r.wrappingColumn*s.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=n.get(16),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options,r=n.get(144),s=n.get(50);return this._lineHeight=n.get(66),this._spaceWidth=s.spaceWidth,this._maxIndentLeft=r.wrappingColumn===-1?-1:r.wrappingColumn*s.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=n.get(16),!0}onCursorStateChanged(e){var n;const s=e.selections[0].getPosition();return!((n=this._primaryPosition)===null||n===void 0)&&n.equals(s)?!1:(this._primaryPosition=s,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var n,r,s,o;if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}const a=e.visibleRange.startLineNumber,l=e.visibleRange.endLineNumber,c=e.scrollWidth,u=this._lineHeight,d=this._primaryPosition,h=this.getGuidesByLine(a,Math.min(l+1,this._context.viewModel.getLineCount()),d),f=[];for(let p=a;p<=l;p++){const g=p-a,m=h[g];let _="";const b=(r=(n=e.visibleRangeForPosition(new ve(p,1)))===null||n===void 0?void 0:n.left)!==null&&r!==void 0?r:0;for(const y of m){const x=y.column===-1?b+(y.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new ve(p,y.column)).left;if(x>c||this._maxIndentLeft>0&&x>this._maxIndentLeft)break;const k=y.horizontalLine?y.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",D=y.horizontalLine?((o=(s=e.visibleRangeForPosition(new ve(p,y.horizontalLine.endColumn)))===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:x+this._spaceWidth)-x:this._spaceWidth;_+=`<div class="core-guide ${y.className} ${k}" style="left:${x}px;height:${u}px;width:${D}px"></div>`}f[g]=_}this._renderResult=f}getGuidesByLine(e,n,r){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,n,r,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?OS.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?OS.EnabledForActive:OS.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,n):null;let a=0,l=0,c=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&r){const h=this._context.viewModel.getActiveIndentGuide(r.lineNumber,e,n);a=h.startLineNumber,l=h.endLineNumber,c=h.indent}const{indentSize:u}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=n;h++){const f=new Array;d.push(f);const p=s?s[h-e]:[],g=new Ev(p),m=o?o[h-e]:0;for(let _=1;_<=m;_++){const b=(_-1)*u+1,y=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||p.length===0)&&a<=h&&h<=l&&_===c;f.push(...g.takeWhile(k=>k.visibleColumn<b)||[]);const x=g.peek();(!x||x.visibleColumn!==b||x.horizontalLine)&&f.push(new yS(b,-1,`core-guide-indent lvl-${(_-1)%30}`+(y?" indent-active":""),null,-1,-1))}f.push(...g.takeWhile(_=>!0)||[])}return d}render(e,n){if(!this._renderResult)return"";const r=n-e;return r<0||r>=this._renderResult.length?"":this._renderResult[r]}}function eD(i){if(!(i&&i.isTransparent()))return i}Of((i,e)=>{const n=[{bracketColor:RIe,guideColor:Kft,guideColorActive:Jft},{bracketColor:AIe,guideColor:Gft,guideColorActive:ept},{bracketColor:NIe,guideColor:Xft,guideColorActive:tpt},{bracketColor:MIe,guideColor:Yft,guideColorActive:npt},{bracketColor:PIe,guideColor:Zft,guideColorActive:ipt},{bracketColor:OIe,guideColor:Qft,guideColorActive:rpt}],r=new UIe,s=[{indentColor:O5,indentColorActive:F5},{indentColor:Ift,indentColorActive:Mft},{indentColor:Tft,indentColorActive:Pft},{indentColor:Rft,indentColorActive:Oft},{indentColor:Aft,indentColorActive:Fft},{indentColor:Nft,indentColorActive:Bft}],o=n.map(l=>{var c,u;const d=i.getColor(l.bracketColor),h=i.getColor(l.guideColor),f=i.getColor(l.guideColorActive),p=eD((c=eD(h))!==null&&c!==void 0?c:d==null?void 0:d.transparent(.3)),g=eD((u=eD(f))!==null&&u!==void 0?u:d);if(!(!p||!g))return{guideColor:p,guideColorActive:g}}).filter(tP),a=s.map(l=>{const c=i.getColor(l.indentColor),u=i.getColor(l.indentColorActive),d=eD(c),h=eD(u);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(tP);if(o.length>0){for(let l=0;l<30;l++){const c=o[l%o.length];e.addRule(`.monaco-editor .${r.getInlineClassNameOfLevel(l).replace(/ /g,".")} { --guide-color: ${c.guideColor}; --guide-color-active: ${c.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${r.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${r.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${r.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(a.length>0){for(let l=0;l<30;l++){const c=a[l%a.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${l} { --indent-color: ${c.indentColor}; --indent-color-active: ${c.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class Cq{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,n){this._domNode=e,this.endNode=n,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class Bpt{constructor(){this._currentVisibleRange=new J(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class jpt{constructor(e,n,r,s,o,a,l){this.minimalReveal=e,this.lineNumber=n,this.startColumn=r,this.endColumn=s,this.startScrollTop=o,this.stopScrollTop=a,this.scrollType=l,this.type="range",this.minLineNumber=n,this.maxLineNumber=n}}class Wpt{constructor(e,n,r,s,o){this.minimalReveal=e,this.selections=n,this.startScrollTop=r,this.stopScrollTop=s,this.scrollType=o,this.type="selections";let a=n[0].startLineNumber,l=n[0].endLineNumber;for(let c=1,u=n.length;c<u;c++){const d=n[c];a=Math.min(a,d.startLineNumber),l=Math.max(l,d.endLineNumber)}this.minLineNumber=a,this.maxLineNumber=l}}class N$ extends hu{constructor(e,n){super(e),this._linesContent=n,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new $Ie(this),this.domNode=this._visibleLines.domNode;const r=this._context.configuration,s=this._context.configuration.options,o=s.get(50),a=s.get(144);this._lineHeight=s.get(66),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=a.isViewportWrapping,this._revealHorizontalRightPadding=s.get(99),this._cursorSurroundingLines=s.get(29),this._cursorSurroundingLinesStyle=s.get(30),this._canUseLayerHinting=!s.get(32),this._viewLineOptions=new gge(r,this._context.theme.type),Ym.write(this.domNode,7),this.domNode.setClassName(`view-lines ${q2}`),Ta(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new Ji(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new Ji(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Bpt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(114).enabled,this._maxNumberStickyLines=s.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new dm(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const n=this._context.configuration.options,r=n.get(50),s=n.get(144);return this._lineHeight=n.get(66),this._typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=n.get(99),this._cursorSurroundingLines=n.get(29),this._cursorSurroundingLinesStyle=n.get(30),this._canUseLayerHinting=!n.get(32),this._stickyScrollEnabled=n.get(114).enabled,this._maxNumberStickyLines=n.get(114).maxLineCount,Ta(this.domNode,r),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,n=new gge(e,this._context.theme.type);if(!this._viewLineOptions.equals(n)){this._viewLineOptions=n;const r=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=r;o<=s;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();let s=!1;for(let o=n;o<=r;o++)s=this._visibleLines.getVisibleLine(o).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let s=n;s<=r;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const n=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,n}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const n=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(n===-1)return!1;let r=this._context.viewLayout.validateScrollPosition({scrollTop:n});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?r={scrollTop:r.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new jpt(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),r.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Wpt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),r.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-r.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(r,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const n=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),r=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<n||e.scrollTop>r)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,n){const r=this._getViewLineDomNode(e);if(r===null)return null;const s=this._getLineNumberFor(r);if(s===-1||s<1||s>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(s)===1)return new ve(s,1);const o=this._visibleLines.getStartLineNumber(),a=this._visibleLines.getEndLineNumber();if(s<o||s>a)return null;let l=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(e,n);const c=this._context.viewModel.getLineMinColumn(s);return l<c&&(l=c),new ve(s,l)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===dm.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let s=n;s<=r;s++){const o=this._visibleLines.getVisibleLine(s);if(e===o.getDomNode())return s}return-1}getLineWidth(e){const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(e<n||e>r)return-1;const s=new Cq(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}linesVisibleRangesForRange(e,n){if(this.shouldRender())return null;const r=e.endLineNumber,s=J.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let a=0;const l=new Cq(this.domNode.domNode,this._textRangeRestingSpot);let c=0;n&&(c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ve(s.startLineNumber,1)).lineNumber);const u=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=s.startLineNumber;h<=s.endLineNumber;h++){if(h<u||h>d)continue;const f=h===s.startLineNumber?s.startColumn:1,p=h!==s.endLineNumber,g=p?this._context.viewModel.getLineMaxColumn(h):s.endColumn,m=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,f,g,l);if(m){if(n&&h<r){const _=c;c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ve(h+1,1)).lineNumber,_!==c&&(m.ranges[m.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[a++]=new Xht(m.outsideRenderedLine,h,D$.from(m.ranges),p)}}return this._updateLineWidthsSlowIfDomDidLayout(l),a===0?null:o}_visibleRangesForLineRange(e,n,r){if(this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;const s=new Cq(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,n,r,s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}visibleRangeForPosition(e){const n=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return n?new Yht(n.outsideRenderedLine,n.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();let s=1,o=!0;for(let a=n;a<=r;a++){const l=this._visibleLines.getVisibleLine(a);if(e&&!l.getWidthIsFast()){o=!1;continue}s=Math.max(s,l.getWidth(null))}return o&&n===1&&r===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),o}_checkMonospaceFontAssumptions(){let e=-1,n=-1;const r=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=r;o<=s;o++){const a=this._visibleLines.getVisibleLine(o);if(a.needsMonospaceFontCheck()){const l=a.getWidth(null);l>n&&(n=l,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=r;o<=s;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const r=this._horizontalRevealRequest;if(e.startLineNumber<=r.minLineNumber&&r.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(r);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:s.scrollLeft},r.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),_l&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const r=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=r;o<=s;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const n=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-n),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const n=Math.ceil(e);this._maxLineWidth<n&&(this._maxLineWidth=n,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,n,r,s,o,a){const l=e.top,c=e.height,u=l+c;let d,h,f;if(o&&o.length>0){let b=o[0].startLineNumber,y=o[0].endLineNumber;for(let x=1,k=o.length;x<k;x++){const D=o[x];b=Math.min(b,D.startLineNumber),y=Math.max(y,D.endLineNumber)}d=!1,h=this._context.viewLayout.getVerticalOffsetForLineNumber(b),f=this._context.viewLayout.getVerticalOffsetForLineNumber(y)+this._lineHeight}else if(s)d=!0,h=this._context.viewLayout.getVerticalOffsetForLineNumber(s.startLineNumber),f=this._context.viewLayout.getVerticalOffsetForLineNumber(s.endLineNumber)+this._lineHeight;else return-1;const p=(n==="mouse"||r)&&this._cursorSurroundingLinesStyle==="default";let g=0,m=0;if(p)r||(g=this._lineHeight);else{const b=Math.min(c/this._lineHeight/2,this._cursorSurroundingLines);this._stickyScrollEnabled?g=Math.max(b,this._maxNumberStickyLines)*this._lineHeight:g=b*this._lineHeight,m=Math.max(0,b-1)*this._lineHeight}r||(a===0||a===4)&&(m+=this._lineHeight),h-=g,f+=m;let _;if(f-h>c){if(!d)return-1;_=h}else if(a===5||a===6)if(a===6&&l<=h&&f<=u)_=l;else{const b=Math.max(5*this._lineHeight,c*.2),y=h-b,x=f-c;_=Math.max(x,y)}else if(a===1||a===2)if(a===2&&l<=h&&f<=u)_=l;else{const b=(h+f)/2;_=Math.max(0,b-c/2)}else _=this._computeMinimumScrolling(l,u,h,f,a===3,a===4);return _}_computeScrollLeftToReveal(e){const n=this._context.viewLayout.getCurrentViewport(),r=this._context.configuration.options.get(143),s=n.left,o=s+n.width-r.verticalScrollbarWidth;let a=1073741824,l=0;if(e.type==="range"){const u=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!u)return null;for(const d of u.ranges)a=Math.min(a,Math.round(d.left)),l=Math.max(l,Math.round(d.left+d.width))}else for(const u of e.selections){if(u.startLineNumber!==u.endLineNumber)return null;const d=this._visibleRangesForLineRange(u.startLineNumber,u.startColumn,u.endColumn);if(!d)return null;for(const h of d.ranges)a=Math.min(a,Math.round(h.left)),l=Math.max(l,Math.round(h.left+h.width))}return e.minimalReveal||(a=Math.max(0,a-N$.HORIZONTAL_EXTRA_PX),l+=this._revealHorizontalRightPadding),e.type==="selections"&&l-a>n.width?null:{scrollLeft:this._computeMinimumScrolling(s,o,a,l),maxHorizontalOffset:l}}_computeMinimumScrolling(e,n,r,s,o,a){e=e|0,n=n|0,r=r|0,s=s|0,o=!!o,a=!!a;const l=n-e;if(s-r<l){if(o)return r;if(a)return Math.max(0,s-l);if(r<e)return r;if(s>n)return Math.max(0,s-l)}else return r;return e}}N$.HORIZONTAL_EXTRA_PX=30;class OJ{constructor(e,n,r,s){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+n,this.className=String(r),this.zIndex=s??0}}class $pt{constructor(e,n){this.className=e,this.zIndex=n}}class zpt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class qIe extends Zx{_render(e,n,r){const s=[];for(let l=e;l<=n;l++){const c=l-e;s[c]=new zpt}if(r.length===0)return s;r.sort((l,c)=>l.className===c.className?l.startLineNumber===c.startLineNumber?l.endLineNumber-c.endLineNumber:l.startLineNumber-c.startLineNumber:l.className<c.className?-1:1);let o=null,a=0;for(let l=0,c=r.length;l<c;l++){const u=r[l],d=u.className,h=u.zIndex;let f=Math.max(u.startLineNumber,e)-e;const p=Math.min(u.endLineNumber,n)-e;o===d?(f=Math.max(a+1,f),a=Math.max(a,p)):(o=d,a=p);for(let g=f;g<=a;g++)s[g].add(new $pt(d,h))}return s}}class Vpt extends hu{constructor(e){super(e),this._widgets={},this._context=e;const n=this._context.configuration.options,r=n.get(143);this.domNode=Di(document.createElement("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=n.get(66),this._glyphMargin=n.get(57),this._glyphMarginLeft=r.glyphMarginLeft,this._glyphMarginWidth=r.glyphMarginWidth,this._glyphMarginDecorationLaneCount=r.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){const n=this._context.configuration.options,r=n.get(143);return this._lineHeight=n.get(66),this._glyphMargin=n.get(57),this._glyphMarginLeft=r.glyphMarginLeft,this._glyphMarginWidth=r.glyphMarginWidth,this._glyphMarginDecorationLaneCount=r.glyphMarginDecorationLaneCount,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}addWidget(e){const n=Di(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:n,renderInfo:null},n.setPosition("absolute"),n.setDisplay("none"),n.setAttribute("widgetId",e.getId()),this.domNode.appendChild(n),this.setShouldRender()}setWidgetPosition(e,n){const r=this._widgets[e.getId()];return r.preference.lane===n.lane&&r.preference.zIndex===n.zIndex&&J.equalsRange(r.preference.range,n.range)?!1:(r.preference=n,this.setShouldRender(),!0)}removeWidget(e){var n;const r=e.getId();if(this._widgets[r]){const o=this._widgets[r].domNode.domNode;delete this._widgets[r],(n=o.parentNode)===null||n===void 0||n.removeChild(o),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,n){var r,s,o;const a=e.visibleRange.startLineNumber,l=e.visibleRange.endLineNumber,c=e.getDecorationsInViewport();for(const u of c){const d=u.options.glyphMarginClassName;if(!d)continue;const h=Math.max(u.range.startLineNumber,a),f=Math.min(u.range.endLineNumber,l),p=Math.min((s=(r=u.options.glyphMargin)===null||r===void 0?void 0:r.position)!==null&&s!==void 0?s:1,this._glyphMarginDecorationLaneCount),g=(o=u.options.zIndex)!==null&&o!==void 0?o:0;for(let m=h;m<=f;m++)n.push(new Hpt(m,p,g,d))}}_collectWidgetBasedGlyphRenderRequest(e,n){const r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(const o of Object.values(this._widgets)){const a=o.preference.range;if(a.endLineNumber<r||a.startLineNumber>s)continue;const l=Math.max(a.startLineNumber,r),c=Math.min(o.preference.lane,this._glyphMarginDecorationLaneCount);n.push(new Upt(l,c,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const n=[];return this._collectDecorationBasedGlyphRenderRequest(e,n),this._collectWidgetBasedGlyphRenderRequest(e,n),n.sort((r,s)=>r.lineNumber===s.lineNumber?r.lane===s.lane?r.zIndex===s.zIndex?s.type===r.type?r.type===0&&s.type===0?r.className<s.className?-1:1:0:s.type-r.type:s.zIndex-r.zIndex:r.lane-s.lane:r.lineNumber-s.lineNumber),n}prepareRender(e){if(!this._glyphMargin){this._decorationGlyphsToRender=[];return}for(const s of Object.values(this._widgets))s.renderInfo=null;const n=new Ev(this._collectSortedGlyphRenderRequests(e)),r=[];for(;n.length>0;){const s=n.peek();if(!s)break;const o=n.takeWhile(l=>l.lineNumber===s.lineNumber&&l.lane===s.lane);if(!o||o.length===0)break;const a=o[0];if(a.type===0){const l=[];for(const c of o){if(c.zIndex!==a.zIndex||c.type!==a.type)break;(l.length===0||l[l.length-1]!==c.className)&&l.push(c.className)}r.push(a.accept(l.join(" ")))}else a.widget.renderInfo={lineNumber:a.lineNumber,lane:a.lane}}this._decorationGlyphsToRender=r}render(e){if(!this._glyphMargin){for(const r of Object.values(this._widgets))r.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const r=this._managedDomNodes.pop();r==null||r.domNode.remove()}return}const n=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const r of Object.values(this._widgets))if(!r.renderInfo)r.domNode.setDisplay("none");else{const s=e.viewportData.relativeVerticalOffset[r.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+(r.renderInfo.lane-1)*this._lineHeight;r.domNode.setDisplay("block"),r.domNode.setTop(s),r.domNode.setLeft(o),r.domNode.setWidth(n),r.domNode.setHeight(this._lineHeight)}for(let r=0;r<this._decorationGlyphsToRender.length;r++){const s=this._decorationGlyphsToRender[r],o=e.viewportData.relativeVerticalOffset[s.lineNumber-e.viewportData.startLineNumber],a=this._glyphMarginLeft+(s.lane-1)*this._lineHeight;let l;r<this._managedDomNodes.length?l=this._managedDomNodes[r]:(l=Di(document.createElement("div")),this._managedDomNodes.push(l),this.domNode.appendChild(l)),l.setClassName("cgmr codicon "+s.combinedClassName),l.setPosition("absolute"),l.setTop(o),l.setLeft(a),l.setWidth(n),l.setHeight(this._lineHeight)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;){const r=this._managedDomNodes.pop();r==null||r.domNode.remove()}}}class Hpt{constructor(e,n,r,s){this.lineNumber=e,this.lane=n,this.zIndex=r,this.className=s,this.type=0}accept(e){return new qpt(this.lineNumber,this.lane,e)}}class Upt{constructor(e,n,r,s){this.lineNumber=e,this.lane=n,this.zIndex=r,this.widget=s,this.type=1}}class qpt{constructor(e,n,r){this.lineNumber=e,this.lane=n,this.combinedClassName=r}}class Kpt extends qIe{constructor(e){super(),this._context=e;const r=this._context.configuration.options.get(143);this._decorationsLeft=r.decorationsLeft,this._decorationsWidth=r.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const r=this._context.configuration.options.get(143);return this._decorationsLeft=r.decorationsLeft,this._decorationsWidth=r.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const n=e.getDecorationsInViewport(),r=[];let s=0;for(let o=0,a=n.length;o<a;o++){const l=n[o],c=l.options.linesDecorationsClassName,u=l.options.zIndex;c&&(r[s++]=new OJ(l.range.startLineNumber,l.range.endLineNumber,c,u));const d=l.options.firstLineDecorationClassName;d&&(r[s++]=new OJ(l.range.startLineNumber,l.range.startLineNumber,d,u))}return r}prepareRender(e){const n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,s=this._render(n,r,this._getDecorations(e)),o=this._decorationsLeft.toString(),a=this._decorationsWidth.toString(),l='" style="left:'+o+"px;width:"+a+'px;"></div>',c=[];for(let u=n;u<=r;u++){const d=u-n,h=s[d].getDecorations();let f="";for(const p of h)f+='<div class="cldr '+p.className+l;c[d]=f}this._renderResult=c}render(e,n){return this._renderResult?this._renderResult[n-e]:""}}class Gpt extends qIe{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const n=e.getDecorationsInViewport(),r=[];let s=0;for(let o=0,a=n.length;o<a;o++){const l=n[o],c=l.options.marginClassName,u=l.options.zIndex;c&&(r[s++]=new OJ(l.range.startLineNumber,l.range.endLineNumber,c,u))}return r}prepareRender(e){const n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,s=this._render(n,r,this._getDecorations(e)),o=[];for(let a=n;a<=r;a++){const l=a-n,c=s[l].getDecorations();let u="";for(const d of c)u+='<div class="cmdr '+d.className+'" style=""></div>';o[l]=u}this._renderResult=o}render(e,n){return this._renderResult?this._renderResult[n-e]:""}}class oh{constructor(e,n,r,s){this._rgba8Brand=void 0,this.r=oh._clamp(e),this.g=oh._clamp(n),this.b=oh._clamp(r),this.a=oh._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}oh.Empty=new oh(0,0,0,0);class j5 extends Le{static getInstance(){return this._INSTANCE||(this._INSTANCE=new j5),this._INSTANCE}constructor(){super(),this._onDidChange=new _e,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Zr.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Zr.getColorMap();if(!e){this._colors=[oh.Empty],this._backgroundIsLight=!0;return}this._colors=[oh.Empty];for(let r=1;r<e.length;r++){const s=e[r].rgba;this._colors[r]=new oh(s.r,s.g,s.b,Math.round(s.a*255))}const n=e[2].getRelativeLuminance();this._backgroundIsLight=n>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}j5._INSTANCE=null;const Xpt=(()=>{const i=[];for(let e=32;e<=126;e++)i.push(e);return i.push(65533),i})(),Ypt=(i,e)=>(i-=32,i<0||i>96?e<=2?(i+96)%96:95:i);class IP{constructor(e,n){this.scale=n,this._minimapCharRendererBrand=void 0,this.charDataNormal=IP.soften(e,12/15),this.charDataLight=IP.soften(e,50/60)}static soften(e,n){const r=new Uint8ClampedArray(e.length);for(let s=0,o=e.length;s<o;s++)r[s]=U9(e[s]*n);return r}renderChar(e,n,r,s,o,a,l,c,u,d,h){const f=1*this.scale,p=2*this.scale,g=h?1:p;if(n+f>e.width||r+g>e.height){console.warn("bad render request outside image data");return}const m=d?this.charDataLight:this.charDataNormal,_=Ypt(s,u),b=e.width*4,y=l.r,x=l.g,k=l.b,D=o.r-y,R=o.g-x,E=o.b-k,A=Math.max(a,c),M=e.data;let N=_*f*p,P=r*b+n*4;for(let O=0;O<g;O++){let B=P;for(let j=0;j<f;j++){const z=m[N++]/255*(a/255);M[B++]=y+D*z,M[B++]=x+R*z,M[B++]=k+E*z,M[B++]=A}P+=b}}blockRenderChar(e,n,r,s,o,a,l,c){const u=1*this.scale,d=2*this.scale,h=c?1:d;if(n+u>e.width||r+h>e.height){console.warn("bad render request outside image data");return}const f=e.width*4,p=.5*(o/255),g=a.r,m=a.g,_=a.b,b=s.r-g,y=s.g-m,x=s.b-_,k=g+b*p,D=m+y*p,R=_+x*p,E=Math.max(o,l),A=e.data;let M=r*f+n*4;for(let N=0;N<h;N++){let P=M;for(let O=0;O<u;O++)A[P++]=k,A[P++]=D,A[P++]=R,A[P++]=E;M+=f}}}const kge={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},Lge=i=>{const e=new Uint8ClampedArray(i.length/2);for(let n=0;n<i.length;n+=2)e[n>>1]=kge[i[n]]<<4|kge[i[n+1]]&15;return e},Dge={1:u1(()=>Lge("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:u1(()=>Lge("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class oM{static create(e,n){if(this.lastCreated&&e===this.lastCreated.scale&&n===this.lastFontFamily)return this.lastCreated;let r;return Dge[e]?r=new IP(Dge[e](),e):r=oM.createFromSampleData(oM.createSampleData(n).data,e),this.lastFontFamily=n,this.lastCreated=r,r}static createSampleData(e){const n=document.createElement("canvas"),r=n.getContext("2d");n.style.height="16px",n.height=16,n.width=96*10,n.style.width=96*10+"px",r.fillStyle="#ffffff",r.font=`bold 16px ${e}`,r.textBaseline="middle";let s=0;for(const o of Xpt)r.fillText(String.fromCharCode(o),s,16/2),s+=10;return r.getImageData(0,0,96*10,16)}static createFromSampleData(e,n){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const s=oM._downsample(e,n);return new IP(s,n)}static _downsampleChar(e,n,r,s,o){const a=1*o,l=2*o;let c=s,u=0;for(let d=0;d<l;d++){const h=d/l*16,f=(d+1)/l*16;for(let p=0;p<a;p++){const g=p/a*10,m=(p+1)/a*10;let _=0,b=0;for(let x=h;x<f;x++){const k=n+Math.floor(x)*3840,D=1-(x-Math.floor(x));for(let R=g;R<m;R++){const E=1-(R-Math.floor(R)),A=k+Math.floor(R)*4,M=E*D;b+=M,_+=e[A]*e[A+3]/255*M}}const y=_/b;u=Math.max(u,y),r[c++]=U9(y)}}return u}static _downsample(e,n){const r=2*n*1*n,s=r*96,o=new Uint8ClampedArray(s);let a=0,l=0,c=0;for(let u=0;u<96;u++)c=Math.max(c,this._downsampleChar(e,l,o,a,n)),a+=r,l+=10*4;if(c>0){const u=255/c;for(let d=0;d<s;d++)o[d]*=u}return o}}const Zpt=140,Qpt=2;class TP{constructor(e,n,r){const s=e.options,o=s.get(141),a=s.get(143),l=a.minimap,c=s.get(50),u=s.get(72);this.renderMinimap=l.renderMinimap,this.size=u.size,this.minimapHeightIsEditorHeight=l.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=s.get(104),this.paddingTop=s.get(83).top,this.paddingBottom=s.get(83).bottom,this.showSlider=u.showSlider,this.autohide=u.autohide,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=c.typicalHalfwidthCharacterWidth,this.lineHeight=s.get(66),this.minimapLeft=l.minimapLeft,this.minimapWidth=l.minimapWidth,this.minimapHeight=a.height,this.canvasInnerWidth=l.minimapCanvasInnerWidth,this.canvasInnerHeight=l.minimapCanvasInnerHeight,this.canvasOuterWidth=l.minimapCanvasOuterWidth,this.canvasOuterHeight=l.minimapCanvasOuterHeight,this.isSampling=l.minimapIsSampling,this.editorHeight=a.height,this.fontScale=l.minimapScale,this.minimapLineHeight=l.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=u1(()=>oM.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=r.getColor(2),this.backgroundColor=TP._getMinimapBackground(n,this.defaultBackgroundColor),this.foregroundAlpha=TP._getMinimapForegroundOpacity(n)}static _getMinimapBackground(e,n){const r=e.getColor(Nht);return r?new oh(r.rgba.r,r.rgba.g,r.rgba.b,Math.round(255*r.rgba.a)):n}static _getMinimapForegroundOpacity(e){const n=e.getColor(Mht);return n?oh._clamp(Math.round(255*n.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class aM{constructor(e,n,r,s,o,a,l,c,u){this.scrollTop=e,this.scrollHeight=n,this.sliderNeeded=r,this._computedSliderRatio=s,this.sliderTop=o,this.sliderHeight=a,this.topPaddingLineCount=l,this.startLineNumber=c,this.endLineNumber=u}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const n=Math.max(this.startLineNumber,e.startLineNumber),r=Math.min(this.endLineNumber,e.endLineNumber);return n>r?null:[n,r]}getYForLineNumber(e,n){return+(e-this.startLineNumber+this.topPaddingLineCount)*n}static create(e,n,r,s,o,a,l,c,u,d,h){const f=e.pixelRatio,p=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/p),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let R=c*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(R+=Math.max(0,o-e.lineHeight-e.paddingBottom));const E=Math.max(1,Math.floor(o*o/R)),A=Math.max(0,e.minimapHeight-E),M=A/(d-o),N=u*M,P=A>0,O=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),B=Math.floor(e.paddingTop/e.lineHeight);return new aM(u,d,P,M,N,E,B,1,Math.min(l,O))}let _;if(a&&r!==l){const R=r-n+1;_=Math.floor(R*p/f)}else{const R=o/m;_=Math.floor(R*p/f)}const b=Math.floor(e.paddingTop/m);let y=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const R=o/m;y=Math.max(y,R-1)}let x;if(y>0){const R=o/m;x=(b+l+y-R-1)*p/f}else x=Math.max(0,(b+l)*p/f-_);x=Math.min(e.minimapHeight-_,x);const k=x/(d-o),D=u*k;if(g>=b+l+y){const R=x>0;return new aM(u,d,R,k,D,_,b,1,l)}else{let R;n>1?R=n+b:R=Math.max(1,u/m);let E,A=Math.max(1,Math.floor(R-D*f/p));A<b?(E=b-A+1,A=1):(E=0,A=Math.max(1,A-b)),h&&h.scrollHeight===d&&(h.scrollTop>u&&(A=Math.min(A,h.startLineNumber),E=Math.max(E,h.topPaddingLineCount)),h.scrollTop<u&&(A=Math.max(A,h.startLineNumber),E=Math.min(E,h.topPaddingLineCount)));const M=Math.min(l,A-E+g-1),N=(u-s)/m;let P;return u>=e.paddingTop?P=(n-A+E+N)*p/f:P=u/e.paddingTop*(E+N)*p/f,new aM(u,d,!0,k,P,_,E,A,M)}}}class s7{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}s7.INVALID=new s7(-1);class Ege{constructor(e,n,r){this.renderedLayout=e,this._imageData=n,this._renderedLines=new WIe(()=>s7.INVALID),this._renderedLines._set(e.startLineNumber,r)}linesEquals(e){if(!this.scrollEquals(e))return!1;const r=this._renderedLines._get().lines;for(let s=0,o=r.length;s<o;s++)if(r[s].dy===-1)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,n){return this._renderedLines.onLinesChanged(e,n)}onLinesDeleted(e,n){this._renderedLines.onLinesDeleted(e,n)}onLinesInserted(e,n){this._renderedLines.onLinesInserted(e,n)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class Eoe{constructor(e,n,r,s){this._backgroundFillData=Eoe._createBackgroundFillData(n,r,s),this._buffers=[e.createImageData(n,r),e.createImageData(n,r)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,n,r){const s=r.r,o=r.g,a=r.b,l=r.a,c=new Uint8ClampedArray(e*n*4);let u=0;for(let d=0;d<n;d++)for(let h=0;h<e;h++)c[u]=s,c[u+1]=o,c[u+2]=a,c[u+3]=l,u+=4;return c}}class RP{static compute(e,n,r){if(e.renderMinimap===0||!e.isSampling)return[null,[]];const{minimapLineCount:s}=P2.computeContainedMinimapLineCount({viewLineCount:n,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),o=n/s,a=o/2;if(!r||r.minimapLines.length===0){const _=[];if(_[0]=1,s>1){for(let b=0,y=s-1;b<y;b++)_[b]=Math.round(b*o+a);_[s-1]=n}return[new RP(o,_),[]]}const l=r.minimapLines,c=l.length,u=[];let d=0,h=0,f=1;const p=10;let g=[],m=null;for(let _=0;_<s;_++){const b=Math.max(f,Math.round(_*o)),y=Math.max(b,Math.round((_+1)*o));for(;d<c&&l[d]<b;){if(g.length<p){const k=d+1+h;m&&m.type==="deleted"&&m._oldIndex===d-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:d,deleteFromLineNumber:k,deleteToLineNumber:k},g.push(m)),h--}d++}let x;if(d<c&&l[d]<=y)x=l[d],d++;else if(_===0?x=1:_+1===s?x=n:x=Math.round(_*o+a),g.length<p){const k=d+1+h;m&&m.type==="inserted"&&m._i===_-1?m.insertToLineNumber++:(m={type:"inserted",_i:_,insertFromLineNumber:k,insertToLineNumber:k},g.push(m)),h++}u[_]=x,f=x}if(g.length<p)for(;d<c;){const _=d+1+h;m&&m.type==="deleted"&&m._oldIndex===d-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:d,deleteFromLineNumber:_,deleteToLineNumber:_},g.push(m)),h--,d++}else g=[{type:"flush"}];return[new RP(o,u),g]}constructor(e,n){this.samplingRatio=e,this.minimapLines=n}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,n){let r=this.modelLineToMinimapLine(e)-1;for(;r>0&&this.minimapLines[r-1]>=e;)r--;let s=this.modelLineToMinimapLine(n)-1;for(;s+1<this.minimapLines.length&&this.minimapLines[s+1]<=n;)s++;if(r===s){const o=this.minimapLines[r];if(o<e||o>n)return null}return[r+1,s+1]}decorationLineRangeToMinimapLineRange(e,n){let r=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(n);return e!==n&&s===r&&(s===this.minimapLines.length?r>1&&r--:s++),[r,s]}onLinesDeleted(e){const n=e.toLineNumber-e.fromLineNumber+1;let r=this.minimapLines.length,s=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),r=Math.min(r,o),s=Math.max(s,o)):this.minimapLines[o]-=n;return[r,s]}onLinesInserted(e){const n=e.toLineNumber-e.fromLineNumber+1;for(let r=this.minimapLines.length-1;r>=0&&!(this.minimapLines[r]<e.fromLineNumber);r--)this.minimapLines[r]+=n}}class Jpt extends hu{constructor(e){super(e),this.tokensColorTracker=j5.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new TP(this._context.configuration,this._context.theme,this.tokensColorTracker);const[n]=RP.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=n,this._shouldCheckSampling=!1,this._actual=new o7(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new TP(this._context.configuration,this._context.theme,this.tokensColorTracker);return this.options.equals(e)?!1:(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return e.affectsMinimap?this._actual.onDecorationsChanged():!1}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const n=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return n?this._actual.onLinesChanged(n[0],n[1]-n[0]+1):!1}else return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[n,r]=this._samplingState.onLinesDeleted(e);return n<=r&&this._actual.onLinesChanged(n+1,r-n+1),this._shouldCheckSampling=!0,!0}else return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){const n=[];for(const r of e.ranges){const s=this._samplingState.modelLineRangeToMinimapLineRange(r.fromLineNumber,r.toLineNumber);s&&n.push({fromLineNumber:s[0],toLineNumber:s[1]})}return n.length?this._actual.onTokensChanged(n):!1}else return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;this._samplingState&&(n=this._samplingState.modelLineToMinimapLine(n),r=this._samplingState.modelLineToMinimapLine(r));const s={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:n,viewportEndLineNumber:r,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(n),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[n,r]=RP.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=n,e&&this._samplingState)for(const s of r)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,n,r){if(this._samplingState){const s=[];for(let o=0,a=n-e+1;o<a;o++)r[o]?s[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):s[o]=null;return s}return this._context.viewModel.getMinimapLinesRenderingData(e,n,r).data}getSelections(){if(this._minimapSelections===null)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[n,r]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new Ft(n,e.startColumn,r,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,n){let r;if(this._samplingState){const o=this._samplingState.minimapLines[e-1],a=this._samplingState.minimapLines[n-1];r=new J(o,1,a,this._context.viewModel.getLineMaxColumn(a))}else r=new J(e,1,n,this._context.viewModel.getLineMaxColumn(n));const s=this._context.viewModel.getMinimapDecorationsInRange(r);if(this._samplingState){const o=[];for(const a of s){if(!a.options.minimap)continue;const l=a.range,c=this._samplingState.modelLineToMinimapLine(l.startLineNumber),u=this._samplingState.modelLineToMinimapLine(l.endLineNumber);o.push(new sIe(new J(c,l.startColumn,u,l.endColumn),a.options))}return o}return s}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new J(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class o7 extends Le{constructor(e,n){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=n,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(dge),this._domNode=Di(document.createElement("div")),Ym.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=Di(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=Di(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=Di(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=Di(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=Di(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=As(this._domNode.domNode,ht.POINTER_DOWN,r=>{if(r.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(r.button===0&&this._lastRenderData){const u=no(this._slider.domNode),d=u.top+u.height/2;this._startSliderDragging(r,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,a=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*r.offsetY;let c=Math.floor(a/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;c=Math.min(c,this._model.getLineCount()),this._model.revealLineNumber(c)}),this._sliderPointerMoveMonitor=new $I,this._sliderPointerDownListener=As(this._slider.domNode,ht.POINTER_DOWN,r=>{r.preventDefault(),r.stopPropagation(),r.button===0&&this._lastRenderData&&this._startSliderDragging(r,r.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=or.addTarget(this._domNode.domNode),this._sliderTouchStartListener=Be(this._domNode.domNode,lr.Start,r=>{r.preventDefault(),r.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(r))},{passive:!1}),this._sliderTouchMoveListener=Be(this._domNode.domNode,lr.Change,r=>{r.preventDefault(),r.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(r)},{passive:!1}),this._sliderTouchEndListener=As(this._domNode.domNode,lr.End,r=>{r.preventDefault(),r.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,n,r){if(!e.target||!(e.target instanceof Element))return;const s=e.pageX;this._slider.toggleClassName("active",!0);const o=(a,l)=>{const c=no(this._domNode.domNode),u=Math.min(Math.abs(l-s),Math.abs(l-c.left),Math.abs(l-c.left-c.width));if(Aa&&u>Zpt){this._model.setScrollTop(r.scrollTop);return}const d=a-n;this._model.setScrollTop(r.getDesiredScrollTopFromDelta(d))};e.pageY!==n&&o(e.pageY,s),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>o(a.pageY,a.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const n=this._domNode.domNode.getBoundingClientRect().top,r=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-n);this._model.setScrollTop(r)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new Eoe(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,n){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,n):!1}onLinesDeleted(e,n){var r;return(r=this._lastRenderData)===null||r===void 0||r.onLinesDeleted(e,n),!0}onLinesInserted(e,n){var r;return(r=this._lastRenderData)===null||r===void 0||r.onLinesInserted(e,n),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(dge),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const r=aM.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(r.sliderNeeded?"block":"none"),this._slider.setTop(r.sliderTop),this._slider.setHeight(r.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(r.sliderHeight),this.renderDecorations(r),this._lastRenderData=this.renderLines(r)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const n=this._model.getSelections();n.sort(J.compareRangesUsingStarts);const r=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);r.sort((f,p)=>(f.options.zIndex||0)-(p.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:o}=this._model.options,a=this._model.options.minimapLineHeight,l=this._model.options.minimapCharWidth,c=this._model.getOptions().tabSize,u=this._decorationsCanvas.domNode.getContext("2d");u.clearRect(0,0,s,o);const d=new Ige(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(u,n,d,e,a),this._renderDecorationsLineHighlights(u,r,d,e,a);const h=new Ige(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(u,n,h,e,a,c,l,s),this._renderDecorationsHighlights(u,r,h,e,a,c,l,s)}}_renderSelectionLineHighlights(e,n,r,s,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let a=0,l=0;for(const c of n){const u=s.intersectWithViewport(c);if(!u)continue;const[d,h]=u;for(let g=d;g<=h;g++)r.set(g,!0);const f=s.getYForLineNumber(d,o),p=s.getYForLineNumber(h,o);l>=f||(l>a&&e.fillRect(qb,a,e.canvas.width,l-a),a=f),l=p}l>a&&e.fillRect(qb,a,e.canvas.width,l-a)}_renderDecorationsLineHighlights(e,n,r,s,o){const a=new Map;for(let l=n.length-1;l>=0;l--){const c=n[l],u=c.options.minimap;if(!u||u.position!==ou.Inline)continue;const d=s.intersectWithViewport(c.range);if(!d)continue;const[h,f]=d,p=u.getColor(this._theme.value);if(!p||p.isTransparent())continue;let g=a.get(p.toString());g||(g=p.transparent(.5).toString(),a.set(p.toString(),g)),e.fillStyle=g;for(let m=h;m<=f;m++){if(r.has(m))continue;r.set(m,!0);const _=s.getYForLineNumber(h,o);e.fillRect(qb,_,e.canvas.width,o)}}}_renderSelectionsHighlights(e,n,r,s,o,a,l,c){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const u of n){const d=s.intersectWithViewport(u);if(!d)continue;const[h,f]=d;for(let p=h;p<=f;p++)this.renderDecorationOnLine(e,r,u,this._selectionColor,s,p,o,o,a,l,c)}}_renderDecorationsHighlights(e,n,r,s,o,a,l,c){for(const u of n){const d=u.options.minimap;if(!d)continue;const h=s.intersectWithViewport(u.range);if(!h)continue;const[f,p]=h,g=d.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let m=f;m<=p;m++)switch(d.position){case ou.Inline:this.renderDecorationOnLine(e,r,u.range,g,s,m,o,o,a,l,c);continue;case ou.Gutter:{const _=s.getYForLineNumber(m,o);this.renderDecoration(e,g,2,_,Qpt,o);continue}}}}renderDecorationOnLine(e,n,r,s,o,a,l,c,u,d,h){const f=o.getYForLineNumber(a,c);if(f+l<0||f>this._model.options.canvasInnerHeight)return;const{startLineNumber:p,endLineNumber:g}=r,m=p===a?r.startColumn:1,_=g===a?r.endColumn:this._model.getLineMaxColumn(a),b=this.getXOffsetForPosition(n,a,m,u,d,h),y=this.getXOffsetForPosition(n,a,_,u,d,h);this.renderDecoration(e,s,b,f,y-b,l)}getXOffsetForPosition(e,n,r,s,o,a){if(r===1)return qb;if((r-1)*o>=a)return a;let c=e.get(n);if(!c){const u=this._model.getLineContent(n);c=[qb];let d=qb;for(let h=1;h<u.length+1;h++){const f=u.charCodeAt(h-1),p=f===9?s*o:d1(f)?2*o:o,g=d+p;if(g>=a){c[h]=a;break}c[h]=g,d=g}e.set(n,c)}return r-1<c.length?c[r-1]:a}renderDecoration(e,n,r,s,o,a){e.fillStyle=n&&n.toString()||"",e.fillRect(r,s,o,a)}renderLines(e){const n=e.startLineNumber,r=e.endLineNumber,s=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const z=this._lastRenderData._get();return new Ege(e,z.imageData,z.lines)}const o=this._getBuffer();if(!o)return null;const[a,l,c]=o7._renderUntouchedLines(o,e.topPaddingLineCount,n,r,s,this._lastRenderData),u=this._model.getMinimapLinesRenderingData(n,r,c),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,f=this._model.options.backgroundColor,p=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),_=this._model.options.renderMinimap,b=this._model.options.charRenderer(),y=this._model.options.fontScale,x=this._model.options.minimapCharWidth,D=(_===1?2:3)*y,R=s>D?Math.floor((s-D)/2):0,E=f.a/255,A=new oh(Math.round((f.r-h.r)*E+h.r),Math.round((f.g-h.g)*E+h.g),Math.round((f.b-h.b)*E+h.b),255);let M=e.topPaddingLineCount*s;const N=[];for(let z=0,H=r-n+1;z<H;z++)c[z]&&o7._renderLine(o,A,f.a,m,_,x,g,p,b,M,R,d,u[z],y,s),N[z]=new s7(M),M+=s;const P=a===-1?0:a,B=(l===-1?o.height:l)-P;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,P,o.width,B),new Ege(e,o,N)}static _renderUntouchedLines(e,n,r,s,o,a){const l=[];if(!a){for(let M=0,N=s-r+1;M<N;M++)l[M]=!0;return[-1,-1,l]}const c=a._get(),u=c.imageData.data,d=c.rendLineNumberStart,h=c.lines,f=h.length,p=e.width,g=e.data,m=(s-r+1)*o*p*4;let _=-1,b=-1,y=-1,x=-1,k=-1,D=-1,R=n*o;for(let M=r;M<=s;M++){const N=M-r,P=M-d,O=P>=0&&P<f?h[P].dy:-1;if(O===-1){l[N]=!0,R+=o;continue}const B=O*p*4,j=(O+o)*p*4,z=R*p*4,H=(R+o)*p*4;x===B&&D===z?(x=j,D=H):(y!==-1&&(g.set(u.subarray(y,x),k),_===-1&&y===0&&y===k&&(_=x),b===-1&&x===m&&y===k&&(b=y)),y=B,x=j,k=z,D=H),l[N]=!1,R+=o}y!==-1&&(g.set(u.subarray(y,x),k),_===-1&&y===0&&y===k&&(_=x),b===-1&&x===m&&y===k&&(b=y));const E=_===-1?-1:_/(p*4),A=b===-1?-1:b/(p*4);return[E,A,l]}static _renderLine(e,n,r,s,o,a,l,c,u,d,h,f,p,g,m){const _=p.content,b=p.tokens,y=e.width-a,x=m===1;let k=qb,D=0,R=0;for(let E=0,A=b.getCount();E<A;E++){const M=b.getEndOffset(E),N=b.getForeground(E),P=l.getColor(N);for(;D<M;D++){if(k>y)return;const O=_.charCodeAt(D);if(O===9){const B=f-(D+R)%f;R+=B-1,k+=B*a}else if(O===32)k+=a;else{const B=d1(O)?2:1;for(let j=0;j<B;j++)if(o===2?u.blockRenderChar(e,k,d+h,P,c,n,r,x):u.renderChar(e,k,d+h,O,P,c,n,r,g,s,x),k+=a,k>y)return}}}}}class Ige{constructor(e,n,r){this._startLineNumber=e,this._endLineNumber=n,this._defaultValue=r,this._values=[];for(let s=0,o=this._endLineNumber-this._startLineNumber+1;s<o;s++)this._values[s]=r}has(e){return this.get(e)!==this._defaultValue}set(e,n){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=n)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class egt extends hu{constructor(e){super(e);const r=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=r.verticalScrollbarWidth,this._minimapWidth=r.minimap.minimapWidth,this._horizontalScrollbarHeight=r.horizontalScrollbarHeight,this._editorHeight=r.height,this._editorWidth=r.width,this._domNode=Di(document.createElement("div")),Ym.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const r=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=r.verticalScrollbarWidth,this._minimapWidth=r.minimap.minimapWidth,this._horizontalScrollbarHeight=r.horizontalScrollbarHeight,this._editorHeight=r.height,this._editorWidth=r.width,!0}addWidget(e){const n=Di(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:n},n.setPosition("absolute"),n.setAttribute("widgetId",e.getId()),this._domNode.appendChild(n),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,n){const r=this._widgets[e.getId()];return r.preference===n?(this._updateMaxMinWidth(),!1):(r.preference=n,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const n=e.getId();if(this._widgets.hasOwnProperty(n)){const s=this._widgets[n].domNode.domNode;delete this._widgets[n],s.parentNode.removeChild(s),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,n;let r=0;const s=Object.keys(this._widgets);for(let o=0,a=s.length;o<a;o++){const l=s[o],u=(n=(e=this._widgets[l].widget).getMinContentWidthInPx)===null||n===void 0?void 0:n.call(e);typeof u<"u"&&(r=Math.max(r,u))}this._context.viewLayout.setOverlayWidgetsMinWidth(r)}_renderWidget(e){const n=e.domNode;if(e.preference===null){n.setTop("");return}if(e.preference===0)n.setTop(0),n.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(e.preference===1){const r=n.domNode.clientHeight;n.setTop(this._editorHeight-r-2*this._horizontalScrollbarHeight),n.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else e.preference===2&&(n.setTop(0),n.domNode.style.right="50%")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const n=Object.keys(this._widgets);for(let r=0,s=n.length;r<s;r++){const o=n[r];this._renderWidget(this._widgets[o])}}}class tgt{constructor(e,n){const r=e.options;this.lineHeight=r.get(66),this.pixelRatio=r.get(141),this.overviewRulerLanes=r.get(82),this.renderBorder=r.get(81);const s=n.getColor(Wft);this.borderColor=s?s.toString():null,this.hideCursor=r.get(59);const o=n.getColor(IIe);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=n.type;const a=r.get(72),l=a.enabled,c=a.side,u=n.getColor($ft),d=Zr.getDefaultBackground();u?this.backgroundColor=u:l&&c==="right"?this.backgroundColor=d:this.backgroundColor=null;const f=r.get(143).overviewRuler;this.top=f.top,this.right=f.right,this.domWidth=f.width,this.domHeight=f.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[p,g]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=p,this.w=g}_initLanes(e,n,r){const s=n-e;if(r>=3){const o=Math.floor(s/3),a=Math.floor(s/3),l=s-o-a,c=e,u=c+o,d=c+o+l;return[[0,c,u,c,d,c,u,c],[0,o,l,o+l,a,o+l+a,l+a,o+l+a]]}else if(r===2){const o=Math.floor(s/2),a=s-o,l=e,c=l+o;return[[0,l,l,l,c,l,l,l],[0,o,o,o,a,o+a,o+a,o+a]]}else{const o=e,a=s;return[[0,o,o,o,o,o,o,o],[0,a,a,a,a,a,a,a]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&Te.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class ngt extends hu{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Di(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=Zr.onDidChange(n=>{n.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const n=new tgt(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(n)?!1:(this._settings=n,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let n=0,r=e.selections.length;n<r;n++)this._cursorPositions[n]=e.selections[n].getPosition();return this._cursorPositions.sort(ve.compare),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?Te.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const n=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(n.sort(bP.compareByRenderingProps),this._actualShouldRender===1&&!bP.equalsArr(this._renderedDecorations,n)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!ys(this._renderedCursorPositions,this._cursorPositions,(g,m)=>g.lineNumber===m.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=n,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const r=this._settings.canvasWidth,s=this._settings.canvasHeight,o=this._settings.lineHeight,a=this._context.viewLayout,l=this._context.viewLayout.getScrollHeight(),c=s/l,u=6*this._settings.pixelRatio|0,d=u/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=Te.Format.CSS.formatHexA(e),h.fillRect(0,0,r,s)):(h.clearRect(0,0,r,s),h.fillStyle=Te.Format.CSS.formatHexA(e),h.fillRect(0,0,r,s)):h.clearRect(0,0,r,s);const f=this._settings.x,p=this._settings.w;for(const g of n){const m=g.color,_=g.data;h.fillStyle=m;let b=0,y=0,x=0;for(let k=0,D=_.length/3;k<D;k++){const R=_[3*k],E=_[3*k+1],A=_[3*k+2];let M=a.getVerticalOffsetForLineNumber(E)*c|0,N=(a.getVerticalOffsetForLineNumber(A)+o)*c|0;if(N-M<u){let O=(M+N)/2|0;O<d?O=d:O+d>s&&(O=s-d),M=O-d,N=O+d}M>x+1||R!==b?(k!==0&&h.fillRect(f[b],y,p[b],x-y),b=R,y=M,x=N):N>x&&(x=N)}h.fillRect(f[b],y,p[b],x-y)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,m=g/2|0,_=this._settings.x[7],b=this._settings.w[7];h.fillStyle=this._settings.cursorColor;let y=-100,x=-100;for(let k=0,D=this._cursorPositions.length;k<D;k++){const R=this._cursorPositions[k];let E=a.getVerticalOffsetForLineNumber(R.lineNumber)*c|0;E<m?E=m:E+m>s&&(E=s-m);const A=E-m,M=A+g;A>x+1?(k!==0&&h.fillRect(_,y,b,x-y),y=A,x=M):M>x&&(x=M)}h.fillRect(_,y,b,x-y)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,s),h.stroke(),h.moveTo(0,0),h.lineTo(r,0),h.stroke())}}class Tge{constructor(e,n,r){this._colorZoneBrand=void 0,this.from=e|0,this.to=n|0,this.colorId=r|0}static compare(e,n){return e.colorId===n.colorId?e.from===n.from?e.to-n.to:e.from-n.from:e.colorId-n.colorId}}class KIe{constructor(e,n,r,s){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=n,this.heightInLines=r,this.color=s,this._colorZone=null}static compare(e,n){return e.color===n.color?e.startLineNumber===n.startLineNumber?e.heightInLines===n.heightInLines?e.endLineNumber-n.endLineNumber:e.heightInLines-n.heightInLines:e.startLineNumber-n.startLineNumber:e.color<n.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class igt{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(KIe.compare)}setLineHeight(e){return this._lineHeight===e?!1:(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth===e?!1:(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight===e?!1:(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight===e?!1:(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,n=Math.floor(this._lineHeight),r=Math.floor(this.getCanvasHeight()),s=Math.floor(this._outerHeight),o=r/s,a=Math.floor(4*this._pixelRatio/2),l=[];for(let c=0,u=this._zones.length;c<u;c++){const d=this._zones[c];if(!e){const k=d.getColorZones();if(k){l.push(k);continue}}const h=this._getVerticalOffsetForLine(d.startLineNumber),f=d.heightInLines===0?this._getVerticalOffsetForLine(d.endLineNumber)+n:h+d.heightInLines*n,p=Math.floor(o*h),g=Math.floor(o*f);let m=Math.floor((p+g)/2),_=g-m;_<a&&(_=a),m-_<0&&(m=_),m+_>r&&(m=r-_);const b=d.color;let y=this._color2Id[b];y||(y=++this._lastAssignedId,this._color2Id[b]=y,this._id2Color[y]=b);const x=new Tge(m-_,m+_,y);d.setColorZone(x),l.push(x)}return this._colorZonesInvalid=!1,l.sort(Tge.compare),l}}class rgt extends N5{constructor(e,n){super(),this._context=e;const r=this._context.configuration.options;this._domNode=Di(document.createElement("canvas")),this._domNode.setClassName(n),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new igt(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(r.get(66)),this._zoneManager.setPixelRatio(r.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(n.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(n.get(141)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let n=!1;n=this._zoneManager.setDOMWidth(e.width)||n,n=this._zoneManager.setDOMHeight(e.height)||n,n&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),n=this._zoneManager.getCanvasHeight(),r=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,n),r.length>0&&this._renderOneLane(o,r,s,e),!0}_renderOneLane(e,n,r,s){let o=0,a=0,l=0;for(const c of n){const u=c.colorId,d=c.from,h=c.to;u!==o?(e.fillRect(0,a,s,l-a),o=u,e.fillStyle=r[o],a=d,l=h):l>=d?l=Math.max(l,h):(e.fillRect(0,a,s,l-a),a=d,l=h)}e.fillRect(0,a,s,l-a)}}class sgt extends hu{constructor(e){super(e),this.domNode=Di(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const n=this._context.configuration.options;this._rulers=n.get(101),this._typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options;return this._rulers=n.get(101),this._typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,n=this._rulers.length;if(e===n)return;if(e<n){const{tabSize:s}=this._context.viewModel.model.getOptions(),o=s;let a=n-e;for(;a>0;){const l=Di(document.createElement("div"));l.setClassName("view-ruler"),l.setWidth(o),this.domNode.appendChild(l),this._renderedRulers.push(l),a--}return}let r=e-n;for(;r>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),r--}}render(e){this._ensureRulersCount();for(let n=0,r=this._rulers.length;n<r;n++){const s=this._renderedRulers[n],o=this._rulers[n];s.setBoxShadow(o.color?`1px 0 0 0 ${o.color} inset`:""),s.setHeight(Math.min(e.scrollHeight,1e6)),s.setLeft(o.column*this._typicalHalfwidthCharacterWidth)}}}class ogt extends hu{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const r=this._context.configuration.options.get(102);this._useShadows=r.useShadows,this._domNode=Di(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const n=this._context.configuration.options.get(143);n.minimap.renderMinimap===0||n.minimap.minimapWidth>0&&n.minimap.minimapLeft===0?this._width=n.width:this._width=n.width-n.verticalScrollbarWidth}onConfigurationChanged(e){const r=this._context.configuration.options.get(102);return this._useShadows=r.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class agt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class lgt{constructor(e,n){this.lineNumber=e,this.ranges=n}}function cgt(i){return new agt(i)}function ugt(i){return new lgt(i.lineNumber,i.ranges.map(cgt))}class gs extends Zx{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const n=this._context.configuration.options;this._lineHeight=n.get(66),this._roundedSelection=n.get(100),this._typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options;return this._lineHeight=n.get(66),this._roundedSelection=n.get(100),this._typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let n=0,r=e.length;n<r;n++)if(e[n].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,n,r){const s=this._typicalHalfwidthCharacterWidth/4;let o=null,a=null;if(r&&r.length>0&&n.length>0){const l=n[0].lineNumber;if(l===e.startLineNumber)for(let u=0;!o&&u<r.length;u++)r[u].lineNumber===l&&(o=r[u].ranges[0]);const c=n[n.length-1].lineNumber;if(c===e.endLineNumber)for(let u=r.length-1;!a&&u>=0;u--)r[u].lineNumber===c&&(a=r[u].ranges[0]);o&&!o.startStyle&&(o=null),a&&!a.startStyle&&(a=null)}for(let l=0,c=n.length;l<c;l++){const u=n[l].ranges[0],d=u.left,h=u.left+u.width,f={top:0,bottom:0},p={top:0,bottom:0};if(l>0){const g=n[l-1].ranges[0].left,m=n[l-1].ranges[0].left+n[l-1].ranges[0].width;J3(d-g)<s?f.top=2:d>g&&(f.top=1),J3(h-m)<s?p.top=2:g<h&&h<m&&(p.top=1)}else o&&(f.top=o.startStyle.top,p.top=o.endStyle.top);if(l+1<c){const g=n[l+1].ranges[0].left,m=n[l+1].ranges[0].left+n[l+1].ranges[0].width;J3(d-g)<s?f.bottom=2:g<d&&d<m&&(f.bottom=1),J3(h-m)<s?p.bottom=2:h<m&&(p.bottom=1)}else a&&(f.bottom=a.startStyle.bottom,p.bottom=a.endStyle.bottom);u.startStyle=f,u.endStyle=p}}_getVisibleRangesWithStyle(e,n,r){const o=(n.linesVisibleRangesForRange(e,!0)||[]).map(ugt);return!this._visibleRangesHaveGaps(o)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(n.visibleRange,o,r),o}_createSelectionPiece(e,n,r,s,o){return'<div class="cslr '+r+'" style="top:'+e.toString()+"px;left:"+s.toString()+"px;width:"+o.toString()+"px;height:"+n+'px;"></div>'}_actualRenderOneSelection(e,n,r,s){if(s.length===0)return;const o=!!s[0].ranges[0].startStyle,a=this._lineHeight.toString(),l=(this._lineHeight-1).toString(),c=s[0].lineNumber,u=s[s.length-1].lineNumber;for(let d=0,h=s.length;d<h;d++){const f=s[d],p=f.lineNumber,g=p-n,m=r&&(p===u||p===c)?l:a,_=r&&p===c?1:0;let b="",y="";for(let x=0,k=f.ranges.length;x<k;x++){const D=f.ranges[x];if(o){const E=D.startStyle,A=D.endStyle;if(E.top===1||E.bottom===1){b+=this._createSelectionPiece(_,m,gs.SELECTION_CLASS_NAME,D.left-gs.ROUNDED_PIECE_WIDTH,gs.ROUNDED_PIECE_WIDTH);let M=gs.EDITOR_BACKGROUND_CLASS_NAME;E.top===1&&(M+=" "+gs.SELECTION_TOP_RIGHT),E.bottom===1&&(M+=" "+gs.SELECTION_BOTTOM_RIGHT),b+=this._createSelectionPiece(_,m,M,D.left-gs.ROUNDED_PIECE_WIDTH,gs.ROUNDED_PIECE_WIDTH)}if(A.top===1||A.bottom===1){b+=this._createSelectionPiece(_,m,gs.SELECTION_CLASS_NAME,D.left+D.width,gs.ROUNDED_PIECE_WIDTH);let M=gs.EDITOR_BACKGROUND_CLASS_NAME;A.top===1&&(M+=" "+gs.SELECTION_TOP_LEFT),A.bottom===1&&(M+=" "+gs.SELECTION_BOTTOM_LEFT),b+=this._createSelectionPiece(_,m,M,D.left+D.width,gs.ROUNDED_PIECE_WIDTH)}}let R=gs.SELECTION_CLASS_NAME;if(o){const E=D.startStyle,A=D.endStyle;E.top===0&&(R+=" "+gs.SELECTION_TOP_LEFT),E.bottom===0&&(R+=" "+gs.SELECTION_BOTTOM_LEFT),A.top===0&&(R+=" "+gs.SELECTION_TOP_RIGHT),A.bottom===0&&(R+=" "+gs.SELECTION_BOTTOM_RIGHT)}y+=this._createSelectionPiece(_,m,R,D.left,D.width)}e[g][0]+=b,e[g][1]+=y}}prepareRender(e){const n=[],r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=r;a<=s;a++){const l=a-r;n[l]=["",""]}const o=[];for(let a=0,l=this._selections.length;a<l;a++){const c=this._selections[a];if(c.isEmpty()){o[a]=null;continue}const u=this._getVisibleRangesWithStyle(c,e,this._previousFrameVisibleRangesWithStyle[a]);o[a]=u,this._actualRenderOneSelection(n,r,this._selections.length>1,u)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=n.map(([a,l])=>a+l)}render(e,n){if(!this._renderResult)return"";const r=n-e;return r<0||r>=this._renderResult.length?"":this._renderResult[r]}}gs.SELECTION_CLASS_NAME="selected-text";gs.SELECTION_TOP_LEFT="top-left-radius";gs.SELECTION_BOTTOM_LEFT="bottom-left-radius";gs.SELECTION_TOP_RIGHT="top-right-radius";gs.SELECTION_BOTTOM_RIGHT="bottom-right-radius";gs.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";gs.ROUNDED_PIECE_WIDTH=10;Of((i,e)=>{const n=i.getColor(jdt);n&&!n.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${n}; }`)});function J3(i){return i<0?-i:i}class Rge{constructor(e,n,r,s,o,a,l){this.top=e,this.left=n,this.paddingLeft=r,this.width=s,this.height=o,this.textContent=a,this.textContentClassName=l}}class Age{constructor(e){this._context=e;const n=this._context.configuration.options,r=n.get(50);this._cursorStyle=n.get(28),this._lineHeight=n.get(66),this._typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(n.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Di(document.createElement("div")),this._domNode.setClassName(`cursor ${q2}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Ta(this._domNode,r),this._domNode.setDisplay("none"),this._position=new ve(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const n=this._context.configuration.options,r=n.get(50);return this._cursorStyle=n.get(28),this._lineHeight=n.get(66),this._typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(n.get(31),this._typicalHalfwidthCharacterWidth),Ta(this._domNode,r),!0}onCursorPositionChanged(e,n){return n?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:n}=this._position,r=this._context.viewModel.getLineContent(e),[s,o]=Lot(r,n-1);return[new ve(e,s+1),r.substring(s,o)]}_prepareRender(e){let n="",r="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===na.Line||this._cursorStyle===na.LineThin){const f=e.visibleRangeForPosition(s);if(!f||f.outsideRenderedLine)return null;let p;this._cursorStyle===na.Line?(p=upe(this._lineCursorWidth>0?this._lineCursorWidth:2),p>2&&(n=o,r=this._getTokenClassName(s))):p=upe(1);let g=f.left,m=0;p>=2&&g>=1&&(m=1,g-=m);const _=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new Rge(_,g,m,p,this._lineHeight,n,r)}const a=e.linesVisibleRangesForRange(new J(s.lineNumber,s.column,s.lineNumber,s.column+o.length),!1);if(!a||a.length===0)return null;const l=a[0];if(l.outsideRenderedLine||l.ranges.length===0)return null;const c=l.ranges[0],u=o===" "?this._typicalHalfwidthCharacterWidth:c.width<1?this._typicalHalfwidthCharacterWidth:c.width;this._cursorStyle===na.Block&&(n=o,r=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===na.Underline||this._cursorStyle===na.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new Rge(d,c.left,0,u,h,n,r)}_getTokenClassName(e){const n=this._context.viewModel.getViewLineData(e.lineNumber),r=n.tokens.findTokenIndexAtOffset(e.column-1);return n.tokens.getClassName(r)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${q2} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class AP extends hu{constructor(e){super(e);const n=this._context.configuration.options;this._readOnly=n.get(90),this._cursorBlinking=n.get(26),this._cursorStyle=n.get(28),this._cursorSmoothCaretAnimation=n.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Age(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Di(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new Mf,this._cursorFlatBlinkInterval=new D5,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const n=this._context.configuration.options;this._readOnly=n.get(90),this._cursorBlinking=n.get(26),this._cursorStyle=n.get(28),this._cursorSmoothCaretAnimation=n.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let r=0,s=this._secondaryCursors.length;r<s;r++)this._secondaryCursors[r].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,n,r){const s=this._secondaryCursors.length!==n.length||this._cursorSmoothCaretAnimation==="explicit"&&r!==3;if(this._primaryCursor.onCursorPositionChanged(e,s),this._updateBlinking(),this._secondaryCursors.length<n.length){const o=n.length-this._secondaryCursors.length;for(let a=0;a<o;a++){const l=new Age(this._context);this._domNode.domNode.insertBefore(l.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(l)}}else if(this._secondaryCursors.length>n.length){const o=this._secondaryCursors.length-n.length;for(let a=0;a<o;a++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let o=0;o<n.length;o++)this._secondaryCursors[o].onCursorPositionChanged(n[o],s)}onCursorStateChanged(e){const n=[];for(let s=0,o=e.selections.length;s<o;s++)n[s]=e.selections[s].getPosition();this._onCursorPositionChanged(n[0],n.slice(1),e.reason);const r=e.selections[0].isEmpty();return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const n=r=>{for(let s=0,o=e.ranges.length;s<o;s++)if(e.ranges[s].fromLineNumber<=r.lineNumber&&r.lineNumber<=e.ranges[s].toLineNumber)return!0;return!1};if(n(this._primaryCursor.getPosition()))return!0;for(const r of this._secondaryCursors)if(n(r.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput||!this._editorHasFocus?0:this._readOnly?5:this._cursorBlinking}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),n=e===0,r=e===5;n?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),!n&&!r&&(e===1?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},AP.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},AP.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case na.Line:e+=" cursor-line-style";break;case na.Block:e+=" cursor-block-style";break;case na.Underline:e+=" cursor-underline-style";break;case na.LineThin:e+=" cursor-line-thin-style";break;case na.BlockOutline:e+=" cursor-block-outline-style";break;case na.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,n=this._secondaryCursors.length;e<n;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,n=this._secondaryCursors.length;e<n;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let n=0,r=this._secondaryCursors.length;n<r;n++)this._secondaryCursors[n].prepareRender(e)}render(e){const n=[];let r=0;const s=this._primaryCursor.render(e);s&&(n[r++]=s);for(let o=0,a=this._secondaryCursors.length;o<a;o++){const l=this._secondaryCursors[o].render(e);l&&(n[r++]=l)}this._renderData=n}getLastRenderData(){return this._renderData}}AP.BLINK_INTERVAL=500;Of((i,e)=>{const n=i.getColor(IIe);if(n){let r=i.getColor(Dft);r||(r=n.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${n}; border-color: ${n}; color: ${r}; }`),Vp(i.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${r}; border-right: 1px solid ${r}; }`)}});const Sq=()=>{throw new Error("Invalid change accessor")};class dgt extends hu{constructor(e){super(e);const n=this._context.configuration.options,r=n.get(143);this._lineHeight=n.get(66),this._contentWidth=r.contentWidth,this._contentLeft=r.contentLeft,this.domNode=Di(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=Di(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),n=new Map;for(const s of e)n.set(s.id,s);let r=!1;return this._context.viewModel.changeWhitespace(s=>{const o=Object.keys(this._zones);for(let a=0,l=o.length;a<l;a++){const c=o[a],u=this._zones[c],d=this._computeWhitespaceProps(u.delegate);u.isInHiddenArea=d.isInHiddenArea;const h=n.get(c);h&&(h.afterLineNumber!==d.afterViewLineNumber||h.height!==d.heightInPx)&&(s.changeOneWhitespace(c,d.afterViewLineNumber,d.heightInPx),this._safeCallOnComputedHeight(u.delegate,d.heightInPx),r=!0)}}),r}onConfigurationChanged(e){const n=this._context.configuration.options,r=n.get(143);return this._lineHeight=n.get(66),this._contentWidth=r.contentWidth,this._contentLeft=r.contentLeft,e.hasChanged(66)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){var n,r;return(r=(n=e.ordinal)!==null&&n!==void 0?n:e.afterColumn)!==null&&r!==void 0?r:1e4}_computeWhitespaceProps(e){if(e.afterLineNumber===0)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let n;if(typeof e.afterColumn<"u")n=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const a=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;n=new ve(a,this._context.viewModel.model.getLineMaxColumn(a))}let r;n.column===this._context.viewModel.model.getLineMaxColumn(n.lineNumber)?r=this._context.viewModel.model.validatePosition({lineNumber:n.lineNumber+1,column:1}):r=this._context.viewModel.model.validatePosition({lineNumber:n.lineNumber,column:n.column+1});const s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n,e.afterColumnAffinity,!0),o=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(r);return{isInHiddenArea:!o,afterViewLineNumber:s.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let n=!1;return this._context.viewModel.changeWhitespace(r=>{const s={addZone:o=>(n=!0,this._addZone(r,o)),removeZone:o=>{o&&(n=this._removeZone(r,o)||n)},layoutZone:o=>{o&&(n=this._layoutZone(r,o)||n)}};hgt(e,s),s.addZone=Sq,s.removeZone=Sq,s.layoutZone=Sq}),n}_addZone(e,n){const r=this._computeWhitespaceProps(n),o={whitespaceId:e.insertWhitespace(r.afterViewLineNumber,this._getZoneOrdinal(n),r.heightInPx,r.minWidthInPx),delegate:n,isInHiddenArea:r.isInHiddenArea,isVisible:!1,domNode:Di(n.domNode),marginDomNode:n.marginDomNode?Di(n.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,r.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,n){if(this._zones.hasOwnProperty(n)){const r=this._zones[n];return delete this._zones[n],e.removeWhitespace(r.whitespaceId),r.domNode.removeAttribute("monaco-visible-view-zone"),r.domNode.removeAttribute("monaco-view-zone"),r.domNode.domNode.parentNode.removeChild(r.domNode.domNode),r.marginDomNode&&(r.marginDomNode.removeAttribute("monaco-visible-view-zone"),r.marginDomNode.removeAttribute("monaco-view-zone"),r.marginDomNode.domNode.parentNode.removeChild(r.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,n){if(this._zones.hasOwnProperty(n)){const r=this._zones[n],s=this._computeWhitespaceProps(r.delegate);return r.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(r.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(r.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,n){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(n)}catch(r){Ln(r)}}_safeCallOnDomNodeTop(e,n){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(n)}catch(r){Ln(r)}}prepareRender(e){}render(e){const n=e.viewportData.whitespaceViewportData,r={};let s=!1;for(const a of n)this._zones[a.id].isInHiddenArea||(r[a.id]=a,s=!0);const o=Object.keys(this._zones);for(let a=0,l=o.length;a<l;a++){const c=o[a],u=this._zones[c];let d=0,h=0,f="none";r.hasOwnProperty(c)?(d=r[c].verticalOffset-e.bigNumbersDelta,h=r[c].height,f="block",u.isVisible||(u.domNode.setAttribute("monaco-visible-view-zone","true"),u.isVisible=!0),this._safeCallOnDomNodeTop(u.delegate,e.getScrolledTopFromAbsoluteTop(r[c].verticalOffset))):(u.isVisible&&(u.domNode.removeAttribute("monaco-visible-view-zone"),u.isVisible=!1),this._safeCallOnDomNodeTop(u.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),u.domNode.setTop(d),u.domNode.setHeight(h),u.domNode.setDisplay(f),u.marginDomNode&&(u.marginDomNode.setTop(d),u.marginDomNode.setHeight(h),u.marginDomNode.setDisplay(f))}s&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}function hgt(i,e){try{return i(e)}catch(n){Ln(n)}}class fgt{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class pgt{constructor(e,n,r){this.configuration=e,this.theme=new fgt(n),this.viewModel=r,this.viewLayout=r.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}class ggt{constructor(e,n,r,s){this.selections=e,this.startLineNumber=n.startLineNumber|0,this.endLineNumber=n.endLineNumber|0,this.relativeVerticalOffset=n.relativeVerticalOffset,this.bigNumbersDelta=n.bigNumbersDelta|0,this.whitespaceViewportData=r,this._model=s,this.visibleRange=new J(n.startLineNumber,this._model.getLineMinColumn(n.startLineNumber),n.endLineNumber,this._model.getLineMaxColumn(n.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class mgt extends hu{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=Di(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const r=this._context.configuration.options.get(143),s=r.contentWidth-r.verticalScrollbarWidth;this.contentWidth!==s&&(this.contentWidth=s,e=!0);const o=r.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var n;let r=0;const s=e.getDecorationsInViewport();for(const o of s){if(!o.options.blockClassName)continue;let a=this.blocks[r];a||(a=this.blocks[r]=Di(document.createElement("div")),this.domNode.appendChild(a));let l,c;o.options.blockIsAfterEnd?(l=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),c=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(l=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),c=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[u,d,h,f]=(n=o.options.blockPadding)!==null&&n!==void 0?n:[0,0,0,0];a.setClassName("blockDecorations-block "+o.options.blockClassName),a.setLeft(this.contentLeft-f),a.setWidth(this.contentWidth+f+d),a.setTop(l-e.scrollTop-u),a.setHeight(c-l+u+h),r++}for(let o=r;o<this.blocks.length;o++)this.blocks[o].domNode.remove();this.blocks.length=r}}class _gt extends Zx{constructor(e){super(),this._context=e,this._options=new Nge(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=new Nge(this._context.configuration);return this._options.equals(n)?e.hasChanged(143):(this._options=n,!0)}onCursorStateChanged(e){return this._selection=e.selections,this._options.renderWhitespace==="selection"}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if(this._options.renderWhitespace==="none"){this._renderResult=null;return}const n=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber-n+1,o=new Array(s);for(let l=0;l<s;l++)o[l]=!0;const a=this._context.viewModel.getMinimapLinesRenderingData(e.viewportData.startLineNumber,e.viewportData.endLineNumber,o);this._renderResult=[];for(let l=e.viewportData.startLineNumber;l<=e.viewportData.endLineNumber;l++){const c=l-e.viewportData.startLineNumber,u=a.data[c];let d=null;if(this._options.renderWhitespace==="selection"){const h=this._selection;for(const f of h){if(f.endLineNumber<l||f.startLineNumber>l)continue;const p=f.startLineNumber===l?f.startColumn:u.minColumn,g=f.endLineNumber===l?f.endColumn:u.maxColumn;p<g&&(d||(d=[]),d.push(new nIe(p-1,g-1)))}}this._renderResult[c]=this._applyRenderWhitespace(e,l,d,u)}}_applyRenderWhitespace(e,n,r,s){if(this._options.renderWhitespace==="selection"&&!r||this._options.renderWhitespace==="trailing"&&s.continuesWithWrappedLine)return"";const o=this._context.theme.getColor(iv),a=this._options.renderWithSVG,l=s.content,c=this._options.stopRenderingLineAfter===-1?l.length:Math.min(this._options.stopRenderingLineAfter,l.length),u=s.continuesWithWrappedLine,d=s.minColumn-1,h=this._options.renderWhitespace==="boundary",f=this._options.renderWhitespace==="trailing",p=this._options.lineHeight,g=this._options.middotWidth,m=this._options.wsmiddotWidth,_=this._options.spaceWidth,b=Math.abs(m-_),y=Math.abs(g-_),x=b<y?11825:183,k=this._options.canUseHalfwidthRightwardsArrow;let D="",R=!1,E=ml(l),A;E===-1?(R=!0,E=c,A=c):A=$p(l);let M=0,N=r&&r[M],P=0;for(let O=d;O<c;O++){const B=l.charCodeAt(O);if(N&&O>=N.endOffset&&(M++,N=r&&r[M]),B!==9&&B!==32||f&&!R&&O<=A)continue;if(h&&O>=E&&O<=A&&B===32){const z=O-1>=0?l.charCodeAt(O-1):0,H=O+1<c?l.charCodeAt(O+1):0;if(z!==32&&H!==32)continue}if(h&&u&&O===c-1){const z=O-1>=0?l.charCodeAt(O-1):0;if(B===32&&z!==32&&z!==9)continue}if(r&&(!N||N.startOffset>O||N.endOffset<=O))continue;const j=e.visibleRangeForPosition(new ve(n,O+1));j&&(a?(P=Math.max(P,j.left),B===9?D+=this._renderArrow(p,_,j.left):D+=`<circle cx="${(j.left+_/2).toFixed(2)}" cy="${(p/2).toFixed(2)}" r="${(_/7).toFixed(2)}" />`):B===9?D+=`<div class="mwh" style="left:${j.left}px;height:${p}px;">${k?"→":"→"}</div>`:D+=`<div class="mwh" style="left:${j.left}px;height:${p}px;">${String.fromCharCode(x)}</div>`)}return a?(P=Math.round(P+_),`<svg style="position:absolute;width:${P}px;height:${p}px" viewBox="0 0 ${P} ${p}" xmlns="http://www.w3.org/2000/svg" fill="${o}">`+D+"</svg>"):D}_renderArrow(e,n,r){const s=n/7,o=n,a=e/2,l=r,c={x:0,y:s/2},u={x:100/125*o,y:c.y},d={x:u.x-.2*u.x,y:u.y+.2*u.x},h={x:d.x+.1*u.x,y:d.y+.1*u.x},f={x:h.x+.35*u.x,y:h.y-.35*u.x},p={x:f.x,y:-f.y},g={x:h.x,y:-h.y},m={x:d.x,y:-d.y},_={x:u.x,y:-u.y},b={x:c.x,y:-c.y};return`<path d="M ${[c,u,d,h,f,p,g,m,_,b].map(k=>`${(l+k.x).toFixed(2)} ${(a+k.y).toFixed(2)}`).join(" L ")}" />`}render(e,n){if(!this._renderResult)return"";const r=n-e;return r<0||r>=this._renderResult.length?"":this._renderResult[r]}}class Nge{constructor(e){const n=e.options,r=n.get(50),s=n.get(38);s==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):s==="svg"?(this.renderWhitespace=n.get(98),this.renderWithSVG=!0):(this.renderWhitespace=n.get(98),this.renderWithSVG=!1),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(66),this.stopRenderingLineAfter=n.get(116)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}var vgt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},bgt=function(i,e){return function(n,r){e(n,r,i)}};let FJ=class extends N5{constructor(e,n,r,s,o,a,l){super(),this._instantiationService=l,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new Ft(1,1,1,1)],this._renderAnimationFrame=null;const c=new Lpt(n,s,o,e);this._context=new pgt(n,r,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(MJ,this._context,c,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Di(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Di(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Di(document.createElement("div")),Ym.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Ppt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new N$(this._context,this._linesContent),this._viewZones=new dgt(this._context),this._viewParts.push(this._viewZones);const u=new ngt(this._context);this._viewParts.push(u);const d=new ogt(this._context);this._viewParts.push(d);const h=new Ept(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Apt(this._context)),h.addDynamicOverlay(new gs(this._context)),h.addDynamicOverlay(new Fpt(this._context)),h.addDynamicOverlay(new Mpt(this._context)),h.addDynamicOverlay(new _gt(this._context));const f=new Ipt(this._context);this._viewParts.push(f),f.addDynamicOverlay(new Npt(this._context)),f.addDynamicOverlay(new Gpt(this._context)),f.addDynamicOverlay(new Kpt(this._context)),f.addDynamicOverlay(new B5(this._context)),this._glyphMarginWidgets=new Vpt(this._context),this._viewParts.push(this._glyphMarginWidgets);const p=new hx(this._context);p.getDomNode().appendChild(this._viewZones.marginDomNode),p.getDomNode().appendChild(f.getDomNode()),p.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(p),this._contentWidgets=new Tpt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new AP(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new egt(this._context),this._viewParts.push(this._overlayWidgets);const g=new sgt(this._context);this._viewParts.push(g);const m=new mgt(this._context);this._viewParts.push(m);const _=new Jpt(this._context);if(this._viewParts.push(_),u){const b=this._scrollbar.getOverviewRulerLayoutInfo();b.parent.insertBefore(u.getDomNode(),b.insertBefore)}this._linesContent.appendChild(h.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(p.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),a?a.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new xft(this._context,c,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),yy.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let n=[];n=n.concat(e.getAllMarginDecorations().map(o=>{var a,l;const c=(l=(a=o.options.glyphMargin)===null||a===void 0?void 0:a.position)!==null&&l!==void 0?l:z2.Left;return{range:o.range,lane:c}})),n=n.concat(this._glyphMarginWidgets.getWidgets().map(o=>({range:e.validateRange(o.preference.range),lane:o.preference.lane}))),n.sort((o,a)=>J.compareRangesUsingStarts(o.range,a.range));let r=null,s=null;for(const o of n)if(o.lane===z2.Left&&(!r||J.compareRangesUsingEnds(r,o.range)<0)&&(r=o.range),o.lane===z2.Right&&(!s||J.compareRangesUsingEnds(s,o.range)<0)&&(s=o.range),r&&s){if(r.endLineNumber<s.startLineNumber){r=null;continue}if(s.endLineNumber<r.startLineNumber){s=null;continue}return 2}return 1}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],n=this._textAreaHandler.getLastRenderData();return new tft(e,n)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,n)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,n)),visibleRangeForPosition:(e,n)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ve(e,n))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const n=this._context.configuration.options.get(143);this.domNode.setWidth(n.width),this.domNode.setHeight(n.height),this._overflowGuardContainer.setWidth(n.width),this._overflowGuardContainer.setHeight(n.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+NJ(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=W9(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){ygt(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let n=0;for(const r of this._viewParts)r.shouldRender()&&(e[n++]=r);return e}_actualRender(){if(!Zse(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const n=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(n.startLineNumber,n.endLineNumber,n.centeredLineNumber);const r=new ggt(this._selections,n,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(r),this._viewLines.shouldRender()&&(this._viewLines.renderText(r),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const s=new Ght(this._context.viewLayout,r,this._viewLines);for(const o of e)o.prepareRender(s);for(const o of e)o.render(s),o.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,n){const r=this._context.viewModel.model.validatePosition({lineNumber:e,column:n}),s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new ve(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,n){const r=this._pointerHandler.getTargetAtClientPoint(e,n);return r?R$.convertViewToModelMouseTarget(r,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new rgt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,n){if(n){this._viewLines.forceShouldRender();for(const r of this._viewParts)r.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var n,r,s,o,a,l,c,u;this._contentWidgets.setWidgetPosition(e.widget,(r=(n=e.position)===null||n===void 0?void 0:n.position)!==null&&r!==void 0?r:null,(o=(s=e.position)===null||s===void 0?void 0:s.secondaryPosition)!==null&&o!==void 0?o:null,(l=(a=e.position)===null||a===void 0?void 0:a.preference)!==null&&l!==void 0?l:null,(u=(c=e.position)===null||c===void 0?void 0:c.positionAffinity)!==null&&u!==void 0?u:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const n=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,n)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const n=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,n)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};FJ=vgt([bgt(6,hn)],FJ);function ygt(i){try{return i()}catch(e){Ln(e)}}class GIe{constructor(e,n,r,s,o,a){this.id=e,this.label=n,this.alias=r,this._precondition=s,this._run=o,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function y1(i){let e=0,n=0,r=0,s=0;for(let o=0,a=i.length;o<a;o++){const l=i.charCodeAt(o);l===13?(e===0&&(n=o),e++,o+1<a&&i.charCodeAt(o+1)===10?(s|=2,o++):s|=3,r=o+1):l===10&&(s|=1,e===0&&(n=o),e++,r=o+1)}return e===0&&(n=i.length),[e,n,i.length-r,s]}class Mge{constructor(e,n,r,s){this.range=e,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=r,this.isInvalid=s}}class wgt{constructor(e,n,r,s,o,a){this.range=e,this.openingBracketRange=n,this.closingBracketRange=r,this.nestingLevel=s,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=a}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class Cgt extends wgt{constructor(e,n,r,s,o,a,l){super(e,n,r,s,o,a),this.minVisibleColumnIndentation=l}}class NP{constructor(e,n){this.lineCount=e,this.columnCount=n}toString(){return`${this.lineCount},${this.columnCount}`}}NP.zero=new NP(0,0);function Sgt(i,e,n,r){return i!==n?Is(n-i,r):Is(0,r-e)}const $l=0;function a7(i){return i===0}const ed=Math.pow(2,26);function Is(i,e){return i*ed+e}function dh(i){const e=i,n=Math.floor(e/ed),r=e-n*ed;return new NP(n,r)}function xgt(i){return Math.floor(i/ed)}function Jr(i,e){let n=i+e;return e>=ed&&(n=n-i%ed),n}function kgt(i,e){return i.reduce((n,r)=>Jr(n,e(r)),$l)}function XIe(i,e){return i===e}function MP(i,e){const n=i,r=e;if(r-n<=0)return $l;const o=Math.floor(n/ed),a=Math.floor(r/ed),l=r-a*ed;if(o===a){const c=n-o*ed;return Is(0,l-c)}else return Is(a-o,l)}function X2(i,e){return i<e}function Y2(i,e){return i<=e}function gN(i,e){return i>=e}function g2(i){return Is(i.lineNumber-1,i.column-1)}function FS(i,e){const n=i,r=Math.floor(n/ed),s=n-r*ed,o=e,a=Math.floor(o/ed),l=o-a*ed;return new J(r+1,s+1,a+1,l+1)}function Lgt(i){const e=Km(i);return Is(e.length-1,e[e.length-1].length)}class rv{static fromModelContentChanges(e){return e.map(r=>{const s=J.lift(r.range);return new rv(g2(s.getStartPosition()),g2(s.getEndPosition()),Lgt(r.text))}).reverse()}constructor(e,n,r){this.startOffset=e,this.endOffset=n,this.newLength=r}toString(){return`[${dh(this.startOffset)}...${dh(this.endOffset)}) -> ${dh(this.newLength)}`}}class Dgt{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(n=>Ioe.from(n))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const n=this.edits[this.nextEditIdx],r=n?this.translateOldToCur(n.offsetObj):null;return r===null?null:MP(e,r)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Is(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Is(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const n=dh(e);return n.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Is(n.lineCount-this.deltaOldToNewLineCount,n.columnCount-this.deltaOldToNewColumnCount):Is(n.lineCount-this.deltaOldToNewLineCount,n.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const n=this.edits[this.nextEditIdx],r=this.translateOldToCur(n.endOffsetAfterObj);if(Y2(r,e)){this.nextEditIdx++;const s=dh(r),o=dh(this.translateOldToCur(n.endOffsetBeforeObj)),a=s.lineCount-o.lineCount;this.deltaOldToNewLineCount+=a;const l=this.deltaLineIdxInOld===n.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,c=s.columnCount-o.columnCount;this.deltaOldToNewColumnCount=l+c,this.deltaLineIdxInOld=n.endOffsetBeforeObj.lineCount}else break}}}class Ioe{static from(e){return new Ioe(e.startOffset,e.endOffset,e.newLength)}constructor(e,n,r){this.endOffsetBeforeObj=dh(n),this.endOffsetAfterObj=dh(Jr(e,r)),this.offsetObj=dh(e)}}const _8=[];class eo{static create(e,n){if(e<=128&&n.length===0){let r=eo.cache[e];return r||(r=new eo(e,n),eo.cache[e]=r),r}return new eo(e,n)}static getEmpty(){return this.empty}constructor(e,n){this.items=e,this.additionalItems=n}add(e,n){const r=n.getKey(e);let s=r>>5;if(s===0){const a=1<<r|this.items;return a===this.items?this:eo.create(a,this.additionalItems)}s--;const o=this.additionalItems.slice(0);for(;o.length<s;)o.push(0);return o[s]|=1<<(r&31),eo.create(this.items,o)}merge(e){const n=this.items|e.items;if(this.additionalItems===_8&&e.additionalItems===_8)return n===this.items?this:n===e.items?e:eo.create(n,_8);const r=[];for(let s=0;s<Math.max(this.additionalItems.length,e.additionalItems.length);s++){const o=this.additionalItems[s]||0,a=e.additionalItems[s]||0;r.push(o|a)}return eo.create(n,r)}intersects(e){if((this.items&e.items)!==0)return!0;for(let n=0;n<Math.min(this.additionalItems.length,e.additionalItems.length);n++)if((this.additionalItems[n]&e.additionalItems[n])!==0)return!0;return!1}}eo.cache=new Array(129);eo.empty=eo.create(0,_8);const Pge={getKey(i){return i}};class YIe{constructor(){this.items=new Map}getKey(e){let n=this.items.get(e);return n===void 0&&(n=this.items.size,this.items.set(e,n)),n}}class Toe{get length(){return this._length}constructor(e){this._length=e}}class PP extends Toe{static create(e,n,r){let s=e.length;return n&&(s=Jr(s,n.length)),r&&(s=Jr(s,r.length)),new PP(s,e,n,r,n?n.missingOpeningBracketIds:eo.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,n,r,s,o){super(e),this.openingBracket=n,this.child=r,this.closingBracket=s,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new PP(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,n){return this.child?this.child.computeMinIndentation(Jr(e,this.openingBracket.length),n):Number.MAX_SAFE_INTEGER}}class Zm extends Toe{static create23(e,n,r,s=!1){let o=e.length,a=e.missingOpeningBracketIds;if(e.listHeight!==n.listHeight)throw new Error("Invalid list heights");if(o=Jr(o,n.length),a=a.merge(n.missingOpeningBracketIds),r){if(e.listHeight!==r.listHeight)throw new Error("Invalid list heights");o=Jr(o,r.length),a=a.merge(r.missingOpeningBracketIds)}return s?new Egt(o,e.listHeight+1,e,n,r,a):new OP(o,e.listHeight+1,e,n,r,a)}static getEmpty(){return new Igt($l,0,[],eo.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,n,r){super(e),this.listHeight=n,this._missingOpeningBracketIds=r,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(e===0)return;const n=this.getChild(e-1),r=n.kind===4?n.toMutable():n;return n!==r&&this.setChild(e-1,r),r}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;const n=this.getChild(0),r=n.kind===4?n.toMutable():n;return n!==r&&this.setChild(0,r),r}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||this.childrenLength===0)return!1;let n=this;for(;n.kind===4;){const r=n.childrenLength;if(r===0)throw new Vs;n=n.getChild(r-1)}return n.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let n=this.getChild(0).length,r=this.getChild(0).missingOpeningBracketIds;for(let s=1;s<e;s++){const o=this.getChild(s);n=Jr(n,o.length),r=r.merge(o.missingOpeningBracketIds)}this._length=n,this._missingOpeningBracketIds=r,this.cachedMinIndentation=-1}computeMinIndentation(e,n){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let r=Number.MAX_SAFE_INTEGER,s=e;for(let o=0;o<this.childrenLength;o++){const a=this.getChild(o);a&&(r=Math.min(r,a.computeMinIndentation(s,n)),s=Jr(s,a.length))}return this.cachedMinIndentation=r,r}}class OP extends Zm{get childrenLength(){return this._item3!==null?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,n){switch(e){case 0:this._item1=n;return;case 1:this._item2=n;return;case 2:this._item3=n;return}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,n,r,s,o,a){super(e,n,a),this._item1=r,this._item2=s,this._item3=o}deepClone(){return new OP(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class Egt extends OP{toMutable(){return new OP(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class l7 extends Zm{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,n){this._children[e]=n}get children(){return this._children}constructor(e,n,r,s){super(e,n,s),this._children=r}deepClone(){const e=new Array(this._children.length);for(let n=0;n<this._children.length;n++)e[n]=this._children[n].deepClone();return new l7(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class Igt extends l7{toMutable(){return new l7(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const Tgt=[];class Roe extends Toe{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return Tgt}deepClone(){return this}}class YC extends Roe{get kind(){return 0}get missingOpeningBracketIds(){return eo.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,n){const r=dh(e),s=(r.columnCount===0?r.lineCount:r.lineCount+1)+1,o=xgt(Jr(e,this.length))+1;let a=Number.MAX_SAFE_INTEGER;for(let l=s;l<=o;l++){const c=n.getLineFirstNonWhitespaceColumn(l),u=n.getLineContent(l);if(c===0)continue;const d=ho.visibleColumnFromColumn(u,c,n.getOptions().tabSize);a=Math.min(a,d)}return a}}class c7 extends Roe{static create(e,n,r){return new c7(e,n,r)}get kind(){return 1}get missingOpeningBracketIds(){return eo.getEmpty()}constructor(e,n,r){super(e),this.bracketInfo=n,this.bracketIds=r}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,n){return Number.MAX_SAFE_INTEGER}}class Rgt extends Roe{get kind(){return 3}constructor(e,n){super(n),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,n){return Number.MAX_SAFE_INTEGER}}let cy=class{constructor(e,n,r,s,o){this.length=e,this.kind=n,this.bracketId=r,this.bracketIds=s,this.astNode=o}};class ZIe{constructor(e,n){this.textModel=e,this.bracketTokens=n,this.reader=new Agt(this.textModel,this.bracketTokens),this._offset=$l,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Is(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Jr(this._offset,e);const n=dh(this._offset);this.reader.setPosition(n.lineCount,n.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Jr(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class Agt{constructor(e,n){this.textModel=e,this.bracketTokens=n,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,n){e===this.lineIdx?(this.lineCharOffset=n,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=n,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const o=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=o.length,o}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,n=this.lineCharOffset;let r=0;for(;;){const o=this.lineTokens,a=o.getCount();let l=null;if(this.lineTokenOffset<a){const c=o.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<a&&c===o.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const u=Da.getTokenType(c)===0,d=Da.containsBalancedBrackets(c),h=o.getEndOffset(this.lineTokenOffset);if(d&&u&&this.lineCharOffset<h){const f=o.getLanguageId(this.lineTokenOffset),p=this.line.substring(this.lineCharOffset,h),g=this.bracketTokens.getSingleLanguageBracketTokens(f),m=g.regExpGlobal;if(m){m.lastIndex=0;const _=m.exec(p);_&&(l=g.getToken(_[0]),l&&(this.lineCharOffset+=_.index))}}if(r+=h-this.lineCharOffset,l)if(e!==this.lineIdx||n!==this.lineCharOffset){this.peekedToken=l;break}else return this.lineCharOffset+=l.length,l;else this.lineTokenOffset++,this.lineCharOffset=h}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,r+=33,r>1e3))break;if(r>1500)break}const s=Sgt(e,n,this.lineIdx,this.lineCharOffset);return new cy(s,0,-1,eo.getEmpty(),new YC(s))}}class Ngt{constructor(e,n){this.text=e,this._offset=$l,this.idx=0;const r=n.getRegExpStr(),s=r?new RegExp(r+`|
`,"gi"):null,o=[];let a,l=0,c=0,u=0,d=0;const h=[];for(let g=0;g<60;g++)h.push(new cy(Is(0,g),0,-1,eo.getEmpty(),new YC(Is(0,g))));const f=[];for(let g=0;g<60;g++)f.push(new cy(Is(1,g),0,-1,eo.getEmpty(),new YC(Is(1,g))));if(s)for(s.lastIndex=0;(a=s.exec(e))!==null;){const g=a.index,m=a[0];if(m===`
`)l++,c=g+1;else{if(u!==g){let _;if(d===l){const b=g-u;if(b<h.length)_=h[b];else{const y=Is(0,b);_=new cy(y,0,-1,eo.getEmpty(),new YC(y))}}else{const b=l-d,y=g-c;if(b===1&&y<f.length)_=f[y];else{const x=Is(b,y);_=new cy(x,0,-1,eo.getEmpty(),new YC(x))}}o.push(_)}o.push(n.getToken(m)),u=g+m.length,d=l}}const p=e.length;if(u!==p){const g=d===l?Is(0,p-u):Is(l-d,p-c);o.push(new cy(g,0,-1,eo.getEmpty(),new YC(g)))}this.length=Is(l,p-c),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new Ost}}class Aoe{static createFromLanguage(e,n){function r(o){return n.getKey(`${o.languageId}:::${o.bracketText}`)}const s=new Map;for(const o of e.bracketsNew.openingBrackets){const a=Is(0,o.bracketText.length),l=r(o),c=eo.getEmpty().add(l,Pge);s.set(o.bracketText,new cy(a,1,l,c,c7.create(a,o,c)))}for(const o of e.bracketsNew.closingBrackets){const a=Is(0,o.bracketText.length);let l=eo.getEmpty();const c=o.getOpeningBrackets();for(const u of c)l=l.add(r(u),Pge);s.set(o.bracketText,new cy(a,2,r(c[0]),l,c7.create(a,o,l)))}return new Aoe(s)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(n=>Mgt(n)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[n,r]of this.map)if(r.kind===2&&r.bracketIds.intersects(e))return n}get isEmpty(){return this.map.size===0}}function Mgt(i){let e=dd(i);return/^[\w ]+/.test(i)&&(e=`\\b${e}`),/[\w ]+$/.test(i)&&(e=`${e}\\b`),e}class QIe{constructor(e,n){this.denseKeyProvider=e,this.getLanguageConfiguration=n,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let n=this.languageIdToBracketTokens.get(e);return n||(n=Aoe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,n)),n}}function Pgt(i){if(i.length===0)return null;if(i.length===1)return i[0];let e=0;function n(){if(e>=i.length)return null;const a=e,l=i[a].listHeight;for(e++;e<i.length&&i[e].listHeight===l;)e++;return e-a>=2?JIe(a===0&&e===i.length?i:i.slice(a,e),!1):i[a]}let r=n(),s=n();if(!s)return r;for(let a=n();a;a=n())Oge(r,s)<=Oge(s,a)?(r=xq(r,s),s=a):s=xq(s,a);return xq(r,s)}function JIe(i,e=!1){if(i.length===0)return null;if(i.length===1)return i[0];let n=i.length;for(;n>3;){const r=n>>1;for(let s=0;s<r;s++){const o=s<<1;i[s]=Zm.create23(i[o],i[o+1],o+3===n?i[o+2]:null,e)}n=r}return Zm.create23(i[0],i[1],n>=3?i[2]:null,e)}function Oge(i,e){return Math.abs(i.listHeight-e.listHeight)}function xq(i,e){return i.listHeight===e.listHeight?Zm.create23(i,e,null,!1):i.listHeight>e.listHeight?Ogt(i,e):Fgt(e,i)}function Ogt(i,e){i=i.toMutable();let n=i;const r=[];let s;for(;;){if(e.listHeight===n.listHeight){s=e;break}if(n.kind!==4)throw new Error("unexpected");r.push(n),n=n.makeLastElementMutable()}for(let o=r.length-1;o>=0;o--){const a=r[o];s?a.childrenLength>=3?s=Zm.create23(a.unappendChild(),s,null,!1):(a.appendChildOfSameHeight(s),s=void 0):a.handleChildrenChanged()}return s?Zm.create23(i,s,null,!1):i}function Fgt(i,e){i=i.toMutable();let n=i;const r=[];for(;e.listHeight!==n.listHeight;){if(n.kind!==4)throw new Error("unexpected");r.push(n),n=n.makeFirstElementMutable()}let s=e;for(let o=r.length-1;o>=0;o--){const a=r[o];s?a.childrenLength>=3?s=Zm.create23(s,a.unprependChild(),null,!1):(a.prependChildOfSameHeight(s),s=void 0):a.handleChildrenChanged()}return s?Zm.create23(s,i,null,!1):i}class Bgt{constructor(e){this.lastOffset=$l,this.nextNodes=[e],this.offsets=[$l],this.idxs=[]}readLongestNodeAt(e,n){if(X2(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const r=XR(this.nextNodes);if(!r)return;const s=XR(this.offsets);if(X2(e,s))return;if(X2(s,e))if(Jr(s,r.length)<=e)this.nextNodeAfterCurrent();else{const o=kq(r);o!==-1?(this.nextNodes.push(r.getChild(o)),this.offsets.push(s),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(n(r))return this.nextNodeAfterCurrent(),r;{const o=kq(r);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(r.getChild(o)),this.offsets.push(s),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=XR(this.offsets),n=XR(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const r=XR(this.nextNodes),s=kq(r,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(r.getChild(s)),this.offsets.push(Jr(e,n.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function kq(i,e=-1){for(;;){if(e++,e>=i.childrenLength)return-1;if(i.getChild(e))return e}}function XR(i){return i.length>0?i[i.length-1]:void 0}function BJ(i,e,n,r){return new jgt(i,e,n,r).parseDocument()}class jgt{constructor(e,n,r,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,r&&s)throw new Error("Not supported");this.oldNodeReader=r?new Bgt(r):void 0,this.positionMapper=new Dgt(n)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(eo.getEmpty(),0);return e||(e=Zm.getEmpty()),e}parseList(e,n){const r=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const a=this.tokenizer.peek();if(!a||a.kind===2&&a.bracketIds.intersects(e))break;o=this.parseChild(e,n+1)}o.kind===4&&o.childrenLength===0||r.push(o)}return this.oldNodeReader?Pgt(r):JIe(r,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const n=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(n===null||!a7(n)){const r=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>n!==null&&!X2(s.length,n)?!1:s.canBeReused(e));if(r)return this._itemsFromCache++,this.tokenizer.skip(r.length),r}}}parseChild(e,n){this._itemsConstructed++;const r=this.tokenizer.read();switch(r.kind){case 2:return new Rgt(r.bracketIds,r.length);case 0:return r.astNode;case 1:{if(n>300)return new YC(r.length);const s=e.merge(r.bracketIds),o=this.parseList(s,n+1),a=this.tokenizer.peek();return a&&a.kind===2&&(a.bracketId===r.bracketId||a.bracketIds.intersects(r.bracketIds))?(this.tokenizer.read(),PP.create(r.astNode,o,a.astNode)):PP.create(r.astNode,o,null)}default:throw new Error("unexpected")}}}function u7(i,e){if(i.length===0)return e;if(e.length===0)return i;const n=new Ev(Fge(i)),r=Fge(e);r.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=n.dequeue();function o(u){if(u===void 0){const h=n.takeWhile(f=>!0)||[];return s&&h.unshift(s),h}const d=[];for(;s&&!a7(u);){const[h,f]=s.splitAt(u);d.push(h),u=MP(h.lengthAfter,u),s=f??n.dequeue()}return a7(u)||d.push(new wy(!1,u,u)),d}const a=[];function l(u,d,h){if(a.length>0&&XIe(a[a.length-1].endOffset,u)){const f=a[a.length-1];a[a.length-1]=new rv(f.startOffset,d,Jr(f.newLength,h))}else a.push({startOffset:u,endOffset:d,newLength:h})}let c=$l;for(const u of r){const d=o(u.lengthBefore);if(u.modified){const h=kgt(d,p=>p.lengthBefore),f=Jr(c,h);l(c,f,u.lengthAfter),c=f}else for(const h of d){const f=c;c=Jr(c,h.lengthBefore),h.modified&&l(f,c,h.lengthAfter)}}return a}class wy{constructor(e,n,r){this.modified=e,this.lengthBefore=n,this.lengthAfter=r}splitAt(e){const n=MP(e,this.lengthAfter);return XIe(n,$l)?[this,void 0]:this.modified?[new wy(this.modified,this.lengthBefore,e),new wy(this.modified,$l,n)]:[new wy(this.modified,e,e),new wy(this.modified,n,n)]}toString(){return`${this.modified?"M":"U"}:${dh(this.lengthBefore)} -> ${dh(this.lengthAfter)}`}}function Fge(i){const e=[];let n=$l;for(const r of i){const s=MP(n,r.startOffset);a7(s)||e.push(new wy(!1,s,s));const o=MP(r.startOffset,r.endOffset);e.push(new wy(!0,o,r.newLength)),n=r.endOffset}return e}class Wgt extends Le{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,n){if(super(),this.textModel=e,this.getLanguageConfiguration=n,this.didChangeEmitter=new _e,this.denseKeyProvider=new YIe,this.brackets=new QIe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const r=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new Ngt(this.textModel.getValue(),r);this.initialAstWithoutTokens=BJ(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const n=e.map(r=>new rv(Is(r.fromLineNumber-1,0),Is(r.toLineNumber,0),Is(r.toLineNumber-r.fromLineNumber+1,0)));this.handleEdits(n,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const n=rv.fromModelContentChanges(e.changes);this.handleEdits(n,!1)}handleEdits(e,n){const r=u7(this.queuedTextEdits,e);this.queuedTextEdits=r,this.initialAstWithoutTokens&&!n&&(this.queuedTextEditsForInitialAstWithoutTokens=u7(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,n,r){const s=n,o=new ZIe(this.textModel,this.brackets);return BJ(o,e,s,r)}getBracketsInRange(e,n){this.flushQueue();const r=Is(e.startLineNumber-1,e.startColumn-1),s=Is(e.endLineNumber-1,e.endColumn-1);return new Rm(o=>{const a=this.initialAstWithoutTokens||this.astWithTokens;jJ(a,$l,a.length,r,s,o,0,0,new Map,n)})}getBracketPairsInRange(e,n){this.flushQueue();const r=g2(e.getStartPosition()),s=g2(e.getEndPosition());return new Rm(o=>{const a=this.initialAstWithoutTokens||this.astWithTokens,l=new $gt(o,n,this.textModel);WJ(a,$l,a.length,r,s,l,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const n=this.initialAstWithoutTokens||this.astWithTokens;return tTe(n,$l,n.length,g2(e))}getFirstBracketBefore(e){this.flushQueue();const n=this.initialAstWithoutTokens||this.astWithTokens;return eTe(n,$l,n.length,g2(e))}}function eTe(i,e,n,r){if(i.kind===4||i.kind===2){const s=[];for(const o of i.children)n=Jr(e,o.length),s.push({nodeOffsetStart:e,nodeOffsetEnd:n}),e=n;for(let o=s.length-1;o>=0;o--){const{nodeOffsetStart:a,nodeOffsetEnd:l}=s[o];if(X2(a,r)){const c=eTe(i.children[o],a,l,r);if(c)return c}}return null}else{if(i.kind===3)return null;if(i.kind===1){const s=FS(e,n);return{bracketInfo:i.bracketInfo,range:s}}}return null}function tTe(i,e,n,r){if(i.kind===4||i.kind===2){for(const s of i.children){if(n=Jr(e,s.length),X2(r,n)){const o=tTe(s,e,n,r);if(o)return o}e=n}return null}else{if(i.kind===3)return null;if(i.kind===1){const s=FS(e,n);return{bracketInfo:i.bracketInfo,range:s}}}return null}function jJ(i,e,n,r,s,o,a,l,c,u,d=!1){if(a>200)return!0;e:for(;;)switch(i.kind){case 4:{const h=i.childrenLength;for(let f=0;f<h;f++){const p=i.getChild(f);if(p){if(n=Jr(e,p.length),Y2(e,s)&&gN(n,r)){if(gN(n,s)){i=p;continue e}if(!jJ(p,e,n,r,s,o,a,0,c,u))return!1}e=n}}return!0}case 2:{const h=!u||!i.closingBracket||i.closingBracket.bracketInfo.closesColorized(i.openingBracket.bracketInfo);let f=0;if(c){let g=c.get(i.openingBracket.text);g===void 0&&(g=0),f=g,h&&(g++,c.set(i.openingBracket.text,g))}const p=i.childrenLength;for(let g=0;g<p;g++){const m=i.getChild(g);if(m){if(n=Jr(e,m.length),Y2(e,s)&&gN(n,r)){if(gN(n,s)&&m.kind!==1){i=m,h?(a++,l=f+1):l=f;continue e}if((h||m.kind!==1||!i.closingBracket)&&!jJ(m,e,n,r,s,o,h?a+1:a,h?f+1:f,c,u,!i.closingBracket))return!1}e=n}}return c==null||c.set(i.openingBracket.text,f),!0}case 3:{const h=FS(e,n);return o(new Mge(h,a-1,0,!0))}case 1:{const h=FS(e,n);return o(new Mge(h,a-1,l-1,d))}case 0:return!0}}class $gt{constructor(e,n,r){this.push=e,this.includeMinIndentation=n,this.textModel=r}}function WJ(i,e,n,r,s,o,a,l){var c;if(a>200)return!0;let u=!0;if(i.kind===2){let d=0;if(l){let p=l.get(i.openingBracket.text);p===void 0&&(p=0),d=p,p++,l.set(i.openingBracket.text,p)}const h=Jr(e,i.openingBracket.length);let f=-1;if(o.includeMinIndentation&&(f=i.computeMinIndentation(e,o.textModel)),u=o.push(new Cgt(FS(e,n),FS(e,h),i.closingBracket?FS(Jr(h,((c=i.child)===null||c===void 0?void 0:c.length)||$l),n):void 0,a,d,i,f)),e=h,u&&i.child){const p=i.child;if(n=Jr(e,p.length),Y2(e,s)&&gN(n,r)&&(u=WJ(p,e,n,r,s,o,a+1,l),!u))return!1}l==null||l.set(i.openingBracket.text,d)}else{let d=e;for(const h of i.children){const f=d;if(d=Jr(d,h.length),Y2(f,s)&&Y2(r,d)&&(u=WJ(h,f,d,r,s,o,a,l),!u))return!1}}return u}class zgt extends Le{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,n){super(),this.textModel=e,this.languageConfigurationService=n,this.bracketPairsTree=this._register(new ha),this.onDidChangeEmitter=new _e,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(r=>{var s;(!r.languageId||!((s=this.bracketPairsTree.value)===null||s===void 0)&&s.object.didLanguageChange(r.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var n;(n=this.bracketPairsTree.value)===null||n===void 0||n.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var n;(n=this.bracketPairsTree.value)===null||n===void 0||n.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Xe;this.bracketPairsTree.value=Vgt(e.add(new Wgt(this.textModel,n=>this.languageConfigurationService.getLanguageConfiguration(n))),e),e.add(this.bracketPairsTree.value.object.onDidChange(n=>this.onDidChangeEmitter.fire(n))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketPairsInRange(e,!1))||Rm.empty}getBracketPairsInRangeWithMinIndentation(e){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketPairsInRange(e,!0))||Rm.empty}getBracketsInRange(e,n=!1){var r;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((r=this.bracketPairsTree.value)===null||r===void 0?void 0:r.object.getBracketsInRange(e,n))||Rm.empty}findMatchingBracketUp(e,n,r){const s=this.textModel.validatePosition(n),o=this.textModel.getLanguageIdAtPosition(s.lineNumber,s.column);if(this.canBuildAST){const a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!a)return null;const l=this.getBracketPairsInRange(J.fromPositions(n,n)).findLast(c=>a.closes(c.openingBracketInfo));return l?l.openingBracketRange:null}else{const a=e.toLowerCase(),l=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!l)return null;const c=l.textIsBracket[a];return c?e6(this._findMatchingBracketUp(c,s,Lq(r))):null}}matchBracket(e,n){if(this.canBuildAST){const r=this.getBracketPairsInRange(J.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(ch(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,J.compareRangesUsingStarts));return r?[r.openingBracketRange,r.closingBracketRange]:null}else{const r=Lq(n);return this._matchBracket(this.textModel.validatePosition(e),r)}}_establishBracketSearchOffsets(e,n,r,s){const o=n.getCount(),a=n.getLanguageId(s);let l=Math.max(0,e.column-1-r.maxBracketLength);for(let u=s-1;u>=0;u--){const d=n.getEndOffset(u);if(d<=l)break;if(Vg(n.getStandardTokenType(u))||n.getLanguageId(u)!==a){l=d;break}}let c=Math.min(n.getLineContent().length,e.column-1+r.maxBracketLength);for(let u=s+1;u<o;u++){const d=n.getStartOffset(u);if(d>=c)break;if(Vg(n.getStandardTokenType(u))||n.getLanguageId(u)!==a){c=d;break}}return{searchStartOffset:l,searchEndOffset:c}}_matchBracket(e,n){const r=e.lineNumber,s=this.textModel.tokenization.getLineTokens(r),o=this.textModel.getLineContent(r),a=s.findTokenIndexAtOffset(e.column-1);if(a<0)return null;const l=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(a)).brackets;if(l&&!Vg(s.getStandardTokenType(a))){let{searchStartOffset:c,searchEndOffset:u}=this._establishBracketSearchOffsets(e,s,l,a),d=null;for(;;){const h=Yh.findNextBracketInRange(l.forwardRegex,r,o,c,u);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),p=this._matchFoundBracket(h,l.textIsBracket[f],l.textIsOpenBracket[f],n);if(p){if(p instanceof R0)return null;d=p}}c=h.endColumn-1}if(d)return d}if(a>0&&s.getStartOffset(a)===e.column-1){const c=a-1,u=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(c)).brackets;if(u&&!Vg(s.getStandardTokenType(c))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,s,u,c),f=Yh.findPrevBracketInRange(u.reversedRegex,r,o,d,h);if(f&&f.startColumn<=e.column&&e.column<=f.endColumn){const p=o.substring(f.startColumn-1,f.endColumn-1).toLowerCase(),g=this._matchFoundBracket(f,u.textIsBracket[p],u.textIsOpenBracket[p],n);if(g)return g instanceof R0?null:g}}}return null}_matchFoundBracket(e,n,r,s){if(!n)return null;const o=r?this._findMatchingBracketDown(n,e.getEndPosition(),s):this._findMatchingBracketUp(n,e.getStartPosition(),s);return o?o instanceof R0?o:[e,o]:null}_findMatchingBracketUp(e,n,r){const s=e.languageId,o=e.reversedRegex;let a=-1,l=0;const c=(u,d,h,f)=>{for(;;){if(r&&++l%100===0&&!r())return R0.INSTANCE;const p=Yh.findPrevBracketInRange(o,u,d,h,f);if(!p)break;const g=d.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(g)?a++:e.isClose(g)&&a--,a===0)return p;f=p.startColumn-1}return null};for(let u=n.lineNumber;u>=1;u--){const d=this.textModel.tokenization.getLineTokens(u),h=d.getCount(),f=this.textModel.getLineContent(u);let p=h-1,g=f.length,m=f.length;u===n.lineNumber&&(p=d.findTokenIndexAtOffset(n.column-1),g=n.column-1,m=n.column-1);let _=!0;for(;p>=0;p--){const b=d.getLanguageId(p)===s&&!Vg(d.getStandardTokenType(p));if(b)_?g=d.getStartOffset(p):(g=d.getStartOffset(p),m=d.getEndOffset(p));else if(_&&g!==m){const y=c(u,f,g,m);if(y)return y}_=b}if(_&&g!==m){const b=c(u,f,g,m);if(b)return b}}return null}_findMatchingBracketDown(e,n,r){const s=e.languageId,o=e.forwardRegex;let a=1,l=0;const c=(d,h,f,p)=>{for(;;){if(r&&++l%100===0&&!r())return R0.INSTANCE;const g=Yh.findNextBracketInRange(o,d,h,f,p);if(!g)break;const m=h.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(m)?a++:e.isClose(m)&&a--,a===0)return g;f=g.endColumn-1}return null},u=this.textModel.getLineCount();for(let d=n.lineNumber;d<=u;d++){const h=this.textModel.tokenization.getLineTokens(d),f=h.getCount(),p=this.textModel.getLineContent(d);let g=0,m=0,_=0;d===n.lineNumber&&(g=h.findTokenIndexAtOffset(n.column-1),m=n.column-1,_=n.column-1);let b=!0;for(;g<f;g++){const y=h.getLanguageId(g)===s&&!Vg(h.getStandardTokenType(g));if(y)b||(m=h.getStartOffset(g)),_=h.getEndOffset(g);else if(b&&m!==_){const x=c(d,p,m,_);if(x)return x}b=y}if(b&&m!==_){const y=c(d,p,m,_);if(y)return y}}return null}findPrevBracket(e){var n;const r=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getFirstBracketBefore(r))||null;let s=null,o=null,a=null;for(let l=r.lineNumber;l>=1;l--){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let h=u-1,f=d.length,p=d.length;if(l===r.lineNumber){h=c.findTokenIndexAtOffset(r.column-1),f=r.column-1,p=r.column-1;const m=c.getLanguageId(h);s!==m&&(s=m,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,a=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let g=!0;for(;h>=0;h--){const m=c.getLanguageId(h);if(s!==m){if(o&&a&&g&&f!==p){const b=Yh.findPrevBracketInRange(o.reversedRegex,l,d,f,p);if(b)return this._toFoundBracket(a,b);g=!1}s=m,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,a=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew}const _=!!o&&!Vg(c.getStandardTokenType(h));if(_)g?f=c.getStartOffset(h):(f=c.getStartOffset(h),p=c.getEndOffset(h));else if(a&&o&&g&&f!==p){const b=Yh.findPrevBracketInRange(o.reversedRegex,l,d,f,p);if(b)return this._toFoundBracket(a,b)}g=_}if(a&&o&&g&&f!==p){const m=Yh.findPrevBracketInRange(o.reversedRegex,l,d,f,p);if(m)return this._toFoundBracket(a,m)}}return null}findNextBracket(e){var n;const r=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getFirstBracketAfter(r))||null;const s=this.textModel.getLineCount();let o=null,a=null,l=null;for(let c=r.lineNumber;c<=s;c++){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),h=this.textModel.getLineContent(c);let f=0,p=0,g=0;if(c===r.lineNumber){f=u.findTokenIndexAtOffset(r.column-1),p=r.column-1,g=r.column-1;const _=u.getLanguageId(f);o!==_&&(o=_,a=this.languageConfigurationService.getLanguageConfiguration(o).brackets,l=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let m=!0;for(;f<d;f++){const _=u.getLanguageId(f);if(o!==_){if(l&&a&&m&&p!==g){const y=Yh.findNextBracketInRange(a.forwardRegex,c,h,p,g);if(y)return this._toFoundBracket(l,y);m=!1}o=_,a=this.languageConfigurationService.getLanguageConfiguration(o).brackets,l=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const b=!!a&&!Vg(u.getStandardTokenType(f));if(b)m||(p=u.getStartOffset(f)),g=u.getEndOffset(f);else if(l&&a&&m&&p!==g){const y=Yh.findNextBracketInRange(a.forwardRegex,c,h,p,g);if(y)return this._toFoundBracket(l,y)}m=b}if(l&&a&&m&&p!==g){const _=Yh.findNextBracketInRange(a.forwardRegex,c,h,p,g);if(_)return this._toFoundBracket(l,_)}}return null}findEnclosingBrackets(e,n){const r=this.textModel.validatePosition(e);if(this.canBuildAST){const p=J.fromPositions(r),g=this.getBracketPairsInRange(J.fromPositions(r,r)).findLast(m=>m.closingBracketRange!==void 0&&m.range.strictContainsRange(p));return g?[g.openingBracketRange,g.closingBracketRange]:null}const s=Lq(n),o=this.textModel.getLineCount(),a=new Map;let l=[];const c=(p,g)=>{if(!a.has(p)){const m=[];for(let _=0,b=g?g.brackets.length:0;_<b;_++)m[_]=0;a.set(p,m)}l=a.get(p)};let u=0;const d=(p,g,m,_,b)=>{for(;;){if(s&&++u%100===0&&!s())return R0.INSTANCE;const y=Yh.findNextBracketInRange(p.forwardRegex,g,m,_,b);if(!y)break;const x=m.substring(y.startColumn-1,y.endColumn-1).toLowerCase(),k=p.textIsBracket[x];if(k&&(k.isOpen(x)?l[k.index]++:k.isClose(x)&&l[k.index]--,l[k.index]===-1))return this._matchFoundBracket(y,k,!1,s);_=y.endColumn-1}return null};let h=null,f=null;for(let p=r.lineNumber;p<=o;p++){const g=this.textModel.tokenization.getLineTokens(p),m=g.getCount(),_=this.textModel.getLineContent(p);let b=0,y=0,x=0;if(p===r.lineNumber){b=g.findTokenIndexAtOffset(r.column-1),y=r.column-1,x=r.column-1;const D=g.getLanguageId(b);h!==D&&(h=D,f=this.languageConfigurationService.getLanguageConfiguration(h).brackets,c(h,f))}let k=!0;for(;b<m;b++){const D=g.getLanguageId(b);if(h!==D){if(f&&k&&y!==x){const E=d(f,p,_,y,x);if(E)return e6(E);k=!1}h=D,f=this.languageConfigurationService.getLanguageConfiguration(h).brackets,c(h,f)}const R=!!f&&!Vg(g.getStandardTokenType(b));if(R)k||(y=g.getStartOffset(b)),x=g.getEndOffset(b);else if(f&&k&&y!==x){const E=d(f,p,_,y,x);if(E)return e6(E)}k=R}if(f&&k&&y!==x){const D=d(f,p,_,y,x);if(D)return e6(D)}}return null}_toFoundBracket(e,n){if(!n)return null;let r=this.textModel.getValueInRange(n);r=r.toLowerCase();const s=e.getBracketInfo(r);return s?{range:n,bracketInfo:s}:null}}function Vgt(i,e){return{object:i,dispose:()=>e==null?void 0:e.dispose()}}function Lq(i){if(typeof i>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=i}}class R0{constructor(){this._searchCanceledBrand=void 0}}R0.INSTANCE=new R0;function e6(i){return i instanceof R0?null:i}class Hgt extends Le{constructor(e){super(),this.textModel=e,this.colorProvider=new nTe,this.onDidChangeEmitter=new _e,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(n=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,n,r,s){return s?[]:n===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(a=>({id:`bracket${a.range.toString()}-${a.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(a,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:a.range})).toArray():[]}getAllDecorations(e,n){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new J(1,1,this.textModel.getLineCount(),1),e,n):[]}}class nTe{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,n){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(n?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Of((i,e)=>{const n=[RIe,AIe,NIe,MIe,PIe,OIe],r=new nTe;e.addRule(`.monaco-editor .${r.unexpectedClosingBracketClassName} { color: ${i.getColor(qft)}; }`);const s=n.map(o=>i.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const a=s[o%s.length];e.addRule(`.monaco-editor .${r.getInlineClassNameOfLevel(o)} { color: ${a}; }`)}});function t6(i){return i.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class xa{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,n,r,s){this.oldPosition=e,this.oldText=n,this.newPosition=r,this.newText=s}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${t6(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${t6(this.oldText)}")`:`(replace@${this.oldPosition} "${t6(this.oldText)}" with "${t6(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,n,r){const s=n.length;gp(e,s,r),r+=4;for(let o=0;o<s;o++)Rlt(e,n.charCodeAt(o),r),r+=2;return r}static _readString(e,n){const r=pp(e,n);return n+=4,Nlt(e,n,r)}writeSize(){return 8+xa._writeStringSize(this.oldText)+xa._writeStringSize(this.newText)}write(e,n){return gp(e,this.oldPosition,n),n+=4,gp(e,this.newPosition,n),n+=4,n=xa._writeString(e,this.oldText,n),n=xa._writeString(e,this.newText,n),n}static read(e,n,r){const s=pp(e,n);n+=4;const o=pp(e,n);n+=4;const a=xa._readString(e,n);n+=xa._writeStringSize(a);const l=xa._readString(e,n);return n+=xa._writeStringSize(l),r.push(new xa(s,a,o,l)),n}}function Ugt(i,e){return i===null||i.length===0?e:new Kg(i,e).compress()}class Kg{constructor(e,n){this._prevEdits=e,this._currEdits=n,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,n=0,r=this._getPrev(e),s=this._getCurr(n);for(;e<this._prevLen||n<this._currLen;){if(r===null){this._acceptCurr(s),s=this._getCurr(++n);continue}if(s===null){this._acceptPrev(r),r=this._getPrev(++e);continue}if(s.oldEnd<=r.newPosition){this._acceptCurr(s),s=this._getCurr(++n);continue}if(r.newEnd<=s.oldPosition){this._acceptPrev(r),r=this._getPrev(++e);continue}if(s.oldPosition<r.newPosition){const[u,d]=Kg._splitCurr(s,r.newPosition-s.oldPosition);this._acceptCurr(u),s=d;continue}if(r.newPosition<s.oldPosition){const[u,d]=Kg._splitPrev(r,s.oldPosition-r.newPosition);this._acceptPrev(u),r=d;continue}let l,c;if(s.oldEnd===r.newEnd)l=r,c=s,r=this._getPrev(++e),s=this._getCurr(++n);else if(s.oldEnd<r.newEnd){const[u,d]=Kg._splitPrev(r,s.oldLength);l=u,c=s,r=d,s=this._getCurr(++n)}else{const[u,d]=Kg._splitCurr(s,r.newLength);l=r,c=u,r=this._getPrev(++e),s=d}this._result[this._resultLen++]=new xa(l.oldPosition,l.oldText,c.newPosition,c.newText),this._prevDeltaOffset+=l.newLength-l.oldLength,this._currDeltaOffset+=c.newLength-c.oldLength}const o=Kg._merge(this._result);return Kg._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=Kg._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=Kg._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,n){return new xa(n.oldPosition-e,n.oldText,n.newPosition,n.newText)}static _rebasePrev(e,n){return new xa(n.oldPosition,n.oldText,n.newPosition+e,n.newText)}static _splitPrev(e,n){const r=e.newText.substr(0,n),s=e.newText.substr(n);return[new xa(e.oldPosition,e.oldText,e.newPosition,r),new xa(e.oldEnd,"",e.newPosition+n,s)]}static _splitCurr(e,n){const r=e.oldText.substr(0,n),s=e.oldText.substr(n);return[new xa(e.oldPosition,r,e.newPosition,e.newText),new xa(e.oldPosition+n,s,e.newEnd,"")]}static _merge(e){if(e.length===0)return e;const n=[];let r=0,s=e[0];for(let o=1;o<e.length;o++){const a=e[o];s.oldEnd===a.oldPosition?s=new xa(s.oldPosition,s.oldText+a.oldText,s.newPosition,s.newText+a.newText):(n[r++]=s,s=a)}return n[r++]=s,n}static _removeNoOps(e){if(e.length===0)return e;const n=[];let r=0;for(let s=0;s<e.length;s++){const o=e[s];o.oldText!==o.newText&&(n[r++]=o)}return n}}function Fb(i){return i===47||i===92}function iTe(i){return i.replace(/[\\/]/g,to.sep)}function qgt(i){return i.indexOf("/")===-1&&(i=iTe(i)),/^[a-zA-Z]:(\/|$)/.test(i)&&(i="/"+i),i}function Bge(i,e=to.sep){if(!i)return"";const n=i.length,r=i.charCodeAt(0);if(Fb(r)){if(Fb(i.charCodeAt(1))&&!Fb(i.charCodeAt(2))){let o=3;const a=o;for(;o<n&&!Fb(i.charCodeAt(o));o++);if(a!==o&&!Fb(i.charCodeAt(o+1))){for(o+=1;o<n;o++)if(Fb(i.charCodeAt(o)))return i.slice(0,o+1).replace(/[\\/]/g,e)}}return e}else if(rTe(r)&&i.charCodeAt(1)===58)return Fb(i.charCodeAt(2))?i.slice(0,2)+e:i.slice(0,2);let s=i.indexOf("://");if(s!==-1){for(s+=3;s<n;s++)if(Fb(i.charCodeAt(s)))return i.slice(0,s+1)}return""}function $J(i,e,n,r=Wp){if(i===e)return!0;if(!i||!e||e.length>i.length)return!1;if(n){if(!Wse(i,e))return!1;if(e.length===i.length)return!0;let o=e.length;return e.charAt(e.length-1)===r&&o--,i.charAt(o)===r}return e.charAt(e.length-1)!==r&&(e+=r),i.indexOf(e)===0}function rTe(i){return i>=65&&i<=90||i>=97&&i<=122}function Kgt(i,e=Aa){return e?rTe(i.charCodeAt(0))&&i.charCodeAt(1)===58:!1}function Hg(i){return N9(i,!0)}class Ggt{constructor(e){this._ignorePathCasing=e}compare(e,n,r=!1){return e===n?0:aP(this.getComparisonKey(e,r),this.getComparisonKey(n,r))}isEqual(e,n,r=!1){return e===n?!0:!e||!n?!1:this.getComparisonKey(e,r)===this.getComparisonKey(n,r)}getComparisonKey(e,n=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:n?null:void 0}).toString()}isEqualOrParent(e,n,r=!1){if(e.scheme===n.scheme){if(e.scheme===Pn.file)return $J(Hg(e),Hg(n),this._ignorePathCasing(e))&&e.query===n.query&&(r||e.fragment===n.fragment);if(Wge(e.authority,n.authority))return $J(e.path,n.path,this._ignorePathCasing(e),"/")&&e.query===n.query&&(r||e.fragment===n.fragment)}return!1}joinPath(e,...n){return Jt.joinPath(e,...n)}basenameOrAuthority(e){return yh(e)||e.authority}basename(e){return to.basename(e.path)}extname(e){return to.extname(e.path)}dirname(e){if(e.path.length===0)return e;let n;return e.scheme===Pn.file?n=Jt.file(W2e(Hg(e))).path:(n=to.dirname(e.path),e.authority&&n.length&&n.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),n="/")),e.with({path:n})}normalizePath(e){if(!e.path.length)return e;let n;return e.scheme===Pn.file?n=Jt.file(j2e(Hg(e))).path:n=to.normalize(e.path),e.with({path:n})}relativePath(e,n){if(e.scheme!==n.scheme||!Wge(e.authority,n.authority))return;if(e.scheme===Pn.file){const o=iot(Hg(e),Hg(n));return Aa?iTe(o):o}let r=e.path||"/";const s=n.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const a=Math.min(r.length,s.length);o<a&&!(r.charCodeAt(o)!==s.charCodeAt(o)&&r.charAt(o).toLowerCase()!==s.charAt(o).toLowerCase());o++);r=s.substr(0,o)+r.substr(o)}return to.relative(r,s)}resolvePath(e,n){if(e.scheme===Pn.file){const r=Jt.file(not(Hg(e),n));return e.with({authority:r.authority,path:r.path})}return n=qgt(n),e.with({path:to.resolve(e.path,n)})}isAbsolutePath(e){return!!e.path&&e.path[0]==="/"}isEqualAuthority(e,n){return e===n||e!==void 0&&n!==void 0&&n2(e,n)}hasTrailingPathSeparator(e,n=Wp){if(e.scheme===Pn.file){const r=Hg(e);return r.length>Bge(r).length&&r[r.length-1]===n}else{const r=e.path;return r.length>1&&r.charCodeAt(r.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,n=Wp){return $ge(e,n)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,n=Wp){let r=!1;if(e.scheme===Pn.file){const s=Hg(e);r=s!==void 0&&s.length===Bge(s).length&&s[s.length-1]===n}else{n="/";const s=e.path;r=s.length===1&&s.charCodeAt(s.length-1)===47}return!r&&!$ge(e,n)?e.with({path:e.path+"/"}):e}}const Er=new Ggt(()=>!1),Noe=Er.isEqual.bind(Er);Er.isEqualOrParent.bind(Er);Er.getComparisonKey.bind(Er);const Xgt=Er.basenameOrAuthority.bind(Er),yh=Er.basename.bind(Er),Ygt=Er.extname.bind(Er),M$=Er.dirname.bind(Er),Zgt=Er.joinPath.bind(Er),Qgt=Er.normalizePath.bind(Er),Jgt=Er.relativePath.bind(Er),jge=Er.resolvePath.bind(Er);Er.isAbsolutePath.bind(Er);const Wge=Er.isEqualAuthority.bind(Er),$ge=Er.hasTrailingPathSeparator.bind(Er);Er.removeTrailingPathSeparator.bind(Er);Er.addTrailingPathSeparator.bind(Er);var w1;(function(i){i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function e(n){const r=new Map;n.path.substring(n.path.indexOf(";")+1,n.path.lastIndexOf(";")).split(";").forEach(a=>{const[l,c]=a.split(":");l&&c&&r.set(l,c)});const o=n.path.substring(0,n.path.indexOf(";"));return o&&r.set(i.META_DATA_MIME,o),r}i.parseMetaData=e})(w1||(w1={}));function tD(i){return i.toString()}class Fo{static create(e,n){const r=e.getAlternativeVersionId(),s=zJ(e);return new Fo(r,r,s,s,n,n,[])}constructor(e,n,r,s,o,a,l){this.beforeVersionId=e,this.afterVersionId=n,this.beforeEOL=r,this.afterEOL=s,this.beforeCursorState=o,this.afterCursorState=a,this.changes=l}append(e,n,r,s,o){n.length>0&&(this.changes=Ugt(this.changes,n)),this.afterEOL=r,this.afterVersionId=s,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,n,r){if(gp(e,n?n.length:0,r),r+=4,n)for(const s of n)gp(e,s.selectionStartLineNumber,r),r+=4,gp(e,s.selectionStartColumn,r),r+=4,gp(e,s.positionLineNumber,r),r+=4,gp(e,s.positionColumn,r),r+=4;return r}static _readSelections(e,n,r){const s=pp(e,n);n+=4;for(let o=0;o<s;o++){const a=pp(e,n);n+=4;const l=pp(e,n);n+=4;const c=pp(e,n);n+=4;const u=pp(e,n);n+=4,r.push(new Ft(a,l,c,u))}return n}serialize(){let e=10+Fo._writeSelectionsSize(this.beforeCursorState)+Fo._writeSelectionsSize(this.afterCursorState)+4;for(const s of this.changes)e+=s.writeSize();const n=new Uint8Array(e);let r=0;gp(n,this.beforeVersionId,r),r+=4,gp(n,this.afterVersionId,r),r+=4,vpe(n,this.beforeEOL,r),r+=1,vpe(n,this.afterEOL,r),r+=1,r=Fo._writeSelections(n,this.beforeCursorState,r),r=Fo._writeSelections(n,this.afterCursorState,r),gp(n,this.changes.length,r),r+=4;for(const s of this.changes)r=s.write(n,r);return n.buffer}static deserialize(e){const n=new Uint8Array(e);let r=0;const s=pp(n,r);r+=4;const o=pp(n,r);r+=4;const a=_pe(n,r);r+=1;const l=_pe(n,r);r+=1;const c=[];r=Fo._readSelections(n,r,c);const u=[];r=Fo._readSelections(n,r,u);const d=pp(n,r);r+=4;const h=[];for(let f=0;f<d;f++)r=xa.read(n,r,h);return new Fo(s,o,a,l,c,u,h)}}class sTe{get type(){return 0}get resource(){return Jt.isUri(this.model)?this.model:this.model.uri}constructor(e,n,r,s){this.label=e,this.code=n,this.model=r,this._data=Fo.create(r,s)}toString(){return(this._data instanceof Fo?this._data:Fo.deserialize(this._data)).changes.map(n=>n.toString()).join(", ")}matchesResource(e){return(Jt.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Fo}append(e,n,r,s,o){this._data instanceof Fo&&this._data.append(e,n,r,s,o)}close(){this._data instanceof Fo&&(this._data=this._data.serialize())}open(){this._data instanceof Fo||(this._data=Fo.deserialize(this._data))}undo(){if(Jt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Fo&&(this._data=this._data.serialize());const e=Fo.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Jt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Fo&&(this._data=this._data.serialize());const e=Fo.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Fo&&(this._data=this._data.serialize()),this._data.byteLength+168}}class emt{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,n,r){this.label=e,this.code=n,this.type=1,this._isOpen=!0,this._editStackElementsArr=r.slice(0),this._editStackElementsMap=new Map;for(const s of this._editStackElementsArr){const o=tD(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const n=tD(e);return this._editStackElementsMap.has(n)}setModel(e){const n=tD(Jt.isUri(e)?e:e.uri);this._editStackElementsMap.has(n)&&this._editStackElementsMap.get(n).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const n=tD(e.uri);return this._editStackElementsMap.has(n)?this._editStackElementsMap.get(n).canAppend(e):!1}append(e,n,r,s,o){const a=tD(e.uri);this._editStackElementsMap.get(a).append(e,n,r,s,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const n=tD(e);return this._editStackElementsMap.has(n)?this._editStackElementsMap.get(n).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const n of this._editStackElementsArr)e.push(`${yh(n.resource)}: ${n}`);return`{${e.join(", ")}}`}}function zJ(i){return i.getEOL()===`
`?0:1}function A0(i){return i?i instanceof sTe||i instanceof emt:!1}class Moe{constructor(e,n){this._model=e,this._undoRedoService=n}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);A0(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);A0(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,n){const r=this._undoRedoService.getLastElement(this._model.uri);if(A0(r)&&r.canAppend(this._model))return r;const s=new sTe(L("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(s,n),s}pushEOL(e){const n=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),n.append(this._model,[],zJ(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,n,r,s){const o=this._getOrCreateEditStackElement(e,s),a=this._model.applyEdits(n,!0),l=Moe._computeCursorState(r,a),c=a.map((u,d)=>({index:d,textChange:u.textChange}));return c.sort((u,d)=>u.textChange.oldPosition===d.textChange.oldPosition?u.index-d.index:u.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,c.map(u=>u.textChange),zJ(this._model),this._model.getAlternativeVersionId(),l),l}static _computeCursorState(e,n){try{return e?e(n):null}catch(r){return Ln(r),null}}}class tmt{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function nmt(i,e,n,r,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let o;for(o=0;o<e&&o<r;o++){const f=i.charCodeAt(o),p=n.charCodeAt(o);if(f!==p)break}let a=0,l=0;for(let f=o;f<e;f++)i.charCodeAt(f)===32?a++:l++;let c=0,u=0;for(let f=o;f<r;f++)n.charCodeAt(f)===32?c++:u++;if(a>0&&l>0||c>0&&u>0)return;const d=Math.abs(l-u),h=Math.abs(a-c);if(d===0){s.spacesDiff=h,h>0&&0<=c-1&&c-1<i.length&&c<n.length&&n.charCodeAt(c)!==32&&i.charCodeAt(c-1)===32&&i.charCodeAt(i.length-1)===44&&(s.looksLikeAlignment=!0);return}if(h%d===0){s.spacesDiff=h/d;return}}function zge(i,e,n){const r=Math.min(i.getLineCount(),1e4);let s=0,o=0,a="",l=0;const c=[2,4,6,8,3,5,7],u=8,d=[0,0,0,0,0,0,0,0,0],h=new tmt;for(let g=1;g<=r;g++){const m=i.getLineLength(g),_=i.getLineContent(g),b=m<=65536;let y=!1,x=0,k=0,D=0;for(let E=0,A=m;E<A;E++){const M=b?_.charCodeAt(E):i.getLineCharCode(g,E);if(M===9)D++;else if(M===32)k++;else{y=!0,x=E;break}}if(!y||(D>0?s++:k>1&&o++,nmt(a,l,_,x,h),h.looksLikeAlignment&&!(n&&e===h.spacesDiff)))continue;const R=h.spacesDiff;R<=u&&d[R]++,a=_,l=x}let f=n;s!==o&&(f=s<o);let p=e;if(f){let g=f?0:.1*r;c.forEach(m=>{const _=d[m];_>g&&(g=_,p=m)}),p===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(p=2)}return{insertSpaces:f,tabSize:p}}function cc(i){return(i.metadata&1)>>>0}function kr(i,e){i.metadata=i.metadata&254|e<<0}function Ra(i){return(i.metadata&2)>>>1===1}function _r(i,e){i.metadata=i.metadata&253|(e?1:0)<<1}function oTe(i){return(i.metadata&4)>>>2===1}function Vge(i,e){i.metadata=i.metadata&251|(e?1:0)<<2}function aTe(i){return(i.metadata&64)>>>6===1}function Hge(i,e){i.metadata=i.metadata&191|(e?1:0)<<6}function imt(i){return(i.metadata&24)>>>3}function Uge(i,e){i.metadata=i.metadata&231|e<<3}function rmt(i){return(i.metadata&32)>>>5===1}function qge(i,e){i.metadata=i.metadata&223|(e?1:0)<<5}class lTe{constructor(e,n,r){this.metadata=0,this.parent=this,this.left=this,this.right=this,kr(this,1),this.start=n,this.end=r,this.delta=0,this.maxEnd=r,this.id=e,this.ownerId=0,this.options=null,Vge(this,!1),Hge(this,!1),Uge(this,1),qge(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=n,this.cachedAbsoluteEnd=r,this.range=null,_r(this,!1)}reset(e,n,r,s){this.start=n,this.end=r,this.maxEnd=r,this.cachedVersionId=e,this.cachedAbsoluteStart=n,this.cachedAbsoluteEnd=r,this.range=s}setOptions(e){this.options=e;const n=this.options.className;Vge(this,n==="squiggly-error"||n==="squiggly-warning"||n==="squiggly-info"),Hge(this,this.options.glyphMarginClassName!==null),Uge(this,this.options.stickiness),qge(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,n,r){this.cachedVersionId!==r&&(this.range=null),this.cachedVersionId=r,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=n}detach(){this.parent=null,this.left=null,this.right=null}}const Wn=new lTe(null,0,0);Wn.parent=Wn;Wn.left=Wn;Wn.right=Wn;kr(Wn,0);class Dq{constructor(){this.root=Wn,this.requestNormalizeDelta=!1}intervalSearch(e,n,r,s,o,a){return this.root===Wn?[]:hmt(this,e,n,r,s,o,a)}search(e,n,r,s){return this.root===Wn?[]:dmt(this,e,n,r,s)}collectNodesFromOwner(e){return cmt(this,e)}collectNodesPostOrder(){return umt(this)}insert(e){Kge(this,e),this._normalizeDeltaIfNecessary()}delete(e){Gge(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,n){const r=e;let s=0;for(;e!==this.root;)e===e.parent.right&&(s+=e.parent.delta),e=e.parent;const o=r.start+s,a=r.end+s;r.setCachedOffsets(o,a,n)}acceptReplace(e,n,r,s){const o=amt(this,e,e+n);for(let a=0,l=o.length;a<l;a++){const c=o[a];Gge(this,c)}this._normalizeDeltaIfNecessary(),lmt(this,e,e+n,r),this._normalizeDeltaIfNecessary();for(let a=0,l=o.length;a<l;a++){const c=o[a];c.start=c.cachedAbsoluteStart,c.end=c.cachedAbsoluteEnd,omt(c,e,e+n,r,s),c.maxEnd=c.end,Kge(this,c)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,smt(this))}}function smt(i){let e=i.root,n=0;for(;e!==Wn;){if(e.left!==Wn&&!Ra(e.left)){e=e.left;continue}if(e.right!==Wn&&!Ra(e.right)){n+=e.delta,e=e.right;continue}e.start=n+e.start,e.end=n+e.end,e.delta=0,C1(e),_r(e,!0),_r(e.left,!1),_r(e.right,!1),e===e.parent.right&&(n-=e.parent.delta),e=e.parent}_r(i.root,!1)}function nD(i,e,n,r){return i<n?!0:i>n||r===1?!1:r===2?!0:e}function omt(i,e,n,r,s){const o=imt(i),a=o===0||o===2,l=o===1||o===2,c=n-e,u=r,d=Math.min(c,u),h=i.start;let f=!1;const p=i.end;let g=!1;e<=h&&p<=n&&rmt(i)&&(i.start=e,f=!0,i.end=e,g=!0);{const _=s?1:c>0?2:0;!f&&nD(h,a,e,_)&&(f=!0),!g&&nD(p,l,e,_)&&(g=!0)}if(d>0&&!s){const _=c>u?2:0;!f&&nD(h,a,e+d,_)&&(f=!0),!g&&nD(p,l,e+d,_)&&(g=!0)}{const _=s?1:0;!f&&nD(h,a,n,_)&&(i.start=e+u,f=!0),!g&&nD(p,l,n,_)&&(i.end=e+u,g=!0)}const m=u-c;f||(i.start=Math.max(0,h+m)),g||(i.end=Math.max(0,p+m)),i.start>i.end&&(i.end=i.start)}function amt(i,e,n){let r=i.root,s=0,o=0,a=0,l=0;const c=[];let u=0;for(;r!==Wn;){if(Ra(r)){_r(r.left,!1),_r(r.right,!1),r===r.parent.right&&(s-=r.parent.delta),r=r.parent;continue}if(!Ra(r.left)){if(o=s+r.maxEnd,o<e){_r(r,!0);continue}if(r.left!==Wn){r=r.left;continue}}if(a=s+r.start,a>n){_r(r,!0);continue}if(l=s+r.end,l>=e&&(r.setCachedOffsets(a,l,0),c[u++]=r),_r(r,!0),r.right!==Wn&&!Ra(r.right)){s+=r.delta,r=r.right;continue}}return _r(i.root,!1),c}function lmt(i,e,n,r){let s=i.root,o=0,a=0,l=0;const c=r-(n-e);for(;s!==Wn;){if(Ra(s)){_r(s.left,!1),_r(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),C1(s),s=s.parent;continue}if(!Ra(s.left)){if(a=o+s.maxEnd,a<e){_r(s,!0);continue}if(s.left!==Wn){s=s.left;continue}}if(l=o+s.start,l>n){s.start+=c,s.end+=c,s.delta+=c,(s.delta<-1073741824||s.delta>1073741824)&&(i.requestNormalizeDelta=!0),_r(s,!0);continue}if(_r(s,!0),s.right!==Wn&&!Ra(s.right)){o+=s.delta,s=s.right;continue}}_r(i.root,!1)}function cmt(i,e){let n=i.root;const r=[];let s=0;for(;n!==Wn;){if(Ra(n)){_r(n.left,!1),_r(n.right,!1),n=n.parent;continue}if(n.left!==Wn&&!Ra(n.left)){n=n.left;continue}if(n.ownerId===e&&(r[s++]=n),_r(n,!0),n.right!==Wn&&!Ra(n.right)){n=n.right;continue}}return _r(i.root,!1),r}function umt(i){let e=i.root;const n=[];let r=0;for(;e!==Wn;){if(Ra(e)){_r(e.left,!1),_r(e.right,!1),e=e.parent;continue}if(e.left!==Wn&&!Ra(e.left)){e=e.left;continue}if(e.right!==Wn&&!Ra(e.right)){e=e.right;continue}n[r++]=e,_r(e,!0)}return _r(i.root,!1),n}function dmt(i,e,n,r,s){let o=i.root,a=0,l=0,c=0;const u=[];let d=0;for(;o!==Wn;){if(Ra(o)){_r(o.left,!1),_r(o.right,!1),o===o.parent.right&&(a-=o.parent.delta),o=o.parent;continue}if(o.left!==Wn&&!Ra(o.left)){o=o.left;continue}l=a+o.start,c=a+o.end,o.setCachedOffsets(l,c,r);let h=!0;if(e&&o.ownerId&&o.ownerId!==e&&(h=!1),n&&oTe(o)&&(h=!1),s&&!aTe(o)&&(h=!1),h&&(u[d++]=o),_r(o,!0),o.right!==Wn&&!Ra(o.right)){a+=o.delta,o=o.right;continue}}return _r(i.root,!1),u}function hmt(i,e,n,r,s,o,a){let l=i.root,c=0,u=0,d=0,h=0;const f=[];let p=0;for(;l!==Wn;){if(Ra(l)){_r(l.left,!1),_r(l.right,!1),l===l.parent.right&&(c-=l.parent.delta),l=l.parent;continue}if(!Ra(l.left)){if(u=c+l.maxEnd,u<e){_r(l,!0);continue}if(l.left!==Wn){l=l.left;continue}}if(d=c+l.start,d>n){_r(l,!0);continue}if(h=c+l.end,h>=e){l.setCachedOffsets(d,h,o);let g=!0;r&&l.ownerId&&l.ownerId!==r&&(g=!1),s&&oTe(l)&&(g=!1),a&&!aTe(l)&&(g=!1),g&&(f[p++]=l)}if(_r(l,!0),l.right!==Wn&&!Ra(l.right)){c+=l.delta,l=l.right;continue}}return _r(i.root,!1),f}function Kge(i,e){if(i.root===Wn)return e.parent=Wn,e.left=Wn,e.right=Wn,kr(e,0),i.root=e,i.root;fmt(i,e),Zb(e.parent);let n=e;for(;n!==i.root&&cc(n.parent)===1;)if(n.parent===n.parent.parent.left){const r=n.parent.parent.right;cc(r)===1?(kr(n.parent,0),kr(r,0),kr(n.parent.parent,1),n=n.parent.parent):(n===n.parent.right&&(n=n.parent,lM(i,n)),kr(n.parent,0),kr(n.parent.parent,1),cM(i,n.parent.parent))}else{const r=n.parent.parent.left;cc(r)===1?(kr(n.parent,0),kr(r,0),kr(n.parent.parent,1),n=n.parent.parent):(n===n.parent.left&&(n=n.parent,cM(i,n)),kr(n.parent,0),kr(n.parent.parent,1),lM(i,n.parent.parent))}return kr(i.root,0),e}function fmt(i,e){let n=0,r=i.root;const s=e.start,o=e.end;for(;;)if(gmt(s,o,r.start+n,r.end+n)<0)if(r.left===Wn){e.start-=n,e.end-=n,e.maxEnd-=n,r.left=e;break}else r=r.left;else if(r.right===Wn){e.start-=n+r.delta,e.end-=n+r.delta,e.maxEnd-=n+r.delta,r.right=e;break}else n+=r.delta,r=r.right;e.parent=r,e.left=Wn,e.right=Wn,kr(e,1)}function Gge(i,e){let n,r;if(e.left===Wn?(n=e.right,r=e,n.delta+=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta):e.right===Wn?(n=e.left,r=e):(r=pmt(e.right),n=r.right,n.start+=r.delta,n.end+=r.delta,n.delta+=r.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0),r.start+=e.delta,r.end+=e.delta,r.delta=e.delta,(r.delta<-1073741824||r.delta>1073741824)&&(i.requestNormalizeDelta=!0)),r===i.root){i.root=n,kr(n,0),e.detach(),Eq(),C1(n),i.root.parent=Wn;return}const s=cc(r)===1;if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===e?n.parent=r.parent:(r.parent===e?n.parent=r:n.parent=r.parent,r.left=e.left,r.right=e.right,r.parent=e.parent,kr(r,cc(e)),e===i.root?i.root=r:e===e.parent.left?e.parent.left=r:e.parent.right=r,r.left!==Wn&&(r.left.parent=r),r.right!==Wn&&(r.right.parent=r)),e.detach(),s){Zb(n.parent),r!==e&&(Zb(r),Zb(r.parent)),Eq();return}Zb(n),Zb(n.parent),r!==e&&(Zb(r),Zb(r.parent));let o;for(;n!==i.root&&cc(n)===0;)n===n.parent.left?(o=n.parent.right,cc(o)===1&&(kr(o,0),kr(n.parent,1),lM(i,n.parent),o=n.parent.right),cc(o.left)===0&&cc(o.right)===0?(kr(o,1),n=n.parent):(cc(o.right)===0&&(kr(o.left,0),kr(o,1),cM(i,o),o=n.parent.right),kr(o,cc(n.parent)),kr(n.parent,0),kr(o.right,0),lM(i,n.parent),n=i.root)):(o=n.parent.left,cc(o)===1&&(kr(o,0),kr(n.parent,1),cM(i,n.parent),o=n.parent.left),cc(o.left)===0&&cc(o.right)===0?(kr(o,1),n=n.parent):(cc(o.left)===0&&(kr(o.right,0),kr(o,1),lM(i,o),o=n.parent.left),kr(o,cc(n.parent)),kr(n.parent,0),kr(o.left,0),cM(i,n.parent),n=i.root));kr(n,0),Eq()}function pmt(i){for(;i.left!==Wn;)i=i.left;return i}function Eq(){Wn.parent=Wn,Wn.delta=0,Wn.start=0,Wn.end=0}function lM(i,e){const n=e.right;n.delta+=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,e.right=n.left,n.left!==Wn&&(n.left.parent=e),n.parent=e.parent,e.parent===Wn?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left=e,e.parent=n,C1(e),C1(n)}function cM(i,e){const n=e.left;e.delta-=n.delta,(e.delta<-1073741824||e.delta>1073741824)&&(i.requestNormalizeDelta=!0),e.start-=n.delta,e.end-=n.delta,e.left=n.right,n.right!==Wn&&(n.right.parent=e),n.parent=e.parent,e.parent===Wn?i.root=n:e===e.parent.right?e.parent.right=n:e.parent.left=n,n.right=e,e.parent=n,C1(e),C1(n)}function cTe(i){let e=i.end;if(i.left!==Wn){const n=i.left.maxEnd;n>e&&(e=n)}if(i.right!==Wn){const n=i.right.maxEnd+i.delta;n>e&&(e=n)}return e}function C1(i){i.maxEnd=cTe(i)}function Zb(i){for(;i!==Wn;){const e=cTe(i);if(i.maxEnd===e)return;i.maxEnd=e,i=i.parent}}function gmt(i,e,n,r){return i===n?e-r:i-n}class VJ{constructor(e,n){this.piece=e,this.color=n,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==xn)return Poe(this.right);let e=this;for(;e.parent!==xn&&e.parent.left!==e;)e=e.parent;return e.parent===xn?xn:e.parent}prev(){if(this.left!==xn)return uTe(this.left);let e=this;for(;e.parent!==xn&&e.parent.right!==e;)e=e.parent;return e.parent===xn?xn:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const xn=new VJ(null,0);xn.parent=xn;xn.left=xn;xn.right=xn;xn.color=0;function Poe(i){for(;i.left!==xn;)i=i.left;return i}function uTe(i){for(;i.right!==xn;)i=i.right;return i}function Ooe(i){return i===xn?0:i.size_left+i.piece.length+Ooe(i.right)}function Foe(i){return i===xn?0:i.lf_left+i.piece.lineFeedCnt+Foe(i.right)}function Iq(){xn.parent=xn}function uM(i,e){const n=e.right;n.size_left+=e.size_left+(e.piece?e.piece.length:0),n.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=n.left,n.left!==xn&&(n.left.parent=e),n.parent=e.parent,e.parent===xn?i.root=n:e.parent.left===e?e.parent.left=n:e.parent.right=n,n.left=e,e.parent=n}function dM(i,e){const n=e.left;e.left=n.right,n.right!==xn&&(n.right.parent=e),n.parent=e.parent,e.size_left-=n.size_left+(n.piece?n.piece.length:0),e.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),e.parent===xn?i.root=n:e===e.parent.right?e.parent.right=n:e.parent.left=n,n.right=e,e.parent=n}function n6(i,e){let n,r;if(e.left===xn?(r=e,n=r.right):e.right===xn?(r=e,n=r.left):(r=Poe(e.right),n=r.right),r===i.root){i.root=n,n.color=0,e.detach(),Iq(),i.root.parent=xn;return}const s=r.color===1;if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===e?(n.parent=r.parent,mN(i,n)):(r.parent===e?n.parent=r:n.parent=r.parent,mN(i,n),r.left=e.left,r.right=e.right,r.parent=e.parent,r.color=e.color,e===i.root?i.root=r:e===e.parent.left?e.parent.left=r:e.parent.right=r,r.left!==xn&&(r.left.parent=r),r.right!==xn&&(r.right.parent=r),r.size_left=e.size_left,r.lf_left=e.lf_left,mN(i,r)),e.detach(),n.parent.left===n){const a=Ooe(n),l=Foe(n);if(a!==n.parent.size_left||l!==n.parent.lf_left){const c=a-n.parent.size_left,u=l-n.parent.lf_left;n.parent.size_left=a,n.parent.lf_left=l,y0(i,n.parent,c,u)}}if(mN(i,n.parent),s){Iq();return}let o;for(;n!==i.root&&n.color===0;)n===n.parent.left?(o=n.parent.right,o.color===1&&(o.color=0,n.parent.color=1,uM(i,n.parent),o=n.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,n=n.parent):(o.right.color===0&&(o.left.color=0,o.color=1,dM(i,o),o=n.parent.right),o.color=n.parent.color,n.parent.color=0,o.right.color=0,uM(i,n.parent),n=i.root)):(o=n.parent.left,o.color===1&&(o.color=0,n.parent.color=1,dM(i,n.parent),o=n.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,n=n.parent):(o.left.color===0&&(o.right.color=0,o.color=1,uM(i,o),o=n.parent.left),o.color=n.parent.color,n.parent.color=0,o.left.color=0,dM(i,n.parent),n=i.root));n.color=0,Iq()}function Xge(i,e){for(mN(i,e);e!==i.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const n=e.parent.parent.right;n.color===1?(e.parent.color=0,n.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,uM(i,e)),e.parent.color=0,e.parent.parent.color=1,dM(i,e.parent.parent))}else{const n=e.parent.parent.left;n.color===1?(e.parent.color=0,n.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,dM(i,e)),e.parent.color=0,e.parent.parent.color=1,uM(i,e.parent.parent))}i.root.color=0}function y0(i,e,n,r){for(;e!==i.root&&e!==xn;)e.parent.left===e&&(e.parent.size_left+=n,e.parent.lf_left+=r),e=e.parent}function mN(i,e){let n=0,r=0;if(e!==i.root){for(;e!==i.root&&e===e.parent.right;)e=e.parent;if(e!==i.root)for(e=e.parent,n=Ooe(e.left)-e.size_left,r=Foe(e.left)-e.lf_left,e.size_left+=n,e.lf_left+=r;e!==i.root&&(n!==0||r!==0);)e.parent.left===e&&(e.parent.size_left+=n,e.parent.lf_left+=r),e=e.parent}}const Y_=65535;function dTe(i){let e;return i[i.length-1]<65536?e=new Uint16Array(i.length):e=new Uint32Array(i.length),e.set(i,0),e}class mmt{constructor(e,n,r,s,o){this.lineStarts=e,this.cr=n,this.lf=r,this.crlf=s,this.isBasicASCII=o}}function x0(i,e=!0){const n=[0];let r=1;for(let s=0,o=i.length;s<o;s++){const a=i.charCodeAt(s);a===13?s+1<o&&i.charCodeAt(s+1)===10?(n[r++]=s+2,s++):n[r++]=s+1:a===10&&(n[r++]=s+1)}return e?dTe(n):n}function _mt(i,e){i.length=0,i[0]=0;let n=1,r=0,s=0,o=0,a=!0;for(let c=0,u=e.length;c<u;c++){const d=e.charCodeAt(c);d===13?c+1<u&&e.charCodeAt(c+1)===10?(o++,i[n++]=c+2,c++):(r++,i[n++]=c+1):d===10?(s++,i[n++]=c+1):a&&d!==9&&(d<32||d>126)&&(a=!1)}const l=new mmt(dTe(i),r,s,o,a);return i.length=0,l}class Bc{constructor(e,n,r,s,o){this.bufferIndex=e,this.start=n,this.end=r,this.lineFeedCnt=s,this.length=o}}class ZC{constructor(e,n){this.buffer=e,this.lineStarts=n}}class vmt{constructor(e,n){this._pieces=[],this._tree=e,this._BOM=n,this._index=0,e.root!==xn&&e.iterate(e.root,r=>(r!==xn&&this._pieces.push(r.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class bmt{constructor(e){this._limit=e,this._cache=[]}get(e){for(let n=this._cache.length-1;n>=0;n--){const r=this._cache[n];if(r.nodeStartOffset<=e&&r.nodeStartOffset+r.node.piece.length>=e)return r}return null}get2(e){for(let n=this._cache.length-1;n>=0;n--){const r=this._cache[n];if(r.nodeStartLineNumber&&r.nodeStartLineNumber<e&&r.nodeStartLineNumber+r.node.piece.lineFeedCnt>=e)return r}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let n=!1;const r=this._cache;for(let s=0;s<r.length;s++){const o=r[s];if(o.node.parent===null||o.nodeStartOffset>=e){r[s]=null,n=!0;continue}}if(n){const s=[];for(const o of r)o!==null&&s.push(o);this._cache=s}}}class ymt{constructor(e,n,r){this.create(e,n,r)}create(e,n,r){this._buffers=[new ZC("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=xn,this._lineCnt=1,this._length=0,this._EOL=n,this._EOLLength=n.length,this._EOLNormalized=r;let s=null;for(let o=0,a=e.length;o<a;o++)if(e[o].buffer.length>0){e[o].lineStarts||(e[o].lineStarts=x0(e[o].buffer));const l=new Bc(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),s=this.rbInsertRight(s,l)}this._searchCache=new bmt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const n=Y_,r=n-Math.floor(n/3),s=r*2;let o="",a=0;const l=[];if(this.iterate(this.root,c=>{const u=this.getNodeContent(c),d=u.length;if(a<=r||a+d<s)return o+=u,a+=d,!0;const h=o.replace(/\r\n|\r|\n/g,e);return l.push(new ZC(h,x0(h))),o=u,a=d,!0}),a>0){const c=o.replace(/\r\n|\r|\n/g,e);l.push(new ZC(c,x0(c)))}this.create(l,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new vmt(this,e)}getOffsetAt(e,n){let r=0,s=this.root;for(;s!==xn;)if(s.left!==xn&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){r+=s.size_left;const o=this.getAccumulatedValue(s,e-s.lf_left-2);return r+=o+n-1}else e-=s.lf_left+s.piece.lineFeedCnt,r+=s.size_left+s.piece.length,s=s.right;return r}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let n=this.root,r=0;const s=e;for(;n!==xn;)if(n.size_left!==0&&n.size_left>=e)n=n.left;else if(n.size_left+n.piece.length>=e){const o=this.getIndexOf(n,e-n.size_left);if(r+=n.lf_left+o.index,o.index===0){const a=this.getOffsetAt(r+1,1),l=s-a;return new ve(r+1,l+1)}return new ve(r+1,o.remainder+1)}else if(e-=n.size_left+n.piece.length,r+=n.lf_left+n.piece.lineFeedCnt,n.right===xn){const o=this.getOffsetAt(r+1,1),a=s-e-o;return new ve(r+1,a+1)}else n=n.right;return new ve(1,1)}getValueInRange(e,n){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const r=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(r,s);return n?n!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,n):n===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,n):o}getValueInRange2(e,n){if(e.node===n.node){const l=e.node,c=this._buffers[l.piece.bufferIndex].buffer,u=this.offsetInBuffer(l.piece.bufferIndex,l.piece.start);return c.substring(u+e.remainder,u+n.remainder)}let r=e.node;const s=this._buffers[r.piece.bufferIndex].buffer,o=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);let a=s.substring(o+e.remainder,o+r.piece.length);for(r=r.next();r!==xn;){const l=this._buffers[r.piece.bufferIndex].buffer,c=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);if(r===n.node){a+=l.substring(c,c+n.remainder);break}else a+=l.substr(c,r.piece.length);r=r.next()}return a}getLinesContent(){const e=[];let n=0,r="",s=!1;return this.iterate(this.root,o=>{if(o===xn)return!0;const a=o.piece;let l=a.length;if(l===0)return!0;const c=this._buffers[a.bufferIndex].buffer,u=this._buffers[a.bufferIndex].lineStarts,d=a.start.line,h=a.end.line;let f=u[d]+a.start.column;if(s&&(c.charCodeAt(f)===10&&(f++,l--),e[n++]=r,r="",s=!1,l===0))return!0;if(d===h)return!this._EOLNormalized&&c.charCodeAt(f+l-1)===13?(s=!0,r+=c.substr(f,l-1)):r+=c.substr(f,l),!0;r+=this._EOLNormalized?c.substring(f,Math.max(f,u[d+1]-this._EOLLength)):c.substring(f,u[d+1]).replace(/(\r\n|\r|\n)$/,""),e[n++]=r;for(let p=d+1;p<h;p++)r=this._EOLNormalized?c.substring(u[p],u[p+1]-this._EOLLength):c.substring(u[p],u[p+1]).replace(/(\r\n|\r|\n)$/,""),e[n++]=r;return!this._EOLNormalized&&c.charCodeAt(u[h]+a.end.column-1)===13?(s=!0,a.end.column===0?n--:r=c.substr(u[h],a.end.column-1)):r=c.substr(u[h],a.end.column),!0}),s&&(e[n++]=r,r=""),e[n++]=r,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){const n=e.node.next();if(!n)return 0;const r=this._buffers[n.piece.bufferIndex],s=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r.buffer.charCodeAt(s)}else{const n=this._buffers[e.node.piece.bufferIndex],s=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return n.buffer.charCodeAt(s)}}getLineCharCode(e,n){const r=this.nodeAt2(e,n+1);return this._getCharCode(r)}getLineLength(e){if(e===this.getLineCount()){const n=this.getOffsetAt(e,1);return this.getLength()-n}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,n,r,s,o,a,l,c,u,d,h){const f=this._buffers[e.piece.bufferIndex],p=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),m=this.offsetInBuffer(e.piece.bufferIndex,a);let _;const b={line:0,column:0};let y,x;n._wordSeparators?(y=f.buffer.substring(g,m),x=k=>k+g,n.reset(0)):(y=f.buffer,x=k=>k,n.reset(g));do if(_=n.next(y),_){if(x(_.index)>=m)return d;this.positionInBuffer(e,x(_.index)-p,b);const k=this.getLineFeedCnt(e.piece.bufferIndex,o,b),D=b.line===o.line?b.column-o.column+s:b.column+1,R=D+_[0].length;if(h[d++]=UC(new J(r+k,D,r+k,R),_,c),x(_.index)+_[0].length>=m||d>=u)return d}while(_);return d}findMatchesLineByLine(e,n,r,s){const o=[];let a=0;const l=new s2(n.wordSeparators,n.regex);let c=this.nodeAt2(e.startLineNumber,e.startColumn);if(c===null)return[];const u=this.nodeAt2(e.endLineNumber,e.endColumn);if(u===null)return[];let d=this.positionInBuffer(c.node,c.remainder);const h=this.positionInBuffer(u.node,u.remainder);if(c.node===u.node)return this.findMatchesInNode(c.node,l,e.startLineNumber,e.startColumn,d,h,n,r,s,a,o),o;let f=e.startLineNumber,p=c.node;for(;p!==u.node;){const m=this.getLineFeedCnt(p.piece.bufferIndex,d,p.piece.end);if(m>=1){const b=this._buffers[p.piece.bufferIndex].lineStarts,y=this.offsetInBuffer(p.piece.bufferIndex,p.piece.start),x=b[d.line+m],k=f===e.startLineNumber?e.startColumn:1;if(a=this.findMatchesInNode(p,l,f,k,d,this.positionInBuffer(p,x-y),n,r,s,a,o),a>=s)return o;f+=m}const _=f===e.startLineNumber?e.startColumn-1:0;if(f===e.endLineNumber){const b=this.getLineContent(f).substring(_,e.endColumn-1);return a=this._findMatchesInLine(n,l,b,e.endLineNumber,_,a,o,r,s),o}if(a=this._findMatchesInLine(n,l,this.getLineContent(f).substr(_),f,_,a,o,r,s),a>=s)return o;f++,c=this.nodeAt2(f,1),p=c.node,d=this.positionInBuffer(c.node,c.remainder)}if(f===e.endLineNumber){const m=f===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(f).substring(m,e.endColumn-1);return a=this._findMatchesInLine(n,l,_,e.endLineNumber,m,a,o,r,s),o}const g=f===e.startLineNumber?e.startColumn:1;return a=this.findMatchesInNode(u.node,l,f,g,d,h,n,r,s,a,o),o}_findMatchesInLine(e,n,r,s,o,a,l,c,u){const d=e.wordSeparators;if(!c&&e.simpleSearch){const f=e.simpleSearch,p=f.length,g=r.length;let m=-p;for(;(m=r.indexOf(f,m+p))!==-1;)if((!d||toe(d,r,g,m,p))&&(l[a++]=new pP(new J(s,m+1+o,s,m+1+p+o),null),a>=u))return a;return a}let h;n.reset(0);do if(h=n.next(r),h&&(l[a++]=UC(new J(s,h.index+1+o,s,h.index+1+h[0].length+o),h,c),a>=u))return a;while(h);return a}insert(e,n,r=!1){if(this._EOLNormalized=this._EOLNormalized&&r,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==xn){const{node:s,remainder:o,nodeStartOffset:a}=this.nodeAt(e),l=s.piece,c=l.bufferIndex,u=this.positionInBuffer(s,o);if(s.piece.bufferIndex===0&&l.end.line===this._lastChangeBufferPos.line&&l.end.column===this._lastChangeBufferPos.column&&a+l.length===e&&n.length<Y_){this.appendToNode(s,n),this.computeBufferMetadata();return}if(a===e)this.insertContentToNodeLeft(n,s),this._searchCache.validate(e);else if(a+s.piece.length>e){const d=[];let h=new Bc(l.bufferIndex,u,l.end,this.getLineFeedCnt(l.bufferIndex,u,l.end),this.offsetInBuffer(c,l.end)-this.offsetInBuffer(c,u));if(this.shouldCheckCRLF()&&this.endWithCR(n)&&this.nodeCharCodeAt(s,o)===10){const m={line:h.start.line+1,column:0};h=new Bc(h.bufferIndex,m,h.end,this.getLineFeedCnt(h.bufferIndex,m,h.end),h.length-1),n+=`
`}if(this.shouldCheckCRLF()&&this.startWithLF(n))if(this.nodeCharCodeAt(s,o-1)===13){const m=this.positionInBuffer(s,o-1);this.deleteNodeTail(s,m),n="\r"+n,s.piece.length===0&&d.push(s)}else this.deleteNodeTail(s,u);else this.deleteNodeTail(s,u);const f=this.createNewPieces(n);h.length>0&&this.rbInsertRight(s,h);let p=s;for(let g=0;g<f.length;g++)p=this.rbInsertRight(p,f[g]);this.deleteNodes(d)}else this.insertContentToNodeRight(n,s)}else{const s=this.createNewPieces(n);let o=this.rbInsertLeft(null,s[0]);for(let a=1;a<s.length;a++)o=this.rbInsertRight(o,s[a])}this.computeBufferMetadata()}delete(e,n){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",n<=0||this.root===xn)return;const r=this.nodeAt(e),s=this.nodeAt(e+n),o=r.node,a=s.node;if(o===a){const f=this.positionInBuffer(o,r.remainder),p=this.positionInBuffer(o,s.remainder);if(r.nodeStartOffset===e){if(n===o.piece.length){const g=o.next();n6(this,o),this.validateCRLFWithPrevNode(g),this.computeBufferMetadata();return}this.deleteNodeHead(o,p),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),this.computeBufferMetadata();return}if(r.nodeStartOffset+o.piece.length===e+n){this.deleteNodeTail(o,f),this.validateCRLFWithNextNode(o),this.computeBufferMetadata();return}this.shrinkNode(o,f,p),this.computeBufferMetadata();return}const l=[],c=this.positionInBuffer(o,r.remainder);this.deleteNodeTail(o,c),this._searchCache.validate(e),o.piece.length===0&&l.push(o);const u=this.positionInBuffer(a,s.remainder);this.deleteNodeHead(a,u),a.piece.length===0&&l.push(a);const d=o.next();for(let f=d;f!==xn&&f!==a;f=f.next())l.push(f);const h=o.piece.length===0?o.prev():o;this.deleteNodes(l),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,n){const r=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(n)){const a=n.piece,l={line:a.start.line+1,column:0},c=new Bc(a.bufferIndex,l,a.end,this.getLineFeedCnt(a.bufferIndex,l,a.end),a.length-1);n.piece=c,e+=`
`,y0(this,n,-1,-1),n.piece.length===0&&r.push(n)}const s=this.createNewPieces(e);let o=this.rbInsertLeft(n,s[s.length-1]);for(let a=s.length-2;a>=0;a--)o=this.rbInsertLeft(o,s[a]);this.validateCRLFWithPrevNode(o),this.deleteNodes(r)}insertContentToNodeRight(e,n){this.adjustCarriageReturnFromNext(e,n)&&(e+=`
`);const r=this.createNewPieces(e),s=this.rbInsertRight(n,r[0]);let o=s;for(let a=1;a<r.length;a++)o=this.rbInsertRight(o,r[a]);this.validateCRLFWithPrevNode(s)}positionInBuffer(e,n,r){const s=e.piece,o=e.piece.bufferIndex,a=this._buffers[o].lineStarts,c=a[s.start.line]+s.start.column+n;let u=s.start.line,d=s.end.line,h=0,f=0,p=0;for(;u<=d&&(h=u+(d-u)/2|0,p=a[h],h!==d);)if(f=a[h+1],c<p)d=h-1;else if(c>=f)u=h+1;else break;return r?(r.line=h,r.column=c-p,null):{line:h,column:c-p}}getLineFeedCnt(e,n,r){if(r.column===0)return r.line-n.line;const s=this._buffers[e].lineStarts;if(r.line===s.length-1)return r.line-n.line;const o=s[r.line+1],a=s[r.line]+r.column;if(o>a+1)return r.line-n.line;const l=a-1;return this._buffers[e].buffer.charCodeAt(l)===13?r.line-n.line+1:r.line-n.line}offsetInBuffer(e,n){return this._buffers[e].lineStarts[n.line]+n.column}deleteNodes(e){for(let n=0;n<e.length;n++)n6(this,e[n])}createNewPieces(e){if(e.length>Y_){const d=[];for(;e.length>Y_;){const f=e.charCodeAt(Y_-1);let p;f===13||f>=55296&&f<=56319?(p=e.substring(0,Y_-1),e=e.substring(Y_-1)):(p=e.substring(0,Y_),e=e.substring(Y_));const g=x0(p);d.push(new Bc(this._buffers.length,{line:0,column:0},{line:g.length-1,column:p.length-g[g.length-1]},g.length-1,p.length)),this._buffers.push(new ZC(p,g))}const h=x0(e);return d.push(new Bc(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new ZC(e,h)),d}let n=this._buffers[0].buffer.length;const r=x0(e,!1);let s=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===n&&n!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},s=this._lastChangeBufferPos;for(let d=0;d<r.length;d++)r[d]+=n+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(r.slice(1)),this._buffers[0].buffer+="_"+e,n+=1}else{if(n!==0)for(let d=0;d<r.length;d++)r[d]+=n;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(r.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,a=this._buffers[0].lineStarts.length-1,l=o-this._buffers[0].lineStarts[a],c={line:a,column:l},u=new Bc(0,s,c,this.getLineFeedCnt(0,s,c),o-n);return this._lastChangeBufferPos=c,[u]}getLineRawContent(e,n=0){let r=this.root,s="";const o=this._searchCache.get2(e);if(o){r=o.node;const a=this.getAccumulatedValue(r,e-o.nodeStartLineNumber-1),l=this._buffers[r.piece.bufferIndex].buffer,c=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);if(o.nodeStartLineNumber+r.piece.lineFeedCnt===e)s=l.substring(c+a,c+r.piece.length);else{const u=this.getAccumulatedValue(r,e-o.nodeStartLineNumber);return l.substring(c+a,c+u-n)}}else{let a=0;const l=e;for(;r!==xn;)if(r.left!==xn&&r.lf_left>=e-1)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt>e-1){const c=this.getAccumulatedValue(r,e-r.lf_left-2),u=this.getAccumulatedValue(r,e-r.lf_left-1),d=this._buffers[r.piece.bufferIndex].buffer,h=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);return a+=r.size_left,this._searchCache.set({node:r,nodeStartOffset:a,nodeStartLineNumber:l-(e-1-r.lf_left)}),d.substring(h+c,h+u-n)}else if(r.lf_left+r.piece.lineFeedCnt===e-1){const c=this.getAccumulatedValue(r,e-r.lf_left-2),u=this._buffers[r.piece.bufferIndex].buffer,d=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);s=u.substring(d+c,d+r.piece.length);break}else e-=r.lf_left+r.piece.lineFeedCnt,a+=r.size_left+r.piece.length,r=r.right}for(r=r.next();r!==xn;){const a=this._buffers[r.piece.bufferIndex].buffer;if(r.piece.lineFeedCnt>0){const l=this.getAccumulatedValue(r,0),c=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);return s+=a.substring(c,c+l-n),s}else{const l=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);s+=a.substr(l,r.piece.length)}r=r.next()}return s}computeBufferMetadata(){let e=this.root,n=1,r=0;for(;e!==xn;)n+=e.lf_left+e.piece.lineFeedCnt,r+=e.size_left+e.piece.length,e=e.right;this._lineCnt=n,this._length=r,this._searchCache.validate(this._length)}getIndexOf(e,n){const r=e.piece,s=this.positionInBuffer(e,n),o=s.line-r.start.line;if(this.offsetInBuffer(r.bufferIndex,r.end)-this.offsetInBuffer(r.bufferIndex,r.start)===n){const a=this.getLineFeedCnt(e.piece.bufferIndex,r.start,s);if(a!==o)return{index:a,remainder:0}}return{index:o,remainder:s.column}}getAccumulatedValue(e,n){if(n<0)return 0;const r=e.piece,s=this._buffers[r.bufferIndex].lineStarts,o=r.start.line+n+1;return o>r.end.line?s[r.end.line]+r.end.column-s[r.start.line]-r.start.column:s[o]-s[r.start.line]-r.start.column}deleteNodeTail(e,n){const r=e.piece,s=r.lineFeedCnt,o=this.offsetInBuffer(r.bufferIndex,r.end),a=n,l=this.offsetInBuffer(r.bufferIndex,a),c=this.getLineFeedCnt(r.bufferIndex,r.start,a),u=c-s,d=l-o,h=r.length+d;e.piece=new Bc(r.bufferIndex,r.start,a,c,h),y0(this,e,d,u)}deleteNodeHead(e,n){const r=e.piece,s=r.lineFeedCnt,o=this.offsetInBuffer(r.bufferIndex,r.start),a=n,l=this.getLineFeedCnt(r.bufferIndex,a,r.end),c=this.offsetInBuffer(r.bufferIndex,a),u=l-s,d=o-c,h=r.length+d;e.piece=new Bc(r.bufferIndex,a,r.end,l,h),y0(this,e,d,u)}shrinkNode(e,n,r){const s=e.piece,o=s.start,a=s.end,l=s.length,c=s.lineFeedCnt,u=n,d=this.getLineFeedCnt(s.bufferIndex,s.start,u),h=this.offsetInBuffer(s.bufferIndex,n)-this.offsetInBuffer(s.bufferIndex,o);e.piece=new Bc(s.bufferIndex,s.start,u,d,h),y0(this,e,h-l,d-c);const f=new Bc(s.bufferIndex,r,a,this.getLineFeedCnt(s.bufferIndex,r,a),this.offsetInBuffer(s.bufferIndex,a)-this.offsetInBuffer(s.bufferIndex,r)),p=this.rbInsertRight(e,f);this.validateCRLFWithPrevNode(p)}appendToNode(e,n){this.adjustCarriageReturnFromNext(n,e)&&(n+=`
`);const r=this.shouldCheckCRLF()&&this.startWithLF(n)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=n;const o=x0(n,!1);for(let p=0;p<o.length;p++)o[p]+=s;if(r){const p=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:s-p}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const a=this._buffers[0].lineStarts.length-1,l=this._buffers[0].buffer.length-this._buffers[0].lineStarts[a],c={line:a,column:l},u=e.piece.length+n.length,d=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,c),f=h-d;e.piece=new Bc(e.piece.bufferIndex,e.piece.start,c,h,u),this._lastChangeBufferPos=c,y0(this,e,n.length,f)}nodeAt(e){let n=this.root;const r=this._searchCache.get(e);if(r)return{node:r.node,nodeStartOffset:r.nodeStartOffset,remainder:e-r.nodeStartOffset};let s=0;for(;n!==xn;)if(n.size_left>e)n=n.left;else if(n.size_left+n.piece.length>=e){s+=n.size_left;const o={node:n,remainder:e-n.size_left,nodeStartOffset:s};return this._searchCache.set(o),o}else e-=n.size_left+n.piece.length,s+=n.size_left+n.piece.length,n=n.right;return null}nodeAt2(e,n){let r=this.root,s=0;for(;r!==xn;)if(r.left!==xn&&r.lf_left>=e-1)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(r,e-r.lf_left-2),a=this.getAccumulatedValue(r,e-r.lf_left-1);return s+=r.size_left,{node:r,remainder:Math.min(o+n-1,a),nodeStartOffset:s}}else if(r.lf_left+r.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(r,e-r.lf_left-2);if(o+n-1<=r.piece.length)return{node:r,remainder:o+n-1,nodeStartOffset:s};n-=r.piece.length-o;break}else e-=r.lf_left+r.piece.lineFeedCnt,s+=r.size_left+r.piece.length,r=r.right;for(r=r.next();r!==xn;){if(r.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(r,0),a=this.offsetOfNode(r);return{node:r,remainder:Math.min(n-1,o),nodeStartOffset:a}}else if(r.piece.length>=n-1){const o=this.offsetOfNode(r);return{node:r,remainder:n-1,nodeStartOffset:o}}else n-=r.piece.length;r=r.next()}return null}nodeCharCodeAt(e,n){if(e.piece.lineFeedCnt<1)return-1;const r=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+n;return r.buffer.charCodeAt(s)}offsetOfNode(e){if(!e)return 0;let n=e.size_left;for(;e!==this.root;)e.parent.right===e&&(n+=e.parent.size_left+e.parent.piece.length),e=e.parent;return n}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===xn||e.piece.lineFeedCnt===0)return!1;const n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,s=n.start.line,o=r[s]+n.start.column;return s===r.length-1||r[s+1]>o+1?!1:this._buffers[n.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===xn||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const n=e.prev();this.endWithCR(n)&&this.fixCRLF(n,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const n=e.next();this.startWithLF(n)&&this.fixCRLF(e,n)}}fixCRLF(e,n){const r=[],s=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const a=e.piece.length-1,l=e.piece.lineFeedCnt-1;e.piece=new Bc(e.piece.bufferIndex,e.piece.start,o,l,a),y0(this,e,-1,-1),e.piece.length===0&&r.push(e);const c={line:n.piece.start.line+1,column:0},u=n.piece.length-1,d=this.getLineFeedCnt(n.piece.bufferIndex,c,n.piece.end);n.piece=new Bc(n.piece.bufferIndex,c,n.piece.end,d,u),y0(this,n,-1,-1),n.piece.length===0&&r.push(n);const h=this.createNewPieces(`\r
`);this.rbInsertRight(e,h[0]);for(let f=0;f<r.length;f++)n6(this,r[f])}adjustCarriageReturnFromNext(e,n){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const r=n.next();if(this.startWithLF(r)){if(e+=`
`,r.piece.length===1)n6(this,r);else{const s=r.piece,o={line:s.start.line+1,column:0},a=s.length-1,l=this.getLineFeedCnt(s.bufferIndex,o,s.end);r.piece=new Bc(s.bufferIndex,o,s.end,l,a),y0(this,r,-1,-1)}return!0}}return!1}iterate(e,n){if(e===xn)return n(xn);const r=this.iterate(e.left,n);return r&&n(e)&&this.iterate(e.right,n)}getNodeContent(e){if(e===xn)return"";const n=this._buffers[e.piece.bufferIndex],r=e.piece,s=this.offsetInBuffer(r.bufferIndex,r.start),o=this.offsetInBuffer(r.bufferIndex,r.end);return n.buffer.substring(s,o)}getPieceContent(e){const n=this._buffers[e.bufferIndex],r=this.offsetInBuffer(e.bufferIndex,e.start),s=this.offsetInBuffer(e.bufferIndex,e.end);return n.buffer.substring(r,s)}rbInsertRight(e,n){const r=new VJ(n,1);if(r.left=xn,r.right=xn,r.parent=xn,r.size_left=0,r.lf_left=0,this.root===xn)this.root=r,r.color=0;else if(e.right===xn)e.right=r,r.parent=e;else{const o=Poe(e.right);o.left=r,r.parent=o}return Xge(this,r),r}rbInsertLeft(e,n){const r=new VJ(n,1);if(r.left=xn,r.right=xn,r.parent=xn,r.size_left=0,r.lf_left=0,this.root===xn)this.root=r,r.color=0;else if(e.left===xn)e.left=r,r.parent=e;else{const s=uTe(e.left);s.right=r,r.parent=s}return Xge(this,r),r}}class Z2 extends Le{constructor(e,n,r,s,o,a,l){super(),this._onDidChangeContent=this._register(new _e),this._BOM=n,this._mightContainNonBasicASCII=!a,this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._pieceTree=new ymt(e,r,l)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,n){return this._pieceTree.getOffsetAt(e,n)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,n){const r=e+n,s=this.getPositionAt(e),o=this.getPositionAt(r);return new J(s.lineNumber,s.column,o.lineNumber,o.column)}getValueInRange(e,n=0){if(e.isEmpty())return"";const r=this._getEndOfLine(n);return this._pieceTree.getValueInRange(e,r)}getValueLengthInRange(e,n=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const r=this.getOffsetAt(e.startLineNumber,e.startColumn),s=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const a=this._getEndOfLine(n),l=this.getEOL();if(a.length!==l.length){const c=a.length-l.length,u=e.endLineNumber-e.startLineNumber;o=c*u}return s-r+o}getCharacterCountInRange(e,n=0){if(this._mightContainNonBasicASCII){let r=0;const s=e.startLineNumber,o=e.endLineNumber;for(let a=s;a<=o;a++){const l=this.getLineContent(a),c=a===s?e.startColumn-1:0,u=a===o?e.endColumn-1:l.length;for(let d=c;d<u;d++)xo(l.charCodeAt(d))?(r=r+1,d=d+1):r=r+1}return r+=this._getEndOfLine(n).length*(o-s),r}return this.getValueLengthInRange(e,n)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,n){return this._pieceTree.getLineCharCode(e,n)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const n=ml(this.getLineContent(e));return n===-1?0:n+1}getLineLastNonWhitespaceColumn(e){const n=$p(this.getLineContent(e));return n===-1?0:n+2}_getEndOfLine(e){switch(e){case 1:return`
`;case 2:return`\r
`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,n,r){let s=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,a=this._mightContainNonBasicASCII,l=!0,c=[];for(let m=0;m<e.length;m++){const _=e[m];l&&_._isTracked&&(l=!1);const b=_.range;if(_.text){let R=!0;a||(R=!k5(_.text),a=R),!s&&R&&(s=TE(_.text)),!o&&R&&(o=Q2e(_.text))}let y="",x=0,k=0,D=0;if(_.text){let R;[x,k,D,R]=y1(_.text);const E=this.getEOL();R===0||R===(E===`\r
`?2:1)?y=_.text:y=_.text.replace(/\r\n|\r|\n/g,E)}c[m]={sortIndex:m,identifier:_.identifier||null,range:b,rangeOffset:this.getOffsetAt(b.startLineNumber,b.startColumn),rangeLength:this.getValueLengthInRange(b),text:y,eolCount:x,firstLineLength:k,lastLineLength:D,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}c.sort(Z2._sortOpsAscending);let u=!1;for(let m=0,_=c.length-1;m<_;m++){const b=c[m].range.getEndPosition(),y=c[m+1].range.getStartPosition();if(y.isBeforeOrEqual(b)){if(y.isBefore(b))throw new Error("Overlapping ranges are not allowed!");u=!0}}l&&(c=this._reduceOperations(c));const d=r||n?Z2._getInverseEditRanges(c):[],h=[];if(n)for(let m=0;m<c.length;m++){const _=c[m],b=d[m];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let y=b.startLineNumber;y<=b.endLineNumber;y++){let x="";y===b.startLineNumber&&(x=this.getLineContent(_.range.startLineNumber),ml(x)!==-1)||h.push({lineNumber:y,oldContent:x})}}let f=null;if(r){let m=0;f=[];for(let _=0;_<c.length;_++){const b=c[_],y=d[_],x=this.getValueInRange(b.range),k=b.rangeOffset+m;m+=b.text.length-x.length,f[_]={sortIndex:b.sortIndex,identifier:b.identifier,range:y,text:x,textChange:new xa(b.rangeOffset,x,k,b.text)}}u||f.sort((_,b)=>_.sortIndex-b.sortIndex)}this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=a;const p=this._doApplyEdits(c);let g=null;if(n&&h.length>0){h.sort((m,_)=>_.lineNumber-m.lineNumber),g=[];for(let m=0,_=h.length;m<_;m++){const b=h[m].lineNumber;if(m>0&&h[m-1].lineNumber===b)continue;const y=h[m].oldContent,x=this.getLineContent(b);x.length===0||x===y||ml(x)!==-1||g.push(b)}}return this._onDidChangeContent.fire(),new Dct(f,p,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let n=!1;const r=e[0].range,s=e[e.length-1].range,o=new J(r.startLineNumber,r.startColumn,s.endLineNumber,s.endColumn);let a=r.startLineNumber,l=r.startColumn;const c=[];for(let p=0,g=e.length;p<g;p++){const m=e[p],_=m.range;n=n||m.forceMoveMarkers,c.push(this.getValueInRange(new J(a,l,_.startLineNumber,_.startColumn))),m.text.length>0&&c.push(m.text),a=_.endLineNumber,l=_.endColumn}const u=c.join(""),[d,h,f]=y1(u);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:u,eolCount:d,firstLineLength:h,lastLineLength:f,forceMoveMarkers:n,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Z2._sortOpsDescending);const n=[];for(let r=0;r<e.length;r++){const s=e[r],o=s.range.startLineNumber,a=s.range.startColumn,l=s.range.endLineNumber,c=s.range.endColumn;if(o===l&&a===c&&s.text.length===0)continue;s.text?(this._pieceTree.delete(s.rangeOffset,s.rangeLength),this._pieceTree.insert(s.rangeOffset,s.text,!0)):this._pieceTree.delete(s.rangeOffset,s.rangeLength);const u=new J(o,a,l,c);n.push({range:u,rangeLength:s.rangeLength,text:s.text,rangeOffset:s.rangeOffset,forceMoveMarkers:s.forceMoveMarkers})}return n}findMatchesLineByLine(e,n,r,s){return this._pieceTree.findMatchesLineByLine(e,n,r,s)}static _getInverseEditRanges(e){const n=[];let r=0,s=0,o=null;for(let a=0,l=e.length;a<l;a++){const c=e[a];let u,d;o?o.range.endLineNumber===c.range.startLineNumber?(u=r,d=s+(c.range.startColumn-o.range.endColumn)):(u=r+(c.range.startLineNumber-o.range.endLineNumber),d=c.range.startColumn):(u=c.range.startLineNumber,d=c.range.startColumn);let h;if(c.text.length>0){const f=c.eolCount+1;f===1?h=new J(u,d,u,d+c.firstLineLength):h=new J(u,d,u+f-1,c.lastLineLength+1)}else h=new J(u,d,u,d);r=h.endLineNumber,s=h.endColumn,n.push(h),o=c}return n}static _sortOpsAscending(e,n){const r=J.compareRangesUsingEnds(e.range,n.range);return r===0?e.sortIndex-n.sortIndex:r}static _sortOpsDescending(e,n){const r=J.compareRangesUsingEnds(e.range,n.range);return r===0?n.sortIndex-e.sortIndex:-r}}class wmt{constructor(e,n,r,s,o,a,l,c,u){this._chunks=e,this._bom=n,this._cr=r,this._lf=s,this._crlf=o,this._containsRTL=a,this._containsUnusualLineTerminators=l,this._isBasicASCII=c,this._normalizeEOL=u}_getEOL(e){const n=this._cr+this._lf+this._crlf,r=this._cr+this._crlf;return n===0?e===1?`
`:`\r
`:r>n/2?`\r
`:`
`}create(e){const n=this._getEOL(e),r=this._chunks;if(this._normalizeEOL&&(n===`\r
`&&(this._cr>0||this._lf>0)||n===`
`&&(this._cr>0||this._crlf>0)))for(let o=0,a=r.length;o<a;o++){const l=r[o].buffer.replace(/\r\n|\r|\n/g,n),c=x0(l);r[o]=new ZC(l,c)}const s=new Z2(r,this._bom,n,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:s,disposable:s}}}class hTe{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&Use(e)&&(this.BOM=Iot,e=e.substr(1));const n=e.charCodeAt(e.length-1);n===13||n>=55296&&n<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=n):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=n)}_acceptChunk1(e,n){!n&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const n=_mt(this._tmpLineStarts,e);this.chunks.push(new ZC(e,n.lineStarts)),this.cr+=n.cr,this.lf+=n.lf,this.crlf+=n.crlf,n.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=TE(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Q2e(e)))}finish(e=!0){return this._finish(),new wmt(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const n=x0(e.buffer);e.lineStarts=n,this._previousChar===13&&this.cr++}}}class Cmt{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,n){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=n}replace(e,n,r){if(e>=this._store.length)return;if(n===0){this.insert(e,r);return}else if(r===0){this.delete(e,n);return}const s=this._store.slice(0,e),o=this._store.slice(e+n),a=Smt(r,this._default);this._store=s.concat(a,o)}delete(e,n){n===0||e>=this._store.length||this._store.splice(e,n)}insert(e,n){if(n===0||e>=this._store.length)return;const r=[];for(let s=0;s<n;s++)r[s]=this._default;this._store=GW(this._store,e,r)}}function Smt(i,e){const n=[];for(let r=0;r<i;r++)n[r]=e;return n}class xmt{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,n){this._startLineNumber=e,this._tokens=n}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class HJ{constructor(){this._tokens=[]}add(e,n){if(this._tokens.length>0){const r=this._tokens[this._tokens.length-1];if(r.endLineNumber+1===e){r.appendLineTokens(n);return}}this._tokens.push(new xmt(e,[n]))}finalize(){return this._tokens}}class kmt{constructor(e,n){this.tokenizationSupport=n,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new UJ(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class Lmt extends kmt{constructor(e,n,r,s){super(e,n),this._textModel=r,this._languageIdCodec=s}updateTokensUntilLine(e,n){const r=this._textModel.getLanguageId();for(;;){const s=this.getFirstInvalidLine();if(!s||s.lineNumber>n)break;const o=this._textModel.getLineContent(s.lineNumber),a=YR(this._languageIdCodec,r,this.tokenizationSupport,o,!0,s.startState);e.add(s.lineNumber,a.tokens),this.store.setEndState(s.lineNumber,a.endState)}}getTokenTypeIfInsertingCharacter(e,n){const r=this.getStartState(e.lineNumber);if(!r)return 0;const s=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),a=o.substring(0,e.column-1)+n+o.substring(e.column-1),l=YR(this._languageIdCodec,s,this.tokenizationSupport,a,!0,r),c=new ko(l.tokens,a,this._languageIdCodec);if(c.getCount()===0)return 0;const u=c.findTokenIndexAtOffset(e.column-1);return c.getStandardTokenType(u)}tokenizeLineWithEdit(e,n,r){const s=e.lineNumber,o=e.column,a=this.getStartState(s);if(!a)return null;const l=this._textModel.getLineContent(s),c=l.substring(0,o-1)+r+l.substring(o-1+n),u=this._textModel.getLanguageIdAtPosition(s,0),d=YR(this._languageIdCodec,u,this.tokenizationSupport,c,!0,a);return new ko(d.tokens,c,this._languageIdCodec)}isCheapToTokenize(e){const n=this.store.getFirstInvalidEndStateLineNumberOrMax();return e<n||e===n&&this._textModel.getLineLength(e)<2048}tokenizeHeuristically(e,n,r){if(r<=this.store.getFirstInvalidEndStateLineNumberOrMax())return{heuristicTokens:!1};if(n<=this.store.getFirstInvalidEndStateLineNumberOrMax())return this.updateTokensUntilLine(e,r),{heuristicTokens:!1};let s=this.guessStartState(n);const o=this._textModel.getLanguageId();for(let a=n;a<=r;a++){const l=this._textModel.getLineContent(a),c=YR(this._languageIdCodec,o,this.tokenizationSupport,l,!0,s);e.add(a,c.tokens),s=c.endState}return{heuristicTokens:!0}}guessStartState(e){let n=this._textModel.getLineFirstNonWhitespaceColumn(e);const r=[];let s=null;for(let l=e-1;n>1&&l>=1;l--){const c=this._textModel.getLineFirstNonWhitespaceColumn(l);if(c!==0&&c<n&&(r.push(this._textModel.getLineContent(l)),n=c,s=this.getStartState(l),s))break}s||(s=this.tokenizationSupport.getInitialState()),r.reverse();const o=this._textModel.getLanguageId();let a=s;for(const l of r)a=YR(this._languageIdCodec,o,this.tokenizationSupport,l,!1,a).endState;return a}}class UJ{constructor(e){this.lineCount=e,this._tokenizationStateStore=new Dmt,this._invalidEndStatesLineNumbers=new Emt,this._invalidEndStatesLineNumbers.addRange(new Un(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,n){if(!n)throw new Vs("Cannot set null/undefined state");this._invalidEndStatesLineNumbers.delete(e);const r=this._tokenizationStateStore.setEndState(e,n);return r&&e<this.lineCount&&this._invalidEndStatesLineNumbers.addRange(new Un(e+1,e+2)),r}acceptChange(e,n){this.lineCount+=n-e.length,this._tokenizationStateStore.acceptChange(e,n),this._invalidEndStatesLineNumbers.addRangeAndResize(new Un(e.startLineNumber,e.endLineNumberExclusive),n)}acceptChanges(e){for(const n of e){const[r]=y1(n.text);this.acceptChange(new Qn(n.range.startLineNumber,n.range.endLineNumber+1),r+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new Un(e.startLineNumber,e.endLineNumberExclusive))}getFirstInvalidEndStateLineNumber(){return this._invalidEndStatesLineNumbers.min}getFirstInvalidEndStateLineNumberOrMax(){return this.getFirstInvalidEndStateLineNumber()||Number.MAX_SAFE_INTEGER}allStatesValid(){return this._invalidEndStatesLineNumbers.min===null}getStartState(e,n){return e===1?n:this.getEndState(e-1)}getFirstInvalidLine(e){const n=this.getFirstInvalidEndStateLineNumber();if(n===null)return null;const r=this.getStartState(n,e);if(!r)throw new Vs("Start state must be defined");return{lineNumber:n,startState:r}}}class Dmt{constructor(){this._lineEndStates=new Cmt(null)}getEndState(e){return this._lineEndStates.get(e)}setEndState(e,n){const r=this._lineEndStates.get(e);return r&&r.equals(n)?!1:(this._lineEndStates.set(e,n),!0)}acceptChange(e,n){let r=e.length;n>0&&r>0&&(r--,n--),this._lineEndStates.replace(e.startLineNumber,r,n)}}class Emt{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const n=this._ranges.findIndex(r=>r.contains(e));if(n!==-1){const r=this._ranges[n];r.start===e?r.endExclusive===e+1?this._ranges.splice(n,1):this._ranges[n]=new Un(e+1,r.endExclusive):r.endExclusive===e+1?this._ranges[n]=new Un(r.start,e):this._ranges.splice(n,1,new Un(r.start,e),new Un(e+1,r.endExclusive))}}addRange(e){Un.addRange(e,this._ranges)}addRangeAndResize(e,n){let r=0;for(;!(r>=this._ranges.length||e.start<=this._ranges[r].endExclusive);)r++;let s=r;for(;!(s>=this._ranges.length||e.endExclusive<this._ranges[s].start);)s++;const o=n-e.length;for(let a=s;a<this._ranges.length;a++)this._ranges[a]=this._ranges[a].delta(o);if(r===s){const a=new Un(e.start,e.start+n);a.isEmpty||this._ranges.splice(r,0,a)}else{const a=Math.min(e.start,this._ranges[r].start),l=Math.max(e.endExclusive,this._ranges[s-1].endExclusive),c=new Un(a,l+o);c.isEmpty?this._ranges.splice(r,s-r):this._ranges.splice(r,s-r,c)}}toString(){return this._ranges.map(e=>e.toString()).join(" + ")}}function YR(i,e,n,r,s,o){let a=null;if(n)try{a=n.tokenizeEncoded(r,s,o.clone())}catch(l){Ln(l)}return a||(a=C$(i.encodeLanguageId(e),o)),ko.convertToEndOffset(a.tokens,r.length),a}class Imt{constructor(e,n){this._tokenizerWithStateStore=e,this._backgroundTokenStore=n,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,Z0(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const n=Date.now()+e.timeRemaining(),r=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()<n?S2e(r):this._beginBackgroundTokenization())};r()}_backgroundTokenizeForAtLeast1ms(){const e=this._tokenizerWithStateStore._textModel.getLineCount(),n=new HJ,r=Xa.create(!1);do if(r.elapsed()>1||this._tokenizeOneInvalidLine(n)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(n.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var n;const r=(n=this._tokenizerWithStateStore)===null||n===void 0?void 0:n.getFirstInvalidLine();return r?(this._tokenizerWithStateStore.updateTokensUntilLine(e,r.lineNumber),r.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,n){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Qn(e,n))}}const k0=new Uint32Array(0).buffer;class Qg{static deleteBeginning(e,n){return e===null||e===k0?e:Qg.delete(e,0,n)}static deleteEnding(e,n){if(e===null||e===k0)return e;const r=H0(e),s=r[r.length-2];return Qg.delete(e,n,s)}static delete(e,n,r){if(e===null||e===k0||n===r)return e;const s=H0(e),o=s.length>>>1;if(n===0&&s[s.length-2]===r)return k0;const a=ko.findIndexInTokensArray(s,n),l=a>0?s[a-1<<1]:0,c=s[a<<1];if(r<c){const p=r-n;for(let g=a;g<o;g++)s[g<<1]-=p;return e}let u,d;l!==n?(s[a<<1]=n,u=a+1<<1,d=n):(u=a<<1,d=l);const h=r-n;for(let p=a+1;p<o;p++){const g=s[p<<1]-h;g>d&&(s[u++]=g,s[u++]=s[(p<<1)+1],d=g)}if(u===s.length)return e;const f=new Uint32Array(u);return f.set(s.subarray(0,u),0),f.buffer}static append(e,n){if(n===k0)return e;if(e===k0)return n;if(e===null)return e;if(n===null)return null;const r=H0(e),s=H0(n),o=s.length>>>1,a=new Uint32Array(r.length+s.length);a.set(r,0);let l=r.length;const c=r[r.length-2];for(let u=0;u<o;u++)a[l++]=s[u<<1]+c,a[l++]=s[(u<<1)+1];return a.buffer}static insert(e,n,r){if(e===null||e===k0)return e;const s=H0(e),o=s.length>>>1;let a=ko.findIndexInTokensArray(s,n);a>0&&s[a-1<<1]===n&&a--;for(let l=a;l<o;l++)s[l<<1]+=r;return e}}function H0(i){return i instanceof Uint32Array?i:new Uint32Array(i)}class FP{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,n,r){let s=null;if(n<this._len&&(s=this._lineTokens[n]),s!==null&&s!==k0)return new ko(H0(s),r,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=r.length,o[1]=Yge(this._languageIdCodec.encodeLanguageId(e)),new ko(o,r,this._languageIdCodec)}static _massageTokens(e,n,r){const s=r?H0(r):null;if(n===0){let o=!1;if(s&&s.length>1&&(o=Da.getLanguageId(s[1])!==e),!o)return k0}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=n,o[1]=Yge(e),o.buffer}return s[s.length-2]=n,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,n){n!==0&&(e+n>this._len&&(n=this._len-e),this._lineTokens.splice(e,n),this._len-=n)}_insertLines(e,n){if(n===0)return;const r=[];for(let s=0;s<n;s++)r[s]=null;this._lineTokens=GW(this._lineTokens,e,r),this._len+=n}setTokens(e,n,r,s,o){const a=FP._massageTokens(this._languageIdCodec.encodeLanguageId(e),r,s);this._ensureLine(n);const l=this._lineTokens[n];return this._lineTokens[n]=a,o?!FP._equals(l,a):!1}static _equals(e,n){if(!e||!n)return!e&&!n;const r=H0(e),s=H0(n);if(r.length!==s.length)return!1;for(let o=0,a=r.length;o<a;o++)if(r[o]!==s[o])return!1;return!0}acceptEdit(e,n,r){this._acceptDeleteRange(e),this._acceptInsertText(new ve(e.startLineNumber,e.startColumn),n,r)}_acceptDeleteRange(e){const n=e.startLineNumber-1;if(n>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[n]=Qg.delete(this._lineTokens[n],e.startColumn-1,e.endColumn-1);return}this._lineTokens[n]=Qg.deleteEnding(this._lineTokens[n],e.startColumn-1);const r=e.endLineNumber-1;let s=null;r<this._len&&(s=Qg.deleteBeginning(this._lineTokens[r],e.endColumn-1)),this._lineTokens[n]=Qg.append(this._lineTokens[n],s),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,n,r){if(n===0&&r===0)return;const s=e.lineNumber-1;if(!(s>=this._len)){if(n===0){this._lineTokens[s]=Qg.insert(this._lineTokens[s],e.column-1,r);return}this._lineTokens[s]=Qg.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=Qg.insert(this._lineTokens[s],e.column-1,r),this._insertLines(e.lineNumber,n)}}setMultilineTokens(e,n){if(e.length===0)return{changes:[]};const r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s];let l=0,c=0,u=!1;for(let d=a.startLineNumber;d<=a.endLineNumber;d++)u?(this.setTokens(n.getLanguageId(),d-1,n.getLineLength(d),a.getLineTokens(d),!1),c=d):this.setTokens(n.getLanguageId(),d-1,n.getLineLength(d),a.getLineTokens(d),!0)&&(u=!0,l=d,c=d);u&&r.push({fromLineNumber:l,toLineNumber:c})}return{changes:r}}}function Yge(i){return(i<<0|0|0|32768|2<<24|1024)>>>0}class Boe{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,n){this._pieces=e||[],this._isComplete=n}setPartial(e,n){let r=e;if(n.length>0){const o=n[0].getRange(),a=n[n.length-1].getRange();if(!o||!a)return e;r=e.plusRange(o).plusRange(a)}let s=null;for(let o=0,a=this._pieces.length;o<a;o++){const l=this._pieces[o];if(l.endLineNumber<r.startLineNumber)continue;if(l.startLineNumber>r.endLineNumber){s=s||{index:o};break}if(l.removeTokens(r),l.isEmpty()){this._pieces.splice(o,1),o--,a--;continue}if(l.endLineNumber<r.startLineNumber)continue;if(l.startLineNumber>r.endLineNumber){s=s||{index:o};continue}const[c,u]=l.split(r);if(c.isEmpty()){s=s||{index:o};continue}u.isEmpty()||(this._pieces.splice(o,1,c,u),o++,a++,s=s||{index:o})}return s=s||{index:this._pieces.length},n.length>0&&(this._pieces=GW(this._pieces,s.index,n)),r}isComplete(){return this._isComplete}addSparseTokens(e,n){if(n.getLineContent().length===0)return n;const r=this._pieces;if(r.length===0)return n;const s=Boe._findFirstPieceWithLine(r,e),o=r[s].getLineTokens(e);if(!o)return n;const a=n.getCount(),l=o.getCount();let c=0;const u=[];let d=0,h=0;const f=(p,g)=>{p!==h&&(h=p,u[d++]=p,u[d++]=g)};for(let p=0;p<l;p++){const g=o.getStartCharacter(p),m=o.getEndCharacter(p),_=o.getMetadata(p),b=((_&1?2048:0)|(_&2?4096:0)|(_&4?8192:0)|(_&8?16384:0)|(_&16?16744448:0)|(_&32?4278190080:0))>>>0,y=~b>>>0;for(;c<a&&n.getEndOffset(c)<=g;)f(n.getEndOffset(c),n.getMetadata(c)),c++;for(c<a&&n.getStartOffset(c)<g&&f(g,n.getMetadata(c));c<a&&n.getEndOffset(c)<m;)f(n.getEndOffset(c),n.getMetadata(c)&y|_&b),c++;if(c<a)f(m,n.getMetadata(c)&y|_&b),n.getEndOffset(c)===m&&c++;else{const x=Math.min(Math.max(0,c-1),a-1);f(m,n.getMetadata(x)&y|_&b)}}for(;c<a;)f(n.getEndOffset(c),n.getMetadata(c)),c++;return new ko(new Uint32Array(u),n.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,n){let r=0,s=e.length-1;for(;r<s;){let o=r+Math.floor((s-r)/2);if(e[o].endLineNumber<n)r=o+1;else if(e[o].startLineNumber>n)s=o-1;else{for(;o>r&&e[o-1].startLineNumber<=n&&n<=e[o-1].endLineNumber;)o--;return o}}return r}acceptEdit(e,n,r,s,o){for(const a of this._pieces)a.acceptEdit(e,n,r,s,o)}}class d7 extends HIe{constructor(e,n,r,s,o,a){super(),this._languageService=e,this._languageConfigurationService=n,this._textModel=r,this._bracketPairsTextModelPart=s,this._languageId=o,this._attachedViews=a,this._semanticTokens=new Boe(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new _e),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new _e),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new _e),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new Tmt(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(l=>{l.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(l=>{this._emitModelTokensChangedEvent(l)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(l=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const n of e.changes){const[r,s,o]=y1(n.text);this._semanticTokens.acceptEdit(n.range,r,s,o,n.text.length>0?n.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const n=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,n)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Vs("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,n,r){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,n,r)}tokenizeLineWithEdit(e,n,r){return this.grammarTokens.tokenizeLineWithEdit(e,n,r)}setSemanticTokens(e,n){this._semanticTokens.set(e,n),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,n){if(this.hasCompleteSemanticTokens())return;const r=this._textModel.validateRange(this._semanticTokens.setPartial(e,n));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:r.startLineNumber,toLineNumber:r.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const n=this._textModel.validatePosition(e),r=this._textModel.getLineContent(n.lineNumber),s=this.getLineTokens(n.lineNumber),o=s.findTokenIndexAtOffset(n.column-1),[a,l]=d7._findLanguageBoundaries(s,o),c=iP(n.column,this.getLanguageConfiguration(s.getLanguageId(o)).getWordDefinition(),r.substring(a,l),a);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(o>0&&a===n.column-1){const[u,d]=d7._findLanguageBoundaries(s,o-1),h=iP(n.column,this.getLanguageConfiguration(s.getLanguageId(o-1)).getWordDefinition(),r.substring(u,d),u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn)return h}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,n){const r=e.getLanguageId(n);let s=0;for(let a=n;a>=0&&e.getLanguageId(a)===r;a--)s=e.getStartOffset(a);let o=e.getLineContent().length;for(let a=n,l=e.getCount();a<l&&e.getLanguageId(a)===r;a++)o=e.getEndOffset(a);return[s,o]}getWordUntilPosition(e){const n=this.getWordAtPosition(e);return n?{word:n.word.substr(0,e.column-n.startColumn),startColumn:n.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,n){const r=this._textModel.validatePosition(new ve(e,n)),s=this.getLineTokens(r.lineNumber);return s.getLanguageId(s.findTokenIndexAtOffset(r.column-1))}setLanguageId(e,n="api"){if(this._languageId===e)return;const r={oldLanguage:this._languageId,newLanguage:e,source:n};this._languageId=e,this._bracketPairsTextModelPart.handleDidChangeLanguage(r),this.grammarTokens.resetTokenization(),this._onDidChangeLanguage.fire(r),this._onDidChangeLanguageConfiguration.fire({})}}class Tmt extends Le{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,n,r,s){super(),this._languageIdCodec=e,this._textModel=n,this.getLanguageId=r,this._tokenizer=null,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new ha),this._tokens=new FP(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new ha),this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new _e),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._onDidChangeTokens=this._register(new _e),this.onDidChangeTokens=this._onDidChangeTokens.event,this._attachedViewStates=this._register(new Nse),this._register(Zr.onDidChange(o=>{const a=this.getLanguageId();o.changedLanguages.indexOf(a)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(s.onDidChangeVisibleRanges(({view:o,state:a})=>{if(a){let l=this._attachedViewStates.get(o);l||(l=new Rmt(()=>this.refreshRanges(l.lineRanges)),this._attachedViewStates.set(o,l)),l.handleStateChange(a)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var n;this._tokens.flush(),(n=this._debugBackgroundTokens)===null||n===void 0||n.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new UJ(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const r=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const a=Zr.get(this.getLanguageId());if(!a)return[null,null];let l;try{l=a.getInitialState()}catch(c){return Ln(c),[null,null]}return[a,l]},[s,o]=r();if(s&&o?this._tokenizer=new Lmt(this._textModel.getLineCount(),s,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const a={setTokens:l=>{this.setTokens(l)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const l=2;this._backgroundTokenizationState=l,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(l,c)=>{var u;if(!this._tokenizer)return;const d=this._tokenizer.store.getFirstInvalidEndStateLineNumber();d!==null&&l>=d&&((u=this._tokenizer)===null||u===void 0||u.store.setEndState(l,c))}};s&&s.createBackgroundTokenizer&&!s.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,a)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Imt(this._tokenizer,a),this._defaultBackgroundTokenizer.handleChanges()),s!=null&&s.backgroundTokenizerShouldOnlyVerifyTokens&&s.createBackgroundTokenizer?(this._debugBackgroundTokens=new FP(this._languageIdCodec),this._debugBackgroundStates=new UJ(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,{setTokens:l=>{var c;(c=this._debugBackgroundTokens)===null||c===void 0||c.setMultilineTokens(l,this._textModel)},backgroundTokenizationFinished(){},setEndState:(l,c)=>{var u;(u=this._debugBackgroundStates)===null||u===void 0||u.setEndState(l,c)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var n,r,s;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[a,l]=y1(o.text);this._tokens.acceptEdit(o.range,a,l),(n=this._debugBackgroundTokens)===null||n===void 0||n.acceptEdit(o.range,a,l)}(r=this._debugBackgroundStates)===null||r===void 0||r.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.handleChanges()}}setTokens(e){const{changes:n}=this._tokens.setMultilineTokens(e,this._textModel);return n.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:n}),{changes:n}}refreshAllVisibleLineTokens(){const e=Qn.joinMany([...this._attachedViewStates].map(([n,r])=>r.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const n of e)this.refreshRange(n.startLineNumber,n.endLineNumberExclusive-1)}refreshRange(e,n){var r,s;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),n=Math.min(this._textModel.getLineCount(),n);const o=new HJ,{heuristicTokens:a}=this._tokenizer.tokenizeHeuristically(o,e,n),l=this.setTokens(o.finalize());if(a)for(const c of l.changes)(r=this._backgroundTokenizer.value)===null||r===void 0||r.requestTokens(c.fromLineNumber,c.toLineNumber+1);(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.checkFinished()}forceTokenization(e){var n,r;const s=new HJ;(n=this._tokenizer)===null||n===void 0||n.updateTokensUntilLine(s,e),this.setTokens(s.finalize()),(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var n;const r=this._textModel.getLineContent(e),s=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,r);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,r);!s.equals(o)&&(!((n=this._debugBackgroundTokenizer.value)===null||n===void 0)&&n.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return s}getTokenTypeIfInsertingCharacter(e,n,r){if(!this._tokenizer)return 0;const s=this._textModel.validatePosition(new ve(e,n));return this.forceTokenization(s.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(s,r)}tokenizeLineWithEdit(e,n,r){if(!this._tokenizer)return null;const s=this._textModel.validatePosition(e);return this.forceTokenization(s.lineNumber),this._tokenizer.tokenizeLineWithEdit(s,n,r)}get hasTokens(){return this._tokens.hasTokens}}class Rmt extends Le{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Ji(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){ys(this._computedLineRanges,this._lineRanges,(e,n)=>e.equals(n))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class Amt{constructor(){this.changeType=1}}class Xp{static applyInjectedText(e,n){if(!n||n.length===0)return e;let r="",s=0;for(const o of n)r+=e.substring(s,o.column-1),s=o.column-1,r+=o.options.content;return r+=e.substring(s),r}static fromDecorations(e){const n=[];for(const r of e)r.options.before&&r.options.before.content.length>0&&n.push(new Xp(r.ownerId,r.range.startLineNumber,r.range.startColumn,r.options.before,0)),r.options.after&&r.options.after.content.length>0&&n.push(new Xp(r.ownerId,r.range.endLineNumber,r.range.endColumn,r.options.after,1));return n.sort((r,s)=>r.lineNumber===s.lineNumber?r.column===s.column?r.order-s.order:r.column-s.column:r.lineNumber-s.lineNumber),n}constructor(e,n,r,s,o){this.ownerId=e,this.lineNumber=n,this.column=r,this.options=s,this.order=o}}class Zge{constructor(e,n,r){this.changeType=2,this.lineNumber=e,this.detail=n,this.injectedText=r}}class Nmt{constructor(e,n){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=n}}class Mmt{constructor(e,n,r,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=n,this.detail=r}}class Pmt{constructor(){this.changeType=5}}class Q2{constructor(e,n,r,s){this.changes=e,this.versionId=n,this.isUndoing=r,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let n=0,r=this.changes.length;n<r;n++)if(this.changes[n].changeType===e)return!0;return!1}static merge(e,n){const r=[].concat(e.changes).concat(n.changes),s=n.versionId,o=e.isUndoing||n.isUndoing,a=e.isRedoing||n.isRedoing;return new Q2(r,s,o,a)}}class fTe{constructor(e){this.changes=e}}class BS{constructor(e,n){this.rawContentChangedEvent=e,this.contentChangedEvent=n}merge(e){const n=Q2.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),r=BS._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new BS(n,r)}static _mergeChangeEvents(e,n){const r=[].concat(e.changes).concat(n.changes),s=n.eol,o=n.versionId,a=e.isUndoing||n.isUndoing,l=e.isRedoing||n.isRedoing,c=e.isFlush||n.isFlush,u=e.isEolChange&&n.isEolChange;return{changes:r,eol:s,isEolChange:u,versionId:o,isUndoing:a,isRedoing:l,isFlush:c}}}const P$=qn("undoRedoService");class pTe{constructor(e,n){this.resource=e,this.elements=n}}class UE{constructor(){this.id=UE._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}UE._ID=0;UE.None=new UE;class hm{constructor(){this.id=hm._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}hm._ID=0;hm.None=new hm;var Omt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Tq=function(i,e){return function(n,r){e(n,r,i)}},PC;function Fmt(i){const e=new hTe;return e.acceptChunk(i),e.finish()}function Bmt(i){const e=new hTe;let n;for(;typeof(n=i.read())=="string";)e.acceptChunk(n);return e.finish()}function Qge(i,e){let n;return typeof i=="string"?n=Fmt(i):kct(i)?n=Bmt(i):n=i,n.create(e)}let i6=0;const jmt=999,Wmt=1e4;class $mt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let n=0,r=0;do{const s=this._source.read();if(s===null)return this._eos=!0,n===0?null:e.join("");if(s.length>0&&(e[n++]=s,r+=s.length),r>=64*1024)return e.join("")}while(!0)}}const ZR=()=>{throw new Error("Invalid change accessor")};let Qm=PC=class extends Le{static resolveOptions(e,n){if(n.detectIndentation){const r=zge(e,n.tabSize,n.insertSpaces);return new c8({tabSize:r.tabSize,indentSize:"tabSize",insertSpaces:r.insertSpaces,trimAutoWhitespace:n.trimAutoWhitespace,defaultEOL:n.defaultEOL,bracketPairColorizationOptions:n.bracketPairColorizationOptions})}return new c8(n)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(n=>e(n.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return Sf(this._eventEmitter.fastEvent(n=>e(n)),this._onDidChangeInjectedText.event(n=>e(n)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,n,r,s=null,o,a,l){super(),this._undoRedoService=o,this._languageService=a,this._languageConfigurationService=l,this._onWillDispose=this._register(new _e),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new qmt(p=>this.handleBeforeFireDecorationsChangedEvent(p))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new _e),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new _e),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new _e),this._eventEmitter=this._register(new Kmt),this._languageSelectionListener=this._register(new ha),this._deltaDecorationCallCnt=0,this._attachedViews=new Gmt,i6++,this.id="$model"+i6,this.isForSimpleWidget=r.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=Jt.parse("inmemory://model/"+i6):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:c,disposable:u}=Qge(e,r.defaultEOL);this._buffer=c,this._bufferDisposable=u,this._options=PC.resolveOptions(this._buffer,r);const d=typeof n=="string"?n:n.languageId;typeof n!="string"&&(this._languageSelectionListener.value=n.onDidChange(()=>this._setLanguage(n.languageId))),this._bracketPairs=this._register(new zgt(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Opt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Hgt(this)),this._tokenizationTextModelPart=new d7(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const h=this._buffer.getLineCount(),f=this._buffer.getValueLengthInRange(new J(1,1,h,this._buffer.getLineLength(h)+1),0);r.largeFileOptimizations?(this._isTooLargeForTokenization=f>PC.LARGE_FILE_SIZE_THRESHOLD||h>PC.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=f>PC.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=f>PC._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=J2e(i6),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new Jge,this._commandManager=new Moe(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new Z2([],"",`
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Le.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,n){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(n),this._bracketPairs.handleDidChangeContent(n),this._eventEmitter.fire(new BS(e,n)))}setValue(e){if(this._assertNotDisposed(),e==null)throw uh();const{textBuffer:n,disposable:r}=Qge(e,this._options.defaultEOL);this._setValueFromTextBuffer(n,r)}_createContentChanged2(e,n,r,s,o,a,l,c){return{changes:[{range:e,rangeOffset:n,rangeLength:r,text:s}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:o,isRedoing:a,isFlush:l}}_setValueFromTextBuffer(e,n){this._assertNotDisposed();const r=this.getFullModelRange(),s=this.getValueLengthInRange(r),o=this.getLineCount(),a=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=n,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new Jge,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Q2([new Amt],this._versionId,!1,!1),this._createContentChanged2(new J(1,1,o,a),0,s,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const n=e===1?`\r
`:`
`;if(this._buffer.getEOL()===n)return;const r=this.getFullModelRange(),s=this.getValueLengthInRange(r),o=this.getLineCount(),a=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(n),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Q2([new Pmt],this._versionId,!1,!1),this._createContentChanged2(new J(1,1,o,a),0,s,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),n=this._decorationsTree.collectNodesPostOrder();for(let r=0,s=n.length;r<s;r++){const o=n[r],a=o.range,l=o.cachedAbsoluteStart-o.start,c=this._buffer.getOffsetAt(a.startLineNumber,a.startColumn),u=this._buffer.getOffsetAt(a.endLineNumber,a.endColumn);o.cachedAbsoluteStart=c,o.cachedAbsoluteEnd=u,o.cachedVersionId=e,o.start=c-l,o.end=u-l,C1(o)}}onBeforeAttached(){return this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,n=0;const r=this._buffer.getLineCount();for(let s=1;s<=r;s++){const o=this._buffer.getLineLength(s);o>=Wmt?n+=o:e+=o}return n>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const n=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,r=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,a=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,l=new c8({tabSize:n,indentSize:r,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:a});if(this._options.equals(l))return;const c=this._options.createChangeEvent(l);this._options=l,this._bracketPairs.handleDidChangeOptions(c),this._decorationProvider.handleDidChangeOptions(c),this._onDidChangeOptions.fire(c)}detectIndentation(e,n){this._assertNotDisposed();const r=zge(this._buffer,n,e);this.updateOptions({insertSpaces:r.insertSpaces,tabSize:r.tabSize,indentSize:r.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),Loe(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const n=this.findMatches(Z2e.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,n.map(r=>({range:r.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const n=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(n.lineNumber,n.column)}getPositionAt(e){this._assertNotDisposed();const n=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(n)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,n=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Vs("Operation would exceed heap memory limits");const r=this.getFullModelRange(),s=this.getValueInRange(r,e);return n?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new $mt(this._buffer.createSnapshot(e))}getValueLength(e,n=!1){this._assertNotDisposed();const r=this.getFullModelRange(),s=this.getValueLengthInRange(r,e);return n?this._buffer.getBOM().length+s:s}getValueInRange(e,n=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),n)}getValueLengthInRange(e,n=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),n)}getCharacterCountInRange(e,n=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),n)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vs("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vs("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Vs("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===`
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vs("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vs("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vs("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const n=this._buffer.getLineCount(),r=e.startLineNumber,s=e.startColumn;let o=Math.floor(typeof r=="number"&&!isNaN(r)?r:1),a=Math.floor(typeof s=="number"&&!isNaN(s)?s:1);if(o<1)o=1,a=1;else if(o>n)o=n,a=this.getLineMaxColumn(o);else if(a<=1)a=1;else{const h=this.getLineMaxColumn(o);a>=h&&(a=h)}const l=e.endLineNumber,c=e.endColumn;let u=Math.floor(typeof l=="number"&&!isNaN(l)?l:1),d=Math.floor(typeof c=="number"&&!isNaN(c)?c:1);if(u<1)u=1,d=1;else if(u>n)u=n,d=this.getLineMaxColumn(u);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(u);d>=h&&(d=h)}return r===o&&s===a&&l===u&&c===d&&e instanceof J&&!(e instanceof Ft)?e:new J(o,a,u,d)}_isValidPosition(e,n,r){if(typeof e!="number"||typeof n!="number"||isNaN(e)||isNaN(n)||e<1||n<1||(e|0)!==e||(n|0)!==n)return!1;const s=this._buffer.getLineCount();if(e>s)return!1;if(n===1)return!0;const o=this.getLineMaxColumn(e);if(n>o)return!1;if(r===1){const a=this._buffer.getLineCharCode(e,n-2);if(xo(a))return!1}return!0}_validatePosition(e,n,r){const s=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof n=="number"&&!isNaN(n)?n:1),a=this._buffer.getLineCount();if(s<1)return new ve(1,1);if(s>a)return new ve(a,this.getLineMaxColumn(a));if(o<=1)return new ve(s,1);const l=this.getLineMaxColumn(s);if(o>=l)return new ve(s,l);if(r===1){const c=this._buffer.getLineCharCode(s,o-2);if(xo(c))return new ve(s,o-1)}return new ve(s,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof ve&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,n){const r=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,a=e.endColumn;if(!this._isValidPosition(r,s,0)||!this._isValidPosition(o,a,0))return!1;if(n===1){const l=s>1?this._buffer.getLineCharCode(r,s-2):0,c=a>1&&a<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,a-2):0,u=xo(l),d=xo(c);return!u&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof J&&!(e instanceof Ft)&&this._isValidRange(e,1))return e;const r=this._validatePosition(e.startLineNumber,e.startColumn,0),s=this._validatePosition(e.endLineNumber,e.endColumn,0),o=r.lineNumber,a=r.column,l=s.lineNumber,c=s.column;{const u=a>1?this._buffer.getLineCharCode(o,a-2):0,d=c>1&&c<=this._buffer.getLineLength(l)?this._buffer.getLineCharCode(l,c-2):0,h=xo(u),f=xo(d);return!h&&!f?new J(o,a,l,c):o===l&&a===c?new J(o,a-1,l,c-1):h&&f?new J(o,a-1,l,c+1):h?new J(o,a-1,l,c):new J(o,a,l,c+1)}}modifyPosition(e,n){this._assertNotDisposed();const r=this.getOffsetAt(e)+n;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,r)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new J(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,n,r,s){return this._buffer.findMatchesLineByLine(e,n,r,s)}findMatches(e,n,r,s,o,a,l=jmt){this._assertNotDisposed();let c=null;n!==null&&(Array.isArray(n)||(n=[n]),n.every(h=>J.isIRange(h))&&(c=n.map(h=>this.validateRange(h)))),c===null&&(c=[this.getFullModelRange()]),c=c.sort((h,f)=>h.startLineNumber-f.startLineNumber||h.startColumn-f.startColumn);const u=[];u.push(c.reduce((h,f)=>J.areIntersecting(h,f)?h.plusRange(f):(u.push(h),f)));let d;if(!r&&e.indexOf(`
`)<0){const f=new MC(e,r,s,o).parseSearchRequest();if(!f)return[];d=p=>this.findMatchesLineByLine(p,f,a,l)}else d=h=>z3.findMatches(this,new MC(e,r,s,o),h,a,l);return u.map(d).reduce((h,f)=>h.concat(f),[])}findNextMatch(e,n,r,s,o,a){this._assertNotDisposed();const l=this.validatePosition(n);if(!r&&e.indexOf(`
`)<0){const u=new MC(e,r,s,o).parseSearchRequest();if(!u)return null;const d=this.getLineCount();let h=new J(l.lineNumber,l.column,d,this.getLineMaxColumn(d)),f=this.findMatchesLineByLine(h,u,a,1);return z3.findNextMatch(this,new MC(e,r,s,o),l,a),f.length>0||(h=new J(1,1,l.lineNumber,this.getLineMaxColumn(l.lineNumber)),f=this.findMatchesLineByLine(h,u,a,1),f.length>0)?f[0]:null}return z3.findNextMatch(this,new MC(e,r,s,o),l,a)}findPreviousMatch(e,n,r,s,o,a){this._assertNotDisposed();const l=this.validatePosition(n);return z3.findPreviousMatch(this,new MC(e,r,s,o),l,a)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===`
`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof uq?e:new uq(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const n=[];for(let r=0,s=e.length;r<s;r++)n[r]=this._validateEditOperation(e[r]);return n}pushEditOperations(e,n,r,s){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(n),r,s)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,n,r,s){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const o=n.map(l=>({range:this.validateRange(l.range),text:l.text}));let a=!0;if(e)for(let l=0,c=e.length;l<c;l++){const u=e[l];let d=!1;for(let h=0,f=o.length;h<f;h++){const p=o[h].range,g=p.startLineNumber>u.endLineNumber,m=u.startLineNumber>p.endLineNumber;if(!g&&!m){d=!0;break}}if(!d){a=!1;break}}if(a)for(let l=0,c=this._trimAutoWhitespaceLines.length;l<c;l++){const u=this._trimAutoWhitespaceLines[l],d=this.getLineMaxColumn(u);let h=!0;for(let f=0,p=o.length;f<p;f++){const g=o[f].range,m=o[f].text;if(!(u<g.startLineNumber||u>g.endLineNumber)&&!(u===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&m&&m.length>0&&m.charAt(0)===`
`)&&!(u===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===`
`)){h=!1;break}}if(h){const f=new J(u,1,u,d);n.push(new uq(null,f,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,n,r,s)}_applyUndo(e,n,r,s){const o=e.map(a=>{const l=this.getPositionAt(a.newPosition),c=this.getPositionAt(a.newEnd);return{range:new J(l.lineNumber,l.column,c.lineNumber,c.column),text:a.oldText}});this._applyUndoRedoEdits(o,n,!0,!1,r,s)}_applyRedo(e,n,r,s){const o=e.map(a=>{const l=this.getPositionAt(a.oldPosition),c=this.getPositionAt(a.oldEnd);return{range:new J(l.lineNumber,l.column,c.lineNumber,c.column),text:a.newText}});this._applyUndoRedoEdits(o,n,!1,!0,r,s)}_applyUndoRedoEdits(e,n,r,s,o,a){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=r,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(n),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(a),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,n=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const r=this._validateEditOperations(e);return this._doApplyEdits(r,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,n){const r=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,n),o=this._buffer.getLineCount(),a=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,a.length!==0){for(let u=0,d=a.length;u<d;u++){const h=a[u];this._decorationsTree.acceptReplace(h.rangeOffset,h.rangeLength,h.text.length,h.forceMoveMarkers)}const l=[];this._increaseVersionId();let c=r;for(let u=0,d=a.length;u<d;u++){const h=a[u],[f]=y1(h.text);this._onDidChangeDecorations.fire();const p=h.range.startLineNumber,g=h.range.endLineNumber,m=g-p,_=f,b=Math.min(m,_),y=_-m,x=o-c-y+p,k=x,D=x+_,R=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new ve(k,1)),this.getOffsetAt(new ve(D,this.getLineMaxColumn(D))),0),E=Xp.fromDecorations(R),A=new Ev(E);for(let M=b;M>=0;M--){const N=p+M,P=x+M;A.takeFromEndWhile(B=>B.lineNumber>P);const O=A.takeFromEndWhile(B=>B.lineNumber===P);l.push(new Zge(N,this.getLineContent(P),O))}if(b<m){const M=p+b;l.push(new Nmt(M+1,g))}if(b<_){const M=new Ev(E),N=p+b,P=_-b,O=o-c-P+N+1,B=[],j=[];for(let z=0;z<P;z++){const H=O+z;j[z]=this.getLineContent(H),M.takeWhile(Y=>Y.lineNumber<H),B[z]=M.takeWhile(Y=>Y.lineNumber===H)}l.push(new Mmt(N+1,p+_,j,B))}c+=y}this._emitContentChangedEvent(new Q2(l,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:a,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const r=Array.from(e).map(s=>new Zge(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new fTe(r))}changeDecorations(e,n=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(n,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,n){const r={addDecoration:(o,a)=>this._deltaDecorationsImpl(e,[],[{range:o,options:a}])[0],changeDecoration:(o,a)=>{this._changeDecorationImpl(o,a)},changeDecorationOptions:(o,a)=>{this._changeDecorationOptionsImpl(o,tme(a))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,a)=>o.length===0&&a.length===0?[]:this._deltaDecorationsImpl(e,o,a)};let s=null;try{s=n(r)}catch(o){Ln(o)}return r.addDecoration=ZR,r.changeDecoration=ZR,r.changeDecorationOptions=ZR,r.removeDecoration=ZR,r.deltaDecorations=ZR,s}deltaDecorations(e,n,r=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&n.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),Ln(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(r,e,n)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,n,r){const s=e?this._decorations[e]:null;if(!s)return n?this._deltaDecorationsImpl(0,[],[{range:n,options:eme[r]}],!0)[0]:null;if(!n)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const o=this._validateRangeRelaxedNoAllocations(n),a=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),l=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),a,l,o),s.setOptions(eme[r]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const n=this._decorationsTree.collectNodesFromOwner(e);for(let r=0,s=n.length;r<s;r++){const o=n[r];this._decorationsTree.delete(o),delete this._decorations[o.id]}}getDecorationOptions(e){const n=this._decorations[e];return n?n.options:null}getDecorationRange(e){const n=this._decorations[e];return n?this._decorationsTree.getNodeRange(this,n):null}getLineDecorations(e,n=0,r=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,n,r)}getLinesDecorations(e,n,r=0,s=!1,o=!1){const a=this.getLineCount(),l=Math.min(a,Math.max(1,e)),c=Math.min(a,Math.max(1,n)),u=this.getLineMaxColumn(c),d=new J(l,1,c,u),h=this._getDecorationsInRange(d,r,s,o);return rQ(h,this._decorationProvider.getDecorationsInRange(d,r,s)),h}getDecorationsInRange(e,n=0,r=!1,s=!1,o=!1){const a=this.validateRange(e),l=this._getDecorationsInRange(a,n,r,o);return rQ(l,this._decorationProvider.getDecorationsInRange(a,n,r,s)),l}getOverviewRulerDecorations(e=0,n=!1){return this._decorationsTree.getAll(this,e,n,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const n=this._buffer.getOffsetAt(e,1),r=n+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,n,r,0);return Xp.fromDecorations(s).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,n=!1){let r=this._decorationsTree.getAll(this,e,n,!1,!1);return r=r.concat(this._decorationProvider.getAllDecorations(e,n)),r}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,n,r,s){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),a=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,a,n,r,s)}getRangeAt(e,n){return this._buffer.getRangeAt(e,n-e)}_changeDecorationImpl(e,n){const r=this._decorations[e];if(!r)return;if(r.options.after){const l=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(r.options.before){const l=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(n),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),a=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(r),r.reset(this.getVersionId(),o,a,s),this._decorationsTree.insert(r),this._onDidChangeDecorations.checkAffectedAndFire(r.options),r.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),r.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,n){const r=this._decorations[e];if(!r)return;const s=!!(r.options.overviewRuler&&r.options.overviewRuler.color),o=!!(n.overviewRuler&&n.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(r.options),this._onDidChangeDecorations.checkAffectedAndFire(n),r.options.after||n.after){const a=this._decorationsTree.getNodeRange(this,r);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(r.options.before||n.before){const a=this._decorationsTree.getNodeRange(this,r);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}s!==o?(this._decorationsTree.delete(r),r.setOptions(n),this._decorationsTree.insert(r)):r.setOptions(n)}_deltaDecorationsImpl(e,n,r,s=!1){const o=this.getVersionId(),a=n.length;let l=0;const c=r.length;let u=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(c);for(;l<a||u<c;){let h=null;if(l<a){do h=this._decorations[n[l++]];while(!h&&l<a);if(h){if(h.options.after){const f=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.endLineNumber)}if(h.options.before){const f=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.startLineNumber)}this._decorationsTree.delete(h),s||this._onDidChangeDecorations.checkAffectedAndFire(h.options)}}if(u<c){if(!h){const b=++this._lastDecorationId,y=`${this._instanceId};${b}`;h=new lTe(y,0,0),this._decorations[y]=h}const f=r[u],p=this._validateRangeRelaxedNoAllocations(f.range),g=tme(f.options),m=this._buffer.getOffsetAt(p.startLineNumber,p.startColumn),_=this._buffer.getOffsetAt(p.endLineNumber,p.endColumn);h.ownerId=e,h.reset(o,m,_,p),h.setOptions(g),h.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(p.endLineNumber),h.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(p.startLineNumber),s||this._onDidChangeDecorations.checkAffectedAndFire(g),this._decorationsTree.insert(h),d[u]=h.id,u++}else h&&delete this._decorations[h.id]}return d}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setLanguage(e,n){typeof e=="string"?(this._languageSelectionListener.clear(),this._setLanguage(e,n)):(this._languageSelectionListener.value=e.onDidChange(()=>this._setLanguage(e.languageId,n)),this._setLanguage(e.languageId,n))}_setLanguage(e,n){this.tokenization.setLanguageId(e,n),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,n){return this.tokenization.getLanguageIdAtPosition(e,n)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,n){return e}getLineIndentColumn(e){return zmt(this.getLineContent(e))+1}};Qm._MODEL_SYNC_LIMIT=50*1024*1024;Qm.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;Qm.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;Qm.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;Qm.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:za.tabSize,indentSize:za.indentSize,insertSpaces:za.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:za.trimAutoWhitespace,largeFileOptimizations:za.largeFileOptimizations,bracketPairColorizationOptions:za.bracketPairColorizationOptions};Qm=PC=Omt([Tq(4,P$),Tq(5,Ar),Tq(6,dr)],Qm);function zmt(i){let e=0;for(const n of i)if(n===" "||n===" ")e++;else break;return e}function Rq(i){return!!(i.options.overviewRuler&&i.options.overviewRuler.color)}function Aq(i){return!!i.options.after||!!i.options.before}class Jge{constructor(){this._decorationsTree0=new Dq,this._decorationsTree1=new Dq,this._injectedTextDecorationsTree=new Dq}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,n){for(const r of n)r.range===null&&(r.range=e.getRangeAt(r.cachedAbsoluteStart,r.cachedAbsoluteEnd));return n}getAllInInterval(e,n,r,s,o,a){const l=e.getVersionId(),c=this._intervalSearch(n,r,s,o,l,a);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,n,r,s,o,a){const l=this._decorationsTree0.intervalSearch(e,n,r,s,o,a),c=this._decorationsTree1.intervalSearch(e,n,r,s,o,a),u=this._injectedTextDecorationsTree.intervalSearch(e,n,r,s,o,a);return l.concat(c).concat(u)}getInjectedTextInInterval(e,n,r,s){const o=e.getVersionId(),a=this._injectedTextDecorationsTree.intervalSearch(n,r,s,!1,o,!1);return this._ensureNodesHaveRanges(e,a).filter(l=>l.options.showIfCollapsed||!l.range.isEmpty())}getAllInjectedText(e,n){const r=e.getVersionId(),s=this._injectedTextDecorationsTree.search(n,!1,r,!1);return this._ensureNodesHaveRanges(e,s).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,n,r,s,o){const a=e.getVersionId(),l=this._search(n,r,s,a,o);return this._ensureNodesHaveRanges(e,l)}_search(e,n,r,s,o){if(r)return this._decorationsTree1.search(e,n,s,o);{const a=this._decorationsTree0.search(e,n,s,o),l=this._decorationsTree1.search(e,n,s,o),c=this._injectedTextDecorationsTree.search(e,n,s,o);return a.concat(l).concat(c)}}collectNodesFromOwner(e){const n=this._decorationsTree0.collectNodesFromOwner(e),r=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return n.concat(r).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),n=this._decorationsTree1.collectNodesPostOrder(),r=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(n).concat(r)}insert(e){Aq(e)?this._injectedTextDecorationsTree.insert(e):Rq(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Aq(e)?this._injectedTextDecorationsTree.delete(e):Rq(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,n){const r=e.getVersionId();return n.cachedVersionId!==r&&this._resolveNode(n,r),n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd)),n.range}_resolveNode(e,n){Aq(e)?this._injectedTextDecorationsTree.resolveNode(e,n):Rq(e)?this._decorationsTree1.resolveNode(e,n):this._decorationsTree0.resolveNode(e,n)}acceptReplace(e,n,r,s){this._decorationsTree0.acceptReplace(e,n,r,s),this._decorationsTree1.acceptReplace(e,n,r,s),this._injectedTextDecorationsTree.acceptReplace(e,n,r,s)}}function Z_(i){return i.replace(/[^a-z0-9\-_]/gi," ")}class gTe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Vmt extends gTe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:hd.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,n){if(typeof e=="string")return e;const r=e?n.getColor(e.id):null;return r?r.toString():""}}class Hmt{constructor(e){var n;this.position=(n=e==null?void 0:e.position)!==null&&n!==void 0?n:z2.Left}}class Umt extends gTe{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,n){return typeof e=="string"?Te.fromHex(e):n.getColor(e.id)}}class S1{static from(e){return e instanceof S1?e:new S1(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class kn{static register(e){return new kn(e)}static createDynamic(e){return new kn(e)}constructor(e){var n,r,s,o,a,l;this.description=e.description,this.blockClassName=e.blockClassName?Z_(e.blockClassName):null,this.blockDoesNotCollapse=(n=e.blockDoesNotCollapse)!==null&&n!==void 0?n:null,this.blockIsAfterEnd=(r=e.blockIsAfterEnd)!==null&&r!==void 0?r:null,this.blockPadding=(s=e.blockPadding)!==null&&s!==void 0?s:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Z_(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Vmt(e.overviewRuler):null,this.minimap=e.minimap?new Umt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Hmt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Z_(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Z_(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Z_(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Z_(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Z_(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Z_(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Z_(e.afterContentClassName):null,this.after=e.after?S1.from(e.after):null,this.before=e.before?S1.from(e.before):null,this.hideInCommentTokens=(a=e.hideInCommentTokens)!==null&&a!==void 0?a:!1,this.hideInStringTokens=(l=e.hideInStringTokens)!==null&&l!==void 0?l:!1}}kn.EMPTY=kn.register({description:"empty"});const eme=[kn.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),kn.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),kn.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),kn.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function tme(i){return i instanceof kn?i:kn.createDynamic(i)}class qmt extends Le{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new _e),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class Kmt extends Le{constructor(){super(),this._fastEmitter=this._register(new _e),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new _e),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const n=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(n),this._slowEmitter.fire(n)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class Gmt{constructor(){this._onDidChangeVisibleRanges=new _e,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Xmt(n=>{this._onDidChangeVisibleRanges.fire({view:e,state:n})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class Xmt{constructor(e){this.handleStateChange=e}setVisibleLines(e,n){const r=e.map(s=>new Qn(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:r,stabilized:n})}}class h7{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new ta(new J(1,1,1,1),0,0,new ve(1,1),0),new ta(new J(1,1,1,1),0,0,new ve(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new hi(this.modelState,this.viewState)}readSelectionFromMarkers(e){const n=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!n.isEmpty()?Ft.fromRange(n.collapseToEnd(),this.modelState.selection.getDirection()):Ft.fromRange(n,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,n,r){this._setState(e,n,r)}static _validatePositionWithCache(e,n,r,s){return n.equals(r)?s:e.normalizePosition(n,2)}static _validateViewState(e,n){const r=n.position,s=n.selectionStart.getStartPosition(),o=n.selectionStart.getEndPosition(),a=e.normalizePosition(r,2),l=this._validatePositionWithCache(e,s,r,a),c=this._validatePositionWithCache(e,o,s,l);return r.equals(a)&&s.equals(l)&&o.equals(c)?n:new ta(J.fromPositions(l,c),n.selectionStartKind,n.selectionStartLeftoverVisibleColumns+s.column-l.column,a,n.leftoverVisibleColumns+r.column-a.column)}_setState(e,n,r){if(r&&(r=h7._validateViewState(e.viewModel,r)),n){const s=e.model.validateRange(n.selectionStart),o=n.selectionStart.equalsRange(s)?n.selectionStartLeftoverVisibleColumns:0,a=e.model.validatePosition(n.position),l=n.position.equals(a)?n.leftoverVisibleColumns:0;n=new ta(s,n.selectionStartKind,o,a,l)}else{if(!r)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(r.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(r.position));n=new ta(s,r.selectionStartKind,r.selectionStartLeftoverVisibleColumns,o,r.leftoverVisibleColumns)}if(r){const s=e.coordinatesConverter.validateViewRange(r.selectionStart,n.selectionStart),o=e.coordinatesConverter.validateViewPosition(r.position,n.position);r=new ta(s,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,o,n.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new ve(n.selectionStart.startLineNumber,n.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new ve(n.selectionStart.endLineNumber,n.selectionStart.endColumn)),a=new J(s.lineNumber,s.column,o.lineNumber,o.column),l=e.coordinatesConverter.convertModelPositionToViewPosition(n.position);r=new ta(a,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,l,n.leftoverVisibleColumns)}this.modelState=n,this.viewState=r,this._updateTrackedRange(e)}}class nme{constructor(e){this.context=e,this.cursors=[new h7(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return Fct(this.cursors,ch(e=>e.viewState.position,ve.compare)).viewState.position}getBottomMostViewPosition(){return Oct(this.cursors,ch(e=>e.viewState.position,ve.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(hi.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const n=this.cursors.length-1,r=e.length;if(n<r){const s=r-n;for(let o=0;o<s;o++)this._addSecondaryCursor()}else if(n>r){const s=n-r;for(let o=0;o<s;o++)this._removeSecondaryCursor(this.cursors.length-2)}for(let s=0;s<r;s++)this.cursors[s+1].setState(this.context,e[s].modelState,e[s].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new h7(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return this.cursors.length===1||this.lastAddedCursorIndex===0?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),n=[];for(let r=0,s=e.length;r<s;r++)n.push({index:r,selection:e[r].modelState.selection});n.sort(ch(r=>r.selection,J.compareRangesUsingStarts));for(let r=0;r<n.length-1;r++){const s=n[r],o=n[r+1],a=s.selection,l=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let c;if(l.isEmpty()||a.isEmpty()?c=l.getStartPosition().isBeforeOrEqual(a.getEndPosition()):c=l.getStartPosition().isBefore(a.getEndPosition()),c){const u=s.index<o.index?r:r+1,d=s.index<o.index?r+1:r,h=n[d].index,f=n[u].index,p=n[d].selection,g=n[u].selection;if(!p.equalsSelection(g)){const m=p.plusRange(g),_=p.selectionStartLineNumber===p.startLineNumber&&p.selectionStartColumn===p.startColumn,b=g.selectionStartLineNumber===g.startLineNumber&&g.selectionStartColumn===g.startColumn;let y;h===this.lastAddedCursorIndex?(y=_,this.lastAddedCursorIndex=f):y=b;let x;y?x=new Ft(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn):x=new Ft(m.endLineNumber,m.endColumn,m.startLineNumber,m.startColumn),n[u].selection=x;const k=hi.fromModelSelection(x);e[f].setState(this.context,k.modelState,k.viewState)}for(const m of n)m.index>h&&m.index--;e.splice(h,1),n.splice(d,1),this._removeSecondaryCursor(h-1),r--}}}}class ime{constructor(e,n,r,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=n,this.coordinatesConverter=r,this.cursorConfig=s}}class Ymt{constructor(){this.type=0}}class Zmt{constructor(){this.type=1}}class Qmt{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Jmt{constructor(e,n,r){this.selections=e,this.modelSelections=n,this.reason=r,this.type=3}}class iD{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class r6{constructor(){this.type=5}}class e_t{constructor(e){this.type=6,this.isFocused=e}}class t_t{constructor(){this.type=7}}class s6{constructor(){this.type=8}}class mTe{constructor(e,n){this.fromLineNumber=e,this.count=n,this.type=9}}class qJ{constructor(e,n){this.type=10,this.fromLineNumber=e,this.toLineNumber=n}}class KJ{constructor(e,n){this.type=11,this.fromLineNumber=e,this.toLineNumber=n}}class v8{constructor(e,n,r,s,o,a,l){this.source=e,this.minimalReveal=n,this.range=r,this.selections=s,this.verticalType=o,this.revealHorizontal=a,this.scrollType=l,this.type=12}}class n_t{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class i_t{constructor(e){this.theme=e,this.type=14}}class r_t{constructor(e){this.type=15,this.ranges=e}}class s_t{constructor(){this.type=16}}let o_t=class{constructor(){this.type=17}};class a_t extends Le{constructor(){super(),this._onEvent=this._register(new _e),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let n=0,r=this._outgoingEvents.length;n<r;n++){const s=this._outgoingEvents[n].kind===e.kind?this._outgoingEvents[n].attemptToMerge(e):null;if(s){this._outgoingEvents[n]=s;return}}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let n=0,r=this._eventHandlers.length;n<r;n++)this._eventHandlers[n]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let n=0;n<this._eventHandlers.length;n++)if(this._eventHandlers[n]===e){this._eventHandlers.splice(n,1);break}}beginEmitViewEvents(){return this._collectorCnt++,this._collectorCnt===1&&(this._collector=new l_t),this._collector}endEmitViewEvents(){if(this._collectorCnt--,this._collectorCnt===0){const e=this._collector.outgoingEvents,n=this._collector.viewEvents;this._collector=null;for(const r of e)this._addOutgoingEvent(r);n.length>0&&this._emitMany(n)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const n=this._eventHandlers.slice(0);for(const r of n)r.handleEvents(e)}}}class l_t{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class joe{constructor(e,n,r,s){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=n,this.contentWidth=r,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new joe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class Woe{constructor(e,n){this.kind=1,this.oldHasFocus=e,this.hasFocus=n}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new Woe(this.oldHasFocus,e.hasFocus)}}class $oe{constructor(e,n,r,s,o,a,l,c){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=n,this._oldScrollHeight=r,this._oldScrollTop=s,this.scrollWidth=o,this.scrollLeft=a,this.scrollHeight=l,this.scrollTop=c,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new $oe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class c_t{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class u_t{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class f7{constructor(e,n,r,s,o,a,l){this.kind=6,this.oldSelections=e,this.selections=n,this.oldModelVersionId=r,this.modelVersionId=s,this.source=o,this.reason=a,this.reachedMaxCursorCount=l}static _selectionsAreEqual(e,n){if(!e&&!n)return!0;if(!e||!n)return!1;const r=e.length,s=n.length;if(r!==s)return!1;for(let o=0;o<r;o++)if(!e[o].equalsSelection(n[o]))return!1;return!0}isNoOp(){return f7._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new f7(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class d_t{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class h_t{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}}class f_t{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class p_t{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class g_t{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class m_t{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class __t{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class v_t extends Le{constructor(e,n,r,s){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=n,this._coordinatesConverter=r,this.context=new ime(this._model,this._viewModel,this._coordinatesConverter,s),this._cursors=new nme(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=Mi(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new ime(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){const e=this._cursors.getSelections();for(let n=0;n<this._autoClosedActions.length;n++){const r=this._autoClosedActions[n];r.isValid(e)||(r.dispose(),this._autoClosedActions.splice(n,1),n--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,n,r,s){let o=!1;const a=this.context.cursorConfig.multiCursorLimit;s!==null&&s.length>a&&(s=s.slice(0,a),o=!0);const l=hM.from(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,n,r,l,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,n,r,s,o,a){const l=this._cursors.getViewPositions();let c=null,u=null;l.length>1?u=this._cursors.getViewSelections():c=J.fromPositions(l[0],l[0]),e.emitViewEvent(new v8(n,r,c,u,s,o,a))}saveState(){const e=[],n=this._cursors.getSelections();for(let r=0,s=n.length;r<s;r++){const o=n[r];e.push({inSelectionMode:!o.isEmpty(),selectionStart:{lineNumber:o.selectionStartLineNumber,column:o.selectionStartColumn},position:{lineNumber:o.positionLineNumber,column:o.positionColumn}})}return e}restoreState(e,n){const r=[];for(let s=0,o=n.length;s<o;s++){const a=n[s];let l=1,c=1;a.position&&a.position.lineNumber&&(l=a.position.lineNumber),a.position&&a.position.column&&(c=a.position.column);let u=l,d=c;a.selectionStart&&a.selectionStart.lineNumber&&(u=a.selectionStart.lineNumber),a.selectionStart&&a.selectionStart.column&&(d=a.selectionStart.column),r.push({selectionStartLineNumber:u,selectionStartColumn:d,positionLineNumber:l,positionColumn:c})}this.setStates(e,"restoreState",0,hi.fromModelSelections(r)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,n){if(n instanceof fTe){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const r=n.rawContentChangedEvent;if(this._knownModelVersionId=r.versionId,this._isHandling)return;const s=r.containsEvent(1);if(this._prevEditOperationType=0,s)this._cursors.dispose(),this._cursors=new nme(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&r.resultingSelection&&r.resultingSelection.length>0){const o=hi.fromModelSelections(r.resultingSelection);this.setStates(e,"modelChange",r.isUndoing?5:r.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,hi.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),n=e.viewState.selectionStart.getStartPosition(),r=e.viewState.position;return{isReal:!1,fromViewLineNumber:n.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n),toViewLineNumber:r.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,r)}}getSelections(){return this._cursors.getSelections()}setSelections(e,n,r,s){this.setStates(e,n,s,hi.fromModelSelections(r))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,n){const r=[],s=[];for(let l=0,c=e.length;l<c;l++)r.push({range:e[l],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),s.push({range:n[l],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],r),a=this._model.deltaDecorations([],s);this._autoClosedActions.push(new rme(this._model,o,a))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const n=b_t.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(n){this._interpretCommandResult(n);const r=[],s=[];for(let o=0;o<e.commands.length;o++){const a=e.commands[o];a instanceof jIe&&a.enclosingRange&&a.closeCharacterRange&&(r.push(a.closeCharacterRange),s.push(a.enclosingRange))}r.length>0&&this._pushAutoClosedAction(r,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,n,r,s,o){const a=hM.from(this._model,this);if(a.equals(s))return!1;const l=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new Jmt(c,l,r)),!s||s.cursorState.length!==a.cursorState.length||a.cursorState.some((u,d)=>!u.modelState.equals(s.cursorState[d].modelState))){const u=s?s.cursorState.map(h=>h.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new f7(u,l,d,a.modelVersionId,n||"keyboard",r,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const n=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];if(!o.text||o.text.indexOf(`
`)>=0)return null;const a=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!a)return null;const l=a[1],c=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(l);if(!c||c.length!==1)return null;const u=c[0].open,d=o.text.length-a[2].length-1,h=o.text.lastIndexOf(u,d-1);if(h===-1)return null;n.push([h,d])}return n}executeEdits(e,n,r,s){let o=null;n==="snippet"&&(o=this._findAutoClosingPairs(r)),o&&(r[0]._isTracked=!0);const a=[],l=[],c=this._model.pushEditOperations(this.getSelections(),r,u=>{if(o)for(let h=0,f=o.length;h<f;h++){const[p,g]=o[h],m=u[h],_=m.range.startLineNumber,b=m.range.startColumn-1+p,y=m.range.startColumn-1+g;a.push(new J(_,y+1,_,y+2)),l.push(new J(_,b+1,_,y+2))}const d=s(u);return d&&(this._isHandling=!0),d});c&&(this._isHandling=!1,this.setSelections(e,n,c,0)),a.length>0&&this._pushAutoClosedAction(a,l)}_executeEdit(e,n,r,s=0){if(this.context.cursorConfig.readOnly)return;const o=hM.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(a){Ln(a)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(n,r,s,o,!1)&&this.revealPrimary(n,r,!1,0,!0,0)}getAutoClosedCharacters(){return rme.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new fM(this._model,this.getSelections())}endComposition(e,n){const r=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{n==="keyboard"&&this._executeEditOperation(zr.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,r,this.getSelections(),this.getAutoClosedCharacters()))},e,n)}type(e,n,r){this._executeEdit(()=>{if(r==="keyboard"){const s=n.length;let o=0;for(;o<s;){const a=Vse(n,o),l=n.substr(o,a);this._executeEditOperation(zr.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),l)),o+=a}}else this._executeEditOperation(zr.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),n))},e,r)}compositionType(e,n,r,s,o,a){if(n.length===0&&r===0&&s===0){if(o!==0){const l=this.getSelections().map(c=>{const u=c.getPosition();return new Ft(u.lineNumber,u.column+o,u.lineNumber,u.column+o)});this.setSelections(e,a,l,0)}return}this._executeEdit(()=>{this._executeEditOperation(zr.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),n,r,s,o))},e,a)}paste(e,n,r,s,o){this._executeEdit(()=>{this._executeEditOperation(zr.paste(this.context.cursorConfig,this._model,this.getSelections(),n,r,s||[]))},e,o,4)}cut(e,n){this._executeEdit(()=>{this._executeEditOperation(fx.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,n)}executeCommand(e,n,r){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new lc(0,[n],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,r)}executeCommands(e,n,r){this._executeEdit(()=>{this._executeEditOperation(new lc(0,n,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,r)}}class hM{static from(e,n){return new hM(e.getVersionId(),n.getCursorStates())}constructor(e,n){this.modelVersionId=e,this.cursorState=n}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let n=0,r=this.cursorState.length;n<r;n++)if(!this.cursorState[n].equals(e.cursorState[n]))return!1;return!0}}class rme{static getAllAutoClosedCharacters(e){let n=[];for(const r of e)n=n.concat(r.getAutoClosedCharactersRanges());return n}constructor(e,n,r){this._model=e,this._autoClosedCharactersDecorations=n,this._autoClosedEnclosingDecorations=r}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let n=0;n<this._autoClosedCharactersDecorations.length;n++){const r=this._model.getDecorationRange(this._autoClosedCharactersDecorations[n]);r&&e.push(r)}return e}isValid(e){const n=[];for(let r=0;r<this._autoClosedEnclosingDecorations.length;r++){const s=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[r]);if(s&&(n.push(s),s.startLineNumber!==s.endLineNumber))return!1}n.sort(J.compareRangesUsingStarts),e.sort(J.compareRangesUsingStarts);for(let r=0;r<e.length;r++)if(r>=n.length||!n[r].strictContainsRange(e[r]))return!1;return!0}}class b_t{static executeCommands(e,n,r){const s={model:e,selectionsBefore:n,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(s,r);for(let a=0,l=s.trackedRanges.length;a<l;a++)s.model._setTrackedRange(s.trackedRanges[a],null,0);return o}static _innerExecuteCommands(e,n){if(this._arrayIsEmpty(n))return null;const r=this._getEditOperations(e,n);if(r.operations.length===0)return null;const s=r.operations,o=this._getLoserCursorMap(s);if(o.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const a=[];for(let u=0,d=s.length;u<d;u++)o.hasOwnProperty(s[u].identifier.major.toString())||a.push(s[u]);r.hadTrackedEditOperation&&a.length>0&&(a[0]._isTracked=!0);let l=e.model.pushEditOperations(e.selectionsBefore,a,u=>{const d=[];for(let p=0;p<e.selectionsBefore.length;p++)d[p]=[];for(const p of u)p.identifier&&d[p.identifier.major].push(p);const h=(p,g)=>p.identifier.minor-g.identifier.minor,f=[];for(let p=0;p<e.selectionsBefore.length;p++)d[p].length>0?(d[p].sort(h),f[p]=n[p].computeCursorState(e.model,{getInverseEditOperations:()=>d[p],getTrackedSelection:g=>{const m=parseInt(g,10),_=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new Ft(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new Ft(_.endLineNumber,_.endColumn,_.startLineNumber,_.startColumn)}})):f[p]=e.selectionsBefore[p];return f});l||(l=e.selectionsBefore);const c=[];for(const u in o)o.hasOwnProperty(u)&&c.push(parseInt(u,10));c.sort((u,d)=>d-u);for(const u of c)l.splice(u,1);return l}static _arrayIsEmpty(e){for(let n=0,r=e.length;n<r;n++)if(e[n])return!1;return!0}static _getEditOperations(e,n){let r=[],s=!1;for(let o=0,a=n.length;o<a;o++){const l=n[o];if(l){const c=this._getEditOperationsFromCommand(e,o,l);r=r.concat(c.operations),s=s||c.hadTrackedEditOperation}}return{operations:r,hadTrackedEditOperation:s}}static _getEditOperationsFromCommand(e,n,r){const s=[];let o=0;const a=(h,f,p=!1)=>{J.isEmpty(h)&&f===""||s.push({identifier:{major:n,minor:o++},range:h,text:f,forceMoveMarkers:p,isAutoWhitespaceEdit:r.insertsAutoWhitespace})};let l=!1;const d={addEditOperation:a,addTrackedEditOperation:(h,f,p)=>{l=!0,a(h,f,p)},trackSelection:(h,f)=>{const p=Ft.liftSelection(h);let g;if(p.isEmpty())if(typeof f=="boolean")f?g=2:g=3;else{const b=e.model.getLineMaxColumn(p.startLineNumber);p.startColumn===b?g=2:g=3}else g=1;const m=e.trackedRanges.length,_=e.model._setTrackedRange(null,p,g);return e.trackedRanges[m]=_,e.trackedRangesDirection[m]=p.getDirection(),m.toString()}};try{r.getEditOperations(e.model,d)}catch(h){return Ln(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:l}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((r,s)=>-J.compareRangesUsingEnds(r.range,s.range));const n={};for(let r=1;r<e.length;r++){const s=e[r-1],o=e[r];if(J.getStartPosition(s.range).isBefore(J.getEndPosition(o.range))){let a;s.identifier.major>o.identifier.major?a=s.identifier.major:a=o.identifier.major,n[a.toString()]=!0;for(let l=0;l<e.length;l++)e[l].identifier.major===a&&(e.splice(l,1),l<r&&r--,l--);r>0&&r--}}return n}}class y_t{constructor(e,n,r){this.text=e,this.startSelection=n,this.endSelection=r}}class fM{static _capture(e,n){const r=[];for(const s of n){if(s.startLineNumber!==s.endLineNumber)return null;r.push(new y_t(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return r}constructor(e,n){this._original=fM._capture(e,n)}deduceOutcome(e,n){if(!this._original)return null;const r=fM._capture(e,n);if(!r||this._original.length!==r.length)return null;const s=[];for(let o=0,a=this._original.length;o<a;o++)s.push(fM._deduceOutcome(this._original[o],r[o]));return s}static _deduceOutcome(e,n){const r=Math.min(e.startSelection,n.startSelection,ax(e.text,n.text)),s=Math.min(e.text.length-e.endSelection,n.text.length-n.endSelection,F9(e.text,n.text)),o=e.text.substring(r,e.text.length-s),a=n.text.substring(r,n.text.length-s);return new xpt(o,e.startSelection-r,e.endSelection-r,a,n.startSelection-r,n.endSelection-r)}}var w_t=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const sme={getInitialState:()=>FE,tokenizeEncoded:(i,e,n)=>C$(0,n)};function C_t(i,e,n){return w_t(this,void 0,void 0,function*(){if(!n)return ome(e,i.languageIdCodec,sme);const r=yield Zr.getOrCreate(n);return ome(e,i.languageIdCodec,r||sme)})}function S_t(i,e,n,r,s,o,a){let l="<div>",c=r,u=0,d=!0;for(let h=0,f=e.getCount();h<f;h++){const p=e.getEndOffset(h);if(p<=r)continue;let g="";for(;c<p&&c<s;c++){const m=i.charCodeAt(c);switch(m){case 9:{let _=o-(c+u)%o;for(u+=_-1;_>0;)a&&d?(g+="&#160;",d=!1):(g+=" ",d=!0),_--;break}case 60:g+="&lt;",d=!1;break;case 62:g+="&gt;",d=!1;break;case 38:g+="&amp;",d=!1;break;case 0:g+="&#00;",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="<EFBFBD>",d=!1;break;case 13:g+="&#8203",d=!1;break;case 32:a&&d?(g+="&#160;",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(m),d=!1}}if(l+=`<span style="${e.getInlineStyle(h,n)}">${g}</span>`,p>s||c>=s)break}return l+="</div>",l}function ome(i,e,n){let r='<div class="monaco-tokenized-source">';const s=Km(i);let o=n.getInitialState();for(let a=0,l=s.length;a<l;a++){const c=s[a];a>0&&(r+="<br/>");const u=n.tokenizeEncoded(c,!0,o);ko.convertToEndOffset(u.tokens,c.length);const h=new ko(u.tokens,c,e).inflate();let f=0;for(let p=0,g=h.getCount();p<g;p++){const m=h.getClassName(p),_=h.getEndOffset(p);r+=`<span class="${m}">${O9(c.substring(f,_))}</span>`,f=_}o=u.endState}return r+="</div>",r}class x_t{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const n=this._inserts,r=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(n,r,s)}}class k_t{constructor(e,n,r,s,o){this.id=e,this.afterLineNumber=n,this.ordinal=r,this.height=s,this.minWidth=o,this.prefixSum=0}}let _Te=class GJ{constructor(e,n,r,s){this._instanceId=J2e(++GJ.INSTANCE_COUNT),this._pendingChanges=new x_t,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=n,this._paddingTop=r,this._paddingBottom=s}static findInsertionIndex(e,n,r){let s=0,o=e.length;for(;s<o;){const a=s+o>>>1;n===e[a].afterLineNumber?r<e[a].ordinal?o=a:s=a+1:n<e[a].afterLineNumber?o=a:s=a+1}return s}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,n){this._paddingTop=e,this._paddingBottom=n}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let n=!1;try{e({insertWhitespace:(s,o,a,l)=>{n=!0,s=s|0,o=o|0,a=a|0,l=l|0;const c=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new k_t(c,s,o,a,l)),c},changeOneWhitespace:(s,o,a)=>{n=!0,o=o|0,a=a|0,this._pendingChanges.change({id:s,newAfterLineNumber:o,newHeight:a})},removeWhitespace:s=>{n=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return n}_commitPendingChanges(e,n,r){if((e.length>0||r.length>0)&&(this._minWidth=-1),e.length+n.length+r.length<=1){for(const c of e)this._insertWhitespace(c);for(const c of n)this._changeOneWhitespace(c.id,c.newAfterLineNumber,c.newHeight);for(const c of r){const u=this._findWhitespaceIndex(c.id);u!==-1&&this._removeWhitespace(u)}return}const s=new Set;for(const c of r)s.add(c.id);const o=new Map;for(const c of n)o.set(c.id,c);const a=c=>{const u=[];for(const d of c)if(!s.has(d.id)){if(o.has(d.id)){const h=o.get(d.id);d.afterLineNumber=h.newAfterLineNumber,d.height=h.newHeight}u.push(d)}return u},l=a(this._arr).concat(a(e));l.sort((c,u)=>c.afterLineNumber===u.afterLineNumber?c.ordinal-u.ordinal:c.afterLineNumber-u.afterLineNumber),this._arr=l,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const n=GJ.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(n,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)}_findWhitespaceIndex(e){const n=this._arr;for(let r=0,s=n.length;r<s;r++)if(n[r].id===e)return r;return-1}_changeOneWhitespace(e,n,r){const s=this._findWhitespaceIndex(e);if(s!==-1&&(this._arr[s].height!==r&&(this._arr[s].height=r,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,s-1)),this._arr[s].afterLineNumber!==n)){const o=this._arr[s];this._removeWhitespace(s),o.afterLineNumber=n,this._insertWhitespace(o)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,n){this._checkPendingChanges(),e=e|0,n=n|0,this._lineCount-=n-e+1;for(let r=0,s=this._arr.length;r<s;r++){const o=this._arr[r].afterLineNumber;e<=o&&o<=n?this._arr[r].afterLineNumber=e-1:o>n&&(this._arr[r].afterLineNumber-=n-e+1)}}onLinesInserted(e,n){this._checkPendingChanges(),e=e|0,n=n|0,this._lineCount+=n-e+1;for(let r=0,s=this._arr.length;r<s;r++){const o=this._arr[r].afterLineNumber;e<=o&&(this._arr[r].afterLineNumber+=n-e+1)}}getWhitespacesTotalHeight(){return this._checkPendingChanges(),this._arr.length===0?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e=e|0;let n=Math.max(0,this._prefixSumValidIndex+1);n===0&&(this._arr[0].prefixSum=this._arr[0].height,n++);for(let r=n;r<=e;r++)this._arr[r].prefixSum=this._arr[r-1].prefixSum+this._arr[r].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){this._checkPendingChanges();const e=this._lineHeight*this._lineCount,n=this.getWhitespacesTotalHeight();return e+n+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e=e|0;const n=this._findLastWhitespaceBeforeLineNumber(e);return n===-1?0:this.getWhitespacesAccumulatedHeight(n)}_findLastWhitespaceBeforeLineNumber(e){e=e|0;const n=this._arr;let r=0,s=n.length-1;for(;r<=s;){const a=(s-r|0)/2|0,l=r+a|0;if(n[l].afterLineNumber<e){if(l+1>=n.length||n[l+1].afterLineNumber>=e)return l;r=l+1|0}else s=l-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const r=this._findLastWhitespaceBeforeLineNumber(e)+1;return r<this._arr.length?r:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e=e|0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,n=!1){this._checkPendingChanges(),e=e|0;let r;e>1?r=this._lineHeight*(e-1):r=0;const s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(n?1:0));return r+s+this._paddingTop}getVerticalOffsetAfterLineNumber(e,n=!1){this._checkPendingChanges(),e=e|0;const r=this._lineHeight*e,s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(n?1:0));return r+s+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let n=0,r=this._arr.length;n<r;n++)e=Math.max(e,this._arr[n].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){this._checkPendingChanges();const n=this.getLinesTotalHeight();return e>n}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){if(this._paddingBottom===0)return!1;this._checkPendingChanges();const n=this.getLinesTotalHeight();return e>=n-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const n=this._lineCount|0,r=this._lineHeight;let s=1,o=n;for(;s<o;){const a=(s+o)/2|0,l=this.getVerticalOffsetForLineNumber(a)|0;if(e>=l+r)s=a+1;else{if(e>=l)return a;o=a}}return s>n?n:s}getLinesViewportData(e,n){this._checkPendingChanges(),e=e|0,n=n|0;const r=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(s)|0;let a=this._lineCount|0,l=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const c=this.getWhitespacesCount()|0;let u,d;l===-1?(l=c,d=a+1,u=0):(d=this.getAfterLineNumberForWhitespaceIndex(l)|0,u=this.getHeightForWhitespaceIndex(l)|0);let h=o,f=h;const p=5e5;let g=0;o>=p&&(g=Math.floor(o/p)*p,g=Math.floor(g/r)*r,f-=g);const m=[],_=e+(n-e)/2;let b=-1;for(let D=s;D<=a;D++){if(b===-1){const R=h,E=h+r;(R<=_&&_<E||R>_)&&(b=D)}for(h+=r,m[D-s]=f,f+=r;d===D;)f+=u,h+=u,l++,l>=c?d=a+1:(d=this.getAfterLineNumberForWhitespaceIndex(l)|0,u=this.getHeightForWhitespaceIndex(l)|0);if(h>=n){a=D;break}}b===-1&&(b=a);const y=this.getVerticalOffsetForLineNumber(a)|0;let x=s,k=a;return x<k&&o<e&&x++,x<k&&y+r>n&&k--,{bigNumbersDelta:g,startLineNumber:s,endLineNumber:a,relativeVerticalOffset:m,centeredLineNumber:b,completelyVisibleStartLineNumber:x,completelyVisibleEndLineNumber:k}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const n=this.getAfterLineNumberForWhitespaceIndex(e);let r;n>=1?r=this._lineHeight*n:r=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,r+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let n=0,r=this.getWhitespacesCount()-1;if(r<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(r),o=this.getHeightForWhitespaceIndex(r);if(e>=s+o)return-1;for(;n<r;){const a=Math.floor((n+r)/2),l=this.getVerticalOffsetForWhitespaceIndex(a),c=this.getHeightForWhitespaceIndex(a);if(e>=l+c)n=a+1;else{if(e>=l)return a;r=a}}return n}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(n<0||n>=this.getWhitespacesCount())return null;const r=this.getVerticalOffsetForWhitespaceIndex(n);if(r>e)return null;const s=this.getHeightForWhitespaceIndex(n),o=this.getIdForWhitespaceIndex(n),a=this.getAfterLineNumberForWhitespaceIndex(n);return{id:o,afterLineNumber:a,verticalOffset:r,height:s}}getWhitespaceViewportData(e,n){this._checkPendingChanges(),e=e|0,n=n|0;const r=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(r<0)return[];const o=[];for(let a=r;a<=s;a++){const l=this.getVerticalOffsetForWhitespaceIndex(a),c=this.getHeightForWhitespaceIndex(a);if(l>=n)break;o.push({id:this.getIdForWhitespaceIndex(a),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(a),verticalOffset:l,height:c})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};_Te.INSTANCE_COUNT=0;const L_t=125;class _N{constructor(e,n,r,s){e=e|0,n=n|0,r=r|0,s=s|0,e<0&&(e=0),n<0&&(n=0),r<0&&(r=0),s<0&&(s=0),this.width=e,this.contentWidth=n,this.scrollWidth=Math.max(e,n),this.height=r,this.contentHeight=s,this.scrollHeight=Math.max(r,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class D_t extends Le{constructor(e,n){super(),this._onDidContentSizeChange=this._register(new _e),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new _N(0,0,0,0),this._scrollable=this._register(new M5({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:n})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const n=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const r=n.contentWidth!==e.contentWidth,s=n.contentHeight!==e.contentHeight;(r||s)&&this._onDidContentSizeChange.fire(new joe(n.contentWidth,n.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class E_t extends Le{constructor(e,n,r){super(),this._configuration=e;const s=this._configuration.options,o=s.get(143),a=s.get(83);this._linesLayout=new _Te(n,s.get(66),a.top,a.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new D_t(0,r)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new _N(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(113)?L_t:0)}onConfigurationChanged(e){const n=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(n.get(66)),e.hasChanged(83)){const r=n.get(83);this._linesLayout.setPadding(r.top,r.bottom)}if(e.hasChanged(143)){const r=n.get(143),s=r.contentWidth,o=r.height,a=this._scrollable.getScrollDimensions(),l=a.contentWidth;this._scrollable.setScrollDimensions(new _N(s,a.contentWidth,o,this._getContentHeight(s,o,l)))}else this._updateHeight();e.hasChanged(113)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,n){this._linesLayout.onLinesDeleted(e,n)}onLinesInserted(e,n){this._linesLayout.onLinesInserted(e,n)}_getHorizontalScrollbarHeight(e,n){const s=this._configuration.options.get(102);return s.horizontal===2||e>=n?0:s.horizontalScrollbarSize}_getContentHeight(e,n,r){const s=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return s.get(104)?o+=Math.max(0,n-s.get(66)-s.get(83).bottom):o+=this._getHorizontalScrollbarHeight(e,r),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),n=e.width,r=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new _N(n,e.contentWidth,r,this._getContentHeight(n,r,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),n=this._scrollable.getCurrentScrollPosition();return new Jpe(n.scrollTop,n.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),n=this._scrollable.getFutureScrollPosition();return new Jpe(n.scrollTop,n.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,n=this._maxLineWidth,r=e.get(144),s=e.get(50),o=e.get(143);if(r.isViewportWrapping){const a=e.get(72);return n>o.contentWidth+s.typicalHalfwidthCharacterWidth&&a.enabled&&a.side==="right"?n+o.verticalScrollbarWidth:n}else{const a=e.get(103)*s.typicalHalfwidthCharacterWidth,l=this._linesLayout.getWhitespaceMinWidth();return Math.max(n+a+o.verticalScrollbarWidth,l,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new _N(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),n=e.scrollTop,r=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(n),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(r);return{scrollTop:n,scrollTopWithoutViewZones:n-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const n=this._linesLayout.changeWhitespace(e);return n&&this.onHeightMaybeChanged(),n}getVerticalOffsetForLineNumber(e,n=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,n)}getVerticalOffsetAfterLineNumber(e,n=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,n)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const n=this._scrollable.getScrollDimensions();return e+n.height>n.scrollHeight&&(e=n.scrollHeight-n.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+n.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,n){n===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,n){const r=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:r.scrollLeft+e,scrollTop:r.scrollTop+n})}}class I_t{constructor(e,n,r,s,o){this.editorId=e,this.model=n,this.configuration=r,this._linesCollection=s,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const n=e.id;let r=this._decorationsCache[n];if(!r){const s=e.range,o=e.options;let a;if(o.isWholeLine){const l=this._coordinatesConverter.convertModelPositionToViewPosition(new ve(s.startLineNumber,1),0,!1,!0),c=this._coordinatesConverter.convertModelPositionToViewPosition(new ve(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);a=new J(l.lineNumber,l.column,c.lineNumber,c.column)}else a=this._coordinatesConverter.convertModelRangeToViewRange(s,1);r=new sIe(a,o),this._decorationsCache[n]=r}return r}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let n=this._cachedModelDecorationsResolver!==null;return n=n&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),n||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,n=!1,r=!1){const s=new J(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(s,n,r).inlineDecorations[0]}_getDecorationsInRange(e,n,r){const s=this._linesCollection.getDecorationsInRange(e,this.editorId,I9(this.configuration.options),n,r),o=e.startLineNumber,a=e.endLineNumber,l=[];let c=0;const u=[];for(let d=o;d<=a;d++)u[d-o]=[];for(let d=0,h=s.length;d<h;d++){const f=s[d],p=f.options;if(!zoe(this.model,f))continue;const g=this._getOrCreateViewModelDecoration(f),m=g.range;if(l[c++]=g,p.inlineClassName){const _=new tM(m,p.inlineClassName,p.inlineClassNameAffectsLetterSpacing?3:0),b=Math.max(o,m.startLineNumber),y=Math.min(a,m.endLineNumber);for(let x=b;x<=y;x++)u[x-o].push(_)}if(p.beforeContentClassName&&o<=m.startLineNumber&&m.startLineNumber<=a){const _=new tM(new J(m.startLineNumber,m.startColumn,m.startLineNumber,m.startColumn),p.beforeContentClassName,1);u[m.startLineNumber-o].push(_)}if(p.afterContentClassName&&o<=m.endLineNumber&&m.endLineNumber<=a){const _=new tM(new J(m.endLineNumber,m.endColumn,m.endLineNumber,m.endColumn),p.afterContentClassName,2);u[m.endLineNumber-o].push(_)}}return{decorations:l,inlineDecorations:u}}}function zoe(i,e){return!(e.options.hideInCommentTokens&&Voe(i,e)||e.options.hideInStringTokens&&Hoe(i,e))}function Voe(i,e){return vTe(i,e.range,n=>n===1)}function Hoe(i,e){return vTe(i,e.range,n=>n===2)}function vTe(i,e,n){for(let r=e.startLineNumber;r<=e.endLineNumber;r++){const s=i.tokenization.getLineTokens(r),o=r===e.startLineNumber,a=r===e.endLineNumber;let l=o?s.findTokenIndexAtOffset(e.startColumn-1):0;for(;l<s.getCount()&&!(a&&s.getStartOffset(l)>e.endColumn-1);){if(!n(s.getStandardTokenType(l)))return!1;l++}}return!0}function Nq(i,e){return i===null?e?p7.INSTANCE:g7.INSTANCE:new T_t(i,e)}class T_t{constructor(e,n){this._projectionData=e,this._isVisible=n}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,n,r){this._assertVisible();const s=r>0?this._projectionData.breakOffsets[r-1]:0,o=this._projectionData.breakOffsets[r];let a;if(this._projectionData.injectionOffsets!==null){const l=this._projectionData.injectionOffsets.map((u,d)=>new Xp(0,0,u+1,this._projectionData.injectionOptions[d],0));a=Xp.applyInjectedText(e.getLineContent(n),l).substring(s,o)}else a=e.getValueInRange({startLineNumber:n,startColumn:s+1,endLineNumber:n,endColumn:o+1});return r>0&&(a=ame(this._projectionData.wrappedTextIndentLength)+a),a}getViewLineLength(e,n,r){return this._assertVisible(),this._projectionData.getLineLength(r)}getViewLineMinColumn(e,n,r){return this._assertVisible(),this._projectionData.getMinOutputOffset(r)+1}getViewLineMaxColumn(e,n,r){return this._assertVisible(),this._projectionData.getMaxOutputOffset(r)+1}getViewLineData(e,n,r){const s=new Array;return this.getViewLinesData(e,n,r,1,0,[!0],s),s[0]}getViewLinesData(e,n,r,s,o,a,l){this._assertVisible();const c=this._projectionData,u=c.injectionOffsets,d=c.injectionOptions;let h=null;if(u){h=[];let p=0,g=0;for(let m=0;m<c.getOutputLineCount();m++){const _=new Array;h[m]=_;const b=m>0?c.breakOffsets[m-1]:0,y=c.breakOffsets[m];for(;g<u.length;){const x=d[g].content.length,k=u[g]+p,D=k+x;if(k>y)break;if(b<D){const R=d[g];if(R.inlineClassName){const E=m>0?c.wrappedTextIndentLength:0,A=E+Math.max(k-b,0),M=E+Math.min(D-b,y-b);A!==M&&_.push(new Out(A,M,R.inlineClassName,R.inlineClassNameAffectsLetterSpacing))}}if(D<=y)p+=x,g++;else break}}}let f;u?f=e.tokenization.getLineTokens(n).withInserted(u.map((p,g)=>({offset:p,text:d[g].content,tokenMetadata:ko.defaultTokenMetadata}))):f=e.tokenization.getLineTokens(n);for(let p=r;p<r+s;p++){const g=o+p-r;if(!a[g]){l[g]=null;continue}l[g]=this._getViewLineData(f,h?h[p]:null,p)}}_getViewLineData(e,n,r){this._assertVisible();const s=this._projectionData,o=r>0?s.wrappedTextIndentLength:0,a=r>0?s.breakOffsets[r-1]:0,l=s.breakOffsets[r],c=e.sliceAndInflate(a,l,o);let u=c.getLineContent();r>0&&(u=ame(s.wrappedTextIndentLength)+u);const d=this._projectionData.getMinOutputOffset(r)+1,h=u.length+1,f=r+1<this.getViewLineCount(),p=r===0?0:s.breakOffsetsVisibleColumn[r-1];return new uoe(u,f,d,h,p,c,n)}getModelColumnOfViewPosition(e,n){return this._assertVisible(),this._projectionData.translateToInputOffset(e,n-1)+1}getViewPositionOfModelPosition(e,n,r=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(n-1,r).toPosition(e)}getViewLineNumberOfModelPosition(e,n){this._assertVisible();const r=this._projectionData.translateToOutputPosition(n-1);return e+r.outputLineIndex}normalizePosition(e,n,r){const s=n.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,n.column-1,r).toPosition(s)}getInjectedTextAt(e,n){return this._projectionData.getInjectedText(e,n-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}}class p7{constructor(){}isVisible(){return!0}setVisible(e){return e?this:g7.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,n,r){return e.getLineContent(n)}getViewLineLength(e,n,r){return e.getLineLength(n)}getViewLineMinColumn(e,n,r){return e.getLineMinColumn(n)}getViewLineMaxColumn(e,n,r){return e.getLineMaxColumn(n)}getViewLineData(e,n,r){const s=e.tokenization.getLineTokens(n),o=s.getLineContent();return new uoe(o,!1,1,o.length+1,0,s.inflate(),null)}getViewLinesData(e,n,r,s,o,a,l){if(!a[o]){l[o]=null;return}l[o]=this.getViewLineData(e,n,0)}getModelColumnOfViewPosition(e,n){return n}getViewPositionOfModelPosition(e,n){return new ve(e,n)}getViewLineNumberOfModelPosition(e,n){return e}normalizePosition(e,n,r){return n}getInjectedTextAt(e,n){return null}}p7.INSTANCE=new p7;class g7{constructor(){}isVisible(){return!1}setVisible(e){return e?p7.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,n,r){throw new Error("Not supported")}getViewLineLength(e,n,r){throw new Error("Not supported")}getViewLineMinColumn(e,n,r){throw new Error("Not supported")}getViewLineMaxColumn(e,n,r){throw new Error("Not supported")}getViewLineData(e,n,r){throw new Error("Not supported")}getViewLinesData(e,n,r,s,o,a,l){throw new Error("Not supported")}getModelColumnOfViewPosition(e,n){throw new Error("Not supported")}getViewPositionOfModelPosition(e,n){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,n){throw new Error("Not supported")}normalizePosition(e,n,r){throw new Error("Not supported")}getInjectedTextAt(e,n){throw new Error("Not supported")}}g7.INSTANCE=new g7;const Mq=[""];function ame(i){if(i>=Mq.length)for(let e=1;e<=i;e++)Mq[e]=R_t(e);return Mq[i]}function R_t(i){return new Array(i+1).join(" ")}class A_t{constructor(e,n,r,s,o,a,l,c,u,d){this._editorId=e,this.model=n,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=r,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=o,this.tabSize=a,this.wrappingStrategy=l,this.wrappingColumn=c,this.wrappingIndent=u,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new M_t(this)}_constructLines(e,n){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const r=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),o=r.length,a=this.createLineBreaksComputer(),l=new Ev(Xp.fromDecorations(s));for(let m=0;m<o;m++){const _=l.takeWhile(b=>b.lineNumber===m+1);a.addRequest(r[m],_,n?n[m]:null)}const c=a.finalize(),u=[],d=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(J.compareRangesUsingStarts);let h=1,f=0,p=-1,g=p+1<d.length?f+1:o+2;for(let m=0;m<o;m++){const _=m+1;_===g&&(p++,h=d[p].startLineNumber,f=d[p].endLineNumber,g=p+1<d.length?f+1:o+2);const b=_>=h&&_<=f,y=Nq(c[m],!b);u[m]=y.getViewLineCount(),this.modelLineProjections[m]=y}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new mct(u)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const n=e.map(f=>this.model.validateRange(f)),r=N_t(n),s=this.hiddenAreasDecorationIds.map(f=>this.model.getDecorationRange(f)).sort(J.compareRangesUsingStarts);if(r.length===s.length){let f=!1;for(let p=0;p<r.length;p++)if(!r[p].equalsRange(s[p])){f=!0;break}if(!f)return!1}const o=r.map(f=>({range:f,options:kn.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const a=r;let l=1,c=0,u=-1,d=u+1<a.length?c+1:this.modelLineProjections.length+2,h=!1;for(let f=0;f<this.modelLineProjections.length;f++){const p=f+1;p===d&&(u++,l=a[u].startLineNumber,c=a[u].endLineNumber,d=u+1<a.length?c+1:this.modelLineProjections.length+2);let g=!1;if(p>=l&&p<=c?this.modelLineProjections[f].isVisible()&&(this.modelLineProjections[f]=this.modelLineProjections[f].setVisible(!1),g=!0):(h=!0,this.modelLineProjections[f].isVisible()||(this.modelLineProjections[f]=this.modelLineProjections[f].setVisible(!0),g=!0)),g){const m=this.modelLineProjections[f].getViewLineCount();this.projectedModelLineLineCounts.setValue(f,m)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,n){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,n,r,s,o){const a=this.fontInfo.equals(e),l=this.wrappingStrategy===n,c=this.wrappingColumn===r,u=this.wrappingIndent===s,d=this.wordBreak===o;if(a&&l&&c&&u&&d)return!1;const h=a&&l&&!c&&u&&d;this.fontInfo=e,this.wrappingStrategy=n,this.wrappingColumn=r,this.wrappingIndent=s,this.wordBreak=o;let f=null;if(h){f=[];for(let p=0,g=this.modelLineProjections.length;p<g;p++)f[p]=this.modelLineProjections[p].getProjectionData()}return this._constructLines(!1,f),!0}createLineBreaksComputer(){return(this.wrappingStrategy==="advanced"?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,n,r){if(!e||e<=this._validModelVersionId)return null;const s=n===1?1:this.projectedModelLineLineCounts.getPrefixSum(n-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(r);return this.modelLineProjections.splice(n-1,r-n+1),this.projectedModelLineLineCounts.removeValues(n-1,r-n+1),new qJ(s,o)}onModelLinesInserted(e,n,r,s){if(!e||e<=this._validModelVersionId)return null;const o=n>2&&!this.modelLineProjections[n-2].isVisible(),a=n===1?1:this.projectedModelLineLineCounts.getPrefixSum(n-1)+1;let l=0;const c=[],u=[];for(let d=0,h=s.length;d<h;d++){const f=Nq(s[d],!o);c.push(f);const p=f.getViewLineCount();l+=p,u[d]=p}return this.modelLineProjections=this.modelLineProjections.slice(0,n-1).concat(c).concat(this.modelLineProjections.slice(n-1)),this.projectedModelLineLineCounts.insertValues(n-1,u),new KJ(a,a+l-1)}onModelLineChanged(e,n,r){if(e!==null&&e<=this._validModelVersionId)return[!1,null,null,null];const s=n-1,o=this.modelLineProjections[s].getViewLineCount(),a=this.modelLineProjections[s].isVisible(),l=Nq(r,a);this.modelLineProjections[s]=l;const c=this.modelLineProjections[s].getViewLineCount();let u=!1,d=0,h=-1,f=0,p=-1,g=0,m=-1;o>c?(d=this.projectedModelLineLineCounts.getPrefixSum(n-1)+1,h=d+c-1,g=h+1,m=g+(o-c)-1,u=!0):o<c?(d=this.projectedModelLineLineCounts.getPrefixSum(n-1)+1,h=d+o-1,f=h+1,p=f+(c-o)-1,u=!0):(d=this.projectedModelLineLineCounts.getPrefixSum(n-1)+1,h=d+c-1),this.projectedModelLineLineCounts.setValue(s,c);const _=d<=h?new mTe(d,h-d+1):null,b=f<=p?new KJ(f,p):null,y=g<=m?new qJ(g,m):null;return[u,_,b,y]}acceptVersionId(e){this._validModelVersionId=e,this.modelLineProjections.length===1&&!this.modelLineProjections[0].isVisible()&&this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;const n=this.getViewLineCount();return e>n?n:e|0}getActiveIndentGuide(e,n,r){e=this._toValidViewLineNumber(e),n=this._toValidViewLineNumber(n),r=this._toValidViewLineNumber(r);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),a=this.convertViewPositionToModelPosition(r,this.getViewLineMinColumn(r)),l=this.model.guides.getActiveIndentGuide(s.lineNumber,o.lineNumber,a.lineNumber),c=this.convertModelPositionToViewPosition(l.startLineNumber,1),u=this.convertModelPositionToViewPosition(l.endLineNumber,this.model.getLineMaxColumn(l.endLineNumber));return{startLineNumber:c.lineNumber,endLineNumber:u.lineNumber,indent:l.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),r=n.index,s=n.remainder;return new lme(r+1,s)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const n=this.modelLineProjections[e.modelLineNumber-1],r=n.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=n.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,r);return new ve(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const n=this.modelLineProjections[e.modelLineNumber-1],r=n.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=n.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,r);return new ve(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,n){const r=this.getViewLineInfo(e),s=this.getViewLineInfo(n),o=new Array;let a=this.getModelStartPositionOfViewLine(r),l=new Array;for(let c=r.modelLineNumber;c<=s.modelLineNumber;c++){const u=this.modelLineProjections[c-1];if(u.isVisible()){const d=c===r.modelLineNumber?r.modelLineWrappedLineIdx:0,h=c===s.modelLineNumber?s.modelLineWrappedLineIdx+1:u.getViewLineCount();for(let f=d;f<h;f++)l.push(new lme(c,f))}if(!u.isVisible()&&a){const d=new ve(c-1,this.model.getLineMaxColumn(c-1)+1),h=J.fromPositions(a,d);o.push(new cme(h,l)),l=[],a=null}else u.isVisible()&&!a&&(a=new ve(c,1))}if(a){const c=J.fromPositions(a,this.getModelEndPositionOfViewLine(s));o.push(new cme(c,l))}return o}getViewLinesBracketGuides(e,n,r,s){const o=r?this.convertViewPositionToModelPosition(r.lineNumber,r.column):null,a=[];for(const l of this.getViewLineInfosGroupedByModelRanges(e,n)){const c=l.modelRange.startLineNumber,u=this.model.guides.getLinesBracketGuides(c,l.modelRange.endLineNumber,o,s);for(const d of l.viewLines){const f=u[d.modelLineNumber-c].map(p=>{if(p.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,p.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||p.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,p.forWrappedLinesBeforeOrAtColumn).lineNumber<d.modelLineWrappedLineIdx)return;if(!p.horizontalLine)return p;let g=-1;if(p.column!==-1){const b=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,p.column);if(b.lineNumber===d.modelLineWrappedLineIdx)g=b.column;else if(b.lineNumber<d.modelLineWrappedLineIdx)g=this.getMinColumnOfViewLine(d);else if(b.lineNumber>d.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(d.modelLineNumber,p.horizontalLine.endColumn),_=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,p.horizontalLine.endColumn);return _.lineNumber===d.modelLineWrappedLineIdx?new yS(p.visibleColumn,g,p.className,new sM(p.horizontalLine.top,m.column),-1,-1):_.lineNumber<d.modelLineWrappedLineIdx||p.visibleColumn!==-1?void 0:new yS(p.visibleColumn,g,p.className,new sM(p.horizontalLine.top,this.getMaxColumnOfViewLine(d)),-1,-1)});a.push(f.filter(p=>!!p))}}return a}getViewLinesIndentGuides(e,n){e=this._toValidViewLineNumber(e),n=this._toValidViewLineNumber(n);const r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(n,this.getViewLineMaxColumn(n));let o=[];const a=[],l=[],c=r.lineNumber-1,u=s.lineNumber-1;let d=null;for(let g=c;g<=u;g++){const m=this.modelLineProjections[g];if(m.isVisible()){const _=m.getViewLineNumberOfModelPosition(0,g===c?r.column:1),b=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),y=b-_+1;let x=0;y>1&&m.getViewLineMinColumn(this.model,g+1,b)===1&&(x=_===0?1:2),a.push(y),l.push(x),d===null&&(d=new ve(g+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const h=n-e+1,f=new Array(h);let p=0;for(let g=0,m=o.length;g<m;g++){let _=o[g];const b=Math.min(h-p,a[g]),y=l[g];let x;y===2?x=0:y===1?x=1:x=b;for(let k=0;k<b;k++)k===x&&(_=0),f[p++]=_}return f}getViewLineContent(e){const n=this.getViewLineInfo(e);return this.modelLineProjections[n.modelLineNumber-1].getViewLineContent(this.model,n.modelLineNumber,n.modelLineWrappedLineIdx)}getViewLineLength(e){const n=this.getViewLineInfo(e);return this.modelLineProjections[n.modelLineNumber-1].getViewLineLength(this.model,n.modelLineNumber,n.modelLineWrappedLineIdx)}getViewLineMinColumn(e){const n=this.getViewLineInfo(e);return this.modelLineProjections[n.modelLineNumber-1].getViewLineMinColumn(this.model,n.modelLineNumber,n.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){const n=this.getViewLineInfo(e);return this.modelLineProjections[n.modelLineNumber-1].getViewLineMaxColumn(this.model,n.modelLineNumber,n.modelLineWrappedLineIdx)}getViewLineData(e){const n=this.getViewLineInfo(e);return this.modelLineProjections[n.modelLineNumber-1].getViewLineData(this.model,n.modelLineNumber,n.modelLineWrappedLineIdx)}getViewLinesData(e,n,r){e=this._toValidViewLineNumber(e),n=this._toValidViewLineNumber(n);const s=this.projectedModelLineLineCounts.getIndexOf(e-1);let o=e;const a=s.index,l=s.remainder,c=[];for(let u=a,d=this.model.getLineCount();u<d;u++){const h=this.modelLineProjections[u];if(!h.isVisible())continue;const f=u===a?l:0;let p=h.getViewLineCount()-f,g=!1;if(o+p>n&&(g=!0,p=n-o+1),h.getViewLinesData(this.model,u+1,f,p,o-e,r,c),o+=p,g)break}return c}validateViewPosition(e,n,r){e=this._toValidViewLineNumber(e);const s=this.projectedModelLineLineCounts.getIndexOf(e-1),o=s.index,a=s.remainder,l=this.modelLineProjections[o],c=l.getViewLineMinColumn(this.model,o+1,a),u=l.getViewLineMaxColumn(this.model,o+1,a);n<c&&(n=c),n>u&&(n=u);const d=l.getModelColumnOfViewPosition(a,n);return this.model.validatePosition(new ve(o+1,d)).equals(r)?new ve(e,n):this.convertModelPositionToViewPosition(r.lineNumber,r.column)}validateViewRange(e,n){const r=this.validateViewPosition(e.startLineNumber,e.startColumn,n.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,n.getEndPosition());return new J(r.lineNumber,r.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,n){const r=this.getViewLineInfo(e),s=this.modelLineProjections[r.modelLineNumber-1].getModelColumnOfViewPosition(r.modelLineWrappedLineIdx,n);return this.model.validatePosition(new ve(r.modelLineNumber,s))}convertViewRangeToModelRange(e){const n=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),r=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new J(n.lineNumber,n.column,r.lineNumber,r.column)}convertModelPositionToViewPosition(e,n,r=2,s=!1,o=!1){const a=this.model.validatePosition(new ve(e,n)),l=a.lineNumber,c=a.column;let u=l-1,d=!1;if(o)for(;u<this.modelLineProjections.length&&!this.modelLineProjections[u].isVisible();)u++,d=!0;else for(;u>0&&!this.modelLineProjections[u].isVisible();)u--,d=!0;if(u===0&&!this.modelLineProjections[u].isVisible())return new ve(s?0:1,1);const h=1+this.projectedModelLineLineCounts.getPrefixSum(u);let f;return d?o?f=this.modelLineProjections[u].getViewPositionOfModelPosition(h,1,r):f=this.modelLineProjections[u].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(u+1),r):f=this.modelLineProjections[l-1].getViewPositionOfModelPosition(h,c,r),f}convertModelRangeToViewRange(e,n=0){if(e.isEmpty()){const r=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,n);return J.fromPositions(r)}else{const r=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new J(r.lineNumber,r.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,n){let r=e-1;if(this.modelLineProjections[r].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(r);return this.modelLineProjections[r].getViewLineNumberOfModelPosition(o,n)}for(;r>0&&!this.modelLineProjections[r].isVisible();)r--;if(r===0&&!this.modelLineProjections[r].isVisible())return 1;const s=1+this.projectedModelLineLineCounts.getPrefixSum(r);return this.modelLineProjections[r].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(r+1))}getDecorationsInRange(e,n,r,s,o){const a=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),l=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(l.lineNumber-a.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new J(a.lineNumber,1,l.lineNumber,l.column),n,r,s,o);let c=[];const u=a.lineNumber-1,d=l.lineNumber-1;let h=null;for(let m=u;m<=d;m++)if(this.modelLineProjections[m].isVisible())h===null&&(h=new ve(m+1,m===u?a.column:1));else if(h!==null){const b=this.model.getLineMaxColumn(m);c=c.concat(this.model.getDecorationsInRange(new J(h.lineNumber,h.column,m,b),n,r,s)),h=null}h!==null&&(c=c.concat(this.model.getDecorationsInRange(new J(h.lineNumber,h.column,l.lineNumber,l.column),n,r,s)),h=null),c.sort((m,_)=>{const b=J.compareRangesUsingStarts(m.range,_.range);return b===0?m.id<_.id?-1:m.id>_.id?1:0:b});const f=[];let p=0,g=null;for(const m of c){const _=m.id;g!==_&&(g=_,f[p++]=m)}return f}getInjectedTextAt(e){const n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].getInjectedTextAt(n.modelLineWrappedLineIdx,e.column)}normalizePosition(e,n){const r=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[r.modelLineNumber-1].normalizePosition(r.modelLineWrappedLineIdx,e,n)}getLineIndentColumn(e){const n=this.getViewLineInfo(e);return n.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(n.modelLineNumber):0}}function N_t(i){if(i.length===0)return[];const e=i.slice();e.sort(J.compareRangesUsingStarts);const n=[];let r=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,a=e.length;o<a;o++){const l=e[o];l.startLineNumber>s+1?(n.push(new J(r,1,s,1)),r=l.startLineNumber,s=l.endLineNumber):l.endLineNumber>s&&(s=l.endLineNumber)}return n.push(new J(r,1,s,1)),n}class lme{constructor(e,n){this.modelLineNumber=e,this.modelLineWrappedLineIdx=n}}class cme{constructor(e,n){this.modelRange=e,this.viewLines=n}}class M_t{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,n){return this._lines.validateViewPosition(e.lineNumber,e.column,n)}validateViewRange(e,n){return this._lines.validateViewRange(e,n)}convertModelPositionToViewPosition(e,n,r,s){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,n,r,s)}convertModelRangeToViewRange(e,n){return this._lines.convertModelRangeToViewRange(e,n)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,n){return this._lines.getViewLineNumberOfModelPosition(e,n)}}class P_t{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new O_t(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,n,r,s){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(n,r,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,n,r){return new qJ(n,r)}onModelLinesInserted(e,n,r,s){return new KJ(n,r)}onModelLineChanged(e,n,r){return[!1,new mTe(n,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,n,r){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,n,r){return new Array(n-e+1).fill([])}getViewLinesIndentGuides(e,n){const r=n-e+1,s=new Array(r);for(let o=0;o<r;o++)s[o]=0;return s}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){const n=this.model.tokenization.getLineTokens(e),r=n.getLineContent();return new uoe(r,!1,1,r.length+1,0,n.inflate(),null)}getViewLinesData(e,n,r){const s=this.model.getLineCount();e=Math.min(Math.max(1,e),s),n=Math.min(Math.max(1,n),s);const o=[];for(let a=e;a<=n;a++){const l=a-e;o[l]=r[l]?this.getViewLineData(a):null}return o}getDecorationsInRange(e,n,r,s,o){return this.model.getDecorationsInRange(e,n,r,s,o)}normalizePosition(e,n){return this.model.normalizePosition(e,n)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class O_t{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,n){return this._validPosition(n)}validateViewRange(e,n){return this._validRange(n)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const n=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>n)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,n){return e}}let F_t=class extends Le{constructor(e,n,r,s,o,a,l,c,u){if(super(),this.languageConfigurationService=l,this._themeService=c,this._attachedView=u,this.hiddenAreasModel=new j_t,this.previousHiddenAreas=[],this._editorId=e,this._configuration=n,this.model=r,this._eventDispatcher=new a_t,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new JL(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new Ji(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=Uoe.create(this.model),this.model.isTooLargeForTokenization())this._lines=new P_t(this.model);else{const d=this._configuration.options,h=d.get(50),f=d.get(137),p=d.get(144),g=d.get(136),m=d.get(128);this._lines=new A_t(this._editorId,this.model,s,o,h,this.model.getOptions().tabSize,f,p.wrappingColumn,g,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new v_t(r,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new E_t(this._configuration,this.getLineCount(),a)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new n_t(d)),this._eventDispatcher.emitOutgoingEvent(new $oe(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new I_t(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const h=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(h,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(j5.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new s_t)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new i_t(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),n=new J(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(n)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new e_t(e)),this._eventDispatcher.emitOutgoingEvent(new Woe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Ymt)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Zmt)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new ve(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),n=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new dme(n,this._viewportStart.startLineDelta)}return new dme(null,0)}_onConfigurationChanged(e,n){const r=this._captureStableViewport(),s=this._configuration.options,o=s.get(50),a=s.get(137),l=s.get(144),c=s.get(136),u=s.get(128);this._lines.setWrappingSettings(o,a,l.wrappingColumn,c,u)&&(e.emitViewEvent(new r6),e.emitViewEvent(new s6),e.emitViewEvent(new iD(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),n.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new iD(null))),e.emitViewEvent(new Qmt(n)),this.viewLayout.onConfigurationChanged(n),r.recoverViewportStart(this.coordinatesConverter,this.viewLayout),JL.shouldRecreate(n)&&(this.cursorConfig=new JL(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const r=this._eventDispatcher.beginEmitViewEvents();let s=!1,o=!1;const a=e instanceof BS?e.rawContentChangedEvent.changes:e.changes,l=e instanceof BS?e.rawContentChangedEvent.versionId:null,c=this._lines.createLineBreaksComputer();for(const h of a)switch(h.changeType){case 4:{for(let f=0;f<h.detail.length;f++){const p=h.detail[f];let g=h.injectedTexts[f];g&&(g=g.filter(m=>!m.ownerId||m.ownerId===this._editorId)),c.addRequest(p,g,null)}break}case 2:{let f=null;h.injectedText&&(f=h.injectedText.filter(p=>!p.ownerId||p.ownerId===this._editorId)),c.addRequest(h.detail,f,null);break}}const u=c.finalize(),d=new Ev(u);for(const h of a)switch(h.changeType){case 1:{this._lines.onModelFlushed(),r.emitViewEvent(new r6),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),s=!0;break}case 3:{const f=this._lines.onModelLinesDeleted(l,h.fromLineNumber,h.toLineNumber);f!==null&&(r.emitViewEvent(f),this.viewLayout.onLinesDeleted(f.fromLineNumber,f.toLineNumber)),s=!0;break}case 4:{const f=d.takeCount(h.detail.length),p=this._lines.onModelLinesInserted(l,h.fromLineNumber,h.toLineNumber,f);p!==null&&(r.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),s=!0;break}case 2:{const f=d.dequeue(),[p,g,m,_]=this._lines.onModelLineChanged(l,h.lineNumber,f);o=p,g&&r.emitViewEvent(g),m&&(r.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),_&&(r.emitViewEvent(_),this.viewLayout.onLinesDeleted(_.fromLineNumber,_.toLineNumber));break}case 5:break}l!==null&&this._lines.acceptVersionId(l),this.viewLayout.onHeightMaybeChanged(),!s&&o&&(r.emitViewEvent(new s6),r.emitViewEvent(new iD(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const n=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&n){const r=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(r){const s=this.coordinatesConverter.convertModelPositionToViewPosition(r.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const r=this._eventDispatcher.beginEmitViewEvents();e instanceof BS&&r.emitOutgoingEvent(new g_t(e.contentChangedEvent)),this._cursor.onModelContentChanged(r,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const n=[];for(let r=0,s=e.ranges.length;r<s;r++){const o=e.ranges[r],a=this.coordinatesConverter.convertModelPositionToViewPosition(new ve(o.fromLineNumber,1)).lineNumber,l=this.coordinatesConverter.convertModelPositionToViewPosition(new ve(o.toLineNumber,this.model.getLineMaxColumn(o.toLineNumber))).lineNumber;n[r]={fromLineNumber:a,toLineNumber:l}}this._eventDispatcher.emitSingleViewEvent(new r_t(n)),this._eventDispatcher.emitOutgoingEvent(new __t(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new t_t),this.cursorConfig=new JL(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new p_t(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new JL(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new f_t(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const n=this._eventDispatcher.beginEmitViewEvents();n.emitViewEvent(new r6),n.emitViewEvent(new s6),n.emitViewEvent(new iD(null)),this._cursor.onLineMappingChanged(n),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new JL(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new m_t(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new iD(e)),this._eventDispatcher.emitOutgoingEvent(new h_t(e))}))}setHiddenAreas(e,n){this.hiddenAreasModel.setHiddenAreas(n,e);const r=this.hiddenAreasModel.getMergedRanges();if(r===this.previousHiddenAreas)return;this.previousHiddenAreas=r;const s=this._captureStableViewport();let o=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(r),o&&(a.emitViewEvent(new r6),a.emitViewEvent(new s6),a.emitViewEvent(new iD(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new u_t)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),n=this._configuration.options.get(66),r=Math.max(20,Math.round(e.height/n)),s=this.viewLayout.getLinesViewportData(),o=Math.max(1,s.completelyVisibleStartLineNumber-r),a=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+r);return this._toModelVisibleRanges(new J(o,this.getLineMinColumn(o),a,this.getLineMaxColumn(a)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const n=this.coordinatesConverter.convertViewRangeToModelRange(e),r=this._lines.getHiddenAreas();if(r.length===0)return[n];const s=[];let o=0,a=n.startLineNumber,l=n.startColumn;const c=n.endLineNumber,u=n.endColumn;for(let d=0,h=r.length;d<h;d++){const f=r[d].startLineNumber,p=r[d].endLineNumber;p<a||f>c||(a<f&&(s[o++]=new J(a,l,f-1,this.model.getLineMaxColumn(f-1))),a=p+1,l=1)}return(a<c||a===c&&l<u)&&(s[o++]=new J(a,l,c,u)),s}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),n=e.completelyVisibleStartLineNumber,r=e.completelyVisibleEndLineNumber;return new J(n,this.getLineMinColumn(n),r,this.getLineMaxColumn(r))}getCompletelyVisibleViewRangeAtScrollTop(e){const n=this.viewLayout.getLinesViewportDataAtScrollTop(e),r=n.completelyVisibleStartLineNumber,s=n.completelyVisibleEndLineNumber;return new J(r,this.getLineMinColumn(r),s,this.getLineMaxColumn(s))}saveState(){const e=this.viewLayout.saveState(),n=e.scrollTop,r=this.viewLayout.getLineNumberAtVerticalOffset(n),s=this.coordinatesConverter.convertViewPositionToModelPosition(new ve(r,this.getLineMinColumn(r))),o=this.viewLayout.getVerticalOffsetForLineNumber(r)-n;return{scrollLeft:e.scrollLeft,firstPosition:s,firstPositionDeltaTop:o}}reduceRestoreState(e){if(typeof e.firstPosition>"u")return this._reduceRestoreStateCompatibility(e);const n=this.model.validatePosition(e.firstPosition),r=this.coordinatesConverter.convertModelPositionToViewPosition(n),s=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,n,r){this._viewportStart.update(this,e)}getActiveIndentGuide(e,n,r){return this._lines.getActiveIndentGuide(e,n,r)}getLinesIndentGuides(e,n){return this._lines.getViewLinesIndentGuides(e,n)}getBracketGuidesInRangeByLine(e,n,r,s){return this._lines.getViewLinesBracketGuides(e,n,r,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const n=ml(this.getLineContent(e));return n===-1?0:n+1}getLineLastNonWhitespaceColumn(e){const n=$p(this.getLineContent(e));return n===-1?0:n+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,n){const s=this._decorations.getDecorationsViewportData(e).inlineDecorations[n-e.startLineNumber];return this._getViewLineRenderingData(n,s)}getViewLineRenderingData(e){const n=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,n)}_getViewLineRenderingData(e,n){const r=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),a=this._lines.getViewLineData(e);return a.inlineDecorations&&(n=[...n,...a.inlineDecorations.map(l=>l.toInlineDecoration(e))]),new fd(a.minColumn,a.maxColumn,a.content,a.continuesWithWrappedLine,r,s,a.tokens,n,o,a.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,n,r){const s=this._lines.getViewLinesData(e,n,r);return new Put(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const n=this.model.getOverviewRulerDecorations(this._editorId,I9(this._configuration.options)),r=new B_t;for(const s of n){const o=s.options,a=o.overviewRuler;if(!a)continue;const l=a.position;if(l===0)continue;const c=a.getColor(e.value),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);r.accept(c,o.zIndex,u,d,l)}return r.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const n of e){const r=n.options.overviewRuler;r==null||r.invalidateCachedColor();const s=n.options.minimap;s==null||s.invalidateCachedColor()}}getValueInRange(e,n){const r=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(r,n)}getValueLengthInRange(e,n){const r=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(r,n)}modifyPosition(e,n){const r=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(r,n)}deduceModelPositionRelativeToViewPosition(e,n,r){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(n<0?n-=r:n+=r);const a=this.model.getOffsetAt(s)+n;return this.model.getPositionAt(a)}getPlainTextToCopy(e,n,r){const s=r?`\r
`:this.model.getEOL();e=e.slice(0),e.sort(J.compareRangesUsingStarts);let o=!1,a=!1;for(const c of e)c.isEmpty()?o=!0:a=!0;if(!a){if(!n)return"";const c=e.map(d=>d.startLineNumber);let u="";for(let d=0;d<c.length;d++)d>0&&c[d-1]===c[d]||(u+=this.model.getLineContent(c[d])+s);return u}if(o&&n){const c=[];let u=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==u&&c.push(this.model.getLineContent(h)):c.push(this.model.getValueInRange(d,r?2:0)),u=h}return c.length===1?c[0]:c}const l=[];for(const c of e)c.isEmpty()||l.push(this.model.getValueInRange(c,r?2:0));return l.length===1?l[0]:l}getRichTextToCopy(e,n){const r=this.model.getLanguageId();if(r===ad||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!n)return null;const d=s.startLineNumber;s=new J(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(50),a=this._getColorMap(),c=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===su.fontFamily;let u;return c?u=su.fontFamily:(u=o.fontFamily,u=u.replace(/"/g,"'"),/[,']/.test(u)||/[+ ]/.test(u)&&(u=`'${u}'`),u=`${u}, ${su.fontFamily}`),{mode:r,html:`<div style="color: ${a[1]};background-color: ${a[2]};font-family: ${u};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(s,a)+"</div>"}}_getHTMLToCopy(e,n){const r=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,a=e.endColumn,l=this.getTabSize();let c="";for(let u=r;u<=o;u++){const d=this.model.tokenization.getLineTokens(u),h=d.getLineContent(),f=u===r?s-1:0,p=u===o?a-1:h.length;h===""?c+="<br>":c+=S_t(h,d.inflate(),n,f,p,l,Aa)}return c}_getColorMap(){const e=Zr.getColorMap(),n=["#000000"];if(e)for(let r=1,s=e.length;r<s;r++)n[r]=Te.Format.CSS.formatHex(e[r]);return n}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,n,r){return this._withViewEventsCollector(s=>this._cursor.setStates(s,e,n,r))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,n,r=0){this._withViewEventsCollector(s=>this._cursor.setSelections(s,e,n,r))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(n=>this._cursor.restoreState(n,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new d_t);return}this._withViewEventsCollector(e)}executeEdits(e,n,r){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,n,r))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(n=>this._cursor.endComposition(n,e))}type(e,n){this._executeCursorEdit(r=>this._cursor.type(r,e,n))}compositionType(e,n,r,s,o){this._executeCursorEdit(a=>this._cursor.compositionType(a,e,n,r,s,o))}paste(e,n,r,s){this._executeCursorEdit(o=>this._cursor.paste(o,e,n,r,s))}cut(e){this._executeCursorEdit(n=>this._cursor.cut(n,e))}executeCommand(e,n){this._executeCursorEdit(r=>this._cursor.executeCommand(r,e,n))}executeCommands(e,n){this._executeCursorEdit(r=>this._cursor.executeCommands(r,e,n))}revealPrimaryCursor(e,n,r=!1){this._withViewEventsCollector(s=>this._cursor.revealPrimary(s,e,r,0,n,0))}revealTopMostCursor(e){const n=this._cursor.getTopMostViewPosition(),r=new J(n.lineNumber,n.column,n.lineNumber,n.column);this._withViewEventsCollector(s=>s.emitViewEvent(new v8(e,!1,r,null,0,!0,0)))}revealBottomMostCursor(e){const n=this._cursor.getBottomMostViewPosition(),r=new J(n.lineNumber,n.column,n.lineNumber,n.column);this._withViewEventsCollector(s=>s.emitViewEvent(new v8(e,!1,r,null,0,!0,0)))}revealRange(e,n,r,s,o){this._withViewEventsCollector(a=>a.emitViewEvent(new v8(e,!1,r,null,s,n,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new o_t),this._eventDispatcher.emitOutgoingEvent(new c_t))}_withViewEventsCollector(e){try{const n=this._eventDispatcher.beginEmitViewEvents();return e(n)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,n){return this._lines.normalizePosition(e,n)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class Uoe{static create(e){const n=e._setTrackedRange(null,new J(1,1,1,1),1);return new Uoe(e,1,!1,n,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,n,r,s,o){this._model=e,this._viewLineNumber=n,this._isValid=r,this._modelTrackedRange=s,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,n){const r=e.coordinatesConverter.convertViewPositionToModelPosition(new ve(n,e.getLineMinColumn(n))),s=e.model._setTrackedRange(this._modelTrackedRange,new J(r.lineNumber,r.column,r.lineNumber,r.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(n),a=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=n,this._isValid=!0,this._modelTrackedRange=s,this._startLineDelta=a-o}invalidate(){this._isValid=!1}}class B_t{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,n,r,s,o){const a=this._asMap[e];if(a){const l=a.data,c=l[l.length-3],u=l[l.length-1];if(c===o&&u+1>=r){s>u&&(l[l.length-1]=s);return}l.push(o,r,s)}else{const l=new bP(e,n,[o,r,s]);this._asMap[e]=l,this.asArray.push(l)}}}class j_t{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,n){const r=this.hiddenAreas.get(e);r&&ume(r,n)||(this.hiddenAreas.set(e,n),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((n,r)=>W_t(n,r),[]);return ume(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function W_t(i,e){const n=[];let r=0,s=0;for(;r<i.length&&s<e.length;){const o=i[r],a=e[s];if(o.endLineNumber<a.startLineNumber-1)n.push(i[r++]);else if(a.endLineNumber<o.startLineNumber-1)n.push(e[s++]);else{const l=Math.min(o.startLineNumber,a.startLineNumber),c=Math.max(o.endLineNumber,a.endLineNumber);n.push(new J(l,1,c,1)),r++,s++}}for(;r<i.length;)n.push(i[r++]);for(;s<e.length;)n.push(e[s++]);return n}function ume(i,e){if(i.length!==e.length)return!1;for(let n=0;n<i.length;n++)if(!i[n].equalsRange(e[n]))return!1;return!0}class dme{constructor(e,n){this.viewportStartModelPosition=e,this.startLineDelta=n}recoverViewportStart(e,n){if(!this.viewportStartModelPosition)return;const r=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),s=n.getVerticalOffsetForLineNumber(r.lineNumber);n.setScrollPosition({scrollTop:s+this.startLineDelta},1)}}class O${constructor(...e){this._entries=new Map;for(const[n,r]of e)this.set(n,r)}set(e,n){const r=this._entries.get(e);return this._entries.set(e,n),r}get(e){return this._entries.get(e)}}var BP;(function(i){i[i.Ignore=0]="Ignore",i[i.Info=1]="Info",i[i.Warning=2]="Warning",i[i.Error=3]="Error"})(BP||(BP={}));(function(i){const e="error",n="warning",r="warn",s="info",o="ignore";function a(c){return c?n2(e,c)?i.Error:n2(n,c)||n2(r,c)?i.Warning:n2(s,c)?i.Info:i.Ignore:i.Ignore}i.fromValue=a;function l(c){switch(c){case i.Error:return e;case i.Warning:return n;case i.Info:return s;default:return o}}i.toString=l})(BP||(BP={}));const vs=BP;var F$=vs;const Ps=qn("notificationService");class $_t{}class pM{constructor(e,n,r,s,o){this.injectionOffsets=e,this.injectionOptions=n,this.breakOffsets=r,this.breakOffsetsVisibleColumn=s,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const n=e>0?this.breakOffsets[e-1]:0;let s=this.breakOffsets[e]-n;return e>0&&(s+=this.wrappedTextIndentLength),s}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,n){e>0&&(n=Math.max(0,n-this.wrappedTextIndentLength));let s=e===0?n:this.breakOffsets[e-1]+n;if(this.injectionOffsets!==null)for(let o=0;o<this.injectionOffsets.length&&s>this.injectionOffsets[o];o++)s<this.injectionOffsets[o]+this.injectionOptions[o].content.length?s=this.injectionOffsets[o]:s-=this.injectionOptions[o].content.length;return s}translateToOutputPosition(e,n=2){let r=e;if(this.injectionOffsets!==null)for(let s=0;s<this.injectionOffsets.length&&!(e<this.injectionOffsets[s]||n!==1&&e===this.injectionOffsets[s]);s++)r+=this.injectionOptions[s].content.length;return this.offsetInInputWithInjectionsToOutputPosition(r,n)}offsetInInputWithInjectionsToOutputPosition(e,n=2){let r=0,s=this.breakOffsets.length-1,o=0,a=0;for(;r<=s;){o=r+(s-r)/2|0;const c=this.breakOffsets[o];if(a=o>0?this.breakOffsets[o-1]:0,n===0)if(e<=a)s=o-1;else if(e>c)r=o+1;else break;else if(e<a)s=o-1;else if(e>=c)r=o+1;else break}let l=e-a;return o>0&&(l+=this.wrappedTextIndentLength),new o6(o,l)}normalizeOutputPosition(e,n,r){if(this.injectionOffsets!==null){const s=this.outputPositionToOffsetInInputWithInjections(e,n),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(s,r);if(o!==s)return this.offsetInInputWithInjectionsToOutputPosition(o,r)}if(r===0){if(e>0&&n===this.getMinOutputOffset(e))return new o6(e-1,this.getMaxOutputOffset(e-1))}else if(r===1){const s=this.getOutputLineCount()-1;if(e<s&&n===this.getMaxOutputOffset(e))return new o6(e+1,this.getMinOutputOffset(e+1))}return new o6(e,n)}outputPositionToOffsetInInputWithInjections(e,n){return e>0&&(n=Math.max(0,n-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+n}normalizeOffsetInInputWithInjectionsAroundInjections(e,n){const r=this.getInjectedTextAtOffset(e);if(!r)return e;if(n===2){if(e===r.offsetInInputWithInjections+r.length&&hme(this.injectionOptions[r.injectedTextIndex].cursorStops))return r.offsetInInputWithInjections+r.length;{let s=r.offsetInInputWithInjections;if(fme(this.injectionOptions[r.injectedTextIndex].cursorStops))return s;let o=r.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[r.injectedTextIndex]&&!(hme(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,fme(this.injectionOptions[o].cursorStops)));)o--;return s}}else if(n===1||n===4){let s=r.offsetInInputWithInjections+r.length,o=r.injectedTextIndex;for(;o+1<this.injectionOffsets.length&&this.injectionOffsets[o+1]===this.injectionOffsets[o];)s+=this.injectionOptions[o+1].content.length,o++;return s}else if(n===0||n===3){let s=r.offsetInInputWithInjections,o=r.injectedTextIndex;for(;o-1>=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)s-=this.injectionOptions[o-1].content.length,o--;return s}l$()}getInjectedText(e,n){const r=this.outputPositionToOffsetInInputWithInjections(e,n),s=this.getInjectedTextAtOffset(r);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const n=this.injectionOffsets,r=this.injectionOptions;if(n!==null){let s=0;for(let o=0;o<n.length;o++){const a=r[o].content.length,l=n[o]+s,c=n[o]+s+a;if(l>e)break;if(e<=c)return{injectedTextIndex:o,offsetInInputWithInjections:l,length:a};s+=a}}}}function hme(i){return i==null?!0:i===Mp.Right||i===Mp.Both}function fme(i){return i==null?!0:i===Mp.Left||i===Mp.Both}class o6{constructor(e,n){this.outputLineIndex=e,this.outputOffset=n}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new ve(e+this.outputLineIndex,this.outputOffset+1)}}class qoe{static create(e){return new qoe(e.get(132),e.get(131))}constructor(e,n){this.classifier=new z_t(e,n)}createLineBreaksComputer(e,n,r,s,o){const a=[],l=[],c=[];return{addRequest:(u,d,h)=>{a.push(u),l.push(d),c.push(h)},finalize:()=>{const u=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let h=0,f=a.length;h<f;h++){const p=l[h],g=c[h];g&&!g.injectionOptions&&!p?d[h]=V_t(this.classifier,g,a[h],n,r,u,s,o):d[h]=H_t(this.classifier,a[h],p,n,r,u,s,o)}return XJ.length=0,YJ.length=0,d}}}}class z_t extends WI{constructor(e,n){super(0);for(let r=0;r<e.length;r++)this.set(e.charCodeAt(r),1);for(let r=0;r<n.length;r++)this.set(n.charCodeAt(r),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let XJ=[],YJ=[];function V_t(i,e,n,r,s,o,a,l){if(s===-1)return null;const c=n.length;if(c<=1)return null;const u=l==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,f=bTe(n,r,s,o,a),p=s-f,g=XJ,m=YJ;let _=0,b=0,y=0,x=s;const k=d.length;let D=0;if(D>=0){let R=Math.abs(h[D]-x);for(;D+1<k;){const E=Math.abs(h[D+1]-x);if(E>=R)break;R=E,D++}}for(;D<k;){let R=D<0?0:d[D],E=D<0?0:h[D];b>R&&(R=b,E=y);let A=0,M=0,N=0,P=0;if(E<=x){let B=E,j=R===0?0:n.charCodeAt(R-1),z=R===0?0:i.get(j),H=!0;for(let Y=R;Y<c;Y++){const X=Y,Q=n.charCodeAt(Y);let ie,K;if(xo(Q)?(Y++,ie=0,K=2):(ie=i.get(Q),K=gM(Q,B,r,o)),X>b&&ZJ(j,z,Q,ie,u)&&(A=X,M=B),B+=K,B>x){X>b?(N=X,P=B-K):(N=Y+1,P=B),B-M>p&&(A=0),H=!1;break}j=Q,z=ie}if(H){_>0&&(g[_]=d[d.length-1],m[_]=h[d.length-1],_++);break}}if(A===0){let B=E,j=n.charCodeAt(R),z=i.get(j),H=!1;for(let Y=R-1;Y>=b;Y--){const X=Y+1,Q=n.charCodeAt(Y);if(Q===9){H=!0;break}let ie,K;if(lx(Q)?(Y--,ie=0,K=2):(ie=i.get(Q),K=d1(Q)?o:1),B<=x){if(N===0&&(N=X,P=B),B<=x-p)break;if(ZJ(Q,ie,j,z,u)){A=X,M=B;break}}B-=K,j=Q,z=ie}if(A!==0){const Y=p-(P-M);if(Y<=r){const X=n.charCodeAt(N);let Q;xo(X)?Q=2:Q=gM(X,P,r,o),Y-Q<0&&(A=0)}}if(H){D--;continue}}if(A===0&&(A=N,M=P),A<=b){const B=n.charCodeAt(b);xo(B)?(A=b+2,M=y+2):(A=b+1,M=y+gM(B,y,r,o))}for(b=A,g[_]=A,y=M,m[_]=M,_++,x=M+p;D<0||D<k&&h[D]<M;)D++;let O=Math.abs(h[D]-x);for(;D+1<k;){const B=Math.abs(h[D+1]-x);if(B>=O)break;O=B,D++}}return _===0?null:(g.length=_,m.length=_,XJ=e.breakOffsets,YJ=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=f,e)}function H_t(i,e,n,r,s,o,a,l){const c=Xp.applyInjectedText(e,n);let u,d;if(n&&n.length>0?(u=n.map(M=>M.options),d=n.map(M=>M.column-1)):(u=null,d=null),s===-1)return u?new pM(d,u,[c.length],[],0):null;const h=c.length;if(h<=1)return u?new pM(d,u,[c.length],[],0):null;const f=l==="keepAll",p=bTe(c,r,s,o,a),g=s-p,m=[],_=[];let b=0,y=0,x=0,k=s,D=c.charCodeAt(0),R=i.get(D),E=gM(D,0,r,o),A=1;xo(D)&&(E+=1,D=c.charCodeAt(1),R=i.get(D),A++);for(let M=A;M<h;M++){const N=M,P=c.charCodeAt(M);let O,B;xo(P)?(M++,O=0,B=2):(O=i.get(P),B=gM(P,E,r,o)),ZJ(D,R,P,O,f)&&(y=N,x=E),E+=B,E>k&&((y===0||E-x>g)&&(y=N,x=E-B),m[b]=y,_[b]=x,b++,k=x+g,y=0),D=P,R=O}return b===0&&(!n||n.length===0)?null:(m[b]=h,_[b]=E,new pM(d,u,m,_,p))}function gM(i,e,n,r){return i===9?n-e%n:d1(i)||i<32?r:1}function pme(i,e){return e-i%e}function ZJ(i,e,n,r,s){return n!==32&&(e===2&&r!==2||e!==1&&r===1||!s&&e===3&&r!==2||!s&&r===3&&e!==1)}function bTe(i,e,n,r,s){let o=0;if(s!==0){const a=ml(i);if(a!==-1){for(let c=0;c<a;c++){const u=i.charCodeAt(c)===9?pme(o,e):1;o+=u}const l=s===3?2:s===2?1:0;for(let c=0;c<l;c++){const u=pme(o,e);o+=u}o+r>n&&(o=0)}}return o}const Pq=$v("domLineBreaksComputer",{createHTML:i=>i});class Koe{static create(){return new Koe}constructor(){}createLineBreaksComputer(e,n,r,s,o){const a=[],l=[];return{addRequest:(c,u,d)=>{a.push(c),l.push(u)},finalize:()=>U_t(a,e,n,r,s,o,l)}}}function U_t(i,e,n,r,s,o,a){var l;function c(M){const N=a[M];if(N){const P=Xp.applyInjectedText(i[M],N),O=N.map(j=>j.options),B=N.map(j=>j.column-1);return new pM(B,O,[P.length],[],0)}else return null}if(r===-1){const M=[];for(let N=0,P=i.length;N<P;N++)M[N]=c(N);return M}const u=Math.round(r*e.typicalHalfwidthCharacterWidth),h=Math.round(n*(s===3?2:s===2?1:0)),f=Math.ceil(e.spaceWidth*h),p=document.createElement("div");Ta(p,e);const g=new jI(1e4),m=[],_=[],b=[],y=[],x=[];for(let M=0;M<i.length;M++){const N=Xp.applyInjectedText(i[M],a[M]);let P=0,O=0,B=u;if(s!==0)if(P=ml(N),P===-1)P=0;else{for(let Y=0;Y<P;Y++){const X=N.charCodeAt(Y)===9?n-O%n:1;O+=X}const H=Math.ceil(e.spaceWidth*O);H+e.typicalFullwidthCharacterWidth>u?(P=0,O=0):B=u-H}const j=N.substr(P),z=q_t(j,O,n,B,g,f);m[M]=P,_[M]=O,b[M]=j,y[M]=z[0],x[M]=z[1]}const k=g.build(),D=(l=Pq==null?void 0:Pq.createHTML(k))!==null&&l!==void 0?l:k;p.innerHTML=D,p.style.position="absolute",p.style.top="10000",o==="keepAll"?(p.style.wordBreak="keep-all",p.style.overflowWrap="anywhere"):(p.style.wordBreak="inherit",p.style.overflowWrap="break-word"),document.body.appendChild(p);const R=document.createRange(),E=Array.prototype.slice.call(p.children,0),A=[];for(let M=0;M<i.length;M++){const N=E[M],P=K_t(R,N,b[M],y[M]);if(P===null){A[M]=c(M);continue}const O=m[M],B=_[M]+h,j=x[M],z=[];for(let Q=0,ie=P.length;Q<ie;Q++)z[Q]=j[P[Q]];if(O!==0)for(let Q=0,ie=P.length;Q<ie;Q++)P[Q]+=O;let H,Y;const X=a[M];X?(H=X.map(Q=>Q.options),Y=X.map(Q=>Q.column-1)):(H=null,Y=null),A[M]=new pM(Y,H,P,z,B)}return document.body.removeChild(p),A}function q_t(i,e,n,r,s,o){if(o!==0){const f=String(o);s.appendString('<div style="text-indent: -'),s.appendString(f),s.appendString("px; padding-left: "),s.appendString(f),s.appendString("px; box-sizing: border-box; width:")}else s.appendString('<div style="width:');s.appendString(String(r)),s.appendString('px;">');const a=i.length;let l=e,c=0;const u=[],d=[];let h=0<a?i.charCodeAt(0):0;s.appendString("<span>");for(let f=0;f<a;f++){f!==0&&f%16384===0&&s.appendString("</span><span>"),u[f]=c,d[f]=l;const p=h;h=f+1<a?i.charCodeAt(f+1):0;let g=1,m=1;switch(p){case 9:g=n-l%n,m=g;for(let _=1;_<=g;_++)_<g?s.appendCharCode(160):s.appendASCIICharCode(32);break;case 32:h===32?s.appendCharCode(160):s.appendASCIICharCode(32);break;case 60:s.appendString("&lt;");break;case 62:s.appendString("&gt;");break;case 38:s.appendString("&amp;");break;case 0:s.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:s.appendCharCode(65533);break;default:d1(p)&&m++,p<32?s.appendCharCode(9216+p):s.appendCharCode(p)}c+=g,l+=m}return s.appendString("</span>"),u[i.length]=c,d[i.length]=l,s.appendString("</div>"),[u,d]}function K_t(i,e,n,r){if(n.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{QJ(i,s,r,0,null,n.length-1,null,o)}catch(a){return console.log(a),null}return o.length===0?null:(o.push(n.length),o)}function QJ(i,e,n,r,s,o,a,l){if(r===o||(s=s||Oq(i,e,n[r],n[r+1]),a=a||Oq(i,e,n[o],n[o+1]),Math.abs(s[0].top-a[0].top)<=.1))return;if(r+1===o){l.push(o);return}const c=r+(o-r)/2|0,u=Oq(i,e,n[c],n[c+1]);QJ(i,e,n,r,s,c,u,l),QJ(i,e,n,c,u,o,a,l)}function Oq(i,e,n,r){return i.setStart(e[n/16384|0].firstChild,n%16384),i.setEnd(e[r/16384|0].firstChild,r%16384),i.getClientRects()}class G_t extends Le{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Nse),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,n,r){this._editor=e,this._instantiationService=r;for(const s of n){if(this._pending.has(s.id)){Ln(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(0),this._register(Z0(()=>{this._instantiateSome(1)})),this._register(Z0(()=>{this._instantiateSome(2)})),this._register(Z0(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[n,r]of this._instances)typeof r.saveViewState=="function"&&(e[n]=r.saveViewState());return e}restoreViewState(e){for(const[n,r]of this._instances)typeof r.restoreViewState=="function"&&r.restoreViewState(e[n])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(Z0(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const n=this._findPendingContributionsByInstantiation(e);for(const r of n)this._instantiateById(r.id)}_findPendingContributionsByInstantiation(e){const n=[];for(const[,r]of this._pending)r.instantiation===e&&n.push(r);return n}_instantiateById(e){const n=this._pending.get(e);if(n){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const r=this._instantiationService.createInstance(n.ctor,this._editor);this._instances.set(n.id,r),typeof r.restoreViewState=="function"&&n.instantiation!==0&&console.warn(`Editor contribution '${n.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(r){Ln(r)}}}}var X_t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Q_=function(i,e){return function(n,r){e(n,r,i)}},Y_t=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},OC;let Z_t=0,Q_t=class{constructor(e,n,r,s,o,a){this.model=e,this.viewModel=n,this.view=r,this.hasRealView=s,this.listenersToRemove=o,this.attachedView=a}dispose(){Mi(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},qE=OC=class extends Le{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,n,r,s,o,a,l,c,u,d,h,f){var p;super(),this.languageConfigurationService=h,this._deliveryQueue=Vst(),this._contributions=this._register(new G_t),this._onDidDispose=this._register(new _e),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new al(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new gme({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new gme({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new al(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new al(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new al(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new al(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new al(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new al(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new al(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new al(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new al(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new al(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new al(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new al(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new al(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new al(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new al(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new al(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new al(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new _e({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g=Object.assign({},n);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Z_t,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=r.telemetryData,this._configuration=this._register(this._createConfiguration(r.isSimpleWidget||!1,g,d)),this._register(this._configuration.onDidChange(b=>{this._onDidChangeConfiguration.fire(b);const y=this._configuration.options;if(b.hasChanged(143)){const x=y.get(143);this._onDidLayoutChange.fire(x)}})),this._contextKeyService=this._register(l.createScoped(this._domElement)),this._notificationService=u,this._codeEditorService=o,this._commandService=a,this._themeService=c,this._register(new J_t(this,this._contextKeyService)),this._register(new e0t(this,this._contextKeyService,f)),this._instantiationService=s.createChild(new O$([mn,this._contextKeyService])),this._modelData=null,this._focusTracker=new t0t(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let m;Array.isArray(r.contributions)?m=r.contributions:m=j2.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const b of j2.getEditorActions()){if(this._actions.has(b.id)){Ln(new Error(`Cannot have two actions with the same id ${b.id}`));continue}const y=new GIe(b.id,b.label,b.alias,(p=b.precondition)!==null&&p!==void 0?p:void 0,()=>this._instantiationService.invokeFunction(x=>Promise.resolve(b.runEditorCommand(x,this,null))),this._contextKeyService);this._actions.set(y.id,y)}const _=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new alt(this._domElement,{onDragEnter:()=>{},onDragOver:b=>{if(!_())return;const y=this.getTargetAtClientPoint(b.clientX,b.clientY);y!=null&&y.position&&this.showDropIndicatorAt(y.position)},onDrop:b=>Y_t(this,void 0,void 0,function*(){if(!_()||(this.removeDropIndicator(),!b.dataTransfer))return;const y=this.getTargetAtClientPoint(b.clientX,b.clientY);y!=null&&y.position&&this._onDropIntoEditor.fire({position:y.position,event:b})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var n;(n=this._modelData)===null||n===void 0||n.view.writeScreenReaderContent(e)}_createConfiguration(e,n,r){return new LJ(e,n,this._domElement,r)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return I5.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?wi.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const n=!!(e&&e.preserveBOM);let r=0;return e&&e.lineEnding&&e.lineEnding===`
`?r=1:e&&e.lineEnding&&e.lineEnding===`\r
`&&(r=2),this._modelData.model.getValue(r,n)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const n=e;if(this._modelData===null&&n===null||this._modelData&&this._modelData.model===n)return;const r=this.hasTextFocus(),s=this._detachModel();this._attachModel(n),r&&this.hasModel()&&this.focus();const o={oldModelUrl:s?s.uri:null,newModelUrl:n?n.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(s),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const n=this._decorationTypeSubtypes[e];for(const r in n)this._removeDecorationType(e+"-"+r)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,n,r,s){const o=e.model.validatePosition({lineNumber:n,column:r}),a=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(a.lineNumber,s)}getTopForLineNumber(e,n=!1){return this._modelData?OC._getVerticalOffsetForPosition(this._modelData,e,1,n):-1}getTopForPosition(e,n){return this._modelData?OC._getVerticalOffsetForPosition(this._modelData,e,n,!1):-1}static _getVerticalOffsetForPosition(e,n,r,s=!1){const o=e.model.validatePosition({lineNumber:n,column:r}),a=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(a.lineNumber,s)}getBottomForLineNumber(e,n=!1){return this._modelData?OC._getVerticalOffsetAfterPosition(this._modelData,e,1,n):-1}setHiddenAreas(e,n){var r;(r=this._modelData)===null||r===void 0||r.viewModel.setHiddenAreas(e.map(s=>J.lift(s)),n)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const n=this._modelData.model.validatePosition(e),r=this._modelData.model.getOptions().tabSize;return ho.visibleColumnFromColumn(this._modelData.model.getLineContent(n.lineNumber),n.column,r)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,n="api"){if(this._modelData){if(!ve.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(n,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,n,r,s){if(!this._modelData)return;if(!J.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),a=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",r,a,n,s)}revealLine(e,n=0){this._revealLine(e,0,n)}revealLineInCenter(e,n=0){this._revealLine(e,1,n)}revealLineInCenterIfOutsideViewport(e,n=0){this._revealLine(e,2,n)}revealLineNearTop(e,n=0){this._revealLine(e,5,n)}_revealLine(e,n,r){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new J(e,1,e,1),n,!1,r)}revealPosition(e,n=0){this._revealPosition(e,0,!0,n)}revealPositionInCenter(e,n=0){this._revealPosition(e,1,!0,n)}revealPositionInCenterIfOutsideViewport(e,n=0){this._revealPosition(e,2,!0,n)}revealPositionNearTop(e,n=0){this._revealPosition(e,5,!0,n)}_revealPosition(e,n,r,s){if(!ve.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new J(e.lineNumber,e.column,e.lineNumber,e.column),n,r,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,n="api"){const r=Ft.isISelection(e),s=J.isIRange(e);if(!r&&!s)throw new Error("Invalid arguments");if(r)this._setSelectionImpl(e,n);else if(s){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,n)}}_setSelectionImpl(e,n){if(!this._modelData)return;const r=new Ft(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(n,[r])}revealLines(e,n,r=0){this._revealLines(e,n,0,r)}revealLinesInCenter(e,n,r=0){this._revealLines(e,n,1,r)}revealLinesInCenterIfOutsideViewport(e,n,r=0){this._revealLines(e,n,2,r)}revealLinesNearTop(e,n,r=0){this._revealLines(e,n,5,r)}_revealLines(e,n,r,s){if(typeof e!="number"||typeof n!="number")throw new Error("Invalid arguments");this._sendRevealRange(new J(e,1,n,1),r,!1,s)}revealRange(e,n=0,r=!1,s=!0){this._revealRange(e,r?1:0,s,n)}revealRangeInCenter(e,n=0){this._revealRange(e,1,!0,n)}revealRangeInCenterIfOutsideViewport(e,n=0){this._revealRange(e,2,!0,n)}revealRangeNearTop(e,n=0){this._revealRange(e,5,!0,n)}revealRangeNearTopIfOutsideViewport(e,n=0){this._revealRange(e,6,!0,n)}revealRangeAtTop(e,n=0){this._revealRange(e,3,!0,n)}_revealRange(e,n,r,s){if(!J.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(J.lift(e),n,r,s)}setSelections(e,n="api",r=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s<o;s++)if(!Ft.isISelection(e[s]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(n,e,r)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,n=1){if(this._modelData){if(typeof e!="number")throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},n)}}setScrollTop(e,n=1){if(this._modelData){if(typeof e!="number")throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},n)}}setScrollPosition(e,n=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,n)}hasPendingScrollAnimation(){return this._modelData?this._modelData.viewModel.viewLayout.hasPendingScrollAnimation():!1}saveViewState(){if(!this._modelData)return null;const e=this._contributions.saveViewState(),n=this._modelData.viewModel.saveCursorState(),r=this._modelData.viewModel.saveState();return{cursorState:n,viewState:r,contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const n=e;if(n&&n.cursorState&&n.viewState){const r=n.cursorState;Array.isArray(r)?r.length>0&&this._modelData.viewModel.restoreCursorState(r):this._modelData.viewModel.restoreCursorState([r]),this._contributions.restoreViewState(n.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(n.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(n=>n.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,n,r){switch(r=r||{},n){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=r;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=r;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=r;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=r;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const s=this.getAction(n);if(s){Promise.resolve(s.run(r)).then(void 0,Ln);return}this._modelData&&(this._triggerEditorCommand(e,n,r)||this._triggerCommand(n,r))}_triggerCommand(e,n){this._commandService.executeCommand(e,n)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,n){!this._modelData||n.length===0||(e==="keyboard"&&this._onWillType.fire(n),this._modelData.viewModel.type(n,e),e==="keyboard"&&this._onDidType.fire(n))}_compositionType(e,n,r,s,o){this._modelData&&this._modelData.viewModel.compositionType(n,r,s,o,e)}_paste(e,n,r,s,o){if(!this._modelData||n.length===0)return;const a=this._modelData.viewModel,l=a.getSelection().getStartPosition();a.paste(n,r,s,e);const c=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new J(l.lineNumber,l.column,c.lineNumber,c.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,n,r){const s=j2.getEditorCommand(n);return s?(r=r||{},r.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,r)).then(void 0,Ln)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,n,r){if(!this._modelData||this._configuration.options.get(90))return!1;let s;return r?Array.isArray(r)?s=()=>r:s=r:s=()=>null,this._modelData.viewModel.executeEdits(e,n,s),!0}executeCommand(e,n){this._modelData&&this._modelData.viewModel.executeCommand(n,e)}executeCommands(e,n){this._modelData&&this._modelData.viewModel.executeCommands(n,e)}createDecorationsCollection(e){return new n0t(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,I9(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,I9(this._configuration.options)):null}deltaDecorations(e,n){return this._modelData?e.length===0&&n.length===0?e:this._modelData.model.deltaDecorations(e,n,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(n=>{n.deltaDecorations(e,[])})}removeDecorationsByType(e){const n=this._decorationTypeKeysToIds[e];n&&this.deltaDecorations(n,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const n={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=n,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(n)}layoutContentWidget(e){const n=e.getId();if(this._contentWidgets.hasOwnProperty(n)){const r=this._contentWidgets[n];r.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(r)}}removeContentWidget(e){const n=e.getId();if(this._contentWidgets.hasOwnProperty(n)){const r=this._contentWidgets[n];delete this._contentWidgets[n],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(r)}}addOverlayWidget(e){const n={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=n,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(n)}layoutOverlayWidget(e){const n=e.getId();if(this._overlayWidgets.hasOwnProperty(n)){const r=this._overlayWidgets[n];r.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(r)}}removeOverlayWidget(e){const n=e.getId();if(this._overlayWidgets.hasOwnProperty(n)){const r=this._overlayWidgets[n];delete this._overlayWidgets[n],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(r)}}addGlyphMarginWidget(e){const n={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=n,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(n)}layoutGlyphMarginWidget(e){const n=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(n)){const r=this._glyphMarginWidgets[n];r.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(r)}}removeGlyphMarginWidget(e){const n=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(n)){const r=this._glyphMarginWidgets[n];delete this._glyphMarginWidgets[n],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(r)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,n){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,n)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const n=this._modelData.model.validatePosition(e),r=this._configuration.options,s=r.get(143),o=OC._getVerticalOffsetForPosition(this._modelData,n.lineNumber,n.column)-this.getScrollTop(),a=this._modelData.view.getOffsetForColumn(n.lineNumber,n.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:a,height:r.get(66)}}getOffsetForColumn(e,n){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,n)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Ta(e,this._configuration.options.get(50))}setBanner(e,n){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?n:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const n=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const r=e.onBeforeAttached(),s=new F_t(this._id,this._configuration,e,Koe.create(),qoe.create(this._configuration.options),l=>mh(l),this.languageConfigurationService,this._themeService,r);n.push(e.onWillDispose(()=>this.setModel(null))),n.push(s.onEvent(l=>{switch(l.kind){case 0:this._onDidContentSizeChange.fire(l);break;case 1:this._editorTextFocus.setValue(l.hasFocus);break;case 2:this._onDidScrollChange.fire(l);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(l.reachedMaxCursorCount){const h=this.getOption(79),f=L("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",h);this._notificationService.prompt(F$.Warning,f,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:L("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const c=[];for(let h=0,f=l.selections.length;h<f;h++)c[h]=l.selections[h].getPosition();const u={position:c[0],secondaryPositions:c.slice(1),reason:l.reason,source:l.source};this._onDidChangeCursorPosition.fire(u);const d={selection:l.selections[0],secondarySelections:l.selections.slice(1),modelVersionId:l.modelVersionId,oldSelections:l.oldSelections,oldModelVersionId:l.oldModelVersionId,source:l.source,reason:l.reason};this._onDidChangeCursorSelection.fire(d);break}case 7:this._onDidChangeModelDecorations.fire(l.event);break;case 8:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(l.event);break;case 9:this._onDidChangeModelLanguageConfiguration.fire(l.event);break;case 10:this._onDidChangeModelContent.fire(l.event);break;case 11:this._onDidChangeModelOptions.fire(l.event);break;case 12:this._onDidChangeModelTokens.fire(l.event);break}}));const[o,a]=this._createView(s);if(a){this._domElement.appendChild(o.domNode.domNode);let l=Object.keys(this._contentWidgets);for(let c=0,u=l.length;c<u;c++){const d=l[c];o.addContentWidget(this._contentWidgets[d])}l=Object.keys(this._overlayWidgets);for(let c=0,u=l.length;c<u;c++){const d=l[c];o.addOverlayWidget(this._overlayWidgets[d])}l=Object.keys(this._glyphMarginWidgets);for(let c=0,u=l.length;c<u;c++){const d=l[c];o.addGlyphMarginWidget(this._glyphMarginWidgets[d])}o.render(!1,!0),o.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new Q_t(e,s,o,a,n,r)}_createView(e){let n;this.isSimpleWidget?n={paste:(o,a,l,c)=>{this._paste("keyboard",o,a,l,c)},type:o=>{this._type("keyboard",o)},compositionType:(o,a,l,c)=>{this._compositionType("keyboard",o,a,l,c)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:n={paste:(o,a,l,c)=>{const u={text:o,pasteOnNewLine:a,multicursorText:l,mode:c};this._commandService.executeCommand("paste",u)},type:o=>{const a={text:o};this._commandService.executeCommand("type",a)},compositionType:(o,a,l,c)=>{if(l||c){const u={text:o,replacePrevCharCnt:a,replaceNextCharCnt:l,positionDelta:c};this._commandService.executeCommand("compositionType",u)}else{const u={text:o,replaceCharCnt:a};this._commandService.executeCommand("replacePreviousChar",u)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const r=new R$(e.coordinatesConverter);return r.onKeyDown=o=>this._onKeyDown.fire(o),r.onKeyUp=o=>this._onKeyUp.fire(o),r.onContextMenu=o=>this._onContextMenu.fire(o),r.onMouseMove=o=>this._onMouseMove.fire(o),r.onMouseLeave=o=>this._onMouseLeave.fire(o),r.onMouseDown=o=>this._onMouseDown.fire(o),r.onMouseUp=o=>this._onMouseUp.fire(o),r.onMouseDrag=o=>this._onMouseDrag.fire(o),r.onMouseDrop=o=>this._onMouseDrop.fire(o),r.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),r.onMouseWheel=o=>this._onMouseWheel.fire(o),[new FJ(n,this._configuration,this._themeService.getColorTheme(),e,r,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,n=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),n&&this._domElement.contains(n)&&this._domElement.removeChild(n),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const n=[{range:new J(e.lineNumber,e.column,e.lineNumber,e.column),options:OC.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(n),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,n){this._contextKeyService.createKey(e,n)}};qE.dropIntoEditorDecorationOptions=kn.register({description:"workbench-dnd-target",className:"dnd-target"});qE=OC=X_t([Q_(3,hn),Q_(4,Si),Q_(5,us),Q_(6,mn),Q_(7,Do),Q_(8,Ps),Q_(9,zv),Q_(10,dr),Q_(11,Et)],qE);class gme extends Le{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new _e(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new _e(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const n=e?2:1;this._value!==n&&(this._value=n,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class al extends _e{constructor(e,n){super({deliveryQueue:n}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class J_t extends Le{constructor(e,n){super(),this._editor=e,n.createKey("editorId",e.getId()),this._editorSimpleInput=oe.editorSimpleInput.bindTo(n),this._editorFocus=oe.focus.bindTo(n),this._textInputFocus=oe.textInputFocus.bindTo(n),this._editorTextFocus=oe.editorTextFocus.bindTo(n),this._tabMovesFocus=oe.tabMovesFocus.bindTo(n),this._editorReadonly=oe.readOnly.bindTo(n),this._inDiffEditor=oe.inDiffEditor.bindTo(n),this._editorColumnSelection=oe.columnSelection.bindTo(n),this._hasMultipleSelections=oe.hasMultipleSelections.bindTo(n),this._hasNonEmptySelection=oe.hasNonEmptySelection.bindTo(n),this._canUndo=oe.canUndo.bindTo(n),this._canRedo=oe.canRedo.bindTo(n),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(BE.onDidChangeTabFocus(r=>this._tabMovesFocus.set(r))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(BE.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(n=>!n.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class e0t extends Le{constructor(e,n,r){super(),this._editor=e,this._contextKeyService=n,this._languageFeaturesService=r,this._langId=oe.languageId.bindTo(n),this._hasCompletionItemProvider=oe.hasCompletionItemProvider.bindTo(n),this._hasCodeActionsProvider=oe.hasCodeActionsProvider.bindTo(n),this._hasCodeLensProvider=oe.hasCodeLensProvider.bindTo(n),this._hasDefinitionProvider=oe.hasDefinitionProvider.bindTo(n),this._hasDeclarationProvider=oe.hasDeclarationProvider.bindTo(n),this._hasImplementationProvider=oe.hasImplementationProvider.bindTo(n),this._hasTypeDefinitionProvider=oe.hasTypeDefinitionProvider.bindTo(n),this._hasHoverProvider=oe.hasHoverProvider.bindTo(n),this._hasDocumentHighlightProvider=oe.hasDocumentHighlightProvider.bindTo(n),this._hasDocumentSymbolProvider=oe.hasDocumentSymbolProvider.bindTo(n),this._hasReferenceProvider=oe.hasReferenceProvider.bindTo(n),this._hasRenameProvider=oe.hasRenameProvider.bindTo(n),this._hasSignatureHelpProvider=oe.hasSignatureHelpProvider.bindTo(n),this._hasInlayHintsProvider=oe.hasInlayHintsProvider.bindTo(n),this._hasDocumentFormattingProvider=oe.hasDocumentFormattingProvider.bindTo(n),this._hasDocumentSelectionFormattingProvider=oe.hasDocumentSelectionFormattingProvider.bindTo(n),this._hasMultipleDocumentFormattingProvider=oe.hasMultipleDocumentFormattingProvider.bindTo(n),this._hasMultipleDocumentSelectionFormattingProvider=oe.hasMultipleDocumentSelectionFormattingProvider.bindTo(n),this._isInWalkThrough=oe.isInWalkThroughSnippet.bindTo(n);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(r.completionProvider.onDidChange(s)),this._register(r.codeActionProvider.onDidChange(s)),this._register(r.codeLensProvider.onDidChange(s)),this._register(r.definitionProvider.onDidChange(s)),this._register(r.declarationProvider.onDidChange(s)),this._register(r.implementationProvider.onDidChange(s)),this._register(r.typeDefinitionProvider.onDidChange(s)),this._register(r.hoverProvider.onDidChange(s)),this._register(r.documentHighlightProvider.onDidChange(s)),this._register(r.documentSymbolProvider.onDidChange(s)),this._register(r.referenceProvider.onDidChange(s)),this._register(r.renameProvider.onDidChange(s)),this._register(r.documentFormattingEditProvider.onDidChange(s)),this._register(r.documentRangeFormattingEditProvider.onDidChange(s)),this._register(r.signatureHelpProvider.onDidChange(s)),this._register(r.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===Pn.walkThroughSnippet)})}}class t0t extends Le{constructor(e){super(),this._onChange=this._register(new _e),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Gm(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class n0t{get length(){return this._decorationIds.length}constructor(e,n){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(n)&&n.length>0&&this.set(n)}onDidChange(e,n,r){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(n,s)},r)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),n=[];for(const r of this._decorationIds){const s=e.getDecorationRange(r);s&&n.push(s)}return n}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(n=>{this._decorationIds=n.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}}const i0t=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),r0t=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function Fq(i){return i0t+encodeURIComponent(i.toString())+r0t}const s0t=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),o0t=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');function a0t(i){return s0t+encodeURIComponent(i.toString())+o0t}Of((i,e)=>{const n=i.getColor(wm);n&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${Fq(n)}") repeat-x bottom left; }`);const r=i.getColor(Ju);r&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${Fq(r)}") repeat-x bottom left; }`);const s=i.getColor(_c);s&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${Fq(s)}") repeat-x bottom left; }`);const o=i.getColor(Tdt);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${a0t(o)}") no-repeat bottom left; }`);const a=i.getColor(zft);a&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${a.rgba.a}; }`)});var l0t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},c0t=function(i,e){return function(n,r){e(n,r,i)}},u0t=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let JJ=class extends Le{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new _e),this._onCodeEditorAdd=this._register(new _e),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new _e),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new _e),this._onDiffEditorAdd=this._register(new _e),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new _e),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new jl,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const n=this.listCodeEditors();for(const r of n){if(r.hasTextFocus())return r;r.hasWidgetFocus()&&(e=r)}return e}removeDecorationType(e){const n=this._decorationOptionProviders.get(e);n&&(n.refCount--,n.refCount<=0&&(this._decorationOptionProviders.delete(e),n.dispose(),this.listCodeEditors().forEach(r=>r.removeDecorationsByType(e))))}setModelProperty(e,n,r){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(n,r)}getModelProperty(e,n){const r=e.toString();if(this._modelProperties.has(r))return this._modelProperties.get(r).get(n)}openCodeEditor(e,n,r){return u0t(this,void 0,void 0,function*(){for(const s of this._codeEditorOpenHandlers){const o=yield s(e,n,r);if(o!==null)return o}return null})}registerCodeEditorOpenHandler(e){const n=this._codeEditorOpenHandlers.unshift(e);return gn(n)}};JJ=l0t([c0t(0,Do)],JJ);var d0t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mme=function(i,e){return function(n,r){e(n,r,i)}},h0t=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let m7=class extends JJ{constructor(e,n){super(n),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((r,s,o)=>h0t(this,void 0,void 0,function*(){return s?this.doOpenEditor(s,r):null})))}_checkContextKey(){let e=!1;for(const n of this.listCodeEditors())if(!n.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,n){if(!this.findModel(e,n.resource)){if(n.resource){const o=n.resource.scheme;if(o===Pn.http||o===Pn.https)return kEe(n.resource.toString()),e}return null}const s=n.options?n.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,1);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,n){const r=e.getModel();return r&&r.uri.toString()!==n.toString()?null:r}};m7=d0t([mme(0,mn),mme(1,Do)],m7);oi(Si,m7,0);const VI=qn("layoutService");var yTe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},wTe=function(i,e){return function(n,r){e(n,r,i)}};let _7=class{get dimension(){return this._dimension||(this._dimension=FI(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=_t.None,this.offset={top:0,quickPickTop:0}}};_7=yTe([wTe(0,Si)],_7);let eee=class extends _7{get hasContainer(){return!1}get container(){return this._container}constructor(e,n){super(n),this._container=e}};eee=yTe([wTe(1,Si)],eee);oi(VI,_7,1);const W5=qn("dialogService");var f0t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},_me=function(i,e){return function(n,r){e(n,r,i)}},a6=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function l6(i){return i.scheme===Pn.file?i.fsPath:i.path}let CTe=0;class c6{constructor(e,n,r,s,o,a,l){this.id=++CTe,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=n,this.strResource=r,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=a,this.sourceOrder=l,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class vme{constructor(e,n){this.resourceLabel=e,this.reason=n}}class bme{constructor(){this.elements=new Map}createMessage(){const e=[],n=[];for(const[,s]of this.elements)(s.reason===0?e:n).push(s.resourceLabel);const r=[];return e.length>0&&r.push(L({},"The following files have been closed and modified on disk: {0}.",e.join(", "))),n.length>0&&r.push(L({},"The following files have been modified in an incompatible way: {0}.",n.join(", "))),r.join(`
`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,n){this.elements.set(e,n)}delete(e){return this.elements.delete(e)}}class p0t{constructor(e,n,r,s,o,a,l){this.id=++CTe,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=n,this.strResources=r,this.groupId=s,this.groupOrder=o,this.sourceId=a,this.sourceOrder=l,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,n,r){this.removedResources||(this.removedResources=new bme),this.removedResources.has(n)||this.removedResources.set(n,new vme(e,r))}setValid(e,n,r){r?this.invalidatedResources&&(this.invalidatedResources.delete(n),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new bme),this.invalidatedResources.has(n)||this.invalidatedResources.set(n,new vme(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class STe{constructor(e,n){this.resourceLabel=e,this.strResource=n,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let n=0;n<this._past.length;n++)e.push(` * [UNDO] ${this._past[n]}`);for(let n=this._future.length-1;n>=0;n--)e.push(` * [REDO] ${this._future[n]}`);return e.join(`
`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,n){e.type===1?e.setValid(this.resourceLabel,this.strResource,n):e.setValid(n)}setElementsValidFlag(e,n){for(const r of this._past)n(r.actual)&&this._setElementValidFlag(r,e);for(const r of this._future)n(r.actual)&&this._setElementValidFlag(r,e)}pushElement(e){for(const n of this._future)n.type===1&&n.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const n=[];for(let r=0,s=this._past.length;r<s;r++)n.push(this._past[r].id);for(let r=this._future.length-1;r>=0;r--)n.push(this._future[r].id);return new pTe(e,n)}restoreSnapshot(e){const n=e.elements.length;let r=!0,s=0,o=-1;for(let l=0,c=this._past.length;l<c;l++,s++){const u=this._past[l];r&&(s>=n||u.id!==e.elements[s])&&(r=!1,o=0),!r&&u.type===1&&u.removeResource(this.resourceLabel,this.strResource,0)}let a=-1;for(let l=this._future.length-1;l>=0;l--,s++){const c=this._future[l];r&&(s>=n||c.id!==e.elements[s])&&(r=!1,a=l),!r&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),a!==-1&&(this._future=this._future.slice(a+1)),this.versionId++}getElements(){const e=[],n=[];for(const r of this._past)e.push(r.actual);for(const r of this._future)n.push(r.actual);return{past:e,future:n}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,n){for(let r=this._past.length-1;r>=0;r--)if(this._past[r]===e){n.has(this.strResource)?this._past[r]=n.get(this.strResource):this._past.splice(r,1);break}this.versionId++}splitFutureWorkspaceElement(e,n){for(let r=this._future.length-1;r>=0;r--)if(this._future[r]===e){n.has(this.strResource)?this._future[r]=n.get(this.strResource):this._future.splice(r,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class Bq{constructor(e){this.editStacks=e,this._versionIds=[];for(let n=0,r=this.editStacks.length;n<r;n++)this._versionIds[n]=this.editStacks[n].versionId}isValid(){for(let e=0,n=this.editStacks.length;e<n;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const xTe=new STe("","");xTe.locked=!0;let tee=class{constructor(e,n){this._dialogService=e,this._notificationService=n,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const n of this._uriComparisonKeyComputers)if(n[0]===e.scheme)return n[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const n=[];for(const r of this._editStacks)n.push(r[1].toString());console.log(n.join(`
`))}pushElement(e,n=UE.None,r=hm.None){if(e.type===0){const s=l6(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new c6(e,s,o,n.id,n.nextOrder(),r.id,r.nextOrder()))}else{const s=new Set,o=[],a=[];for(const l of e.resources){const c=l6(l),u=this.getUriComparisonKey(l);s.has(u)||(s.add(u),o.push(c),a.push(u))}o.length===1?this._pushElement(new c6(e,o[0],a[0],n.id,n.nextOrder(),r.id,r.nextOrder())):this._pushElement(new p0t(e,o,a,n.id,n.nextOrder(),r.id,r.nextOrder()))}}_pushElement(e){for(let n=0,r=e.strResources.length;n<r;n++){const s=e.resourceLabels[n],o=e.strResources[n];let a;this._editStacks.has(o)?a=this._editStacks.get(o):(a=new STe(s,o),this._editStacks.set(o,a)),a.pushElement(e)}}getLastElement(e){const n=this.getUriComparisonKey(e);if(this._editStacks.has(n)){const r=this._editStacks.get(n);if(r.hasFutureElements())return null;const s=r.getClosestPastElement();return s?s.actual:null}return null}_splitPastWorkspaceElement(e,n){const r=e.actual.split(),s=new Map;for(const o of r){const a=l6(o.resource),l=this.getUriComparisonKey(o.resource),c=new c6(o,a,l,0,0,0,0);s.set(c.strResource,c)}for(const o of e.strResources){if(n&&n.has(o))continue;this._editStacks.get(o).splitPastWorkspaceElement(e,s)}}_splitFutureWorkspaceElement(e,n){const r=e.actual.split(),s=new Map;for(const o of r){const a=l6(o.resource),l=this.getUriComparisonKey(o.resource),c=new c6(o,a,l,0,0,0,0);s.set(c.strResource,c)}for(const o of e.strResources){if(n&&n.has(o))continue;this._editStacks.get(o).splitFutureWorkspaceElement(e,s)}}removeElements(e){const n=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(n)&&(this._editStacks.get(n).dispose(),this._editStacks.delete(n))}setElementsValidFlag(e,n,r){const s=this.getUriComparisonKey(e);this._editStacks.has(s)&&this._editStacks.get(s).setElementsValidFlag(n,r)}createSnapshot(e){const n=this.getUriComparisonKey(e);return this._editStacks.has(n)?this._editStacks.get(n).createSnapshot(e):new pTe(e,[])}restoreSnapshot(e){const n=this.getUriComparisonKey(e.resource);if(this._editStacks.has(n)){const r=this._editStacks.get(n);r.restoreSnapshot(e),!r.hasPastElements()&&!r.hasFutureElements()&&(r.dispose(),this._editStacks.delete(n))}}getElements(e){const n=this.getUriComparisonKey(e);return this._editStacks.has(n)?this._editStacks.get(n).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let n=null,r=null;for(const[s,o]of this._editStacks){const a=o.getClosestPastElement();a&&a.sourceId===e&&(!n||a.sourceOrder>n.sourceOrder)&&(n=a,r=s)}return[n,r]}canUndo(e){if(e instanceof hm){const[,r]=this._findClosestUndoElementWithSource(e.id);return!!r}const n=this.getUriComparisonKey(e);return this._editStacks.has(n)?this._editStacks.get(n).hasPastElements():!1}_onError(e,n){Ln(e);for(const r of n.strResources)this.removeElements(r);this._notificationService.error(e)}_acquireLocks(e){for(const n of e.editStacks)if(n.locked)throw new Error("Cannot acquire edit stack lock");for(const n of e.editStacks)n.locked=!0;return()=>{for(const n of e.editStacks)n.locked=!1}}_safeInvokeWithLocks(e,n,r,s,o){const a=this._acquireLocks(r);let l;try{l=n()}catch(c){return a(),s.dispose(),this._onError(c,e)}return l?l.then(()=>(a(),s.dispose(),o()),c=>(a(),s.dispose(),this._onError(c,e))):(a(),s.dispose(),o())}_invokeWorkspacePrepare(e){return a6(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return Le.None;const n=e.actual.prepareUndoRedo();return typeof n>"u"?Le.None:n})}_invokeResourcePrepare(e,n){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return n(Le.None);const r=e.actual.prepareUndoRedo();return r?Ase(r)?n(r):r.then(s=>n(s)):n(Le.None)}_getAffectedEditStacks(e){const n=[];for(const r of e.strResources)n.push(this._editStacks.get(r)||xTe);return new Bq(n)}_tryToSplitAndUndo(e,n,r,s){if(n.canSplit())return this._splitPastWorkspaceElement(n,r),this._notificationService.warn(s),new u6(this._undo(e,0,!0));for(const o of n.strResources)this.removeElements(o);return this._notificationService.warn(s),new u6}_checkWorkspaceUndo(e,n,r,s){if(n.removedResources)return this._tryToSplitAndUndo(e,n,n.removedResources,L({},"Could not undo '{0}' across all files. {1}",n.label,n.removedResources.createMessage()));if(s&&n.invalidatedResources)return this._tryToSplitAndUndo(e,n,n.invalidatedResources,L({},"Could not undo '{0}' across all files. {1}",n.label,n.invalidatedResources.createMessage()));const o=[];for(const l of r.editStacks)l.getClosestPastElement()!==n&&o.push(l.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,n,null,L({},"Could not undo '{0}' across all files because changes were made to {1}",n.label,o.join(", ")));const a=[];for(const l of r.editStacks)l.locked&&a.push(l.resourceLabel);return a.length>0?this._tryToSplitAndUndo(e,n,null,L({},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",n.label,a.join(", "))):r.isValid()?null:this._tryToSplitAndUndo(e,n,null,L({},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",n.label))}_workspaceUndo(e,n,r){const s=this._getAffectedEditStacks(n),o=this._checkWorkspaceUndo(e,n,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,n,s,r)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,n]of this._editStacks){const r=n.getClosestPastElement();if(r){if(r===e){const s=n.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(r.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,n,r,s){return a6(this,void 0,void 0,function*(){if(n.canSplit()&&!this._isPartOfUndoGroup(n)){let l;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(l||(l={}));const{result:c}=yield this._dialogService.prompt({type:vs.Info,message:L("confirmWorkspace","Would you like to undo '{0}' across all files?",n.label),buttons:[{label:L({},"&&Undo in {0} Files",r.editStacks.length),run:()=>l.All},{label:L({},"Undo this &&File"),run:()=>l.This}],cancelButton:{run:()=>l.Cancel}});if(c===l.Cancel)return;if(c===l.This)return this._splitPastWorkspaceElement(n,null),this._undo(e,0,!0);const u=this._checkWorkspaceUndo(e,n,r,!1);if(u)return u.returnValue;s=!0}let o;try{o=yield this._invokeWorkspacePrepare(n)}catch(l){return this._onError(l,n)}const a=this._checkWorkspaceUndo(e,n,r,!0);if(a)return o.dispose(),a.returnValue;for(const l of r.editStacks)l.moveBackward(n);return this._safeInvokeWithLocks(n,()=>n.actual.undo(),r,o,()=>this._continueUndoInGroup(n.groupId,s))})}_resourceUndo(e,n,r){if(!n.isValid){e.flushAllElements();return}if(e.locked){const s=L({},"Could not undo '{0}' because there is already an undo or redo operation running.",n.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(n,s=>(e.moveBackward(n),this._safeInvokeWithLocks(n,()=>n.actual.undo(),new Bq([e]),s,()=>this._continueUndoInGroup(n.groupId,r))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let n=null,r=null;for(const[s,o]of this._editStacks){const a=o.getClosestPastElement();a&&a.groupId===e&&(!n||a.groupOrder>n.groupOrder)&&(n=a,r=s)}return[n,r]}_continueUndoInGroup(e,n){if(!e)return;const[,r]=this._findClosestUndoElementInGroup(e);if(r)return this._undo(r,0,n)}undo(e){if(e instanceof hm){const[,n]=this._findClosestUndoElementWithSource(e.id);return n?this._undo(n,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,n=0,r){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[l,c]=this._findClosestUndoElementInGroup(o.groupId);if(o!==l&&c)return this._undo(c,n,r)}if((o.sourceId!==n||o.confirmBeforeUndo)&&!r)return this._confirmAndContinueUndo(e,n,o);try{return o.type===1?this._workspaceUndo(e,o,r):this._resourceUndo(s,o,r)}finally{}}_confirmAndContinueUndo(e,n,r){return a6(this,void 0,void 0,function*(){if((yield this._dialogService.confirm({message:L("confirmDifferentSource","Would you like to undo '{0}'?",r.label),primaryButton:L({},"&&Yes"),cancelButton:L("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,n,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let n=null,r=null;for(const[s,o]of this._editStacks){const a=o.getClosestFutureElement();a&&a.sourceId===e&&(!n||a.sourceOrder<n.sourceOrder)&&(n=a,r=s)}return[n,r]}canRedo(e){if(e instanceof hm){const[,r]=this._findClosestRedoElementWithSource(e.id);return!!r}const n=this.getUriComparisonKey(e);return this._editStacks.has(n)?this._editStacks.get(n).hasFutureElements():!1}_tryToSplitAndRedo(e,n,r,s){if(n.canSplit())return this._splitFutureWorkspaceElement(n,r),this._notificationService.warn(s),new u6(this._redo(e));for(const o of n.strResources)this.removeElements(o);return this._notificationService.warn(s),new u6}_checkWorkspaceRedo(e,n,r,s){if(n.removedResources)return this._tryToSplitAndRedo(e,n,n.removedResources,L({},"Could not redo '{0}' across all files. {1}",n.label,n.removedResources.createMessage()));if(s&&n.invalidatedResources)return this._tryToSplitAndRedo(e,n,n.invalidatedResources,L({},"Could not redo '{0}' across all files. {1}",n.label,n.invalidatedResources.createMessage()));const o=[];for(const l of r.editStacks)l.getClosestFutureElement()!==n&&o.push(l.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,n,null,L({},"Could not redo '{0}' across all files because changes were made to {1}",n.label,o.join(", ")));const a=[];for(const l of r.editStacks)l.locked&&a.push(l.resourceLabel);return a.length>0?this._tryToSplitAndRedo(e,n,null,L({},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",n.label,a.join(", "))):r.isValid()?null:this._tryToSplitAndRedo(e,n,null,L({},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",n.label))}_workspaceRedo(e,n){const r=this._getAffectedEditStacks(n),s=this._checkWorkspaceRedo(e,n,r,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,n,r)}_executeWorkspaceRedo(e,n,r){return a6(this,void 0,void 0,function*(){let s;try{s=yield this._invokeWorkspacePrepare(n)}catch(a){return this._onError(a,n)}const o=this._checkWorkspaceRedo(e,n,r,!0);if(o)return s.dispose(),o.returnValue;for(const a of r.editStacks)a.moveForward(n);return this._safeInvokeWithLocks(n,()=>n.actual.redo(),r,s,()=>this._continueRedoInGroup(n.groupId))})}_resourceRedo(e,n){if(!n.isValid){e.flushAllElements();return}if(e.locked){const r=L({},"Could not redo '{0}' because there is already an undo or redo operation running.",n.label);this._notificationService.warn(r);return}return this._invokeResourcePrepare(n,r=>(e.moveForward(n),this._safeInvokeWithLocks(n,()=>n.actual.redo(),new Bq([e]),r,()=>this._continueRedoInGroup(n.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let n=null,r=null;for(const[s,o]of this._editStacks){const a=o.getClosestFutureElement();a&&a.groupId===e&&(!n||a.groupOrder<n.groupOrder)&&(n=a,r=s)}return[n,r]}_continueRedoInGroup(e){if(!e)return;const[,n]=this._findClosestRedoElementInGroup(e);if(n)return this._redo(n)}redo(e){if(e instanceof hm){const[,n]=this._findClosestRedoElementWithSource(e.id);return n?this._redo(n):void 0}return typeof e=="string"?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),r=n.getClosestFutureElement();if(r){if(r.groupId){const[s,o]=this._findClosestRedoElementInGroup(r.groupId);if(r!==s&&o)return this._redo(o)}try{return r.type===1?this._workspaceRedo(e,r):this._resourceRedo(n,r)}finally{}}}};tee=f0t([_me(0,W5),_me(1,Ps)],tee);class u6{constructor(e){this.returnValue=e}}oi(P$,tee,1);function Kc(i,e,n){return Math.min(Math.max(i,e),n)}class kTe{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class g0t{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const n=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=n,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}const Goe=qn("environmentService"),fu=qn("openerService");function Xoe(i,e){return Jt.isUri(i)?n2(i.scheme,e):Wse(i,e+":")}function yme(i,...e){return e.some(n=>Xoe(i,n))}function m0t(i){let e;const n=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.fragment);return n&&(e={startLineNumber:parseInt(n[1]),startColumn:n[2]?parseInt(n[2]):1,endLineNumber:n[4]?parseInt(n[4]):void 0,endColumn:n[4]?n[5]?parseInt(n[5]):1:void 0},i=i.with({fragment:""})),{selection:e,uri:i}}var _0t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},wme=function(i,e){return function(n,r){e(n,r,i)}};const xh=qn("ILanguageFeatureDebounceService");var v7;(function(i){const e=new WeakMap;let n=0;function r(s){let o=e.get(s);return o===void 0&&(o=++n,e.set(s,o)),o}i.of=r})(v7||(v7={}));class v0t{constructor(e){this._default=e}get(e){return this._default}update(e,n){return this._default}default(){return this._default}}class b0t{constructor(e,n,r,s,o,a){this._logService=e,this._name=n,this._registry=r,this._default=s,this._min=o,this._max=a,this._cache=new G1(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((n,r)=>y$(v7.of(r),n),0)}get(e){const n=this._key(e),r=this._cache.get(n);return r?Kc(r.value,this._min,this._max):this.default()}update(e,n){const r=this._key(e);let s=this._cache.get(r);s||(s=new g0t(6),this._cache.set(r,s));const o=Kc(s.update(n),this._min,this._max);return Xoe(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new kTe;for(const[,n]of this._cache)e.update(n.value);return e.value}default(){const e=this._overall()|0||this._default;return Kc(e,this._min,this._max)}}let nee=class{constructor(e,n){this._logService=e,this._data=new Map,this._isDev=n.isExtensionDevelopment||!n.isBuilt}for(e,n,r){var s,o,a;const l=(s=r==null?void 0:r.min)!==null&&s!==void 0?s:50,c=(o=r==null?void 0:r.max)!==null&&o!==void 0?o:Math.pow(l,2),u=(a=r==null?void 0:r.key)!==null&&a!==void 0?a:void 0,d=`${v7.of(e)},${l}${u?","+u:""}`;let h=this._data.get(d);return h||(this._isDev?h=new b0t(this._logService,n,e,this._overallAverage()|0||l*1.5,l,c):(this._logService.debug(`[DEBOUNCE: ${n}] is disabled in developed mode`),h=new v0t(l*1.5)),this._data.set(d,h)),h}_overallAverage(){const e=new kTe;for(const n of this._data.values())e.update(n.default());return e.value}};nee=_0t([wme(0,vd),wme(1,Goe)],nee);oi(xh,nee,1);class mM{static create(e,n){return new mM(e,new b7(n))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,n){this._startLineNumber=e,this._tokens=n,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new J(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const n=e.startLineNumber-this._startLineNumber,r=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(n,e.startColumn-1,r,e.endColumn-1),this._updateEndLineNumber()}split(e){const n=e.startLineNumber-this._startLineNumber,r=e.endLineNumber-this._startLineNumber,[s,o,a]=this._tokens.split(n,e.startColumn-1,r,e.endColumn-1);return[new mM(this._startLineNumber,s),new mM(this._startLineNumber+a,o)]}applyEdit(e,n){const[r,s,o]=y1(n);this.acceptEdit(e,r,s,o,n.length>0?n.charCodeAt(0):0)}acceptEdit(e,n,r,s,o){this._acceptDeleteRange(e),this._acceptInsertText(new ve(e.startLineNumber,e.startColumn),n,r,s,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const n=e.startLineNumber-this._startLineNumber,r=e.endLineNumber-this._startLineNumber;if(r<0){const o=r-n;this._startLineNumber-=o;return}const s=this._tokens.getMaxDeltaLine();if(!(n>=s+1)){if(n<0&&r>=s+1){this._startLineNumber=0,this._tokens.clear();return}if(n<0){const o=-n;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,r,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,n,e.startColumn-1,r,e.endColumn-1)}}_acceptInsertText(e,n,r,s,o){if(n===0&&r===0)return;const a=e.lineNumber-this._startLineNumber;if(a<0){this._startLineNumber+=n;return}const l=this._tokens.getMaxDeltaLine();a>=l+1||this._tokens.acceptInsertText(a,e.column-1,n,r,s,o)}}class b7{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const n=[];for(let r=0;r<this._tokenCount;r++)n.push(`(${this._getDeltaLine(r)+e},${this._getStartCharacter(r)}-${this._getEndCharacter(r)})`);return`[${n.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return e===0?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(e===0)return null;const n=this._getStartCharacter(0),r=this._getDeltaLine(e-1),s=this._getEndCharacter(e-1);return new J(0,n+1,r,s+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return this._getTokenCount()===0}getLineTokens(e){let n=0,r=this._getTokenCount()-1;for(;n<r;){const s=n+Math.floor((r-n)/2),o=this._getDeltaLine(s);if(o<e)n=s+1;else if(o>e)r=s-1;else{let a=s;for(;a>n&&this._getDeltaLine(a-1)===e;)a--;let l=s;for(;l<r&&this._getDeltaLine(l+1)===e;)l++;return new Cme(this._tokens.subarray(4*a,4*l+4))}}return this._getDeltaLine(n)===e?new Cme(this._tokens.subarray(4*n,4*n+4)):null}clear(){this._tokenCount=0}removeTokens(e,n,r,s){const o=this._tokens,a=this._tokenCount;let l=0,c=!1,u=0;for(let d=0;d<a;d++){const h=4*d,f=o[h],p=o[h+1],g=o[h+2],m=o[h+3];if((f>e||f===e&&g>=n)&&(f<r||f===r&&p<=s))c=!0;else{if(l===0&&(u=f),c){const _=4*l;o[_]=f-u,o[_+1]=p,o[_+2]=g,o[_+3]=m}l++}}return this._tokenCount=l,u}split(e,n,r,s){const o=this._tokens,a=this._tokenCount,l=[],c=[];let u=l,d=0,h=0;for(let f=0;f<a;f++){const p=4*f,g=o[p],m=o[p+1],_=o[p+2],b=o[p+3];if(g>e||g===e&&_>=n){if(g<r||g===r&&m<=s)continue;u!==c&&(u=c,d=0,h=g)}u[d++]=g-h,u[d++]=m,u[d++]=_,u[d++]=b}return[new b7(new Uint32Array(l)),new b7(new Uint32Array(c)),h]}acceptDeleteRange(e,n,r,s,o){const a=this._tokens,l=this._tokenCount,c=s-n;let u=0,d=!1;for(let h=0;h<l;h++){const f=4*h;let p=a[f],g=a[f+1],m=a[f+2];const _=a[f+3];if(p<n||p===n&&m<=r){u++;continue}else if(p===n&&g<r)p===s&&m>o?m-=o-r:m=r;else if(p===n&&g===r)if(p===s&&m>o)m-=o-r;else{d=!0;continue}else if(p<s||p===s&&g<o)if(p===s&&m>o)p=n,g=r,m=g+(m-o);else{d=!0;continue}else if(p>s){if(c===0&&!d){u=l;break}p-=c}else if(p===s&&g>=o)e&&p===0&&(g+=e,m+=e),p-=c,g-=o-r,m-=o-r;else throw new Error("Not possible!");const b=4*u;a[b]=p,a[b+1]=g,a[b+2]=m,a[b+3]=_,u++}this._tokenCount=u}acceptInsertText(e,n,r,s,o,a){const l=r===0&&s===1&&(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122),c=this._tokens,u=this._tokenCount;for(let d=0;d<u;d++){const h=4*d;let f=c[h],p=c[h+1],g=c[h+2];if(!(f<e||f===e&&g<n)){if(f===e&&g===n)if(l)g+=1;else continue;else if(f===e&&p<n&&n<g)r===0?g+=s:g=n;else{if(f===e&&p===n&&l)continue;if(f===e)if(f+=r,r===0)p+=s,g+=s;else{const m=g-p;p=o+(p-n),g=p+m}else f+=r}c[h]=f,c[h+1]=p,c[h+2]=g}}}}class Cme{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var y0t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},jq=function(i,e){return function(n,r){e(n,r,i)}};let iee=class{constructor(e,n,r,s){this._legend=e,this._themeService=n,this._languageService=r,this._logService=s,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new N0}getMetadata(e,n,r){const s=this._languageService.languageIdCodec.encodeLanguageId(r),o=this._hashTable.get(e,n,s);let a;if(o)a=o.metadata,this._logService.getLevel()===La.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${n}: foreground ${Da.getForeground(a)}, fontStyle ${Da.getFontStyle(a).toString(2)}`);else{let l=this._legend.tokenTypes[e];const c=[];if(l){let u=n;for(let h=0;u>0&&h<this._legend.tokenModifiers.length;h++)u&1&&c.push(this._legend.tokenModifiers[h]),u=u>>1;u>0&&this._logService.getLevel()===La.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${n.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),c.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(l,c,r);if(typeof d>"u")a=2147483647;else{if(a=0,typeof d.italic<"u"){const h=(d.italic?1:0)<<11;a|=h|1}if(typeof d.bold<"u"){const h=(d.bold?2:0)<<11;a|=h|2}if(typeof d.underline<"u"){const h=(d.underline?4:0)<<11;a|=h|4}if(typeof d.strikethrough<"u"){const h=(d.strikethrough?8:0)<<11;a|=h|8}if(d.foreground){const h=d.foreground<<15;a|=h|16}a===0&&(a=2147483647)}}else this._logService.getLevel()===La.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),a=2147483647,l="not-in-legend";this._hashTable.add(e,n,s,a),this._logService.getLevel()===La.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${l}) / ${n} (${c.join(" ")}): foreground ${Da.getForeground(a)}, fontStyle ${Da.getFontStyle(a).toString(2)}`)}return a}warnOverlappingSemanticTokens(e,n){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${n}`))}warnInvalidLengthSemanticTokens(e,n){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${n}`))}warnInvalidEditStart(e,n,r,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${n}) at edit #${r}: The provided start offset ${s} is outside the previous data (length ${o}).`))}};iee=y0t([jq(1,Do),jq(2,Ar),jq(3,vd)],iee);function LTe(i,e,n){const r=i.data,s=i.data.length/5|0,o=Math.max(Math.ceil(s/1024),400),a=[];let l=0,c=1,u=0;for(;l<s;){const d=l;let h=Math.min(d+o,s);if(h<s){let y=h;for(;y-1>d&&r[5*y]===0;)y--;if(y-1===d){let x=h;for(;x+1<s&&r[5*x]===0;)x++;h=x}else h=y}let f=new Uint32Array((h-d)*4),p=0,g=0,m=0,_=0;for(;l<h;){const y=5*l,x=r[y],k=r[y+1],D=c+x|0,R=x===0?u+k|0:k,E=r[y+2],A=R+E|0,M=r[y+3],N=r[y+4];if(A<=R)e.warnInvalidLengthSemanticTokens(D,R+1);else if(m===D&&_>R)e.warnOverlappingSemanticTokens(D,R+1);else{const P=e.getMetadata(M,N,n);P!==2147483647&&(g===0&&(g=D),f[p]=D-g,f[p+1]=R,f[p+2]=A,f[p+3]=P,p+=4,m=D,_=A)}c=D,u=R,l++}p!==f.length&&(f=f.subarray(0,p));const b=mM.create(g,f);a.push(b)}return a}class w0t{constructor(e,n,r,s){this.tokenTypeIndex=e,this.tokenModifierSet=n,this.languageId=r,this.metadata=s,this.next=null}}class N0{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=N0._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<N0._SIZES.length?2/3*this._currentLength:0),this._elements=[],N0._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,n){for(let r=0;r<n;r++)e[r]=null}_hash2(e,n){return(e<<5)-e+n|0}_hashFunc(e,n,r){return this._hash2(this._hash2(e,n),r)%this._currentLength}get(e,n,r){const s=this._hashFunc(e,n,r);let o=this._elements[s];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===n&&o.languageId===r)return o;o=o.next}return null}add(e,n,r,s){if(this._elementsCount++,this._growCount!==0&&this._elementsCount>=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=N0._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<N0._SIZES.length?2/3*this._currentLength:0),this._elements=[],N0._nullOutEntries(this._elements,this._currentLength);for(const a of o){let l=a;for(;l;){const c=l.next;l.next=null,this._add(l),l=c}}}this._add(new w0t(e,n,r,s))}_add(e){const n=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[n],this._elements[n]=e}}N0._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];const B$=qn("semanticTokensStylingService");var C0t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Wq=function(i,e){return function(n,r){e(n,r,i)}};let ree=class extends Le{constructor(e,n,r){super(),this._themeService=e,this._logService=n,this._languageService=r,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new iee(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};ree=C0t([Wq(0,Do),Wq(1,vd),Wq(2,Ar)],ree);oi(B$,ree,1);var Sme=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const d6="**",xme="/",b8="[/\\\\]",y8="[^/\\\\]",S0t=/\//g;function kme(i,e){switch(i){case 0:return"";case 1:return`${y8}*?`;default:return`(?:${b8}|${y8}+${b8}${e?`|${b8}${y8}+`:""})*?`}}function Lme(i,e){if(!i)return[];const n=[];let r=!1,s=!1,o="";for(const a of i){switch(a){case e:if(!r&&!s){n.push(o),o="";continue}break;case"{":r=!0;break;case"}":r=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=a}return o&&n.push(o),n}function DTe(i){if(!i)return"";let e="";const n=Lme(i,xme);if(n.every(r=>r===d6))e=".*";else{let r=!1;n.forEach((s,o)=>{if(s===d6){if(r)return;e+=kme(2,o===n.length-1)}else{let a=!1,l="",c=!1,u="";for(const d of s){if(d!=="}"&&a){l+=d;continue}if(c&&(d!=="]"||!u)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!u?h="^":d===xme?h="":h=dd(d),u+=h;continue}switch(d){case"{":a=!0;continue;case"[":c=!0;continue;case"}":{const f=`(?:${Lme(l,",").map(p=>DTe(p)).join("|")})`;e+=f,a=!1,l="";break}case"]":{e+="["+u+"]",c=!1,u="";break}case"?":e+=y8;continue;case"*":e+=kme(1);continue;default:e+=dd(d)}}o<n.length-1&&(n[o+1]!==d6||o+2<n.length)&&(e+=b8)}r=s===d6})}return e}const x0t=/^\*\*\/\*\.[\w\.-]+$/,k0t=/^\*\*\/([\w\.-]+)\/?$/,L0t=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,D0t=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,E0t=/^\*\*((\/[\w\.-]+)+)\/?$/,I0t=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,Dme=new G1(1e4),Eme=function(){return!1},Mm=function(){return null};function Yoe(i,e){if(!i)return Mm;let n;typeof i!="string"?n=i.pattern:n=i,n=n.trim();const r=`${n}_${!!e.trimForExclusions}`;let s=Dme.get(r);if(s)return Ime(s,i);let o;return x0t.test(n)?s=T0t(n.substr(4),n):(o=k0t.exec($q(n,e)))?s=R0t(o[1],n):(e.trimForExclusions?D0t:L0t).test(n)?s=A0t(n,e):(o=E0t.exec($q(n,e)))?s=Tme(o[1].substr(1),n,!0):(o=I0t.exec($q(n,e)))?s=Tme(o[1],n,!1):s=N0t(n),Dme.set(r,s),Ime(s,i)}function Ime(i,e){if(typeof e=="string")return i;const n=function(r,s){return $J(r,e.base,!_l)?i(S5(r.substr(e.base.length),Wp),s):null};return n.allBasenames=i.allBasenames,n.allPaths=i.allPaths,n.basenames=i.basenames,n.patterns=i.patterns,n}function $q(i,e){return e.trimForExclusions&&i.endsWith("/**")?i.substr(0,i.length-2):i}function T0t(i,e){return function(n,r){return typeof n=="string"&&n.endsWith(i)?e:null}}function R0t(i,e){const n=`/${i}`,r=`\\${i}`,s=function(a,l){return typeof a!="string"?null:l?l===i?e:null:a===i||a.endsWith(n)||a.endsWith(r)?e:null},o=[i];return s.basenames=o,s.patterns=[e],s.allBasenames=o,s}function A0t(i,e){const n=ITe(i.slice(1,-1).split(",").map(l=>Yoe(l,e)).filter(l=>l!==Mm),i),r=n.length;if(!r)return Mm;if(r===1)return n[0];const s=function(l,c){for(let u=0,d=n.length;u<d;u++)if(n[u](l,c))return i;return null},o=n.find(l=>!!l.allBasenames);o&&(s.allBasenames=o.allBasenames);const a=n.reduce((l,c)=>c.allPaths?l.concat(c.allPaths):l,[]);return a.length&&(s.allPaths=a),s}function Tme(i,e,n){const r=Wp===to.sep,s=r?i:i.replace(S0t,Wp),o=Wp+s,a=to.sep+i;let l;return n?l=function(c,u){return typeof c=="string"&&(c===s||c.endsWith(o)||!r&&(c===i||c.endsWith(a)))?e:null}:l=function(c,u){return typeof c=="string"&&(c===s||!r&&c===i)?e:null},l.allPaths=[(n?"*/":"./")+i],l}function N0t(i){try{const e=new RegExp(`^${DTe(i)}$`);return function(n){return e.lastIndex=0,typeof n=="string"&&e.test(n)?i:null}}catch{return Mm}}function M0t(i,e,n){return!i||typeof e!="string"?!1:ETe(i)(e,void 0,n)}function ETe(i,e={}){if(!i)return Eme;if(typeof i=="string"||P0t(i)){const n=Yoe(i,e);if(n===Mm)return Eme;const r=function(s,o){return!!n(s,o)};return n.allBasenames&&(r.allBasenames=n.allBasenames),n.allPaths&&(r.allPaths=n.allPaths),r}return O0t(i,e)}function P0t(i){const e=i;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function O0t(i,e){const n=ITe(Object.getOwnPropertyNames(i).map(l=>F0t(l,i[l],e)).filter(l=>l!==Mm)),r=n.length;if(!r)return Mm;if(!n.some(l=>!!l.requiresSiblings)){if(r===1)return n[0];const l=function(d,h){let f;for(let p=0,g=n.length;p<g;p++){const m=n[p](d,h);if(typeof m=="string")return m;uJ(m)&&(f||(f=[]),f.push(m))}return f?Sme(this,void 0,void 0,function*(){for(const p of f){const g=yield p;if(typeof g=="string")return g}return null}):null},c=n.find(d=>!!d.allBasenames);c&&(l.allBasenames=c.allBasenames);const u=n.reduce((d,h)=>h.allPaths?d.concat(h.allPaths):d,[]);return u.length&&(l.allPaths=u),l}const s=function(l,c,u){let d,h;for(let f=0,p=n.length;f<p;f++){const g=n[f];g.requiresSiblings&&u&&(c||(c=jy(l)),d||(d=c.substr(0,c.length-rot(l).length)));const m=g(l,c,d,u);if(typeof m=="string")return m;uJ(m)&&(h||(h=[]),h.push(m))}return h?Sme(this,void 0,void 0,function*(){for(const f of h){const p=yield f;if(typeof p=="string")return p}return null}):null},o=n.find(l=>!!l.allBasenames);o&&(s.allBasenames=o.allBasenames);const a=n.reduce((l,c)=>c.allPaths?l.concat(c.allPaths):l,[]);return a.length&&(s.allPaths=a),s}function F0t(i,e,n){if(e===!1)return Mm;const r=Yoe(i,n);if(r===Mm)return Mm;if(typeof e=="boolean")return r;if(e){const s=e.when;if(typeof s=="string"){const o=(a,l,c,u)=>{if(!u||!r(a,l))return null;const d=s.replace("$(basename)",()=>c),h=u(d);return uJ(h)?h.then(f=>f?i:null):h?i:null};return o.requiresSiblings=!0,o}}return r}function ITe(i,e){const n=i.filter(l=>!!l.basenames);if(n.length<2)return i;const r=n.reduce((l,c)=>{const u=c.basenames;return u?l.concat(u):l},[]);let s;if(e){s=[];for(let l=0,c=r.length;l<c;l++)s.push(e)}else s=n.reduce((l,c)=>{const u=c.patterns;return u?l.concat(u):l},[]);const o=function(l,c){if(typeof l!="string")return null;if(!c){let d;for(d=l.length;d>0;d--){const h=l.charCodeAt(d-1);if(h===47||h===92)break}c=l.substr(d)}const u=r.indexOf(c);return u!==-1?s[u]:null};o.basenames=r,o.patterns=s,o.allBasenames=r;const a=i.filter(l=>!l.basenames);return a.push(o),a}function TTe(i,e,n,r,s,o){if(Array.isArray(i)){let a=0;for(const l of i){const c=TTe(l,e,n,r,s,o);if(c===10)return c;c>a&&(a=c)}return a}else{if(typeof i=="string")return r?i==="*"?5:i===n?10:0:0;if(i){const{language:a,pattern:l,scheme:c,hasAccessToAllModels:u,notebookType:d}=i;if(!r&&!u)return 0;d&&s&&(e=s);let h=0;if(c)if(c===e.scheme)h=10;else if(c==="*")h=5;else return 0;if(a)if(a===n)h=10;else if(a==="*")h=Math.max(h,5);else return 0;if(d)if(d===o)h=10;else if(d==="*"&&o!==void 0)h=Math.max(h,5);else return 0;if(l){let f;if(typeof l=="string"?f=l:f=Object.assign(Object.assign({},l),{base:j2e(l.base)}),f===e.fsPath||M0t(f,e.fsPath))h=10;else return 0}return h}else return 0}}function RTe(i){return typeof i=="string"?!1:Array.isArray(i)?i.every(RTe):!!i.exclusive}class Rme{constructor(e,n,r,s){this.uri=e,this.languageId=n,this.notebookUri=r,this.notebookType=s}equals(e){var n,r;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((n=this.notebookUri)===null||n===void 0?void 0:n.toString())===((r=e.notebookUri)===null||r===void 0?void 0:r.toString())}}class is{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new _e,this.onDidChange=this._onDidChange.event}register(e,n){let r={selector:e,provider:n,_score:-1,_time:this._clock++};return this._entries.push(r),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),gn(()=>{if(r){const s=this._entries.indexOf(r);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),r=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const n=[];for(const r of this._entries)r._score>0&&n.push(r.provider);return n}ordered(e){const n=[];return this._orderedForEach(e,r=>n.push(r.provider)),n}orderedGroups(e){const n=[];let r,s;return this._orderedForEach(e,o=>{r&&s===o._score?r.push(o.provider):(s=o._score,r=[o.provider],n.push(r))}),n}_orderedForEach(e,n){this._updateScores(e);for(const r of this._entries)r._score>0&&n(r)}_updateScores(e){var n,r;const s=(n=this._notebookInfoResolver)===null||n===void 0?void 0:n.call(this,e.uri),o=s?new Rme(e.uri,e.getLanguageId(),s.uri,s.type):new Rme(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((r=this._lastCandidate)===null||r===void 0)&&r.equals(o))){this._lastCandidate=o;for(const a of this._entries)if(a._score=TTe(a.selector,o.uri,o.languageId,Ect(e),o.notebookUri,o.notebookType),RTe(a.selector)&&a._score>0){for(const l of this._entries)l._score=0;a._score=1e3;break}this._entries.sort(is._compareByScoreAndTime)}}static _compareByScoreAndTime(e,n){return e._score<n._score?1:e._score>n._score?-1:vN(e.selector)&&!vN(n.selector)?1:!vN(e.selector)&&vN(n.selector)?-1:e._time<n._time?1:e._time>n._time?-1:0}}function vN(i){return typeof i=="string"?!1:Array.isArray(i)?i.some(vN):!!i.isBuiltin}class B0t{constructor(){this.referenceProvider=new is(this._score.bind(this)),this.renameProvider=new is(this._score.bind(this)),this.codeActionProvider=new is(this._score.bind(this)),this.definitionProvider=new is(this._score.bind(this)),this.typeDefinitionProvider=new is(this._score.bind(this)),this.declarationProvider=new is(this._score.bind(this)),this.implementationProvider=new is(this._score.bind(this)),this.documentSymbolProvider=new is(this._score.bind(this)),this.inlayHintsProvider=new is(this._score.bind(this)),this.colorProvider=new is(this._score.bind(this)),this.codeLensProvider=new is(this._score.bind(this)),this.documentFormattingEditProvider=new is(this._score.bind(this)),this.documentRangeFormattingEditProvider=new is(this._score.bind(this)),this.onTypeFormattingEditProvider=new is(this._score.bind(this)),this.signatureHelpProvider=new is(this._score.bind(this)),this.hoverProvider=new is(this._score.bind(this)),this.documentHighlightProvider=new is(this._score.bind(this)),this.selectionRangeProvider=new is(this._score.bind(this)),this.foldingRangeProvider=new is(this._score.bind(this)),this.linkProvider=new is(this._score.bind(this)),this.inlineCompletionsProvider=new is(this._score.bind(this)),this.completionProvider=new is(this._score.bind(this)),this.linkedEditingRangeProvider=new is(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new is(this._score.bind(this)),this.documentSemanticTokensProvider=new is(this._score.bind(this)),this.documentOnDropEditProvider=new is(this._score.bind(this)),this.documentPasteEditProvider=new is(this._score.bind(this))}_score(e){var n;return(n=this._notebookTypeResolver)===null||n===void 0?void 0:n.call(this,e)}}oi(Et,B0t,1);const $5=qn("IWorkspaceEditService");class Zoe{constructor(e){this.metadata=e}static convert(e){return e.edits.map(n=>{if(mv.is(n))return mv.lift(n);if(J2.is(n))return J2.lift(n);throw new Error("Unsupported edit")})}}class mv extends Zoe{static is(e){return e instanceof mv?!0:Bl(e)&&Jt.isUri(e.resource)&&Bl(e.textEdit)}static lift(e){return e instanceof mv?e:new mv(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,n,r=void 0,s){super(s),this.resource=e,this.textEdit=n,this.versionId=r}}class J2 extends Zoe{static is(e){return e instanceof J2?!0:Bl(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof J2?e:new J2(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,n,r={},s){super(s),this.oldResource=e,this.newResource=n,this.options=r}}const ll={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},j$=Object.freeze({id:"editor",order:5,type:"object",title:L("editorConfigurationTitle","Editor"),scope:5}),y7=Object.assign(Object.assign({},j$),{properties:{"editor.tabSize":{type:"number",default:za.tabSize,minimum:1,markdownDescription:L("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:L("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:za.insertSpaces,markdownDescription:L("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:za.detectIndentation,markdownDescription:L("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:za.trimAutoWhitespace,description:L("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:za.largeFileOptimizations,description:L("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:L("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[L("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),L("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),L("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:L("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[L("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),L("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),L("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:L("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:L("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:L("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:L("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:L("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:L("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:L("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:L("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:L("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:L("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:L("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:L("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:ll.maxComputationTime,description:L("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:ll.maxFileSize,description:L("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:ll.renderSideBySide,description:L("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:ll.renderSideBySideInlineBreakpoint,description:L("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:ll.useInlineViewWhenSpaceIsLimited,description:L("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:ll.renderMarginRevertIcon,description:L("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:ll.ignoreTrimWhitespace,description:L("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:ll.renderIndicators,description:L("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:ll.diffCodeLens,description:L("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:ll.diffWordWrap,markdownEnumDescriptions:[L("wordWrap.off","Lines will never wrap."),L("wordWrap.on","Lines will wrap at the viewport width."),L("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:ll.diffAlgorithm,markdownEnumDescriptions:[L("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),L("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:ll.hideUnchangedRegions.enabled,markdownDescription:L("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:ll.hideUnchangedRegions.revealLineCount,markdownDescription:L("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:ll.hideUnchangedRegions.minimumLineCount,markdownDescription:L("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:ll.hideUnchangedRegions.contextLineCount,markdownDescription:L("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:ll.experimental.showMoves,markdownDescription:L("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:ll.experimental.showEmptyDecorations,description:L("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function j0t(i){return typeof i.type<"u"||typeof i.anyOf<"u"}for(const i of t2){const e=i.schema;if(typeof e<"u")if(j0t(e))y7.properties[`editor.${i.name}`]=e;else for(const n in e)Object.hasOwnProperty.call(e,n)&&(y7.properties[n]=e[n])}let h6=null;function ATe(){return h6===null&&(h6=Object.create(null),Object.keys(y7.properties).forEach(i=>{h6[i]=!0})),h6}function W0t(i){return ATe()[`editor.${i}`]||!1}function $0t(i){return ATe()[`diffEditor.${i}`]||!1}const z0t=Kr.as(ag.Configuration);z0t.registerConfiguration(y7);class Vr{static insert(e,n){return{range:new J(e.lineNumber,e.column,e.lineNumber,e.column),text:n,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,n){return{range:e,text:n}}static replaceMove(e,n){return{range:e,text:n,forceMoveMarkers:!0}}}function zq(i){return Object.isFrozen(i)?i:Irt(i)}class Wa{constructor(e={},n=[],r=[],s){this._contents=e,this._keys=n,this._overrides=r,this.raw=s,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const n=this.raw.map(r=>{if(r instanceof Wa)return r;const s=new V0t("");return s.parseRaw(r),s.configurationModel});this._rawConfiguration=n.reduce((r,s)=>s===r?s:r.merge(s),n[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?bpe(this.contents,e):this.contents}inspect(e,n){const r=this.rawConfiguration.getValue(e),s=n?this.rawConfiguration.getOverrideValue(e,n):void 0,o=n?this.rawConfiguration.override(n).getValue(e):r;return{value:r,override:s,merged:o}}getOverrideValue(e,n){const r=this.getContentsForOverrideIdentifer(n);return r?e?bpe(r,e):r:void 0}override(e){let n=this.overrideConfigurations.get(e);return n||(n=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,n)),n}merge(...e){var n,r;const s=T0(this.contents),o=T0(this.overrides),a=[...this.keys],l=!((n=this.raw)===null||n===void 0)&&n.length?[...this.raw]:[this];for(const c of e)if(l.push(...!((r=c.raw)===null||r===void 0)&&r.length?c.raw:[c]),!c.isEmpty()){this.mergeContents(s,c.contents);for(const u of c.overrides){const[d]=o.filter(h=>ys(h.identifiers,u.identifiers));d?(this.mergeContents(d.contents,u.contents),d.keys.push(...u.keys),d.keys=l1(d.keys)):o.push(T0(u))}for(const u of c.keys)a.indexOf(u)===-1&&a.push(u)}return new Wa(s,a,o,l.every(c=>c instanceof Wa)?void 0:l)}createOverrideConfigurationModel(e){const n=this.getContentsForOverrideIdentifer(e);if(!n||typeof n!="object"||!Object.keys(n).length)return this;const r={};for(const s of l1([...Object.keys(this.contents),...Object.keys(n)])){let o=this.contents[s];const a=n[s];a&&(typeof o=="object"&&typeof a=="object"?(o=T0(o),this.mergeContents(o,a)):o=a),r[s]=o}return new Wa(r,this.keys,this.overrides)}mergeContents(e,n){for(const r of Object.keys(n)){if(r in e&&Bl(e[r])&&Bl(n[r])){this.mergeContents(e[r],n[r]);continue}e[r]=T0(n[r])}}getContentsForOverrideIdentifer(e){let n=null,r=null;const s=o=>{o&&(r?this.mergeContents(r,o):r=T0(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?n=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(n),r}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,n){this.updateValue(e,n,!0)}setValue(e,n){this.updateValue(e,n,!1)}removeValue(e){const n=this.keys.indexOf(e);n!==-1&&(this.keys.splice(n,1),Hlt(this.contents,e),m1.test(e)&&this.overrides.splice(this.overrides.findIndex(r=>ys(r.identifiers,H9(e))),1))}updateValue(e,n,r){WEe(this.contents,e,n,s=>console.error(s)),r=r||this.keys.indexOf(e)===-1,r&&this.keys.push(e),m1.test(e)&&this.overrides.push({identifiers:H9(e),keys:Object.keys(this.contents[e]),contents:fJ(this.contents[e],s=>console.error(s))})}}class V0t{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new Wa}parseRaw(e,n){this._raw=e;const{contents:r,keys:s,overrides:o,restricted:a,hasExcludedProperties:l}=this.doParseRaw(e,n);this._configurationModel=new Wa(r,s,o,l?[e]:void 0),this._restrictedConfigurations=a||[]}doParseRaw(e,n){const r=Kr.as(ag.Configuration).getConfigurationProperties(),s=this.filter(e,r,!0,n);e=s.raw;const o=fJ(e,c=>console.error(`Conflict in settings file ${this._name}: ${c}`)),a=Object.keys(e),l=this.toOverrides(e,c=>console.error(`Conflict in settings file ${this._name}: ${c}`));return{contents:o,keys:a,overrides:l,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,n,r,s){var o,a,l;let c=!1;if(!(s!=null&&s.scopes)&&!(s!=null&&s.skipRestricted)&&!(!((o=s==null?void 0:s.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:c};const u={},d=[];for(const h in e)if(m1.test(h)&&r){const f=this.filter(e[h],n,!1,s);u[h]=f.raw,c=c||f.hasExcludedProperties,d.push(...f.restricted)}else{const f=n[h],p=f?typeof f.scope<"u"?f.scope:3:void 0;f!=null&&f.restricted&&d.push(h),!(!((a=s.exclude)===null||a===void 0)&&a.includes(h))&&(!((l=s.include)===null||l===void 0)&&l.includes(h)||(p===void 0||s.scopes===void 0||s.scopes.includes(p))&&!(s.skipRestricted&&(f!=null&&f.restricted)))?u[h]=e[h]:c=!0}return{raw:u,restricted:d,hasExcludedProperties:c}}toOverrides(e,n){const r=[];for(const s of Object.keys(e))if(m1.test(s)){const o={};for(const a in e[s])o[a]=e[s][a];r.push({identifiers:H9(s),keys:Object.keys(o),contents:fJ(o,n)})}return r}}class H0t{constructor(e,n,r,s,o,a,l,c,u,d,h,f,p){this.key=e,this.overrides=n,this._value=r,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=a,this.applicationConfiguration=l,this.userConfiguration=c,this.localUserConfiguration=u,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=f,this.memoryConfigurationModel=p}inspect(e,n,r){const s=e.inspect(n,r);return{get value(){return zq(s.value)},get override(){return zq(s.override)},get merged(){return zq(s.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class W${constructor(e,n,r,s,o=new Wa,a=new Wa,l=new Va,c=new Wa,u=new Va){this._defaultConfiguration=e,this._policyConfiguration=n,this._applicationConfiguration=r,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=a,this._folderConfigurations=l,this._memoryConfiguration=c,this._memoryConfigurationByResource=u,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Va,this._userConfiguration=null}getValue(e,n,r){return this.getConsolidatedConfigurationModel(e,n,r).getValue(e)}updateValue(e,n,r={}){let s;r.resource?(s=this._memoryConfigurationByResource.get(r.resource),s||(s=new Wa,this._memoryConfigurationByResource.set(r.resource,s))):s=this._memoryConfiguration,n===void 0?s.removeValue(e):s.setValue(e,n),r.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,n,r){const s=this.getConsolidatedConfigurationModel(e,n,r),o=this.getFolderConfigurationModelForResource(n.resource,r),a=n.resource?this._memoryConfigurationByResource.get(n.resource)||this._memoryConfiguration:this._memoryConfiguration,l=new Set;for(const c of s.overrides)for(const u of c.identifiers)s.getOverrideValue(e,u)!==void 0&&l.add(u);return new H0t(e,n,s.getValue(e),l.size?[...l]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,r?this._workspaceConfiguration:void 0,o||void 0,a)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,n,r){let s=this.getConsolidatedConfigurationModelForResource(n,r);return n.overrideIdentifier&&(s=s.override(n.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},n){let r=this.getWorkspaceConsolidatedConfiguration();if(n&&e){const s=n.getFolder(e);s&&(r=this.getFolderConsolidatedConfiguration(s.uri)||r);const o=this._memoryConfigurationByResource.get(e);o&&(r=r.merge(o))}return r}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let n=this._foldersConsolidatedConfigurations.get(e);if(!n){const r=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(n=r.merge(s),this._foldersConsolidatedConfigurations.set(e,n)):n=r}return n}getFolderConfigurationModelForResource(e,n){if(n&&e){const r=n.getFolder(e);if(r)return this._folderConfigurations.get(r.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,n)=>{const{contents:r,overrides:s,keys:o}=this._folderConfigurations.get(n);return e.push([n,{contents:r,overrides:s,keys:o}]),e},[])}}static parse(e){const n=this.parseConfigurationModel(e.defaults),r=this.parseConfigurationModel(e.policy),s=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),a=this.parseConfigurationModel(e.workspace),l=e.folders.reduce((c,u)=>(c.set(Jt.revive(u[0]),this.parseConfigurationModel(u[1])),c),new Va);return new W$(n,r,s,o,new Wa,a,l,new Wa,new Va)}static parseConfigurationModel(e){return new Wa(e.contents,e.keys,e.overrides)}}class U0t{constructor(e,n,r,s){this.change=e,this.previous=n,this.currentConfiguraiton=r,this.currentWorkspace=s,this._marker=`
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const a of o)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=W$.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,n){var r;const s=this._marker+e,o=this._affectsConfigStr.indexOf(s);if(o<0)return!1;const a=o+s.length;if(a>=this._affectsConfigStr.length)return!1;const l=this._affectsConfigStr.charCodeAt(a);if(l!==this._markerCode1&&l!==this._markerCode2)return!1;if(n){const c=this.previousConfiguration?this.previousConfiguration.getValue(e,n,(r=this.previous)===null||r===void 0?void 0:r.workspace):void 0,u=this.currentConfiguraiton.getValue(e,n,this.currentWorkspace);return!od(c,u)}return!0}}const w7={kind:0},q0t={kind:1};function K0t(i,e,n){return{kind:2,commandId:i,commandArgs:e,isBubble:n}}class _M{constructor(e,n,r){var s;this._log=r,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const a=o.command;a&&a.charAt(0)!=="-"&&this._defaultBoundCommands.set(a,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=_M.handleRemovals([].concat(e).concat(n));for(let o=0,a=this._keybindings.length;o<a;o++){const l=this._keybindings[o];if(l.chords.length===0)continue;const c=(s=l.when)===null||s===void 0?void 0:s.substituteConstants();c&&c.type===0||this._addKeyPress(l.chords[0],l)}}static _isTargetedForRemoval(e,n,r){if(n){for(let s=0;s<n.length;s++)if(n[s]!==e.chords[s])return!1}return!(r&&r.type!==1&&(!e.when||!nat(r,e.when)))}static handleRemovals(e){const n=new Map;for(let s=0,o=e.length;s<o;s++){const a=e[s];if(a.command&&a.command.charAt(0)==="-"){const l=a.command.substring(1);n.has(l)?n.get(l).push(a):n.set(l,[a])}}if(n.size===0)return e;const r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s];if(!a.command||a.command.length===0){r.push(a);continue}if(a.command.charAt(0)==="-")continue;const l=n.get(a.command);if(!l||!a.isDefault){r.push(a);continue}let c=!1;for(const u of l){const d=u.when;if(this._isTargetedForRemoval(a,u.chords,d)){c=!0;break}}if(!c){r.push(a);continue}}return r}_addKeyPress(e,n){const r=this._map.get(e);if(typeof r>"u"){this._map.set(e,[n]),this._addToLookupMap(n);return}for(let s=r.length-1;s>=0;s--){const o=r[s];if(o.command===n.command)continue;let a=!0;for(let l=1;l<o.chords.length&&l<n.chords.length;l++)if(o.chords[l]!==n.chords[l]){a=!1;break}a&&_M.whenIsEntirelyIncluded(o.when,n.when)&&this._removeFromLookupMap(o)}r.push(n),this._addToLookupMap(n)}_addToLookupMap(e){if(!e.command)return;let n=this._lookupMap.get(e.command);typeof n>"u"?(n=[e],this._lookupMap.set(e.command,n)):n.push(e)}_removeFromLookupMap(e){if(!e.command)return;const n=this._lookupMap.get(e.command);if(!(typeof n>"u")){for(let r=0,s=n.length;r<s;r++)if(n[r]===e){n.splice(r,1);return}}}static whenIsEntirelyIncluded(e,n){return!n||n.type===1?!0:!e||e.type===1?!1:sJ(e,n)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,n){const r=this._lookupMap.get(e);if(typeof r>"u"||r.length===0)return null;if(r.length===1)return r[0];for(let s=r.length-1;s>=0;s--){const o=r[s];if(n.contextMatchesRules(o.when))return o}return r[r.length-1]}resolve(e,n,r){const s=[...n,r];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),w7;let a=null;if(s.length<2)a=o;else{a=[];for(let c=0,u=o.length;c<u;c++){const d=o[c];if(s.length>d.chords.length)continue;let h=!0;for(let f=1;f<s.length;f++)if(d.chords[f]!==s[f]){h=!1;break}h&&a.push(d)}}const l=this._findCommand(e,a);return l?s.length<l.chords.length?(this._log(`\\ From ${a.length} keybinding entries, awaiting ${l.chords.length-s.length} more chord(s), when: ${Ame(l.when)}, source: ${Nme(l)}.`),q0t):(this._log(`\\ From ${a.length} keybinding entries, matched ${l.command}, when: ${Ame(l.when)}, source: ${Nme(l)}.`),K0t(l.command,l.commandArgs,l.bubble)):(this._log(`\\ From ${a.length} keybinding entries, no when clauses matched the context.`),w7)}_findCommand(e,n){for(let r=n.length-1;r>=0;r--){const s=n[r];if(_M._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,n){return n?n.evaluate(e):!0}}function Ame(i){return i?`${i.serialize()}`:"no when condition"}function Nme(i){return i.extensionId?i.isBuiltinExtension?`built-in extension ${i.extensionId}`:`user extension ${i.extensionId}`:i.isDefault?"built-in":"user"}const G0t=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class X0t extends Le{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:_t.None}get inChordMode(){return this._currentChords.length>0}constructor(e,n,r,s,o){super(),this._contextKeyService=e,this._commandService=n,this._telemetryService=r,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new _e),this._currentChords=[],this._currentChordChecker=new D5,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=m2.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Mf,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,n){const r=this._getResolver().lookupPrimaryKeybinding(e,n||this._contextKeyService);if(r)return r.resolvedKeybinding}dispatchEvent(e,n){return this._dispatch(e,n)}softDispatch(e,n){this._log("/ Soft dispatching keyboard event");const r=this.resolveKeyboardEvent(e);if(r.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),w7;const[s]=r.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),w7;const o=this._contextKeyService.getContext(n),a=this._currentChords.map(({keypress:l})=>l);return this._getResolver().resolve(o,a,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,n){switch(this._currentChords.push({keypress:e,label:n}),this._currentChords.length){case 0:throw Rse("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(L("first.chord","({0}) was pressed. Waiting for second key of chord...",n));break;default:{const r=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(L("next.chord","({0}) was pressed. Waiting for next key of chord...",r))}}this._scheduleLeaveChordMode(),iM.enabled&&iM.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],iM.enable()}_dispatch(e,n){return this._doDispatch(this.resolveKeyboardEvent(e),n,!1)}_singleModifierDispatch(e,n){const r=this.resolveKeyboardEvent(e),[s]=r.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=m2.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=m2.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(r,n,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=r.getChords();return this._ignoreSingleModifiers=new m2(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,n,r=!1){var s;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let a=null,l=null;if(r){const[h]=e.getSingleModifierDispatchChords();a=h,l=h?[h]:[]}else[a]=e.getDispatchChords(),l=this._currentChords.map(({keypress:h})=>h);if(a===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const c=this._contextKeyService.getContext(n),u=e.getLabel(),d=this._getResolver().resolve(c,l,a);switch(d.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",u,"[ No matching keybinding ]"),this.inChordMode){const h=this._currentChords.map(({label:f})=>f).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${h}, ${u}".`),this._notificationService.status(L("missing.chord","The key combination ({0}, {1}) is not a command.",h,u),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",u,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(a,u),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",u,`[ Will dispatch command ${d.commandId} ]`),d.commandId===null||d.commandId===""){if(this.inChordMode){const h=this._currentChords.map(({label:f})=>f).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${h}, ${u}".`),this._notificationService.status(L("missing.chord","The key combination ({0}, {1}) is not a command.",h,u),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else this.inChordMode&&this._leaveChordMode(),d.isBubble||(o=!0),this._log(`+ Invoking command ${d.commandId}.`),typeof d.commandArgs>"u"?this._commandService.executeCommand(d.commandId).then(void 0,h=>this._notificationService.warn(h)):this._commandService.executeCommand(d.commandId,d.commandArgs).then(void 0,h=>this._notificationService.warn(h)),G0t.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding",detail:(s=e.getUserSettingsLabel())!==null&&s!==void 0?s:void 0});return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class m2{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}m2.EMPTY=new m2(null);class Mme{constructor(e,n,r,s,o,a,l){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?see(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=see(e.getSingleModifierDispatchChords())),this.bubble=n?n.charCodeAt(0)===94:!1,this.command=this.bubble?n.substr(1):n,this.commandArgs=r,this.when=s,this.isDefault=o,this.extensionId=a,this.isBuiltinExtension=l}}function see(i){const e=[];for(let n=0,r=i.length;n<r;n++){const s=i[n];if(!s)return[];e.push(s)}return e}class $${constructor(e,n,r=n){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=n,this.modifierLabels[3]=r}toLabel(e,n,r){if(n.length===0)return null;const s=[];for(let o=0,a=n.length;o<a;o++){const l=n[o],c=r(l);if(c===null)return null;s[o]=J0t(l,c,this.modifierLabels[e])}return s.join(" ")}}const Qoe=new $$({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:L({},"Ctrl"),shiftKey:L({},"Shift"),altKey:L({},"Alt"),metaKey:L({},"Windows"),separator:"+"},{ctrlKey:L({},"Ctrl"),shiftKey:L({},"Shift"),altKey:L({},"Alt"),metaKey:L({},"Super"),separator:"+"}),Y0t=new $$({ctrlKey:L({},"Control"),shiftKey:L({},"Shift"),altKey:L({},"Option"),metaKey:L({},"Command"),separator:"+"},{ctrlKey:L({},"Control"),shiftKey:L({},"Shift"),altKey:L({},"Alt"),metaKey:L({},"Windows"),separator:"+"},{ctrlKey:L({},"Control"),shiftKey:L({},"Shift"),altKey:L({},"Alt"),metaKey:L({},"Super"),separator:"+"}),Z0t=new $$({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),Q0t=new $$({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});function J0t(i,e,n){if(e===null)return"";const r=[];return i.ctrlKey&&r.push(n.ctrlKey),i.shiftKey&&r.push(n.shiftKey),i.altKey&&r.push(n.altKey),i.metaKey&&r.push(n.metaKey),e!==""&&r.push(e),r.join(n.separator)}class evt extends rat{constructor(e,n){if(super(),n.length===0)throw uh("chords");this._os=e,this._chords=n}getLabel(){return Qoe.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return Y0t.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Z0t.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return Q0t.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new iat(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class jP extends evt{constructor(e,n){super(n,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return W0.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":W0.toString(e.keyCode)}_getElectronAccelerator(e){return W0.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const n=W0.toUserSettingsUS(e.keyCode);return n&&n.toLowerCase()}_getChordDispatch(e){return jP.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let n="";return e.ctrlKey&&(n+="ctrl+"),e.shiftKey&&(n+="shift+"),e.altKey&&(n+="alt+"),e.metaKey&&(n+="meta+"),n+=W0.toString(e.keyCode),n}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const n=Fse[e];if(n!==-1)return n;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Iv)return e;const n=this._scanCodeToKeyCode(e.scanCode);return n===0?null:new Iv(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,n)}static resolveKeybinding(e,n){const r=see(e.chords.map(s=>this._toKeyCodeChord(s)));return r.length>0?[new jP(r,n)]:[]}}const KE=qn("labelService"),NTe=qn("progressService");class _v{constructor(e,n){this.callback=e,this.report=n!=null&&n.async?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally(()=>{this._value=e;const n=this.callback(this._value);this._lastTask=Promise.resolve(n).finally(()=>this._lastTask=void 0)})}}_v.None=Object.freeze({report(){}});const Z1=qn("editorProgressService");class tvt{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){const n=e.charCodeAt(0),r=this._value.charCodeAt(this._pos);return n-r}value(){return this._value[this._pos]}}class nvt{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?jse(e,this._value,0,e.length,this._from,this._to):x5(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class ivt{constructor(e=!0,n=!0){this._splitOnBackslash=e,this._caseSensitive=n}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let n=e.length-1;n>=0;n--,this._valueLen--){const r=this._value.charCodeAt(n);if(!(r===47||this._splitOnBackslash&&r===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const n=this._value.charCodeAt(this._to);if(n===47||this._splitOnBackslash&&n===92)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?jse(e,this._value,0,e.length,this._from,this._to):x5(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class rvt{constructor(e,n){this._ignorePathCasing=e,this._ignoreQueryAndFragment=n,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new ivt(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===1)return JQ(e,this._value.scheme);if(this._states[this._stateIdx]===2)return JQ(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return aP(e,this._value.query);if(this._states[this._stateIdx]===5)return aP(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}}class f6{constructor(){this.height=1}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){var e,n;return(n=(e=this.left)===null||e===void 0?void 0:e.height)!==null&&n!==void 0?n:0}get heightRight(){var e,n;return(n=(e=this.right)===null||e===void 0?void 0:e.height)!==null&&n!==void 0?n:0}}class eE{static forUris(e=()=>!1,n=()=>!1){return new eE(new rvt(e,n))}static forStrings(){return new eE(new tvt)}static forConfigKeys(){return new eE(new nvt)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,n){const r=this._iter.reset(e);let s;this._root||(this._root=new f6,this._root.segment=r.value());const o=[];for(s=this._root;;){const l=r.cmp(s.segment);if(l>0)s.left||(s.left=new f6,s.left.segment=r.value()),o.push([-1,s]),s=s.left;else if(l<0)s.right||(s.right=new f6,s.right.segment=r.value()),o.push([1,s]),s=s.right;else if(r.hasNext())r.next(),s.mid||(s.mid=new f6,s.mid.segment=r.value()),o.push([0,s]),s=s.mid;else break}const a=s.value;s.value=n,s.key=e;for(let l=o.length-1;l>=0;l--){const c=o[l][1];c.updateHeight();const u=c.balanceFactor();if(u<-1||u>1){const d=o[l][0],h=o[l+1][0];if(d===1&&h===1)o[l][1]=c.rotateLeft();else if(d===-1&&h===-1)o[l][1]=c.rotateRight();else if(d===1&&h===-1)c.right=o[l+1][1]=o[l+1][1].rotateRight(),o[l][1]=c.rotateLeft();else if(d===-1&&h===1)c.left=o[l+1][1]=o[l+1][1].rotateLeft(),o[l][1]=c.rotateRight();else throw new Error;if(l>0)switch(o[l-1][0]){case-1:o[l-1][1].left=o[l][1];break;case 1:o[l-1][1].right=o[l][1];break;case 0:o[l-1][1].mid=o[l][1];break}else this._root=o[0][1]}}return a}get(e){var n;return(n=this._getNode(e))===null||n===void 0?void 0:n.value}_getNode(e){const n=this._iter.reset(e);let r=this._root;for(;r;){const s=n.cmp(r.segment);if(s>0)r=r.left;else if(s<0)r=r.right;else if(n.hasNext())n.next(),r=r.mid;else break}return r}has(e){const n=this._getNode(e);return!((n==null?void 0:n.value)===void 0&&(n==null?void 0:n.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,n){var r;const s=this._iter.reset(e),o=[];let a=this._root;for(;a;){const l=s.cmp(a.segment);if(l>0)o.push([-1,a]),a=a.left;else if(l<0)o.push([1,a]),a=a.right;else if(s.hasNext())s.next(),o.push([0,a]),a=a.mid;else break}if(a){if(n?(a.left=void 0,a.mid=void 0,a.right=void 0,a.height=1):(a.key=void 0,a.value=void 0),!a.mid&&!a.value)if(a.left&&a.right){const l=this._min(a.right);if(l.key){const{key:c,value:u,segment:d}=l;this._delete(l.key,!1),a.key=c,a.value=u,a.segment=d}}else{const l=(r=a.left)!==null&&r!==void 0?r:a.right;if(o.length>0){const[c,u]=o[o.length-1];switch(c){case-1:u.left=l;break;case 0:u.mid=l;break;case 1:u.right=l;break}}else this._root=l}for(let l=o.length-1;l>=0;l--){const c=o[l][1];c.updateHeight();const u=c.balanceFactor();if(u>1?(c.right.balanceFactor()>=0||(c.right=c.right.rotateRight()),o[l][1]=c.rotateLeft()):u<-1&&(c.left.balanceFactor()<=0||(c.left=c.left.rotateLeft()),o[l][1]=c.rotateRight()),l>0)switch(o[l-1][0]){case-1:o[l-1][1].left=o[l][1];break;case 1:o[l-1][1].right=o[l][1];break;case 0:o[l-1][1].mid=o[l][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const n=this._iter.reset(e);let r=this._root,s;for(;r;){const o=n.cmp(r.segment);if(o>0)r=r.left;else if(o<0)r=r.right;else if(n.hasNext())n.next(),s=r.value||s,r=r.mid;else break}return r&&r.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,n){const r=this._iter.reset(e);let s=this._root;for(;s;){const o=r.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(r.hasNext())r.next(),s=s.mid;else return s.mid?this._entries(s.mid):n?s.value:void 0}}forEach(e){for(const[n,r]of this)e(r,n)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const n=[];return this._dfsEntries(e,n),n[Symbol.iterator]()}_dfsEntries(e,n){e&&(e.left&&this._dfsEntries(e.left,n),e.value&&n.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,n),e.right&&this._dfsEntries(e.right,n))}}const px=qn("contextService");function oee(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Jt.isUri(e.uri)}function svt(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&!oee(i)&&!lvt(i)}const ovt={id:"empty-window"};function avt(i,e){if(typeof i=="string"||typeof i>"u")return typeof i=="string"?{id:jy(i)}:ovt;const n=i;return n.configuration?{id:n.id,configPath:n.configuration}:n.folders.length===1?{id:n.id,uri:n.folders[0].uri}:{id:n.id}}function lvt(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Jt.isUri(e.configPath)}class cvt{constructor(e,n){this.raw=n,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const aee="code-workspace";L("codeWorkspace","Code Workspace");const MTe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function uvt(i){return i.id===MTe}var lee;(function(i){i.inspectTokensAction=L("inspectTokens","Developer: Inspect Tokens")})(lee||(lee={}));var C7;(function(i){i.gotoLineActionLabel=L("gotoLineActionLabel","Go to Line/Column...")})(C7||(C7={}));var cee;(function(i){i.helpQuickAccessActionLabel=L("helpQuickAccess","Show all Quick Access Providers")})(cee||(cee={}));var S7;(function(i){i.quickCommandActionLabel=L("quickCommandActionLabel","Command Palette"),i.quickCommandHelp=L("quickCommandActionHelp","Show And Run Commands")})(S7||(S7={}));var WP;(function(i){i.quickOutlineActionLabel=L("quickOutlineActionLabel","Go to Symbol..."),i.quickOutlineByCategoryActionLabel=L("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(WP||(WP={}));var x7;(function(i){i.editorViewAccessibleLabel=L("editorViewAccessibleLabel","Editor content"),i.accessibilityHelpMessage=L("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(x7||(x7={}));var uee;(function(i){i.toggleHighContrast=L("toggleHighContrast","Toggle High Contrast Theme")})(uee||(uee={}));var dee;(function(i){i.bulkEditServiceSummary=L("bulkEditServiceSummary","Made {0} edits in {1} files")})(dee||(dee={}));const PTe=qn("workspaceTrustManagementService"),Vv=qn("contextViewService"),Ff=qn("contextMenuService");var Ba;(function(i){function e(o,a){if(o.start>=a.end||a.start>=o.end)return{start:0,end:0};const l=Math.max(o.start,a.start),c=Math.min(o.end,a.end);return c-l<=0?{start:0,end:0}:{start:l,end:c}}i.intersect=e;function n(o){return o.end-o.start<=0}i.isEmpty=n;function r(o,a){return!n(e(o,a))}i.intersects=r;function s(o,a){const l=[],c={start:o.start,end:Math.min(a.start,o.end)},u={start:Math.max(a.end,o.start),end:o.end};return n(c)||l.push(c),n(u)||l.push(u),l}i.relativeComplement=s})(Ba||(Ba={}));function dvt(i){const e=i;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Cy;(function(i){i[i.AVOID=0]="AVOID",i[i.ALIGN=1]="ALIGN"})(Cy||(Cy={}));function _2(i,e,n){const r=n.mode===Cy.ALIGN?n.offset:n.offset+n.size,s=n.mode===Cy.ALIGN?n.offset+n.size:n.offset;return n.position===0?e<=i-r?r:e<=s?s-e:Math.max(i-e,0):e<=s?s-e:e<=i-r?r:0}class GE extends Le{constructor(e,n){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Le.None,this.toDisposeOnSetContainer=Le.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=tt(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Pl(this.view),this.setContainer(e,n),this._register(gn(()=>this.setContainer(null,1)))}setContainer(e,n){var r;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(r=this.shadowRootHostElement)===null||r===void 0||r.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=n!==1,this.useShadowDOM=n===3,this.useShadowDOM){this.shadowRootHostElement=tt(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=hvt,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(tt("slot"))}else this.container.appendChild(this.view);const s=new Xe;GE.BUBBLE_UP_EVENTS.forEach(o=>{s.add(As(this.container,o,a=>{this.onDOMEvent(a,!1)}))}),GE.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(As(this.container,o,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var n,r;this.isVisible()&&this.hide(),la(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Jc(this.view),this.toDisposeOnClean=e.render(this.view)||Le.None,this.delegate=e,this.doLayout(),(r=(n=this.delegate).focus)===null||r===void 0||r.call(n)}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Kp&&Yse.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let n;if(Qse(e)){const h=no(e),f=Xat(e);n={top:h.top*f,left:h.left*f,width:h.width*f,height:h.height*f}}else dvt(e)?n={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:n={top:e.posy,left:e.posx,width:2,height:2};const r=dc(this.view),s=gS(this.view),o=this.delegate.anchorPosition||0,a=this.delegate.anchorAlignment||0,l=this.delegate.anchorAxisAlignment||0;let c,u;if(l===0){const h={offset:n.top-window.pageYOffset,size:n.height,position:o===0?0:1},f={offset:n.left,size:n.width,position:a===0?0:1,mode:Cy.ALIGN};c=_2(window.innerHeight,s,h)+window.pageYOffset,Ba.intersects({start:c,end:c+s},{start:h.offset,end:h.offset+h.size})&&(f.mode=Cy.AVOID),u=_2(window.innerWidth,r,f)}else{const h={offset:n.left,size:n.width,position:a===0?0:1},f={offset:n.top,size:n.height,position:o===0?0:1,mode:Cy.ALIGN};u=_2(window.innerWidth,r,h),Ba.intersects({start:u,end:u+r},{start:h.offset,end:h.offset+h.size})&&(f.mode=Cy.AVOID),c=_2(window.innerHeight,s,f)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(a===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=no(this.container);this.view.style.top=`${c-(this.useFixedPosition?no(this.view).top:d.top)}px`,this.view.style.left=`${u-(this.useFixedPosition?no(this.view).left:d.left)}px`,this.view.style.width="initial"}hide(e){const n=this.delegate;this.delegate=null,n!=null&&n.onHide&&n.onHide(e),this.toDisposeOnClean.dispose(),Pl(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,n){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):n&&!Ia(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}GE.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];GE.BUBBLE_DOWN_EVENTS=["click"];const hvt=`
:host {
all: initial; /* 1st rule so subsequent properties are reset. */
}
.codicon[class*='codicon-'] {
font: normal normal normal 16px/1 codicon;
display: inline-block;
text-decoration: none;
text-rendering: auto;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
:host {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
}
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
`;var fvt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},pvt=function(i,e){return function(n,r){e(n,r,i)}};let hee=class extends Le{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Le.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new GE(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,n){this.contextView.setContainer(e,n||1)}showContextView(e,n,r){n?(n!==this.container||this.shadowRoot!==r)&&(this.container=n,this.setContainer(n,r?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=r,this.contextView.show(e);const s=gn(()=>{this.currentViewDisposable===s&&this.hideContextView()});return this.currentViewDisposable=s,s}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};hee=fvt([pvt(0,VI)],hee);let XE=[],Joe=[],OTe=[];function p6(i,e=!1){gvt(i,!1,e)}function gvt(i,e,n){const r=mvt(i,e);XE.push(r),r.userConfigured?OTe.push(r):Joe.push(r),n&&!r.userConfigured&&XE.forEach(s=>{s.mime===r.mime||s.userConfigured||(r.extension&&s.extension===r.extension&&console.warn(`Overwriting extension <<${r.extension}>> to now point to mime <<${r.mime}>>`),r.filename&&s.filename===r.filename&&console.warn(`Overwriting filename <<${r.filename}>> to now point to mime <<${r.mime}>>`),r.filepattern&&s.filepattern===r.filepattern&&console.warn(`Overwriting filepattern <<${r.filepattern}>> to now point to mime <<${r.mime}>>`),r.firstline&&s.firstline===r.firstline&&console.warn(`Overwriting firstline <<${r.firstline}>> to now point to mime <<${r.mime}>>`))})}function mvt(i,e){return{id:i.id,mime:i.mime,filename:i.filename,extension:i.extension,filepattern:i.filepattern,firstline:i.firstline,userConfigured:e,filenameLowercase:i.filename?i.filename.toLowerCase():void 0,extensionLowercase:i.extension?i.extension.toLowerCase():void 0,filepatternLowercase:i.filepattern?ETe(i.filepattern.toLowerCase()):void 0,filepatternOnPath:i.filepattern?i.filepattern.indexOf(to.sep)>=0:!1}}function _vt(){XE=XE.filter(i=>i.userConfigured),Joe=[]}function vvt(i,e){return bvt(i,e).map(n=>n.id)}function bvt(i,e){let n;if(i)switch(i.scheme){case Pn.file:n=i.fsPath;break;case Pn.data:{n=w1.parseMetaData(i).get(w1.META_DATA_LABEL);break}case Pn.vscodeNotebookCell:n=void 0;break;default:n=i.path}if(!n)return[{id:"unknown",mime:bs.unknown}];n=n.toLowerCase();const r=jy(n),s=Pme(n,r,OTe);if(s)return[s,{id:ad,mime:bs.text}];const o=Pme(n,r,Joe);if(o)return[o,{id:ad,mime:bs.text}];if(e){const a=yvt(e);if(a)return[a,{id:ad,mime:bs.text}]}return[{id:"unknown",mime:bs.unknown}]}function Pme(i,e,n){var r;let s,o,a;for(let l=n.length-1;l>=0;l--){const c=n[l];if(e===c.filenameLowercase){s=c;break}if(c.filepattern&&(!o||c.filepattern.length>o.filepattern.length)){const u=c.filepatternOnPath?i:e;!((r=c.filepatternLowercase)===null||r===void 0)&&r.call(c,u)&&(o=c)}c.extension&&(!a||c.extension.length>a.extension.length)&&e.endsWith(c.extensionLowercase)&&(a=c)}if(s)return s;if(o)return o;if(a)return a}function yvt(i){if(Use(i)&&(i=i.substr(1)),i.length>0)for(let e=XE.length-1;e>=0;e--){const n=XE[e];if(!n.firstline)continue;const r=i.match(n.firstline);if(r&&r.length>0)return n}}const g6=Object.prototype.hasOwnProperty,Ome="vs.editor.nullLanguage";class wvt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Ome,0),this._register(ad,1),this._nextLanguageId=2}_register(e,n){this._languageIdToLanguage[n]=e,this._languageToLanguageId.set(e,n)}register(e){if(this._languageToLanguageId.has(e))return;const n=this._nextLanguageId++;this._register(e,n)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||Ome}}class $P extends Le{constructor(e=!0,n=!1){super(),this._onDidChange=this._register(new _e),this.onDidChange=this._onDidChange.event,$P.instanceCount++,this._warnOnOverwrite=n,this.languageIdCodec=new wvt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(PE.onDidChangeLanguages(r=>{this._initializeFromRegistry()})))}dispose(){$P.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},_vt();const e=[].concat(PE.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const n of e)this._registerLanguage(n);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(n=>{const r=this._languages[n];r.name&&(this._nameMap[r.name]=r.identifier),r.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=r.identifier}),r.mimetypes.forEach(s=>{this._mimeTypesMap[s]=r.identifier})}),Kr.as(ag.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const n=e.id;let r;g6.call(this._languages,n)?r=this._languages[n]:(this.languageIdCodec.register(n),r={identifier:n,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[n]=r),this._mergeLanguage(r,e)}_mergeLanguage(e,n){const r=n.id;let s=null;if(Array.isArray(n.mimetypes)&&n.mimetypes.length>0&&(e.mimetypes.push(...n.mimetypes),s=n.mimetypes[0]),s||(s=`text/x-${r}`,e.mimetypes.push(s)),Array.isArray(n.extensions)){n.configuration?e.extensions=n.extensions.concat(e.extensions):e.extensions=e.extensions.concat(n.extensions);for(const l of n.extensions)p6({id:r,mime:s,extension:l},this._warnOnOverwrite)}if(Array.isArray(n.filenames))for(const l of n.filenames)p6({id:r,mime:s,filename:l},this._warnOnOverwrite),e.filenames.push(l);if(Array.isArray(n.filenamePatterns))for(const l of n.filenamePatterns)p6({id:r,mime:s,filepattern:l},this._warnOnOverwrite);if(typeof n.firstLine=="string"&&n.firstLine.length>0){let l=n.firstLine;l.charAt(0)!=="^"&&(l="^"+l);try{const c=new RegExp(l);xot(c)||p6({id:r,mime:s,firstline:c},this._warnOnOverwrite)}catch(c){console.warn(`[${n.id}]: Invalid regular expression \`${l}\`: `,c)}}e.aliases.push(r);let o=null;if(typeof n.aliases<"u"&&Array.isArray(n.aliases)&&(n.aliases.length===0?o=[null]:o=n.aliases),o!==null)for(const l of o)!l||l.length===0||e.aliases.push(l);const a=o!==null&&o.length>0;if(!(a&&o[0]===null)){const l=(a?o[0]:null)||r;(a||!e.name)&&(e.name=l)}n.configuration&&e.configurationFiles.push(n.configuration),n.icon&&e.icons.push(n.icon)}isRegisteredLanguageId(e){return e?g6.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const n=e.toLowerCase();return g6.call(this._lowercaseNameMap,n)?this._lowercaseNameMap[n]:null}getLanguageIdByMimeType(e){return e&&g6.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,n){return!e&&!n?[]:vvt(e,n)}}$P.instanceCount=0;class zP extends Le{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new _e),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new _e),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new _e({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,zP.instanceCount++,this._registry=this._register(new $P(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){zP.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,n){const r=this._registry.guessLanguageIdByFilepathOrFirstLine(e,n);return g2e(r,null)}createById(e){return new Fme(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,n){return new Fme(this.onDidChange,()=>{const r=this.guessLanguageIdByFilepathOrFirstLine(e,n);return this._createAndGetLanguageIdentifier(r)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=ad),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),Zr.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}zP.instanceCount=0;class Fme{constructor(e,n){this._onDidChangeLanguages=e,this._selector=n,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new _e({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const n=this._selector();n!==this.languageId&&(this.languageId=n,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const VP={RESOURCES:"ResourceURLs",TEXT:bs.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function eae(...i){return function(e,n){for(let r=0,s=i.length;r<s;r++){const o=i[r](e,n);if(o)return o}return null}}FTe.bind(void 0,!1);const HP=FTe.bind(void 0,!0);function FTe(i,e,n){if(!n||n.length<e.length)return null;let r;return i?r=Wse(n,e):r=n.indexOf(e)===0,r?e.length>0?[{start:0,end:e.length}]:[]:null}function BTe(i,e){const n=e.toLowerCase().indexOf(i.toLowerCase());return n===-1?null:[{start:n,end:n+i.length}]}function jTe(i,e){return fee(i.toLowerCase(),e.toLowerCase(),0,0)}function fee(i,e,n,r){if(n===i.length)return[];if(r===e.length)return null;if(i[n]===e[r]){let s=null;return(s=fee(i,e,n+1,r+1))?iae({start:r,end:r+1},s):null}return fee(i,e,n,r+1)}function tae(i){return 97<=i&&i<=122}function z$(i){return 65<=i&&i<=90}function nae(i){return 48<=i&&i<=57}function WTe(i){return i===32||i===9||i===10||i===13}const $Te=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(i=>$Te.add(i.charCodeAt(0)));function k7(i){return WTe(i)||$Te.has(i)}function Cvt(i,e){return i===e||k7(i)&&k7(e)}function zTe(i){return tae(i)||z$(i)||nae(i)}function iae(i,e){return e.length===0?e=[i]:i.end===e[0].start?e[0].start=i.start:e.unshift(i),e}function VTe(i,e){for(let n=e;n<i.length;n++){const r=i.charCodeAt(n);if(z$(r)||nae(r)||n>0&&!zTe(i.charCodeAt(n-1)))return n}return i.length}function pee(i,e,n,r){if(n===i.length)return[];if(r===e.length)return null;if(i[n]!==e[r].toLowerCase())return null;{let s=null,o=r+1;for(s=pee(i,e,n+1,r+1);!s&&(o=VTe(e,o))<e.length;)s=pee(i,e,n+1,o),o++;return s===null?null:iae({start:r,end:r+1},s)}}function Svt(i){let e=0,n=0,r=0,s=0,o=0;for(let d=0;d<i.length;d++)o=i.charCodeAt(d),z$(o)&&e++,tae(o)&&n++,zTe(o)&&r++,nae(o)&&s++;const a=e/i.length,l=n/i.length,c=r/i.length,u=s/i.length;return{upperPercent:a,lowerPercent:l,alphaPercent:c,numericPercent:u}}function xvt(i){const{upperPercent:e,lowerPercent:n}=i;return n===0&&e>.6}function kvt(i){const{upperPercent:e,lowerPercent:n,alphaPercent:r,numericPercent:s}=i;return n>.2&&e<.8&&r>.6&&s<.2}function Lvt(i){let e=0,n=0,r=0,s=0;for(let o=0;o<i.length;o++)r=i.charCodeAt(o),z$(r)&&e++,tae(r)&&n++,WTe(r)&&s++;return(e===0||n===0)&&s===0?i.length<=30:e<=5}function HTe(i,e){if(!e||(e=e.trim(),e.length===0)||!Lvt(i)||e.length>60)return null;const n=Svt(e);if(!kvt(n)){if(!xvt(n))return null;e=e.toLowerCase()}let r=null,s=0;for(i=i.toLowerCase();s<e.length&&(r=pee(i,e,0,s))===null;)s=VTe(e,s+1);return r}function Dvt(i,e,n=!1){if(!e||e.length===0)return null;let r=null,s=0;for(i=i.toLowerCase(),e=e.toLowerCase();s<e.length&&(r=gee(i,e,0,s,n))===null;)s=UTe(e,s+1);return r}function gee(i,e,n,r,s){if(n===i.length)return[];if(r===e.length)return null;if(Cvt(i.charCodeAt(n),e.charCodeAt(r))){let o=null,a=r+1;if(o=gee(i,e,n+1,r+1,s),!s)for(;!o&&(a=UTe(e,a))<e.length;)o=gee(i,e,n+1,a,s),a++;return o?i.charCodeAt(n)!==e.charCodeAt(r)?o:iae({start:r,end:r+1},o):null}else return null}function UTe(i,e){for(let n=e;n<i.length;n++)if(k7(i.charCodeAt(n))||n>0&&k7(i.charCodeAt(n-1)))return n;return i.length}const Evt=eae(HP,HTe,BTe),Ivt=eae(HP,HTe,jTe),Bme=new G1(1e4);function jme(i,e,n=!1){if(typeof i!="string"||typeof e!="string")return null;let r=Bme.get(i);r||(r=new RegExp(Cot(i),"i"),Bme.set(i,r));const s=r.exec(e);return s?[{start:s.index,end:s.index+s[0].length}]:n?Ivt(i,e):Evt(i,e)}function Tvt(i,e){const n=gx(i,i.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?z5(n):null}function Rvt(i,e,n,r,s,o){const a=Math.min(13,i.length);for(;n<a;n++){const l=gx(i,e,n,r,s,o,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return l}return[0,o]}function z5(i){if(typeof i>"u")return[];const e=[],n=i[1];for(let r=i.length-1;r>1;r--){const s=i[r]+n,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const Sy=128;function rae(){const i=[],e=[];for(let n=0;n<=Sy;n++)e[n]=0;for(let n=0;n<=Sy;n++)i.push(e.slice(0));return i}function qTe(i){const e=[];for(let n=0;n<=i;n++)e[n]=0;return e}const KTe=qTe(2*Sy),mee=qTe(2*Sy),J_=rae(),nC=rae(),m6=rae();function _6(i,e){if(e<0||e>=i.length)return!1;const n=i.codePointAt(e);switch(n){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Hse(n)}}function Wme(i,e){if(e<0||e>=i.length)return!1;switch(i.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function w8(i,e,n){return e[i]!==n[i]}function Avt(i,e,n,r,s,o,a=!1){for(;e<n&&s<o;)i[e]===r[s]&&(a&&(KTe[e]=s),e+=1),s+=1;return e===n}var Hp;(function(i){i.Default=[-100,0];function e(n){return!n||n.length===2&&n[0]===-100&&n[1]===0}i.isDefault=e})(Hp||(Hp={}));class V${constructor(e,n){this.firstMatchCanBeWeak=e,this.boostFullMatch=n}}V$.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};function gx(i,e,n,r,s,o,a=V$.default){const l=i.length>Sy?Sy:i.length,c=r.length>Sy?Sy:r.length;if(n>=l||o>=c||l-n>c-o||!Avt(e,n,l,s,o,c,!0))return;Nvt(l,c,n,o,e,s);let u=1,d=1,h=n,f=o;const p=[!1];for(u=1,h=n;h<l;u++,h++){const y=KTe[h],x=mee[h],k=h+1<l?mee[h+1]:c;for(d=y-o+1,f=y;f<k;d++,f++){let D=Number.MIN_SAFE_INTEGER,R=!1;f<=x&&(D=Mvt(i,e,h,n,r,s,f,c,o,J_[u-1][d-1]===0,p));let E=0;D!==Number.MAX_SAFE_INTEGER&&(R=!0,E=D+nC[u-1][d-1]);const A=f>y,M=A?nC[u][d-1]+(J_[u][d-1]>0?-5:0):0,N=f>y+1&&J_[u][d-1]>0,P=N?nC[u][d-2]+(J_[u][d-2]>0?-5:0):0;if(N&&(!A||P>=M)&&(!R||P>=E))nC[u][d]=P,m6[u][d]=3,J_[u][d]=0;else if(A&&(!R||M>=E))nC[u][d]=M,m6[u][d]=2,J_[u][d]=0;else if(R)nC[u][d]=E,m6[u][d]=1,J_[u][d]=J_[u-1][d-1]+1;else throw new Error("not possible")}}if(!p[0]&&!a.firstMatchCanBeWeak)return;u--,d--;const g=[nC[u][d],o];let m=0,_=0;for(;u>=1;){let y=d;do{const x=m6[u][y];if(x===3)y=y-2;else if(x===2)y=y-1;else break}while(y>=1);m>1&&e[n+u-1]===s[o+d-1]&&!w8(y+o-1,r,s)&&m+1>J_[u][y]&&(y=d),y===d?m++:m=1,_||(_=y),u--,d=y-1,g.push(d)}c===l&&a.boostFullMatch&&(g[0]+=2);const b=_-l;return g[0]-=b,g}function Nvt(i,e,n,r,s,o){let a=i-1,l=e-1;for(;a>=n&&l>=r;)s[a]===o[l]&&(mee[a]=l,a--),l--}function Mvt(i,e,n,r,s,o,a,l,c,u,d){if(e[n]!==o[a])return Number.MIN_SAFE_INTEGER;let h=1,f=!1;return a===n-r?h=i[n]===s[a]?7:5:w8(a,s,o)&&(a===0||!w8(a-1,s,o))?(h=i[n]===s[a]?7:5,f=!0):_6(o,a)&&(a===0||!_6(o,a-1))?h=5:(_6(o,a-1)||Wme(o,a-1))&&(h=5,f=!0),h>1&&n===r&&(d[0]=!0),f||(f=w8(a,s,o)||_6(o,a-1)||Wme(o,a-1)),n===r?a>c&&(h-=f?3:5):u?h+=f?2:0:h+=f?0:1,a+1===l&&(h-=f?3:5),h}function Pvt(i,e,n,r,s,o,a){return Ovt(i,e,n,r,s,o,!0,a)}function Ovt(i,e,n,r,s,o,a,l){let c=gx(i,e,n,r,s,o,l);if(i.length>=3){const u=Math.min(7,i.length-1);for(let d=n+1;d<u;d++){const h=Fvt(i,d);if(h){const f=gx(h,h.toLowerCase(),n,r,s,o,l);f&&(f[0]-=3,(!c||f[0]>c[0])&&(c=f))}}}return c}function Fvt(i,e){if(e+1>=i.length)return;const n=i[e],r=i[e+1];if(n!==r)return i.slice(0,e)+r+n+i.slice(e+2)}const Bvt="$(",sae=new RegExp(`\\$\\(${en.iconNameExpression}(?:${en.iconModifierExpression})?\\)`,"g"),jvt=new RegExp(`(\\\\)?${sae.source}`,"g");function Wvt(i){return i.replace(jvt,(e,n)=>n?e:`\\${e}`)}const $vt=new RegExp(`\\\\${sae.source}`,"g");function zvt(i){return i.replace($vt,e=>`\\${e}`)}const Vvt=new RegExp(`(\\s)?(\\\\)?${sae.source}(\\s)?`,"g");function oae(i){return i.indexOf(Bvt)===-1?i:i.replace(Vvt,(e,n,r,s)=>r?e:n||s||"")}function Hvt(i){return i?i.replace(/\$\((.*?)\)/g,(e,n)=>` ${n} `).trim():""}const Vq=new RegExp(`\\$\\(${en.iconNameCharacter}+\\)`,"g");function bN(i){Vq.lastIndex=0;let e="";const n=[];let r=0;for(;;){const s=Vq.lastIndex,o=Vq.exec(i),a=i.substring(s,o==null?void 0:o.index);if(a.length>0){e+=a;for(let l=0;l<a.length;l++)n.push(r)}if(!o)break;r+=o[0].length}return{text:e,iconOffsets:n}}function Hq(i,e,n=!1){const{text:r,iconOffsets:s}=e;if(!s||s.length===0)return jme(i,r,n);const o=S5(r," "),a=r.length-o.length,l=jme(i,o,n);if(l)for(const c of l){const u=s[c.start+a]+a;c.start+=u,c.end+=u}return l}class Ea{constructor(e="",n=!1){var r,s,o;if(this.value=e,typeof this.value!="string")throw uh("value");typeof n=="boolean"?(this.isTrusted=n,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=(r=n.isTrusted)!==null&&r!==void 0?r:void 0,this.supportThemeIcons=(s=n.supportThemeIcons)!==null&&s!==void 0?s:!1,this.supportHtml=(o=n.supportHtml)!==null&&o!==void 0?o:!1)}appendText(e,n=0){return this.value+=qvt(this.supportThemeIcons?Wvt(e):e).replace(/([ \t]+)/g,(r,s)=>"&nbsp;".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,n===1?`\\
`:`
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,n){return this.value+="\n```",this.value+=e,this.value+=`
`,this.value+=n,this.value+="\n```\n",this}appendLink(e,n,r){return this.value+="[",this.value+=this._escape(n,"]"),this.value+="](",this.value+=this._escape(String(e),")"),r&&(this.value+=` "${this._escape(this._escape(r,'"'),")")}"`),this.value+=")",this}_escape(e,n){const r=new RegExp(dd(n),"g");return e.replace(r,(s,o)=>e.charAt(o-1)!=="\\"?`\\${s}`:s)}}function YE(i){return Hy(i)?!i.value:Array.isArray(i)?i.every(YE):!0}function Hy(i){return i instanceof Ea?!0:i&&typeof i=="object"?typeof i.value=="string"&&(typeof i.isTrusted=="boolean"||typeof i.isTrusted=="object"||i.isTrusted===void 0)&&(typeof i.supportThemeIcons=="boolean"||i.supportThemeIcons===void 0):!1}function Uvt(i,e){return i===e?!0:!i||!e?!1:i.value===e.value&&i.isTrusted===e.isTrusted&&i.supportThemeIcons===e.supportThemeIcons&&i.supportHtml===e.supportHtml&&(i.baseUri===e.baseUri||!!i.baseUri&&!!e.baseUri&&Noe(Jt.from(i.baseUri),Jt.from(e.baseUri)))}function qvt(i){return i.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function v6(i){return i.replace(/"/g,"&quot;")}function Uq(i){return i&&i.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Kvt(i){const e=[],n=i.split("|").map(s=>s.trim());i=n[0];const r=n[1];if(r){const s=/height=(\d+)/.exec(r),o=/width=(\d+)/.exec(r),a=s?s[1]:"",l=o?o[1]:"",c=isFinite(parseInt(l)),u=isFinite(parseInt(a));c&&e.push(`width="${l}"`),u&&e.push(`height="${a}"`)}return{href:i,dimensions:e}}var _ee=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function Gvt(i,e){zl(e)?i.title=oae(e):e!=null&&e.markdownNotSupportedFallback?i.title=e.markdownNotSupportedFallback:i.removeAttribute("title")}class Xvt{constructor(e,n,r){this.hoverDelegate=e,this.target=n,this.fadeInAnimation=r}update(e,n,r){var s;return _ee(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||zl(e)||e instanceof HTMLElement)o=e;else if(!nP(e.markdown))o=(s=e.markdown)!==null&&s!==void 0?s:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(L("iconLabel.loading","Loading..."),n),this._cancellationTokenSource=new Ns;const a=this._cancellationTokenSource.token;if(o=yield e.markdown(a),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||a.isCancellationRequested)return}this.show(o,n,r)})}show(e,n,r){const s=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!s},r);this._hoverWidget=this.hoverDelegate.showHover(o,n)}s==null||s.dispose()}hasContent(e){return e?Hy(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,n;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(n=this._cancellationTokenSource)===null||n===void 0||n.dispose(!0),this._cancellationTokenSource=void 0}}function GTe(i,e,n,r){let s,o;const a=(h,f)=>{var p;const g=o!==void 0;h&&(o==null||o.dispose(),o=void 0),f&&(s==null||s.dispose(),s=void 0),g&&((p=i.onDidHideHover)===null||p===void 0||p.call(i))},l=(h,f,p)=>new Mf(()=>_ee(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new Xvt(i,p||e,h>0),yield o.update(n,f,r))}),h),c=()=>{if(s)return;const h=new Xe,f=m=>a(!1,m.fromElement===e);h.add(Be(e,ht.MOUSE_LEAVE,f,!0));const p=()=>a(!0,!0);h.add(Be(e,ht.MOUSE_DOWN,p,!0));const g={targetElements:[e],dispose:()=>{}};if(i.placement===void 0||i.placement==="mouse"){const m=_=>{g.x=_.x+10,_.target instanceof HTMLElement&&_.target.classList.contains("action-label")&&a(!0,!0)};h.add(Be(e,ht.MOUSE_MOVE,m,!0))}h.add(l(i.delay,!1,g)),s=h},u=Be(e,ht.MOUSE_OVER,c,!0);return{show:h=>{a(!1,!0),l(0,h)},hide:()=>{a(!0,!0)},update:(h,f)=>_ee(this,void 0,void 0,function*(){n=h,yield o==null?void 0:o.update(n,void 0,f)}),dispose:()=>{u.dispose(),a(!0,!0)}}}function Yvt(i,e={}){const n=aae(e);return n.textContent=i,n}function Zvt(i,e={}){const n=aae(e);return XTe(n,Jvt(i,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),n}function aae(i){const e=i.inline?"span":"div",n=document.createElement(e);return i.className&&(n.className=i.className),n}class Qvt{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function XTe(i,e,n,r){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&r)s=document.createElement("code");else if(e.type===5&&n){const o=document.createElement("a");n.disposables.add(As(o,"click",a=>{n.callback(String(e.index),a)})),s=o}else e.type===8?s=document.createElement("br"):e.type===1&&(s=i);s&&i!==s&&i.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{XTe(s,o,n,r)})}function Jvt(i,e){const n={type:1,children:[]};let r=0,s=n;const o=[],a=new Qvt(i);for(;!a.eos();){let l=a.next();const c=l==="\\"&&vee(a.peek(),e)!==0;if(c&&(l=a.next()),!c&&ebt(l,e)&&l===a.peek()){a.advance(),s.type===2&&(s=o.pop());const u=vee(l,e);if(s.type===u||s.type===5&&u===6)s=o.pop();else{const d={type:u,children:[]};u===5&&(d.index=r,r++),s.children.push(d),o.push(s),s=d}}else if(l===`
`)s.type===2&&(s=o.pop()),s.children.push({type:8});else if(s.type!==2){const u={type:2,content:l};s.children.push(u),o.push(s),s=u}else s.content+=l}return s.type===2&&(s=o.pop()),n}function ebt(i,e){return vee(i,e)!==0}function vee(i,e){switch(i){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const tbt=new RegExp(`(\\\\)?\\$\\((${en.iconNameExpression}(?:${en.iconModifierExpression})?)\\)`,"g");function Uy(i){const e=new Array;let n,r=0,s=0;for(;(n=tbt.exec(i))!==null;){s=n.index||0,r<s&&e.push(i.substring(r,s)),r=(n.index||0)+n[0].length;const[,o,a]=n;e.push(o?`$(${a})`:bee({id:a}))}return r<i.length&&e.push(i.substring(r)),e}function bee(i){const e=tt("span");return e.classList.add(...en.asClassNameArray(i)),e}class lae{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const yee=new lae("id#");let Kl={};(function(){function i(e,n){n(Kl)}i.amd=!0,function(e,n){typeof i=="function"&&i.amd?i(["exports"],n):typeof exports=="object"&&typeof module<"u"?n(exports):(e=typeof globalThis<"u"?globalThis:e||self,n(e.marked={}))}(this,function(e){function n(Ce,ge){for(var pe=0;pe<ge.length;pe++){var ne=ge[pe];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(Ce,ne.key,ne)}}function r(Ce,ge,pe){return pe&&n(Ce,pe),Object.defineProperty(Ce,"prototype",{writable:!1}),Ce}function s(Ce,ge){if(Ce){if(typeof Ce=="string")return o(Ce,ge);var pe=Object.prototype.toString.call(Ce).slice(8,-1);if(pe==="Object"&&Ce.constructor&&(pe=Ce.constructor.name),pe==="Map"||pe==="Set")return Array.from(Ce);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return o(Ce,ge)}}function o(Ce,ge){(ge==null||ge>Ce.length)&&(ge=Ce.length);for(var pe=0,ne=new Array(ge);pe<ge;pe++)ne[pe]=Ce[pe];return ne}function a(Ce,ge){var pe=typeof Symbol<"u"&&Ce[Symbol.iterator]||Ce["@@iterator"];if(pe)return(pe=pe.call(Ce)).next.bind(pe);if(Array.isArray(Ce)||(pe=s(Ce))||ge){pe&&(Ce=pe);var ne=0;return function(){return ne>=Ce.length?{done:!0}:{done:!1,value:Ce[ne++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=l();function c(Ce){e.defaults=Ce}var u=/[&<>"']/,d=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,f=/[<>"']|&(?!#?\w+;)/g,p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},g=function(ge){return p[ge]};function m(Ce,ge){if(ge){if(u.test(Ce))return Ce.replace(d,g)}else if(h.test(Ce))return Ce.replace(f,g);return Ce}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function b(Ce){return Ce.replace(_,function(ge,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var y=/(^|[^\[])\^/g;function x(Ce,ge){Ce=typeof Ce=="string"?Ce:Ce.source,ge=ge||"";var pe={replace:function(ae,ue){return ue=ue.source||ue,ue=ue.replace(y,"$1"),Ce=Ce.replace(ae,ue),pe},getRegex:function(){return new RegExp(Ce,ge)}};return pe}var k=/[^\w:]/g,D=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ce,ge,pe){if(Ce){var ne;try{ne=decodeURIComponent(b(pe)).replace(k,"").toLowerCase()}catch{return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}ge&&!D.test(pe)&&(pe=P(ge,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch{return null}return pe}var E={},A=/^[^:]+:\/*[^/]*$/,M=/^([^:]+:)[\s\S]*$/,N=/^([^:]+:\/*[^/]*)[\s\S]*$/;function P(Ce,ge){E[" "+Ce]||(A.test(Ce)?E[" "+Ce]=Ce+"/":E[" "+Ce]=z(Ce,"/",!0)),Ce=E[" "+Ce];var pe=Ce.indexOf(":")===-1;return ge.substring(0,2)==="//"?pe?ge:Ce.replace(M,"$1")+ge:ge.charAt(0)==="/"?pe?ge:Ce.replace(N,"$1")+ge:Ce+ge}var O={exec:function(){}};function B(Ce){for(var ge=1,pe,ne;ge<arguments.length;ge++){pe=arguments[ge];for(ne in pe)Object.prototype.hasOwnProperty.call(pe,ne)&&(Ce[ne]=pe[ne])}return Ce}function j(Ce,ge){var pe=Ce.replace(/\|/g,function(ue,de,Se){for(var Ie=!1,nt=de;--nt>=0&&Se[nt]==="\\";)Ie=!Ie;return Ie?"|":" |"}),ne=pe.split(/ \|/),ae=0;if(ne[0].trim()||ne.shift(),ne.length>0&&!ne[ne.length-1].trim()&&ne.pop(),ne.length>ge)ne.splice(ge);else for(;ne.length<ge;)ne.push("");for(;ae<ne.length;ae++)ne[ae]=ne[ae].trim().replace(/\\\|/g,"|");return ne}function z(Ce,ge,pe){var ne=Ce.length;if(ne===0)return"";for(var ae=0;ae<ne;){var ue=Ce.charAt(ne-ae-1);if(ue===ge&&!pe)ae++;else if(ue!==ge&&pe)ae++;else break}return Ce.slice(0,ne-ae)}function H(Ce,ge){if(Ce.indexOf(ge[1])===-1)return-1;for(var pe=Ce.length,ne=0,ae=0;ae<pe;ae++)if(Ce[ae]==="\\")ae++;else if(Ce[ae]===ge[0])ne++;else if(Ce[ae]===ge[1]&&(ne--,ne<0))return ae;return-1}function Y(Ce){Ce&&Ce.sanitize&&!Ce.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function X(Ce,ge){if(ge<1)return"";for(var pe="";ge>1;)ge&1&&(pe+=Ce),ge>>=1,Ce+=Ce;return pe+Ce}function Q(Ce,ge,pe,ne){var ae=ge.href,ue=ge.title?m(ge.title):null,de=Ce[1].replace(/\\([\[\]])/g,"$1");if(Ce[0].charAt(0)!=="!"){ne.state.inLink=!0;var Se={type:"link",raw:pe,href:ae,title:ue,text:de,tokens:ne.inlineTokens(de)};return ne.state.inLink=!1,Se}return{type:"image",raw:pe,href:ae,title:ue,text:m(de)}}function ie(Ce,ge){var pe=Ce.match(/^(\s+)(?:```)/);if(pe===null)return ge;var ne=pe[1];return ge.split(`
`).map(function(ae){var ue=ae.match(/^\s+/);if(ue===null)return ae;var de=ue[0];return de.length>=ne.length?ae.slice(ne.length):ae}).join(`
`)}var K=function(){function Ce(pe){this.options=pe||e.defaults}var ge=Ce.prototype;return ge.space=function(ne){var ae=this.rules.block.newline.exec(ne);if(ae&&ae[0].length>0)return{type:"space",raw:ae[0]}},ge.code=function(ne){var ae=this.rules.block.code.exec(ne);if(ae){var ue=ae[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ae[0],codeBlockStyle:"indented",text:this.options.pedantic?ue:z(ue,`
`)}}},ge.fences=function(ne){var ae=this.rules.block.fences.exec(ne);if(ae){var ue=ae[0],de=ie(ue,ae[3]||"");return{type:"code",raw:ue,lang:ae[2]?ae[2].trim():ae[2],text:de}}},ge.heading=function(ne){var ae=this.rules.block.heading.exec(ne);if(ae){var ue=ae[2].trim();if(/#$/.test(ue)){var de=z(ue,"#");(this.options.pedantic||!de||/ $/.test(de))&&(ue=de.trim())}return{type:"heading",raw:ae[0],depth:ae[1].length,text:ue,tokens:this.lexer.inline(ue)}}},ge.hr=function(ne){var ae=this.rules.block.hr.exec(ne);if(ae)return{type:"hr",raw:ae[0]}},ge.blockquote=function(ne){var ae=this.rules.block.blockquote.exec(ne);if(ae){var ue=ae[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:ae[0],tokens:this.lexer.blockTokens(ue,[]),text:ue}}},ge.list=function(ne){var ae=this.rules.block.list.exec(ne);if(ae){var ue,de,Se,Ie,nt,Oe,Ve,gt,$t,Mt,Bt,jn,Dt=ae[1].trim(),Fn=Dt.length>1,tn={type:"list",raw:"",ordered:Fn,start:Fn?+Dt.slice(0,-1):"",loose:!1,items:[]};Dt=Fn?"\\d{1,9}\\"+Dt.slice(-1):"\\"+Dt,this.options.pedantic&&(Dt=Fn?Dt:"[*+-]");for(var pi=new RegExp("^( {0,3}"+Dt+")((?:[ ][^\\n]*)?(?:\\n|$))");ne&&(jn=!1,!(!(ae=pi.exec(ne))||this.rules.block.hr.test(ne)));){if(ue=ae[0],ne=ne.substring(ue.length),gt=ae[2].split(`
`,1)[0],$t=ne.split(`
`,1)[0],this.options.pedantic?(Ie=2,Bt=gt.trimLeft()):(Ie=ae[2].search(/[^ ]/),Ie=Ie>4?1:Ie,Bt=gt.slice(Ie),Ie+=ae[1].length),Oe=!1,!gt&&/^ *$/.test($t)&&(ue+=$t+`
`,ne=ne.substring($t.length+1),jn=!0),!jn)for(var Pi=new RegExp("^ {0,"+Math.min(3,Ie-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),ti=new RegExp("^ {0,"+Math.min(3,Ie-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),mi=new RegExp("^ {0,"+Math.min(3,Ie-1)+"}(?:```|~~~)"),ds=new RegExp("^ {0,"+Math.min(3,Ie-1)+"}#");ne&&(Mt=ne.split(`
`,1)[0],gt=Mt,this.options.pedantic&&(gt=gt.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(mi.test(gt)||ds.test(gt)||Pi.test(gt)||ti.test(ne)));){if(gt.search(/[^ ]/)>=Ie||!gt.trim())Bt+=`
`+gt.slice(Ie);else if(!Oe)Bt+=`
`+gt;else break;!Oe&&!gt.trim()&&(Oe=!0),ue+=Mt+`
`,ne=ne.substring(Mt.length+1)}tn.loose||(Ve?tn.loose=!0:/\n *\n *$/.test(ue)&&(Ve=!0)),this.options.gfm&&(de=/^\[[ xX]\] /.exec(Bt),de&&(Se=de[0]!=="[ ] ",Bt=Bt.replace(/^\[[ xX]\] +/,""))),tn.items.push({type:"list_item",raw:ue,task:!!de,checked:Se,loose:!1,text:Bt}),tn.raw+=ue}tn.items[tn.items.length-1].raw=ue.trimRight(),tn.items[tn.items.length-1].text=Bt.trimRight(),tn.raw=tn.raw.trimRight();var Nr=tn.items.length;for(nt=0;nt<Nr;nt++){this.lexer.state.top=!1,tn.items[nt].tokens=this.lexer.blockTokens(tn.items[nt].text,[]);var Br=tn.items[nt].tokens.filter(function(hr){return hr.type==="space"}),Mn=Br.every(function(hr){for(var rn=hr.raw.split(""),sn=0,Kn=a(rn),ai;!(ai=Kn()).done;){var Ki=ai.value;if(Ki===`
`&&(sn+=1),sn>1)return!0}return!1});!tn.loose&&Br.length&&Mn&&(tn.loose=!0,tn.items[nt].loose=!0)}return tn}},ge.html=function(ne){var ae=this.rules.block.html.exec(ne);if(ae){var ue={type:"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:ae[0]};if(this.options.sanitize){var de=this.options.sanitizer?this.options.sanitizer(ae[0]):m(ae[0]);ue.type="paragraph",ue.text=de,ue.tokens=this.lexer.inline(de)}return ue}},ge.def=function(ne){var ae=this.rules.block.def.exec(ne);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var ue=ae[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:ue,raw:ae[0],href:ae[2],title:ae[3]}}},ge.table=function(ne){var ae=this.rules.block.table.exec(ne);if(ae){var ue={type:"table",header:j(ae[1]).map(function(Ve){return{text:Ve}}),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:ae[3]&&ae[3].trim()?ae[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(ue.header.length===ue.align.length){ue.raw=ae[0];var de=ue.align.length,Se,Ie,nt,Oe;for(Se=0;Se<de;Se++)/^ *-+: *$/.test(ue.align[Se])?ue.align[Se]="right":/^ *:-+: *$/.test(ue.align[Se])?ue.align[Se]="center":/^ *:-+ *$/.test(ue.align[Se])?ue.align[Se]="left":ue.align[Se]=null;for(de=ue.rows.length,Se=0;Se<de;Se++)ue.rows[Se]=j(ue.rows[Se],ue.header.length).map(function(Ve){return{text:Ve}});for(de=ue.header.length,Ie=0;Ie<de;Ie++)ue.header[Ie].tokens=this.lexer.inline(ue.header[Ie].text);for(de=ue.rows.length,Ie=0;Ie<de;Ie++)for(Oe=ue.rows[Ie],nt=0;nt<Oe.length;nt++)Oe[nt].tokens=this.lexer.inline(Oe[nt].text);return ue}}},ge.lheading=function(ne){var ae=this.rules.block.lheading.exec(ne);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1],tokens:this.lexer.inline(ae[1])}},ge.paragraph=function(ne){var ae=this.rules.block.paragraph.exec(ne);if(ae){var ue=ae[1].charAt(ae[1].length-1)===`
`?ae[1].slice(0,-1):ae[1];return{type:"paragraph",raw:ae[0],text:ue,tokens:this.lexer.inline(ue)}}},ge.text=function(ne){var ae=this.rules.block.text.exec(ne);if(ae)return{type:"text",raw:ae[0],text:ae[0],tokens:this.lexer.inline(ae[0])}},ge.escape=function(ne){var ae=this.rules.inline.escape.exec(ne);if(ae)return{type:"escape",raw:ae[0],text:m(ae[1])}},ge.tag=function(ne){var ae=this.rules.inline.tag.exec(ne);if(ae)return!this.lexer.state.inLink&&/^<a /i.test(ae[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(ae[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(ae[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ae[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:ae[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):m(ae[0]):ae[0]}},ge.link=function(ne){var ae=this.rules.inline.link.exec(ne);if(ae){var ue=ae[2].trim();if(!this.options.pedantic&&/^</.test(ue)){if(!/>$/.test(ue))return;var de=z(ue.slice(0,-1),"\\");if((ue.length-de.length)%2===0)return}else{var Se=H(ae[2],"()");if(Se>-1){var Ie=ae[0].indexOf("!")===0?5:4,nt=Ie+ae[1].length+Se;ae[2]=ae[2].substring(0,Se),ae[0]=ae[0].substring(0,nt).trim(),ae[3]=""}}var Oe=ae[2],Ve="";if(this.options.pedantic){var gt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Oe);gt&&(Oe=gt[1],Ve=gt[3])}else Ve=ae[3]?ae[3].slice(1,-1):"";return Oe=Oe.trim(),/^</.test(Oe)&&(this.options.pedantic&&!/>$/.test(ue)?Oe=Oe.slice(1):Oe=Oe.slice(1,-1)),Q(ae,{href:Oe&&Oe.replace(this.rules.inline._escapes,"$1"),title:Ve&&Ve.replace(this.rules.inline._escapes,"$1")},ae[0],this.lexer)}},ge.reflink=function(ne,ae){var ue;if((ue=this.rules.inline.reflink.exec(ne))||(ue=this.rules.inline.nolink.exec(ne))){var de=(ue[2]||ue[1]).replace(/\s+/g," ");if(de=ae[de.toLowerCase()],!de||!de.href){var Se=ue[0].charAt(0);return{type:"text",raw:Se,text:Se}}return Q(ue,de,ue[0],this.lexer)}},ge.emStrong=function(ne,ae,ue){ue===void 0&&(ue="");var de=this.rules.inline.emStrong.lDelim.exec(ne);if(de&&!(de[3]&&ue.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Se=de[1]||de[2]||"";if(!Se||Se&&(ue===""||this.rules.inline.punctuation.exec(ue))){var Ie=de[0].length-1,nt,Oe,Ve=Ie,gt=0,$t=de[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for($t.lastIndex=0,ae=ae.slice(-1*ne.length+Ie);(de=$t.exec(ae))!=null;)if(nt=de[1]||de[2]||de[3]||de[4]||de[5]||de[6],!!nt){if(Oe=nt.length,de[3]||de[4]){Ve+=Oe;continue}else if((de[5]||de[6])&&Ie%3&&!((Ie+Oe)%3)){gt+=Oe;continue}if(Ve-=Oe,!(Ve>0)){if(Oe=Math.min(Oe,Oe+Ve+gt),Math.min(Ie,Oe)%2){var Mt=ne.slice(1,Ie+de.index+Oe);return{type:"em",raw:ne.slice(0,Ie+de.index+Oe+1),text:Mt,tokens:this.lexer.inlineTokens(Mt)}}var Bt=ne.slice(2,Ie+de.index+Oe-1);return{type:"strong",raw:ne.slice(0,Ie+de.index+Oe+1),text:Bt,tokens:this.lexer.inlineTokens(Bt)}}}}}},ge.codespan=function(ne){var ae=this.rules.inline.code.exec(ne);if(ae){var ue=ae[2].replace(/\n/g," "),de=/[^ ]/.test(ue),Se=/^ /.test(ue)&&/ $/.test(ue);return de&&Se&&(ue=ue.substring(1,ue.length-1)),ue=m(ue,!0),{type:"codespan",raw:ae[0],text:ue}}},ge.br=function(ne){var ae=this.rules.inline.br.exec(ne);if(ae)return{type:"br",raw:ae[0]}},ge.del=function(ne){var ae=this.rules.inline.del.exec(ne);if(ae)return{type:"del",raw:ae[0],text:ae[2],tokens:this.lexer.inlineTokens(ae[2])}},ge.autolink=function(ne,ae){var ue=this.rules.inline.autolink.exec(ne);if(ue){var de,Se;return ue[2]==="@"?(de=m(this.options.mangle?ae(ue[1]):ue[1]),Se="mailto:"+de):(de=m(ue[1]),Se=de),{type:"link",raw:ue[0],text:de,href:Se,tokens:[{type:"text",raw:de,text:de}]}}},ge.url=function(ne,ae){var ue;if(ue=this.rules.inline.url.exec(ne)){var de,Se;if(ue[2]==="@")de=m(this.options.mangle?ae(ue[0]):ue[0]),Se="mailto:"+de;else{var Ie;do Ie=ue[0],ue[0]=this.rules.inline._backpedal.exec(ue[0])[0];while(Ie!==ue[0]);de=m(ue[0]),ue[1]==="www."?Se="http://"+de:Se=de}return{type:"link",raw:ue[0],text:de,href:Se,tokens:[{type:"text",raw:de,text:de}]}}},ge.inlineText=function(ne,ae){var ue=this.rules.inline.text.exec(ne);if(ue){var de;return this.lexer.state.inRawBlock?de=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):m(ue[0]):ue[0]:de=m(this.options.smartypants?ae(ue[0]):ue[0]),{type:"text",raw:ue[0],text:de}}},Ce}(),ee={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:O,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ee._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ee.def=x(ee.def).replace("label",ee._label).replace("title",ee._title).getRegex(),ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,ee.listItemStart=x(/^( *)(bull) */).replace("bull",ee.bullet).getRegex(),ee.list=x(ee.list).replace(/bull/g,ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ee.def.source+")").getRegex(),ee._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ee._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,ee.html=x(ee.html,"i").replace("comment",ee._comment).replace("tag",ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ee.paragraph=x(ee._paragraph).replace("hr",ee.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee._tag).getRegex(),ee.blockquote=x(ee.blockquote).replace("paragraph",ee.paragraph).getRegex(),ee.normal=B({},ee),ee.gfm=B({},ee.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ee.gfm.table=x(ee.gfm.table).replace("hr",ee.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee._tag).getRegex(),ee.gfm.paragraph=x(ee._paragraph).replace("hr",ee.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ee.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee._tag).getRegex(),ee.pedantic=B({},ee.normal,{html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,paragraph:x(ee.normal._paragraph).replace("hr",ee.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:O,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:O,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};le._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",le.punctuation=x(le.punctuation).replace(/punctuation/g,le._punctuation).getRegex(),le.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,le.escapedEmSt=/\\\*|\\_/g,le._comment=x(ee._comment).replace("(?:-->|$)","-->").getRegex(),le.emStrong.lDelim=x(le.emStrong.lDelim).replace(/punct/g,le._punctuation).getRegex(),le.emStrong.rDelimAst=x(le.emStrong.rDelimAst,"g").replace(/punct/g,le._punctuation).getRegex(),le.emStrong.rDelimUnd=x(le.emStrong.rDelimUnd,"g").replace(/punct/g,le._punctuation).getRegex(),le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,le._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,le.autolink=x(le.autolink).replace("scheme",le._scheme).replace("email",le._email).getRegex(),le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,le.tag=x(le.tag).replace("comment",le._comment).replace("attribute",le._attribute).getRegex(),le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,le._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,le.link=x(le.link).replace("label",le._label).replace("href",le._href).replace("title",le._title).getRegex(),le.reflink=x(le.reflink).replace("label",le._label).replace("ref",ee._label).getRegex(),le.nolink=x(le.nolink).replace("ref",ee._label).getRegex(),le.reflinkSearch=x(le.reflinkSearch,"g").replace("reflink",le.reflink).replace("nolink",le.nolink).getRegex(),le.normal=B({},le),le.pedantic=B({},le.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",le._label).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le._label).getRegex()}),le.gfm=B({},le.normal,{escape:x(le.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),le.gfm.url=x(le.gfm.url,"i").replace("email",le.gfm._extended_email).getRegex(),le.breaks=B({},le.gfm,{br:x(le.br).replace("{2,}","*").getRegex(),text:x(le.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function ke(Ce){return Ce.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function xe(Ce){var ge="",pe,ne,ae=Ce.length;for(pe=0;pe<ae;pe++)ne=Ce.charCodeAt(pe),Math.random()>.5&&(ne="x"+ne.toString(16)),ge+="&#"+ne+";";return ge}var me=function(){function Ce(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||e.defaults,this.options.tokenizer=this.options.tokenizer||new K,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var ne={block:ee.normal,inline:le.normal};this.options.pedantic?(ne.block=ee.pedantic,ne.inline=le.pedantic):this.options.gfm&&(ne.block=ee.gfm,this.options.breaks?ne.inline=le.breaks:ne.inline=le.gfm),this.tokenizer.rules=ne}Ce.lex=function(ne,ae){var ue=new Ce(ae);return ue.lex(ne)},Ce.lexInline=function(ne,ae){var ue=new Ce(ae);return ue.inlineTokens(ne)};var ge=Ce.prototype;return ge.lex=function(ne){ne=ne.replace(/\r\n|\r/g,`
`),this.blockTokens(ne,this.tokens);for(var ae;ae=this.inlineQueue.shift();)this.inlineTokens(ae.src,ae.tokens);return this.tokens},ge.blockTokens=function(ne,ae){var ue=this;ae===void 0&&(ae=[]),this.options.pedantic?ne=ne.replace(/\t/g," ").replace(/^ +$/gm,""):ne=ne.replace(/^( *)(\t+)/gm,function(Ve,gt,$t){return gt+" ".repeat($t.length)});for(var de,Se,Ie,nt;ne;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Ve){return(de=Ve.call({lexer:ue},ne,ae))?(ne=ne.substring(de.raw.length),ae.push(de),!0):!1}))){if(de=this.tokenizer.space(ne)){ne=ne.substring(de.raw.length),de.raw.length===1&&ae.length>0?ae[ae.length-1].raw+=`
`:ae.push(de);continue}if(de=this.tokenizer.code(ne)){ne=ne.substring(de.raw.length),Se=ae[ae.length-1],Se&&(Se.type==="paragraph"||Se.type==="text")?(Se.raw+=`
`+de.raw,Se.text+=`
`+de.text,this.inlineQueue[this.inlineQueue.length-1].src=Se.text):ae.push(de);continue}if(de=this.tokenizer.fences(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.heading(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.hr(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.blockquote(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.list(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.html(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.def(ne)){ne=ne.substring(de.raw.length),Se=ae[ae.length-1],Se&&(Se.type==="paragraph"||Se.type==="text")?(Se.raw+=`
`+de.raw,Se.text+=`
`+de.raw,this.inlineQueue[this.inlineQueue.length-1].src=Se.text):this.tokens.links[de.tag]||(this.tokens.links[de.tag]={href:de.href,title:de.title});continue}if(de=this.tokenizer.table(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.lheading(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(Ie=ne,this.options.extensions&&this.options.extensions.startBlock&&function(){var Ve=1/0,gt=ne.slice(1),$t=void 0;ue.options.extensions.startBlock.forEach(function(Mt){$t=Mt.call({lexer:this},gt),typeof $t=="number"&&$t>=0&&(Ve=Math.min(Ve,$t))}),Ve<1/0&&Ve>=0&&(Ie=ne.substring(0,Ve+1))}(),this.state.top&&(de=this.tokenizer.paragraph(Ie))){Se=ae[ae.length-1],nt&&Se.type==="paragraph"?(Se.raw+=`
`+de.raw,Se.text+=`
`+de.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Se.text):ae.push(de),nt=Ie.length!==ne.length,ne=ne.substring(de.raw.length);continue}if(de=this.tokenizer.text(ne)){ne=ne.substring(de.raw.length),Se=ae[ae.length-1],Se&&Se.type==="text"?(Se.raw+=`
`+de.raw,Se.text+=`
`+de.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Se.text):ae.push(de);continue}if(ne){var Oe="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(Oe);break}else throw new Error(Oe)}}return this.state.top=!0,ae},ge.inline=function(ne,ae){return ae===void 0&&(ae=[]),this.inlineQueue.push({src:ne,tokens:ae}),ae},ge.inlineTokens=function(ne,ae){var ue=this;ae===void 0&&(ae=[]);var de,Se,Ie,nt=ne,Oe,Ve,gt;if(this.tokens.links){var $t=Object.keys(this.tokens.links);if($t.length>0)for(;(Oe=this.tokenizer.rules.inline.reflinkSearch.exec(nt))!=null;)$t.includes(Oe[0].slice(Oe[0].lastIndexOf("[")+1,-1))&&(nt=nt.slice(0,Oe.index)+"["+X("a",Oe[0].length-2)+"]"+nt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Oe=this.tokenizer.rules.inline.blockSkip.exec(nt))!=null;)nt=nt.slice(0,Oe.index)+"["+X("a",Oe[0].length-2)+"]"+nt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Oe=this.tokenizer.rules.inline.escapedEmSt.exec(nt))!=null;)nt=nt.slice(0,Oe.index)+"++"+nt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ne;)if(Ve||(gt=""),Ve=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Bt){return(de=Bt.call({lexer:ue},ne,ae))?(ne=ne.substring(de.raw.length),ae.push(de),!0):!1}))){if(de=this.tokenizer.escape(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.tag(ne)){ne=ne.substring(de.raw.length),Se=ae[ae.length-1],Se&&de.type==="text"&&Se.type==="text"?(Se.raw+=de.raw,Se.text+=de.text):ae.push(de);continue}if(de=this.tokenizer.link(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(de.raw.length),Se=ae[ae.length-1],Se&&de.type==="text"&&Se.type==="text"?(Se.raw+=de.raw,Se.text+=de.text):ae.push(de);continue}if(de=this.tokenizer.emStrong(ne,nt,gt)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.codespan(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.br(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.del(ne)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(de=this.tokenizer.autolink(ne,xe)){ne=ne.substring(de.raw.length),ae.push(de);continue}if(!this.state.inLink&&(de=this.tokenizer.url(ne,xe))){ne=ne.substring(de.raw.length),ae.push(de);continue}if(Ie=ne,this.options.extensions&&this.options.extensions.startInline&&function(){var Bt=1/0,jn=ne.slice(1),Dt=void 0;ue.options.extensions.startInline.forEach(function(Fn){Dt=Fn.call({lexer:this},jn),typeof Dt=="number"&&Dt>=0&&(Bt=Math.min(Bt,Dt))}),Bt<1/0&&Bt>=0&&(Ie=ne.substring(0,Bt+1))}(),de=this.tokenizer.inlineText(Ie,ke)){ne=ne.substring(de.raw.length),de.raw.slice(-1)!=="_"&&(gt=de.raw.slice(-1)),Ve=!0,Se=ae[ae.length-1],Se&&Se.type==="text"?(Se.raw+=de.raw,Se.text+=de.text):ae.push(de);continue}if(ne){var Mt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(Mt);break}else throw new Error(Mt)}}return ae},r(Ce,null,[{key:"rules",get:function(){return{block:ee,inline:le}}}]),Ce}(),Ee=function(){function Ce(pe){this.options=pe||e.defaults}var ge=Ce.prototype;return ge.code=function(ne,ae,ue){var de=(ae||"").match(/\S*/)[0];if(this.options.highlight){var Se=this.options.highlight(ne,de);Se!=null&&Se!==ne&&(ue=!0,ne=Se)}return ne=ne.replace(/\n$/,"")+`
`,de?'<pre><code class="'+this.options.langPrefix+m(de,!0)+'">'+(ue?ne:m(ne,!0))+`</code></pre>
`:"<pre><code>"+(ue?ne:m(ne,!0))+`</code></pre>
`},ge.blockquote=function(ne){return`<blockquote>
`+ne+`</blockquote>
`},ge.html=function(ne){return ne},ge.heading=function(ne,ae,ue,de){if(this.options.headerIds){var Se=this.options.headerPrefix+de.slug(ue);return"<h"+ae+' id="'+Se+'">'+ne+"</h"+ae+`>
`}return"<h"+ae+">"+ne+"</h"+ae+`>
`},ge.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ge.list=function(ne,ae,ue){var de=ae?"ol":"ul",Se=ae&&ue!==1?' start="'+ue+'"':"";return"<"+de+Se+`>
`+ne+"</"+de+`>
`},ge.listitem=function(ne){return"<li>"+ne+`</li>
`},ge.checkbox=function(ne){return"<input "+(ne?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ge.paragraph=function(ne){return"<p>"+ne+`</p>
`},ge.table=function(ne,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
<thead>
`+ne+`</thead>
`+ae+`</table>
`},ge.tablerow=function(ne){return`<tr>
`+ne+`</tr>
`},ge.tablecell=function(ne,ae){var ue=ae.header?"th":"td",de=ae.align?"<"+ue+' align="'+ae.align+'">':"<"+ue+">";return de+ne+("</"+ue+`>
`)},ge.strong=function(ne){return"<strong>"+ne+"</strong>"},ge.em=function(ne){return"<em>"+ne+"</em>"},ge.codespan=function(ne){return"<code>"+ne+"</code>"},ge.br=function(){return this.options.xhtml?"<br/>":"<br>"},ge.del=function(ne){return"<del>"+ne+"</del>"},ge.link=function(ne,ae,ue){if(ne=R(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ue;var de='<a href="'+m(ne)+'"';return ae&&(de+=' title="'+ae+'"'),de+=">"+ue+"</a>",de},ge.image=function(ne,ae,ue){if(ne=R(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ue;var de='<img src="'+ne+'" alt="'+ue+'"';return ae&&(de+=' title="'+ae+'"'),de+=this.options.xhtml?"/>":">",de},ge.text=function(ne){return ne},Ce}(),je=function(){function Ce(){}var ge=Ce.prototype;return ge.strong=function(ne){return ne},ge.em=function(ne){return ne},ge.codespan=function(ne){return ne},ge.del=function(ne){return ne},ge.html=function(ne){return ne},ge.text=function(ne){return ne},ge.link=function(ne,ae,ue){return""+ue},ge.image=function(ne,ae,ue){return""+ue},ge.br=function(){return""},Ce}(),qe=function(){function Ce(){this.seen={}}var ge=Ce.prototype;return ge.serialize=function(ne){return ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ge.getNextSafeSlug=function(ne,ae){var ue=ne,de=0;if(this.seen.hasOwnProperty(ue)){de=this.seen[ne];do de++,ue=ne+"-"+de;while(this.seen.hasOwnProperty(ue))}return ae||(this.seen[ne]=de,this.seen[ue]=0),ue},ge.slug=function(ne,ae){ae===void 0&&(ae={});var ue=this.serialize(ne);return this.getNextSafeSlug(ue,ae.dryrun)},Ce}(),Ze=function(){function Ce(pe){this.options=pe||e.defaults,this.options.renderer=this.options.renderer||new Ee,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new je,this.slugger=new qe}Ce.parse=function(ne,ae){var ue=new Ce(ae);return ue.parse(ne)},Ce.parseInline=function(ne,ae){var ue=new Ce(ae);return ue.parseInline(ne)};var ge=Ce.prototype;return ge.parse=function(ne,ae){ae===void 0&&(ae=!0);var ue="",de,Se,Ie,nt,Oe,Ve,gt,$t,Mt,Bt,jn,Dt,Fn,tn,pi,Pi,ti,mi,ds,Nr=ne.length;for(de=0;de<Nr;de++){if(Bt=ne[de],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Bt.type]&&(ds=this.options.extensions.renderers[Bt.type].call({parser:this},Bt),ds!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(Bt.type))){ue+=ds||"";continue}switch(Bt.type){case"space":continue;case"hr":{ue+=this.renderer.hr();continue}case"heading":{ue+=this.renderer.heading(this.parseInline(Bt.tokens),Bt.depth,b(this.parseInline(Bt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ue+=this.renderer.code(Bt.text,Bt.lang,Bt.escaped);continue}case"table":{for($t="",gt="",nt=Bt.header.length,Se=0;Se<nt;Se++)gt+=this.renderer.tablecell(this.parseInline(Bt.header[Se].tokens),{header:!0,align:Bt.align[Se]});for($t+=this.renderer.tablerow(gt),Mt="",nt=Bt.rows.length,Se=0;Se<nt;Se++){for(Ve=Bt.rows[Se],gt="",Oe=Ve.length,Ie=0;Ie<Oe;Ie++)gt+=this.renderer.tablecell(this.parseInline(Ve[Ie].tokens),{header:!1,align:Bt.align[Ie]});Mt+=this.renderer.tablerow(gt)}ue+=this.renderer.table($t,Mt);continue}case"blockquote":{Mt=this.parse(Bt.tokens),ue+=this.renderer.blockquote(Mt);continue}case"list":{for(jn=Bt.ordered,Dt=Bt.start,Fn=Bt.loose,nt=Bt.items.length,Mt="",Se=0;Se<nt;Se++)pi=Bt.items[Se],Pi=pi.checked,ti=pi.task,tn="",pi.task&&(mi=this.renderer.checkbox(Pi),Fn?pi.tokens.length>0&&pi.tokens[0].type==="paragraph"?(pi.tokens[0].text=mi+" "+pi.tokens[0].text,pi.tokens[0].tokens&&pi.tokens[0].tokens.length>0&&pi.tokens[0].tokens[0].type==="text"&&(pi.tokens[0].tokens[0].text=mi+" "+pi.tokens[0].tokens[0].text)):pi.tokens.unshift({type:"text",text:mi}):tn+=mi),tn+=this.parse(pi.tokens,Fn),Mt+=this.renderer.listitem(tn,ti,Pi);ue+=this.renderer.list(Mt,jn,Dt);continue}case"html":{ue+=this.renderer.html(Bt.text);continue}case"paragraph":{ue+=this.renderer.paragraph(this.parseInline(Bt.tokens));continue}case"text":{for(Mt=Bt.tokens?this.parseInline(Bt.tokens):Bt.text;de+1<Nr&&ne[de+1].type==="text";)Bt=ne[++de],Mt+=`
`+(Bt.tokens?this.parseInline(Bt.tokens):Bt.text);ue+=ae?this.renderer.paragraph(Mt):Mt;continue}default:{var Br='Token with "'+Bt.type+'" type was not found.';if(this.options.silent){console.error(Br);return}else throw new Error(Br)}}}return ue},ge.parseInline=function(ne,ae){ae=ae||this.renderer;var ue="",de,Se,Ie,nt=ne.length;for(de=0;de<nt;de++){if(Se=ne[de],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Se.type]&&(Ie=this.options.extensions.renderers[Se.type].call({parser:this},Se),Ie!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(Se.type))){ue+=Ie||"";continue}switch(Se.type){case"escape":{ue+=ae.text(Se.text);break}case"html":{ue+=ae.html(Se.text);break}case"link":{ue+=ae.link(Se.href,Se.title,this.parseInline(Se.tokens,ae));break}case"image":{ue+=ae.image(Se.href,Se.title,Se.text);break}case"strong":{ue+=ae.strong(this.parseInline(Se.tokens,ae));break}case"em":{ue+=ae.em(this.parseInline(Se.tokens,ae));break}case"codespan":{ue+=ae.codespan(Se.text);break}case"br":{ue+=ae.br();break}case"del":{ue+=ae.del(this.parseInline(Se.tokens,ae));break}case"text":{ue+=ae.text(Se.text);break}default:{var Oe='Token with "'+Se.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return ue},Ce}();function We(Ce,ge,pe){if(typeof Ce>"u"||Ce===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ce!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ce)+", string expected");if(typeof ge=="function"&&(pe=ge,ge=null),ge=B({},We.defaults,ge||{}),Y(ge),pe){var ne=ge.highlight,ae;try{ae=me.lex(Ce,ge)}catch(nt){return pe(nt)}var ue=function(Oe){var Ve;if(!Oe)try{ge.walkTokens&&We.walkTokens(ae,ge.walkTokens),Ve=Ze.parse(ae,ge)}catch(gt){Oe=gt}return ge.highlight=ne,Oe?pe(Oe):pe(null,Ve)};if(!ne||ne.length<3||(delete ge.highlight,!ae.length))return ue();var de=0;We.walkTokens(ae,function(nt){nt.type==="code"&&(de++,setTimeout(function(){ne(nt.text,nt.lang,function(Oe,Ve){if(Oe)return ue(Oe);Ve!=null&&Ve!==nt.text&&(nt.text=Ve,nt.escaped=!0),de--,de===0&&ue()})},0))}),de===0&&ue();return}function Se(nt){if(nt.message+=`
Please report this to https://github.com/markedjs/marked.`,ge.silent)return"<p>An error occurred:</p><pre>"+m(nt.message+"",!0)+"</pre>";throw nt}try{var Ie=me.lex(Ce,ge);if(ge.walkTokens){if(ge.async)return Promise.all(We.walkTokens(Ie,ge.walkTokens)).then(function(){return Ze.parse(Ie,ge)}).catch(Se);We.walkTokens(Ie,ge.walkTokens)}return Ze.parse(Ie,ge)}catch(nt){Se(nt)}}We.options=We.setOptions=function(Ce){return B(We.defaults,Ce),c(We.defaults),We},We.getDefaults=l,We.defaults=e.defaults,We.use=function(){for(var Ce=arguments.length,ge=new Array(Ce),pe=0;pe<Ce;pe++)ge[pe]=arguments[pe];var ne=B.apply(void 0,[{}].concat(ge)),ae=We.defaults.extensions||{renderers:{},childTokens:{}},ue;ge.forEach(function(de){if(de.extensions&&(ue=!0,de.extensions.forEach(function(Ie){if(!Ie.name)throw new Error("extension name required");if(Ie.renderer){var nt=ae.renderers?ae.renderers[Ie.name]:null;nt?ae.renderers[Ie.name]=function(){for(var Oe=arguments.length,Ve=new Array(Oe),gt=0;gt<Oe;gt++)Ve[gt]=arguments[gt];var $t=Ie.renderer.apply(this,Ve);return $t===!1&&($t=nt.apply(this,Ve)),$t}:ae.renderers[Ie.name]=Ie.renderer}if(Ie.tokenizer){if(!Ie.level||Ie.level!=="block"&&Ie.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");ae[Ie.level]?ae[Ie.level].unshift(Ie.tokenizer):ae[Ie.level]=[Ie.tokenizer],Ie.start&&(Ie.level==="block"?ae.startBlock?ae.startBlock.push(Ie.start):ae.startBlock=[Ie.start]:Ie.level==="inline"&&(ae.startInline?ae.startInline.push(Ie.start):ae.startInline=[Ie.start]))}Ie.childTokens&&(ae.childTokens[Ie.name]=Ie.childTokens)})),de.renderer&&function(){var Ie=We.defaults.renderer||new Ee,nt=function(gt){var $t=Ie[gt];Ie[gt]=function(){for(var Mt=arguments.length,Bt=new Array(Mt),jn=0;jn<Mt;jn++)Bt[jn]=arguments[jn];var Dt=de.renderer[gt].apply(Ie,Bt);return Dt===!1&&(Dt=$t.apply(Ie,Bt)),Dt}};for(var Oe in de.renderer)nt(Oe);ne.renderer=Ie}(),de.tokenizer&&function(){var Ie=We.defaults.tokenizer||new K,nt=function(gt){var $t=Ie[gt];Ie[gt]=function(){for(var Mt=arguments.length,Bt=new Array(Mt),jn=0;jn<Mt;jn++)Bt[jn]=arguments[jn];var Dt=de.tokenizer[gt].apply(Ie,Bt);return Dt===!1&&(Dt=$t.apply(Ie,Bt)),Dt}};for(var Oe in de.tokenizer)nt(Oe);ne.tokenizer=Ie}(),de.walkTokens){var Se=We.defaults.walkTokens;ne.walkTokens=function(Ie){var nt=[];return nt.push(de.walkTokens.call(this,Ie)),Se&&(nt=nt.concat(Se.call(this,Ie))),nt}}ue&&(ne.extensions=ae),We.setOptions(ne)})},We.walkTokens=function(Ce,ge){for(var pe=[],ne=function(){var Se=ue.value;switch(pe=pe.concat(ge.call(We,Se)),Se.type){case"table":{for(var Ie=a(Se.header),nt;!(nt=Ie()).done;){var Oe=nt.value;pe=pe.concat(We.walkTokens(Oe.tokens,ge))}for(var Ve=a(Se.rows),gt;!(gt=Ve()).done;)for(var $t=gt.value,Mt=a($t),Bt;!(Bt=Mt()).done;){var jn=Bt.value;pe=pe.concat(We.walkTokens(jn.tokens,ge))}break}case"list":{pe=pe.concat(We.walkTokens(Se.items,ge));break}default:We.defaults.extensions&&We.defaults.extensions.childTokens&&We.defaults.extensions.childTokens[Se.type]?We.defaults.extensions.childTokens[Se.type].forEach(function(Dt){pe=pe.concat(We.walkTokens(Se[Dt],ge))}):Se.tokens&&(pe=pe.concat(We.walkTokens(Se.tokens,ge)))}},ae=a(Ce),ue;!(ue=ae()).done;)ne();return pe},We.parseInline=function(Ce,ge){if(typeof Ce>"u"||Ce===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Ce!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Ce)+", string expected");ge=B({},We.defaults,ge||{}),Y(ge);try{var pe=me.lexInline(Ce,ge);return ge.walkTokens&&We.walkTokens(pe,ge.walkTokens),Ze.parseInline(pe,ge)}catch(ne){if(ne.message+=`
Please report this to https://github.com/markedjs/marked.`,ge.silent)return"<p>An error occurred:</p><pre>"+m(ne.message+"",!0)+"</pre>";throw ne}},We.Parser=Ze,We.parser=Ze.parse,We.Renderer=Ee,We.TextRenderer=je,We.Lexer=me,We.lexer=me.lex,We.Tokenizer=K,We.Slugger=qe,We.parse=We;var ut=We.options,st=We.setOptions,mt=We.use,Rt=We.walkTokens,Vt=We.parseInline,Ot=We,vt=Ze.parse,wn=me.lex;e.Lexer=me,e.Parser=Ze,e.Renderer=Ee,e.Slugger=qe,e.TextRenderer=je,e.Tokenizer=K,e.getDefaults=l,e.lexer=wn,e.marked=We,e.options=ut,e.parse=Ot,e.parseInline=Vt,e.parser=vt,e.setOptions=st,e.use=mt,e.walkTokens=Rt,Object.defineProperty(e,"__esModule",{value:!0})})})();Kl.Lexer||exports.Lexer;Kl.Parser||exports.Parser;Kl.Renderer||exports.Renderer;Kl.Slugger||exports.Slugger;Kl.TextRenderer||exports.TextRenderer;Kl.Tokenizer||exports.Tokenizer;Kl.getDefaults||exports.getDefaults;Kl.lexer||exports.lexer;var fm=Kl.marked||exports.marked;Kl.options||exports.options;Kl.parse||exports.parse;Kl.parseInline||exports.parseInline;Kl.parser||exports.parser;Kl.setOptions||exports.setOptions;Kl.use||exports.use;Kl.walkTokens||exports.walkTokens;function nbt(i){return JSON.stringify(i,ibt)}function wee(i){let e=JSON.parse(i);return e=Cee(e),e}function ibt(i,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function Cee(i,e=0){if(!i||e>200)return i;if(typeof i=="object"){switch(i.$mid){case 1:return Jt.revive(i);case 2:return new RegExp(i.source,i.flags);case 17:return new Date(i.source)}if(i instanceof m$||i instanceof Uint8Array)return i;if(Array.isArray(i))for(let n=0;n<i.length;++n)i[n]=Cee(i[n],e+1);else for(const n in i)Object.hasOwnProperty.call(i,n)&&(i[n]=Cee(i[n],e+1))}return i}const qq=Object.freeze({image:(i,e,n)=>{let r=[],s=[];return i&&({href:i,dimensions:r}=Kvt(i),s.push(`src="${v6(i)}"`)),n&&s.push(`alt="${v6(n)}"`),e&&s.push(`title="${v6(e)}"`),r.length&&(s=s.concat(r)),"<img "+s.join(" ")+">"},paragraph:i=>`<p>${i}</p>`,link:(i,e,n)=>typeof i!="string"?"":(i===n&&(n=Uq(n)),e=typeof e=="string"?v6(Uq(e)):"",i=Uq(i),i=i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),`<a href="${i}" title="${e||i}">${n}</a>`)});function H$(i,e={},n={}){var r,s;const o=new Xe;let a=!1;const l=aae(e),c=function(b){let y;try{y=wee(decodeURIComponent(b))}catch{}return y?(y=y2e(y,x=>{if(i.uris&&i.uris[x])return Jt.revive(i.uris[x])}),encodeURIComponent(JSON.stringify(y))):b},u=function(b,y){const x=i.uris&&i.uris[b];let k=Jt.revive(x);return y?b.startsWith(Pn.data+":")?b:(k||(k=Jt.parse(b)),vEe.uriToBrowserUri(k).toString(!0)):!k||Jt.parse(b).toString()===k.toString()?b:(k.query&&(k=k.with({query:c(k.query)})),k.toString())},d=new fm.Renderer;d.image=qq.image,d.link=qq.link,d.paragraph=qq.paragraph;const h=[],f=[];if(e.codeBlockRendererSync?d.code=(b,y)=>{const x=yee.nextId(),k=e.codeBlockRendererSync($me(y),b);return f.push([x,k]),`<div class="code" data-code="${x}">${O9(b)}</div>`}:e.codeBlockRenderer&&(d.code=(b,y)=>{const x=yee.nextId(),k=e.codeBlockRenderer($me(y),b);return h.push(k.then(D=>[x,D])),`<div class="code" data-code="${x}">${O9(b)}</div>`}),e.actionHandler){const b=function(k){let D=k.target;if(!(D.tagName!=="A"&&(D=D.parentElement,!D||D.tagName!=="A")))try{let R=D.dataset.href;R&&(i.baseUri&&(R=Kq(Jt.from(i.baseUri),R)),e.actionHandler.callback(R,k))}catch(R){Ln(R)}finally{k.preventDefault()}},y=e.actionHandler.disposables.add(new Xn(l,"click")),x=e.actionHandler.disposables.add(new Xn(l,"auxclick"));e.actionHandler.disposables.add(_t.any(y.event,x.event)(k=>{const D=new rh(k);!D.leftButton&&!D.middleButton||b(D)})),e.actionHandler.disposables.add(Be(l,"keydown",k=>{const D=new yr(k);!D.equals(10)&&!D.equals(3)||b(D)}))}i.supportHtml||(n.sanitizer=b=>(i.isTrusted?b.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?b:"",n.sanitize=!0,n.silent=!0),n.renderer=d;let p=(r=i.value)!==null&&r!==void 0?r:"";p.length>1e5&&(p=`${p.substr(0,1e5)}…`),i.supportThemeIcons&&(p=zvt(p));let g;if(e.fillInIncompleteTokens){const b=Object.assign(Object.assign({},fm.defaults),n),y=fm.lexer(p,b),x=dbt(y);g=fm.parser(x,b)}else g=fm.parse(p,n);i.supportThemeIcons&&(g=Uy(g).map(y=>typeof y=="string"?y:y.outerHTML).join(""));const _=new DOMParser().parseFromString(See(i,g),"text/html");if(_.body.querySelectorAll("img").forEach(b=>{const y=b.getAttribute("src");if(y){let x=y;try{i.baseUri&&(x=Kq(Jt.from(i.baseUri),x))}catch{}b.src=u(x,!0)}}),_.body.querySelectorAll("a").forEach(b=>{const y=b.getAttribute("href");if(b.setAttribute("href",""),!y||/^data:|javascript:/i.test(y)||/^command:/i.test(y)&&!i.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(y))b.replaceWith(...b.childNodes);else{let x=u(y,!1);i.baseUri&&(x=Kq(Jt.from(i.baseUri),y)),b.dataset.href=x}}),l.innerHTML=See(i,_.body.innerHTML),h.length>0)Promise.all(h).then(b=>{var y,x;if(a)return;const k=new Map(b),D=l.querySelectorAll("div[data-code]");for(const R of D){const E=k.get((y=R.dataset.code)!==null&&y!==void 0?y:"");E&&ca(R,E)}(x=e.asyncRenderCallback)===null||x===void 0||x.call(e)});else if(f.length>0){const b=new Map(f),y=l.querySelectorAll("div[data-code]");for(const x of y){const k=b.get((s=x.dataset.code)!==null&&s!==void 0?s:"");k&&ca(x,k)}}if(e.asyncRenderCallback)for(const b of l.getElementsByTagName("img")){const y=o.add(Be(b,"load",()=>{y.dispose(),e.asyncRenderCallback()}))}return{element:l,dispose:()=>{a=!0,o.dispose()}}}function $me(i){if(!i)return"";const e=i.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:i}function Kq(i,e){return/^\w[\w\d+.-]*:/.test(e)?e:i.path.endsWith("/")?jge(i,e).toString():jge(M$(i),e).toString()}function See(i,e){const{config:n,allowedSchemes:r}=sbt(i);gEe("uponSanitizeAttribute",(o,a)=>{if(a.attrName==="style"||a.attrName==="class"){if(o.tagName==="SPAN"){if(a.attrName==="style"){a.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(a.attrValue);return}else if(a.attrName==="class"){a.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(a.attrValue);return}}a.keepAttr=!1;return}});const s=slt(r);try{return pEe(e,Object.assign(Object.assign({},n),{RETURN_TRUSTED_TYPE:!0}))}finally{mEe("uponSanitizeAttribute"),s.dispose()}}const rbt=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function sbt(i){const e=[Pn.http,Pn.https,Pn.mailto,Pn.data,Pn.file,Pn.vscodeFileResource,Pn.vscodeRemote,Pn.vscodeRemoteResource];return i.isTrusted&&e.push(Pn.command),{config:{ALLOWED_TAGS:[...olt],ALLOWED_ATTR:rbt,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function obt(i){return typeof i=="string"?i:abt(i)}function abt(i){var e;let n=(e=i.value)!==null&&e!==void 0?e:"";n.length>1e5&&(n=`${n.substr(0,1e5)}…`);const r=fm.parse(n,{renderer:cbt.value}).replace(/&(#\d+|[a-zA-Z]+);/g,s=>{var o;return(o=lbt.get(s))!==null&&o!==void 0?o:s});return See({isTrusted:!1},r).toString()}const lbt=new Map([["&quot;",'"'],["&nbsp;"," "],["&amp;","&"],["&#39;","'"],["&lt;","<"],["&gt;",">"]]),cbt=new K1(()=>{const i=new fm.Renderer;return i.code=e=>e,i.blockquote=e=>e,i.html=e=>"",i.heading=(e,n,r)=>e+`
`,i.hr=()=>"",i.list=(e,n)=>e,i.listitem=e=>e+`
`,i.paragraph=e=>e+`
`,i.table=(e,n)=>e+n+`
`,i.tablerow=e=>e,i.tablecell=(e,n)=>e+" ",i.strong=e=>e,i.em=e=>e,i.codespan=e=>e,i.br=()=>`
`,i.del=e=>e,i.image=(e,n,r)=>"",i.text=e=>e,i.link=(e,n,r)=>r,i});function cae(i){let e="";return i.forEach(n=>{e+=n.raw}),e}function ubt(i){for(const e of i.tokens)if(e.type==="text"){const n=e.raw.split(`
`),r=n[n.length-1];if(r.includes("`"))return fbt(i);if(r.includes("**"))return vbt(i);if(r.match(/\*\w/))return pbt(i);if(r.match(/(^|\s)__\w/))return bbt(i);if(r.match(/(^|\s)_\w/))return gbt(i);if(r.match(/(^|\s)\[.*\]\(\w*/))return mbt(i);if(r.match(/(^|\s)\[\w/))return _bt(i)}}function dbt(i){let e,n;for(e=0;e<i.length;e++){const r=i[e];if(r.type==="paragraph"&&r.raw.match(/(\n|^)```/)){n=hbt(i.slice(e));break}if(r.type==="paragraph"&&r.raw.match(/(\n|^)\|/)){n=ybt(i.slice(e));break}if(e===i.length-1&&r.type==="paragraph"){const s=ubt(r);if(s){n=[s];break}}}if(n){const r=[...i.slice(0,e),...n];return r.links=i.links,r}return i}function hbt(i){const e=cae(i);return fm.lexer(e+"\n```")}function fbt(i){return Jx(i,"`")}function pbt(i){return Jx(i,"*")}function gbt(i){return Jx(i,"_")}function mbt(i){return Jx(i,")")}function _bt(i){return Jx(i,"](about:blank)")}function vbt(i){return Jx(i,"**")}function bbt(i){return Jx(i,"__")}function Jx(i,e){const n=cae(Array.isArray(i)?i:[i]);return fm.lexer(n+e)[0]}function ybt(i){const e=cae(i),n=e.split(`
`);let r,s=!1;for(let o=0;o<n.length;o++){const a=n[o].trim();if(typeof r>"u"&&a.match(/^\s*\|/)){const l=a.match(/(\|[^\|]+)(?=\||$)/g);l&&(r=l.length)}else if(typeof r=="number")if(a.match(/^\s*\|/)){if(o!==n.length-1)return;s=!0}else return}if(typeof r=="number"&&r>0){const o=s?n.slice(0,-1).join(`
`):e,a=!!o.match(/\|\s*$/),l=o+(a?"":"|")+`
|${" --- |".repeat(r)}`;return fm.lexer(l)}}class wbt{constructor(e){this.spliceables=e}splice(e,n,r){this.spliceables.forEach(s=>s.splice(e,n,r))}}class rD extends Error{constructor(e,n){super(`ListError [${e}] ${n}`)}}function zme(i,e){const n=[];for(const r of e){if(i.start>=r.range.end)continue;if(i.end<r.range.start)break;const s=Ba.intersect(i,r.range);Ba.isEmpty(s)||n.push({range:s,size:r.size})}return n}function xee({start:i,end:e},n){return{start:i+n,end:e+n}}function Cbt(i){const e=[];let n=null;for(const r of i){const s=r.range.start,o=r.range.end,a=r.size;if(n&&a===n.size){n.range.end=o;continue}n={range:{start:s,end:o},size:a},e.push(n)}return e}function Sbt(...i){return Cbt(i.reduce((e,n)=>e.concat(n),[]))}class Vme{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,n,r=[]){const s=r.length-n,o=zme({start:0,end:e},this.groups),a=zme({start:e+n,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:xee(c.range,s),size:c.size})),l=r.map((c,u)=>({range:{start:e+u,end:e+u+1},size:c.size}));this.groups=Sbt(o,l,a),this._size=this._paddingTop+this.groups.reduce((c,u)=>c+u.size*(u.range.end-u.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e<this._paddingTop)return 0;let n=0,r=this._paddingTop;for(const s of this.groups){const o=s.range.end-s.range.start,a=r+o*s.size;if(e<a)return n+Math.floor((e-r)/s.size);n+=o,r=a}return n}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let n=0,r=0;for(const s of this.groups){const o=s.range.end-s.range.start,a=r+o;if(e<a)return this._paddingTop+n+(e-r)*s.size;n+=o*s.size,r=a}return-1}}function xbt(i){var e;try{(e=i.parentElement)===null||e===void 0||e.removeChild(i)}catch{}}class kbt{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let n=this.getTemplateCache(e).pop(),r=!1;if(n)r=this.transactionNodesPendingRemoval.has(n.domNode),r&&this.transactionNodesPendingRemoval.delete(n.domNode);else{const s=tt(".monaco-list-row"),a=this.getRenderer(e).renderTemplate(s);n={domNode:s,templateId:e,templateData:a}}return{row:n,isReusingConnectedDomNode:r}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const n of this.transactionNodesPendingRemoval)this.doRemoveNode(n);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:n,templateId:r}=e;n&&(this.inTransaction?this.transactionNodesPendingRemoval.add(n):this.doRemoveNode(n)),this.getTemplateCache(r).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),xbt(e)}getTemplateCache(e){let n=this.cache.get(e);return n||(n=[],this.cache.set(e,n)),n}dispose(){this.cache.forEach((e,n)=>{for(const r of e)this.getRenderer(n).disposeTemplate(r.templateData),r.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const n=this.renderers.get(e);if(!n)throw new Error(`No renderer found for ${e}`);return n}}var Hv=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const iC={CurrentDragAndDropData:void 0},jg={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(i){return[i]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class V5{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Lbt{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Dbt{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let n=0;n<e.files.length;n++){const r=e.files.item(n);r&&(r.size||r.type)&&this.files.push(r)}}}getData(){return{types:this.types,files:this.files}}}function Ebt(i,e){return Array.isArray(i)&&Array.isArray(e)?ys(i,e):i===e}class Ibt{constructor(e){e!=null&&e.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(n,r,s)=>s,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(n,r)=>r+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=n=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=n=>{}}}class kh{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const n of this.items)this.measureItemWidth(n);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:JU(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,n,r,s=jg){var o,a,l,c,u,d,h,f,p,g,m,_,b;if(this.virtualDelegate=n,this.domId=`list_id_${++kh.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Rf(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Le.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Le.None,this.onDragLeaveTimeout=Le.None,this.disposables=new Xe,this._onDidChangeContentHeight=new _e,this._onDidChangeContentWidth=new _e,this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new Vme((o=s.paddingTop)!==null&&o!==void 0?o:0);for(const x of r)this.renderers.set(x.templateId,x);this.cache=this.disposables.add(new kbt(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=(a=s.horizontalScrolling)!==null&&a!==void 0?a:jg.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new Ibt(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((l=s.transformOptimization)!==null&&l!==void 0?l:jg.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(or.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new M5({forceIntegerValues:!0,smoothScrollDuration:(c=s.smoothScrolling)!==null&&c!==void 0&&c?125:0,scheduleAtNextAnimationFrame:x=>mh(x)})),this.scrollableElement=this.disposables.add(new xoe(this.rowsContainer,{alwaysConsumeMouseWheel:(u=s.alwaysConsumeMouseWheel)!==null&&u!==void 0?u:jg.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=s.verticalScrollMode)!==null&&d!==void 0?d:jg.verticalScrollMode,useShadows:(h=s.useShadows)!==null&&h!==void 0?h:jg.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(Be(this.rowsContainer,lr.Change,x=>this.onTouchChange(x))),this.disposables.add(Be(this.scrollableElement.getDomNode(),"scroll",x=>x.target.scrollTop=0)),this.disposables.add(Be(this.domNode,"dragover",x=>this.onDragOver(this.toDragEvent(x)))),this.disposables.add(Be(this.domNode,"drop",x=>this.onDrop(this.toDragEvent(x)))),this.disposables.add(Be(this.domNode,"dragleave",x=>this.onDragLeave(this.toDragEvent(x)))),this.disposables.add(Be(this.domNode,"dragend",x=>this.onDragEnd(x))),this.setRowLineHeight=(f=s.setRowLineHeight)!==null&&f!==void 0?f:jg.setRowLineHeight,this.setRowHeight=(p=s.setRowHeight)!==null&&p!==void 0?p:jg.setRowHeight,this.supportDynamicHeights=(g=s.supportDynamicHeights)!==null&&g!==void 0?g:jg.supportDynamicHeights,this.dnd=(m=s.dnd)!==null&&m!==void 0?m:this.disposables.add(jg.dnd),this.layout((_=s.initialSize)===null||_===void 0?void 0:_.height,(b=s.initialSize)===null||b===void 0?void 0:b.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let n;if(e.scrollByPage!==void 0&&(n=Object.assign(Object.assign({},n??{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(n=Object.assign(Object.assign({},n??{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(n=Object.assign(Object.assign({},n??{}),{fastScrollSensitivity:e.fastScrollSensitivity})),n&&this.scrollableElement.updateOptions(n),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(r,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,n,r=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,n,r)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,n,r=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+n},a=Ba.intersect(s,o),l=new Map;for(let R=a.end-1;R>=a.start;R--){const E=this.items[R];if(E.dragStartDisposable.dispose(),E.checkedDisposable.dispose(),E.row){let A=l.get(E.templateId);A||(A=[],l.set(E.templateId,A));const M=this.renderers.get(E.templateId);M&&M.disposeElement&&M.disposeElement(E.element,R,E.row.templateData,E.size),A.push(E.row)}E.row=null}const c={start:e+n,end:this.items.length},u=Ba.intersect(c,s),d=Ba.relativeComplement(c,s),h=r.map(R=>({id:String(this.itemId++),element:R,templateId:this.virtualDelegate.getTemplateId(R),size:this.virtualDelegate.getHeight(R),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(R),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Le.None,checkedDisposable:Le.None}));let f;e===0&&n>=this.items.length?(this.rangeMap=new Vme(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),f=this.items,this.items=h):(this.rangeMap.splice(e,n,h),f=this.items.splice(e,n,...h));const p=r.length-n,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=xee(u,p),_=Ba.intersect(g,m);for(let R=_.start;R<_.end;R++)this.updateItemInDOM(this.items[R],R);const b=Ba.relativeComplement(m,g);for(const R of b)for(let E=R.start;E<R.end;E++)this.removeItemFromDOM(E);const y=d.map(R=>xee(R,p)),k=[{start:e,end:e+r.length},...y].map(R=>Ba.intersect(g,R)),D=this.getNextToLastElement(k);for(const R of k)for(let E=R.start;E<R.end;E++){const A=this.items[E],M=l.get(A.templateId),N=M==null?void 0:M.pop();this.insertItemInDOM(E,D,N)}for(const R of l.values())for(const E of R)this.cache.release(E);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),f.map(R=>R.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=mh(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const n of this.items)typeof n.width<"u"&&(e=Math.max(e,n.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),n=this.rangeMap.positionAt(e.start),r=this.rangeMap.positionAt(e.start+1);return r!==-1&&(r-n)/2+n<this.scrollTop?e.start+1:e.start}element(e){return this.items[e].element}domElement(e){const n=this.items[e].row;return n&&n.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,n){const r={height:typeof e=="number"?e:Yat(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,r.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(r),typeof n<"u"&&(this.renderWidth=n,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof n=="number"?n:JU(this.domNode)})}render(e,n,r,s,o,a=!1){const l=this.getRenderRange(n,r),c=Ba.relativeComplement(l,e),u=Ba.relativeComplement(e,l),d=this.getNextToLastElement(c);if(a){const h=Ba.intersect(e,l);for(let f=h.start;f<h.end;f++)this.updateItemInDOM(this.items[f],f)}this.cache.transact(()=>{for(const h of u)for(let f=h.start;f<h.end;f++)this.removeItemFromDOM(f);for(const h of c)for(let f=h.start;f<h.end;f++)this.insertItemInDOM(f,d)}),s!==void 0&&(this.rowsContainer.style.left=`-${s}px`),this.rowsContainer.style.top=`-${n}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=n,this.lastRenderHeight=r}insertItemInDOM(e,n,r){const s=this.items[e];let o=!1;if(!s.row)if(r)s.row=r;else{const d=this.cache.alloc(s.templateId);s.row=d.row,o=d.isReusingConnectedDomNode}const a=this.accessibilityProvider.getRole(s.element)||"listitem";s.row.domNode.setAttribute("role",a);const l=this.accessibilityProvider.isChecked(s.element);if(typeof l=="boolean")s.row.domNode.setAttribute("aria-checked",String(!!l));else if(l){const d=h=>s.row.domNode.setAttribute("aria-checked",String(!!h));d(l.value),s.checkedDisposable=l.onDidChange(d)}(o||!s.row.domNode.parentElement)&&(n?this.rowsContainer.insertBefore(s.row.domNode,n):this.rowsContainer.appendChild(s.row.domNode)),this.updateItemInDOM(s,e);const c=this.renderers.get(s.templateId);if(!c)throw new Error(`No renderer found for template id ${s.templateId}`);c==null||c.renderElement(s.element,e,s.row.templateData,s.size);const u=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!u,u&&(s.dragStartDisposable=Be(s.row.domNode,"dragstart",d=>this.onDragStart(s.element,u,d))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=JU(e.row.domNode);const n=window.getComputedStyle(e.row.domNode);n.paddingLeft&&(e.width+=parseFloat(n.paddingLeft)),n.paddingRight&&(e.width+=parseFloat(n.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,n){e.row.domNode.style.top=`${this.elementTop(n)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${n}`),e.row.domNode.setAttribute("data-last-element",n===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",n%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,n,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,n))),e.row.domNode.setAttribute("id",this.getElementDomId(n)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const n=this.items[e];if(n.dragStartDisposable.dispose(),n.checkedDisposable.dispose(),n.row){const r=this.renderers.get(n.templateId);r&&r.disposeElement&&r.disposeElement(n.element,e,n.row.templateData,n.size),this.cache.release(n.row),n.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,n){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:n})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return _t.map(this.disposables.add(new Xn(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return _t.map(this.disposables.add(new Xn(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return _t.filter(_t.map(this.disposables.add(new Xn(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return _t.map(this.disposables.add(new Xn(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return _t.map(this.disposables.add(new Xn(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return _t.map(this.disposables.add(new Xn(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return _t.any(_t.map(this.disposables.add(new Xn(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),_t.map(this.disposables.add(new Xn(this.domNode,lr.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return _t.map(this.disposables.add(new Xn(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return _t.map(this.disposables.add(new Xn(this.rowsContainer,lr.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const n=this.getItemIndexFromEventTarget(e.target||null),r=typeof n>"u"?void 0:this.items[n],s=r&&r.element;return{browserEvent:e,index:n,element:s}}toTouchEvent(e){const n=this.getItemIndexFromEventTarget(e.target||null),r=typeof n>"u"?void 0:this.items[n],s=r&&r.element;return{browserEvent:e,index:n,element:s}}toGestureEvent(e){const n=this.getItemIndexFromEventTarget(e.initialTarget||null),r=typeof n>"u"?void 0:this.items[n],s=r&&r.element;return{browserEvent:e,index:n,element:s}}toDragEvent(e){const n=this.getItemIndexFromEventTarget(e.target||null),r=typeof n>"u"?void 0:this.items[n],s=r&&r.element;return{browserEvent:e,index:n,element:s}}onScroll(e){try{const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(n,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(n){throw console.error("Got bad scroll event:",e),n}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,n,r){var s,o;if(!r.dataTransfer)return;const a=this.dnd.getDragElements(e);if(r.dataTransfer.effectAllowed="copyMove",r.dataTransfer.setData(VP.TEXT,n),r.dataTransfer.setDragImage){let l;this.dnd.getDragLabel&&(l=this.dnd.getDragLabel(a,r)),typeof l>"u"&&(l=String(a.length));const c=tt(".monaco-drag-image");c.textContent=l;const d=(h=>{for(;h&&!h.classList.contains("monaco-workbench");)h=h.parentElement;return h||document.body})(this.domNode);d.appendChild(c),r.dataTransfer.setDragImage(c,-10,-10),setTimeout(()=>d.removeChild(c),0)}this.domNode.classList.add("dragging"),this.currentDragData=new V5(a),iC.CurrentDragAndDropData=new Lbt(a),(o=(s=this.dnd).onDragStart)===null||o===void 0||o.call(s,this.currentDragData,r)}onDragOver(e){var n;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),iC.CurrentDragAndDropData&&iC.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(iC.CurrentDragAndDropData)this.currentDragData=iC.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new Dbt}const r=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof r=="boolean"?r:r.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof r!="boolean"&&r.effect===0?"copy":"move";let s;if(typeof r!="boolean"&&r.feedback?s=r.feedback:typeof e.index>"u"?s=[-1]:s=[e.index],s=l1(s).filter(o=>o>=-1&&o<this.length).sort((o,a)=>o-a),s=s[0]===-1?[-1]:s,Ebt(this.currentDragFeedback,s))return!0;if(this.currentDragFeedback=s,this.currentDragFeedbackDisposable.dispose(),s[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=gn(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const o of s){const a=this.items[o];a.dropTarget=!0,(n=a.row)===null||n===void 0||n.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=gn(()=>{var o;for(const a of s){const l=this.items[a];l.dropTarget=!1,(o=l.row)===null||o===void 0||o.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var n,r;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=g1(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((r=(n=this.dnd).onDragLeave)===null||r===void 0||r.call(n,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const n=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,iC.CurrentDragAndDropData=void 0,!(!n||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),n.update(e.browserEvent.dataTransfer),this.dnd.drop(n,e.element,e.index,e.browserEvent))}onDragEnd(e){var n,r;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,iC.CurrentDragAndDropData=void 0,(r=(n=this.dnd).onDragEnd)===null||r===void 0||r.call(n,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Le.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const n=yEe(this.domNode).top;this.dragOverAnimationDisposable=rlt(this.animateDragAndDropScrollTop.bind(this,n))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=g1(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const n=this.dragOverMouseY-e,r=this.renderHeight-35;n<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(n-35))):n>r&&(this.scrollTop+=Math.min(14,Math.floor(.3*(n-r))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const n=this.scrollableElement.getDomNode();let r=e;for(;r instanceof HTMLElement&&r!==this.rowsContainer&&n.contains(r);){const s=r.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}r=r.parentElement}}getRenderRange(e,n){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+n-1)}}_rerender(e,n,r){const s=this.getRenderRange(e,n);let o,a;e===this.elementTop(s.start)?(o=s.start,a=0):s.end-s.start>1&&(o=s.start+1,a=this.elementTop(o)-e);let l=0;for(;;){const c=this.getRenderRange(e,n);let u=!1;for(let d=c.start;d<c.end;d++){const h=this.probeDynamicHeight(d);h!==0&&this.rangeMap.splice(d,1,[this.items[d]]),l+=h,u=u||h!==0}if(!u){l!==0&&this.eventuallyUpdateScrollDimensions();const d=Ba.relativeComplement(s,c);for(const f of d)for(let p=f.start;p<f.end;p++)this.items[p].row&&this.removeItemFromDOM(p);const h=Ba.relativeComplement(c,s);for(const f of h)for(let p=f.start;p<f.end;p++){const g=p+1,m=g<this.items.length?this.items[g].row:null,_=m?m.domNode:null;this.insertItemInDOM(p,_)}for(let f=c.start;f<c.end;f++)this.items[f].row&&this.updateItemInDOM(this.items[f],f);if(typeof o=="number"){const f=this.scrollable.getFutureScrollPosition().scrollTop-e,p=this.elementTop(o)-a+f;this.setScrollTop(p,r)}this._onDidChangeContentHeight.fire(this.contentHeight);return}}}probeDynamicHeight(e){var n,r,s;const o=this.items[e];if(this.virtualDelegate.getDynamicHeight){const u=this.virtualDelegate.getDynamicHeight(o.element);if(u!==null){const d=o.size;return o.size=u,o.lastDynamicHeightWidth=this.renderWidth,u-d}}if(!o.hasDynamicHeight||o.lastDynamicHeightWidth===this.renderWidth||this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(o.element))return 0;const a=o.size;if(o.row)return o.row.domNode.style.height="",o.size=o.row.domNode.offsetHeight,o.lastDynamicHeightWidth=this.renderWidth,o.size-a;const{row:l}=this.cache.alloc(o.templateId);l.domNode.style.height="",this.rowsContainer.appendChild(l.domNode);const c=this.renderers.get(o.templateId);if(!c)throw new Vs("Missing renderer for templateId: "+o.templateId);return c.renderElement(o.element,e,l.templateData,void 0),o.size=l.domNode.offsetHeight,(n=c.disposeElement)===null||n===void 0||n.call(c,o.element,e,l.templateData,void 0),(s=(r=this.virtualDelegate).setDynamicHeight)===null||s===void 0||s.call(r,o.element,o.size),o.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(l.domNode),this.cache.release(l),o.size-a}getNextToLastElement(e){const n=e[e.length-1];if(!n)return null;const r=this.items[n.end];return!r||!r.row?null:r.row.domNode}getElementDomId(e){return`${this.domId}_${e}`}dispose(){var e,n;for(const r of this.items)if(r.dragStartDisposable.dispose(),r.checkedDisposable.dispose(),r.row){const s=this.renderers.get(r.row.templateId);s&&((e=s.disposeElement)===null||e===void 0||e.call(s,r.element,-1,r.row.templateData,void 0),s.disposeTemplate(r.row.templateData))}this.items=[],this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),(n=this.dragOverAnimationDisposable)===null||n===void 0||n.dispose(),this.disposables.dispose()}}kh.InstanceCount=0;Hv([Ms],kh.prototype,"onMouseClick",null);Hv([Ms],kh.prototype,"onMouseDblClick",null);Hv([Ms],kh.prototype,"onMouseMiddleClick",null);Hv([Ms],kh.prototype,"onMouseDown",null);Hv([Ms],kh.prototype,"onMouseOver",null);Hv([Ms],kh.prototype,"onMouseOut",null);Hv([Ms],kh.prototype,"onContextMenu",null);Hv([Ms],kh.prototype,"onTouchStart",null);Hv([Ms],kh.prototype,"onTap",null);var ek=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Hme=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class Tbt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,n,r){const s=this.renderedElements.findIndex(o=>o.templateData===r);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(r),o.index=n}else{const o={index:n,templateData:r};this.renderedElements.push(o)}this.trait.renderIndex(n,r)}splice(e,n,r){const s=[];for(const o of this.renderedElements)o.index<e?s.push(o):o.index>=e+n&&s.push({index:o.index+r-n,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:n,templateData:r}of this.renderedElements)e.indexOf(n)>-1&&this.trait.renderIndex(n,r)}disposeTemplate(e){const n=this.renderedElements.findIndex(r=>r.templateData===e);n<0||this.renderedElements.splice(n,1)}}let L7=class{get name(){return this._trait}get renderer(){return new Tbt(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new _e,this.onChange=this._onChange.event}splice(e,n,r){var s;n=Math.max(0,Math.min(n,this.length-e));const o=r.length-n,a=e+n,l=[];let c=0;for(;c<this.sortedIndexes.length&&this.sortedIndexes[c]<e;)l.push(this.sortedIndexes[c++]);for(let d=0;d<r.length;d++)r[d]&&l.push(d+e);for(;c<this.sortedIndexes.length&&this.sortedIndexes[c]>=a;)l.push(this.sortedIndexes[c++]+o);const u=this.length+o;if(this.sortedIndexes.length>0&&l.length===0&&u>0){const d=(s=this.sortedIndexes.find(h=>h>=e))!==null&&s!==void 0?s:u-1;l.push(Math.min(d,u-1))}this.renderer.splice(e,n,r.length),this._set(l,l),this.length=u}renderIndex(e,n){n.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,n){return this._set(e,[...e].sort(qme),n)}_set(e,n,r){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=n;const a=kee(o,e);return this.renderer.renderIndexes(a),this._onChange.fire({indexes:e,browserEvent:r}),s}get(){return this.indexes}contains(e){return JM(this.sortedIndexes,e,qme)>=0}dispose(){Mi(this._onChange)}};ek([Ms],L7.prototype,"renderer",null);class Rbt extends L7{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,n){super.renderIndex(e,n),this.setAriaSelected&&(this.contains(e)?n.setAttribute("aria-selected","true"):n.setAttribute("aria-selected","false"))}}class Gq{constructor(e,n,r){this.trait=e,this.view=n,this.identityProvider=r}splice(e,n,r){if(!this.identityProvider)return this.trait.splice(e,n,new Array(r.length).fill(!1));const s=this.trait.get().map(l=>this.identityProvider.getId(this.view.element(l)).toString());if(s.length===0)return this.trait.splice(e,n,new Array(r.length).fill(!1));const o=new Set(s),a=r.map(l=>o.has(this.identityProvider.getId(l).toString()));this.trait.splice(e,n,a)}}function qy(i){return i.tagName==="INPUT"||i.tagName==="TEXTAREA"}function v2(i){return i.classList.contains("monaco-editor")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:v2(i.parentElement)}function YTe(i){return i.tagName==="A"&&i.classList.contains("monaco-button")||i.tagName==="DIV"&&i.classList.contains("monaco-button-dropdown")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:YTe(i.parentElement)}class ZTe{get onKeyDown(){return _t.chain(this.disposables.add(new Xn(this.view.domNode,"keydown")).event,e=>e.filter(n=>!qy(n.target)).map(n=>new yr(n)))}constructor(e,n,r){this.list=e,this.view=n,this.disposables=new Xe,this.multipleSelectionDisposables=new Xe,this.multipleSelectionSupport=r.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case 3:return this.onEnter(s);case 16:return this.onUpArrow(s);case 18:return this.onDownArrow(s);case 11:return this.onPageUpArrow(s);case 12:return this.onPageDownArrow(s);case 9:return this.onEscape(s);case 31:this.multipleSelectionSupport&&(ri?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const n=this.list.getFocus()[0];this.list.setAnchor(n),this.list.reveal(n),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const n=this.list.getFocus()[0];this.list.setAnchor(n),this.list.reveal(n),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const n=this.list.getFocus()[0];this.list.setAnchor(n),this.list.reveal(n),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const n=this.list.getFocus()[0];this.list.setAnchor(n),this.list.reveal(n),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Tl(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}ek([Ms],ZTe.prototype,"onKeyDown",null);var pm;(function(i){i[i.Automatic=0]="Automatic",i[i.Trigger=1]="Trigger"})(pm||(pm={}));var b2;(function(i){i[i.Idle=0]="Idle",i[i.Typing=1]="Typing"})(b2||(b2={}));const Abt=new class{mightProducePrintableCharacter(i){return i.ctrlKey||i.metaKey||i.altKey?!1:i.keyCode>=31&&i.keyCode<=56||i.keyCode>=21&&i.keyCode<=30||i.keyCode>=98&&i.keyCode<=107||i.keyCode>=85&&i.keyCode<=95}};class Nbt{constructor(e,n,r,s,o){this.list=e,this.view=n,this.keyboardNavigationLabelProvider=r,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=b2.Idle,this.mode=pm.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Xe,this.disposables=new Xe,this.updateOptions(e.options)}updateOptions(e){var n,r;!((n=e.typeNavigationEnabled)!==null&&n!==void 0)||n?this.enable():this.disable(),this.mode=(r=e.typeNavigationMode)!==null&&r!==void 0?r:pm.Automatic}enable(){if(this.enabled)return;let e=!1;const n=_t.chain(this.enabledDisposables.add(new Xn(this.view.domNode,"keydown")).event,o=>o.filter(a=>!qy(a.target)).filter(()=>this.mode===pm.Automatic||this.triggered).map(a=>new yr(a)).filter(a=>e||this.keyboardNavigationEventFilter(a)).filter(a=>this.delegate.mightProducePrintableCharacter(a)).forEach(a=>Nn.stop(a,!0)).map(a=>a.browserEvent.key)),r=_t.debounce(n,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);_t.reduce(_t.any(n,r),(o,a)=>a===null?null:(o||"")+a,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),r(this.onClear,this,this.enabledDisposables),n(()=>e=!0,void 0,this.enabledDisposables),r(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const n=this.list.getFocus();if(n.length>0&&n[0]===this.previouslyFocused){const r=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(n[0]));r&&Ua(r)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=b2.Idle,this.triggered=!1;return}const n=this.list.getFocus(),r=n.length>0?n[0]:0,s=this.state===b2.Idle?1:0;this.state=b2.Typing;for(let o=0;o<this.list.length;o++){const a=(r+o+s)%this.list.length,l=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(a)),c=l&&l.toString();if(this.list.options.typeNavigationEnabled){if(typeof c<"u"){if(HP(e,c)){this.previouslyFocused=r,this.list.setFocus([a]),this.list.reveal(a);return}const u=Tvt(e,c);if(u&&u[0].end-u[0].start>1&&u.length===1){this.previouslyFocused=r,this.list.setFocus([a]),this.list.reveal(a);return}}}else if(typeof c>"u"||HP(e,c)){this.previouslyFocused=r,this.list.setFocus([a]),this.list.reveal(a);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Mbt{constructor(e,n){this.list=e,this.view=n,this.disposables=new Xe;const r=_t.chain(this.disposables.add(new Xn(n.domNode,"keydown")).event,o=>o.filter(a=>!qy(a.target)).map(a=>new yr(a)));_t.chain(r,o=>o.filter(a=>a.keyCode===2&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&!a.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const n=this.list.getFocus();if(n.length===0)return;const r=this.view.domElement(n[0]);if(!r)return;const s=r.querySelector("[tabIndex]");if(!s||!(s instanceof HTMLElement)||s.tabIndex===-1)return;const o=window.getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function QTe(i){return ri?i.browserEvent.metaKey:i.browserEvent.ctrlKey}function JTe(i){return i.browserEvent.shiftKey}function Pbt(i){return i instanceof MouseEvent&&i.button===2}const Ume={isSelectionSingleChangeEvent:QTe,isSelectionRangeChangeEvent:JTe};class eRe{constructor(e){this.list=e,this.disposables=new Xe,this._onPointer=new _e,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Ume),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(or.addTarget(e.getHTMLElement()))),_t.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Ume))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){v2(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(qy(e.browserEvent.target)||v2(e.browserEvent.target))return;const n=typeof e.index>"u"?[]:[e.index];this.list.setFocus(n,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||qy(e.browserEvent.target)||v2(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const n=e.index;if(typeof n>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([n],e.browserEvent),this.list.setAnchor(n),Pbt(e.browserEvent)||this.list.setSelection([n],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(qy(e.browserEvent.target)||v2(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const n=this.list.getFocus();this.list.setSelection(n,e.browserEvent)}changeSelection(e){const n=e.index;let r=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof r>"u"){const d=this.list.getFocus()[0];r=d??n,this.list.setAnchor(r)}const s=Math.min(r,n),o=Math.max(r,n),a=Tl(s,o+1),l=this.list.getSelection(),c=Bbt(kee(l,[r]),r);if(c.length===0)return;const u=kee(a,jbt(l,c));this.list.setSelection(u,e.browserEvent),this.list.setFocus([n],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(a=>a!==n);this.list.setFocus([n]),this.list.setAnchor(n),s.length===o.length?this.list.setSelection([...o,n],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class tRe{constructor(e,n){this.styleElement=e,this.selectorSuffix=n}style(e){var n,r;const s=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${s} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(`
.monaco-drag-image,
.monaco-list${s}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
`),e.listFocusAndSelectionForeground&&o.push(`
.monaco-drag-image,
.monaco-list${s}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
`),e.listInactiveFocusForeground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${s} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${s} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${s} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const a=MS(e.listFocusAndSelectionOutline,MS(e.listSelectionOutline,(n=e.listFocusOutline)!==null&&n!==void 0?n:""));a&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused.selected { outline: 1px solid ${a}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(`
.monaco-drag-image,
.monaco-list${s}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
.monaco-workbench.context-menu-visible .monaco-list${s}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
`);const l=MS(e.listSelectionOutline,(r=e.listInactiveFocusOutline)!==null&&r!==void 0?r:"");l&&o.push(`.monaco-list${s} .monaco-list-row.focused.selected { outline: 1px dotted ${l}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${s} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${s} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${s} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(`
.monaco-list${s}.drop-target,
.monaco-list${s} .monaco-list-rows.drop-target,
.monaco-list${s} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }
`),e.tableColumnsBorder&&o.push(`
.monaco-table > .monaco-split-view2,
.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
border-color: ${e.tableColumnsBorder};
}
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
border-color: transparent;
}
`),e.tableOddRowsBackgroundColor&&o.push(`
.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
background-color: ${e.tableOddRowsBackgroundColor};
}
`),this.styleElement.textContent=o.join(`
`)}}const Obt={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:Te.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Te.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Te.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},Fbt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Bbt(i,e){const n=i.indexOf(e);if(n===-1)return[];const r=[];let s=n-1;for(;s>=0&&i[s]===e-(n-s);)r.push(i[s--]);for(r.reverse(),s=n;s<i.length&&i[s]===e+(s-n);)r.push(i[s++]);return r}function kee(i,e){const n=[];let r=0,s=0;for(;r<i.length||s<e.length;)if(r>=i.length)n.push(e[s++]);else if(s>=e.length)n.push(i[r++]);else if(i[r]===e[s]){n.push(i[r]),r++,s++;continue}else i[r]<e[s]?n.push(i[r++]):n.push(e[s++]);return n}function jbt(i,e){const n=[];let r=0,s=0;for(;r<i.length||s<e.length;)if(r>=i.length)n.push(e[s++]);else if(s>=e.length)n.push(i[r++]);else if(i[r]===e[s]){r++,s++;continue}else i[r]<e[s]?n.push(i[r++]):s++;return n}const qme=(i,e)=>i-e;class Wbt{constructor(e,n){this._templateId=e,this.renderers=n}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(n=>n.renderTemplate(e))}renderElement(e,n,r,s){let o=0;for(const a of this.renderers)a.renderElement(e,n,r[o++],s)}disposeElement(e,n,r,s){var o;let a=0;for(const l of this.renderers)(o=l.disposeElement)===null||o===void 0||o.call(l,e,n,r[a],s),a+=1}disposeTemplate(e){let n=0;for(const r of this.renderers)r.disposeTemplate(e[n++])}}class $bt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,n,r){const s=this.accessibilityProvider.getAriaLabel(e);s?r.setAttribute("aria-label",s):r.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?r.setAttribute("aria-level",`${o}`):r.removeAttribute("aria-level")}disposeTemplate(e){}}class zbt{constructor(e,n){this.list=e,this.dnd=n}getDragElements(e){const n=this.list.getSelectedElements();return n.indexOf(e)>-1?n:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,n){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,n)}onDragStart(e,n){var r,s;(s=(r=this.dnd).onDragStart)===null||s===void 0||s.call(r,e,n)}onDragOver(e,n,r,s){return this.dnd.onDragOver(e,n,r,s)}onDragLeave(e,n,r,s){var o,a;(a=(o=this.dnd).onDragLeave)===null||a===void 0||a.call(o,e,n,r,s)}onDragEnd(e){var n,r;(r=(n=this.dnd).onDragEnd)===null||r===void 0||r.call(n,e)}drop(e,n,r,s){this.dnd.drop(e,n,r,s)}dispose(){this.dnd.dispose()}}class Bf{get onDidChangeFocus(){return _t.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return _t.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const n=_t.chain(this.disposables.add(new Xn(this.view.domNode,"keydown")).event,o=>o.map(a=>new yr(a)).filter(a=>e=a.keyCode===58||a.shiftKey&&a.keyCode===68).map(a=>Nn.stop(a,!0)).filter(()=>!1)),r=_t.chain(this.disposables.add(new Xn(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(a=>new yr(a)).filter(a=>a.keyCode===58||a.shiftKey&&a.keyCode===68).map(a=>Nn.stop(a,!0)).map(({browserEvent:a})=>{const l=this.getFocus(),c=l.length?l[0]:void 0,u=typeof c<"u"?this.view.element(c):void 0,d=typeof c<"u"?this.view.domElement(c):this.view.domNode;return{index:c,element:u,anchor:d,browserEvent:a}})),s=_t.chain(this.view.onContextMenu,o=>o.filter(a=>!e).map(({element:a,index:l,browserEvent:c})=>({element:a,index:l,anchor:new rh(c),browserEvent:c})));return _t.any(n,r,s)}get onKeyDown(){return this.disposables.add(new Xn(this.view.domNode,"keydown")).event}get onDidFocus(){return _t.signal(this.disposables.add(new Xn(this.view.domNode,"focus",!0)).event)}constructor(e,n,r,s,o=Fbt){var a,l,c,u;this.user=e,this._options=o,this.focus=new L7("focused"),this.anchor=new L7("anchor"),this.eventBufferer=new Pse,this._ariaLabel="",this.disposables=new Xe,this._onDidDispose=new _e,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(a=this._options.accessibilityProvider)===null||a===void 0?void 0:a.getWidgetRole():"list";this.selection=new Rbt(d!=="listbox");const h=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(h.push(new $bt(this.accessibilityProvider)),(c=(l=this.accessibilityProvider).onDidChangeActiveDescendant)===null||c===void 0||c.call(l,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(p=>new Wbt(p.templateId,[...h,p]));const f=Object.assign(Object.assign({},o),{dnd:o.dnd&&new zbt(this,o.dnd)});if(this.view=this.createListView(n,r,s,f),this.view.domNode.setAttribute("role",d),o.styleController)this.styleController=o.styleController(this.view.domId);else{const p=_h(this.view.domNode);this.styleController=new tRe(p,this.view.domId)}if(this.spliceable=new wbt([new Gq(this.focus,this.view,o.identityProvider),new Gq(this.selection,this.view,o.identityProvider),new Gq(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new Mbt(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new ZTe(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const p=o.keyboardNavigationDelegate||Abt;this.typeNavigationController=new Nbt(this,this.view,o.keyboardNavigationLabelProvider,(u=o.keyboardNavigationEventFilter)!==null&&u!==void 0?u:()=>!0,p),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,n,r,s){return new kh(e,n,r,s)}createMouseController(e){return new eRe(this)}updateOptions(e={}){var n,r;this._options=Object.assign(Object.assign({},this._options),e),(n=this.typeNavigationController)===null||n===void 0||n.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(r=this.keyboardController)===null||r===void 0||r.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,n,r=[]){if(e<0||e>this.view.length)throw new rD(this.user,`Invalid start index: ${e}`);if(n<0)throw new rD(this.user,`Invalid delete count: ${n}`);n===0&&r.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,n,r))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,n){this.view.layout(e,n)}setSelection(e,n){for(const r of e)if(r<0||r>=this.length)throw new rD(this.user,`Invalid index ${r}`);this.selection.set(e,n)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new rD(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return g2e(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,n){for(const r of e)if(r<0||r>=this.length)throw new rD(this.user,`Invalid index ${r}`);this.focus.set(e,n)}focusNext(e=1,n=!1,r,s){if(this.length===0)return;const o=this.focus.get(),a=this.findNextIndex(o.length>0?o[0]+e:0,n,s);a>-1&&this.setFocus([a],r)}focusPrevious(e=1,n=!1,r,s){if(this.length===0)return;const o=this.focus.get(),a=this.findPreviousIndex(o.length>0?o[0]-e:0,n,s);a>-1&&this.setFocus([a],r)}focusNextPage(e,n){return Hme(this,void 0,void 0,function*(){let r=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);r=r===0?0:r-1;const s=this.getFocus()[0];if(s!==r&&(s===void 0||r>s)){const o=this.findPreviousIndex(r,!1,n);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([r],e)}else{const o=this.view.getScrollTop();let a=o+this.view.renderHeight;r>s&&(a-=this.view.elementHeight(r)),this.view.setScrollTop(a),this.view.getScrollTop()!==o&&(this.setFocus([]),yield p1(0),yield this.focusNextPage(e,n))}})}focusPreviousPage(e,n){return Hme(this,void 0,void 0,function*(){let r;const s=this.view.getScrollTop();s===0?r=this.view.indexAt(s):r=this.view.indexAfter(s-1);const o=this.getFocus()[0];if(o!==r&&(o===void 0||o>=r)){const a=this.findNextIndex(r,!1,n);a>-1&&o!==a?this.setFocus([a],e):this.setFocus([r],e)}else{const a=s;this.view.setScrollTop(s-this.view.renderHeight),this.view.getScrollTop()!==a&&(this.setFocus([]),yield p1(0),yield this.focusPreviousPage(e,n))}})}focusLast(e,n){if(this.length===0)return;const r=this.findPreviousIndex(this.length-1,!1,n);r>-1&&this.setFocus([r],e)}focusFirst(e,n){this.focusNth(0,e,n)}focusNth(e,n,r){if(this.length===0)return;const s=this.findNextIndex(e,!1,r);s>-1&&this.setFocus([s],n)}findNextIndex(e,n=!1,r){for(let s=0;s<this.length;s++){if(e>=this.length&&!n)return-1;if(e=e%this.length,!r||r(this.element(e)))return e;e++}return-1}findPreviousIndex(e,n=!1,r){for(let s=0;s<this.length;s++){if(e<0&&!n)return-1;if(e=(this.length+e%this.length)%this.length,!r||r(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map(e=>this.view.element(e))}reveal(e,n){if(e<0||e>=this.length)throw new rD(this.user,`Invalid index ${e}`);const r=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(c1(n)){const a=o-this.view.renderHeight;this.view.setScrollTop(a*Kc(n,0,1)+s)}else{const a=s+o,l=r+this.view.renderHeight;s<r&&a>=l||(s<r||a>=l&&o>=this.view.renderHeight?this.view.setScrollTop(s):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:n}){return{indexes:e,elements:e.map(r=>this.view.element(r)),browserEvent:n}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const n=this.focus.get();if(n.length>0){let r;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(r=this.accessibilityProvider.getActiveDescendantId(this.view.element(n[0]))),this.view.domNode.setAttribute("aria-activedescendant",r||this.view.getElementDomId(n[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}ek([Ms],Bf.prototype,"onDidChangeFocus",null);ek([Ms],Bf.prototype,"onDidChangeSelection",null);ek([Ms],Bf.prototype,"onContextMenu",null);ek([Ms],Bf.prototype,"onKeyDown",null);ek([Ms],Bf.prototype,"onDidFocus",null);const wS=tt,nRe="selectOption.entry.template";class Vbt{get templateId(){return nRe}renderTemplate(e){const n=Object.create(null);return n.root=e,n.text=He(e,wS(".option-text")),n.detail=He(e,wS(".option-detail")),n.decoratorRight=He(e,wS(".option-decorator-right")),n}renderElement(e,n,r){const s=r,o=e.text,a=e.detail,l=e.decoratorRight,c=e.isDisabled;s.text.textContent=o,s.detail.textContent=a||"",s.decoratorRight.innerText=l||"",c?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}class gm extends Le{constructor(e,n,r,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=gm.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new _e,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(r),this.selected=n||0,e&&this.setOptions(e,n),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return nRe}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=tt(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=He(this.selectDropDownContainer,wS(".select-box-details-pane"));const n=He(this.selectDropDownContainer,wS(".select-box-dropdown-container-width-control")),r=He(n,wS(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",He(r,this.widthControlElement),this._dropDownPosition=0,this.styleElement=_h(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(Be(this.selectDropDownContainer,ht.DRAG_START,s=>{Nn.stop(s,!0)}))}registerListeners(){this._register(As(this.selectElement,"change",n=>{this.selected=n.target.selectedIndex,this._onDidSelect.fire({index:n.target.selectedIndex,selected:n.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)})),this._register(Be(this.selectElement,ht.CLICK,n=>{Nn.stop(n),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(Be(this.selectElement,ht.MOUSE_DOWN,n=>{Nn.stop(n)}));let e;this._register(Be(this.selectElement,"touchstart",n=>{e=this._isVisible})),this._register(Be(this.selectElement,"touchend",n=>{Nn.stop(n),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(Be(this.selectElement,ht.KEY_DOWN,n=>{const r=new yr(n);let s=!1;ri?(r.keyCode===18||r.keyCode===16||r.keyCode===10||r.keyCode===3)&&(s=!0):(r.keyCode===18&&r.altKey||r.keyCode===16&&r.altKey||r.keyCode===10||r.keyCode===3)&&(s=!0),s&&(this.showSelectDropDown(),Nn.stop(n,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,n){ys(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((r,s)=>{this.selectElement.add(this.createOption(r.text,s,r.isDisabled)),typeof r.description=="string"&&(this._hasDetails=!0)})),n!==void 0&&(this.select(n),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(`
`)}styleSelectElement(){var e,n,r;const s=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(n=this.styles.selectForeground)!==null&&n!==void 0?n:"",a=(r=this.styles.selectBorder)!==null&&r!==void 0?r:"";this.selectElement.style.backgroundColor=s,this.selectElement.style.color=o,this.selectElement.style.borderColor=a}styleList(){var e,n;const r=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",s=MS(this.styles.selectListBackground,r);this.selectDropDownListContainer.style.backgroundColor=s,this.selectionDetailsPane.style.backgroundColor=s;const o=(n=this.styles.focusBorder)!==null&&n!==void 0?n:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,n,r){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!r,s}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,n){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(n),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((n,r)=>{this.updateDetail(r),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const n=no(this.selectElement),r=getComputedStyle(this.selectElement),s=parseFloat(r.getPropertyValue("--dropdown-padding-top"))+parseFloat(r.getPropertyValue("--dropdown-padding-bottom")),o=window.innerHeight-n.top-n.height-(this.selectBoxOptions.minBottomMargin||0),a=n.top-gm.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),u=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=u,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const h=this._hasDetails?this._cachedMaxDetailsHeight:0,f=d+s+h,p=Math.floor((o-s-h)/this.getHeight()),g=Math.floor((a-s-h)/this.getHeight());if(e)return n.top+n.height>window.innerHeight-22||n.top<gm.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||p<1&&g<1?!1:(p<gm.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&g>p&&this.options.length>p?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(n.top+n.height>window.innerHeight-22||n.top<gm.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||this._dropDownPosition===0&&p<1||this._dropDownPosition===1&&g<1)return this.hideSelectDropDown(!0),!1;if(this._dropDownPosition===0){if(this._isVisible&&p+g<1)return this.hideSelectDropDown(!0),!1;f>o&&(d=p*this.getHeight())}else f>a&&(d=g*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=u,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let n=0;if(e){let r=0,s=0;this.options.forEach((o,a)=>{const l=o.detail?o.detail.length:0,c=o.decoratorRight?o.decoratorRight.length:0,u=o.text.length+l+c;u>s&&(r=a,s=u)}),e.textContent=this.options[r].text+(this.options[r].decoratorRight?this.options[r].decoratorRight+" ":""),n=dc(e)}return n}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=He(e,wS(".select-box-dropdown-list-container")),this.listRenderer=new Vbt,this.selectList=new Bf("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>L({},"Select Box"),getRole:()=>ri?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const n=this._register(new Xn(this.selectDropDownListContainer,"keydown")),r=_t.chain(n.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new yr(o)));this._register(_t.chain(r,s=>s.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(_t.chain(r,s=>s.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(_t.chain(r,s=>s.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(_t.chain(r,s=>s.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(_t.chain(r,s=>s.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(_t.chain(r,s=>s.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(_t.chain(r,s=>s.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(_t.chain(r,s=>s.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(_t.chain(r,s=>s.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(_t.chain(r,s=>s.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(Be(this.selectList.getHTMLElement(),ht.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(Be(this.selectDropDownContainer,ht.FOCUS_OUT,s=>{!this._isVisible||Ia(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Nn.stop(e);const n=e.target;if(!n||n.classList.contains("slider"))return;const r=n.closest(".monaco-list-row");if(!r)return;const s=Number(r.getAttribute("data-index")),o=r.classList.contains("option-disabled");s>=0&&s<this.options.length&&!o&&(this.selected=s,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,n){const r=o=>{for(let a=0;a<o.childNodes.length;a++){const l=o.childNodes.item(a);(l.tagName&&l.tagName.toLowerCase())==="img"?o.removeChild(l):r(l)}},s=H$({value:e,supportThemeIcons:!0},{actionHandler:n});return s.element.classList.add("select-box-description-markdown"),r(s.element),s.element}onListFocus(e){!this._isVisible||!this._hasDetails||this.updateDetail(e.indexes[0])}updateDetail(e){var n,r;this.selectionDetailsPane.innerText="";const s=this.options[e],o=(n=s==null?void 0:s.description)!==null&&n!==void 0?n:"",a=(r=s==null?void 0:s.descriptionIsMarkdown)!==null&&r!==void 0?r:!1;if(o){if(a){const l=s.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(o,l))}else this.selectionDetailsPane.innerText=o;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){Nn.stop(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){Nn.stop(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){Nn.stop(e,!0);const n=this.options[this.selected+1].isDisabled;if(n&&this.options.length>this.selected+2)this.selected+=2;else{if(n)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(Nn.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){Nn.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onPageDown(e){Nn.stop(e),this.selectList.focusNextPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){Nn.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Nn.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const n=W0.toString(e.keyCode);let r=-1;for(let s=0;s<this.options.length-1;s++)if(r=(s+this.selected+1)%this.options.length,this.options[r].text.charAt(0).toUpperCase()===n&&!this.options[r].isDisabled){this.select(r),this.selectList.setFocus([r]),this.selectList.reveal(this.selectList.getFocus()[0]),Nn.stop(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}gm.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32;gm.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2;gm.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;class Hbt extends Le{constructor(e,n,r,s){super(),this.selected=0,this.selectBoxOptions=s||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new _e),this.styles=r,this.registerListeners(),this.setOptions(e,n)}registerListeners(){this._register(or.addTarget(this.selectElement)),[lr.Tap].forEach(e=>{this._register(Be(this.selectElement,e,n=>{this.selectElement.focus()}))}),this._register(As(this.selectElement,"click",e=>{Nn.stop(e,!0)})),this._register(As(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(As(this.selectElement,"keydown",e=>{let n=!1;ri?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(n=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(n=!0),n&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,n){(!this.options||!ys(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((r,s)=>{this.selectElement.add(this.createOption(r.text,s,r.isDisabled))})),n!==void 0&&this.select(n)}select(e){this.options.length===0?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&typeof this.options[this.selected].text=="string"?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){var e,n,r;this.selectElement&&(this.selectElement.style.backgroundColor=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",this.selectElement.style.color=(n=this.styles.selectForeground)!==null&&n!==void 0?n:"",this.selectElement.style.borderColor=(r=this.styles.selectBorder)!==null&&r!==void 0?r:"")}createOption(e,n,r){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!r,s}}class Ubt extends Pf{constructor(e,n,r,s,o){super(),ri&&!(o!=null&&o.useCustomDrawn)?this.selectBoxDelegate=new Hbt(e,n,s,o):this.selectBoxDelegate=new gm(e,n,r,s,o),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,n){this.selectBoxDelegate.setOptions(e,n)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}}class xp extends Le{get action(){return this._action}constructor(e,n,r={}){super(),this.options=r,this._context=e||this,this._action=n,n instanceof Vl&&this._register(n.onDidChange(s=>{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new AE)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const n=this.element=e;this._register(or.addTarget(e));const r=this.options&&this.options.draggable;r&&(e.draggable=!0,gh&&this._register(Be(e,ht.DRAG_START,s=>{var o;return(o=s.dataTransfer)===null||o===void 0?void 0:o.setData(VP.TEXT,this._action.label)}))),this._register(Be(n,lr.Tap,s=>this.onClick(s,!0))),this._register(Be(n,ht.MOUSE_DOWN,s=>{r||Nn.stop(s,!0),this._action.enabled&&s.button===0&&n.classList.add("active")})),ri&&this._register(Be(n,ht.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(Be(n,ht.CLICK,s=>{Nn.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(Be(n,ht.DBLCLICK,s=>{Nn.stop(s,!0)})),[ht.MOUSE_UP,ht.MOUSE_OUT].forEach(s=>{this._register(Be(n,s,o=>{Nn.stop(o),n.classList.remove("active")}))})}onClick(e,n=!1){var r;Nn.stop(e,!0);const s=Hu(this._context)?!((r=this.options)===null||r===void 0)&&r.useEventAsContext?e:{preserveFocus:n}:this._context;this.actionRunner.run(this._action,s)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const n=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(n):(this.customHover=GTe(this.options.hoverDelegate,this.element,n),this._store.add(this.customHover))):this.element.title=n}updateAriaLabel(){var e;if(this.element){const n=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",n)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class ZE extends xp{constructor(e,n,r){super(e,n,r),this.options=r,this.options.icon=r.icon!==void 0?r.icon:!1,this.options.label=r.label!==void 0?r.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=He(this.element,tt("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(He(this.element,tt("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Vo.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=L({},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,n;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(n=this.element)===null||n===void 0||n.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const n=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",n)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class qbt extends xp{constructor(e,n,r,s,o,a,l){super(e,n),this.selectBox=new Ubt(r,s,o,a,l),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,n){this.actionRunner.run(this._action,this.getActionContext(e,n))}getActionContext(e,n){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class Kbt extends AE{constructor(e,n){super(),this._onDidChangeVisibility=this._register(new _e),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=He(e,tt(".monaco-dropdown")),this._label=He(this._element,tt(".dropdown-label"));let r=n.labelRenderer;r||(r=o=>(o.textContent=n.label||"",null));for(const o of[ht.CLICK,ht.MOUSE_DOWN,lr.Tap])this._register(Be(this.element,o,a=>Nn.stop(a,!0)));for(const o of[ht.MOUSE_DOWN,lr.Tap])this._register(Be(this._label,o,a=>{a instanceof MouseEvent&&(a.detail>1||a.button!==0)||(this.visible?this.hide():this.show())}));this._register(Be(this._label,ht.KEY_UP,o=>{const a=new yr(o);(a.equals(3)||a.equals(10))&&(Nn.stop(o,!0),this.visible?this.hide():this.show())}));const s=r(this._label);s&&this._register(s),this._register(or.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class Gbt extends Kbt{constructor(e,n){super(e,n),this._options=n,this._actions=[],this.actions=n.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,n)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,n):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class D7 extends xp{constructor(e,n,r,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new _e),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=n,this.contextMenuProvider=r,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const n=o=>{this.element=He(o,tt("a.action-label"));let a=[];return typeof this.options.classNames=="string"?a=this.options.classNames.split(/\s+/g).filter(l=>!!l):this.options.classNames&&(a=this.options.classNames),a.find(l=>l==="icon")||a.push("codicon"),this.element.classList.add(...a),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},r=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:n,menuAsChild:this.options.menuAsChild,actions:r?this.menuActionsOrProvider:void 0,actionProvider:r?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Gbt(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var a;(a=this.element)===null||a===void 0||a.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return o.options.anchorAlignmentProvider()}})}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,n;const r=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",r),(n=this.element)===null||n===void 0||n.classList.toggle("disabled",r)}}function Xbt(i){return i?i.condition!==void 0:!1}var yN=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},tE;(function(i){i[i.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",i[i.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(tE||(tE={}));var y2;(function(i){i[i.None=0]="None",i[i.Initialized=1]="Initialized",i[i.Closed=2]="Closed"})(y2||(y2={}));class nE extends Le{constructor(e,n=Object.create(null)){super(),this.database=e,this.options=n,this._onDidChangeStorage=this._register(new sx),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=y2.None,this.cache=new Map,this.flushDelayer=this._register(new AEe(nE.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var n,r;this._onDidChangeStorage.pause();try{(n=e.changed)===null||n===void 0||n.forEach((s,o)=>this.acceptExternal(o,s)),(r=e.deleted)===null||r===void 0||r.forEach(s=>this.acceptExternal(s,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,n){if(this.state===y2.Closed)return;let r=!1;Hu(n)?r=this.cache.delete(e):this.cache.get(e)!==n&&(this.cache.set(e,n),r=!0),r&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,n){const r=this.cache.get(e);return Hu(r)?n:r}getBoolean(e,n){const r=this.get(e);return Hu(r)?n:r==="true"}getNumber(e,n){const r=this.get(e);return Hu(r)?n:parseInt(r,10)}set(e,n,r=!1){return yN(this,void 0,void 0,function*(){if(this.state===y2.Closed)return;if(Hu(n))return this.delete(e,r);const s=Bl(n)||Array.isArray(n)?nbt(n):String(n);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:r}),this.doFlush()})}delete(e,n=!1){return yN(this,void 0,void 0,function*(){if(!(this.state===y2.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return yN(this,void 0,void 0,function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var n;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(n=this.whenFlushedCallbacks.pop())===null||n===void 0||n()})})}doFlush(e){return yN(this,void 0,void 0,function*(){return this.options.hint===tE.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}nE.DEFAULT_FLUSH_DELAY=100;class Xq{constructor(){this.onDidChangeItemsExternal=_t.None,this.items=new Map}updateItems(e){var n,r;return yN(this,void 0,void 0,function*(){(n=e.insert)===null||n===void 0||n.forEach((s,o)=>this.items.set(o,s)),(r=e.delete)===null||r===void 0||r.forEach(s=>this.items.delete(s))})}}const C8="__$__targetStorageMarker",jf=qn("storageService");var E7;(function(i){i[i.NONE=0]="NONE",i[i.SHUTDOWN=1]="SHUTDOWN"})(E7||(E7={}));function Ybt(i){const e=i.get(C8);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class U$ extends Le{constructor(e={flushInterval:U$.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new sx),this._onDidChangeTarget=this._register(new sx),this._onWillSaveState=this._register(new _e),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,n,r){return _t.filter(this._onDidChangeValue.event,s=>s.scope===e&&(n===void 0||s.key===n),r)}emitDidChangeValue(e,n){const{key:r,external:s}=n;if(r===C8){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:r,target:this.getKeyTargets(e)[r],external:s})}get(e,n,r){var s;return(s=this.getStorage(n))===null||s===void 0?void 0:s.get(e,r)}getBoolean(e,n,r){var s;return(s=this.getStorage(n))===null||s===void 0?void 0:s.getBoolean(e,r)}getNumber(e,n,r){var s;return(s=this.getStorage(n))===null||s===void 0?void 0:s.getNumber(e,r)}store(e,n,r,s,o=!1){if(Hu(n)){this.remove(e,r,o);return}this.withPausedEmitters(()=>{var a;this.updateKeyTarget(e,r,s),(a=this.getStorage(r))===null||a===void 0||a.set(e,n,o)})}remove(e,n,r=!1){this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,n,void 0),(s=this.getStorage(n))===null||s===void 0||s.delete(e,r)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,n,r,s=!1){var o,a;const l=this.getKeyTargets(n);typeof r=="number"?l[e]!==r&&(l[e]=r,(o=this.getStorage(n))===null||o===void 0||o.set(C8,JSON.stringify(l),s)):typeof l[e]=="number"&&(delete l[e],(a=this.getStorage(n))===null||a===void 0||a.set(C8,JSON.stringify(l),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const n=this.getStorage(e);return n?Ybt(n):Object.create(null)}}U$.DEFAULT_FLUSH_INTERVAL=60*1e3;class Zbt extends U${constructor(){super(),this.applicationStorage=this._register(new nE(new Xq,{hint:tE.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new nE(new Xq,{hint:tE.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new nE(new Xq,{hint:tE.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function Qbt(i,e){const n=Object.assign({},e);for(const r in i){const s=i[r];n[r]=s!==void 0?wt(s):void 0}return n}const Jbt={keybindingLabelBackground:wt(Pdt),keybindingLabelForeground:wt(Odt),keybindingLabelBorder:wt(Fdt),keybindingLabelBottomBorder:wt(Bdt),keybindingLabelShadow:wt(bm)},eyt={buttonForeground:wt(aN),buttonSeparator:wt(wdt),buttonBackground:wt(lN),buttonHoverBackground:wt(Cdt),buttonSecondaryForeground:wt(xdt),buttonSecondaryBackground:wt(DJ),buttonSecondaryHoverBackground:wt(kdt),buttonBorder:wt(Sdt)},tyt={progressBarBackground:wt(Edt)},I7={inputActiveOptionBorder:wt(goe),inputActiveOptionForeground:wt(moe),inputActiveOptionBackground:wt(mS)};wt(_ht),wt(bht),wt(vht);wt(cs),wt(Cm),wt(bm),wt(Jn),wt(Pht),wt(Oht),wt(Fht),wt(udt);const T7={inputBackground:wt(uIe),inputForeground:wt(dIe),inputBorder:wt(hIe),inputValidationInfoBorder:wt(fdt),inputValidationInfoBackground:wt(ddt),inputValidationInfoForeground:wt(hdt),inputValidationWarningBorder:wt(mdt),inputValidationWarningBackground:wt(pdt),inputValidationWarningForeground:wt(gdt),inputValidationErrorBorder:wt(bdt),inputValidationErrorBackground:wt(_dt),inputValidationErrorForeground:wt(vdt)},nyt={listFilterWidgetBackground:wt(uht),listFilterWidgetOutline:wt(dht),listFilterWidgetNoMatchesOutline:wt(hht),listFilterWidgetShadow:wt(fht),inputBoxStyles:T7,toggleStyles:I7},iRe={badgeBackground:wt(f8),badgeForeground:wt(Ldt),badgeBorder:wt(Jn)};wt(Eht),wt(Dht),wt(age),wt(age),wt(Iht);const tk={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:wt(eht),listFocusForeground:wt(tht),listFocusOutline:wt(nht),listActiveSelectionBackground:wt(nv),listActiveSelectionForeground:wt(km),listActiveSelectionIconForeground:wt(hN),listFocusAndSelectionOutline:wt(iht),listFocusAndSelectionBackground:wt(nv),listFocusAndSelectionForeground:wt(km),listInactiveSelectionBackground:wt(rht),listInactiveSelectionIconForeground:wt(oht),listInactiveSelectionForeground:wt(sht),listInactiveFocusBackground:wt(aht),listInactiveFocusOutline:wt(lht),listHoverBackground:wt(gIe),listHoverForeground:wt(mIe),listDropBackground:wt(cht),listSelectionOutline:wt(Dr),listHoverOutline:wt(Dr),treeIndentGuidesStroke:wt(fN),treeInactiveIndentGuidesStroke:wt(pht),tableColumnsBorder:wt(ght),tableOddRowsBackgroundColor:wt(mht)};function HI(i){return Qbt(i,tk)}const iyt={selectBackground:wt(ym),selectListBackground:wt(ydt),selectForeground:wt(J0),decoratorRightForeground:wt(fIe),selectBorder:wt(a2),focusBorder:wt(Qu),listFocusBackground:wt(vS),listInactiveSelectionIconForeground:wt(l2),listFocusForeground:wt(_S),listFocusOutline:adt(Dr,Te.transparent.toString()),listHoverBackground:wt(gIe),listHoverForeground:wt(mIe),listHoverOutline:wt(Dr),selectListBorder:wt(Sm),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0},ryt={shadowColor:wt(bm),borderColor:wt(yht),foregroundColor:wt(wht),backgroundColor:wt(Cht),selectionForegroundColor:wt(Sht),selectionBackgroundColor:wt(xht),selectionBorderColor:wt(kht),separatorColor:wt(Lht),scrollbarShadow:wt(Ddt),scrollbarSliderBackground:wt(cN),scrollbarSliderHoverBackground:wt(uN),scrollbarSliderActiveBackground:wt(dN)};var q$=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},gc=function(i,e){return function(n,r){e(n,r,i)}},rRe=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function syt(i,e,n,r){const s=i.getActions(e),o=Y0.getInstance(),a=o.keyStatus.altKey||(Aa||_l)&&o.keyStatus.shiftKey;oRe(s,n,a,l=>l==="navigation")}function sRe(i,e,n,r,s,o){const a=i.getActions(e);oRe(a,n,!1,typeof r=="string"?c=>c===r:r,s,o)}function oRe(i,e,n,r=a=>a==="navigation",s=()=>!1,o=!1){let a,l;Array.isArray(e)?(a=e,l=e):(a=e.primary,l=e.secondary);const c=new Set;for(const[u,d]of i){let h;r(u)?(h=a,h.length>0&&o&&h.push(new Vo)):(h=l,h.length>0&&h.push(new Vo));for(let f of d){n&&(f=f instanceof If&&f.alt?f.alt:f);const p=h.push(f);f instanceof NE&&c.add({group:u,action:f,index:p-1})}}for(const{group:u,action:d,index:h}of c){const f=r(u)?a:l,p=d.actions;s(d,u,f.length)&&f.splice(h,1,...p)}}let mx=class extends ZE{constructor(e,n,r,s,o,a,l,c){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:n==null?void 0:n.draggable,keybinding:n==null?void 0:n.keybinding,hoverDelegate:n==null?void 0:n.hoverDelegate}),this._keybindingService=r,this._notificationService=s,this._contextKeyService=o,this._themeService=a,this._contextMenuService=l,this._accessibilityService=c,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new ha),this._altKey=Y0.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return rRe(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(n){this._notificationService.error(n)}})}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let n=!1;const r=()=>{var s;const o=!!(!((s=this._menuItemAction.alt)===null||s===void 0)&&s.enabled)&&(!this._accessibilityService.isMotionReduced()||n)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&n);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(r)),this._register(Be(e,"mouseleave",s=>{n=!1,r()})),this._register(Be(e,"mouseenter",s=>{n=!0,r()})),r()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const n=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),r=n&&n.getLabel(),s=this._commandAction.tooltip||this._commandAction.label;let o=r?L("titleAndKb","{0} ({1})",s,r):s;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const a=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,l=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),c=l&&l.getLabel(),u=c?L("titleAndKb","{0} ({1})",a,c):a;o=L("titleAndKbAndAlt",`{0}
[{1}] {2}`,o,Qoe.modifierLabels[Zu].altKey,u)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:n,label:r}=this;if(!n||!r)return;const s=this._commandAction.checked&&Xbt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if(en.isThemeIcon(s)){const o=en.asClassNameArray(s);r.classList.add(...o),this._itemClassDispose.value=gn(()=>{r.classList.remove(...o)})}else{const o=$E(this._themeService.getColorTheme().type)?f1(s.dark):f1(s.light),a=tt("span");a.style.webkitMask=a.style.mask=`${o} no-repeat 50% 50%`,a.style.background="var(--vscode-icon-foreground)",a.style.display="inline-block",a.style.width="100%",a.style.height="100%",r.appendChild(a),r.classList.add("icon"),this._itemClassDispose.value=Sf(gn(()=>{r.classList.remove("icon"),ca(r)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};mx=q$([gc(2,sr),gc(3,Ps),gc(4,mn),gc(5,Do),gc(6,Ff),gc(7,zv)],mx);let Lee=class extends D7{constructor(e,n,r,s,o){var a,l,c;const u=Object.assign(Object.assign({},n),{menuAsChild:(a=n==null?void 0:n.menuAsChild)!==null&&a!==void 0?a:!1,classNames:(l=n==null?void 0:n.classNames)!==null&&l!==void 0?l:en.isThemeIcon(e.item.icon)?en.asClassName(e.item.icon):void 0,keybindingProvider:(c=n==null?void 0:n.keybindingProvider)!==null&&c!==void 0?c:d=>r.lookupKeybinding(d.id)});super(e,{getActions:()=>e.actions},s,u),this._keybindingService=r,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),Ui(this.element),e.classList.add("menu-entry");const n=this._action,{icon:r}=n.item;if(r&&!en.isThemeIcon(r)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=$E(this._themeService.getColorTheme().type)?f1(r.dark):f1(r.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};Lee=q$([gc(2,sr),gc(3,Ff),gc(4,Do)],Lee);let Dee=class extends xp{constructor(e,n,r,s,o,a,l,c){var u,d,h;super(null,e),this._keybindingService=r,this._notificationService=s,this._contextMenuService=o,this._menuService=a,this._instaService=l,this._storageService=c,this._container=null,this._options=n,this._storageKey=`${e.item.submenu.id}_lastActionId`;let f;const p=n!=null&&n.persistLastActionId?c.get(this._storageKey,1):void 0;p&&(f=e.actions.find(m=>p===m.id)),f||(f=e.actions[0]),this._defaultAction=this._instaService.createInstance(mx,f,{keybinding:this._getDefaultActionKeybindingLabel(f)});const g=Object.assign(Object.assign({keybindingProvider:m=>this._keybindingService.lookupKeybinding(m.id)},n),{menuAsChild:(u=n==null?void 0:n.menuAsChild)!==null&&u!==void 0?u:!0,classNames:(d=n==null?void 0:n.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(h=n==null?void 0:n.actionRunner)!==null&&h!==void 0?h:new AE});this._dropdown=new D7(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof If&&this.update(m.action)})}update(e){var n;!((n=this._options)===null||n===void 0)&&n.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(mx,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends AE{runAction(r,s){return rRe(this,void 0,void 0,function*(){yield r.run(void 0)})}},this._container&&this._defaultAction.render(SEe(this._container,tt(".action-container")))}_getDefaultActionKeybindingLabel(e){var n;let r;if(!((n=this._options)===null||n===void 0)&&n.renderKeybindingWithDefaultActionLabel){const s=this._keybindingService.lookupKeybinding(e.id);s&&(r=`(${s.getLabel()})`)}return r}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const n=tt(".action-container");this._defaultAction.render(He(this._container,n)),this._register(Be(n,ht.KEY_DOWN,s=>{const o=new yr(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const r=tt(".dropdown-action-container");this._dropdown.render(He(this._container,r)),this._register(Be(r,ht.KEY_DOWN,s=>{var o;const a=new yr(s);a.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),a.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};Dee=q$([gc(2,sr),gc(3,Ps),gc(4,Ff),gc(5,c_),gc(6,hn),gc(7,jf)],Dee);let Eee=class extends qbt{constructor(e,n){super(null,e,e.actions.map(r=>({text:r.id===Vo.ID?"─────────":r.label,isDisabled:!r.enabled})),0,n,iyt,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(r=>r.checked)))}render(e){super.render(e),e.style.borderColor=wt(a2)}runAction(e,n){const r=this.action.actions[n];r&&this.actionRunner.run(r)}};Eee=q$([gc(1,Vv)],Eee);function oyt(i,e,n){return e instanceof If?i.createInstance(mx,e,n):e instanceof dP?e.item.isSelection?i.createInstance(Eee,e):e.item.rememberDefaultAction?i.createInstance(Dee,e,Object.assign(Object.assign({},n),{persistLastActionId:!0})):i.createInstance(Lee,e,n):void 0}var ayt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class wh extends Le{constructor(e,n={}){var r,s,o,a,l,c;super(),this._actionRunnerDisposables=this._register(new Xe),this.viewItemDisposables=this._register(new Nse),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new _e),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new _e({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new _e),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new _e),this.onWillRun=this._onWillRun.event,this.options=n,this._context=(r=n.context)!==null&&r!==void 0?r:null,this._orientation=(s=this.options.orientation)!==null&&s!==void 0?s:0,this._triggerKeys={keyDown:(a=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&a!==void 0?a:!1,keys:(c=(l=this.options.triggerKeys)===null||l===void 0?void 0:l.keys)!==null&&c!==void 0?c:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new AE,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(h=>this._onDidRun.fire(h))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(h=>this._onWillRun.fire(h))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",n.animated!==!1&&this.domNode.classList.add("animated");let u,d;switch(this._orientation){case 0:u=[15],d=[17];break;case 1:u=[16],d=[18],this.domNode.className+=" vertical";break}this._register(Be(this.domNode,ht.KEY_DOWN,h=>{const f=new yr(h);let p=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;u&&(f.equals(u[0])||f.equals(u[1]))?p=this.focusPrevious():d&&(f.equals(d[0])||f.equals(d[1]))?p=this.focusNext():f.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():f.equals(14)?p=this.focusFirst():f.equals(13)?p=this.focusLast():f.equals(2)&&g instanceof xp&&g.trapsArrowNavigation?p=this.focusNext():this.isTriggerKeyEvent(f)?this._triggerKeys.keyDown?this.doTrigger(f):this.triggerKeyDown=!0:p=!1,p&&(f.preventDefault(),f.stopPropagation())})),this._register(Be(this.domNode,ht.KEY_UP,h=>{const f=new yr(h);this.isTriggerKeyEvent(f)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(f)),f.preventDefault(),f.stopPropagation()):(f.equals(2)||f.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(Gm(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(xf()===this.domNode||!Ia(xf(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const n=this.viewItems.find(r=>r instanceof xp&&r.isEnabled());n instanceof xp&&n.setFocusable(!0)}else this.viewItems.forEach(n=>{n instanceof xp&&n.setFocusable(!1)})}isTriggerKeyEvent(e){let n=!1;return this._triggerKeys.keys.forEach(r=>{n=n||e.equals(r)}),n}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const n=this.actionsList.children[e];if(Ia(xf(),n)){this.focusedItem=e;break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach(n=>n.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(n=>this._onDidRun.fire(n))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(n=>this._onWillRun.fire(n))),this.viewItems.forEach(n=>n.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var n;if(typeof e=="number")return(n=this.viewItems[e])===null||n===void 0?void 0:n.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let r=0;r<this.actionsList.childNodes.length;r++)if(this.actionsList.childNodes[r]===e)return this.viewItems[r].action}}push(e,n={}){const r=Array.isArray(e)?e:[e];let s=c1(n.index)?n.index:null;r.forEach(o=>{const a=document.createElement("li");a.className="action-item",a.setAttribute("role","presentation");let l;const c=Object.assign({hoverDelegate:this.options.hoverDelegate},n);this.options.actionViewItemProvider&&(l=this.options.actionViewItemProvider(o,c)),l||(l=new ZE(this.context,o,c)),this.options.allowContextMenu||this.viewItemDisposables.set(l,Be(a,ht.CONTEXT_MENU,u=>{Nn.stop(u,!0)})),l.actionRunner=this._actionRunner,l.setActionContext(this.context),l.render(a),this.focusable&&l instanceof xp&&this.viewItems.length===0&&l.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(a),this.viewItems.push(l)):(this.actionsList.insertBefore(a,this.actionsList.children[s]),this.viewItems.splice(s,0,l),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=Mi(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),la(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let n=!1,r;if(e===void 0?n=!0:typeof e=="number"?r=e:typeof e=="boolean"&&(n=e),n&&typeof this.focusedItem>"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else r!==void 0&&(this.focusedItem=r),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const n=this.focusedItem;let r;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=n,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,r=this.viewItems[this.focusedItem]}while(this.focusedItem!==n&&(this.options.focusOnlyEnabledItems&&!r.isEnabled()||r.action.id===Vo.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const n=this.focusedItem;let r;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=n,!1;this.focusedItem=this.viewItems.length-1}r=this.viewItems[this.focusedItem]}while(this.focusedItem!==n&&(this.options.focusOnlyEnabledItems&&!r.isEnabled()||r.action.id===Vo.ID));return this.updateFocus(!0),!0}updateFocus(e,n,r=!1){var s;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:n}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((s=this.viewItems[this.previouslyFocusedItem])===null||s===void 0||s.blur());const o=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(o){let a=!0;nP(o.focus)||(a=!1),this.options.focusOnlyEnabledItems&&nP(o.isEnabled)&&!o.isEnabled()&&(a=!1),o.action.id===Vo.ID&&(a=!1),a?(r||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:n}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem>"u")return;const n=this.viewItems[this.focusedItem];if(n instanceof xp){const r=n._context===null||n._context===void 0?e:n._context;this.run(n._action,r)}}run(e,n){return ayt(this,void 0,void 0,function*(){yield this._actionRunner.run(e,n)})}dispose(){this._context=void 0,this.viewItems=Mi(this.viewItems),this.getContainer().remove(),super.dispose()}}const Iee=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Yq=/(&amp;)?(&amp;)([^\s&])/g;var R7;(function(i){i[i.Right=0]="Right",i[i.Left=1]="Left"})(R7||(R7={}));class iE extends wh{constructor(e,n,r,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,r,a),context:r.context,actionRunner:r.actionRunner,ariaLabel:r.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...ri||_l?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Xe),this.initializeOrUpdateStyleSheet(e,s),this._register(or.addTarget(o)),Be(o,ht.KEY_DOWN,c=>{new yr(c).equals(2)&&c.preventDefault()}),r.enableMnemonics&&this.menuDisposables.add(Be(o,ht.KEY_DOWN,c=>{const u=c.key.toLocaleLowerCase();if(this.mnemonics.has(u)){Nn.stop(c,!0);const d=this.mnemonics.get(u);if(d.length===1&&(d[0]instanceof Kme&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(c)),d.length>1){const h=d.shift();h&&h.container&&(this.focusItemByElement(h.container),d.push(h)),this.mnemonics.set(u,d)}}})),_l&&this._register(Be(o,ht.KEY_DOWN,c=>{const u=new yr(c);u.equals(14)||u.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Nn.stop(c,!0)):(u.equals(13)||u.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Nn.stop(c,!0))})),this._register(Be(this.domNode,ht.MOUSE_OUT,c=>{const u=c.relatedTarget;Ia(u,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(Be(this.actionsList,ht.MOUSE_OVER,c=>{let u=c.target;if(!(!u||!Ia(u,this.actionsList)||u===this.actionsList)){for(;u.parentElement!==this.actionsList&&u.parentElement!==null;)u=u.parentElement;if(u.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(u),d!==this.focusedItem&&this.updateFocus()}}})),this._register(or.addTarget(this.actionsList)),this._register(Be(this.actionsList,lr.Tap,c=>{let u=c.initialTarget;if(!(!u||!Ia(u,this.actionsList)||u===this.actionsList)){for(;u.parentElement!==this.actionsList&&u.parentElement!==null;)u=u.parentElement;if(u.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(u),d!==this.focusedItem&&this.updateFocus()}}}));const a={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new P5(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const l=this.scrollableElement.getDomNode();l.style.position="",this.styleScrollElement(l,s),this._register(Be(o,lr.Change,c=>{Nn.stop(c,!0);const u=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:u-c.translationY})})),this._register(Be(l,ht.MOUSE_UP,c=>{c.preventDefault()})),o.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,n=n.filter(c=>{var u;return!((u=r.submenuIds)===null||u===void 0)&&u.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!0}),this.push(n,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof Gme)).forEach((c,u,d)=>{c.updatePositionInSet(u+1,d.length)})}initializeOrUpdateStyleSheet(e,n){this.styleSheet||($9(e)?this.styleSheet=_h(e):(iE.globalStyleSheet||(iE.globalStyleSheet=_h()),this.styleSheet=iE.globalStyleSheet)),this.styleSheet.textContent=cyt(n,$9(e))}styleScrollElement(e,n){var r,s;const o=(r=n.foregroundColor)!==null&&r!==void 0?r:"",a=(s=n.backgroundColor)!==null&&s!==void 0?s:"",l=n.borderColor?`1px solid ${n.borderColor}`:"",c="5px",u=n.shadowColor?`0 2px 8px ${n.shadowColor}`:"";e.style.outline=l,e.style.borderRadius=c,e.style.color=o,e.style.backgroundColor=a,e.style.boxShadow=u}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const n=this.focusedItem;this.setFocusedItem(e),n!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let n=0;n<this.actionsList.children.length;n++){const r=this.actionsList.children[n];if(e===r){this.focusedItem=n;break}}}updateFocus(e){super.updateFocus(e,!0,!0),typeof this.focusedItem<"u"&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,n,r){if(e instanceof Vo)return new Gme(n.context,e,{icon:!0},this.menuStyles);if(e instanceof NE){const s=new Kme(e,e.actions,r,Object.assign(Object.assign({},n),{submenuIds:new Set([...n.submenuIds||[],e.id])}),this.menuStyles);if(n.enableMnemonics){const o=s.getMnemonic();if(o&&s.isEnabled()){let a=[];this.mnemonics.has(o)&&(a=this.mnemonics.get(o)),a.push(s),this.mnemonics.set(o,a)}}return s}else{const s={enableMnemonics:n.enableMnemonics,useEventAsContext:n.useEventAsContext};if(n.getKeyBinding){const a=n.getKeyBinding(e);if(a){const l=a.getLabel();l&&(s.keybinding=l)}}const o=new aRe(n.context,e,s,this.menuStyles);if(n.enableMnemonics){const a=o.getMnemonic();if(a&&o.isEnabled()){let l=[];this.mnemonics.has(a)&&(l=this.mnemonics.get(a)),l.push(o),this.mnemonics.set(a,l)}}return o}}}class aRe extends xp{constructor(e,n,r,s){if(r.isMenu=!0,super(n,n,r),this.menuStyle=s,this.options=r,this.options.icon=r.icon!==void 0?r.icon:!1,this.options.label=r.label!==void 0?r.label:!0,this.cssClass="",this.options.label&&r.enableMnemonics){const o=this.action.label;if(o){const a=Iee.exec(o);a&&(this.mnemonic=(a[1]?a[1]:a[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new Ji(()=>{this.element&&(this._register(Be(this.element,ht.MOUSE_UP,o=>{if(Nn.stop(o,!0),gh){if(new rh(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(Be(this.element,ht.CONTEXT_MENU,o=>{Nn.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=He(this.element,tt("a.action-menu-item")),this._action.id===Vo.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=He(this.item,tt("span.menu-item-check"+en.asCSSSelector(lt.menuSelection))),this.check.setAttribute("role","none"),this.label=He(this.item,tt("span.action-label")),this.options.label&&this.options.keybinding&&(He(this.item,tt("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,n){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${n}`))}updateLabel(){var e;if(this.label&&this.options.label){la(this.label);let n=oae(this.action.label);if(n){const r=lyt(n);this.options.enableMnemonics||(n=r),this.label.setAttribute("aria-label",r.replace(/&&/g,"&"));const s=Iee.exec(n);if(s){n=O9(n),Yq.lastIndex=0;let o=Yq.exec(n);for(;o&&o[1];)o=Yq.exec(n);const a=l=>l.replace(/&amp;&amp;/g,"&amp;");o?this.label.append(S5(a(n.substr(0,o.index))," "),tt("u",{"aria-hidden":"true"},o[3]),G2e(a(n.substr(o.index+o[0].length))," ")):this.label.innerText=a(n).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(s[1]?s[1]:s[3]).toLocaleLowerCase())}else this.label.innerText=n.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),n=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,r=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=n??"",this.item.style.backgroundColor=r??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=n??"")}}class Kme extends aRe{constructor(e,n,r,s,o){super(e,e,s,o),this.submenuActions=n,this.parentData=r,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new Xe),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:R7.Right,this.showScheduler=new Ji(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Ji(()=>{this.element&&!Ia(xf(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=He(this.item,tt("span.submenu-indicator"+en.asCSSSelector(lt.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(Be(this.element,ht.KEY_UP,n=>{const r=new yr(n);(r.equals(17)||r.equals(3))&&(Nn.stop(n,!0),this.createSubmenu(!0))})),this._register(Be(this.element,ht.KEY_DOWN,n=>{const r=new yr(n);xf()===this.item&&(r.equals(17)||r.equals(3))&&Nn.stop(n,!0)})),this._register(Be(this.element,ht.MOUSE_OVER,n=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(Be(this.element,ht.MOUSE_LEAVE,n=>{this.mouseOver=!1})),this._register(Be(this.element,ht.FOCUS_OUT,n=>{this.element&&!Ia(xf(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){Nn.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,n,r,s){const o={top:0,left:0};return o.left=_2(e.width,n.width,{position:s===R7.Right?0:1,offset:r.left,size:r.width}),o.left>=r.left&&o.left<r.left+r.width&&(r.left+10+n.width<=e.width&&(o.left=r.left+10),r.top+=10,r.height=0),o.top=_2(e.height,n.height,{position:0,offset:r.top,size:0}),o.top+n.height===r.top&&o.top+r.height+n.height<=e.height&&(o.top+=r.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=He(this.element,tt("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const n=getComputedStyle(this.parentData.parent.domNode),r=parseFloat(n.paddingTop||"0")||0;this.submenuContainer.style.zIndex="1",this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.parentData.submenu=new iE(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new JW],this.submenuOptions,this.menuStyle);const s=this.element.getBoundingClientRect(),o={top:s.top-r,left:s.left,height:s.height+2*r,width:s.width},a=this.submenuContainer.getBoundingClientRect(),{top:l,left:c}=this.calculateSubmenuMenuLayout(new bi(window.innerWidth,window.innerHeight),bi.lift(a),o,this.expandDirection);this.submenuContainer.style.left=`${c-a.left}px`,this.submenuContainer.style.top=`${l-a.top}px`,this.submenuDisposables.add(Be(this.submenuContainer,ht.KEY_UP,u=>{new yr(u).equals(15)&&(Nn.stop(u,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(Be(this.submenuContainer,ht.KEY_DOWN,u=>{new yr(u).equals(15)&&Nn.stop(u,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var n;this.item&&((n=this.item)===null||n===void 0||n.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const n=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=n??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Gme extends ZE{constructor(e,n,r,s){super(e,n,r),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function lyt(i){const e=Iee,n=e.exec(i);if(!n)return i;const r=!n[1];return i.replace(e,r?"$2$3":"").trim()}function Xme(i){const e=H2e()[i.id];return`.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`}function cyt(i,e){let n=`
.monaco-menu {
font-size: 13px;
border-radius: 5px;
min-width: 160px;
}
${Xme(lt.menuSelection)}
${Xme(lt.menuSubmenu)}
.monaco-menu .monaco-action-bar {
text-align: right;
overflow: hidden;
white-space: nowrap;
}
.monaco-menu .monaco-action-bar .actions-container {
display: flex;
margin: 0 auto;
padding: 0;
width: 100%;
justify-content: flex-end;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: inline-block;
}
.monaco-menu .monaco-action-bar.reverse .actions-container {
flex-direction: row-reverse;
}
.monaco-menu .monaco-action-bar .action-item {
cursor: pointer;
display: inline-block;
transition: transform 50ms ease;
position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
}
.monaco-menu .monaco-action-bar .action-item.disabled {
cursor: default;
}
.monaco-menu .monaco-action-bar.animated .action-item.active {
transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */
}
.monaco-menu .monaco-action-bar .action-item .icon,
.monaco-menu .monaco-action-bar .action-item .codicon {
display: inline-block;
}
.monaco-menu .monaco-action-bar .action-item .codicon {
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar .action-label {
font-size: 11px;
margin-right: 4px;
}
.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
color: var(--vscode-disabledForeground);
}
/* Vertical actions */
.monaco-menu .monaco-action-bar.vertical {
text-align: left;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
display: block;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
display: block;
border-bottom: 1px solid var(--vscode-menu-separatorBackground);
padding-top: 1px;
padding: 30px;
}
.monaco-menu .secondary-actions .monaco-action-bar .action-label {
margin-left: 6px;
}
/* Action Items */
.monaco-menu .monaco-action-bar .action-item.select-container {
overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
flex: 1;
max-width: 170px;
min-width: 60px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.monaco-menu .monaco-action-bar.vertical {
margin-left: 0;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: block;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
padding: 0;
transform: none;
display: flex;
}
.monaco-menu .monaco-action-bar.vertical .action-item.active {
transform: none;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
flex: 1 1 auto;
display: flex;
height: 2em;
align-items: center;
position: relative;
margin: 0 4px;
border-radius: 4px;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {
opacity: unset;
}
.monaco-menu .monaco-action-bar.vertical .action-label {
flex: 1 1 auto;
text-decoration: none;
padding: 0 1em;
background: none;
font-size: 12px;
line-height: 1;
}
.monaco-menu .monaco-action-bar.vertical .keybinding,
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
display: inline-block;
flex: 2 1 auto;
padding: 0 1em;
text-align: right;
font-size: 12px;
line-height: 1;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
font-size: 16px !important;
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
margin-left: auto;
margin-right: -20px;
}
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
opacity: 0.4;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
display: inline-block;
box-sizing: border-box;
margin: 0;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
position: static;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
position: absolute;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
width: 100%;
height: 0px !important;
opacity: 1;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
padding: 0.7em 1em 0.1em 1em;
font-weight: bold;
opacity: 1;
}
.monaco-menu .monaco-action-bar.vertical .action-label:hover {
color: inherit;
}
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
position: absolute;
visibility: hidden;
width: 1em;
height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
visibility: visible;
display: flex;
align-items: center;
justify-content: center;
}
/* Context Menu */
.context-view.monaco-menu-container {
outline: 0;
border: none;
animation: fadeIn 0.083s linear;
-webkit-app-region: no-drag;
}
.context-view.monaco-menu-container :focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
outline: 0;
}
.hc-black .context-view.monaco-menu-container,
.hc-light .context-view.monaco-menu-container,
:host-context(.hc-black) .context-view.monaco-menu-container,
:host-context(.hc-light) .context-view.monaco-menu-container {
box-shadow: none;
}
.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,
.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
background: none;
}
/* Vertical Action Bar Styles */
.monaco-menu .monaco-action-bar.vertical {
padding: 4px 0;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
height: 2em;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
.monaco-menu .monaco-action-bar.vertical .keybinding {
font-size: inherit;
padding: 0 2em;
}
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
font-size: inherit;
width: 2em;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
font-size: inherit;
margin: 5px 0 !important;
padding: 0;
border-radius: 0;
}
.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
margin-left: 0;
margin-right: 0;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
font-size: 60%;
padding: 0 1.8em;
}
.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
height: 100%;
mask-size: 10px 10px;
-webkit-mask-size: 10px 10px;
}
.monaco-menu .action-item {
cursor: default;
}`;if(e){n+=`
/* Arrows */
.monaco-scrollable-element > .scrollbar > .scra {
cursor: pointer;
font-size: 11px !important;
}
.monaco-scrollable-element > .visible {
opacity: 1;
/* Background rule added for IE9 - to allow clicks on dom node */
background:rgba(0,0,0,0);
transition: opacity 100ms linear;
}
.monaco-scrollable-element > .invisible {
opacity: 0;
pointer-events: none;
}
.monaco-scrollable-element > .invisible.fade {
transition: opacity 800ms linear;
}
/* Scrollable Content Inset Shadow */
.monaco-scrollable-element > .shadow {
position: absolute;
display: none;
}
.monaco-scrollable-element > .shadow.top {
display: block;
top: 0;
left: 3px;
height: 3px;
width: 100%;
}
.monaco-scrollable-element > .shadow.left {
display: block;
top: 3px;
left: 0;
height: 100%;
width: 3px;
}
.monaco-scrollable-element > .shadow.top-left-corner {
display: block;
top: 0;
left: 0;
height: 3px;
width: 3px;
}
`;const r=i.scrollbarShadow;r&&(n+=`
.monaco-scrollable-element > .shadow.top {
box-shadow: ${r} 0 6px 6px -6px inset;
}
.monaco-scrollable-element > .shadow.left {
box-shadow: ${r} 6px 0 6px -6px inset;
}
.monaco-scrollable-element > .shadow.top.left {
box-shadow: ${r} 6px 6px 6px -6px inset;
}
`);const s=i.scrollbarSliderBackground;s&&(n+=`
.monaco-scrollable-element > .scrollbar > .slider {
background: ${s};
}
`);const o=i.scrollbarSliderHoverBackground;o&&(n+=`
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: ${o};
}
`);const a=i.scrollbarSliderActiveBackground;a&&(n+=`
.monaco-scrollable-element > .scrollbar > .slider.active {
background: ${a};
}
`)}return n}class uyt{constructor(e,n,r,s){this.contextViewService=e,this.telemetryService=n,this.notificationService=r,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const n=e.getActions();if(!n.length)return;this.focusToReturn=document.activeElement;let r;const s=Qse(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var a;this.lastContainer=o;const l=e.getMenuClassName?e.getMenuClassName():"";l&&(o.className+=" "+l),this.options.blockMouse&&(this.block=o.appendChild(tt(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=Be(this.block,ht.MOUSE_DOWN,d=>d.stopPropagation()));const c=new Xe,u=e.actionRunner||new AE;return u.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,c),u.onDidRun(this.onDidActionRun,this,c),r=new iE(o,n,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:u,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},ryt),r.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,c),r.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,c),c.add(Be(window,ht.BLUR,()=>this.contextViewService.hideContextView(!0))),c.add(Be(window,ht.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new rh(d);let f=h.target;if(!h.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),Sf(c,r)},focus:()=>{r==null||r.focus(!!e.autoSelectFirstItem)},onHide:o=>{var a,l,c;(a=e.onHide)===null||a===void 0||a.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(l=this.blockDisposable)===null||l===void 0||l.dispose(),this.blockDisposable=null,this.lastContainer&&(xf()===this.lastContainer||Ia(xf(),this.lastContainer))&&((c=this.focusToReturn)===null||c===void 0||c.focus()),this.lastContainer=null}},s,!!s)}onActionRun(e,n){n&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!sg(e.error)&&this.notificationService.error(e.error)}}var dyt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},sD=function(i,e){return function(n,r){e(n,r,i)}};let Tee=class extends Le{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new uyt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,n,r,s,o,a){super(),this.telemetryService=e,this.notificationService=n,this.contextViewService=r,this.keybindingService=s,this.menuService=o,this.contextKeyService=a,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new _e),this._onDidHideContextMenu=this._store.add(new _e)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Ree.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:n=>{var r;(r=e.onHide)===null||r===void 0||r.call(e,n),this._onDidHideContextMenu.fire()}})),Y0.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};Tee=dyt([sD(0,_d),sD(1,Ps),sD(2,Vv),sD(3,sr),sD(4,c_),sD(5,mn)],Tee);var Ree;(function(i){function e(r){return r&&r.menuId instanceof se}function n(r,s,o){if(!e(r))return r;const{menuId:a,menuActionOptions:l,contextKeyService:c}=r;return Object.assign(Object.assign({},r),{getActions:()=>{const u=[];if(a){const d=s.createMenu(a,c??o);syt(d,l,u),d.dispose()}return r.getActions?Vo.join(r.getActions(),u):u}})}i.transform=n})(Ree||(Ree={}));var A7;(function(i){i[i.API=0]="API",i[i.USER=1]="USER"})(A7||(A7={}));var uae=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},N7=function(i,e){return function(n,r){e(n,r,i)}},QC=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let Aee=class{constructor(e){this._commandService=e}open(e,n){return QC(this,void 0,void 0,function*(){if(!Xoe(e,Pn.command))return!1;if(!(n!=null&&n.allowCommands)||(typeof e=="string"&&(e=Jt.parse(e)),Array.isArray(n.allowCommands)&&!n.allowCommands.includes(e.path)))return!0;let r=[];try{r=wee(decodeURIComponent(e.query))}catch{try{r=wee(e.query)}catch{}}return Array.isArray(r)||(r=[r]),yield this._commandService.executeCommand(e.path,...r),!0})}};Aee=uae([N7(0,us)],Aee);let Nee=class{constructor(e){this._editorService=e}open(e,n){return QC(this,void 0,void 0,function*(){typeof e=="string"&&(e=Jt.parse(e));const{selection:r,uri:s}=m0t(e);return e=s,e.scheme===Pn.file&&(e=Qgt(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:r,source:n!=null&&n.fromUserGesture?A7.USER:A7.API},n==null?void 0:n.editorOptions)},this._editorService.getFocusedCodeEditor(),n==null?void 0:n.openToSide),!0})}};Nee=uae([N7(0,Si)],Nee);let Mee=class{constructor(e,n){this._openers=new jl,this._validators=new jl,this._resolvers=new jl,this._resolvedUriTargets=new Va(r=>r.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new jl,this._defaultExternalOpener={openExternal:r=>QC(this,void 0,void 0,function*(){return yme(r,Pn.http,Pn.https)?kEe(r):window.location.href=r,!0})},this._openers.push({open:(r,s)=>QC(this,void 0,void 0,function*(){return s!=null&&s.openExternal||yme(r,Pn.mailto,Pn.http,Pn.https,Pn.vsls)?(yield this._doOpenExternal(r,s),!0):!1})}),this._openers.push(new Aee(n)),this._openers.push(new Nee(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,n){var r;return QC(this,void 0,void 0,function*(){const s=typeof e=="string"?Jt.parse(e):e,o=(r=this._resolvedUriTargets.get(s))!==null&&r!==void 0?r:e;for(const a of this._validators)if(!(yield a.shouldOpen(o,n)))return!1;for(const a of this._openers)if(yield a.open(e,n))return!0;return!1})}resolveExternalUri(e,n){return QC(this,void 0,void 0,function*(){for(const r of this._resolvers)try{const s=yield r.resolveExternalUri(e,n);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,n){return QC(this,void 0,void 0,function*(){const r=typeof e=="string"?Jt.parse(e):e;let s;try{s=(yield this.resolveExternalUri(r,n)).resolved}catch{s=r}let o;if(typeof e=="string"&&r.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),n!=null&&n.allowContributedOpeners){const a=typeof(n==null?void 0:n.allowContributedOpeners)=="string"?n==null?void 0:n.allowContributedOpeners:void 0;for(const l of this._externalOpeners)if(yield l.openExternal(o,{sourceUri:r,preferredOpenerId:a},Hn.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:r},Hn.None)})}dispose(){this._validators.clear()}};Mee=uae([N7(0,Si),N7(1,us)],Mee);const Wf=qn("editorWorkerService");var es;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(es||(es={}));(function(i){function e(a,l){return l-a}i.compare=e;const n=Object.create(null);n[i.Error]=L("sev.error","Error"),n[i.Warning]=L("sev.warning","Warning"),n[i.Info]=L("sev.info","Info");function r(a){return n[a]||""}i.toString=r;function s(a){switch(a){case vs.Error:return i.Error;case vs.Warning:return i.Warning;case vs.Info:return i.Info;case vs.Ignore:return i.Hint}}i.fromSeverity=s;function o(a){switch(a){case i.Error:return vs.Error;case i.Warning:return vs.Warning;case i.Info:return vs.Info;case i.Hint:return vs.Ignore}}i.toSeverity=o})(es||(es={}));var M7;(function(i){const e="";function n(s){return r(s,!0)}i.makeKey=n;function r(s,o){const a=[e];return s.source?a.push(s.source.replace("¦","\\¦")):a.push(e),s.code?typeof s.code=="string"?a.push(s.code.replace("¦","\\¦")):a.push(s.code.value.replace("¦","\\¦")):a.push(e),s.severity!==void 0&&s.severity!==null?a.push(es.toString(s.severity)):a.push(e),s.message&&o?a.push(s.message.replace("¦","\\¦")):a.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?a.push(s.startLineNumber.toString()):a.push(e),s.startColumn!==void 0&&s.startColumn!==null?a.push(s.startColumn.toString()):a.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?a.push(s.endLineNumber.toString()):a.push(e),s.endColumn!==void 0&&s.endColumn!==null?a.push(s.endColumn.toString()):a.push(e),a.push(e),a.join("¦")}i.makeKeyOptionalMessage=r})(M7||(M7={}));const h_=qn("markerService");function hyt(i,e){const n=[],r=[];for(const s of i)e.has(s)||n.push(s);for(const s of e)i.has(s)||r.push(s);return{removed:n,added:r}}function fyt(i,e){const n=new Set;for(const r of e)i.has(r)&&n.add(r);return n}var pyt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Yme=function(i,e){return function(n,r){e(n,r,i)}};let Pee=class extends Le{constructor(e,n){super(),this._markerService=n,this._onDidChangeMarker=this._register(new _e),this._markerDecorations=new Va,e.getModels().forEach(r=>this._onModelAdded(r)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,n){const r=this._markerDecorations.get(e);return r&&r.getMarker(n)||null}_handleMarkerChange(e){e.forEach(n=>{const r=this._markerDecorations.get(n);r&&this._updateDecorations(r)})}_onModelAdded(e){const n=new gyt(e);this._markerDecorations.set(e.uri,n),this._updateDecorations(n)}_onModelRemoved(e){var n;const r=this._markerDecorations.get(e.uri);r&&(r.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Pn.inMemory||e.uri.scheme===Pn.internal||e.uri.scheme===Pn.vscode)&&((n=this._markerService)===null||n===void 0||n.read({resource:e.uri}).map(s=>s.owner).forEach(s=>this._markerService.remove(s,[e.uri])))}_updateDecorations(e){const n=this._markerService.read({resource:e.model.uri,take:500});e.update(n)&&this._onDidChangeMarker.fire(e.model)}};Pee=pyt([Yme(0,Fr),Yme(1,h_)],Pee);class gyt extends Le{constructor(e){super(),this.model=e,this._map=new Qct,this._register(gn(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:n,removed:r}=hyt(new Set(this._map.keys()),new Set(e));if(n.length===0&&r.length===0)return!1;const s=r.map(l=>this._map.get(l)),o=n.map(l=>({range:this._createDecorationRange(this.model,l),options:this._createDecorationOption(l)})),a=this.model.deltaDecorations(s,o);for(const l of r)this._map.delete(l);for(let l=0;l<a.length;l++)this._map.set(n[l],a[l]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,n){let r=J.lift(n);if(n.severity===es.Hint&&!this._hasMarkerTag(n,1)&&!this._hasMarkerTag(n,2)&&(r=r.setEndPosition(r.startLineNumber,r.startColumn+2)),r=e.validateRange(r),r.isEmpty()){const s=e.getLineLastNonWhitespaceColumn(r.startLineNumber)||e.getLineMaxColumn(r.startLineNumber);if(s===1||r.endColumn>=s)return r;const o=e.getWordAtPosition(r.getStartPosition());o&&(r=new J(r.startLineNumber,o.startColumn,r.endLineNumber,o.endColumn))}else if(n.endColumn===Number.MAX_VALUE&&n.startColumn===1&&r.startLineNumber===r.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(n.startLineNumber);s<r.endColumn&&(r=new J(r.startLineNumber,s,r.endLineNumber,r.endColumn),n.startColumn=s)}return r}_createDecorationOption(e){let n,r,s,o,a;switch(e.severity){case es.Hint:this._hasMarkerTag(e,2)?n=void 0:this._hasMarkerTag(e,1)?n="squiggly-unnecessary":n="squiggly-hint",s=0;break;case es.Info:n="squiggly-info",r=Qr(Uft),s=10,a={color:Qr(Tht),position:ou.Inline};break;case es.Warning:n="squiggly-warning",r=Qr(Hft),s=20,a={color:Qr(Rht),position:ou.Inline};break;case es.Error:default:n="squiggly-error",r=Qr(Vft),s=30,a={color:Qr(Aht),position:ou.Inline};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(o="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:n,showIfCollapsed:!0,overviewRuler:{color:r,position:hd.Right},minimap:a,zIndex:s,inlineClassName:o}}_hasMarkerTag(e,n){return e.tags?e.tags.indexOf(n)>=0:!1}}var myt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},QR=function(i,e){return function(n,r){e(n,r,i)}},$D;function rC(i){return i.toString()}class _yt{constructor(e,n,r){this.model=e,this._modelEventListeners=new Xe,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>n(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>r(e,s)))}dispose(){this._modelEventListeners.dispose()}}const vyt=_l||ri?1:2;class byt{constructor(e,n,r,s,o,a,l,c){this.uri=e,this.initialUndoRedoSnapshot=n,this.time=r,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=a,this.versionId=l,this.alternativeVersionId=c}}let P7=$D=class extends Le{constructor(e,n,r,s,o){super(),this._configurationService=e,this._resourcePropertiesService=n,this._undoRedoService=r,this._languageService=s,this._languageConfigurationService=o,this._onModelAdded=this._register(new _e),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new _e),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new _e),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(a=>this._updateModelOptions(a))),this._updateModelOptions(void 0)}static _readModelOptions(e,n){var r;let s=za.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const p=parseInt(e.editor.tabSize,10);isNaN(p)||(s=p),s<1&&(s=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const p=parseInt(e.editor.indentSize,10);isNaN(p)||(o=Math.max(p,1))}let a=za.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(a=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let l=vyt;const c=e.eol;c===`\r
`?l=2:c===`
`&&(l=1);let u=za.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(u=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=za.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let h=za.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(h=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let f=za.bracketPairColorizationOptions;return!((r=e.editor)===null||r===void 0)&&r.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(f={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:n,tabSize:s,indentSize:o,insertSpaces:a,detectIndentation:d,defaultEOL:l,trimAutoWhitespace:u,largeFileOptimizations:h,bracketPairColorizationOptions:f}}_getEOL(e,n){if(e)return this._resourcePropertiesService.getEOL(e,n);const r=this._configurationService.getValue("files.eol",{overrideIdentifier:n});return r&&typeof r=="string"&&r!=="auto"?r:Zu===3||Zu===2?`
`:`\r
`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,n,r){const s=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[s+n];if(!o){const a=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:n}),l=this._getEOL(n,s);o=$D._readModelOptions({editor:a,eol:l},r),this._modelCreationOptionsByLanguageAndResource[s+n]=o}return o}_updateModelOptions(e){const n=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const r=Object.keys(this._models);for(let s=0,o=r.length;s<o;s++){const a=r[s],l=this._models[a],c=l.model.getLanguageId(),u=l.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:c,resource:u})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:c,resource:u}))continue;const d=n[c+u],h=this.getCreationOptions(c,u,l.model.isForSimpleWidget);$D._setModelOptionsForModel(l.model,h,d)}}static _setModelOptionsForModel(e,n,r){r&&r.defaultEOL!==n.defaultEOL&&e.getLineCount()===1&&e.setEOL(n.defaultEOL===1?0:1),!(r&&r.detectIndentation===n.detectIndentation&&r.insertSpaces===n.insertSpaces&&r.tabSize===n.tabSize&&r.indentSize===n.indentSize&&r.trimAutoWhitespace===n.trimAutoWhitespace&&od(r.bracketPairColorizationOptions,n.bracketPairColorizationOptions))&&(n.detectIndentation?(e.detectIndentation(n.insertSpaces,n.tabSize),e.updateOptions({trimAutoWhitespace:n.trimAutoWhitespace,bracketColorizationOptions:n.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.indentSize,trimAutoWhitespace:n.trimAutoWhitespace,bracketColorizationOptions:n.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(rC(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const n=this._disposedModels.get(rC(e));return n&&(this._disposedModelsHeapSize-=n.heapSize),this._disposedModels.delete(rC(e)),n}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const n=[];for(this._disposedModels.forEach(r=>{r.sharesUndoRedoStack||n.push(r)}),n.sort((r,s)=>r.time-s.time);n.length>0&&this._disposedModelsHeapSize>e;){const r=n.shift();this._removeDisposedModel(r.uri),r.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(r.initialUndoRedoSnapshot)}}}_createModelData(e,n,r,s){const o=this.getCreationOptions(n,r,s),a=new Qm(e,n,o,r,this._undoRedoService,this._languageService,this._languageConfigurationService);if(r&&this._disposedModels.has(rC(r))){const u=this._removeDisposedModel(r),d=this._undoRedoService.getElements(r),h=this._getSHA1Computer(),f=h.canComputeSHA1(a)?h.computeSHA1(a)===u.sha1:!1;if(f||u.sharesUndoRedoStack){for(const p of d.past)A0(p)&&p.matchesResource(r)&&p.setModel(a);for(const p of d.future)A0(p)&&p.matchesResource(r)&&p.setModel(a);this._undoRedoService.setElementsValidFlag(r,!0,p=>A0(p)&&p.matchesResource(r)),f&&(a._overwriteVersionId(u.versionId),a._overwriteAlternativeVersionId(u.alternativeVersionId),a._overwriteInitialUndoRedoSnapshot(u.initialUndoRedoSnapshot))}else u.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(u.initialUndoRedoSnapshot)}const l=rC(a.uri);if(this._models[l])throw new Error("ModelService: Cannot add model because it already exists!");const c=new _yt(a,u=>this._onWillDispose(u),(u,d)=>this._onDidChangeLanguage(u,d));return this._models[l]=c,c}createModel(e,n,r,s=!1){let o;return n?o=this._createModelData(e,n,r,s):o=this._createModelData(e,ad,r,s),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],n=Object.keys(this._models);for(let r=0,s=n.length;r<s;r++){const o=n[r];e.push(this._models[o].model)}return e}getModel(e){const n=rC(e),r=this._models[n];return r?r.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Pn.file||e.scheme===Pn.vscodeRemote||e.scheme===Pn.vscodeUserData||e.scheme===Pn.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const n=rC(e.uri),r=this._models[n],s=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,a=0;if(s||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){const u=this._undoRedoService.getElements(e.uri);if(u.past.length>0||u.future.length>0){for(const d of u.past)A0(d)&&d.matchesResource(e.uri)&&(o=!0,a+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of u.future)A0(d)&&d.matchesResource(e.uri)&&(o=!0,a+=d.heapSize(e.uri),d.setModel(e.uri))}}const l=$D.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,c=this._getSHA1Computer();if(o)if(!s&&(a>l||!c.canComputeSHA1(e))){const u=r.model.getInitialUndoRedoSnapshot();u!==null&&this._undoRedoService.restoreSnapshot(u)}else this._ensureDisposedModelsHeapSize(l-a),this._undoRedoService.setElementsValidFlag(e.uri,!1,u=>A0(u)&&u.matchesResource(e.uri)),this._insertDisposedModel(new byt(e.uri,r.model.getInitialUndoRedoSnapshot(),Date.now(),s,a,c.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const u=r.model.getInitialUndoRedoSnapshot();u!==null&&this._undoRedoService.restoreSnapshot(u)}delete this._models[n],r.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,n){const r=n.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(r,e.uri,e.isForSimpleWidget),a=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);$D._setModelOptionsForModel(e,a,o),this._onModelModeChanged.fire({model:e,oldLanguageId:r})}_getSHA1Computer(){return new K$}};P7.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;P7=$D=myt([QR(0,ei),QR(1,tIe),QR(2,P$),QR(3,Ar),QR(4,dr)],P7);class K${canComputeSHA1(e){return e.getValueLength()<=K$.MAX_MODEL_SIZE}computeSHA1(e){const n=new w$,r=e.createSnapshot();let s;for(;s=r.read();)n.update(s);return n.digest()}}K$.MAX_MODEL_SIZE=10*1024*1024;class yyt{get templateId(){return this.renderer.templateId}constructor(e,n){this.renderer=e,this.modelProvider=n}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Le.None}}renderElement(e,n,r,s){var o;if((o=r.disposable)===null||o===void 0||o.dispose(),!r.data)return;const a=this.modelProvider();if(a.isResolved(e))return this.renderer.renderElement(a.get(e),e,r.data,s);const l=new Ns,c=a.resolve(e,l.token);r.disposable={dispose:()=>l.cancel()},this.renderer.renderPlaceholder(e,r.data),c.then(u=>this.renderer.renderElement(u,e,r.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class wyt{constructor(e,n){this.modelProvider=e,this.accessibilityProvider=n}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const n=this.modelProvider();return n.isResolved(e)?this.accessibilityProvider.getAriaLabel(n.get(e)):null}}function Cyt(i,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new wyt(i,e.accessibilityProvider)})}class Syt{constructor(e,n,r,s,o={}){const a=()=>this.model,l=s.map(c=>new yyt(c,a));this.list=new Bf(e,n,r,l,Cyt(a,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return _t.map(this.list.onMouseDblClick,({element:e,index:n,browserEvent:r})=>({element:e===void 0?void 0:this._model.get(e),index:n,browserEvent:r}))}get onPointer(){return _t.map(this.list.onPointer,({element:e,index:n,browserEvent:r})=>({element:e===void 0?void 0:this._model.get(e),index:n,browserEvent:r}))}get onDidChangeSelection(){return _t.map(this.list.onDidChangeSelection,({elements:e,indexes:n,browserEvent:r})=>({elements:e.map(s=>this._model.get(s)),indexes:n,browserEvent:r}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Tl(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var UI=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const xyt=!1;var O7;(function(i){i.North="north",i.South="south",i.East="east",i.West="west"})(O7||(O7={}));let kyt=4;const Lyt=new _e;let Dyt=300;const Eyt=new _e;class dae{constructor(){this.disposables=new Xe}get onPointerMove(){return this.disposables.add(new Xn(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new Xn(window,"mouseup")).event}dispose(){this.disposables.dispose()}}UI([Ms],dae.prototype,"onPointerMove",null);UI([Ms],dae.prototype,"onPointerUp",null);class hae{get onPointerMove(){return this.disposables.add(new Xn(this.el,lr.Change)).event}get onPointerUp(){return this.disposables.add(new Xn(this.el,lr.End)).event}constructor(e){this.el=e,this.disposables=new Xe}dispose(){this.disposables.dispose()}}UI([Ms],hae.prototype,"onPointerMove",null);UI([Ms],hae.prototype,"onPointerUp",null);class F7{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}UI([Ms],F7.prototype,"onPointerMove",null);UI([Ms],F7.prototype,"onPointerUp",null);const Zme="pointer-events-disabled";class ja extends Le{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const n=r=>{this.orthogonalStartDragHandleDisposables.clear(),r!==0&&(this._orthogonalStartDragHandle=He(this.el,tt(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(gn(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new Xn(this._orthogonalStartDragHandle,"mouseenter")).event(()=>ja.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Xn(this._orthogonalStartDragHandle,"mouseleave")).event(()=>ja.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(n,this)),n(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const n=r=>{this.orthogonalEndDragHandleDisposables.clear(),r!==0&&(this._orthogonalEndDragHandle=He(this.el,tt(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(gn(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new Xn(this._orthogonalEndDragHandle,"mouseenter")).event(()=>ja.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Xn(this._orthogonalEndDragHandle,"mouseleave")).event(()=>ja.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(n,this)),n(e.state)}this._orthogonalEndSash=e}}constructor(e,n,r){super(),this.hoverDelay=Dyt,this.hoverDelayer=this._register(new Rf(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new _e),this._onDidStart=this._register(new _e),this._onDidChange=this._register(new _e),this._onDidReset=this._register(new _e),this._onDidEnd=this._register(new _e),this.orthogonalStartSashDisposables=this._register(new Xe),this.orthogonalStartDragHandleDisposables=this._register(new Xe),this.orthogonalEndSashDisposables=this._register(new Xe),this.orthogonalEndDragHandleDisposables=this._register(new Xe),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=He(e,tt(".monaco-sash")),r.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${r.orthogonalEdge}`),ri&&this.el.classList.add("mac");const s=this._register(new Xn(this.el,"mousedown")).event;this._register(s(h=>this.onPointerStart(h,new dae),this));const o=this._register(new Xn(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const a=this._register(new Xn(this.el,"mouseenter")).event;this._register(a(()=>ja.onMouseEnter(this)));const l=this._register(new Xn(this.el,"mouseleave")).event;this._register(l(()=>ja.onMouseLeave(this))),this._register(or.addTarget(this.el));const c=this._register(new Xn(this.el,lr.Start)).event;this._register(c(h=>this.onPointerStart(h,new hae(this.el)),this));const u=this._register(new Xn(this.el,lr.Tap)).event;let d;this._register(u(h=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(h);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof r.size=="number"?(this.size=r.size,r.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=kyt,this._register(Lyt.event(h=>{this.size=h,this.layout()}))),this._register(Eyt.event(h=>this.hoverDelay=h)),this.layoutProvider=n,this.orthogonalStartSash=r.orthogonalStartSash,this.orthogonalEndSash=r.orthogonalEndSash,this.orientation=r.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",xyt),this.layout()}onPointerStart(e,n){Nn.stop(e);let r=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(r=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new F7(n)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new F7(n))),!this.state)return;const s=document.getElementsByTagName("iframe");for(const g of s)g.classList.add(Zme);const o=e.pageX,a=e.pageY,l=e.altKey,c={startX:o,currentX:o,startY:a,currentY:a,altKey:l};this.el.classList.add("active"),this._onDidStart.fire(c);const u=_h(this.el),d=()=>{let g="";r?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=ri?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=ri?"col-resize":"ew-resize",u.textContent=`* { cursor: ${g} !important; }`},h=new Xe;d(),r||this.onDidEnablementChange.event(d,null,h);const f=g=>{Nn.stop(g,!1);const m={startX:o,currentX:g.pageX,startY:a,currentY:g.pageY,altKey:l};this._onDidChange.fire(m)},p=g=>{Nn.stop(g,!1),this.el.removeChild(u),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of s)m.classList.remove(Zme)};n.onPointerMove(f,null,h),n.onPointerUp(p,null,h),h.add(n)}onPointerDoublePress(e){const n=this.getOrthogonalSash(e);n&&n._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,n=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!n&&e.linkedSash&&ja.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,n=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!n&&e.linkedSash&&ja.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){ja.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var n;const r=(n=e.initialTarget)!==null&&n!==void 0?n:e.target;if(!(!r||!(r instanceof HTMLElement))&&r.classList.contains("orthogonal-drag-handle"))return r.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const Iyt={separatorBorder:Te.transparent};class lRe{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,n){var r,s;e!==this.visible&&(e?(this.size=Kc(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof n=="number"?n:this.size,this.size=0),this.container.classList.toggle("visible",e),(s=(r=this.view).setVisible)===null||s===void 0||s.call(r,e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,n,r,s){this.container=e,this.view=n,this.disposable=s,this._cachedVisibleSize=void 0,typeof r=="number"?(this._size=r,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=r.cachedVisibleSize)}layout(e,n){this.layoutContainer(e),this.view.layout(this.size,e,n)}dispose(){this.disposable.dispose()}}class Tyt extends lRe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Ryt extends lRe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var L0;(function(i){i[i.Idle=0]="Idle",i[i.Busy=1]="Busy"})(L0||(L0={}));var B7;(function(i){i.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}i.Split=e;function n(s){return{type:"auto",index:s}}i.Auto=n;function r(s){return{type:"invisible",cachedVisibleSize:s}}i.Invisible=r})(B7||(B7={}));class cRe extends Le{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const n of this.sashItems)n.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const n of this.sashItems)n.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,n={}){var r,s,o,a,l;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=L0.Idle,this._onDidSashChange=this._register(new _e),this._onDidSashReset=this._register(new _e),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(r=n.orientation)!==null&&r!==void 0?r:0,this.inverseAltBehavior=(s=n.inverseAltBehavior)!==null&&s!==void 0?s:!1,this.proportionalLayout=(o=n.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=n.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=He(this.el,tt(".sash-container")),this.viewContainer=tt(".split-view-container"),this.scrollable=this._register(new M5({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:mh})),this.scrollableElement=this._register(new xoe(this.viewContainer,{vertical:this.orientation===0?(a=n.scrollbarVisibility)!==null&&a!==void 0?a:1:2,horizontal:this.orientation===1?(l=n.scrollbarVisibility)!==null&&l!==void 0?l:1:2},this.scrollable));const c=this._register(new Xn(this.viewContainer,"scroll")).event;this._register(c(u=>{const d=this.scrollableElement.getScrollPosition(),h=Math.abs(this.viewContainer.scrollLeft-d.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,f=Math.abs(this.viewContainer.scrollTop-d.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(h!==void 0||f!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:h,scrollTop:f})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(u=>{u.scrollTopChanged&&(this.viewContainer.scrollTop=u.scrollTop),u.scrollLeftChanged&&(this.viewContainer.scrollLeft=u.scrollLeft)})),He(this.el,this.scrollableElement.getDomNode()),this.style(n.styles||Iyt),n.descriptor&&(this.size=n.descriptor.size,n.descriptor.views.forEach((u,d)=>{const h=nu(u.visible)||u.visible?u.size:{type:"invisible",cachedVisibleSize:u.size},f=u.view;this.doAddView(f,h,d,!0)}),this.contentSize=this.viewItems.reduce((u,d)=>u+d.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,n,r=this.viewItems.length,s){this.doAddView(e,n,r,s)}layout(e,n){const r=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=n,this.proportions){let s=0;for(let o=0;o<this.viewItems.length;o++){const a=this.viewItems[o],l=this.proportions[o];typeof l=="number"?s+=l:e-=a.size}for(let o=0;o<this.viewItems.length;o++){const a=this.viewItems[o],l=this.proportions[o];typeof l=="number"&&(a.size=Kc(Math.round(l*e/s),a.minimumSize,a.maximumSize))}}else{const s=Tl(this.viewItems.length),o=s.filter(l=>this.viewItems[l].priority===1),a=s.filter(l=>this.viewItems[l].priority===2);this.resize(this.viewItems.length-1,e-r,void 0,o,a)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout?e.size/this.contentSize:void 0))}onSashStart({sash:e,start:n,alt:r}){for(const l of this.viewItems)l.enabled=!1;const s=this.sashItems.findIndex(l=>l.sash===e),o=Sf(Be(document.body,"keydown",l=>a(this.sashDragState.current,l.altKey)),Be(document.body,"keyup",()=>a(this.sashDragState.current,!1))),a=(l,c)=>{const u=this.viewItems.map(g=>g.size);let d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(c=!c),c)if(s===this.sashItems.length-1){const m=this.viewItems[s];d=(m.minimumSize-m.size)/2,h=(m.maximumSize-m.size)/2}else{const m=this.viewItems[s+1];d=(m.size-m.maximumSize)/2,h=(m.size-m.minimumSize)/2}let f,p;if(!c){const g=Tl(s,-1),m=Tl(s+1,this.viewItems.length),_=g.reduce((A,M)=>A+(this.viewItems[M].minimumSize-u[M]),0),b=g.reduce((A,M)=>A+(this.viewItems[M].viewMaximumSize-u[M]),0),y=m.length===0?Number.POSITIVE_INFINITY:m.reduce((A,M)=>A+(u[M]-this.viewItems[M].minimumSize),0),x=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((A,M)=>A+(u[M]-this.viewItems[M].viewMaximumSize),0),k=Math.max(_,x),D=Math.min(y,b),R=this.findFirstSnapIndex(g),E=this.findFirstSnapIndex(m);if(typeof R=="number"){const A=this.viewItems[R],M=Math.floor(A.viewMinimumSize/2);f={index:R,limitDelta:A.visible?k-M:k+M,size:A.size}}if(typeof E=="number"){const A=this.viewItems[E],M=Math.floor(A.viewMinimumSize/2);p={index:E,limitDelta:A.visible?D+M:D-M,size:A.size}}}this.sashDragState={start:l,current:l,index:s,sizes:u,minDelta:d,maxDelta:h,alt:c,snapBefore:f,snapAfter:p,disposable:o}};a(n,r)}onSashChange({current:e}){const{index:n,start:r,sizes:s,alt:o,minDelta:a,maxDelta:l,snapBefore:c,snapAfter:u}=this.sashDragState;this.sashDragState.current=e;const d=e-r,h=this.resize(n,d,s,void 0,void 0,a,l,c,u);if(o){const f=n===this.sashItems.length-1,p=this.viewItems.map(x=>x.size),g=f?n:n+1,m=this.viewItems[g],_=m.size-m.maximumSize,b=m.size-m.minimumSize,y=f?n-1:n+1;this.resize(y,-h,p,void 0,void 0,_,b)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const n of this.viewItems)n.enabled=!0}onViewChange(e,n){const r=this.viewItems.indexOf(e);r<0||r>=this.viewItems.length||(n=typeof n=="number"?n:e.size,n=Kc(n,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&r>0?(this.resize(r-1,Math.floor((e.size-n)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=n,this.relayout([r],void 0)))}resizeView(e,n){if(this.state!==L0.Idle)throw new Error("Cant modify splitview");if(this.state=L0.Busy,e<0||e>=this.viewItems.length)return;const r=Tl(this.viewItems.length).filter(l=>l!==e),s=[...r.filter(l=>this.viewItems[l].priority===1),e],o=r.filter(l=>this.viewItems[l].priority===2),a=this.viewItems[e];n=Math.round(n),n=Kc(n,a.minimumSize,Math.min(a.maximumSize,this.size)),a.size=n,this.relayout(s,o),this.state=L0.Idle}distributeViewSizes(){const e=[];let n=0;for(const l of this.viewItems)l.maximumSize-l.minimumSize>0&&(e.push(l),n+=l.size);const r=Math.floor(n/e.length);for(const l of e)l.size=Kc(r,l.minimumSize,l.maximumSize);const s=Tl(this.viewItems.length),o=s.filter(l=>this.viewItems[l].priority===1),a=s.filter(l=>this.viewItems[l].priority===2);this.relayout(o,a)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,n,r=this.viewItems.length,s){if(this.state!==L0.Idle)throw new Error("Cant modify splitview");this.state=L0.Busy;const o=tt(".split-view-view");r===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(r));const a=e.onDidChange(f=>this.onViewChange(d,f)),l=gn(()=>this.viewContainer.removeChild(o)),c=Sf(a,l);let u;typeof n=="number"?u=n:(n.type==="auto"&&(this.areViewsDistributed()?n={type:"distribute"}:n={type:"split",index:n.index}),n.type==="split"?u=this.getViewSize(n.index)/2:n.type==="invisible"?u={cachedVisibleSize:n.cachedVisibleSize}:u=e.minimumSize);const d=this.orientation===0?new Tyt(o,e,u,c):new Ryt(o,e,u,c);if(this.viewItems.splice(r,0,d),this.viewItems.length>1){const f={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},p=this.orientation===0?new ja(this.sashContainer,{getHorizontalSashTop:A=>this.getSashPosition(A),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},f),{orientation:1})):new ja(this.sashContainer,{getVerticalSashLeft:A=>this.getSashPosition(A),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},f),{orientation:0})),g=this.orientation===0?A=>({sash:p,start:A.startY,current:A.currentY,alt:A.altKey}):A=>({sash:p,start:A.startX,current:A.currentX,alt:A.altKey}),_=_t.map(p.onDidStart,g)(this.onSashStart,this),y=_t.map(p.onDidChange,g)(this.onSashChange,this),k=_t.map(p.onDidEnd,()=>this.sashItems.findIndex(A=>A.sash===p))(this.onSashEnd,this),D=p.onDidReset(()=>{const A=this.sashItems.findIndex(B=>B.sash===p),M=Tl(A,-1),N=Tl(A+1,this.viewItems.length),P=this.findFirstSnapIndex(M),O=this.findFirstSnapIndex(N);typeof P=="number"&&!this.viewItems[P].visible||typeof O=="number"&&!this.viewItems[O].visible||this._onDidSashReset.fire(A)}),R=Sf(_,y,k,D,p),E={sash:p,disposable:R};this.sashItems.splice(r-1,0,E)}o.appendChild(e.element);let h;typeof n!="number"&&n.type==="split"&&(h=[n.index]),s||this.relayout([r],h),this.state=L0.Idle,!s&&typeof n!="number"&&n.type==="distribute"&&this.distributeViewSizes()}relayout(e,n){const r=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-r,void 0,e,n),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,n,r=this.viewItems.map(d=>d.size),s,o,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,c,u){if(e<0||e>=this.viewItems.length)return 0;const d=Tl(e,-1),h=Tl(e+1,this.viewItems.length);if(o)for(const E of o)BU(d,E),BU(h,E);if(s)for(const E of s)A3(d,E),A3(h,E);const f=d.map(E=>this.viewItems[E]),p=d.map(E=>r[E]),g=h.map(E=>this.viewItems[E]),m=h.map(E=>r[E]),_=d.reduce((E,A)=>E+(this.viewItems[A].minimumSize-r[A]),0),b=d.reduce((E,A)=>E+(this.viewItems[A].maximumSize-r[A]),0),y=h.length===0?Number.POSITIVE_INFINITY:h.reduce((E,A)=>E+(r[A]-this.viewItems[A].minimumSize),0),x=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((E,A)=>E+(r[A]-this.viewItems[A].maximumSize),0),k=Math.max(_,x,a),D=Math.min(y,b,l);let R=!1;if(c){const E=this.viewItems[c.index],A=n>=c.limitDelta;R=A!==E.visible,E.setVisible(A,c.size)}if(!R&&u){const E=this.viewItems[u.index],A=n<u.limitDelta;R=A!==E.visible,E.setVisible(A,u.size)}if(R)return this.resize(e,n,r,s,o,a,l);n=Kc(n,k,D);for(let E=0,A=n;E<f.length;E++){const M=f[E],N=Kc(p[E]+A,M.minimumSize,M.maximumSize),P=N-p[E];A-=P,M.size=N}for(let E=0,A=n;E<g.length;E++){const M=g[E],N=Kc(m[E]-A,M.minimumSize,M.maximumSize),P=N-m[E];A+=P,M.size=N}return n}distributeEmptySpace(e){const n=this.viewItems.reduce((l,c)=>l+c.size,0);let r=this.size-n;const s=Tl(this.viewItems.length-1,-1),o=s.filter(l=>this.viewItems[l].priority===1),a=s.filter(l=>this.viewItems[l].priority===2);for(const l of a)BU(s,l);for(const l of o)A3(s,l);typeof e=="number"&&A3(s,e);for(let l=0;r!==0&&l<s.length;l++){const c=this.viewItems[s[l]],u=Kc(c.size+r,c.minimumSize,c.maximumSize),d=u-c.size;r-=d,c.size=u}}layoutViews(){this.contentSize=this.viewItems.reduce((n,r)=>n+r.size,0);let e=0;for(const n of this.viewItems)n.layout(e,this.layoutContext),e+=n.size;this.sashItems.forEach(n=>n.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const n=this.viewItems.map(c=>e=c.size-c.minimumSize>0||e);e=!1;const r=this.viewItems.map(c=>e=c.maximumSize-c.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const a=s.map(c=>e=c.maximumSize-c.size>0||e).reverse();let l=0;for(let c=0;c<this.sashItems.length;c++){const{sash:u}=this.sashItems[c],d=this.viewItems[c];l+=d.size;const h=!(n[c]&&a[c+1]),f=!(r[c]&&o[c+1]);if(h&&f){const p=Tl(c,-1),g=Tl(c+1,this.viewItems.length),m=this.findFirstSnapIndex(p),_=this.findFirstSnapIndex(g),b=typeof m=="number"&&!this.viewItems[m].visible,y=typeof _=="number"&&!this.viewItems[_].visible;b&&o[c]&&(l>0||this.startSnappingEnabled)?u.state=1:y&&n[c]&&(l<this.contentSize||this.endSnappingEnabled)?u.state=2:u.state=0}else h&&!f?u.state=1:!h&&f?u.state=2:u.state=3}}getSashPosition(e){let n=0;for(let r=0;r<this.sashItems.length;r++)if(n+=this.viewItems[r].size,this.sashItems[r].sash===e)return n;return 0}findFirstSnapIndex(e){for(const n of e){const r=this.viewItems[n];if(r.visible&&r.snap)return n}for(const n of e){const r=this.viewItems[n];if(r.visible&&r.maximumSize-r.minimumSize>0)return;if(!r.visible&&r.snap)return n}}areViewsDistributed(){let e,n;for(const r of this.viewItems)if(e=e===void 0?r.size:Math.min(e,r.size),n=n===void 0?r.size:Math.max(n,r.size),n-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),Mi(this.viewItems),this.viewItems=[],this.sashItems.forEach(n=>n.disposable.dispose()),this.sashItems=[],super.dispose()}}class H5{constructor(e,n,r){this.columns=e,this.getColumnSize=r,this.templateId=H5.TemplateId,this.renderedTemplates=new Set;const s=new Map(n.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const a=s.get(o.templateId);if(!a)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(a)}}renderTemplate(e){const n=He(e,tt(".monaco-table-tr")),r=[],s=[];for(let a=0;a<this.columns.length;a++){const l=this.renderers[a],c=He(n,tt(".monaco-table-td",{"data-col-index":a}));c.style.width=`${this.getColumnSize(a)}px`,r.push(c),s.push(l.renderTemplate(c))}const o={container:e,cellContainers:r,cellTemplateData:s};return this.renderedTemplates.add(o),o}renderElement(e,n,r,s){for(let o=0;o<this.columns.length;o++){const l=this.columns[o].project(e);this.renderers[o].renderElement(l,n,r.cellTemplateData[o],s)}}disposeElement(e,n,r,s){for(let o=0;o<this.columns.length;o++){const a=this.renderers[o];if(a.disposeElement){const c=this.columns[o].project(e);a.disposeElement(c,n,r.cellTemplateData[o],s)}}}disposeTemplate(e){for(let n=0;n<this.columns.length;n++)this.renderers[n].disposeTemplate(e.cellTemplateData[n]);la(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,n){for(const{cellContainers:r}of this.renderedTemplates)r[e].style.width=`${n}px`}}H5.TemplateId="row";function Ayt(i){return{getHeight(e){return i.getHeight(e)},getTemplateId(){return H5.TemplateId}}}class Nyt{get minimumSize(){var e;return(e=this.column.minimumWidth)!==null&&e!==void 0?e:120}get maximumSize(){var e;return(e=this.column.maximumWidth)!==null&&e!==void 0?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return(e=this.column.onDidChangeWidthConstraints)!==null&&e!==void 0?e:_t.None}constructor(e,n){this.column=e,this.index=n,this._onDidLayout=new _e,this.onDidLayout=this._onDidLayout.event,this.element=tt(".monaco-table-th",{"data-col-index":n,title:e.tooltip},e.label)}layout(e){this._onDidLayout.fire([this.index,e])}}class G${get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onDidScroll(){return this.list.onDidScroll}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollHeight(){return this.list.scrollHeight}get renderHeight(){return this.list.renderHeight}get onDidDispose(){return this.list.onDidDispose}constructor(e,n,r,s,o,a){this.virtualDelegate=r,this.domId=`table_id_${++G$.InstanceCount}`,this.disposables=new Xe,this.cachedWidth=0,this.cachedHeight=0,this.domNode=He(n,tt(`.monaco-table.${this.domId}`));const l=s.map((d,h)=>new Nyt(d,h)),c={size:l.reduce((d,h)=>d+h.column.weight,0),views:l.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new cRe(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:c})),this.splitview.el.style.height=`${r.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${r.headerRowHeight}px`;const u=new H5(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Bf(e,this.domNode,Ayt(r),[u],a)),_t.any(...l.map(d=>d.onDidLayout))(([d,h])=>u.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=s.reduce((p,g)=>p+g.weight,0),f=s[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,f)},null,this.disposables),this.styleElement=_h(this.domNode),this.style(Obt)}updateOptions(e){this.list.updateOptions(e)}splice(e,n,r=[]){this.list.splice(e,n,r)}getHTMLElement(){return this.domNode}style(e){const n=[];n.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {
top: ${this.virtualDelegate.headerRowHeight+1}px;
height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
}`),this.styleElement.textContent=n.join(`
`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}G$.InstanceCount=0;class qI extends Pf{constructor(e){super(),this._onChange=this._register(new _e),this.onChange=this._onChange.event,this._onKeyDown=this._register(new _e),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const n=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,n.push(...en.asClassNameArray(this._icon))),this._opts.actionClassName&&n.push(...this._opts.actionClassName.split(" ")),this._checked&&n.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...n),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,r=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),r.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,r=>{if(r.keyCode===10||r.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),r.preventDefault(),r.stopPropagation();return}this._onKeyDown.fire(r)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const Myt=L("caseDescription","Match Case"),Pyt=L("wordsDescription","Match Whole Word"),Oyt=L("regexDescription","Use Regular Expression");class uRe extends qI{constructor(e){super({icon:lt.caseSensitive,title:Myt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class dRe extends qI{constructor(e){super({icon:lt.wholeWord,title:Pyt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class hRe extends qI{constructor(e){super({icon:lt.regex,title:Oyt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Fyt{constructor(e,n=0,r=e.length,s=n-1){this.items=e,this.start=n,this.end=r,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class Byt{constructor(e=[],n=10){this._initialize(e),this._limit=n,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new Fyt(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const n of e)this._history.add(n)}get _elements(){const e=[];return this._history.forEach(n=>e.push(n)),e}}const JR=tt;let jyt=class extends Pf{constructor(e,n,r){var s;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new _e),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new _e),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=n,this.options=r,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(s=this.options.tooltip)!==null&&s!==void 0?s:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=He(e,JR(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",a=He(this.element,JR(".ibwrapper"));if(this.input=He(a,JR(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=He(a,JR("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new kIe(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),He(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(u=>this.input.scrollTop=u.scrollTop));const l=this._register(new Xn(document,"selectionchange")),c=_t.filter(l.event,()=>{const u=document.getSelection();return(u==null?void 0:u.anchorNode)===a});this._register(c(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new wh(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:gS(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,n=this.cachedHeight,r=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:n}),this.scrollableElement.setScrollPosition({scrollTop:r})}showMessage(e,n){if(this.state==="open"&&od(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const r=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${MS(r.border,"transparent")}`,this.message.content&&(this.hasFocus()||n)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const n=this.options.inputBoxStyles;switch(e){case 1:return{border:n.inputValidationInfoBorder,background:n.inputValidationInfoBackground,foreground:n.inputValidationInfoForeground};case 2:return{border:n.inputValidationWarningBorder,background:n.inputValidationWarningBackground,foreground:n.inputValidationWarningForeground};default:return{border:n.inputValidationErrorBorder,background:n.inputValidationErrorBackground,foreground:n.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const n=()=>e.style.width=dc(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{var o,a;if(!this.message)return null;e=He(s,JR(".monaco-inputbox-container")),n();const l={inline:!0,className:"monaco-inputbox-message"},c=this.message.formatContent?Zvt(this.message.content,l):Yvt(this.message.content,l);c.classList.add(this.classForType(this.message.type));const u=this.stylesForType(this.message.type);return c.style.backgroundColor=(o=u.background)!==null&&o!==void 0?o:"",c.style.color=(a=u.foreground)!==null&&a!==void 0?a:"",c.style.border=u.border?`1px solid ${u.border}`:"",He(e,c),null},onHide:()=>{this.state="closed"},layout:n});let r;this.message.type===3?r=L("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?r=L("alertWarningMessage","Warning: {0}",this.message.content):r=L("alertInfoMessage","Info: {0}",this.message.content),Ua(r),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,r=e.charCodeAt(e.length-1)===10?" ":"";(e+r).replace(/\u000c/g,"")?this.mirror.textContent=e+r:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,n,r;const s=this.options.inputBoxStyles,o=(e=s.inputBackground)!==null&&e!==void 0?e:"",a=(n=s.inputForeground)!==null&&n!==void 0?n:"",l=(r=s.inputBorder)!==null&&r!==void 0?r:"";this.element.style.backgroundColor=o,this.element.style.color=a,this.input.style.backgroundColor="inherit",this.input.style.color=a,this.element.style.border=`1px solid ${MS(l,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=gS(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const n=this.inputElement,r=n.selectionStart,s=n.selectionEnd,o=n.value;r!==null&&s!==null&&(this.value=o.substr(0,r)+e+o.substr(s),n.setSelectionRange(r+1,r+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class fRe extends jyt{constructor(e,n,r){const s=L({},"for history"),o=` or ⇅ ${s}`,a=` (⇅ ${s})`;super(e,n,r),this._onDidFocus=this._register(new _e),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new _e),this.onDidBlur=this._onDidBlur.event,this.history=new Byt(r.history,100);const l=()=>{if(r.showHistoryHint&&r.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(a)&&this.history.getHistory().length){const c=this.placeholder.endsWith(")")?o:a,u=this.placeholder+c;r.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=u:this.setPlaceHolder(u)}};this.observer=new MutationObserver((c,u)=>{c.forEach(d=>{d.target.textContent||l()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>l()),this.onblur(this.input,()=>{const c=u=>{if(this.placeholder.endsWith(u)){const d=this.placeholder.slice(0,this.placeholder.length-u.length);return r.showPlaceholderOnFocus?this.placeholder=d:this.setPlaceHolder(d),!0}else return!1};c(a)||c(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",v1(this.value?this.value:L("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,v1(this.value))}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const Wyt=L("defaultLabel","input");class pRe extends Pf{constructor(e,n,r){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new ha),this.additionalToggles=[],this._onDidOptionChange=this._register(new _e),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new _e),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new _e),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new _e),this._onKeyUp=this._register(new _e),this._onCaseSensitiveKeyDown=this._register(new _e),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new _e),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||Wyt,this.showCommonFindToggles=!!r.showCommonFindToggles;const s=r.appendCaseSensitiveLabel||"",o=r.appendWholeWordsLabel||"",a=r.appendRegexLabel||"",l=r.history||[],c=!!r.flexibleHeight,u=!!r.flexibleWidth,d=r.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new fRe(this.domNode,n,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:l,showHistoryHint:r.showHistoryHint,flexibleHeight:c,flexibleWidth:u,flexibleMaxHeight:d,inputBoxStyles:r.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new hRe(Object.assign({appendTitle:a,isChecked:!1},r.toggleStyles))),this._register(this.regex.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(f=>{this._onRegexKeyDown.fire(f)})),this.wholeWords=this._register(new dRe(Object.assign({appendTitle:o,isChecked:!1},r.toggleStyles))),this._register(this.wholeWords.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new uRe(Object.assign({appendTitle:s,isChecked:!1},r.toggleStyles))),this._register(this.caseSensitive.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(f=>{this._onCaseSensitiveKeyDown.fire(f)}));const h=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(15)||f.equals(17)||f.equals(9)){const p=h.indexOf(document.activeElement);if(p>=0){let g=-1;f.equals(17)?g=(p+1)%h.length:f.equals(15)&&(p===0?g=h.length-1:g=p-1),f.equals(9)?(h[p].blur(),this.inputBox.focus()):g>=0&&h[g].focus(),Nn.stop(f,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(r==null?void 0:r.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(Be(this.inputBox.inputElement,"compositionstart",h=>{this.imeSessionInProgress=!0})),this._register(Be(this.inputBox.inputElement,"compositionend",h=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,n,r;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(n=this.wholeWords)===null||n===void 0||n.enable(),(r=this.caseSensitive)===null||r===void 0||r.enable();for(const s of this.additionalToggles)s.enable()}disable(){var e,n,r;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(n=this.wholeWords)===null||n===void 0||n.disable(),(r=this.caseSensitive)===null||r===void 0||r.disable();for(const s of this.additionalToggles)s.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const n of this.additionalToggles)n.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new Xe;for(const n of e??[])this.additionalTogglesDisposables.value.add(n),this.controls.appendChild(n.domNode),this.additionalTogglesDisposables.value.add(n.onChange(r=>{this._onDidOptionChange.fire(r),!r&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(n);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var n,r,s,o,a,l;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((r=(n=this.caseSensitive)===null||n===void 0?void 0:n.width())!==null&&r!==void 0?r:0)+((o=(s=this.wholeWords)===null||s===void 0?void 0:s.width())!==null&&o!==void 0?o:0)+((l=(a=this.regex)===null||a===void 0?void 0:a.width())!==null&&l!==void 0?l:0)+this.additionalToggles.reduce((c,u)=>c+u.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,n;return(n=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&n!==void 0?n:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,n;return(n=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&n!==void 0?n:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,n;return(n=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&n!==void 0?n:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var Gg;(function(i){i[i.Expanded=0]="Expanded",i[i.Collapsed=1]="Collapsed",i[i.PreserveOrExpanded=2]="PreserveOrExpanded",i[i.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Gg||(Gg={}));var CS;(function(i){i[i.Unknown=0]="Unknown",i[i.Twistie=1]="Twistie",i[i.Element=2]="Element",i[i.Filter=3]="Filter"})(CS||(CS={}));class qu extends Error{constructor(e,n){super(`TreeError [${e}] ${n}`)}}class fae{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let n=this._map.get(e);return n||(n=this.fn(e),this._map.set(e,n)),n}}function pae(i){return typeof i=="object"&&"visibility"in i&&"data"in i}function UP(i){switch(i){case!0:return 1;case!1:return 0;default:return i}}function Zq(i){return typeof i.collapsible=="boolean"}class $yt{constructor(e,n,r,s={}){this.user=e,this.list=n,this.rootRef=[],this.eventBufferer=new Pse,this._onDidChangeCollapseState=new _e,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new _e,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new _e,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Rf(REe),this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element:r,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,n,r=Vn.empty(),s={}){if(e.length===0)throw new qu(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,n,r,s):this.spliceSimple(e,n,r,s)}spliceSmart(e,n,r,s,o,a){var l;s===void 0&&(s=Vn.empty()),a===void 0&&(a=(l=o.diffDepth)!==null&&l!==void 0?l:0);const{parentNode:c}=this.getParentNodeWithListIndex(n);if(!c.lastDiffIds)return this.spliceSimple(n,r,s,o);const u=[...s],d=n[n.length-1],h=new cm({getElements:()=>c.lastDiffIds},{getElements:()=>[...c.children.slice(0,d),...u,...c.children.slice(d+r)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(h.quitEarly)return c.lastDiffIds=void 0,this.spliceSimple(n,r,u,o);const f=n.slice(0,-1),p=(_,b,y)=>{if(a>0)for(let x=0;x<y;x++)_--,b--,this.spliceSmart(e,[...f,_,0],Number.MAX_SAFE_INTEGER,u[b].children,o,a-1)};let g=Math.min(c.children.length,d+r),m=u.length;for(const _ of h.changes.sort((b,y)=>y.originalStart-b.originalStart))p(g,m,g-(_.originalStart+_.originalLength)),g=_.originalStart,m=_.modifiedStart-d,this.spliceSimple([...f,g],_.originalLength,Vn.slice(u,m,m+_.modifiedLength),o);p(g,m,g)}spliceSimple(e,n,r=Vn.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:a}){const{parentNode:l,listIndex:c,revealed:u,visible:d}=this.getParentNodeWithListIndex(e),h=[],f=Vn.map(r,E=>this.createTreeNode(E,l,l.visible?1:0,u,h,s)),p=e[e.length-1],g=l.children.length>0;let m=0;for(let E=p;E>=0&&E<l.children.length;E--){const A=l.children[E];if(A.visible){m=A.visibleChildIndex;break}}const _=[];let b=0,y=0;for(const E of f)_.push(E),y+=E.renderNodeCount,E.visible&&(E.visibleChildIndex=m+b++);const x=Pfe(l.children,p,n,_);a?l.lastDiffIds?Pfe(l.lastDiffIds,p,n,_.map(E=>a.getId(E.element).toString())):l.lastDiffIds=l.children.map(E=>a.getId(E.element).toString()):l.lastDiffIds=void 0;let k=0;for(const E of x)E.visible&&k++;if(k!==0)for(let E=p+_.length;E<l.children.length;E++){const A=l.children[E];A.visible&&(A.visibleChildIndex-=k)}if(l.visibleChildrenCount+=b-k,u&&d){const E=x.reduce((A,M)=>A+(M.visible?M.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(l,y-E),this.list.splice(c,E,h)}if(x.length>0&&o){const E=A=>{o(A),A.children.forEach(E)};x.forEach(E)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:x});const D=l.children.length>0;g!==D&&this.setCollapsible(e.slice(0,-1),D);let R=l;for(;R;){if(R.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}R=R.parent}}rerender(e){if(e.length===0)throw new qu(this.user,"Invalid tree location");const{node:n,listIndex:r,revealed:s}=this.getTreeNodeWithListIndex(e);n.visible&&s&&this.list.splice(r,1,[n])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:n,visible:r,revealed:s}=this.getTreeNodeWithListIndex(e);return r&&s?n:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,n){const r=this.getTreeNode(e);typeof n>"u"&&(n=!r.collapsible);const s={collapsible:n};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,n,r){const s=this.getTreeNode(e);typeof n>"u"&&(n=!s.collapsed);const o={collapsed:n,recursive:r||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,n){const{node:r,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),a=this._setListNodeCollapseState(r,s,o,n);if(r!==this.root&&this.autoExpandSingleChildren&&a&&!Zq(n)&&r.collapsible&&!r.collapsed&&!n.recursive){let l=-1;for(let c=0;c<r.children.length;c++)if(r.children[c].visible)if(l>-1){l=-1;break}else l=c;l>-1&&this._setCollapseState([...e,l],n)}return a}_setListNodeCollapseState(e,n,r,s){const o=this._setNodeCollapseState(e,s,!1);if(!r||!e.visible||!o)return o;const a=e.renderNodeCount,l=this.updateNodeAfterCollapseChange(e),c=a-(n===-1?0:1);return this.list.splice(n+1,c,l.slice(1)),o}_setNodeCollapseState(e,n,r){let s;if(e===this.root?s=!1:(Zq(n)?(s=e.collapsible!==n.collapsible,e.collapsible=n.collapsible):e.collapsible?(s=e.collapsed!==n.collapsed,e.collapsed=n.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:r})),!Zq(n)&&n.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,n,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let n=this.getTreeNode(e);for(;n.parent;)n=n.parent,e=e.slice(0,e.length-1),n.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,n=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,n),this.refilterDelayer.cancel()}createTreeNode(e,n,r,s,o,a){const l={parent:n,element:e.element,children:[],depth:n.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},c=this._filterNode(l,r);l.visibility=c,s&&o.push(l);const u=e.children||Vn.empty(),d=s&&c!==0&&!l.collapsed;let h=0,f=1;for(const p of u){const g=this.createTreeNode(p,l,c,d,o,a);l.children.push(g),f+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=h++)}return l.collapsible=l.collapsible||l.children.length>0,l.visibleChildrenCount=h,l.visible=c===2?h>0:c===1,l.visible?l.collapsed||(l.renderNodeCount=f):(l.renderNodeCount=0,s&&o.pop()),a==null||a(l),l}updateNodeAfterCollapseChange(e){const n=e.renderNodeCount,r=[];return this._updateNodeAfterCollapseChange(e,r),this._updateAncestorsRenderNodeCount(e.parent,r.length-n),r}_updateNodeAfterCollapseChange(e,n){if(e.visible===!1)return 0;if(n.push(e),e.renderNodeCount=1,!e.collapsed)for(const r of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(r,n);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const n=e.renderNodeCount,r=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,r),this._updateAncestorsRenderNodeCount(e.parent,r.length-n),r}_updateNodeAfterFilterChange(e,n,r,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,n),o===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&r.push(e)}const a=r.length;e.renderNodeCount=e===this.root?0:1;let l=!1;if(!e.collapsed||o!==0){let c=0;for(const u of e.children)l=this._updateNodeAfterFilterChange(u,o,r,s&&!e.collapsed)||l,u.visible&&(u.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?l:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=r.length-a):(e.renderNodeCount=0,s&&r.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,n){if(n!==0)for(;e;)e.renderNodeCount+=n,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,n){const r=this.filter?this.filter.filter(e.element,n):1;return typeof r=="boolean"?(e.filterData=void 0,r?1:0):pae(r)?(e.filterData=r.data,UP(r.visibility)):(e.filterData=void 0,UP(r))}hasTreeNode(e,n=this.root){if(!e||e.length===0)return!0;const[r,...s]=e;return r<0||r>n.children.length?!1:this.hasTreeNode(s,n.children[r])}getTreeNode(e,n=this.root){if(!e||e.length===0)return n;const[r,...s]=e;if(r<0||r>n.children.length)throw new qu(this.user,"Invalid tree location");return this.getTreeNode(s,n.children[r])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:n,listIndex:r,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),a=e[e.length-1];if(a<0||a>n.children.length)throw new qu(this.user,"Invalid tree location");const l=n.children[a];return{node:l,listIndex:r,revealed:s,visible:o&&l.visible}}getParentNodeWithListIndex(e,n=this.root,r=0,s=!0,o=!0){const[a,...l]=e;if(a<0||a>n.children.length)throw new qu(this.user,"Invalid tree location");for(let c=0;c<a;c++)r+=n.children[c].renderNodeCount;return s=s&&!n.collapsed,o=o&&n.visible,l.length===0?{parentNode:n,listIndex:r,revealed:s,visible:o}:this.getParentNodeWithListIndex(l,n.children[a],r+1,s,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const n=[];let r=e;for(;r.parent;)n.push(r.parent.children.indexOf(r)),r=r.parent;return n.reverse()}getParentNodeLocation(e){if(e.length!==0)return e.length===1?[]:brt(e)[0]}getFirstElementChild(e){const n=this.getTreeNode(e);if(n.children.length!==0)return n.children[0].element}}class zyt extends V5{constructor(e){super(e.elements.map(n=>n.element)),this.data=e}}function Qq(i){return i instanceof V5?new zyt(i):i}class Vyt{constructor(e,n){this.modelProvider=e,this.dnd=n,this.autoExpandDisposable=Le.None,this.disposables=new Xe}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,n){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(r=>r.element),n)}onDragStart(e,n){var r,s;(s=(r=this.dnd).onDragStart)===null||s===void 0||s.call(r,Qq(e),n)}onDragOver(e,n,r,s,o=!0){const a=this.dnd.onDragOver(Qq(e),n&&n.element,r,s),l=this.autoExpandNode!==n;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=n),typeof n>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=g1(()=>{const f=this.modelProvider(),p=f.getNodeLocation(n);f.isCollapsed(p)&&f.setCollapsed(p,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!o){const f=typeof a=="boolean"?a:a.accept,p=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:p,feedback:[r]}}return a}if(a.bubble===1){const f=this.modelProvider(),p=f.getNodeLocation(n),g=f.getParentNodeLocation(p),m=f.getNode(g),_=g&&f.getListIndex(g);return this.onDragOver(e,m,_,s,!1)}const c=this.modelProvider(),u=c.getNodeLocation(n),d=c.getListIndex(u),h=c.getListRenderCount(u);return Object.assign(Object.assign({},a),{feedback:Tl(d,d+h)})}drop(e,n,r,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(Qq(e),n&&n.element,r,s)}onDragEnd(e){var n,r;(r=(n=this.dnd).onDragEnd)===null||r===void 0||r.call(n,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Hyt(i,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(n){return e.identityProvider.getId(n.element)}},dnd:e.dnd&&new Vyt(i,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(n){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},n),{element:n.element}))},isSelectionRangeChangeEvent(n){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},n),{element:n.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(n){const r=i(),s=r.getNodeLocation(n),o=r.getParentNodeLocation(s);return r.getNode(o).visibleChildrenCount},getPosInSet(n){return n.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?n=>e.accessibilityProvider.isChecked(n.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?n=>e.accessibilityProvider.getRole(n.element):()=>"treeitem",getAriaLabel(n){return e.accessibilityProvider.getAriaLabel(n.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?n=>e.accessibilityProvider.getAriaLevel(n.element):n=>n.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(n=>e.accessibilityProvider.getActiveDescendantId(n.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(n){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n.element)}})})}class gae{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,n){var r,s;(s=(r=this.delegate).setDynamicHeight)===null||s===void 0||s.call(r,e.element,n)}}var qP;(function(i){i.None="none",i.OnHover="onHover",i.Always="always"})(qP||(qP={}));class Uyt{get elements(){return this._elements}constructor(e,n=[]){this._elements=n,this.disposables=new Xe,this.onDidChange=_t.forEach(e,r=>this._elements=r,this.disposables)}dispose(){this.disposables.dispose()}}class KP{constructor(e,n,r,s,o,a={}){var l;this.renderer=e,this.modelProvider=n,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=KP.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Le.None,this.disposables=new Xe,this.templateId=e.templateId,this.updateOptions(a),_t.map(r,c=>c.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(l=e.onDidChangeTwistieState)===null||l===void 0||l.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const n=Kc(e.indent,0,40);if(n!==this.indent){this.indent=n;for(const[r,s]of this.renderedNodes)this.renderTreeElement(r,s)}}if(typeof e.renderIndentGuides<"u"){const n=e.renderIndentGuides!==qP.None;if(n!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=n;for(const[r,s]of this.renderedNodes)this._renderIndentGuides(r,s);if(this.indentGuidesDisposable.dispose(),n){const r=new Xe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,r),this.indentGuidesDisposable=r,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const n=He(e,tt(".monaco-tl-row")),r=He(n,tt(".monaco-tl-indent")),s=He(n,tt(".monaco-tl-twistie")),o=He(n,tt(".monaco-tl-contents")),a=this.renderer.renderTemplate(o);return{container:e,indent:r,twistie:s,indentGuidesDisposable:Le.None,templateData:a}}renderElement(e,n,r,s){this.renderedNodes.set(e,r),this.renderedElements.set(e.element,e),this.renderTreeElement(e,r),this.renderer.renderElement(e,n,r.templateData,s)}disposeElement(e,n,r,s){var o,a;r.indentGuidesDisposable.dispose(),(a=(o=this.renderer).disposeElement)===null||a===void 0||a.call(o,e,n,r.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const n=this.renderedElements.get(e);n&&this.onDidChangeNodeTwistieState(n)}onDidChangeNodeTwistieState(e){const n=this.renderedNodes.get(e);n&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,n))}renderTreeElement(e,n){const r=KP.DefaultIndent+(e.depth-1)*this.indent;n.twistie.style.paddingLeft=`${r}px`,n.indent.style.width=`${r+this.indent-16}px`,e.collapsible?n.container.setAttribute("aria-expanded",String(!e.collapsed)):n.container.removeAttribute("aria-expanded"),n.twistie.classList.remove(...en.asClassNameArray(lt.treeItemExpanded));let s=!1;this.renderer.renderTwistie&&(s=this.renderer.renderTwistie(e.element,n.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(s||n.twistie.classList.add(...en.asClassNameArray(lt.treeItemExpanded)),n.twistie.classList.add("collapsible"),n.twistie.classList.toggle("collapsed",e.collapsed)):n.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,n)}_renderIndentGuides(e,n){if(la(n.indent),n.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const r=new Xe,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),a=s.getParentNodeLocation(o);if(!a)break;const l=s.getNode(a),c=tt(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(l)&&c.classList.add("active"),n.indent.childElementCount===0?n.indent.appendChild(c):n.indent.insertBefore(c,n.indent.firstElementChild),this.renderedIndentGuides.add(l,c),r.add(gn(()=>this.renderedIndentGuides.delete(l,c))),e=l}n.indentGuidesDisposable=r}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const n=new Set,r=this.modelProvider();e.forEach(s=>{const o=r.getNodeLocation(s);try{const a=r.getParentNodeLocation(o);s.collapsible&&s.children.length>0&&!s.collapsed?n.add(s):a&&n.add(r.getNode(a))}catch{}}),this.activeIndentNodes.forEach(s=>{n.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.remove("active"))}),n.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.add("active"))}),this.activeIndentNodes=n}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Mi(this.disposables)}}KP.DefaultIndent=8;class qyt{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,n,r){this.tree=e,this.keyboardNavigationLabelProvider=n,this._filter=r,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Xe,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,n){let r=1;if(this._filter){const a=this._filter.filter(e,n);if(typeof a=="boolean"?r=a?1:0:pae(a)?r=UP(a.visibility):r=a,r===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:Hp.Default,visibility:r};const s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const a of o){const l=a&&a.toString();if(typeof l>"u")return{data:Hp.Default,visibility:r};let c;if(this.tree.findMatchType===_x.Contiguous){const u=l.toLowerCase().indexOf(this._lowercasePattern);if(u>-1){c=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)c.push(u+d-1)}}else c=gx(this._pattern,this._lowercasePattern,0,l,l.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(c)return this._matchCount++,o.length===1?{data:c,visibility:r}:{data:{label:l,score:c},visibility:r}}return this.tree.findMode===Lm.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:Hp.Default,visibility:r}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Mi(this.disposables)}}var Lm;(function(i){i[i.Highlight=0]="Highlight",i[i.Filter=1]="Filter"})(Lm||(Lm={}));var _x;(function(i){i[i.Fuzzy=0]="Fuzzy",i[i.Contiguous=1]="Contiguous"})(_x||(_x={}));let Kyt=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,n,r,s,o,a={}){var l,c;this.tree=e,this.view=r,this.filter=s,this.contextViewProvider=o,this.options=a,this._pattern="",this.width=0,this._onDidChangeMode=new _e,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new _e,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new _e,this._onDidChangeOpenState=new _e,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Xe,this.disposables=new Xe,this._mode=(l=e.options.defaultFindMode)!==null&&l!==void 0?l:Lm.Highlight,this._matchType=(c=e.options.defaultFindMatchType)!==null&&c!==void 0?c:_x.Fuzzy,n.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,n,r,s;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(n=this.widget)===null||n===void 0||n.showMessage({type:2,content:L("not found","No elements found.")}):(r=this.widget)===null||r===void 0||r.showMessage({type:2}):(s=this.widget)===null||s===void 0||s.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===Lm.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!Hp.isDefault(e.filterData)}layout(e){var n;this.width=e,(n=this.widget)===null||n===void 0||n.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function Qme(i){let e=CS.Unknown;return eq(i.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=CS.Twistie:eq(i.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=CS.Element:eq(i.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=CS.Filter),{browserEvent:i.browserEvent,element:i.element?i.element.element:null,target:e}}function S8(i,e){e(i),i.children.forEach(n=>S8(n,e))}class Jq{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,n){this.getFirstViewElementWithTrait=e,this.identityProvider=n,this.nodes=[],this._onDidChange=new _e,this.onDidChange=this._onDidChange.event}set(e,n){!(n!=null&&n.__forceEvent)&&ys(this.nodes,e)||this._set(e,!1,n)}_set(e,n,r){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!n){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:r})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:n}){if(!this.identityProvider){const c=this.createNodeSet(),u=d=>c.delete(d);n.forEach(d=>S8(d,u)),this.set([...c.values()]);return}const r=new Set,s=c=>r.add(this.identityProvider.getId(c.element).toString());n.forEach(c=>S8(c,s));const o=new Map,a=c=>o.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>S8(c,a));const l=[];for(const c of this.nodes){const u=this.identityProvider.getId(c.element).toString();if(!r.has(u))l.push(c);else{const h=o.get(u);h&&h.visible&&l.push(h)}}if(this.nodes.length>0&&l.length===0){const c=this.getFirstViewElementWithTrait();c&&l.push(c)}this._set(l,!0)}createNodeSet(){const e=new Set;for(const n of this.nodes)e.add(n);return e}}class Gyt extends eRe{constructor(e,n){super(e),this.tree=n}onViewPointer(e){if(YTe(e.browserEvent.target)||qy(e.browserEvent.target)||v2(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const n=e.element;if(!n)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const r=e.browserEvent.target,s=r.classList.contains("monaco-tl-twistie")||r.classList.contains("monaco-icon-label")&&r.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(n.element):o=!!this.tree.expandOnlyOnTwistieClick,o&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(n.collapsible){const a=this.tree.getNodeLocation(n),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),o&&s){e.browserEvent.isHandledByList=!0;return}}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}}class Xyt extends Bf{constructor(e,n,r,s,o,a,l,c){super(e,n,r,s,c),this.focusTrait=o,this.selectionTrait=a,this.anchorTrait=l}createMouseController(e){return new Gyt(this,e.tree)}splice(e,n,r=[]){if(super.splice(e,n,r),r.length===0)return;const s=[],o=[];let a;r.forEach((l,c)=>{this.focusTrait.has(l)&&s.push(e+c),this.selectionTrait.has(l)&&o.push(e+c),this.anchorTrait.has(l)&&(a=e+c)}),s.length>0&&super.setFocus(l1([...super.getFocus(),...s])),o.length>0&&super.setSelection(l1([...super.getSelection(),...o])),typeof a=="number"&&super.setAnchor(a)}setFocus(e,n,r=!1){super.setFocus(e,n),r||this.focusTrait.set(e.map(s=>this.element(s)),n)}setSelection(e,n,r=!1){super.setSelection(e,n),r||this.selectionTrait.set(e.map(s=>this.element(s)),n)}setAnchor(e,n=!1){super.setAnchor(e),n||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class gRe{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return _t.filter(_t.map(this.view.onMouseDblClick,Qme),e=>e.target!==CS.Filter)}get onPointer(){return _t.map(this.view.onPointer,Qme)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return _t.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,n;return(n=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&n!==void 0?n:Lm.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,n;return(n=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&n!==void 0?n:_x.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,n,r,s,o={}){var a;this._user=e,this._options=o,this.eventBufferer=new Pse,this.onDidChangeFindOpenState=_t.None,this.disposables=new Xe,this._onWillRefilter=new _e,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new _e;const l=new gae(r),c=new zfe,u=new zfe,d=this.disposables.add(new Uyt(u.event)),h=new roe;this.renderers=s.map(_=>new KP(_,()=>this.model,c.event,d,h,o));for(const _ of this.renderers)this.disposables.add(_);let f;o.keyboardNavigationLabelProvider&&(f=new qyt(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:f}),this.disposables.add(f)),this.focus=new Jq(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new Jq(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new Jq(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new Xyt(e,n,l,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},Hyt(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),c.input=this.model.onDidChangeCollapseState;const p=_t.forEach(this.model.onDidSplice,_=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(_),this.selection.onDidModelSplice(_)})},this.disposables);p(()=>null,null,this.disposables);const g=this.disposables.add(new _e),m=this.disposables.add(new Rf(0));if(this.disposables.add(_t.any(p,this.focus.onDidChange,this.selection.onDidChange)(()=>{m.trigger(()=>{const _=new Set;for(const b of this.focus.getNodes())_.add(b);for(const b of this.selection.getNodes())_.add(b);g.fire([..._.values()])})})),u.input=g.event,o.keyboardSupport!==!1){const _=_t.chain(this.view.onKeyDown,b=>b.filter(y=>!qy(y.target)).map(y=>new yr(y)));_t.chain(_,b=>b.filter(y=>y.keyCode===15))(this.onLeftArrow,this,this.disposables),_t.chain(_,b=>b.filter(y=>y.keyCode===17))(this.onRightArrow,this,this.disposables),_t.chain(_,b=>b.filter(y=>y.keyCode===10))(this.onSpace,this,this.disposables)}if((!((a=o.findWidgetEnabled)!==null&&a!==void 0)||a)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const _=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new Kyt(this,this.model,this.view,f,o.contextViewProvider,_),this.focusNavigationFilter=b=>this.findController.shouldAllowFocus(b),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=_t.None,this.onDidChangeFindMatchType=_t.None;this.styleElement=_h(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===qP.Always)}updateOptions(e={}){var n;this._options=Object.assign(Object.assign({},this._options),e);for(const r of this.renderers)r.updateOptions(e);this.view.updateOptions(this._options),(n=this.findController)===null||n===void 0||n.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===qP.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,n){var r;this.view.layout(e,n),c1(n)&&((r=this.findController)===null||r===void 0||r.layout(n))}style(e){const n=`.${this.view.domId}`,r=[];e.treeIndentGuidesStroke&&(r.push(`.monaco-list${n}:hover .monaco-tl-indent > .indent-guide, .monaco-list${n}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),r.push(`.monaco-list${n} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=r.join(`
`),this.view.style(e)}getParentElement(e){const n=this.model.getParentNodeLocation(e);return this.model.getNode(n).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,n=!1){return this.model.setCollapsed(e,!0,n)}expand(e,n=!1){return this.model.setCollapsed(e,!1,n)}toggleCollapsed(e,n=!1){return this.model.setCollapsed(e,void 0,n)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,n){return this.model.setCollapsible(e,n)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,n){const r=e.map(o=>this.model.getNode(o));this.selection.set(r,n);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,n,!0)}getSelection(){return this.selection.get()}setFocus(e,n){const r=e.map(o=>this.model.getNode(o));this.focus.set(r,n);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,n,!0)}getFocus(){return this.focus.get()}reveal(e,n){this.model.expandTo(e);const r=this.model.getListIndex(e);r!==-1&&this.view.reveal(r,n)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const n=this.view.getFocusedElements();if(n.length===0)return;const r=n[0],s=this.model.getNodeLocation(r);if(!this.model.setCollapsed(s,!0)){const a=this.model.getParentNodeLocation(s);if(!a)return;const l=this.model.getListIndex(a);this.view.reveal(l),this.view.setFocus([l])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const n=this.view.getFocusedElements();if(n.length===0)return;const r=n[0],s=this.model.getNodeLocation(r);if(!this.model.setCollapsed(s,!1)){if(!r.children.some(c=>c.visible))return;const[a]=this.view.getFocus(),l=a+1;this.view.reveal(l),this.view.setFocus([l])}}onSpace(e){e.preventDefault(),e.stopPropagation();const n=this.view.getFocusedElements();if(n.length===0)return;const r=n[0],s=this.model.getNodeLocation(r),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}dispose(){Mi(this.disposables),this.view.dispose()}}class mae{constructor(e,n,r={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new $yt(e,n,null,r),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,r.sorter&&(this.sorter={compare(s,o){return r.sorter.compare(s.element,o.element)}}),this.identityProvider=r.identityProvider}setChildren(e,n=Vn.empty(),r={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(n),r)}_setChildren(e,n=Vn.empty(),r){const s=new Set,o=new Set,a=c=>{var u;if(c.element===null)return;const d=c;if(s.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const h=this.identityProvider.getId(d.element).toString();o.add(h),this.nodesByIdentity.set(h,d)}(u=r.onDidCreateNode)===null||u===void 0||u.call(r,d)},l=c=>{var u;if(c.element===null)return;const d=c;if(s.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const h=this.identityProvider.getId(d.element).toString();o.has(h)||this.nodesByIdentity.delete(h)}(u=r.onDidDeleteNode)===null||u===void 0||u.call(r,d)};this.model.splice([...e,0],Number.MAX_VALUE,n,Object.assign(Object.assign({},r),{onDidCreateNode:a,onDidDeleteNode:l}))}preserveCollapseState(e=Vn.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Vn.map(e,n=>{let r=this.nodes.get(n.element);if(!r&&this.identityProvider){const a=this.identityProvider.getId(n.element).toString();r=this.nodesByIdentity.get(a)}if(!r){let a;return typeof n.collapsed>"u"?a=void 0:n.collapsed===Gg.Collapsed||n.collapsed===Gg.PreserveOrCollapsed?a=!0:n.collapsed===Gg.Expanded||n.collapsed===Gg.PreserveOrExpanded?a=!1:a=!!n.collapsed,Object.assign(Object.assign({},n),{children:this.preserveCollapseState(n.children),collapsed:a})}const s=typeof n.collapsible=="boolean"?n.collapsible:r.collapsible;let o;return typeof n.collapsed>"u"||n.collapsed===Gg.PreserveOrCollapsed||n.collapsed===Gg.PreserveOrExpanded?o=r.collapsed:n.collapsed===Gg.Collapsed?o=!0:n.collapsed===Gg.Expanded?o=!1:o=!!n.collapsed,Object.assign(Object.assign({},n),{collapsible:s,collapsed:o,children:this.preserveCollapseState(n.children)})})}rerender(e){const n=this.getElementLocation(e);this.model.rerender(n)}getFirstElementChild(e=null){const n=this.getElementLocation(e);return this.model.getFirstElementChild(n)}has(e){return this.nodes.has(e)}getListIndex(e){const n=this.getElementLocation(e);return this.model.getListIndex(n)}getListRenderCount(e){const n=this.getElementLocation(e);return this.model.getListRenderCount(n)}isCollapsible(e){const n=this.getElementLocation(e);return this.model.isCollapsible(n)}setCollapsible(e,n){const r=this.getElementLocation(e);return this.model.setCollapsible(r,n)}isCollapsed(e){const n=this.getElementLocation(e);return this.model.isCollapsed(n)}setCollapsed(e,n,r){const s=this.getElementLocation(e);return this.model.setCollapsed(s,n,r)}expandTo(e){const n=this.getElementLocation(e);this.model.expandTo(n)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const n=this.nodes.get(e);if(!n)throw new qu(this.user,`Tree element not found: ${e}`);return n}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new qu(this.user,"Invalid getParentNodeLocation call");const n=this.nodes.get(e);if(!n)throw new qu(this.user,`Tree element not found: ${e}`);const r=this.model.getNodeLocation(n),s=this.model.getParentNodeLocation(r);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const n=this.nodes.get(e);if(!n)throw new qu(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(n)}}function x8(i){const e=[i.element],n=i.incompressible||!1;return{element:{elements:e,incompressible:n},children:Vn.map(Vn.from(i.children),x8),collapsible:i.collapsible,collapsed:i.collapsed}}function k8(i){const e=[i.element],n=i.incompressible||!1;let r,s;for(;[s,r]=Vn.consume(Vn.from(i.children),2),!(s.length!==1||s[0].incompressible);)i=s[0],e.push(i.element);return{element:{elements:e,incompressible:n},children:Vn.map(Vn.concat(s,r),k8),collapsible:i.collapsible,collapsed:i.collapsed}}function Oee(i,e=0){let n;return e<i.element.elements.length-1?n=[Oee(i,e+1)]:n=Vn.map(Vn.from(i.children),r=>Oee(r,0)),e===0&&i.element.incompressible?{element:i.element.elements[e],children:n,incompressible:!0,collapsible:i.collapsible,collapsed:i.collapsed}:{element:i.element.elements[e],children:n,collapsible:i.collapsible,collapsed:i.collapsed}}function Jme(i){return Oee(i,0)}function mRe(i,e,n){return i.element===e?Object.assign(Object.assign({},i),{children:n}):Object.assign(Object.assign({},i),{children:Vn.map(Vn.from(i.children),r=>mRe(r,e,n))})}const Yyt=i=>({getId(e){return e.elements.map(n=>i.getId(n).toString()).join("\0")}});class Zyt{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,n,r={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new mae(e,n,r),this.enabled=typeof r.compressionEnabled>"u"?!0:r.compressionEnabled,this.identityProvider=r.identityProvider}setChildren(e,n=Vn.empty(),r){const s=r.diffIdentityProvider&&Yyt(r.diffIdentityProvider);if(e===null){const g=Vn.map(n,this.enabled?k8:x8);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new qu(this.user,"Unknown compressed tree node");const a=this.model.getNode(o),l=this.model.getParentNodeLocation(o),c=this.model.getNode(l),u=Jme(a),d=mRe(u,e,n),h=(this.enabled?k8:x8)(d),f=r.diffIdentityProvider?(g,m)=>r.diffIdentityProvider.getId(g)===r.diffIdentityProvider.getId(m):void 0;if(ys(h.element.elements,a.element.elements,f)){this._setChildren(o,h.children||Vn.empty(),{diffIdentityProvider:s,diffDepth:1});return}const p=c.children.map(g=>g===a?h:g);this._setChildren(c.element,p,{diffIdentityProvider:s,diffDepth:a.depth-c.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const r=this.model.getNode().children,s=Vn.map(r,Jme),o=Vn.map(s,e?k8:x8);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,n,r){const s=new Set,o=l=>{for(const c of l.element.elements)s.add(c),this.nodes.set(c,l.element)},a=l=>{for(const c of l.element.elements)s.has(c)||this.nodes.delete(c)};this.model.setChildren(e,n,Object.assign(Object.assign({},r),{onDidCreateNode:o,onDidDeleteNode:a}))}has(e){return this.nodes.has(e)}getListIndex(e){const n=this.getCompressedNode(e);return this.model.getListIndex(n)}getListRenderCount(e){const n=this.getCompressedNode(e);return this.model.getListRenderCount(n)}getNode(e){if(typeof e>"u")return this.model.getNode();const n=this.getCompressedNode(e);return this.model.getNode(n)}getNodeLocation(e){const n=this.model.getNodeLocation(e);return n===null?null:n.elements[n.elements.length-1]}getParentNodeLocation(e){const n=this.getCompressedNode(e),r=this.model.getParentNodeLocation(n);return r===null?null:r.elements[r.elements.length-1]}getFirstElementChild(e){const n=this.getCompressedNode(e);return this.model.getFirstElementChild(n)}isCollapsible(e){const n=this.getCompressedNode(e);return this.model.isCollapsible(n)}setCollapsible(e,n){const r=this.getCompressedNode(e);return this.model.setCollapsible(r,n)}isCollapsed(e){const n=this.getCompressedNode(e);return this.model.isCollapsed(n)}setCollapsed(e,n,r){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,n,r)}expandTo(e){const n=this.getCompressedNode(e);this.model.expandTo(n)}rerender(e){const n=this.getCompressedNode(e);this.model.rerender(n)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const n=this.nodes.get(e);if(!n)throw new qu(this.user,`Tree element not found: ${e}`);return n}}const Qyt=i=>i[i.length-1];class _ae{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new _ae(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,n){this.unwrapper=e,this.node=n}}function Jyt(i,e){return{splice(n,r,s){e.splice(n,r,s.map(o=>i.map(o)))},updateElementHeight(n,r){e.updateElementHeight(n,r)}}}function e1t(i,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(n){return e.identityProvider.getId(i(n))}},sorter:e.sorter&&{compare(n,r){return e.sorter.compare(n.elements[0],r.elements[0])}},filter:e.filter&&{filter(n,r){return e.filter.filter(i(n),r)}}})}class t1t{get onDidSplice(){return _t.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:n})=>({insertedNodes:e.map(r=>this.nodeMapper.map(r)),deletedNodes:n.map(r=>this.nodeMapper.map(r))}))}get onDidChangeCollapseState(){return _t.map(this.model.onDidChangeCollapseState,({node:e,deep:n})=>({node:this.nodeMapper.map(e),deep:n}))}get onDidChangeRenderNodeCount(){return _t.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,n,r={}){this.rootRef=null,this.elementMapper=r.elementMapper||Qyt;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new fae(o=>new _ae(s,o)),this.model=new Zyt(e,Jyt(this.nodeMapper,n),e1t(s,r))}setChildren(e,n=Vn.empty(),r={}){this.model.setChildren(e,n,r)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const n=this.model.getFirstElementChild(e);return n===null||typeof n>"u"?n:this.elementMapper(n.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,n){return this.model.setCollapsible(e,n)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,n,r){return this.model.setCollapsed(e,n,r)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var n1t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class vae extends gRe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,n,r,s,o={}){super(e,n,r,s,o),this.user=e}setChildren(e,n=Vn.empty(),r){this.model.setChildren(e,n,r)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,n,r){return new mae(e,n,r)}}class _Re{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,n){this._compressedTreeNodeProvider=e,this.renderer=n,this.templateId=n.templateId,n.onDidChangeTwistieState&&(this.onDidChangeTwistieState=n.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,n,r,s){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);o.element.elements.length===1?(r.compressedTreeNode=void 0,this.renderer.renderElement(e,n,r.data,s)):(r.compressedTreeNode=o,this.renderer.renderCompressedElements(o,n,r.data,s))}disposeElement(e,n,r,s){var o,a,l,c;r.compressedTreeNode?(a=(o=this.renderer).disposeCompressedElements)===null||a===void 0||a.call(o,r.compressedTreeNode,n,r.data,s):(c=(l=this.renderer).disposeElement)===null||c===void 0||c.call(l,e,n,r.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,n){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,n):!1}}n1t([Ms],_Re.prototype,"compressedTreeNodeProvider",null);function i1t(i,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(n){let r;try{r=i().getCompressedTreeNode(n)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n)}return r.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(r.element.elements)}}})}class vRe extends vae{constructor(e,n,r,s,o={}){const a=()=>this,l=s.map(c=>new _Re(a,c));super(e,n,r,l,i1t(a,o))}setChildren(e,n=Vn.empty(),r){this.model.setChildren(e,n,r)}createModel(e,n,r){return new t1t(e,n,r)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var Bb=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function eK(i){return Object.assign(Object.assign({},i),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function Fee(i,e){return e.parent?e.parent===i?!0:Fee(i,e.parent):!1}function r1t(i,e){return i===e||Fee(i,e)||Fee(e,i)}class bae{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new bae(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class s1t{constructor(e,n,r){this.renderer=e,this.nodeMapper=n,this.onDidChangeTwistieState=r,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,n,r,s){this.renderer.renderElement(this.nodeMapper.map(e),n,r.templateData,s)}renderTwistie(e,n){return e.slow?(n.classList.add(...en.asClassNameArray(lt.treeItemLoading)),!0):(n.classList.remove(...en.asClassNameArray(lt.treeItemLoading)),!1)}disposeElement(e,n,r,s){var o,a;(a=(o=this.renderer).disposeElement)===null||a===void 0||a.call(o,this.nodeMapper.map(e),n,r.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function e_e(i){return{browserEvent:i.browserEvent,elements:i.elements.map(e=>e.element)}}function t_e(i){return{browserEvent:i.browserEvent,element:i.element&&i.element.element,target:i.target}}class o1t extends V5{constructor(e){super(e.elements.map(n=>n.element)),this.data=e}}function tK(i){return i instanceof V5?new o1t(i):i}class a1t{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,n){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(r=>r.element),n)}onDragStart(e,n){var r,s;(s=(r=this.dnd).onDragStart)===null||s===void 0||s.call(r,tK(e),n)}onDragOver(e,n,r,s,o=!0){return this.dnd.onDragOver(tK(e),n&&n.element,r,s)}drop(e,n,r,s){this.dnd.drop(tK(e),n&&n.element,r,s)}onDragEnd(e){var n,r;(r=(n=this.dnd).onDragEnd)===null||r===void 0||r.call(n,e)}dispose(){this.dnd.dispose()}}function bRe(i){return i&&Object.assign(Object.assign({},i),{collapseByDefault:!0,identityProvider:i.identityProvider&&{getId(e){return i.identityProvider.getId(e.element)}},dnd:i.dnd&&new a1t(i.dnd),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return i.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return i.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:i.accessibilityProvider&&Object.assign(Object.assign({},i.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:i.accessibilityProvider.isChecked?e=>{var n;return!!(!((n=i.accessibilityProvider)===null||n===void 0)&&n.isChecked(e.element))}:void 0,getAriaLabel(e){return i.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return i.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider.getAriaLevel&&(e=>i.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))}),filter:i.filter&&{filter(e,n){return i.filter.filter(e.element,n)}},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},i.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof i.expandOnlyOnTwistieClick>"u"?void 0:typeof i.expandOnlyOnTwistieClick!="function"?i.expandOnlyOnTwistieClick:e=>i.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof i.defaultFindVisibility=="number"?i.defaultFindVisibility:typeof i.defaultFindVisibility>"u"?2:i.defaultFindVisibility(e.element)})}function Bee(i,e){e(i),i.children.forEach(n=>Bee(n,e))}class yRe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return _t.map(this.tree.onDidChangeFocus,e_e)}get onDidChangeSelection(){return _t.map(this.tree.onDidChangeSelection,e_e)}get onMouseDblClick(){return _t.map(this.tree.onMouseDblClick,t_e)}get onPointer(){return _t.map(this.tree.onPointer,t_e)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,n,r,s,o,a={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new _e,this._onDidChangeNodeSlowState=new _e,this.nodeMapper=new fae(l=>new bae(l)),this.disposables=new Xe,this.identityProvider=a.identityProvider,this.autoExpandSingleChildren=typeof a.autoExpandSingleChildren>"u"?!1:a.autoExpandSingleChildren,this.sorter=a.sorter,this.collapseByDefault=a.collapseByDefault,this.tree=this.createTree(e,n,r,s,a),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=eK({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,n,r,s,o){const a=new gae(r),l=s.map(u=>new s1t(u,this.nodeMapper,this._onDidChangeNodeSlowState.event)),c=bRe(o)||{};return new vae(e,n,a,l,c)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,n){this.tree.layout(e,n)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,n){return Bb(this,void 0,void 0,function*(){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const r=n&&{viewState:n,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,r),r&&(this.tree.setFocus(r.focus),this.tree.setSelection(r.selection)),n&&typeof n.scrollTop=="number"&&(this.scrollTop=n.scrollTop)})}_updateChildren(e=this.root.element,n=!0,r=!1,s,o){return Bb(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new qu(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield _t.toPromise(this._onDidRender.event));const a=this.getDataNode(e);if(yield this.refreshAndRenderNode(a,n,s,o),r)try{this.tree.rerender(a)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const n=this.getDataNode(e);this.tree.rerender(n)}getNode(e=this.root.element){const n=this.getDataNode(e),r=this.tree.getNode(n===this.root?null:n);return this.nodeMapper.map(r)}collapse(e,n=!1){const r=this.getDataNode(e);return this.tree.collapse(r===this.root?null:r,n)}expand(e,n=!1){return Bb(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new qu(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield _t.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(this.tree.hasElement(r)&&!this.tree.isCollapsible(r)||(r.refreshPromise&&(yield this.root.refreshPromise,yield _t.toPromise(this._onDidRender.event)),r!==this.root&&!r.refreshPromise&&!this.tree.isCollapsed(r)))return!1;const s=this.tree.expand(r===this.root?null:r,n);return r.refreshPromise&&(yield this.root.refreshPromise,yield _t.toPromise(this._onDidRender.event)),s})}setSelection(e,n){const r=e.map(s=>this.getDataNode(s));this.tree.setSelection(r,n)}getSelection(){return this.tree.getSelection().map(n=>n.element)}setFocus(e,n){const r=e.map(s=>this.getDataNode(s));this.tree.setFocus(r,n)}getFocus(){return this.tree.getFocus().map(n=>n.element)}reveal(e,n){this.tree.reveal(this.getDataNode(e),n)}getParentElement(e){const n=this.tree.getParentElement(this.getDataNode(e));return n&&n.element}getFirstElementChild(e=this.root.element){const n=this.getDataNode(e),r=this.tree.getFirstElementChild(n===this.root?null:n);return r&&r.element}getDataNode(e){const n=this.nodes.get(e===this.root.element?null:e);if(!n)throw new qu(this.user,`Data tree node not found: ${e}`);return n}refreshAndRenderNode(e,n,r,s){return Bb(this,void 0,void 0,function*(){yield this.refreshNode(e,n,r),this.render(e,r,s)})}refreshNode(e,n,r){return Bb(this,void 0,void 0,function*(){let s;if(this.subTreeRefreshPromises.forEach((o,a)=>{!s&&r1t(a,e)&&(s=o.then(()=>this.refreshNode(e,n,r)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0;return}return this.doRefreshSubTree(e,n,r)})}doRefreshSubTree(e,n,r){return Bb(this,void 0,void 0,function*(){let s;e.refreshPromise=new Promise(o=>s=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,n,r);e.stale=!1,yield dJ.settled(o.map(a=>this.doRefreshSubTree(a,n,r)))}finally{s()}})}doRefreshNode(e,n,r){return Bb(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(Vn.empty());else{const o=this.doGetChildren(e);if(Ofe(o))s=Promise.resolve(o);else{const a=p1(800);a.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},l=>null),s=o.finally(()=>a.cancel())}}try{const o=yield s;return this.setChildren(e,o,n,r)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),sg(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let n=this.refreshPromises.get(e);if(n)return n;const r=this.dataSource.getChildren(e.element);return Ofe(r)?this.processChildren(r):(n=go(()=>Bb(this,void 0,void 0,function*(){return this.processChildren(yield r)})),this.refreshPromises.set(e,n),n.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:n}){e.element!==null&&!e.collapsed&&e.element.stale&&(n?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Ln))}setChildren(e,n,r,s){const o=[...n];if(e.children.length===0&&o.length===0)return[];const a=new Map,l=new Map;for(const d of e.children)if(a.set(d.element,d),this.identityProvider){const h=this.tree.isCollapsed(d);l.set(d.id,{node:d,collapsed:h})}const c=[],u=o.map(d=>{const h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const m=eK({element:d,parent:e,hasChildren:h});return h&&this.collapseByDefault&&!this.collapseByDefault(d)&&(m.collapsedByDefault=!1,c.push(m)),m}const f=this.identityProvider.getId(d).toString(),p=l.get(f);if(p){const m=p.node;return a.delete(m.element),this.nodes.delete(m.element),this.nodes.set(d,m),m.element=d,m.hasChildren=h,r?p.collapsed?(m.children.forEach(_=>Bee(_,b=>this.nodes.delete(b.element))),m.children.splice(0,m.children.length),m.stale=!0):c.push(m):h&&this.collapseByDefault&&!this.collapseByDefault(d)&&(m.collapsedByDefault=!1,c.push(m)),m}const g=eK({element:d,parent:e,id:f,hasChildren:h});return s&&s.viewState.focus&&s.viewState.focus.indexOf(f)>-1&&s.focus.push(g),s&&s.viewState.selection&&s.viewState.selection.indexOf(f)>-1&&s.selection.push(g),s&&s.viewState.expanded&&s.viewState.expanded.indexOf(f)>-1?c.push(g):h&&this.collapseByDefault&&!this.collapseByDefault(d)&&(g.collapsedByDefault=!1,c.push(g)),g});for(const d of a.values())Bee(d,h=>this.nodes.delete(h.element));for(const d of u)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...u),e!==this.root&&this.autoExpandSingleChildren&&u.length===1&&c.length===0&&(u[0].collapsedByDefault=!1,c.push(u[0])),c}render(e,n,r){const s=e.children.map(a=>this.asTreeElement(a,n)),o=r&&Object.assign(Object.assign({},r),{diffIdentityProvider:r.diffIdentityProvider&&{getId(a){return r.diffIdentityProvider.getId(a.element)}}});this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,n){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let r;return n&&n.viewState.expanded&&e.id&&n.viewState.expanded.indexOf(e.id)>-1?r=!1:r=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?Vn.map(e.children,s=>this.asTreeElement(s,n)):[],collapsible:e.hasChildren,collapsed:r}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class yae{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new yae(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class l1t{constructor(e,n,r,s){this.renderer=e,this.nodeMapper=n,this.compressibleNodeMapperProvider=r,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,n,r,s){this.renderer.renderElement(this.nodeMapper.map(e),n,r.templateData,s)}renderCompressedElements(e,n,r,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),n,r.templateData,s)}renderTwistie(e,n){return e.slow?(n.classList.add(...en.asClassNameArray(lt.treeItemLoading)),!0):(n.classList.remove(...en.asClassNameArray(lt.treeItemLoading)),!1)}disposeElement(e,n,r,s){var o,a;(a=(o=this.renderer).disposeElement)===null||a===void 0||a.call(o,this.nodeMapper.map(e),n,r.templateData,s)}disposeCompressedElements(e,n,r,s){var o,a;(a=(o=this.renderer).disposeCompressedElements)===null||a===void 0||a.call(o,this.compressibleNodeMapperProvider().map(e),n,r.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Mi(this.disposables)}}function c1t(i){const e=i&&bRe(i);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(n){return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.map(r=>r.element))}})})}class u1t extends yRe{constructor(e,n,r,s,o,a,l={}){super(e,n,r,o,a,l),this.compressionDelegate=s,this.compressibleNodeMapper=new fae(c=>new yae(c)),this.filter=l.filter}createTree(e,n,r,s,o){const a=new gae(r),l=s.map(u=>new l1t(u,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),c=c1t(o)||{};return new vRe(e,n,a,l,c)}asTreeElement(e,n){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,n))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,n){if(!this.identityProvider)return super.render(e,n);const r=f=>this.identityProvider.getId(f).toString(),s=f=>{const p=new Set;for(const g of f){const m=this.tree.getCompressedTreeNode(g===this.root?null:g);if(m.element)for(const _ of m.element.elements)p.add(r(_.element))}return p},o=s(this.tree.getSelection()),a=s(this.tree.getFocus());super.render(e,n);const l=this.getSelection();let c=!1;const u=this.getFocus();let d=!1;const h=f=>{const p=f.element;if(p)for(let g=0;g<p.elements.length;g++){const m=r(p.elements[g].element),_=p.elements[p.elements.length-1].element;o.has(m)&&l.indexOf(_)===-1&&(l.push(_),c=!0),a.has(m)&&u.indexOf(_)===-1&&(u.push(_),d=!0)}f.children.forEach(h)};h(this.tree.getCompressedTreeNode(e===this.root?null:e)),c&&this.setSelection(l),d&&this.setFocus(u)}processChildren(e){return this.filter&&(e=Vn.filter(e,n=>{const r=this.filter.filter(n,1),s=d1t(r);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function d1t(i){return typeof i=="boolean"?i?1:0:pae(i)?UP(i.visibility):UP(i)}class h1t extends gRe{constructor(e,n,r,s,o,a={}){super(e,n,r,s,a),this.user=e,this.dataSource=o,this.identityProvider=a.identityProvider}createModel(e,n,r){return new mae(e,n,r)}}new yt("isMac",ri,L("isMac","Whether the operating system is macOS"));new yt("isLinux",_l,L("isLinux","Whether the operating system is Linux"));const X$=new yt("isWindows",Aa,L("isWindows","Whether the operating system is Windows")),wRe=new yt("isWeb",H1,L("isWeb","Whether the platform is a web browser"));new yt("isMacNative",ri&&!H1,L("isMacNative","Whether the operating system is macOS on a non-browser platform"));new yt("isIOS",Kp,L("isIOS","Whether the operating system is iOS"));new yt("isMobile",Brt,L("isMobile","Whether the platform is a mobile web browser"));new yt("isDevelopment",!1,!0);new yt("productQualityType","",L("productQualityType","Quality type of VS Code"));const CRe="inputFocus";new yt(CRe,!1,L("inputFocus","Whether keyboard focus is inside an input box"));var Uv=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},wr=function(i,e){return function(n,r){e(n,r,i)}};const Lh=qn("listService");class f1t{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Xe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var n,r;e!==this._lastFocusedWidget&&((n=this._lastFocusedWidget)===null||n===void 0||n.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(r=this._lastFocusedWidget)===null||r===void 0||r.getHTMLElement().classList.add("last-focused"))}register(e,n){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new tRe(_h(),"").style(tk)),this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const r={widget:e,extraContextKeys:n};return this.lists.push(r),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),Sf(e.onDidFocus(()=>this.setLastFocusedList(e)),gn(()=>this.lists.splice(this.lists.indexOf(r),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==r),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const GP=new yt("listScrollAtBoundary","none");ze.or(GP.isEqualTo("top"),GP.isEqualTo("both"));ze.or(GP.isEqualTo("bottom"),GP.isEqualTo("both"));const SRe=new yt("listFocus",!0),Y$=new yt("listSupportsMultiselect",!0),xRe=ze.and(SRe,ze.not(CRe)),wae=new yt("listHasSelectionOrFocus",!1),Cae=new yt("listDoubleSelection",!1),Sae=new yt("listMultiSelection",!1),Z$=new yt("listSelectionNavigation",!1),p1t=new yt("listSupportsFind",!0),xae=new yt("treeElementCanCollapse",!1),g1t=new yt("treeElementHasParent",!1),kae=new yt("treeElementCanExpand",!1),m1t=new yt("treeElementHasChild",!1),_1t=new yt("treeFindOpen",!1),kRe="listTypeNavigationMode",LRe="listAutomaticKeyboardNavigation";function Q$(i,e){const n=i.createScoped(e.getHTMLElement());return SRe.bindTo(n),n}function J$(i,e){const n=GP.bindTo(i),r=()=>{const s=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&o?n.set("both"):s?n.set("top"):o?n.set("bottom"):n.set("none")};return r(),e.onDidScroll(r)}const nk="workbench.list.multiSelectModifier",L8="workbench.list.openMode",hh="workbench.list.horizontalScrolling",Lae="workbench.list.defaultFindMode",Dae="workbench.list.typeNavigationMode",j7="workbench.list.keyboardNavigation",Yp="workbench.list.scrollByPage",Eae="workbench.list.defaultFindMatchType",XP="workbench.tree.indent",W7="workbench.tree.renderIndentGuides",Zp="workbench.list.smoothScrolling",Jm="workbench.list.mouseWheelScrollSensitivity",e_="workbench.list.fastScrollSensitivity",$7="workbench.tree.expandMode";function t_(i){return i.getValue(nk)==="alt"}class v1t extends Le{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=t_(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(nk)&&(this.useAltAsMultipleSelectionModifier=t_(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:QTe(e)}isSelectionRangeChangeEvent(e){return JTe(e)}}function ez(i,e){var n;const r=i.get(ei),s=i.get(sr),o=new Xe;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(l){return s.mightProducePrintableCharacter(l)}},smoothScrolling:!!r.getValue(Zp),mouseWheelScrollSensitivity:r.getValue(Jm),fastScrollSensitivity:r.getValue(e_),multipleSelectionController:(n=e.multipleSelectionController)!==null&&n!==void 0?n:o.add(new v1t(r)),keyboardNavigationEventFilter:w1t(s),scrollByPage:!!r.getValue(Yp)}),o]}let jee=class extends Bf{constructor(e,n,r,s,o,a,l,c,u){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(hh),[h,f]=u.invokeFunction(ez,o);super(e,n,r,s,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:d})),this.disposables.add(f),this.contextKeyService=Q$(a,this),this.disposables.add(J$(this.contextKeyService,this)),this.listSupportsMultiSelect=Y$.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Z$.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=wae.bindTo(this.contextKeyService),this.listDoubleSelection=Cae.bindTo(this.contextKeyService),this.listMultiSelection=Sae.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=t_(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||m.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||m.length>0)})),this.disposables.add(c.onDidChangeConfiguration(g=>{g.affectsConfiguration(nk)&&(this._useAltAsMultipleSelectionModifier=t_(c));let m={};if(g.affectsConfiguration(hh)&&this.horizontalScrolling===void 0){const _=!!c.getValue(hh);m=Object.assign(Object.assign({},m),{horizontalScrolling:_})}if(g.affectsConfiguration(Yp)){const _=!!c.getValue(Yp);m=Object.assign(Object.assign({},m),{scrollByPage:_})}if(g.affectsConfiguration(Zp)){const _=!!c.getValue(Zp);m=Object.assign(Object.assign({},m),{smoothScrolling:_})}if(g.affectsConfiguration(Jm)){const _=c.getValue(Jm);m=Object.assign(Object.assign({},m),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(e_)){const _=c.getValue(e_);m=Object.assign(Object.assign({},m),{fastScrollSensitivity:_})}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new DRe(this,Object.assign({configurationService:c},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?HI(e):tk)}};jee=Uv([wr(5,mn),wr(6,Lh),wr(7,ei),wr(8,hn)],jee);let n_e=class extends Syt{constructor(e,n,r,s,o,a,l,c,u){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(hh),[h,f]=u.invokeFunction(ez,o);super(e,n,r,s,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:d})),this.disposables=new Xe,this.disposables.add(f),this.contextKeyService=Q$(a,this),this.disposables.add(J$(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=Y$.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Z$.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=t_(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(c.onDidChangeConfiguration(g=>{g.affectsConfiguration(nk)&&(this._useAltAsMultipleSelectionModifier=t_(c));let m={};if(g.affectsConfiguration(hh)&&this.horizontalScrolling===void 0){const _=!!c.getValue(hh);m=Object.assign(Object.assign({},m),{horizontalScrolling:_})}if(g.affectsConfiguration(Yp)){const _=!!c.getValue(Yp);m=Object.assign(Object.assign({},m),{scrollByPage:_})}if(g.affectsConfiguration(Zp)){const _=!!c.getValue(Zp);m=Object.assign(Object.assign({},m),{smoothScrolling:_})}if(g.affectsConfiguration(Jm)){const _=c.getValue(Jm);m=Object.assign(Object.assign({},m),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(e_)){const _=c.getValue(e_);m=Object.assign(Object.assign({},m),{fastScrollSensitivity:_})}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new DRe(this,Object.assign({configurationService:c},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?HI(e):tk)}dispose(){this.disposables.dispose(),super.dispose()}};n_e=Uv([wr(5,mn),wr(6,Lh),wr(7,ei),wr(8,hn)],n_e);let i_e=class extends G${constructor(e,n,r,s,o,a,l,c,u,d){const h=typeof a.horizontalScrolling<"u"?a.horizontalScrolling:!!u.getValue(hh),[f,p]=d.invokeFunction(ez,a);super(e,n,r,s,o,Object.assign(Object.assign({keyboardSupport:!1},f),{horizontalScrolling:h})),this.disposables.add(p),this.contextKeyService=Q$(l,this),this.disposables.add(J$(this.contextKeyService,this)),this.listSupportsMultiSelect=Y$.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(a.multipleSelectionSupport!==!1),Z$.bindTo(this.contextKeyService).set(!!a.selectionNavigation),this.listHasSelectionOrFocus=wae.bindTo(this.contextKeyService),this.listDoubleSelection=Cae.bindTo(this.contextKeyService),this.listMultiSelection=Sae.bindTo(this.contextKeyService),this.horizontalScrolling=a.horizontalScrolling,this._useAltAsMultipleSelectionModifier=t_(u),this.disposables.add(this.contextKeyService),this.disposables.add(c.register(this)),this.updateStyles(a.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||_.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||_.length>0)})),this.disposables.add(u.onDidChangeConfiguration(m=>{m.affectsConfiguration(nk)&&(this._useAltAsMultipleSelectionModifier=t_(u));let _={};if(m.affectsConfiguration(hh)&&this.horizontalScrolling===void 0){const b=!!u.getValue(hh);_=Object.assign(Object.assign({},_),{horizontalScrolling:b})}if(m.affectsConfiguration(Yp)){const b=!!u.getValue(Yp);_=Object.assign(Object.assign({},_),{scrollByPage:b})}if(m.affectsConfiguration(Zp)){const b=!!u.getValue(Zp);_=Object.assign(Object.assign({},_),{smoothScrolling:b})}if(m.affectsConfiguration(Jm)){const b=u.getValue(Jm);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:b})}if(m.affectsConfiguration(e_)){const b=u.getValue(e_);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:b})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new b1t(this,Object.assign({configurationService:u},a)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?HI(e):tk)}dispose(){this.disposables.dispose(),super.dispose()}};i_e=Uv([wr(6,mn),wr(7,Lh),wr(8,ei),wr(9,hn)],i_e);class Iae extends Le{constructor(e,n){var r;super(),this.widget=e,this._onDidOpen=this._register(new _e),this.onDidOpen=this._onDidOpen.event,this._register(_t.filter(this.widget.onDidChangeSelection,s=>s.browserEvent instanceof KeyboardEvent)(s=>this.onSelectionFromKeyboard(s))),this._register(this.widget.onPointer(s=>this.onPointer(s.element,s.browserEvent))),this._register(this.widget.onMouseDblClick(s=>this.onMouseDblClick(s.element,s.browserEvent))),typeof(n==null?void 0:n.openOnSingleClick)!="boolean"&&(n!=null&&n.configurationService)?(this.openOnSingleClick=(n==null?void 0:n.configurationService.getValue(L8))!=="doubleClick",this._register(n==null?void 0:n.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(L8)&&(this.openOnSingleClick=(n==null?void 0:n.configurationService.getValue(L8))!=="doubleClick")}))):this.openOnSingleClick=(r=n==null?void 0:n.openOnSingleClick)!==null&&r!==void 0?r:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const n=e.browserEvent,r=typeof n.preserveFocus=="boolean"?n.preserveFocus:!0,s=typeof n.pinned=="boolean"?n.pinned:!r;this._open(this.getSelectedElement(),r,s,!1,e.browserEvent)}onPointer(e,n){if(!this.openOnSingleClick||n.detail===2)return;const s=n.button===1,o=!0,a=s,l=n.ctrlKey||n.metaKey||n.altKey;this._open(e,o,a,l,n)}onMouseDblClick(e,n){if(!n)return;const r=n.target;if(r.classList.contains("monaco-tl-twistie")||r.classList.contains("monaco-icon-label")&&r.classList.contains("folder-icon")&&n.offsetX<16)return;const o=!1,a=!0,l=n.ctrlKey||n.metaKey||n.altKey;this._open(e,o,a,l,n)}_open(e,n,r,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:n,pinned:r,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class DRe extends Iae{constructor(e,n){super(e,n),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class b1t extends Iae{constructor(e,n){super(e,n)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class y1t extends Iae{constructor(e,n){super(e,n)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function w1t(i){let e=!1;return n=>{if(n.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const r=i.softDispatch(n,n.target);return r.kind===1?(e=!0,!1):(e=!1,r.kind===0)}}let r_e=class extends vae{constructor(e,n,r,s,o,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(U5,o);super(e,n,r,s,d),this.disposables.add(f),this.internals=new vx(this,o,h,o.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};r_e=Uv([wr(5,hn),wr(6,mn),wr(7,Lh),wr(8,ei)],r_e);let s_e=class extends vRe{constructor(e,n,r,s,o,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(U5,o);super(e,n,r,s,d),this.disposables.add(f),this.internals=new vx(this,o,h,o.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};s_e=Uv([wr(5,hn),wr(6,mn),wr(7,Lh),wr(8,ei)],s_e);let o_e=class extends h1t{constructor(e,n,r,s,o,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:p}=l.invokeFunction(U5,a);super(e,n,r,s,o,h),this.disposables.add(p),this.internals=new vx(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};o_e=Uv([wr(6,hn),wr(7,mn),wr(8,Lh),wr(9,ei)],o_e);let Wee=class extends yRe{get onDidOpen(){return this.internals.onDidOpen}constructor(e,n,r,s,o,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:p}=l.invokeFunction(U5,a);super(e,n,r,s,o,h),this.disposables.add(p),this.internals=new vx(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Wee=Uv([wr(6,hn),wr(7,mn),wr(8,Lh),wr(9,ei)],Wee);let a_e=class extends u1t{constructor(e,n,r,s,o,a,l,c,u,d,h){const{options:f,getTypeNavigationMode:p,disposable:g}=c.invokeFunction(U5,l);super(e,n,r,s,o,a,f),this.disposables.add(g),this.internals=new vx(this,l,p,l.overrideStyles,u,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};a_e=Uv([wr(7,hn),wr(8,mn),wr(9,Lh),wr(10,ei)],a_e);function ERe(i){const e=i.getValue(Lae);if(e==="highlight")return Lm.Highlight;if(e==="filter")return Lm.Filter;const n=i.getValue(j7);if(n==="simple"||n==="highlight")return Lm.Highlight;if(n==="filter")return Lm.Filter}function IRe(i){const e=i.getValue(Eae);if(e==="fuzzy")return _x.Fuzzy;if(e==="contiguous")return _x.Contiguous}function U5(i,e){var n;const r=i.get(ei),s=i.get(Vv),o=i.get(mn),a=i.get(hn),l=()=>{const p=o.getContextKeyValue(kRe);if(p==="automatic")return pm.Automatic;if(p==="trigger"||o.getContextKeyValue(LRe)===!1)return pm.Trigger;const m=r.getValue(Dae);if(m==="automatic")return pm.Automatic;if(m==="trigger")return pm.Trigger},c=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!r.getValue(hh),[u,d]=a.invokeFunction(ez,e),h=e.paddingBottom,f=e.renderIndentGuides!==void 0?e.renderIndentGuides:r.getValue(W7);return{getTypeNavigationMode:l,disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},u),{indent:typeof r.getValue(XP)=="number"?r.getValue(XP):void 0,renderIndentGuides:f,smoothScrolling:!!r.getValue(Zp),defaultFindMode:ERe(r),defaultFindMatchType:IRe(r),horizontalScrolling:c,scrollByPage:!!r.getValue(Yp),paddingBottom:h,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(n=e.expandOnlyOnTwistieClick)!==null&&n!==void 0?n:r.getValue($7)==="doubleClick",contextViewProvider:s,findWidgetStyles:nyt})}}let vx=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,n,r,s,o,a,l){var c;this.tree=e,this.disposables=[],this.contextKeyService=Q$(o,e),this.disposables.push(J$(this.contextKeyService,e)),this.listSupportsMultiSelect=Y$.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(n.multipleSelectionSupport!==!1),Z$.bindTo(this.contextKeyService).set(!!n.selectionNavigation),this.listSupportFindWidget=p1t.bindTo(this.contextKeyService),this.listSupportFindWidget.set((c=n.findWidgetEnabled)!==null&&c!==void 0?c:!0),this.hasSelectionOrFocus=wae.bindTo(this.contextKeyService),this.hasDoubleSelection=Cae.bindTo(this.contextKeyService),this.hasMultiSelection=Sae.bindTo(this.contextKeyService),this.treeElementCanCollapse=xae.bindTo(this.contextKeyService),this.treeElementHasParent=g1t.bindTo(this.contextKeyService),this.treeElementCanExpand=kae.bindTo(this.contextKeyService),this.treeElementHasChild=m1t.bindTo(this.contextKeyService),this.treeFindOpen=_1t.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=t_(l),this.updateStyleOverrides(s);const d=()=>{const f=e.getFocus()[0];if(!f)return;const p=e.getNode(f);this.treeElementCanCollapse.set(p.collapsible&&!p.collapsed),this.treeElementHasParent.set(!!e.getParentElement(f)),this.treeElementCanExpand.set(p.collapsible&&p.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(f))},h=new Set;h.add(kRe),h.add(LRe),this.disposables.push(this.contextKeyService,a.register(e),e.onDidChangeSelection(()=>{const f=e.getSelection(),p=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(f.length>0||p.length>0),this.hasMultiSelection.set(f.length>1),this.hasDoubleSelection.set(f.length===2)})}),e.onDidChangeFocus(()=>{const f=e.getSelection(),p=e.getFocus();this.hasSelectionOrFocus.set(f.length>0||p.length>0),d()}),e.onDidChangeCollapseState(d),e.onDidChangeModel(d),e.onDidChangeFindOpenState(f=>this.treeFindOpen.set(f)),l.onDidChangeConfiguration(f=>{let p={};if(f.affectsConfiguration(nk)&&(this._useAltAsMultipleSelectionModifier=t_(l)),f.affectsConfiguration(XP)){const g=l.getValue(XP);p=Object.assign(Object.assign({},p),{indent:g})}if(f.affectsConfiguration(W7)&&n.renderIndentGuides===void 0){const g=l.getValue(W7);p=Object.assign(Object.assign({},p),{renderIndentGuides:g})}if(f.affectsConfiguration(Zp)){const g=!!l.getValue(Zp);p=Object.assign(Object.assign({},p),{smoothScrolling:g})}if(f.affectsConfiguration(Lae)||f.affectsConfiguration(j7)){const g=ERe(l);p=Object.assign(Object.assign({},p),{defaultFindMode:g})}if(f.affectsConfiguration(Dae)||f.affectsConfiguration(j7)){const g=r();p=Object.assign(Object.assign({},p),{typeNavigationMode:g})}if(f.affectsConfiguration(Eae)){const g=IRe(l);p=Object.assign(Object.assign({},p),{defaultFindMatchType:g})}if(f.affectsConfiguration(hh)&&n.horizontalScrolling===void 0){const g=!!l.getValue(hh);p=Object.assign(Object.assign({},p),{horizontalScrolling:g})}if(f.affectsConfiguration(Yp)){const g=!!l.getValue(Yp);p=Object.assign(Object.assign({},p),{scrollByPage:g})}if(f.affectsConfiguration($7)&&n.expandOnlyOnTwistieClick===void 0&&(p=Object.assign(Object.assign({},p),{expandOnlyOnTwistieClick:l.getValue($7)==="doubleClick"})),f.affectsConfiguration(Jm)){const g=l.getValue(Jm);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:g})}if(f.affectsConfiguration(e_)){const g=l.getValue(e_);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:g})}Object.keys(p).length>0&&e.updateOptions(p)}),this.contextKeyService.onDidChangeContext(f=>{f.affectsSome(h)&&e.updateOptions({typeNavigationMode:r()})})),this.navigator=new y1t(e,Object.assign({configurationService:l},n)),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?HI(e):tk)}dispose(){this.disposables=Mi(this.disposables)}};vx=Uv([wr(4,mn),wr(5,Lh),wr(6,ei)],vx);const C1t=Kr.as(ag.Configuration);C1t.registerConfiguration({id:"workbench",order:7,title:L("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[nk]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[L("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),L("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:L({},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[L8]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:L({},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[hh]:{type:"boolean",default:!1,description:L("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Yp]:{type:"boolean",default:!1,description:L("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[XP]:{type:"number",default:8,minimum:4,maximum:40,description:L("tree indent setting","Controls tree indentation in pixels.")},[W7]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:L("render tree indent guides","Controls whether the tree should render indent guides.")},[Zp]:{type:"boolean",default:!1,description:L("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Jm]:{type:"number",default:1,markdownDescription:L("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[e_]:{type:"number",default:5,markdownDescription:L("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[Lae]:{type:"string",enum:["highlight","filter"],enumDescriptions:[L("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),L("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:L("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[j7]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[L("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),L("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),L("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:L("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:L("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[Eae]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[L("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),L("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:L("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[$7]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:L("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Dae]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:L("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var $ee;(function(i){i[i.PRESERVE=0]="PRESERVE",i[i.LAST=1]="LAST"})($ee||($ee={}));const ik={Quickaccess:"workbench.contributions.quickaccess"};class S1t{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((n,r)=>r.prefix.length-n.prefix.length),gn(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return Hm([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(r=>e.startsWith(r.prefix))||void 0||this.defaultProvider}}Kr.add(ik.Quickaccess,new S1t);const x1t={ctrlCmd:!1,alt:!1};var YP;(function(i){i[i.Blur=1]="Blur",i[i.Gesture=2]="Gesture",i[i.Other=3]="Other"})(YP||(YP={}));var _p;(function(i){i[i.NONE=0]="NONE",i[i.FIRST=1]="FIRST",i[i.SECOND=2]="SECOND",i[i.LAST=3]="LAST"})(_p||(_p={}));const lg=qn("quickInputService");var k1t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},l_e=function(i,e){return function(n,r){e(n,r,i)}};let zee=class extends Le{constructor(e,n){super(),this.quickInputService=e,this.instantiationService=n,this.registry=Kr.as(ik.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",n){this.doShowOrPick(e,!1,n)}doShowOrPick(e,n,r){var s;const[o,a]=this.getOrInstantiateProvider(e),l=this.visibleQuickAccess,c=l==null?void 0:l.descriptor;if(l&&a&&c===a){e!==a.prefix&&!(r!=null&&r.preserveValue)&&(l.picker.value=e),this.adjustValueSelection(l.picker,a,r);return}if(a&&!(r!=null&&r.preserveValue)){let p;if(l&&c&&c!==a){const g=l.value.substr(c.prefix.length);g&&(p=`${a.prefix}${g}`)}if(!p){const g=o==null?void 0:o.defaultFilterValue;g===$ee.LAST?p=this.lastAcceptedPickerValues.get(a):typeof g=="string"&&(p=`${a.prefix}${g}`)}typeof p=="string"&&(e=p)}const u=new Xe,d=u.add(this.quickInputService.createQuickPick());d.value=e,this.adjustValueSelection(d,a,r),d.placeholder=a==null?void 0:a.placeholder,d.quickNavigate=r==null?void 0:r.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!l,(typeof(r==null?void 0:r.itemActivation)=="number"||r!=null&&r.quickNavigateConfiguration)&&(d.itemActivation=(s=r==null?void 0:r.itemActivation)!==null&&s!==void 0?s:_p.SECOND),d.contextKey=a==null?void 0:a.contextKey,d.filterValue=p=>p.substring(a?a.prefix.length:0);let h;n&&(h=new f$,u.add(_t.once(d.onWillAccept)(p=>{p.veto(),d.hide()}))),u.add(this.registerPickerListeners(d,o,a,e,r==null?void 0:r.providerOptions));const f=u.add(new Ns);if(o&&u.add(o.provide(d,f.token,r==null?void 0:r.providerOptions)),_t.once(d.onDidHide)(()=>{d.selectedItems.length===0&&f.cancel(),u.dispose(),h==null||h.complete(d.selectedItems.slice(0))}),d.show(),n)return h==null?void 0:h.p}adjustValueSelection(e,n,r){var s;let o;r!=null&&r.preserveValue?o=[e.value.length,e.value.length]:o=[(s=n==null?void 0:n.prefix.length)!==null&&s!==void 0?s:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,n,r,s,o){const a=new Xe,l=this.visibleQuickAccess={picker:e,descriptor:r,value:s};return a.add(gn(()=>{l===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),a.add(e.onDidChangeValue(c=>{const[u]=this.getOrInstantiateProvider(c);u!==n?this.show(c,{preserveValue:!0,providerOptions:o}):l.value=c})),r&&a.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(r,e.value)})),a}getOrInstantiateProvider(e){const n=this.registry.getQuickAccessProvider(e);if(!n)return[void 0,void 0];let r=this.mapProviderToDescriptor.get(n);return r||(r=this.instantiationService.createInstance(n.ctor),this.mapProviderToDescriptor.set(n,r)),[r,n]}};zee=k1t([l_e(0,lg),l_e(1,hn)],zee);Te.white.toString(),Te.white.toString();class Vee extends Le{get onDidClick(){return this._onDidClick.event}constructor(e,n){super(),this._label="",this._onDidClick=this._register(new _e),this.options=n,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!n.secondary);const r=n.secondary?n.buttonSecondaryBackground:n.buttonBackground,s=n.secondary?n.buttonSecondaryForeground:n.buttonForeground;this._element.style.color=s||"",this._element.style.backgroundColor=r||"",n.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),e.appendChild(this._element),this._register(or.addTarget(this._element)),[ht.CLICK,lr.Tap].forEach(o=>{this._register(Be(this._element,o,a=>{if(!this.enabled){Nn.stop(a);return}this._onDidClick.fire(a)}))}),this._register(Be(this._element,ht.KEY_DOWN,o=>{const a=new yr(o);let l=!1;this.enabled&&(a.equals(3)||a.equals(10))?(this._onDidClick.fire(o),l=!0):a.equals(9)&&(this._element.blur(),l=!0),l&&Nn.stop(a,!0)})),this._register(Be(this._element,ht.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(Be(this._element,ht.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Gm(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const n=[];for(let r of Uy(e))if(typeof r=="string"){if(r=r.trim(),r==="")continue;const s=document.createElement("span");s.textContent=r,n.push(s)}else n.push(r);return n}updateBackground(e){let n;this.options.secondary?n=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:n=e?this.options.buttonHoverBackground:this.options.buttonBackground,n&&(this._element.style.backgroundColor=n)}get element(){return this._element}set label(e){var n;if(this._label===e||Hy(this._label)&&Hy(e)&&Uvt(this._label,e))return;this._element.classList.add("monaco-text-button");const r=this.options.supportShortLabel?this._labelElement:this._element;if(Hy(e)){const s=H$(e,{inline:!0});s.dispose();const o=(n=s.element.querySelector("p"))===null||n===void 0?void 0:n.innerHTML;if(o){const a=pEe(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});r.innerHTML=a}else ca(r)}else this.options.supportIcons?ca(r,...this.getContentElements(e)):r.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=obt(e)),this._label=e}get label(){return this._label}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}class Hee{constructor(e,n,r){this.options=n,this.styles=r,this.count=0,this.element=He(e,tt(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,n;this.element.textContent=ox(this.countFormat,this.count),this.element.title=ox(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(n=this.styles.badgeForeground)!==null&&n!==void 0?n:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const c_e="done",u_e="active",nK="infinite",iK="infinite-long-running",d_e="discrete";class tz extends Le{constructor(e,n){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new Ji(()=>Jc(this.element),0)),this.longRunningScheduler=this._register(new Ji(()=>this.infiniteLongRunning(),tz.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,n)}create(e,n){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(n==null?void 0:n.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(u_e,nK,iK,d_e),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(c_e),this.element.classList.contains(nK)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(d_e,c_e,iK),this.element.classList.add(u_e,nK),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(iK)}getContainer(){return this.element}}tz.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const L1t=tt;class D1t extends Le{constructor(e,n,r){super(),this.parent=e,this.onKeyDown=o=>Be(this.findInput.inputBox.inputElement,ht.KEY_DOWN,a=>{o(new yr(a))}),this.onMouseDown=o=>Be(this.findInput.inputBox.inputElement,ht.MOUSE_DOWN,a=>{o(new rh(a))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=He(this.parent,L1t(".quick-input-box")),this.findInput=this._register(new pRe(this.container,void 0,{label:"",inputBoxStyles:n,toggleStyles:r}));const s=this.findInput.inputBox.inputElement;s.role="combobox",s.ariaHasPopup="menu",s.ariaAutoComplete="list",s.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,n){this.findInput.inputBox.inputElement.setAttribute(e,n)}showDecoration(e){e===vs.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===vs.Info?1:e===vs.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===vs.Info?1:e===vs.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Ky{constructor(e,n){var r;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(r=n==null?void 0:n.supportIcons)!==null&&r!==void 0?r:!1,this.domNode=He(e,tt("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,n=[],r="",s){e||(e=""),s&&(e=Ky.escapeNewLines(e,n)),!(this.didEverRender&&this.text===e&&this.title===r&&od(this.highlights,n))&&(this.text=e,this.title=r,this.highlights=n,this.render())}render(){const e=[];let n=0;for(const r of this.highlights){if(r.end===r.start)continue;if(n<r.start){const a=this.text.substring(n,r.start);this.supportIcons?e.push(...Uy(a)):e.push(a),n=r.start}const s=this.text.substring(n,r.end),o=tt("span.highlight",void 0,...this.supportIcons?Uy(s):[s]);r.extraClasses&&o.classList.add(...r.extraClasses),e.push(o),n=r.end}if(n<this.text.length){const r=this.text.substring(n);this.supportIcons?e.push(...Uy(r)):e.push(r)}ca(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,n){let r=0,s=0;return e.replace(/\r\n|\r|\n/g,(o,a)=>{s=o===`\r
`?-1:0,a+=r;for(const l of n)l.end<=a||(l.start>=a&&(l.start+=s),l.end>=a&&(l.end+=s));return r+=s,"⏎"})}}class rK{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class z7 extends Le{constructor(e,n){super(),this.customHovers=new Map,this.creationOptions=n,this.domNode=this._register(new rK(He(e,tt(".monaco-icon-label")))),this.labelContainer=He(this.domNode.element,tt(".monaco-icon-label-container"));const r=He(this.labelContainer,tt("span.monaco-icon-name-container"));n!=null&&n.supportHighlights||n!=null&&n.supportIcons?this.nameNode=new T1t(r,!!n.supportIcons):this.nameNode=new E1t(r),this.hoverDelegate=n==null?void 0:n.hoverDelegate}get element(){return this.domNode.element}setLabel(e,n,r){const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let a="";if(r&&(r.extraClasses&&s.push(...r.extraClasses),r.italic&&s.push("italic"),r.strikethrough&&s.push("strikethrough"),r.disabledCommand&&o.push("disabled"),r.title&&(a+=r.title)),this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=o.join(" "),this.setupHover(r!=null&&r.descriptionTitle?this.labelContainer:this.element,r==null?void 0:r.title),this.nameNode.setLabel(e,r),n||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof Ky?(l.set(n||"",r?r.descriptionMatches:void 0,void 0,r==null?void 0:r.labelEscapeNewLines),this.setupHover(l.element,r==null?void 0:r.descriptionTitle)):(l.textContent=n&&(r!=null&&r.labelEscapeNewLines)?Ky.escapeNewLines(n,[]):n||"",this.setupHover(l.element,(r==null?void 0:r.descriptionTitle)||""),l.empty=!n)}}setupHover(e,n){const r=this.customHovers.get(e);if(r&&(r.dispose(),this.customHovers.delete(e)),!n){e.removeAttribute("title");return}if(!this.hoverDelegate)Gvt(e,n);else{const s=GTe(this.hoverDelegate,e,n);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const n=this._register(new rK(He(this.labelContainer,tt("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Ky(He(n.element,tt("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new rK(He(n.element,tt("span.label-description"))))}return this.descriptionNode}}class E1t{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,n){if(!(this.label===e&&od(this.options,n)))if(this.label=e,this.options=n,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=He(this.container,tt("a.label-name",{id:n==null?void 0:n.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let r=0;r<e.length;r++){const s=e[r],o=(n==null?void 0:n.domId)&&`${n==null?void 0:n.domId}_${r}`;He(this.container,tt("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":r,role:"treeitem"},s)),r<e.length-1&&He(this.container,tt("span.label-separator",void 0,(n==null?void 0:n.separator)||"/"))}}}}function I1t(i,e,n){if(!n)return;let r=0;return i.map(s=>{const o={start:r,end:r+s.length},a=n.map(l=>Ba.intersect(o,l)).filter(l=>!Ba.isEmpty(l)).map(({start:l,end:c})=>({start:l-r,end:c-r}));return r=o.end+e.length,a})}class T1t{constructor(e,n){this.container=e,this.supportIcons=n,this.label=void 0,this.singleLabel=void 0}setLabel(e,n){if(!(this.label===e&&od(this.options,n)))if(this.label=e,this.options=n,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Ky(He(this.container,tt("a.label-name",{id:n==null?void 0:n.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,n==null?void 0:n.matches,void 0,n==null?void 0:n.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const r=(n==null?void 0:n.separator)||"/",s=I1t(e,r,n==null?void 0:n.matches);for(let o=0;o<e.length;o++){const a=e[o],l=s?s[o]:void 0,c=(n==null?void 0:n.domId)&&`${n==null?void 0:n.domId}_${o}`,u=tt("a.label-name",{id:c,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new Ky(He(this.container,u),{supportIcons:this.supportIcons}).set(a,l,void 0,n==null?void 0:n.labelEscapeNewLines),o<e.length-1&&He(u,tt("span.label-separator",void 0,r))}}}}const b6=tt,R1t={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class q5{constructor(e,n,r){this.os=n,this.keyElements=new Set,this.options=r||Object.create(null);const s=this.options.keybindingLabelForeground;this.domNode=He(e,b6(".monaco-keybinding")),s&&(this.domNode.style.color=s),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,n){this.didEverRender&&this.keybinding===e&&q5.areSame(this.matches,n)||(this.keybinding=e,this.matches=n,this.render())}render(){var e;if(this.clear(),this.keybinding){const n=this.keybinding.getChords();n[0]&&this.renderChord(this.domNode,n[0],this.matches?this.matches.firstPart:null);for(let s=1;s<n.length;s++)He(this.domNode,b6("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,n[s],this.matches?this.matches.chordPart:null);const r=(e=this.options.disableTitle)!==null&&e!==void 0&&e?void 0:this.keybinding.getAriaLabel()||void 0;r!==void 0?this.domNode.title=r:this.domNode.removeAttribute("title")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){la(this.domNode),this.keyElements.clear()}renderChord(e,n,r){const s=Qoe.modifierLabels[this.os];n.ctrlKey&&this.renderKey(e,s.ctrlKey,!!(r!=null&&r.ctrlKey),s.separator),n.shiftKey&&this.renderKey(e,s.shiftKey,!!(r!=null&&r.shiftKey),s.separator),n.altKey&&this.renderKey(e,s.altKey,!!(r!=null&&r.altKey),s.separator),n.metaKey&&this.renderKey(e,s.metaKey,!!(r!=null&&r.metaKey),s.separator);const o=n.keyLabel;o&&this.renderKey(e,o,!!(r!=null&&r.keyCode),"")}renderKey(e,n,r,s){He(e,this.createKeyElement(n,r?".highlight":"")),s&&He(e,b6("span.monaco-keybinding-key-separator",void 0,s))}renderUnbound(e){He(e,this.createKeyElement(L("unbound","Unbound")))}createKeyElement(e,n=""){const r=b6("span.monaco-keybinding-key"+n,void 0,e);return this.keyElements.add(r),this.options.keybindingLabelBackground&&(r.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(r.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(r.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(r.style.boxShadow=`inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),r}static areSame(e,n){return e===n||!e&&!n?!0:!!e&&!!n&&od(e.firstPart,n.firstPart)&&od(e.chordPart,n.chordPart)}}const h_e=new K1(()=>{const i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:i,collatorIsNumeric:i.resolvedOptions().numeric}});function A1t(i,e,n=!1){const r=i||"",s=e||"",o=h_e.value.collator.compare(r,s);return h_e.value.collatorIsNumeric&&o===0&&r!==s?r<s?-1:1:o}function N1t(i,e,n){const r=i.toLowerCase(),s=e.toLowerCase(),o=M1t(i,e,n);if(o)return o;const a=r.endsWith(n),l=s.endsWith(n);if(a!==l)return a?-1:1;const c=A1t(r,s);return c!==0?c:r.localeCompare(s)}function M1t(i,e,n){const r=i.toLowerCase(),s=e.toLowerCase(),o=r.startsWith(n),a=s.startsWith(n);if(o!==a)return o?-1:1;if(o&&a){if(r.length<s.length)return-1;if(r.length>s.length)return 1}return 0}var P1t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class TRe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}P1t([Ms],TRe.prototype,"toString",null);const O1t=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function F1t(i){const e=[];let n=0,r;for(;r=O1t.exec(i);){r.index-n>0&&e.push(i.substring(n,r.index));const[,s,o,,a]=r;a?e.push({label:s,href:o,title:a}):e.push({label:s,href:o}),n=r.index+r[0].length}return n<i.length&&e.push(i.substring(n)),new TRe(e)}const sK={},B1t=new lae("quick-input-button-icon-");function Uee(i){if(!i)return;let e;const n=i.dark.toString();return sK[n]?e=sK[n]:(e=B1t.nextId(),cJ(`.${e}, .hc-light .${e}`,`background-image: ${f1(i.light||i.dark)}`),cJ(`.vs-dark .${e}, .hc-black .${e}`,`background-image: ${f1(i.dark)}`),sK[n]=e),e}function j1t(i,e,n){ca(e);const r=F1t(i);let s=0;for(const o of r.nodes)if(typeof o=="string")e.append(...Uy(o));else{let a=o.title;!a&&o.href.startsWith("command:")?a=L("executeCommand","Click to execute command '{0}'",o.href.substring(8)):a||(a=o.href);const l=tt("a",{href:o.href,title:a,tabIndex:s++},o.label);l.style.textDecoration="underline";const c=p=>{Jat(p)&&Nn.stop(p,!0),n.callback(o.href)},u=n.disposables.add(new Xn(l,ht.CLICK)).event,d=n.disposables.add(new Xn(l,ht.KEY_DOWN)).event,h=_t.chain(d,p=>p.filter(g=>{const m=new yr(g);return m.equals(10)||m.equals(3)}));n.disposables.add(or.addTarget(l));const f=n.disposables.add(new Xn(l,lr.Tap)).event;_t.any(u,f,h)(c,null,n.disposables),e.appendChild(l)}}var RRe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},f_e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const up=tt;class W1t{constructor(e,n,r,s,o,a,l){var c,u,d;this._checked=!1,this._hidden=!1,this.hasCheckbox=s,this.index=r,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=a,this._onChecked=l,this.onChecked=s?_t.map(_t.filter(this._onChecked.event,h=>h.listElement===this),h=>h.checked):_t.None,e.type==="separator"?this._separator=e:(this.item=e,n&&n.type==="separator"&&!n.buttons&&(this._separator=n),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.label,this._descriptionHighlights=(u=this.item.highlights)===null||u===void 0?void 0:u.description,this._detailHighlights=(d=this.item.highlights)===null||d===void 0?void 0:d.detail,this.saneTooltip=this.item.tooltip),this._init=new K1(()=>{var h;const f=(h=e.label)!==null&&h!==void 0?h:"",p=bN(f).text.trim(),g=e.ariaLabel||[f,this.saneDescription,this.saneDetail].map(m=>Hvt(m)).filter(m=>!!m).join(", ");return{saneLabel:f,saneSortLabel:p,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class K5{constructor(e){this.themeService=e}get templateId(){return K5.ID}renderTemplate(e){const n=Object.create(null);n.toDisposeElement=[],n.toDisposeTemplate=[],n.entry=He(e,up(".quick-input-list-entry"));const r=He(n.entry,up("label.quick-input-list-label"));n.toDisposeTemplate.push(As(r,ht.CLICK,u=>{n.checkbox.offsetParent||u.preventDefault()})),n.checkbox=He(r,up("input.quick-input-list-checkbox")),n.checkbox.type="checkbox",n.toDisposeTemplate.push(As(n.checkbox,ht.CHANGE,u=>{n.element.checked=n.checkbox.checked}));const s=He(r,up(".quick-input-list-rows")),o=He(s,up(".quick-input-list-row")),a=He(s,up(".quick-input-list-row"));n.label=new z7(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),n.toDisposeTemplate.push(n.label),n.icon=SEe(n.label.element,up(".quick-input-list-icon"));const l=He(o,up(".quick-input-list-entry-keybinding"));n.keybinding=new q5(l,Zu);const c=He(a,up(".quick-input-list-label-meta"));return n.detail=new z7(c,{supportHighlights:!0,supportIcons:!0}),n.toDisposeTemplate.push(n.detail),n.separator=He(n.entry,up(".quick-input-list-separator")),n.actionBar=new wh(n.entry),n.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),n.toDisposeTemplate.push(n.actionBar),n}renderElement(e,n,r){var s,o,a,l;r.element=e,e.element=(s=r.entry)!==null&&s!==void 0?s:void 0;const c=e.item?e.item:e.separator;r.checkbox.checked=e.checked,r.toDisposeElement.push(e.onChecked(g=>r.checkbox.checked=g));const{labelHighlights:u,descriptionHighlights:d,detailHighlights:h}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const g=$E(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(a=e.item.iconPath.light)!==null&&a!==void 0?a:e.item.iconPath.dark,m=Jt.revive(g);r.icon.className="quick-input-list-icon",r.icon.style.backgroundImage=f1(m)}else r.icon.style.backgroundImage="",r.icon.className=!((l=e.item)===null||l===void 0)&&l.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const f={matches:u||[],descriptionTitle:e.saneDescription,descriptionMatches:d||[],labelEscapeNewLines:!0};c.type!=="separator"?(f.extraClasses=c.iconClasses,f.italic=c.italic,f.strikethrough=c.strikethrough,r.entry.classList.remove("quick-input-list-separator-as-item")):r.entry.classList.add("quick-input-list-separator-as-item"),r.label.setLabel(e.saneLabel,e.saneDescription,f),r.keybinding.set(c.type==="separator"?void 0:c.keybinding),e.saneDetail?(r.detail.element.style.display="",r.detail.setLabel(e.saneDetail,void 0,{matches:h,title:e.saneDetail,labelEscapeNewLines:!0})):r.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(r.separator.textContent=e.separator.label,r.separator.style.display=""):r.separator.style.display="none",r.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const p=c.buttons;p&&p.length?(r.actionBar.push(p.map((g,m)=>{let _=g.iconClass||(g.iconPath?Uee(g.iconPath):void 0);return g.alwaysVisible&&(_=_?`${_} always-visible`:"always-visible"),{id:`id-${m}`,class:_,enabled:!0,label:"",tooltip:g.tooltip||"",run:()=>{c.type!=="separator"?e.fireButtonTriggered({button:g,item:c}):e.fireSeparatorButtonTriggered({button:g,separator:c})}}}),{icon:!0,label:!1}),r.entry.classList.add("has-actions")):r.entry.classList.remove("has-actions")}disposeElement(e,n,r){r.toDisposeElement=Mi(r.toDisposeElement),r.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=Mi(e.toDisposeElement),e.toDisposeTemplate=Mi(e.toDisposeTemplate)}}K5.ID="listelement";class $1t{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return K5.ID}}var jo;(function(i){i[i.First=1]="First",i[i.Second=2]="Second",i[i.Last=3]="Last",i[i.Next=4]="Next",i[i.Previous=5]="Previous",i[i.NextPage=6]="NextPage",i[i.PreviousPage=7]="PreviousPage"})(jo||(jo={}));class Tae{constructor(e,n,r,s){this.parent=e,this.options=r,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new _e,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new _e,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new _e,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new _e,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new _e,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new _e,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new _e,this.onKeyDown=this._onKeyDown.event,this._onLeave=new _e,this.onLeave=this._onLeave.event,this._listElementChecked=new _e,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=n,this.container=He(this.parent,up(".quick-input-list"));const o=new $1t,a=new H1t;if(this.list=r.createList("QuickInput",this.container,o,[new K5(s)],{identityProvider:{getId:l=>{var c,u,d,h,f,p,g,m;return(m=(p=(h=(u=(c=l.item)===null||c===void 0?void 0:c.id)!==null&&u!==void 0?u:(d=l.item)===null||d===void 0?void 0:d.label)!==null&&h!==void 0?h:(f=l.separator)===null||f===void 0?void 0:f.id)!==null&&p!==void 0?p:(g=l.separator)===null||g===void 0?void 0:g.label)!==null&&m!==void 0?m:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:a}),this.list.getHTMLElement().id=n,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(l=>{const c=new yr(l);switch(c.keyCode){case 10:this.toggleCheckbox();break;case 31:(ri?l.metaKey:l.ctrlKey)&&this.list.setFocus(Tl(this.list.length));break;case 16:{const u=this.list.getFocus();u.length===1&&u[0]===0&&this._onLeave.fire();break}case 18:{const u=this.list.getFocus();u.length===1&&u[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(c)})),this.disposables.push(this.list.onMouseDown(l=>{l.browserEvent.button!==2&&l.browserEvent.preventDefault()})),this.disposables.push(Be(this.container,ht.CLICK,l=>{(l.x||l.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(l=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(l=>{typeof l.index=="number"&&(l.browserEvent.preventDefault(),this.list.setSelection([l.index]))})),r.hoverDelegate){const l=new AEe(r.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(c=>f_e(this,void 0,void 0,function*(){var u;if(c.browserEvent.target instanceof HTMLAnchorElement){l.cancel();return}if(!(!(c.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&Ia(c.browserEvent.relatedTarget,(u=c.element)===null||u===void 0?void 0:u.element)))try{yield l.trigger(()=>f_e(this,void 0,void 0,function*(){c.element&&this.showHover(c.element)}))}catch(d){if(!sg(d))throw d}}))),this.disposables.push(this.list.onMouseOut(c=>{var u;Ia(c.browserEvent.relatedTarget,(u=c.element)===null||u===void 0?void 0:u.element)||l.cancel()})),this.disposables.push(l)}this.disposables.push(this._listElementChecked.event(l=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return _t.map(this.list.onDidChangeFocus,e=>e.elements.map(n=>n.item))}get onDidChangeSelection(){return _t.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(n=>n.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,n=!0){for(let r=0,s=e.length;r<s;r++){const o=e[r];if(!o.hidden)if(o.checked)n=!0;else return!1}return n}getCheckedCount(){let e=0;const n=this.elements;for(let r=0,s=n.length;r<s;r++)n[r].checked&&e++;return e}getVisibleCount(){let e=0;const n=this.elements;for(let r=0,s=n.length;r<s;r++)n[r].hidden||e++;return e}setAllVisibleChecked(e){try{this._fireCheckedEvents=!1,this.elements.forEach(n=>{n.hidden||(n.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=Mi(this.elementDisposables);const n=a=>this.fireButtonTriggered(a),r=a=>this.fireSeparatorButtonTriggered(a);this.inputElements=e;const s=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((a,l,c)=>{var u;const d=c>0?e[c-1]:void 0;if(l.type==="separator"&&!l.buttons)return a;const h=new W1t(l,d,c,o,n,r,this._listElementChecked),f=a.length;return a.push(h),s.set((u=h.item)!==null&&u!==void 0?u:h.separator,f),a},[]),this.elementsToIndexes=s,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(n=>this.elementsToIndexes.has(n)).map(n=>this.elementsToIndexes.get(n))),e.length>0){const n=this.list.getFocus()[0];typeof n=="number"&&this.list.reveal(n)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(n=>this.elementsToIndexes.has(n)).map(n=>this.elementsToIndexes.get(n)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const n=new Set;for(const r of e)n.add(r);for(const r of this.elements)r.checked=n.has(r.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===jo.Second&&this.list.length<2&&(e=jo.First),e){case jo.First:this.list.scrollTop=0,this.list.focusFirst(void 0,r=>!!r.item);break;case jo.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,r=>!!r.item);break;case jo.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,r=>!!r.item);break;case jo.Next:{this.list.focusNext(void 0,!0,void 0,s=>!!s.item);const r=this.list.getFocus()[0];r!==0&&!this.elements[r-1].item&&this.list.firstVisibleIndex>r-1&&this.list.reveal(r-1);break}case jo.Previous:{this.list.focusPrevious(void 0,!0,void 0,s=>!!s.item);const r=this.list.getFocus()[0];r!==0&&!this.elements[r-1].item&&this.list.firstVisibleIndex>r-1&&this.list.reveal(r-1);break}case jo.NextPage:this.list.focusNextPage(void 0,r=>!!r.item);break;case jo.PreviousPage:this.list.focusPreviousPage(void 0,r=>!!r.item);break}const n=this.list.getFocus()[0];typeof n=="number"&&this.list.reveal(n)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var n,r,s;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((r=(n=this.options.hoverDelegate).onDidHideHover)===null||r===void 0||r.call(n),(s=this._lastHover)===null||s===void 0||s.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const n=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(s=>{s.labelHighlights=void 0,s.descriptionHighlights=void 0,s.detailHighlights=void 0,s.hidden=!1;const o=s.index&&this.inputElements[s.index-1];s.item&&(s.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let s;this.elements.forEach(o=>{var a,l,c,u;let d;this.matchOnLabelMode==="fuzzy"?d=this.matchOnLabel&&(a=Hq(e,bN(o.saneLabel)))!==null&&a!==void 0?a:void 0:d=this.matchOnLabel&&(l=z1t(n,bN(o.saneLabel)))!==null&&l!==void 0?l:void 0;const h=this.matchOnDescription&&(c=Hq(e,bN(o.saneDescription||"")))!==null&&c!==void 0?c:void 0,f=this.matchOnDetail&&(u=Hq(e,bN(o.saneDetail||"")))!==null&&u!==void 0?u:void 0;if(d||h||f?(o.labelHighlights=d,o.descriptionHighlights=h,o.detailHighlights=f,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const p=o.index&&this.inputElements[o.index-1];s=p&&p.type==="separator"?p:s,s&&!o.hidden&&(o.separator=s,s=void 0)}})}const r=this.elements.filter(s=>!s.hidden);if(this.sortByLabel&&e){const s=e.toLowerCase();r.sort((o,a)=>V1t(o,a,s))}return this.elementsToIndexes=r.reduce((s,o,a)=>{var l;return s.set((l=o.item)!==null&&l!==void 0?l:o.separator,a),s},new Map),this.list.splice(0,this.list.length,r),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(r.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),n=this.allVisibleChecked(e);for(const r of e)r.checked=!n}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=Mi(this.elementDisposables),this.disposables=Mi(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const n=this.list.getFocusedElements()[0];if(!n)return;this.showHover(n);const r=new Xe;r.add(this.list.onDidChangeFocus(s=>{s.indexes.length&&this.showHover(s.elements[0])})),this._lastHover&&r.add(this._lastHover),this._toggleHover=r,this.elementDisposables.push(this._toggleHover)}}RRe([Ms],Tae.prototype,"onDidChangeFocus",null);RRe([Ms],Tae.prototype,"onDidChangeSelection",null);function z1t(i,e){const{text:n,iconOffsets:r}=e;if(!r||r.length===0)return p_e(i,n);const s=S5(n," "),o=n.length-s.length,a=p_e(i,s);if(a)for(const l of a){const c=r[l.start+o]+o;l.start+=c,l.end+=c}return a}function p_e(i,e){const n=e.toLowerCase().indexOf(i.toLowerCase());return n!==-1?[{start:n,end:n+i.length}]:null}function V1t(i,e,n){const r=i.labelHighlights||[],s=e.labelHighlights||[];return r.length&&!s.length?-1:!r.length&&s.length?1:r.length===0&&s.length===0?0:N1t(i.saneSortLabel,e.saneSortLabel,n)}class H1t{getWidgetAriaLabel(){return L("quickInput","Quick Input")}getAriaLabel(e){var n;return!((n=e.separator)===null||n===void 0)&&n.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var g_e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const qee={iconClass:en.asClassName(lt.quickInputBack),tooltip:L("quickInput.back","Back")};class G5 extends Le{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=G5.noPromptMessage,this._severity=vs.Ignore,this.onDidTriggerButtonEmitter=this._register(new _e),this.onDidHideEmitter=this._register(new _e),this.onDisposeEmitter=this._register(new _e),this.visibleDisposables=this._register(new Xe),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const n=this._ignoreFocusOut!==e&&!Kp;this._ignoreFocusOut=e&&!Kp,n&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=YP.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,n;if(!this.visible)return;const r=this.getTitle();r&&this.ui.title.textContent!==r?this.ui.title.textContent=r:!r&&this.ui.title.innerHTML!=="&nbsp;"&&(this.ui.title.innerText=" ");const s=this.getDescription();if(this.ui.description1.textContent!==s&&(this.ui.description1.textContent=s),this.ui.description2.textContent!==s&&(this.ui.description2.textContent=s),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?ca(this.ui.widget,this._widget):ca(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Mf,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const a=this.buttons.filter(c=>c===qee);this.ui.leftActionBar.push(a.map((c,u)=>{const d=new Vl(`id-${u}`,"",c.iconClass||Uee(c.iconPath),!0,()=>g_e(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(c)}));return d.tooltip=c.tooltip||"",d}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const l=this.buttons.filter(c=>c!==qee);this.ui.rightActionBar.push(l.map((c,u)=>{const d=new Vl(`id-${u}`,"",c.iconClass||Uee(c.iconPath),!0,()=>g_e(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(c)}));return d.tooltip=c.tooltip||"",d}),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const a=(n=(e=this.toggles)===null||e===void 0?void 0:e.filter(l=>l instanceof qI))!==null&&n!==void 0?n:[];this.ui.inputBox.toggles=a}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,ca(this.ui.message),j1t(o,this.ui.message,{callback:a=>{this.ui.linkOpenerDelegate(a)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?L("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==vs.Ignore){const n=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=n.foreground?`${n.foreground}`:"",this.ui.message.style.backgroundColor=n.background?`${n.background}`:"",this.ui.message.style.border=n.border?`1px solid ${n.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}G5.noPromptMessage=L("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class ZP extends G5{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new _e),this.onWillAcceptEmitter=this._register(new _e),this.onDidAcceptEmitter=this._register(new _e),this.onDidCustomEmitter=this._register(new _e),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=_p.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new _e),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new _e),this.onDidTriggerItemButtonEmitter=this._register(new _e),this.onDidTriggerSeparatorButtonEmitter=this._register(new _e),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,n){this._value!==e&&(this._value=e,n||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?x1t:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(jo.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(jo.Next),this.canSelectMany&&this.ui.list.domFocus(),Nn.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(jo.Previous):this.ui.list.focus(jo.Last),this.canSelectMany&&this.ui.list.domFocus(),Nn.stop(e,!0);break;case 12:this.ui.list.focus(jo.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Nn.stop(e,!0);break;case 11:this.ui.list.focus(jo.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Nn.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(jo.First),Nn.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(jo.Last),Nn.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&ys(e,this._activeItems,(n,r)=>n===r)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:n})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&ys(e,this._selectedItems,(r,s)=>r===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(n instanceof MouseEvent&&n.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&ys(e,this._selectedItems,(n,r)=>n===r)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let n=!1;this.onWillAcceptEmitter.fire({veto:()=>n=!0}),n||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return Be(this.ui.container,ht.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const n=new yr(e),r=n.keyCode;this._quickNavigate.keybindings.some(a=>{const l=a.getChords();return l.length>1?!1:l[0].shiftKey&&r===4?!(n.ctrlKey||n.altKey||n.metaKey):!!(l[0].altKey&&r===6||l[0].ctrlKey&&r===5||l[0].metaKey&&r===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,n=!!this.description,r={title:!!this.title||!!this.step||!!this.buttons.length,description:n,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||n,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(r),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;if(!s&&r.inputBox&&(s=this.placeholder||ZP.DEFAULT_ARIA_LABEL,this.title&&(s+=` - ${this.title}`)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case _p.NONE:this._itemActivation=_p.FIRST;break;case _p.SECOND:this.ui.list.focus(jo.Second),this._itemActivation=_p.FIRST;break;case _p.LAST:this.ui.list.focus(jo.Last),this._itemActivation=_p.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",r.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(jo.First)),this.keepScrollPosition&&(this.scrollTop=e)}}ZP.DEFAULT_ARIA_LABEL=L("quickInputBox.ariaLabel","Type to narrow down results.");class U1t extends G5{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new _e),this.onDidAcceptEmitter=this._register(new _e),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const jc=tt;class nz extends Le{constructor(e,n){super(),this.options=e,this.themeService=n,this.enabled=!0,this.onDidAcceptEmitter=this._register(new _e),this.onDidCustomEmitter=this._register(new _e),this.onDidTriggerButtonEmitter=this._register(new _e),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new _e),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new _e),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=n=>{this.keyMods.ctrlCmd=n.ctrlKey||n.metaKey,this.keyMods.alt=n.altKey};this._register(Be(window,ht.KEY_DOWN,e,!0)),this._register(Be(window,ht.KEY_UP,e,!0)),this._register(Be(window,ht.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=He(this.parentElement,jc(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const n=_h(e),r=He(e,jc(".quick-input-titlebar")),s=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new wh(r,s));o.domNode.classList.add("quick-input-left-action-bar");const a=He(r,jc(".quick-input-title")),l=this._register(new wh(r,s));l.domNode.classList.add("quick-input-right-action-bar");const c=He(e,jc(".quick-input-header")),u=He(c,jc("input.quick-input-check-all"));u.type="checkbox",u.setAttribute("aria-label",L("quickInput.checkAll","Toggle all checkboxes")),this._register(As(u,ht.CHANGE,B=>{const j=u.checked;P.setAllVisibleChecked(j)})),this._register(Be(u,ht.CLICK,B=>{(B.x||B.y)&&p.setFocus()}));const d=He(c,jc(".quick-input-description")),h=He(c,jc(".quick-input-and-message")),f=He(h,jc(".quick-input-filter")),p=this._register(new D1t(f,this.styles.inputBox,this.styles.toggle));p.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=He(f,jc(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const m=new Hee(g,{countFormat:L({},"{0} Results")},this.styles.countBadge),_=He(f,jc(".quick-input-count"));_.setAttribute("aria-live","polite");const b=new Hee(_,{countFormat:L({},"{0} Selected")},this.styles.countBadge),y=He(c,jc(".quick-input-action")),x=this._register(new Vee(y,this.styles.button));x.label=L("ok","OK"),this._register(x.onDidClick(B=>{this.onDidAcceptEmitter.fire()}));const k=He(c,jc(".quick-input-action")),D=this._register(new Vee(k,this.styles.button));D.label=L("custom","Custom"),this._register(D.onDidClick(B=>{this.onDidCustomEmitter.fire()}));const R=He(h,jc(`#${this.idPrefix}message.quick-input-message`)),E=this._register(new tz(e,this.styles.progressBar));E.getContainer().classList.add("quick-input-progress");const A=He(e,jc(".quick-input-html-widget"));A.tabIndex=-1;const M=He(e,jc(".quick-input-description")),N=this.idPrefix+"list",P=this._register(new Tae(e,N,this.options,this.themeService));p.setAttribute("aria-controls",N),this._register(P.onDidChangeFocus(()=>{var B;p.setAttribute("aria-activedescendant",(B=P.getActiveDescendant())!==null&&B!==void 0?B:"")})),this._register(P.onChangedAllVisibleChecked(B=>{u.checked=B})),this._register(P.onChangedVisibleCount(B=>{m.setCount(B)})),this._register(P.onChangedCheckedCount(B=>{b.setCount(B)})),this._register(P.onLeave(()=>{setTimeout(()=>{p.setFocus(),this.controller instanceof ZP&&this.controller.canSelectMany&&P.clearFocus()},0)}));const O=Gm(e);return this._register(O),this._register(Be(e,ht.FOCUS,B=>{Ia(B.relatedTarget,e)||(this.previousFocusElement=B.relatedTarget instanceof HTMLElement?B.relatedTarget:void 0)},!0)),this._register(O.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(YP.Blur),this.previousFocusElement=void 0})),this._register(Be(e,ht.FOCUS,B=>{p.setFocus()})),this._register(As(e,ht.KEY_DOWN,B=>{if(!Ia(B.target,A))switch(B.keyCode){case 3:Nn.stop(B,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:Nn.stop(B,!0),this.hide(YP.Gesture);break;case 2:if(!B.altKey&&!B.ctrlKey&&!B.metaKey){const j=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?j.push("input"):j.push("input[type=text]"),this.getUI().list.isDisplayed()&&j.push(".monaco-list"),this.getUI().message&&j.push(".quick-input-message a"),this.getUI().widget){if(Ia(B.target,this.getUI().widget))break;j.push(".quick-input-html-widget")}const z=e.querySelectorAll(j.join(", "));B.shiftKey&&B.target===z[0]?(Nn.stop(B,!0),P.clearFocus()):!B.shiftKey&&Ia(B.target,z[z.length-1])&&(Nn.stop(B,!0),z[0].focus())}break;case 10:B.ctrlKey&&(Nn.stop(B,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:n,leftActionBar:o,titleBar:r,title:a,description1:M,description2:d,widget:A,rightActionBar:l,checkAll:u,inputContainer:h,filterContainer:f,inputBox:p,visibleCountContainer:g,visibleCount:m,countContainer:_,count:b,okContainer:y,ok:x,message:R,customButtonContainer:k,customButton:D,list:P,progressBar:E,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:B=>this.show(B),hide:()=>this.hide(),setVisibilities:B=>this.setVisibilities(B),setEnabled:B=>this.setEnabled(B),setContextKey:B=>this.options.setContextKey(B),linkOpenerDelegate:B=>this.options.linkOpenerDelegate(B)},this.updateStyles(),this.ui}pick(e,n={},r=Hn.None){return new Promise((s,o)=>{let a=d=>{var h;a=s,(h=n.onKeyMods)===null||h===void 0||h.call(n,l.keyMods),s(d)};if(r.isCancellationRequested){a(void 0);return}const l=this.createQuickPick();let c;const u=[l,l.onDidAccept(()=>{if(l.canSelectMany)a(l.selectedItems.slice()),l.hide();else{const d=l.activeItems[0];d&&(a(d),l.hide())}}),l.onDidChangeActive(d=>{const h=d[0];h&&n.onDidFocus&&n.onDidFocus(h)}),l.onDidChangeSelection(d=>{if(!l.canSelectMany){const h=d[0];h&&(a(h),l.hide())}}),l.onDidTriggerItemButton(d=>n.onDidTriggerItemButton&&n.onDidTriggerItemButton(Object.assign(Object.assign({},d),{removeItem:()=>{const h=l.items.indexOf(d.item);if(h!==-1){const f=l.items.slice(),p=f.splice(h,1),g=l.activeItems.filter(_=>_!==p[0]),m=l.keepScrollPosition;l.keepScrollPosition=!0,l.items=f,g&&(l.activeItems=g),l.keepScrollPosition=m}}}))),l.onDidTriggerSeparatorButton(d=>{var h;return(h=n.onDidTriggerSeparatorButton)===null||h===void 0?void 0:h.call(n,d)}),l.onDidChangeValue(d=>{c&&!d&&(l.activeItems.length!==1||l.activeItems[0]!==c)&&(l.activeItems=[c])}),r.onCancellationRequested(()=>{l.hide()}),l.onDidHide(()=>{Mi(u),a(void 0)})];l.title=n.title,l.canSelectMany=!!n.canPickMany,l.placeholder=n.placeHolder,l.ignoreFocusOut=!!n.ignoreFocusLost,l.matchOnDescription=!!n.matchOnDescription,l.matchOnDetail=!!n.matchOnDetail,l.matchOnLabel=n.matchOnLabel===void 0||n.matchOnLabel,l.autoFocusOnList=n.autoFocusOnList===void 0||n.autoFocusOnList,l.quickNavigate=n.quickNavigate,l.hideInput=!!n.hideInput,l.contextKey=n.contextKey,l.busy=!0,Promise.all([e,n.activeItem]).then(([d,h])=>{c=h,l.busy=!1,l.items=d,l.canSelectMany&&(l.selectedItems=d.filter(f=>f.type!=="separator"&&f.picked)),c&&(l.activeItems=[c])}),l.show(),Promise.resolve(e).then(void 0,d=>{o(d),l.hide()})})}createQuickPick(){const e=this.getUI();return new ZP(e)}createInputBox(){const e=this.getUI();return new U1t(e)}show(e){const n=this.getUI();this.onShowEmitter.fire();const r=this.controller;this.controller=e,r==null||r.didHide(),this.setEnabled(!0),n.leftActionBar.clear(),n.title.textContent="",n.description1.textContent="",n.description2.textContent="",ca(n.widget),n.rightActionBar.clear(),n.checkAll.checked=!1,n.inputBox.placeholder="",n.inputBox.password=!1,n.inputBox.showDecoration(vs.Ignore),n.visibleCount.setCount(0),n.count.setCount(0),ca(n.message),n.progressBar.stop(),n.list.setElements([]),n.list.matchOnDescription=!1,n.list.matchOnDetail=!1,n.list.matchOnLabel=!0,n.list.sortByLabel=!0,n.ignoreFocusOut=!1,n.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();qee.tooltip=s?L("quickInput.backWithKeybinding","Back ({0})",s):L("quickInput.back","Back"),n.container.style.display="",this.updateLayout(),n.inputBox.setFocus()}setVisibilities(e){const n=this.getUI();n.title.style.display=e.title?"":"none",n.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",n.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",n.checkAll.style.display=e.checkAll?"":"none",n.inputContainer.style.display=e.inputBox?"":"none",n.filterContainer.style.display=e.inputBox?"":"none",n.visibleCountContainer.style.display=e.visibleCount?"":"none",n.countContainer.style.display=e.count?"":"none",n.okContainer.style.display=e.ok?"":"none",n.customButtonContainer.style.display=e.customButton?"":"none",n.message.style.display=e.message?"":"none",n.progressBar.getContainer().style.display=e.progressBar?"":"none",n.list.display(!!e.list),n.container.classList.toggle("show-checkboxes",!!e.checkBox),n.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const n of this.getUI().leftActionBar.viewItems)n.action.enabled=e;for(const n of this.getUI().rightActionBar.viewItems)n.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var n,r,s;const o=this.controller;if(!o)return;const a=!Ia(document.activeElement,(r=(n=this.ui)===null||n===void 0?void 0:n.container)!==null&&r!==void 0?r:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!a){let l=this.previousFocusElement;for(;l&&!l.offsetParent;)l=(s=l.parentElement)!==null&&s!==void 0?s:void 0;l!=null&&l.offsetParent?(l.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}o.didHide(e)}layout(e,n){this.dimension=e,this.titleBarOffset=n,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,n=Math.min(this.dimension.width*.62,nz.MAX_WIDTH);e.width=n+"px",e.marginLeft="-"+n/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:n,quickInputForeground:r,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=n??"",this.ui.container.style.color=r??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const a=[];this.styles.pickerGroup.pickerGroupBorder&&a.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&a.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&a.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(a.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&a.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&a.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&a.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&a.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&a.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),a.push("}"));const l=a.join(`
`);l!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=l)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}nz.MAX_WIDTH=600;var q1t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},y6=function(i,e){return function(n,r){e(n,r,i)}};let Kee=class extends Lft{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(zee))),this._quickAccess}constructor(e,n,r,s){super(r),this.instantiationService=e,this.contextKeyService=n,this.layoutService=s,this._onShow=this._register(new _e),this._onHide=this._register(new _e),this.contexts=new Map}createController(e=this.layoutService,n){const r={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(a=>{a.get(fu).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,a,l,c,u)=>this.instantiationService.createInstance(jee,o,a,l,c,u),styles:this.computeStyles()},s=this._register(new nz(Object.assign(Object.assign({},r),n),this.themeService));return s.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(o=>s.layout(o,e.offset.quickPickTop))),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let n;e&&(n=this.contexts.get(e),n||(n=new yt(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,n))),!(n&&n.get())&&(this.resetContextKeys(),n==null||n.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,n={},r=Hn.None){return this.controller.pick(e,n,r)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:wt(sge),quickInputForeground:wt(Adt),quickInputTitleBackground:wt(Ndt),widgetBorder:wt(poe),widgetShadow:wt(bm)},inputBox:T7,toggle:I7,countBadge:iRe,button:eyt,progressBar:tyt,keybindingLabel:Jbt,list:HI({listBackground:sge,listFocusBackground:vS,listFocusForeground:_S,listInactiveFocusForeground:_S,listInactiveSelectionIconForeground:l2,listInactiveFocusBackground:vS,listFocusOutline:Dr,listInactiveFocusOutline:Dr}),pickerGroup:{pickerGroupBorder:wt(Mdt),pickerGroupForeground:wt(fIe)}}}};Kee=q1t([y6(0,hn),y6(1,mn),y6(2,Do),y6(3,VI)],Kee);var ARe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},w2=function(i,e){return function(n,r){e(n,r,i)}};let Gee=class extends Kee{constructor(e,n,r,s,o){super(n,r,s,new eee(e.getContainerDomNode(),o)),this.host=void 0;const a=QE.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return l.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};Gee=ARe([w2(1,hn),w2(2,mn),w2(3,Do),w2(4,Si)],Gee);let Xee=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let n=this.mapEditorToService.get(e);if(!n){const r=n=this.instantiationService.createInstance(Gee,e);this.mapEditorToService.set(e,n),u1(e.onDidDispose)(()=>{r.dispose(),this.mapEditorToService.delete(e)})}return n}get quickAccess(){return this.activeService.quickAccess}constructor(e,n){this.instantiationService=e,this.codeEditorService=n,this.mapEditorToService=new Map}pick(e,n={},r=Hn.None){return this.activeService.pick(e,n,r)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};Xee=ARe([w2(0,hn),w2(1,Si)],Xee);class QE{static get(e){return e.getContribution(QE.ID)}constructor(e){this.editor=e,this.widget=new iz(this.editor)}dispose(){this.widget.dispose()}}QE.ID="editor.controller.quickInput";class iz{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return iz.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}iz.ID="editor.contrib.quickInputWidget";_i(QE.ID,QE,4);class K1t{constructor(e,n,r,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=o}}function G1t(i){if(!i||!Array.isArray(i))return[];const e=[];let n=0;for(let r=0,s=i.length;r<s;r++){const o=i[r];let a=-1;if(typeof o.fontStyle=="string"){a=0;const u=o.fontStyle.split(" ");for(let d=0,h=u.length;d<h;d++)switch(u[d]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let l=null;typeof o.foreground=="string"&&(l=o.foreground);let c=null;typeof o.background=="string"&&(c=o.background),e[n++]=new K1t(o.token||"",r,a,l,c)}return e}function X1t(i,e){i.sort((d,h)=>{const f=ewt(d.token,h.token);return f!==0?f:d.index-h.index});let n=0,r="000000",s="ffffff";for(;i.length>=1&&i[0].token==="";){const d=i.shift();d.fontStyle!==-1&&(n=d.fontStyle),d.foreground!==null&&(r=d.foreground),d.background!==null&&(s=d.background)}const o=new Z1t;for(const d of e)o.getId(d);const a=o.getId(r),l=o.getId(s),c=new Rae(n,a,l),u=new Aae(c);for(let d=0,h=i.length;d<h;d++){const f=i[d];u.insert(f.token,f.fontStyle,o.getId(f.foreground),o.getId(f.background))}return new NRe(o,u)}const Y1t=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class Z1t{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(e===null)return 0;const n=e.match(Y1t);if(!n)throw new Error("Illegal value for token color: "+e);e=n[1].toUpperCase();let r=this._color2id.get(e);return r||(r=++this._lastColorId,this._color2id.set(e,r),this._id2color[r]=Te.fromHex("#"+e),r)}getColorMap(){return this._id2color.slice(0)}}class NRe{static createFromRawTokenTheme(e,n){return this.createFromParsedTokenTheme(G1t(e),n)}static createFromParsedTokenTheme(e,n){return X1t(e,n)}constructor(e,n){this._colorMap=e,this._root=n,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,n){let r=this._cache.get(n);if(typeof r>"u"){const s=this._match(n),o=J1t(n);r=(s.metadata|o<<8)>>>0,this._cache.set(n,r)}return(r|e<<0)>>>0}}const Q1t=/\b(comment|string|regex|regexp)\b/;function J1t(i){const e=i.match(Q1t);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function ewt(i,e){return i<e?-1:i>e?1:0}class Rae{constructor(e,n,r){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=n,this._background=r,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new Rae(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,n,r){e!==-1&&(this._fontStyle=e),n!==0&&(this._foreground=n),r!==0&&(this._background=r),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class Aae{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const n=e.indexOf(".");let r,s;n===-1?(r=e,s=""):(r=e.substring(0,n),s=e.substring(n+1));const o=this._children.get(r);return typeof o<"u"?o.match(s):this._mainRule}insert(e,n,r,s){if(e===""){this._mainRule.acceptOverwrite(n,r,s);return}const o=e.indexOf(".");let a,l;o===-1?(a=e,l=""):(a=e.substring(0,o),l=e.substring(o+1));let c=this._children.get(a);typeof c>"u"&&(c=new Aae(this._mainRule.clone()),this._children.set(a,c)),c.insert(l,n,r,s)}}function twt(i){const e=[];for(let n=1,r=i.length;n<r;n++){const s=i[n];e[n]=`.mtk${n} { color: ${s}; }`}return e.push(".mtki { font-style: italic; }"),e.push(".mtkb { font-weight: bold; }"),e.push(".mtku { text-decoration: underline; text-underline-position: under; }"),e.push(".mtks { text-decoration: line-through; }"),e.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),e.join(`
`)}const nwt={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Lo]:"#FFFFFE",[_f]:"#000000",[pIe]:"#E5EBF1",[O5]:"#D3D3D3",[F5]:"#939393",[_oe]:"#ADD6FF4D"}},iwt={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Lo]:"#1E1E1E",[_f]:"#D4D4D4",[pIe]:"#3A3D41",[O5]:"#404040",[F5]:"#707070",[_oe]:"#ADD6FF26"}},rwt={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Lo]:"#000000",[_f]:"#FFFFFF",[O5]:"#FFFFFF",[F5]:"#FFFFFF"}},swt={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Lo]:"#FFFFFF",[_f]:"#292929",[O5]:"#292929",[F5]:"#292929"}},owt={IconContribution:"base.contributions.icons"};var m_e;(function(i){function e(n,r){let s=n.defaults;for(;en.isThemeIcon(s);){const o=rk.getIcon(s.id);if(!o)return;s=o.defaults}return s}i.getDefinition=e})(m_e||(m_e={}));var __e;(function(i){function e(r){return{weight:r.weight,style:r.style,src:r.src.map(s=>({format:s.format,location:s.location.toString()}))}}i.toJSONObject=e;function n(r){const s=o=>zl(o)?o:void 0;if(r&&Array.isArray(r.src)&&r.src.every(o=>zl(o.format)&&zl(o.location)))return{weight:s(r.weight),style:s(r.style),src:r.src.map(o=>({format:o.format,location:Jt.parse(o.location)}))}}i.fromJSONObject=n})(__e||(__e={}));class awt{constructor(){this._onDidChange=new _e,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:L("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:L("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${en.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,n,r,s){const o=this.iconsById[e];if(o){if(r&&!o.description){o.description=r,this.iconSchema.properties[e].markdownDescription=`${r} $(${e})`;const c=this.iconReferenceSchema.enum.indexOf(e);c!==-1&&(this.iconReferenceSchema.enumDescriptions[c]=r),this._onDidChange.fire()}return o}const a={id:e,description:r,defaults:n,deprecationMessage:s};this.iconsById[e]=a;const l={$ref:"#/definitions/icons"};return s&&(l.deprecationMessage=s),r&&(l.markdownDescription=`${r}: $(${e})`),this.iconSchema.properties[e]=l,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(r||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,a)=>o.id.localeCompare(a.id),n=o=>{for(;en.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},r=[];r.push("| preview | identifier | default codicon ID | description"),r.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(a=>!!a.description).sort(e))r.push(`|<i class="${n(o)}"></i>|${o.id}|${en.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);r.push("| preview | identifier "),r.push("| ----------- | --------------------------------- |");for(const o of s.filter(a=>!en.isThemeIcon(a.defaults)).sort(e))r.push(`|<i class="${n(o)}"></i>|${o.id}|`);return r.join(`
`)}}const rk=new awt;Kr.add(owt.IconContribution,rk);function ws(i,e,n,r){return rk.registerIcon(i,e,n,r)}function MRe(){return rk}function lwt(){const i=H2e();for(const e in i){const n="\\"+i[e].toString(16);rk.registerIcon(e,{fontCharacter:n})}}lwt();const PRe="vscode://schemas/icons",ORe=Kr.as(b$.JSONContribution);ORe.registerSchema(PRe,rk.getIconSchema());const v_e=new Ji(()=>ORe.notifySchemaChanged(PRe),200);rk.onDidChange(()=>{v_e.isScheduled()||v_e.schedule()});const FRe=ws("widget-close",lt.close,L("widgetClose","Icon for the close action in widgets."));ws("goto-previous-location",lt.arrowUp,L("previousChangeIcon","Icon for goto previous editor location."));ws("goto-next-location",lt.arrowDown,L("nextChangeIcon","Icon for goto next editor location."));en.modify(lt.sync,"spin");en.modify(lt.loading,"spin");function cwt(i){const e=new Xe,n=e.add(new _e),r=MRe();return e.add(r.onDidChange(()=>n.fire())),i&&e.add(i.onDidProductIconThemeChange(()=>n.fire())),{dispose:()=>e.dispose(),onDidChange:n.event,getCSS(){const s=i?i.getProductIconTheme():new BRe,o={},a=c=>{const u=s.getIcon(c);if(!u)return;const d=u.font;return d?(o[d.id]=d.definition,`.codicon-${c.id}:before { content: '${u.fontCharacter}'; font-family: ${dpe(d.id)}; }`):`.codicon-${c.id}:before { content: '${u.fontCharacter}'; }`},l=[];for(const c of r.getIcons()){const u=a(c);u&&l.push(u)}for(const c in o){const u=o[c],d=u.weight?`font-weight: ${u.weight};`:"",h=u.style?`font-style: ${u.style};`:"",f=u.src.map(p=>`${f1(p.location)} format('${p.format}')`).join(", ");l.push(`@font-face { src: ${f}; font-family: ${dpe(c)};${d}${h} font-display: block; }`)}return l.join(`
`)}}}class BRe{getIcon(e){const n=MRe();let r=e.defaults;for(;en.isThemeIcon(r);){const s=n.getIcon(r.id);if(!s)return;r=s.defaults}return r}}const U0="vs",rE="vs-dark",jS="hc-black",WS="hc-light",jRe=Kr.as(cIe.ColorContribution),uwt=Kr.as(LIe.ThemingContribution);class WRe{constructor(e,n){this.semanticHighlighting=!1,this.themeData=n;const r=n.base;e.length>0?(D8(e)?this.id=e:this.id=r+" "+e,this.themeName=e):(this.id=r,this.themeName=r),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const n in this.themeData.colors)e.set(n,Te.fromHex(this.themeData.colors[n]));if(this.themeData.inherit){const n=Yee(this.themeData.base);for(const r in n.colors)e.has(r)||e.set(r,Te.fromHex(n.colors[r]))}this.colors=e}return this.colors}getColor(e,n){const r=this.getColors().get(e);if(r)return r;if(n!==!1)return this.getDefault(e)}getDefault(e){let n=this.defaultColors[e];return n||(n=jRe.resolveDefaultColor(e,this),this.defaultColors[e]=n,n)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case U0:return sh.LIGHT;case jS:return sh.HIGH_CONTRAST_DARK;case WS:return sh.HIGH_CONTRAST_LIGHT;default:return sh.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],n=[];if(this.themeData.inherit){const o=Yee(this.themeData.base);e=o.rules,o.encodedTokensColors&&(n=o.encodedTokensColors)}const r=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(r||s){const o={token:""};r&&(o.foreground=r),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(n=this.themeData.encodedTokensColors),this._tokenTheme=NRe.createFromRawTokenTheme(e,n)}return this._tokenTheme}getTokenStyleMetadata(e,n,r){const o=this.tokenTheme._match([e].concat(n).join(".")).metadata,a=Da.getForeground(o),l=Da.getFontStyle(o);return{foreground:a,italic:!!(l&1),bold:!!(l&2),underline:!!(l&4),strikethrough:!!(l&8)}}}function D8(i){return i===U0||i===rE||i===jS||i===WS}function Yee(i){switch(i){case U0:return nwt;case rE:return iwt;case jS:return rwt;case WS:return swt}}function w6(i){const e=Yee(i);return new WRe(i,e)}class dwt extends Le{constructor(){super(),this._onColorThemeChange=this._register(new _e),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new _e),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new BRe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(U0,w6(U0)),this._knownThemes.set(rE,w6(rE)),this._knownThemes.set(jS,w6(jS)),this._knownThemes.set(WS,w6(WS));const e=this._register(cwt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(U0),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),tEe("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return $9(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=_h(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),Le.None}_registerShadowDomContainer(e){const n=_h(e,r=>{r.className="monaco-colors",r.textContent=this._allCSS});return this._styleElements.push(n),{dispose:()=>{for(let r=0;r<this._styleElements.length;r++)if(this._styleElements[r]===n){this._styleElements.splice(r,1);return}}}}defineTheme(e,n){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!D8(n.base)&&!D8(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new WRe(e,n)),D8(e)&&this._knownThemes.forEach(r=>{r.base===e&&r.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let n;this._knownThemes.has(e)?n=this._knownThemes.get(e):n=this._knownThemes.get(U0),this._updateActualTheme(n)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==Vp(this._theme.type)){let n;$E(this._theme.type)?n=e?jS:rE:n=e?WS:U0,this._updateActualTheme(this._knownThemes.get(n))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],n={},r={addRule:a=>{n[a]||(e.push(a),n[a]=!0)}};uwt.getThemingParticipants().forEach(a=>a(this._theme,r,this._environment));const s=[];for(const a of jRe.getColors()){const l=this._theme.getColor(a.id,!0);l&&s.push(`${foe(a.id)}: ${l.toString()};`)}r.addRule(`.monaco-editor, .monaco-diff-editor { ${s.join(`
`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();r.addRule(twt(o)),this._themeCSS=e.join(`
`),this._updateCSS(),Zr.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const bd=qn("themeService");var hwt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},oK=function(i,e){return function(n,r){e(n,r,i)}};let Zee=class extends Le{constructor(e,n,r){super(),this._contextKeyService=e,this._layoutService=n,this._configurationService=r,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new _e,this._onDidChangeReducedMotion=new _e,this._accessibilityModeEnabledContext=R5.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(a=>{a.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),a.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(Be(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const n=()=>{const r=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",r),this._layoutService.container.classList.toggle("enable-motion",!r)};n(),this._register(this.onDidChangeReducedMotion(()=>n()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};Zee=hwt([oK(0,mn),oK(1,VI),oK(2,ei)],Zee);var rz=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},bx=function(i,e){return function(n,r){e(n,r,i)}},zD,Qb;let Qee=class{constructor(e,n){this._commandService=e,this._hiddenStates=new V7(n)}createMenu(e,n,r){return new ete(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},r),this._commandService,n)}resetHiddenStates(e){this._hiddenStates.reset(e)}};Qee=rz([bx(0,us),bx(1,jf)],Qee);let V7=zD=class{constructor(e){this._storageService=e,this._disposables=new Xe,this._onDidChange=new _e,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const n=e.get(zD._key,0,"{}");this._data=JSON.parse(n)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,zD._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const n=e.get(zD._key,0,"{}");this._data=JSON.parse(n)}catch(n){console.log("FAILED to read storage after UPDATE",n)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,n){var r;return(r=this._hiddenByDefaultCache.get(`${e.id}/${n}`))!==null&&r!==void 0?r:!1}setDefaultState(e,n,r){this._hiddenByDefaultCache.set(`${e.id}/${n}`,r)}isHidden(e,n){var r,s;const o=this._isHiddenByDefault(e,n),a=(s=(r=this._data[e.id])===null||r===void 0?void 0:r.includes(n))!==null&&s!==void 0?s:!1;return o?!a:a}updateHidden(e,n,r){this._isHiddenByDefault(e,n)&&(r=!r);const o=this._data[e.id];if(r)o?o.indexOf(n)<0&&o.push(n):this._data[e.id]=[n];else if(o){const a=o.indexOf(n);a>=0&&yrt(o,a),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:n}of e)this._data[n]&&delete this._data[n];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(zD._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};V7._key="menu.hiddenCommands";V7=zD=rz([bx(0,jf)],V7);let Jee=Qb=class{constructor(e,n,r,s,o){this._id=e,this._hiddenStates=n,this._collectContextKeysForSubmenus=r,this._commandService=s,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=sa.getMenuItems(this._id);let n;e.sort(Qb._compareMenuItems);for(const r of e){const s=r.group||"";(!n||n[0]!==s)&&(n=[s,[]],this._menuGroups.push(n)),n[1].push(r),this._collectContextKeys(r)}}_collectContextKeys(e){if(Qb._fillInKbExprKeys(e.when,this._structureContextKeys),i2(e)){if(e.command.precondition&&Qb._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const n=e.command.toggled.condition||e.command.toggled;Qb._fillInKbExprKeys(n,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&sa.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const n=[];for(const r of this._menuGroups){const[s,o]=r,a=[];for(const l of o)if(this._contextKeyService.contextMatchesRules(l.when)){const c=i2(l);c&&this._hiddenStates.setDefaultState(this._id,l.command.id,!!l.isHiddenByDefault);const u=fwt(this._id,c?l.command:l,this._hiddenStates);if(c)a.push(new If(l.command,l.alt,e,u,this._contextKeyService,this._commandService));else{const d=new Qb(l.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),h=Vo.join(...d.map(f=>f[1]));h.length>0&&a.push(new dP(l,u,h))}}a.length>0&&n.push([s,a])}return n}static _fillInKbExprKeys(e,n){if(e)for(const r of e.keys())n.add(r)}static _compareMenuItems(e,n){const r=e.group,s=n.group;if(r!==s){if(r){if(!s)return-1}else return 1;if(r==="navigation")return-1;if(s==="navigation")return 1;const l=r.localeCompare(s);if(l!==0)return l}const o=e.order||0,a=n.order||0;return o<a?-1:o>a?1:Qb._compareTitles(i2(e)?e.command.title:e.title,i2(n)?n.command.title:n.title)}static _compareTitles(e,n){const r=typeof e=="string"?e:e.original,s=typeof n=="string"?n:n.original;return r.localeCompare(s)}};Jee=Qb=rz([bx(3,us),bx(4,mn)],Jee);let ete=class{constructor(e,n,r,s,o){this._disposables=new Xe,this._menuInfo=new Jee(e,n,r.emitEventsForSubmenuChanges,s,o);const a=new Ji(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},r.eventDebounceDelay);this._disposables.add(a),this._disposables.add(sa.onDidChangeMenu(d=>{d.has(e)&&a.schedule()}));const l=this._disposables.add(new Xe),c=d=>{let h=!1,f=!1,p=!1;for(const g of d)if(h=h||g.isStructuralChange,f=f||g.isEnablementChange,p=p||g.isToggleChange,h&&f&&p)break;return{menu:this,isStructuralChange:h,isEnablementChange:f,isToggleChange:p}},u=()=>{l.add(o.onDidChangeContext(d=>{const h=d.affectsSome(this._menuInfo.structureContextKeys),f=d.affectsSome(this._menuInfo.preconditionContextKeys),p=d.affectsSome(this._menuInfo.toggledContextKeys);(h||f||p)&&this._onDidChange.fire({menu:this,isStructuralChange:h,isEnablementChange:f,isToggleChange:p})})),l.add(n.onDidChange(d=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new N2e({onWillAddFirstListener:u,onDidRemoveLastListener:l.clear.bind(l),delay:r.eventDebounceDelay,merge:c}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};ete=rz([bx(3,us),bx(4,mn)],ete);function fwt(i,e,n){const r=uat(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=B2({id:`hide/${i.id}/${r}`,label:L("hide.label","Hide '{0}'",s),run(){n.updateHidden(i,r,!0)}}),a=B2({id:`toggle/${i.id}/${r}`,label:s,get checked(){return!n.isHidden(i,r)},run(){n.updateHidden(i,r,!!this.checked)}});return{hide:o,toggle:a,get isHidden(){return!a.checked}}}var pwt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},b_e=function(i,e){return function(n,r){e(n,r,i)}},sC=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let tte=class extends Le{constructor(e,n){super(),this.layoutService=e,this.logService=n,this.mapTextToType=new Map,this.findText="",this.resources=[],(h1||nEe)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const n=new f$;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=n,navigator.clipboard.write([new ClipboardItem({"text/plain":n.p})]).catch(r=>sC(this,void 0,void 0,function*(){(!(r instanceof Error)||r.name!=="NotAllowedError"||!n.isRejected)&&this.logService.error(r)}))};this.layoutService.hasContainer&&(this._register(Be(this.layoutService.container,"click",e)),this._register(Be(this.layoutService.container,"keydown",e)))}writeText(e,n){return sC(this,void 0,void 0,function*(){if(n){this.mapTextToType.set(n,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const r=document.activeElement,s=document.body.appendChild(tt("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),document.execCommand("copy"),r instanceof HTMLElement&&r.focus(),document.body.removeChild(s)})}readText(e){return sC(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(n){return console.error(n),""}})}readFindText(){return sC(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return sC(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return sC(this,void 0,void 0,function*(){this.resources=e})}readResources(){return sC(this,void 0,void 0,function*(){return this.resources})}};tte=pwt([b_e(0,VI),b_e(1,vd)],tte);const qv=qn("clipboardService");var gwt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mwt=function(i,e){return function(n,r){e(n,r,i)}};const vM="data-keybinding-context";let Nae=class{constructor(e,n){this._id=e,this._parent=n,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,n){return this._value[e]!==n?(this._value[e]=n,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const n=this._value[e];return typeof n>"u"&&this._parent?this._parent.getValue(e):n}};class JE extends Nae{constructor(){super(-1,null)}setValue(e,n){return!1}removeValue(e){return!1}getValue(e){}}JE.INSTANCE=new JE;class QP extends Nae{constructor(e,n,r){super(e,null),this._configurationService=n,this._values=eE.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===7){const o=Array.from(this._values,([a])=>a);this._values.clear(),r.fire(new w_e(o))}else{const o=[];for(const a of s.affectedKeys){const l=`config.${a}`,c=this._values.findSuperstr(l);c!==void 0&&(o.push(...Vn.map(c,([u])=>u)),this._values.deleteSuperstr(l)),this._values.has(l)&&(o.push(l),this._values.delete(l))}r.fire(new w_e(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(QP._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const n=e.substr(QP._keyPrefix.length),r=this._configurationService.getValue(n);let s;switch(typeof r){case"number":case"boolean":case"string":s=r;break;default:Array.isArray(r)?s=JSON.stringify(r):s=r}return this._values.set(e,s),s}setValue(e,n){return super.setValue(e,n)}removeValue(e){return super.removeValue(e)}}QP._keyPrefix="config.";class _wt{constructor(e,n,r){this._service=e,this._key=n,this._defaultValue=r,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class y_e{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class w_e{constructor(e){this.keys=e}affectsSome(e){for(const n of this.keys)if(e.has(n))return!0;return!1}allKeysContainedIn(e){return this.keys.every(n=>e.has(n))}}class vwt{constructor(e){this.events=e}affectsSome(e){for(const n of this.events)if(n.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(n=>n.allKeysContainedIn(e))}}function bwt(i,e){return i.allKeysContainedIn(new Set(Object.keys(e)))}class $Re extends Le{constructor(e){super(),this._onDidChangeContext=this._register(new sx({merge:n=>new vwt(n)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,n){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new _wt(this,e,n)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new ywt(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const n=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(n):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,n){if(this._isDisposed)return;const r=this.getContextValuesContainer(this._myContextId);r&&r.setValue(e,n)&&this._onDidChangeContext.fire(new y_e(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new y_e(e))}getContext(e){return this._isDisposed?JE.INSTANCE:this.getContextValuesContainer(wwt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let nte=class extends $Re{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const n=this._register(new QP(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,n)}getContextValuesContainer(e){return this._isDisposed?JE.INSTANCE:this._contexts.get(e)||JE.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const n=++this._lastContextId;return this._contexts.set(n,new Nae(n,this.getContextValuesContainer(e))),n}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};nte=gwt([mwt(0,ei)],nte);class ywt extends $Re{constructor(e,n){if(super(e.createChildContext()),this._parentChangeListener=this._register(new ha),this._parent=e,this._updateParentChangeListener(),this._domNode=n,this._domNode.hasAttribute(vM)){let r="";this._domNode.classList&&(r=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${r?": "+r:""}`)}this._domNode.setAttribute(vM,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const r=this._parent.getContextValuesContainer(this._myContextId).value;bwt(e,r)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(vM),super.dispose())}getContextValuesContainer(e){return this._isDisposed?JE.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function wwt(i){for(;i;){if(i.hasAttribute(vM)){const e=i.getAttribute(vM);return e?parseInt(e,10):NaN}i=i.parentElement}return 0}function Cwt(i,e,n){i.get(mn).createKey(String(e),Swt(n))}function Swt(i){return y2e(i,e=>{if(typeof e=="object"&&e.$mid===1)return Jt.revive(e).toString();if(e instanceof Jt)return e.toString()})}si.registerCommand("_setContext",Cwt);si.registerCommand({id:"getContextKeyInfo",handler(){return[...yt.all()].sort((i,e)=>i.key.localeCompare(e.key))},description:{description:L("getContextKeyInfo","A command that returns information about context keys"),args:[]}});si.registerCommand("_generateContextKeyInfo",function(){const i=[],e=new Set;for(const n of yt.all())e.has(n.key)||(e.add(n.key),i.push(n));i.sort((n,r)=>n.key.localeCompare(r.key)),console.log(JSON.stringify(i,void 0,2))});let xwt=class{constructor(e,n){this.key=e,this.data=n,this.incoming=new Map,this.outgoing=new Map}},C_e=class{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const n of this._nodes.values())n.outgoing.size===0&&e.push(n);return e}insertEdge(e,n){const r=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(n);r.outgoing.set(s.key,s),s.incoming.set(r.key,r)}removeNode(e){const n=this._hashFn(e);this._nodes.delete(n);for(const r of this._nodes.values())r.outgoing.delete(n),r.incoming.delete(n)}lookupOrInsertNode(e){const n=this._hashFn(e);let r=this._nodes.get(n);return r||(r=new xwt(n,e),this._nodes.set(n,r)),r}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[n,r]of this._nodes)e.push(`${n}
(-> incoming)[${[...r.incoming.keys()].join(", ")}]
(outgoing ->)[${[...r.outgoing.keys()].join(",")}]
`);return e.join(`
`)}findCycleSlow(){for(const[e,n]of this._nodes){const r=new Set([e]),s=this._findCycle(n,r);if(s)return s}}_findCycle(e,n){for(const[r,s]of e.outgoing){if(n.has(r))return[...n,r].join(" -> ");n.add(r);const o=this._findCycle(s,n);if(o)return o;n.delete(r)}}};const kwt=!1;class S_e extends Error{constructor(e){var n;super("cyclic dependency between services"),this.message=(n=e.findCycleSlow())!==null&&n!==void 0?n:`UNABLE to detect cycle, dumping graph:
${e.toString()}`}}class H7{constructor(e=new O$,n=!1,r,s=kwt){var o;this._services=e,this._strict=n,this._parent=r,this._enableTracing=s,this._activeInstantiations=new Set,this._services.set(hn,this),this._globalGraph=s?(o=r==null?void 0:r._globalGraph)!==null&&o!==void 0?o:new C_e(a=>a):void 0}createChild(e){return new H7(e,this._strict,this,this._enableTracing)}invokeFunction(e,...n){const r=hc.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:a=>{if(s)throw Rse("service accessor is only valid during the invocation of its target method");const l=this._getOrCreateServiceInstance(a,r);if(!l)throw new Error(`[invokeFunction] unknown service '${a}'`);return l}},...n)}finally{s=!0,r.stop()}}createInstance(e,...n){let r,s;return e instanceof im?(r=hc.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(n),r)):(r=hc.traceCreation(this._enableTracing,e),s=this._createInstance(e,n,r)),r.stop(),s}_createInstance(e,n=[],r){const s=Np.getServiceDependencies(e).sort((l,c)=>l.index-c.index),o=[];for(const l of s){const c=this._getOrCreateServiceInstance(l.id,r);c||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id}.`,!1),o.push(c)}const a=s.length>0?s[0].index:n.length;if(n.length!==a){console.trace(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${n.length} static arguments`);const l=a-n.length;l>0?n=n.concat(new Array(l)):n=n.slice(0,a)}return Reflect.construct(e,n.concat(o))}_setServiceInstance(e,n){if(this._services.get(e)instanceof im)this._services.set(e,n);else if(this._parent)this._parent._setServiceInstance(e,n);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const n=this._services.get(e);return!n&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):n}_getOrCreateServiceInstance(e,n){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const r=this._getServiceInstanceOrDescriptor(e);return r instanceof im?this._safeCreateAndCacheServiceInstance(e,r,n.branch(e,!0)):(n.branch(e,!1),r)}_safeCreateAndCacheServiceInstance(e,n,r){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,n,r)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,n,r){var s;const o=new C_e(c=>c.id.toString());let a=0;const l=[{id:e,desc:n,_trace:r}];for(;l.length;){const c=l.pop();if(o.lookupOrInsertNode(c),a++>1e3)throw new S_e(o);for(const u of Np.getServiceDependencies(c.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(u.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${u.id} which is NOT registered.`,!0),(s=this._globalGraph)===null||s===void 0||s.insertEdge(String(c.id),String(u.id)),d instanceof im){const h={id:u.id,desc:d,_trace:c._trace.branch(u.id,!0)};o.insertEdge(c,h),l.push(h)}}}for(;;){const c=o.roots();if(c.length===0){if(!o.isEmpty())throw new S_e(o);break}for(const{data:u}of c){if(this._getServiceInstanceOrDescriptor(u.id)instanceof im){const h=this._createServiceInstanceWithOwner(u.id,u.desc.ctor,u.desc.staticArguments,u.desc.supportsDelayedInstantiation,u._trace);this._setServiceInstance(u.id,h)}o.removeNode(u)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,n,r=[],s,o){if(this._services.get(e)instanceof im)return this._createServiceInstance(e,n,r,s,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,n,r,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${n.name}`)}_createServiceInstance(e,n,r=[],s,o){if(s){const a=new H7(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const l=new Map,c=new a8(()=>{const u=a._createInstance(n,r,o);for(const[d,h]of l){const f=u[d];if(typeof f=="function")for(const p of h)f.apply(u,p)}return l.clear(),u});return new Proxy(Object.create(null),{get(u,d){if(!c.isInitialized&&typeof d=="string"&&(d.startsWith("onDid")||d.startsWith("onWill"))){let p=l.get(d);return p||(p=new jl,l.set(d,p)),(m,_,b)=>{const y=p.push([m,_,b]);return gn(y)}}if(d in u)return u[d];const h=c.value;let f=h[d];return typeof f!="function"||(f=f.bind(h),u[d]=f),f},set(u,d,h){return c.value[d]=h,!0},getPrototypeOf(u){return n.prototype}})}else return this._createInstance(n,r,o)}_throwIfStrict(e,n){if(n&&console.warn(e),this._strict)throw new Error(e)}}class hc{static traceInvocation(e,n){return e?new hc(2,n.name||new Error().stack.split(`
`).slice(3,4).join(`
`)):hc._None}static traceCreation(e,n){return e?new hc(1,n.name):hc._None}constructor(e,n){this.type=e,this.name=n,this._start=Date.now(),this._dep=[]}branch(e,n){const r=new hc(3,e.toString());return this._dep.push([e,n,r]),r}stop(){const e=Date.now()-this._start;hc._totals+=e;let n=!1;function r(o,a){const l=[],c=new Array(o+1).join(" ");for(const[u,d,h]of a._dep)if(d&&h){n=!0,l.push(`${c}CREATES -> ${u}`);const f=r(o+1,h);f&&l.push(f)}else l.push(`${c}uses -> ${u}`);return l.join(`
`)}const s=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${r(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${hc._totals.toFixed(2)}ms)`];(e>2||n)&&hc.all.add(s.join(`
`))}}hc.all=new Set;hc._None=new class extends hc{constructor(){super(0,null)}stop(){}branch(){return this}};hc._totals=0;const Lwt=new Set([Pn.inMemory,Pn.vscodeSourceControl,Pn.walkThrough,Pn.walkThroughSnippet]);class Dwt{constructor(){this._byResource=new Va,this._byOwner=new Map}set(e,n,r){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(n,r);let o=this._byOwner.get(n);o||(o=new Va,this._byOwner.set(n,o)),o.set(e,r)}get(e,n){const r=this._byResource.get(e);return r==null?void 0:r.get(n)}delete(e,n){let r=!1,s=!1;const o=this._byResource.get(e);o&&(r=o.delete(n));const a=this._byOwner.get(n);if(a&&(s=a.delete(e)),r!==s)throw new Error("illegal state");return r&&s}values(e){var n,r,s,o;return typeof e=="string"?(r=(n=this._byOwner.get(e))===null||n===void 0?void 0:n.values())!==null&&r!==void 0?r:Vn.empty():Jt.isUri(e)?(o=(s=this._byResource.get(e))===null||s===void 0?void 0:s.values())!==null&&o!==void 0?o:Vn.empty():Vn.map(Vn.concat(...this._byOwner.values()),a=>a[1])}}class Ewt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Va,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const n of e){const r=this._data.get(n);r&&this._substract(r);const s=this._resourceStats(n);this._add(s),this._data.set(n,s)}}_resourceStats(e){const n={errors:0,warnings:0,infos:0,unknowns:0};if(Lwt.has(e.scheme))return n;for(const{severity:r}of this._service.read({resource:e}))r===es.Error?n.errors+=1:r===es.Warning?n.warnings+=1:r===es.Info?n.infos+=1:n.unknowns+=1;return n}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class ty{constructor(){this._onMarkerChanged=new N2e({delay:0,merge:ty._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Dwt,this._stats=new Ewt(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,n){for(const r of n||[])this.changeOne(e,r,[])}changeOne(e,n,r){if(p2e(r))this._data.delete(n,e)&&this._onMarkerChanged.fire([n]);else{const s=[];for(const o of r){const a=ty._toMarker(e,n,o);a&&s.push(a)}this._data.set(n,e,s),this._onMarkerChanged.fire([n])}}static _toMarker(e,n,r){let{code:s,severity:o,message:a,source:l,startLineNumber:c,startColumn:u,endLineNumber:d,endColumn:h,relatedInformation:f,tags:p}=r;if(a)return c=c>0?c:1,u=u>0?u:1,d=d>=c?d:c,h=h>0?h:u,{resource:n,owner:e,code:s,severity:o,message:a,source:l,startLineNumber:c,startColumn:u,endLineNumber:d,endColumn:h,relatedInformation:f,tags:p}}changeAll(e,n){const r=[],s=this._data.values(e);if(s)for(const o of s){const a=Vn.first(o);a&&(r.push(a.resource),this._data.delete(a.resource,e))}if(Ka(n)){const o=new Va;for(const{resource:a,marker:l}of n){const c=ty._toMarker(e,a,l);if(!c)continue;const u=o.get(a);u?u.push(c):(o.set(a,[c]),r.push(a))}for(const[a,l]of o)this._data.set(a,e,l)}r.length>0&&this._onMarkerChanged.fire(r)}read(e=Object.create(null)){let{owner:n,resource:r,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),n&&r){const a=this._data.get(r,n);if(a){const l=[];for(const c of a)if(ty._accept(c,s)){const u=l.push(c);if(o>0&&u===o)break}return l}else return[]}else if(!n&&!r){const a=[];for(const l of this._data.values())for(const c of l)if(ty._accept(c,s)){const u=a.push(c);if(o>0&&u===o)return a}return a}else{const a=this._data.values(r??n),l=[];for(const c of a)for(const u of c)if(ty._accept(u,s)){const d=l.push(u);if(o>0&&d===o)return l}return l}}static _accept(e,n){return n===void 0||(n&e.severity)===e.severity}static _merge(e){const n=new Va;for(const r of e)for(const s of r)n.set(s,!0);return Array.from(n.keys())}}class Iwt extends Le{constructor(){super(...arguments),this._configurationModel=new Wa}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new Wa;const e=Kr.as(ag.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,n){const r=this.getConfigurationDefaultOverrides();for(const s of e){const o=r[s],a=n[s];o!==void 0?this._configurationModel.addValue(s,o):a?this._configurationModel.addValue(s,a.default):this._configurationModel.removeValue(s)}}}const X5=qn("audioCue");class On{static register(e){return new On(e.fileName)}constructor(e){this.fileName=e}}On.error=On.register({fileName:"error.mp3"});On.warning=On.register({fileName:"warning.mp3"});On.foldedArea=On.register({fileName:"foldedAreas.mp3"});On.break=On.register({fileName:"break.mp3"});On.quickFixes=On.register({fileName:"quickFixes.mp3"});On.taskCompleted=On.register({fileName:"taskCompleted.mp3"});On.taskFailed=On.register({fileName:"taskFailed.mp3"});On.terminalBell=On.register({fileName:"terminalBell.mp3"});On.diffLineInserted=On.register({fileName:"diffLineInserted.mp3"});On.diffLineDeleted=On.register({fileName:"diffLineDeleted.mp3"});On.diffLineModified=On.register({fileName:"diffLineModified.mp3"});On.chatRequestSent=On.register({fileName:"chatRequestSent.mp3"});On.chatResponsePending=On.register({fileName:"chatResponsePending.mp3"});On.chatResponseReceived1=On.register({fileName:"chatResponseReceived1.mp3"});On.chatResponseReceived2=On.register({fileName:"chatResponseReceived2.mp3"});On.chatResponseReceived3=On.register({fileName:"chatResponseReceived3.mp3"});On.chatResponseReceived4=On.register({fileName:"chatResponseReceived4.mp3"});class Twt{constructor(e){this.randomOneOf=e}}class fi{static register(e){const n=new Twt("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),r=new fi(n,e.name,e.settingsKey);return fi._audioCues.add(r),r}constructor(e,n,r){this.sound=e,this.name=n,this.settingsKey=r}}fi._audioCues=new Set;fi.error=fi.register({name:L("audioCues.lineHasError.name","Error on Line"),sound:On.error,settingsKey:"audioCues.lineHasError"});fi.warning=fi.register({name:L("audioCues.lineHasWarning.name","Warning on Line"),sound:On.warning,settingsKey:"audioCues.lineHasWarning"});fi.foldedArea=fi.register({name:L("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:On.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});fi.break=fi.register({name:L("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:On.break,settingsKey:"audioCues.lineHasBreakpoint"});fi.inlineSuggestion=fi.register({name:L("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:On.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});fi.terminalQuickFix=fi.register({name:L("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:On.quickFixes,settingsKey:"audioCues.terminalQuickFix"});fi.onDebugBreak=fi.register({name:L("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:On.break,settingsKey:"audioCues.onDebugBreak"});fi.noInlayHints=fi.register({name:L("audioCues.noInlayHints","No Inlay Hints on Line"),sound:On.error,settingsKey:"audioCues.noInlayHints"});fi.taskCompleted=fi.register({name:L("audioCues.taskCompleted","Task Completed"),sound:On.taskCompleted,settingsKey:"audioCues.taskCompleted"});fi.taskFailed=fi.register({name:L("audioCues.taskFailed","Task Failed"),sound:On.taskFailed,settingsKey:"audioCues.taskFailed"});fi.terminalCommandFailed=fi.register({name:L("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:On.error,settingsKey:"audioCues.terminalCommandFailed"});fi.terminalBell=fi.register({name:L("audioCues.terminalBell","Terminal Bell"),sound:On.terminalBell,settingsKey:"audioCues.terminalBell"});fi.notebookCellCompleted=fi.register({name:L("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:On.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});fi.notebookCellFailed=fi.register({name:L("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:On.taskFailed,settingsKey:"audioCues.notebookCellFailed"});fi.diffLineInserted=fi.register({name:L("audioCues.diffLineInserted","Diff Line Inserted"),sound:On.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});fi.diffLineDeleted=fi.register({name:L("audioCues.diffLineDeleted","Diff Line Deleted"),sound:On.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});fi.diffLineModified=fi.register({name:L("audioCues.diffLineModified","Diff Line Modified"),sound:On.diffLineModified,settingsKey:"audioCues.diffLineModified"});fi.chatRequestSent=fi.register({name:L("audioCues.chatRequestSent","Chat Request Sent"),sound:On.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});fi.chatResponseReceived=fi.register({name:L("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[On.chatResponseReceived1,On.chatResponseReceived2,On.chatResponseReceived3,On.chatResponseReceived4]}});fi.chatResponsePending=fi.register({name:L("audioCues.chatResponsePending","Chat Response Pending"),sound:On.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class Rwt extends Le{constructor(e,n=[]){super(),this.logger=new hat([e,...n]),this._register(e.onDidChangeLogLevel(r=>this.setLevel(r)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...n){this.logger.trace(e,...n)}debug(e,...n){this.logger.debug(e,...n)}info(e,...n){this.logger.info(e,...n)}warn(e,...n){this.logger.warn(e,...n)}error(e,...n){this.logger.error(e,...n)}}const zRe=[];function sz(i){zRe.push(i)}function Awt(){return zRe.slice(0)}var Q1=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ia=function(i,e){return function(n,r){e(n,r,i)}},sE=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class Nwt{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new _e}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let ite=class{constructor(e){this.modelService=e}createModelReference(e){const n=this.modelService.getModel(e);return n?Promise.resolve(new Bst(new Nwt(n))):Promise.reject(new Error("Model not found"))}};ite=Q1([ia(0,Fr)],ite);class oz{show(){return oz.NULL_PROGRESS_RUNNER}showWhile(e,n){return sE(this,void 0,void 0,function*(){yield e})}}oz.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class Mwt{withProgress(e,n,r){return n({report:()=>{}})}}class Pwt{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class Owt{confirm(e){return sE(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,n){let r=e;return n&&(r=r+`
`+n),window.confirm(r)}prompt(e){var n,r;return sE(this,void 0,void 0,function*(){let s;if(this.doConfirm(e.message,e.detail)){const a=[...(n=e.buttons)!==null&&n!==void 0?n:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&a.push(e.cancelButton),s=yield(r=a[0])===null||r===void 0?void 0:r.run({checkboxChecked:!1})}return{result:s}})}error(e,n){return sE(this,void 0,void 0,function*(){yield this.prompt({type:vs.Error,message:e,detail:n})})}}class JP{info(e){return this.notify({severity:vs.Info,message:e})}warn(e){return this.notify({severity:vs.Warning,message:e})}error(e){return this.notify({severity:vs.Error,message:e})}notify(e){switch(e.severity){case vs.Error:console.error(e.message);break;case vs.Warning:console.warn(e.message);break;default:console.log(e.message);break}return JP.NO_OP}prompt(e,n,r,s){return JP.NO_OP}status(e,n){return Le.None}}JP.NO_OP=new $_t;let rte=class{constructor(e){this._onWillExecuteCommand=new _e,this._onDidExecuteCommand=new _e,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...n){const r=si.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:n});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[r.handler,...n]);return this._onDidExecuteCommand.fire({commandId:e,args:n}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};rte=Q1([ia(0,hn)],rte);let eI=class extends X0t{constructor(e,n,r,s,o,a){super(e,n,r,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const l=p=>{const g=new Xe;g.add(Be(p,ht.KEY_DOWN,m=>{const _=new yr(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(Be(p,ht.KEY_UP,m=>{const _=new yr(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new Fwt(p,g))},c=p=>{for(let g=0;g<this._domNodeListeners.length;g++){const m=this._domNodeListeners[g];m.domNode===p&&(this._domNodeListeners.splice(g,1),m.dispose())}},u=p=>{p.getOption(61)||l(p.getContainerDomNode())},d=p=>{p.getOption(61)||c(p.getContainerDomNode())};this._register(a.onCodeEditorAdd(u)),this._register(a.onCodeEditorRemove(d)),a.listCodeEditors().forEach(u);const h=p=>{l(p.getContainerDomNode())},f=p=>{c(p.getContainerDomNode())};this._register(a.onDiffEditorAdd(h)),this._register(a.onDiffEditorRemove(f)),a.listDiffEditors().forEach(h)}addDynamicKeybinding(e,n,r,s){return Sf(si.registerCommand(e,r),this.addDynamicKeybindings([{keybinding:n,command:e,when:s}]))}addDynamicKeybindings(e){const n=e.map(r=>{var s;return{keybinding:oJ(r.keybinding,Zu),command:(s=r.command)!==null&&s!==void 0?s:null,commandArgs:r.commandArgs,when:r.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(n),this.updateResolver(),gn(()=>{for(let r=0;r<this._dynamicKeybindings.length;r++)if(this._dynamicKeybindings[r]===n[0]){this._dynamicKeybindings.splice(r,n.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(Sc.getDefaultKeybindings(),!0),n=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new _M(e,n,r=>this._log(r))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,n){const r=[];let s=0;for(const o of e){const a=o.when||void 0,l=o.keybinding;if(!l)r[s++]=new Mme(void 0,o.command,o.commandArgs,a,n,null,!1);else{const c=jP.resolveKeybinding(l,Zu);for(const u of c)r[s++]=new Mme(u,o.command,o.commandArgs,a,n,null,!1)}}return r}resolveKeyboardEvent(e){const n=new Iv(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new jP([n],Zu)}};eI=Q1([ia(0,mn),ia(1,us),ia(2,_d),ia(3,Ps),ia(4,vd),ia(5,Si)],eI);class Fwt extends Le{constructor(e,n){super(),this.domNode=e,this._register(n)}}function x_e(i){return i&&typeof i=="object"&&(!i.overrideIdentifier||typeof i.overrideIdentifier=="string")&&(!i.resource||i.resource instanceof Jt)}class VRe{constructor(){this._onDidChangeConfiguration=new _e,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new Iwt;this._configuration=new W$(e.reload(),new Wa,new Wa,new Wa),e.dispose()}getValue(e,n){const r=typeof e=="string"?e:void 0,s=x_e(e)?e:x_e(n)?n:{};return this._configuration.getValue(r,s,void 0)}updateValues(e){const n={data:this._configuration.toData()},r=[];for(const s of e){const[o,a]=s;this.getValue(o)!==a&&(this._configuration.updateValue(o,a),r.push(o))}if(r.length>0){const s=new U0t({keys:r,overrides:[]},n,this._configuration);s.source=8,s.sourceConfig=null,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,n,r,s){return this.updateValues([[e,n]])}inspect(e,n={}){return this._configuration.inspect(e,n,void 0)}}let ste=class{constructor(e,n,r){this.configurationService=e,this.modelService=n,this.languageService=r,this._onDidChangeConfiguration=new _e,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,a)=>s.affectsConfiguration(a)})})}getValue(e,n,r){const s=ve.isIPosition(n)?n:null,o=s?typeof r=="string"?r:void 0:typeof n=="string"?n:void 0,a=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:a}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:a})}getLanguage(e,n){const r=this.modelService.getModel(e);return r?n?r.getLanguageIdAtPosition(n.lineNumber,n.column):r.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};ste=Q1([ia(0,ei),ia(1,Fr),ia(2,Ar)],ste);let ote=class{constructor(e){this.configurationService=e}getEOL(e,n){const r=this.configurationService.getValue("files.eol",{overrideIdentifier:n,resource:e});return r&&typeof r=="string"&&r!=="auto"?r:_l||ri?`
`:`\r
`}};ote=Q1([ia(0,ei)],ote);class Bwt{publicLog2(){}}class eO{constructor(){const e=Jt.from({scheme:eO.SCHEME,authority:"model",path:"/"});this.workspace={id:MTe,folders:[new cvt({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===eO.SCHEME?this.workspace.folders[0]:null}}eO.SCHEME="inmemory";function U7(i,e,n){if(!e||!(i instanceof VRe))return;const r=[];Object.keys(e).forEach(s=>{W0t(s)&&r.push([`editor.${s}`,e[s]]),n&&$0t(s)&&r.push([`diffEditor.${s}`,e[s]])}),r.length>0&&i.updateValues(r)}let ate=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,n){return sE(this,void 0,void 0,function*(){const r=Array.isArray(e)?e:Zoe.convert(e),s=new Map;for(const l of r){if(!(l instanceof mv))throw new Error("bad edit - only text edits are supported");const c=this._modelService.getModel(l.resource);if(!c)throw new Error("bad edit - model not found");if(typeof l.versionId=="number"&&c.getVersionId()!==l.versionId)throw new Error("bad state - model changed in the meantime");let u=s.get(c);u||(u=[],s.set(c,u)),u.push(Vr.replaceMove(J.lift(l.textEdit.range),l.textEdit.text))}let o=0,a=0;for(const[l,c]of s)l.pushStackElement(),l.pushEditOperations([],c,()=>[]),l.pushStackElement(),a+=1,o+=c.length;return{ariaSummary:ox(dee.bulkEditServiceSummary,o,a),isApplied:o>0}})}};ate=Q1([ia(0,Fr)],ate);class jwt{getUriLabel(e,n){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return yh(e)}}let lte=class extends hee{constructor(e,n){super(e),this._codeEditorService=n}showContextView(e,n,r){if(!n){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(n=s.getContainerDomNode())}return super.showContextView(e,n,r)}};lte=Q1([ia(0,VI),ia(1,Si)],lte);class Wwt{constructor(){this._neverEmitter=new _e,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class $wt extends zP{constructor(){super()}}class zwt extends Rwt{constructor(){super(new dat)}}let cte=class extends Tee{constructor(e,n,r,s,o,a){super(e,n,r,s,o,a),this.configure({blockMouse:!1})}};cte=Q1([ia(0,_d),ia(1,Ps),ia(2,Vv),ia(3,sr),ia(4,c_),ia(5,mn)],cte);class Vwt{playAudioCue(e,n){return sE(this,void 0,void 0,function*(){})}}oi(ei,VRe,0);oi(ooe,ste,0);oi(tIe,ote,0);oi(px,eO,0);oi(KE,jwt,0);oi(_d,Bwt,0);oi(W5,Owt,0);oi(Goe,Pwt,0);oi(Ps,JP,0);oi(h_,ty,0);oi(Ar,$wt,0);oi(bd,dwt,0);oi(vd,zwt,0);oi(Fr,P7,0);oi(hoe,Pee,0);oi(mn,nte,0);oi(NTe,Mwt,0);oi(Z1,oz,0);oi(jf,Zbt,0);oi(Wf,wJ,0);oi($5,ate,0);oi(PTe,Wwt,0);oi(Ec,ite,0);oi(zv,Zee,0);oi(Lh,f1t,0);oi(us,rte,0);oi(sr,eI,0);oi(lg,Xee,0);oi(Vv,lte,0);oi(fu,Mee,0);oi(qv,tte,0);oi(Ff,cte,0);oi(c_,Qee,0);oi(X5,Vwt,0);var un;(function(i){const e=new O$;for(const[c,u]of ype())e.set(c,u);const n=new H7(e,!0);e.set(hn,n);function r(c){s||a({});const u=e.get(c);if(!u)throw new Error("Missing service "+c);return u instanceof im?n.invokeFunction(d=>d.get(c)):u}i.get=r;let s=!1;const o=new _e;function a(c){if(s)return n;s=!0;for(const[d,h]of ype())e.get(d)||e.set(d,h);for(const d in c)if(c.hasOwnProperty(d)){const h=qn(d);e.get(h)instanceof im&&e.set(h,c[d])}const u=Awt();for(const d of u)try{n.createInstance(d)}catch(h){Ln(h)}return o.fire(),n}i.initialize=a;function l(c){if(s)return c();const u=new Xe,d=u.add(o.event(()=>{d.dispose(),u.add(c())}));return u}i.withServices=l})(un||(un={}));let Hwt;function vv(){return Hwt}let HRe;function Uwt(i){HRe=i}class URe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,n){const r=n===void 0?void 0:e,s=n===void 0?e:n;return HRe({owner:r,debugName:()=>{const o=sk(s);if(o!==void 0)return o;const l=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(l)return`${this.debugName}.${l[2]}`;if(!r)return`${this.debugName} (mapped)`}},o=>s(this.read(o),o))}}class Y5 extends URe{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const n=this.observers.size;this.observers.add(e),n===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Pr(i,e){const n=new qRe(i,e);try{i(n)}finally{n.finish()}}function ute(i,e,n){i?e(i):Pr(e,n)}class qRe{constructor(e,n){var r;this._fn=e,this._getDebugName=n,this.updatingObservers=[],(r=vv())===null||r===void 0||r.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():sk(this._fn)}updateObserver(e,n){this.updatingObservers.push({observer:e,observable:n}),e.beginUpdate(n)}finish(){var e;const n=this.updatingObservers;this.updatingObservers=null;for(const{observer:r,observable:s}of n)r.endUpdate(s);(e=vv())===null||e===void 0||e.handleEndTransaction()}}function Mae(i,e,n,r){let s;if(i!==void 0)if(typeof i=="function"){if(s=i(),s!==void 0)return s}else return i;if(e!==void 0&&(s=sk(e),s!==void 0))return s;if(n!==void 0){for(const o in n)if(n[o]===r)return o}}function sk(i){const e=i.toString(),r=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),s=r?r[1]:void 0;return s==null?void 0:s.trim()}function vr(i,e){return typeof i=="string"?new dte(void 0,i,e):new dte(i,void 0,e)}class dte extends Y5{get debugName(){var e;return(e=Mae(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,n,r){super(),this._owner=e,this._debugName=n,this._value=r}get(){return this._value}set(e,n,r){var s;if(this._value===e)return;let o;n||(n=o=new qRe(()=>{},()=>`Setting ${this.debugName}`));try{const a=this._value;this._setValue(e),(s=vv())===null||s===void 0||s.handleObservableChanged(this,{oldValue:a,newValue:e,change:r,didChange:!0,hadValue:!0});for(const l of this.observers)n.updateObserver(l,this),l.handleChange(this,r)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function q7(i,e){return typeof i=="string"?new k_e(void 0,i,e):new k_e(i,void 0,e)}class k_e extends dte{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const tO=(i,e)=>i===e;function ni(i,e){return e!==void 0?new iO(i,void 0,e,void 0,void 0,void 0,tO):new iO(void 0,void 0,i,void 0,void 0,void 0,tO)}function L_e(i,e){var n;return new iO(i.owner,i.debugName,e,void 0,void 0,void 0,(n=i.equalityComparer)!==null&&n!==void 0?n:tO)}function qwt(i,e){var n;return new iO(i.owner,i.debugName,e,i.createEmptyChangeSummary,i.handleChange,void 0,(n=i.equalityComparer)!==null&&n!==void 0?n:tO)}function nO(i,e){let n,r;e===void 0?(n=i,r=void 0):(r=i,n=e);const s=new Xe;return new iO(r,()=>{var o;return(o=sk(n))!==null&&o!==void 0?o:"(anonymous)"},o=>(s.clear(),n(o,s)),void 0,void 0,()=>s.dispose(),tO)}Uwt(ni);class iO extends Y5{get debugName(){var e;return(e=Mae(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,n,r,s,o,a=void 0,l){var c,u;super(),this._owner=e,this._debugName=n,this._computeFn=r,this.createChangeSummary=s,this._handleChange=o,this._handleLastObserverRemoved=a,this._equalityComparator=l,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(c=this.createChangeSummary)===null||c===void 0?void 0:c.call(this),(u=vv())===null||u===void 0||u.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const n of this.dependencies)n.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const n=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),n}else{do{if(this.state===1){for(const n of this.dependencies)if(n.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,n;if(this.state===3)return;const r=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=r;const s=this.state!==0,o=this.value;this.state=3;const a=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,a)}finally{for(const c of this.dependenciesToBeRemoved)c.removeObserver(this);this.dependenciesToBeRemoved.clear()}const l=s&&!this._equalityComparator(o,this.value);if((n=vv())===null||n===void 0||n.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:l,hadValue:s}),l)for(const c of this.observers)c.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const n=this.updateCount===1;if(this.state===3&&(this.state=1,!n))for(const r of this.observers)r.handlePossibleChange(this);if(n)for(const r of this.observers)r.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const n=[...this.observers];for(const r of n)r.endUpdate(this)}if(this.updateCount<0)throw new Vs}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const n of this.observers)n.handlePossibleChange(this)}}handleChange(e,n){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const r=this._handleChange?this._handleChange({changedObservable:e,change:n,didChange:o=>o===e},this.changeSummary):!0,s=this.state===3;if(r&&(this.state===1||s)&&(this.state=2,s))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const n=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),n}addObserver(e){const n=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),n&&e.beginUpdate(this)}removeObserver(e){const n=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),n&&e.endUpdate(this)}}function Pae(i,e){return new lz(i.debugName,e,void 0,void 0)}function ur(i){return new lz(void 0,i,void 0,void 0)}function az(i,e){return new lz(i.debugName,e,i.createEmptyChangeSummary,i.handleChange)}function Xc(i){const e=new Xe,n=Pae({debugName:()=>sk(i)||"(anonymous)"},r=>{e.clear(),i(r,e)});return gn(()=>{n.dispose(),e.dispose()})}class lz{get debugName(){if(typeof this._debugName=="string")return this._debugName;if(typeof this._debugName=="function"){const n=this._debugName();if(n!==void 0)return n}const e=sk(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,n,r,s){var o,a;this._debugName=e,this._runFn=n,this.createChangeSummary=r,this._handleChange=s,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(a=vv())===null||a===void 0||a.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,n,r;if(this.state===3)return;const s=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=s,this.state=3;try{if(!this.disposed){(e=vv())===null||e===void 0||e.handleAutorunTriggered(this);const o=this.changeSummary;this.changeSummary=(n=this.createChangeSummary)===null||n===void 0?void 0:n.call(this),this._runFn(this,o)}}finally{(r=vv())===null||r===void 0||r.handleAutorunFinished(this);for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,uP(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,n){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:n,didChange:s=>s===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const n=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),n}}(function(i){i.Observer=lz})(ur||(ur={}));function K7(i){return new Kwt(i)}class Kwt extends URe{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Gwt(i,e){return new Promise(n=>{let r=!1,s=!1;const o=ur(a=>{const l=i.read(a);e(l)&&(r?o.dispose():s=!0,n(l))});r=!0,s&&o.dispose()})}function oa(i,e){return new KRe(i,e)}class KRe extends Y5{constructor(e,n){super(),this.event=e,this._getValue=n,this.hasValue=!1,this.handleEvent=r=>{var s;const o=this._getValue(r),a=!this.hasValue||this.value!==o;(s=vv())===null||s===void 0||s.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue}),a&&(this.value=o,this.hasValue&&Pr(l=>{for(const c of this.observers)l.updateObserver(c,this),c.handleChange(this,void 0)},()=>{const l=this.getDebugName();return"Event fired"+(l?`: ${l}`:"")}),this.hasValue=!0)}}getDebugName(){return sk(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(i){i.Observer=KRe})(oa||(oa={}));function Ku(i,e){return new Xwt(i,e)}class Xwt extends Y5{constructor(e,n){super(),this.debugName=e,this.event=n,this.handleEvent=()=>{Pr(r=>{for(const s of this.observers)r.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function GRe(i){return typeof i=="string"?new D_e(i):new D_e(void 0,i)}class D_e extends Y5{get debugName(){var e;return(e=Mae(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,n){super(),this._debugName=e,this._owner=n}trigger(e,n){if(!e){Pr(r=>{this.trigger(r,n)},()=>`Trigger signal ${this.debugName}`);return}for(const r of this.observers)e.updateObserver(r,this),r.handleChange(this,n)}get(){}}function rO(i){const e=new Ywt(!0);return i.addObserver(e),i.reportChanges(),gn(()=>{i.removeObserver(e)})}class Ywt{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,this.counter===0&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,n){}}function XRe(){return!!O2e.VSCODE_DEV}function Zwt(i){if(XRe()){const e=Qwt();return e.add(i),{dispose(){e.delete(i)}}}else return{dispose(){}}}function Qwt(){C6||(C6=new Set);const i=globalThis;return i.$hotReload_applyNewExports||(i.$hotReload_applyNewExports=e=>{for(const n of C6){const r=n(e);if(r)return r}}),C6}let C6;function Jwt(i,e,n,r){if(i.length===0)return e;if(e.length===0)return i;const s=[];let o=0,a=0;for(;o<i.length&&a<e.length;){const l=i[o],c=e[a],u=n(l),d=n(c);u<d?(s.push(l),o++):u>d?(s.push(c),a++):(s.push(r(l,c)),o++,a++)}for(;o<i.length;)s.push(i[o]),o++;for(;a<e.length;)s.push(e[a]),a++;return s}function G7(i,e){const n=new Xe,r=i.createDecorationsCollection();return n.add(Pae({debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);r.set(o)})),n.add({dispose:()=>{r.clear()}}),n}function S6(i,e){return i.appendChild(e),gn(()=>{i.removeChild(e)})}class eCt extends Le{get width(){return this._width}get height(){return this._height}constructor(e,n){super(),this.elementSizeObserver=this._register(new lIe(e,n)),this._width=vr(this,this.elementSizeObserver.getWidth()),this._height=vr(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(r=>Pr(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function E_e(i,e){let n=i.get(),r=n,s=n;const o=vr("animatedValue",n);let a=-1;const l=300;let c;e.add(az({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,h)=>(d.didChange(i)&&(h.animate=h.animate||d.change),!0)},(d,h)=>{c!==void 0&&(cancelAnimationFrame(c),c=void 0),r=s,n=i.read(d),a=Date.now()-(h.animate?0:l),u()}));function u(){const d=Date.now()-a;s=Math.floor(tCt(d,r,n-r,l)),d<l?c=requestAnimationFrame(u):s=n,o.set(s,void 0)}return o}function tCt(i,e,n,r){return i===r?e+n:n*(-Math.pow(2,-10*i/r)+1)+e}class YRe extends Le{constructor(e,n,r){super(),this._register(new cz(e,r)),this._register(Gy(r,{height:n.actualHeight,top:n.actualTop}))}}class X7{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,n){this._afterLineNumber=e,this.heightInPx=n,this.domNode=document.createElement("div"),this._actualTop=vr(this,void 0),this._actualHeight=vr(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=r=>{this._actualTop.set(r,void 0)},this.onComputedHeight=r=>{this._actualHeight.set(r,void 0)}}}class cz{constructor(e,n){this._editor=e,this._domElement=n,this._overlayWidgetId=`managedOverlayWidget-${cz._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}cz._counter=0;function Gy(i,e){return ur(n=>{for(let[r,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(n)),typeof s=="number"&&(s=`${s}px`),r=r.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),i.style[r]=s})}function ny(i,e){return nCt([i],e),i}function nCt(i,e){XRe()&&Ku("reload",r=>Zwt(s=>{if([...Object.values(s)].some(o=>i.includes(o)))return o=>(r(void 0),!0)})).read(e)}function Y7(i,e,n){const r=new Xe,s=[];return r.add(ur(o=>{const a=e.read(o),l=new Map,c=new Map;n&&n(!0),i.changeViewZones(u=>{for(const d of s)u.removeZone(d);s.length=0;for(const d of a){const h=u.addZone(d);s.push(h),l.set(d,h)}}),n&&n(!1),r.add(az({createEmptyChangeSummary(){return[]},handleChange(u,d){const h=c.get(u.changedObservable);return h!==void 0&&d.push(h),!0}},(u,d)=>{for(const h of a)h.onChange&&(c.set(h.onChange,l.get(h)),h.onChange.read(u));n&&n(!0),i.changeViewZones(h=>{for(const f of d)h.layoutZone(f)}),n&&n(!1)}))})),r.add({dispose(){n&&n(!0),i.changeViewZones(o=>{for(const a of s)o.removeZone(a)}),n&&n(!1)}}),r}class iCt extends Ns{dispose(){super.dispose(!0)}}var Oae=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Fae=function(i,e){return function(n,r){e(n,r,i)}},rCt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const sCt=ws("diff-review-insert",lt.add,L("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),oCt=ws("diff-review-remove",lt.remove,L("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),aCt=ws("diff-review-close",lt.close,L("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let xy=class extends Le{constructor(e,n,r,s,o,a,l,c,u){super(),this._parentNode=e,this._visible=n,this._setVisible=r,this._canClose=s,this._width=o,this._height=a,this._diffs=l,this._editors=c,this._instantiationService=u,this.model=nO(this,(d,h)=>{const f=this._visible.read(d);if(this._parentNode.style.visibility=f?"visible":"hidden",!f)return null;const p=h.add(this._instantiationService.createInstance(hte,this._diffs,this._editors,this._setVisible,this._canClose)),g=h.add(this._instantiationService.createInstance(fte,this._parentNode,p,this._width,this._height,this._editors));return{model:p,view:g}}),this._register(rO(this.model))}next(){Pr(e=>{const n=this._visible.get();this._setVisible(!0,e),n&&this.model.get().model.nextGroup(e)})}prev(){Pr(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){Pr(e=>{this._setVisible(!1,e)})}};xy._ttPolicy=$v("diffReview",{createHTML:i=>i});xy=Oae([Fae(8,hn)],xy);let hte=class extends Le{constructor(e,n,r,s,o){super(),this._diffs=e,this._editors=n,this._setVisible=r,this.canClose=s,this._audioCueService=o,this._groups=vr(this,[]),this._currentGroupIdx=vr(this,0),this._currentElementIdx=vr(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((a,l)=>this._groups.read(l)[a]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((a,l)=>{var c;return(c=this.currentGroup.read(l))===null||c===void 0?void 0:c.lines[a]}),this._register(ur(a=>{const l=this._diffs.read(a);if(!l){this._groups.set([],void 0);return}const c=lCt(l,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());Pr(u=>{const d=this._editors.modified.getPosition();if(d){const h=c.findIndex(f=>(d==null?void 0:d.lineNumber)<f.range.modified.endLineNumberExclusive);h!==-1&&this._currentGroupIdx.set(h,u)}this._groups.set(c,u)})})),this._register(ur(a=>{const l=this.currentElement.read(a);(l==null?void 0:l.type)===Ol.Deleted?this._audioCueService.playAudioCue(fi.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(l==null?void 0:l.type)===Ol.Added&&this._audioCueService.playAudioCue(fi.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ur(a=>{var l;const c=this.currentElement.read(a);if(c&&c.type!==Ol.Header){const u=(l=c.modifiedLineNumber)!==null&&l!==void 0?l:c.diff.modified.startLineNumber;this._editors.modified.setSelection(J.fromPositions(new ve(u,1)))}}))}_goToGroupDelta(e,n){const r=this.groups.get();!r||r.length<=1||ute(n,s=>{this._currentGroupIdx.set(Un.ofLength(r.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const n=this.currentGroup.get();!n||n.lines.length<=1||Pr(r=>{this._currentElementIdx.set(Un.ofLength(n.lines.length).clip(this._currentElementIdx.get()+e),r)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const n=this.currentGroup.get();if(!n)return;const r=n.lines.indexOf(e);r!==-1&&Pr(s=>{this._currentElementIdx.set(r,s)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===Ol.Deleted?(this._editors.original.setSelection(J.fromPositions(new ve(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==Ol.Header&&(this._editors.modified.setSelection(J.fromPositions(new ve(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};hte=Oae([Fae(4,X5)],hte);const eA=3;function lCt(i,e,n){const r=[];for(const s of h2e(i,(o,a)=>a.modified.startLineNumber-o.modified.endLineNumberExclusive<2*eA)){const o=[];o.push(new uCt);const a=new Qn(Math.max(1,s[0].original.startLineNumber-eA),Math.min(s[s.length-1].original.endLineNumberExclusive+eA,e+1)),l=new Qn(Math.max(1,s[0].modified.startLineNumber-eA),Math.min(s[s.length-1].modified.endLineNumberExclusive+eA,n+1));f2e(s,(d,h)=>{const f=new Qn(d?d.original.endLineNumberExclusive:a.startLineNumber,h?h.original.startLineNumber:a.endLineNumberExclusive),p=new Qn(d?d.modified.endLineNumberExclusive:l.startLineNumber,h?h.modified.startLineNumber:l.endLineNumberExclusive);f.forEach(g=>{o.push(new fCt(g,p.startLineNumber+(g-f.startLineNumber)))}),h&&(h.original.forEach(g=>{o.push(new dCt(h,g))}),h.modified.forEach(g=>{o.push(new hCt(h,g))}))});const c=s[0].modified.join(s[s.length-1].modified),u=s[0].original.join(s[s.length-1].original);r.push(new cCt(new Xm(c,u),o))}return r}var Ol;(function(i){i[i.Header=0]="Header",i[i.Unchanged=1]="Unchanged",i[i.Deleted=2]="Deleted",i[i.Added=3]="Added"})(Ol||(Ol={}));class cCt{constructor(e,n){this.range=e,this.lines=n}}class uCt{constructor(){this.type=Ol.Header}}class dCt{constructor(e,n){this.diff=e,this.originalLineNumber=n,this.type=Ol.Deleted,this.modifiedLineNumber=void 0}}class hCt{constructor(e,n){this.diff=e,this.modifiedLineNumber=n,this.type=Ol.Added,this.originalLineNumber=void 0}}class fCt{constructor(e,n){this.originalLineNumber=e,this.modifiedLineNumber=n,this.type=Ol.Unchanged}}let fte=class extends Le{constructor(e,n,r,s,o,a){super(),this._element=e,this._model=n,this._width=r,this._height=s,this._editors=o,this._languageService=a,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const l=document.createElement("div");l.className="diff-review-actions",this._actionBar=this._register(new wh(l)),this._register(ur(c=>{this._actionBar.clear(),this._model.canClose.read(c)&&this._actionBar.push(new Vl("diffreview.close",L("label.close","Close"),"close-diff-review "+en.asClassName(aCt),!0,()=>rCt(this,void 0,void 0,function*(){return n.close()})),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new P5(this._content,{})),ca(this.domNode,this._scrollbar.getDomNode(),l),this._register(gn(()=>{ca(this.domNode)})),this._register(Gy(this.domNode,{width:this._width,height:this._height})),this._register(Gy(this._content,{width:this._width,height:this._height})),this._register(Xc((c,u)=>{this._model.currentGroup.read(c),this._render(u)})),this._register(As(this.domNode,"keydown",c=>{(c.equals(18)||c.equals(2066)||c.equals(530))&&(c.preventDefault(),this._model.goToNextLine()),(c.equals(16)||c.equals(2064)||c.equals(528))&&(c.preventDefault(),this._model.goToPreviousLine()),(c.equals(9)||c.equals(2057)||c.equals(521)||c.equals(1033))&&(c.preventDefault(),this._model.close()),(c.equals(10)||c.equals(3))&&(c.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const n=this._editors.original.getOptions(),r=this._editors.modified.getOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",L("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),Ta(s,r.get(50)),ca(this._content,s);const o=this._editors.original.getModel(),a=this._editors.modified.getModel();if(!o||!a)return;const l=o.getOptions(),c=a.getOptions(),u=r.get(66),d=this._model.currentGroup.get();for(const h of(d==null?void 0:d.lines)||[]){if(!d)break;let f;if(h.type===Ol.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const m=d.range,_=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,y=R=>R===0?L("no_lines_changed","no lines changed"):R===1?L("one_line_changed","1 line changed"):L("more_lines_changed","{0} lines changed",R),x=y(m.original.length),k=y(m.modified.length);g.setAttribute("aria-label",L({},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,b,m.original.startLineNumber,x,m.modified.startLineNumber,k));const D=document.createElement("div");D.className="diff-review-cell diff-review-summary",D.appendChild(document.createTextNode(`${_+1}/${b}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),g.appendChild(D),f=g}else f=this._createRow(h,u,this._width.get(),n,o,l,r,a,c);s.appendChild(f);const p=ni(g=>this._model.currentElement.read(g)===h);e.add(ur(g=>{const m=p.read(g);f.tabIndex=m?0:-1,m&&f.focus()})),e.add(Be(f,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,n,r,s,o,a,l,c,u){const d=s.get(143),h=d.glyphMarginWidth+d.lineNumbersWidth,f=l.get(143),p=10+f.glyphMarginWidth+f.lineNumbersWidth;let g="diff-review-row",m="";const _="diff-review-spacer";let b=null;switch(e.type){case Ol.Added:g="diff-review-row line-insert",m=" char-insert",b=sCt;break;case Ol.Deleted:g="diff-review-row line-delete",m=" char-delete",b=oCt;break}const y=document.createElement("div");y.style.minWidth=r+"px",y.className=g,y.setAttribute("role","listitem"),y.ariaLevel="";const x=document.createElement("div");x.className="diff-review-cell",x.style.height=`${n}px`,y.appendChild(x);const k=document.createElement("span");k.style.width=h+"px",k.style.minWidth=h+"px",k.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?k.appendChild(document.createTextNode(String(e.originalLineNumber))):k.innerText=" ",x.appendChild(k);const D=document.createElement("span");D.style.width=p+"px",D.style.minWidth=p+"px",D.style.paddingRight="10px",D.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?D.appendChild(document.createTextNode(String(e.modifiedLineNumber))):D.innerText=" ",x.appendChild(D);const R=document.createElement("span");if(R.className=_,b){const M=document.createElement("span");M.className=en.asClassName(b),M.innerText="  ",R.appendChild(M)}else R.innerText="  ";x.appendChild(R);let E;if(e.modifiedLineNumber!==void 0){let M=this._getLineHtml(c,l,u.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);xy._ttPolicy&&(M=xy._ttPolicy.createHTML(M)),x.insertAdjacentHTML("beforeend",M),E=c.getLineContent(e.modifiedLineNumber)}else{let M=this._getLineHtml(o,s,a.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);xy._ttPolicy&&(M=xy._ttPolicy.createHTML(M)),x.insertAdjacentHTML("beforeend",M),E=o.getLineContent(e.originalLineNumber)}E.length===0&&(E=L("blankLine","blank"));let A="";switch(e.type){case Ol.Unchanged:e.originalLineNumber===e.modifiedLineNumber?A=L({},"{0} unchanged line {1}",E,e.originalLineNumber):A=L("equalLine","{0} original line {1} modified line {2}",E,e.originalLineNumber,e.modifiedLineNumber);break;case Ol.Added:A=L("insertLine","+ {0} modified line {1}",E,e.modifiedLineNumber);break;case Ol.Deleted:A=L("deleteLine","- {0} original line {1}",E,e.originalLineNumber);break}return y.setAttribute("aria-label",A),y}_getLineHtml(e,n,r,s,o){const a=e.getLineContent(s),l=n.get(50),c=ko.createEmpty(a,o),u=fd.isBasicASCII(a,e.mightContainNonBasicASCII()),d=fd.containsRTL(a,u,e.mightContainRTL());return S$(new X1(l.isMonospace&&!n.get(33),l.canUseHalfwidthRightwardsArrow,a,!1,u,d,0,c,[],r,0,l.spaceWidth,l.middotWidth,l.wsmiddotWidth,n.get(116),n.get(98),n.get(93),n.get(51)!==Uu.OFF,null)).html}};fte=Oae([Fae(5,Ar)],fte);const pCt=ws("diff-insert",lt.add,L("diffInsertIcon","Line decoration for inserts in the diff editor.")),ZRe=ws("diff-remove",lt.remove,L("diffRemoveIcon","Line decoration for removals in the diff editor.")),I_e=kn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+en.asClassName(pCt),marginClassName:"gutter-insert"}),T_e=kn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+en.asClassName(ZRe),marginClassName:"gutter-delete"}),R_e=kn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),A_e=kn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),N_e=kn.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),gCt=kn.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),mCt=kn.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),pte=kn.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),_Ct=kn.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),vCt=kn.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),bCt=kn.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new Ea(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(L("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+en.asClassName(lt.arrowRight),zIndex:10001});class Xy extends Le{constructor(e,n,r,s,o){super(),this._rootElement=e,this._diffModel=n,this._originalEditorLayoutInfo=r,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=oa(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=oa(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Ku("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=vr(this,0),this._modifiedViewZonesChangedSignal=Ku("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Ku("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=nO((f,p)=>{var g;this._element.replaceChildren();const m=this._diffModel.read(f),_=(g=m==null?void 0:m.diff.read(f))===null||g===void 0?void 0:g.movedTexts;if(!_||_.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(f);const b=this._originalEditorLayoutInfo.read(f),y=this._modifiedEditorLayoutInfo.read(f);if(!b||!y){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(f),this._originalViewZonesChangedSignal.read(f);const x=_.map(N=>{function P(ie,K){const ee=K.getTopForLineNumber(ie.startLineNumber,!0),le=K.getTopForLineNumber(ie.endLineNumberExclusive,!0);return(ee+le)/2}const O=P(N.lineRangeMapping.original,this._editors.original),B=this._originalScrollTop.read(f),j=P(N.lineRangeMapping.modified,this._editors.modified),z=this._modifiedScrollTop.read(f),H=O-B,Y=j-z,X=Math.min(O,j),Q=Math.max(O,j);return{range:new Un(X,Q),from:H,to:Y,fromWithoutScroll:O,toWithoutScroll:j,move:N}});x.sort(xrt(ch(N=>N.fromWithoutScroll>N.toWithoutScroll,krt),ch(N=>N.fromWithoutScroll>N.toWithoutScroll?N.fromWithoutScroll:-N.toWithoutScroll,fv)));const k=Bae.compute(x.map(N=>N.range)),D=10,R=b.verticalScrollbarWidth,E=(k.getTrackCount()-1)*10+D*2,A=R+E+(y.contentLeft-Xy.movedCodeBlockPadding);let M=0;for(const N of x){const P=k.getTrack(M),O=R+D+P*10,B=15,j=15,z=A,H=y.glyphMarginWidth+y.lineNumbersWidth,Y=18,X=document.createElementNS("http://www.w3.org/2000/svg","rect");X.classList.add("arrow-rectangle"),X.setAttribute("x",`${z-H}`),X.setAttribute("y",`${N.to-Y/2}`),X.setAttribute("width",`${H}`),X.setAttribute("height",`${Y}`),this._element.appendChild(X);const Q=document.createElementNS("http://www.w3.org/2000/svg","g"),ie=document.createElementNS("http://www.w3.org/2000/svg","path");ie.setAttribute("d",`M 0 ${N.from} L ${O} ${N.from} L ${O} ${N.to} L ${z-j} ${N.to}`),ie.setAttribute("fill","none"),Q.appendChild(ie);const K=document.createElementNS("http://www.w3.org/2000/svg","polygon");K.classList.add("arrow"),p.add(ur(ee=>{ie.classList.toggle("currentMove",N.move===m.activeMovedText.read(ee)),K.classList.toggle("currentMove",N.move===m.activeMovedText.read(ee))})),K.setAttribute("points",`${z-j},${N.to-B/2} ${z},${N.to} ${z-j},${N.to+B/2}`),Q.appendChild(K),this._element.appendChild(Q),M++}this.width.set(E,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(gn(()=>this._element.remove())),this._register(ur(f=>{const p=this._originalEditorLayoutInfo.read(f),g=this._modifiedEditorLayoutInfo.read(f);!p||!g||(this._element.style.left=`${p.width-p.verticalScrollbarWidth}px`,this._element.style.height=`${p.height}px`,this._element.style.width=`${p.verticalScrollbarWidth+p.contentLeft-Xy.movedCodeBlockPadding+this.width.read(f)}px`)})),this._register(rO(this._state));const a=ni(f=>{const p=this._diffModel.read(f),g=p==null?void 0:p.diff.read(f);return g?g.movedTexts.map(m=>({move:m,original:new X7(K7(m.lineRangeMapping.original.startLineNumber-1),18),modified:new X7(K7(m.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(Y7(this._editors.original,a.map(f=>f.map(p=>p.original)))),this._register(Y7(this._editors.modified,a.map(f=>f.map(p=>p.modified)))),this._register(Xc((f,p)=>{const g=a.read(f);for(const m of g)p.add(new M_e(this._editors.original,m.original,m.move,"original",this._diffModel.get())),p.add(new M_e(this._editors.modified,m.modified,m.move,"modified",this._diffModel.get()))}));const l=oa(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),c=oa(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),u=Ku("original.onDidFocusEditorWidget",f=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>f(void 0),0))),d=Ku("modified.onDidFocusEditorWidget",f=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>f(void 0),0)));let h="modified";this._register(az({createEmptyChangeSummary:()=>{},handleChange:(f,p)=>(f.didChange(u)&&(h="original"),f.didChange(d)&&(h="modified"),!0)},f=>{u.read(f),d.read(f);const p=this._diffModel.read(f);if(!p)return;const g=p.diff.read(f);let m;if(g&&h==="original"){const _=l.read(f);_&&(m=g.movedTexts.find(b=>b.lineRangeMapping.original.contains(_.lineNumber)))}if(g&&h==="modified"){const _=c.read(f);_&&(m=g.movedTexts.find(b=>b.lineRangeMapping.modified.contains(_.lineNumber)))}m!==p.movedTextToCompare.get()&&p.movedTextToCompare.set(void 0,void 0),p.setActiveMovedText(m)}))}}Xy.movedCodeBlockPadding=4;class Bae{static compute(e){const n=[],r=[];for(const s of e){let o=n.findIndex(a=>!a.intersectsStrict(s));o===-1&&(n.length>=6?o=Bct(n,ch(l=>l.intersectWithRangeLength(s),fv)):(o=n.length,n.push(new ioe))),n[o].addRange(s),r.push(o)}return new Bae(n.length,r)}constructor(e,n){this._trackCount=e,this.trackPerLineIdx=n}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class M_e extends YRe{constructor(e,n,r,s,o){const a=Jo("div.diff-hidden-lines-widget");super(e,n,a.root),this._editor=e,this._move=r,this._kind=s,this._diffModel=o,this._nodes=Jo("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Jo("div.text-content@textContent"),Jo("div.action-bar@actionBar")]),a.root.appendChild(this._nodes.root);const l=oa(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Gy(this._nodes.root,{paddingRight:l.map(f=>f.verticalScrollbarWidth)}));let c;r.changes.length>0?c=this._kind==="original"?L("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):L("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):c=this._kind==="original"?L("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):L("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const u=this._register(new wh(this._nodes.actionBar,{highlightToggledItems:!0})),d=new Vl("",c,"",!1);u.push(d,{icon:!1,label:!0});const h=new Vl("","Compare",en.asClassName(lt.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===r?void 0:this._move,void 0)});this._register(ur(f=>{const p=this._diffModel.movedTextToCompare.read(f)===r;h.checked=p})),u.push(h,{icon:!1,label:!0})}}class yCt extends Le{constructor(e,n,r){super(),this._editors=e,this._diffModel=n,this._options=r,this._decorations=ni(this,s=>{var o;const a=(o=this._diffModel.read(s))===null||o===void 0?void 0:o.diff.read(s);if(!a)return null;const l=this._diffModel.read(s).movedTextToCompare.read(s),c=this._options.renderIndicators.read(s),u=this._options.showEmptyDecorations.read(s),d=[],h=[];if(!l)for(const p of a.mappings){if(p.lineRangeMapping.original.isEmpty||d.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:c?T_e:A_e}),p.lineRangeMapping.modified.isEmpty||h.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:c?I_e:R_e}),p.lineRangeMapping.modified.isEmpty||p.lineRangeMapping.original.isEmpty)p.lineRangeMapping.original.isEmpty||d.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:_Ct}),p.lineRangeMapping.modified.isEmpty||h.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:gCt});else for(const g of p.lineRangeMapping.innerChanges||[])p.lineRangeMapping.original.contains(g.originalRange.startLineNumber)&&d.push({range:g.originalRange,options:g.originalRange.isEmpty()&&u?vCt:pte}),p.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&h.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&u?mCt:N_e});!p.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(s)&&!l&&h.push({range:J.fromPositions(new ve(p.lineRangeMapping.modified.startLineNumber,1)),options:bCt})}if(l)for(const p of l.changes){const g=p.original.toInclusiveRange();g&&d.push({range:g,options:c?T_e:A_e});const m=p.modified.toInclusiveRange();m&&h.push({range:m,options:c?I_e:R_e});for(const _ of p.innerChanges||[])d.push({range:_.originalRange,options:pte}),h.push({range:_.modifiedRange,options:N_e})}const f=this._diffModel.read(s).activeMovedText.read(s);for(const p of a.movedTexts)d.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(p===f?" currentMove":""),blockPadding:[Xy.movedCodeBlockPadding,0,Xy.movedCodeBlockPadding,Xy.movedCodeBlockPadding]}}),h.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(p===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:h}}),this._register(G7(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(G7(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class wCt extends Le{constructor(e,n,r){super(),this._options=e,this._domNode=n,this._dimensions=r,this._sashRatio=vr(this,void 0),this.sashLeft=ni(this,s=>{var o;const a=(o=this._sashRatio.read(s))!==null&&o!==void 0?o:this._options.splitViewDefaultRatio.read(s);return this._computeSashLeft(a,s)}),this._sash=this._register(new ja(this._domNode,{getVerticalSashTop:s=>0,getVerticalSashLeft:s=>this.sashLeft.get(),getVerticalSashHeight:s=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(s=>{const o=this._dimensions.width.get(),a=this._computeSashLeft((this._startSashPosition+(s.currentX-s.startX))/o,void 0);this._sashRatio.set(a/o,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(ur(s=>{const o=this._options.enableSplitViewResizing.read(s);this._sash.state=o?3:0,this.sashLeft.read(s),this._dimensions.height.read(s),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,n){const r=this._dimensions.width.read(n),s=Math.floor(this._options.splitViewDefaultRatio.read(n)*r),o=this._options.enableSplitViewResizing.read(n)?Math.floor(e*r):s,a=100;return r<=a*2?s:o<a?a:o>r-a?r-a:o}}let C2=class{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,n){let r;typeof e=="string"?r=`${n.id}/${e}`:(r=`${n.id}/${e.name}`,n.children.get(r)!==void 0&&(r=`${n.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=r;for(let o=0;n.children.get(s)!==void 0;o++)s=`${r}_${o}`;return s}static empty(e){return e.children.size===0}},P_e=class extends C2{constructor(e,n,r){super(),this.id=e,this.parent=n,this.symbol=r,this.children=new Map}},CCt=class extends C2{constructor(e,n,r,s){super(),this.id=e,this.parent=n,this.label=r,this.order=s,this.children=new Map}},SCt=class FC extends C2{static create(e,n,r){const s=new Ns(r),o=new FC(n.uri),a=e.ordered(n),l=a.map((u,d)=>{var h;const f=C2.findId(`provider_${d}`,o),p=new CCt(f,o,(h=u.displayName)!==null&&h!==void 0?h:"Unknown Outline Provider",d);return Promise.resolve(u.provideDocumentSymbols(n,s.token)).then(g=>{for(const m of g||[])FC._makeOutlineElement(m,p);return p},g=>(Us(g),p)).then(g=>{C2.empty(g)?g.remove():o._groups.set(f,g)})}),c=e.onDidChange(()=>{const u=e.ordered(n);ys(u,a)||s.cancel()});return Promise.all(l).then(()=>s.token.isCancellationRequested&&!r.isCancellationRequested?FC.create(e,n,r):o._compact()).finally(()=>{s.dispose(),c.dispose()})}static _makeOutlineElement(e,n){const r=C2.findId(e,n),s=new P_e(r,n,e);if(e.children)for(const o of e.children)FC._makeOutlineElement(o,s);n.children.set(s.id,s)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[n,r]of this._groups)r.children.size===0?this._groups.delete(n):e+=1;if(e!==1)this.children=this._groups;else{const n=Vn.first(this._groups.values());for(const[,r]of n.children)r.parent=this,this.children.set(r.id,r)}return this}getTopLevelSymbols(){const e=[];for(const n of this.children.values())n instanceof P_e?e.push(n.symbol):e.push(...Vn.map(n.children.values(),r=>r.symbol));return e.sort((n,r)=>J.compareRangesUsingStarts(n.range,r.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),n=[];return FC._flattenDocumentSymbols(n,e,""),n.sort((r,s)=>ve.compare(J.getStartPosition(r.range),J.getStartPosition(s.range))||ve.compare(J.getEndPosition(s.range),J.getEndPosition(r.range)))}static _flattenDocumentSymbols(e,n,r){for(const s of n)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||r,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&FC._flattenDocumentSymbols(e,s.children,s.name)}};var QRe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},JRe=function(i,e){return function(n,r){e(n,r,i)}},xCt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let gte=class extends Le{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,n,r,s){super(),this._editors=e,this._diffModel=n,this._options=r,this._languageFeaturesService=s,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=nO(this,(u,d)=>{const h=this._editors.modifiedModel.read(u);if(h)return d.add(new mte(this._languageFeaturesService,h))}),this._register(this._editors.original.onDidChangeCursorPosition(u=>{if(u.reason===3){const d=this._diffModel.get();Pr(h=>{for(const f of this._editors.original.getSelections()||[])d==null||d.ensureOriginalLineIsVisible(f.getStartPosition().lineNumber,h),d==null||d.ensureOriginalLineIsVisible(f.getEndPosition().lineNumber,h)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(u=>{if(u.reason===3){const d=this._diffModel.get();Pr(h=>{for(const f of this._editors.modified.getSelections()||[])d==null||d.ensureModifiedLineIsVisible(f.getStartPosition().lineNumber,h),d==null||d.ensureModifiedLineIsVisible(f.getEndPosition().lineNumber,h)})}}));const o=this._diffModel.map((u,d)=>{var h,f;return((h=u==null?void 0:u.diff.read(d))===null||h===void 0?void 0:h.mappings.length)===0?[]:(f=u==null?void 0:u.unchangedRegions.read(d))!==null&&f!==void 0?f:[]}),a=nO(this,(u,d)=>{const h=this._modifiedOutlineSource.read(u);if(!h)return{origViewZones:[],modViewZones:[]};const f=[],p=[],g=this._options.renderSideBySide.read(u),m=o.read(u);for(const _ of m)if(!_.shouldHideControls(u)){{const b=ni(x=>_.getHiddenOriginalRange(x).startLineNumber-1),y=new X7(b,24);f.push(y),d.add(new O_e(this._editors.original,y,_,_.originalUnchangedRange,!g,h,x=>this._diffModel.get().ensureModifiedLineIsVisible(x,void 0),this._options))}{const b=ni(x=>_.getHiddenModifiedRange(x).startLineNumber-1),y=new X7(b,24);p.push(y),d.add(new O_e(this._editors.modified,y,_,_.modifiedUnchangedRange,!1,h,x=>this._diffModel.get().ensureModifiedLineIsVisible(x,void 0),this._options))}}return{origViewZones:f,modViewZones:p}}),l={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},c={description:"Fold Unchanged",glyphMarginHoverMessage:new Ea(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(L("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+en.asClassName(lt.fold),zIndex:10001};this._register(G7(this._editors.original,ni(u=>{const d=o.read(u),h=d.map(f=>({range:f.originalUnchangedRange.toInclusiveRange(),options:l}));for(const f of d)f.shouldHideControls(u)&&h.push({range:J.fromPositions(new ve(f.originalLineNumber,1)),options:c});return h}))),this._register(G7(this._editors.modified,ni(u=>{const d=o.read(u),h=d.map(f=>({range:f.modifiedUnchangedRange.toInclusiveRange(),options:l}));for(const f of d)f.shouldHideControls(u)&&h.push({range:Qn.ofLength(f.modifiedLineNumber,1).toInclusiveRange(),options:c});return h}))),this._register(Y7(this._editors.original,a.map(u=>u.origViewZones),u=>this._isUpdatingViewZones=u)),this._register(Y7(this._editors.modified,a.map(u=>u.modViewZones),u=>this._isUpdatingViewZones=u)),this._register(ur(u=>{const d=o.read(u);this._editors.original.setHiddenAreas(d.map(h=>h.getHiddenOriginalRange(u).toInclusiveRange()).filter(tP)),this._editors.modified.setHiddenAreas(d.map(h=>h.getHiddenModifiedRange(u).toInclusiveRange()).filter(tP))})),this._register(this._editors.modified.onMouseUp(u=>{var d;if(!u.event.rightButton&&u.target.position&&(!((d=u.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const h=u.target.position.lineNumber,f=this._diffModel.get();if(!f)return;const p=f.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(h));if(!p)return;p.collapseAll(void 0),u.event.stopPropagation(),u.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(u=>{var d;if(!u.event.rightButton&&u.target.position&&(!((d=u.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const h=u.target.position.lineNumber,f=this._diffModel.get();if(!f)return;const p=f.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(h));if(!p)return;p.collapseAll(void 0),u.event.stopPropagation(),u.event.preventDefault()}}))}};gte=QRe([JRe(3,Et)],gte);let mte=class extends Le{constructor(e,n){super(),this._languageFeaturesService=e,this._textModel=n,this._currentModel=vr(this,void 0);const r=Ku("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Ku("_textModel.onDidChangeContent",_t.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(Xc((o,a)=>xCt(this,void 0,void 0,function*(){r.read(o),s.read(o);const l=a.add(new iCt),c=yield SCt.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)})))}getBreadcrumbItems(e,n){const r=this._currentModel.read(n);if(!r)return[];const s=r.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(_2e(ch(o=>o.range.endLineNumber-o.range.startLineNumber,fv))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};mte=QRe([JRe(0,Et)],mte);class O_e extends YRe{constructor(e,n,r,s,o,a,l,c){const u=Jo("div.diff-hidden-lines-widget");super(e,n,u.root),this._editor=e,this._unchangedRegion=r,this._unchangedRegionRange=s,this.hide=o,this._modifiedOutlineSource=a,this._revealModifiedHiddenLine=l,this._options=c,this._nodes=Jo("div.diff-hidden-lines",[Jo("div.top@top",{title:L("diff.hiddenLines.top","Click or drag to show more above")}),Jo("div.center@content",{style:{display:"flex"}},[Jo("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[tt("a",{title:L("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Uy("$(unfold)"))]),Jo("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Jo("div.bottom@bottom",{title:L("diff.bottom","Click or drag to show more below"),role:"button"})]),u.root.appendChild(this._nodes.root);const d=oa(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?ca(this._nodes.first):this._register(Gy(this._nodes.first,{width:d.map(f=>f.contentLeft)}));const h=this._editor;this._register(Be(this._nodes.top,"mousedown",f=>{if(f.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),f.preventDefault();const p=f.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=Be(window,"mousemove",y=>{const k=y.clientY-p;g=g||Math.abs(k)>2;const D=Math.round(k/h.getOption(66)),R=Math.max(0,Math.min(m+D,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(R,void 0)}),b=Be(window,"mouseup",y=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(!1,void 0),_.dispose(),b.dispose()})})),this._register(Be(this._nodes.bottom,"mousedown",f=>{if(f.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),f.preventDefault();const p=f.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=Be(window,"mousemove",y=>{const k=y.clientY-p;g=g||Math.abs(k)>2;const D=Math.round(k/h.getOption(66)),R=Math.max(0,Math.min(m-D,this._unchangedRegion.getMaxVisibleLineCountBottom())),E=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(R,void 0);const A=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(A-E))}),b=Be(window,"mouseup",y=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const x=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const k=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(k-x))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),b.dispose()})})),this._register(ur(f=>{const p=[];if(!this.hide){const g=r.getHiddenModifiedRange(f).length,m=L("hiddenLines","{0} hidden lines",g),_=tt("span",{title:L("diff.hiddenLines.expandAll","Double click to unfold")},m);_.addEventListener("dblclick",x=>{x.button===0&&(x.preventDefault(),this._unchangedRegion.showAll(void 0))}),p.push(_);const b=this._unchangedRegion.getHiddenModifiedRange(f),y=this._modifiedOutlineSource.getBreadcrumbItems(b,f);if(y.length>0){p.push(tt("span",void 0,"  |  "));for(let x=0;x<y.length;x++){const k=y[x],D=M9.toIcon(k.kind),R=Jo("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[bee(D)," ",k.name,...x===y.length-1?[]:[bee(lt.chevronRight)]]).root;p.push(R),R.onclick=()=>{this._revealModifiedHiddenLine(k.startLineNumber)}}}}ca(this._nodes.others,...p)}))}}class Qp{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Qp(e.getScrollTop(),e.getContentHeight(),null,0,null);let n=null,r=0;const s=e.getVisibleRanges();if(s.length>0){n=s[0].getStartPosition();const o=e.getTopForPosition(n.lineNumber,n.column);r=e.getScrollTop()-o}return new Qp(e.getScrollTop(),e.getContentHeight(),n,r,e.getPosition())}constructor(e,n,r,s,o){this._initialScrollTop=e,this._initialContentHeight=n,this._visiblePosition=r,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const n=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(n+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const n=e.getPosition();if(!this._cursorPosition||!n)return;const r=e.getTopForLineNumber(n.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+r)}}var kCt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},F_e=function(i,e){return function(n,r){e(n,r,i)}},LCt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},BC;let Z7=BC=class{constructor(e,n,r){this.editorWorkerService=n,this.telemetryService=r,this.onDidChangeEventEmitter=new _e,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,n,r,s){var o,a;return LCt(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,n,r,s);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return n.getLineCount()===1&&n.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new bh(new Qn(1,2),new Qn(1,n.getLineCount()+1),[new _1(e.getFullModelRange(),n.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const l=JSON.stringify([e.uri.toString(),n.uri.toString()]),c=JSON.stringify([e.id,n.id,e.getAlternativeVersionId(),n.getAlternativeVersionId(),JSON.stringify(r)]),u=BC.diffCache.get(l);if(u&&u.context===c)return u.result;const d=Xa.create(),h=yield this.editorWorkerService.computeDiff(e.uri,n.uri,r,this.diffAlgorithm),f=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:f,timedOut:(o=h==null?void 0:h.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:r.computeMoves?(a=h==null?void 0:h.moves.length)!==null&&a!==void 0?a:0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!h)throw new Error("no diff result available");return BC.diffCache.size>10&&BC.diffCache.delete(BC.diffCache.keys().next().value),BC.diffCache.set(l,{result:h,context:c}),h})}setOptions(e){var n;let r=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((n=this.diffAlgorithmOnDidChangeSubscription)===null||n===void 0||n.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),r=!0),r&&this.onDidChangeEventEmitter.fire()}};Z7.diffCache=new Map;Z7=BC=kCt([F_e(1,Wf),F_e(2,_d)],Z7);var DCt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ECt=function(i,e){return function(n,r){e(n,r,i)}};const eAe=qn("diffProviderFactoryService");let _te=class{constructor(e){this.instantiationService=e}createDiffProvider(e,n){return this.instantiationService.createInstance(Z7,n)}};_te=DCt([ECt(0,hn)],_te);oi(eAe,_te,1);var ICt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},TCt=function(i,e){return function(n,r){e(n,r,i)}},B_e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let vte=class extends Le{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,n,r,s){super(),this.model=e,this._options=n,this._editor=r,this._diffProviderFactoryService=s,this._isDiffUpToDate=vr(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=vr(this,void 0),this.diff=this._diff,this._unchangedRegions=vr(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=ni(this,c=>this._options.hideUnchangedRegions.read(c)?this._unchangedRegions.read(c).regions:(Pr(u=>{for(const d of this._unchangedRegions.get().regions)d.collapseAll(u)}),[])),this.movedTextToCompare=vr(this,void 0),this._activeMovedText=vr(this,void 0),this._hoveredMovedText=vr(this,void 0),this.activeMovedText=ni(this,c=>{var u,d;return(d=(u=this.movedTextToCompare.read(c))!==null&&u!==void 0?u:this._hoveredMovedText.read(c))!==null&&d!==void 0?d:this._activeMovedText.read(c)}),this._cancellationTokenSource=new Ns,this._diffProvider=ni(this,c=>{const u=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(c)}),d=Ku("onDidChange",u.onDidChange);return{diffProvider:u,onChangeSignal:d}}),this._register(gn(()=>this._cancellationTokenSource.cancel()));const o=GRe("contentChangedSignal"),a=this._register(new Ji(()=>o.trigger(void 0),200)),l=(c,u,d)=>{const h=Q7.fromDiffs(c.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(d),this._options.hideUnchangedRegionsContextLineCount.read(d)),f=this._unchangedRegions.get(),p=f.originalDecorationIds.map(b=>e.original.getDecorationRange(b)).filter(b=>!!b).map(b=>Qn.fromRange(b)),g=f.modifiedDecorationIds.map(b=>e.modified.getDecorationRange(b)).filter(b=>!!b).map(b=>Qn.fromRange(b)),m=e.original.deltaDecorations(f.originalDecorationIds,h.map(b=>({range:b.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),_=e.modified.deltaDecorations(f.modifiedDecorationIds,h.map(b=>({range:b.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const b of h)for(let y=0;y<f.regions.length;y++)if(b.originalUnchangedRange.intersectsStrict(p[y])&&b.modifiedUnchangedRange.intersectsStrict(g[y])){b.setHiddenModifiedRange(f.regions[y].getHiddenModifiedRange(void 0),u);break}this._unchangedRegions.set({regions:h,originalDecorationIds:m,modifiedDecorationIds:_},u)};this._register(e.modified.onDidChangeContent(c=>{if(this._diff.get()){const d=rv.fromModelContentChanges(c.changes);this._lastDiff,e.original,e.modified}a.schedule()})),this._register(e.original.onDidChangeContent(c=>{if(this._diff.get()){const d=rv.fromModelContentChanges(c.changes);this._lastDiff,e.original,e.modified}a.schedule()})),this._register(Xc((c,u)=>B_e(this,void 0,void 0,function*(){var d,h;this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c),a.cancel(),o.read(c);const f=this._diffProvider.read(c);f.onChangeSignal.read(c),ny(JEe,c),ny(yJ,c),this._isDiffUpToDate.set(!1,void 0);let p=[];u.add(e.original.onDidChangeContent(_=>{const b=rv.fromModelContentChanges(_.changes);p=u7(p,b)}));let g=[];u.add(e.modified.onDidChangeContent(_=>{const b=rv.fromModelContentChanges(_.changes);g=u7(g,b)}));let m=yield f.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(c),maxComputationTimeMs:this._options.maxComputationTimeMs.read(c),computeMoves:this._options.showMoves.read(c)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(m=RCt(m,e.original,e.modified),m=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:m,m=(h=(e.original,e.modified,void 0))!==null&&h!==void 0?h:m,Pr(_=>{l(m,_),this._lastDiff=m;const b=jae.fromDiffResult(m);this._diff.set(b,_),this._isDiffUpToDate.set(!0,_);const y=this.movedTextToCompare.get();this.movedTextToCompare.set(y?this._lastDiff.moves.find(x=>x.lineRangeMapping.modified.intersect(y.lineRangeMapping.modified)):void 0,_)}))})))}ensureModifiedLineIsVisible(e,n){var r;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,n);return}}ensureOriginalLineIsVisible(e,n){var r;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,n);return}}waitForDiff(){return B_e(this,void 0,void 0,function*(){yield Gwt(this.isDiffUpToDate,e=>e)})}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map(n=>({range:n.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const n=e.collapsedRegions.map(s=>Qn.deserialize(s.range)),r=this._unchangedRegions.get();Pr(s=>{for(const o of r.regions)for(const a of n)if(o.modifiedUnchangedRange.intersect(a)){o.setHiddenModifiedRange(a,s);break}})}};vte=ICt([TCt(3,eAe)],vte);function RCt(i,e,n){return{changes:i.changes.map(r=>new bh(r.original,r.modified,r.innerChanges?r.innerChanges.map(s=>ACt(s,e,n)):void 0)),moves:i.moves,identical:i.identical,quitEarly:i.quitEarly}}function ACt(i,e,n){let r=i.originalRange,s=i.modifiedRange;return(r.endColumn!==1||s.endColumn!==1)&&r.endColumn===e.getLineMaxColumn(r.endLineNumber)&&s.endColumn===n.getLineMaxColumn(s.endLineNumber)&&r.endLineNumber<e.getLineCount()&&s.endLineNumber<n.getLineCount()&&(r=r.setEndPosition(r.endLineNumber+1,1),s=s.setEndPosition(s.endLineNumber+1,1)),new _1(r,s)}class jae{static fromDiffResult(e){return new jae(e.changes.map(n=>new tAe(n)),e.moves||[],e.identical,e.quitEarly)}constructor(e,n,r,s){this.mappings=e,this.movedTexts=n,this.identical=r,this.quitEarly=s}}class tAe{constructor(e){this.lineRangeMapping=e}}class Q7{static fromDiffs(e,n,r,s,o){const a=bh.inverse(e,n,r),l=[];for(const c of a){let u=c.original.startLineNumber,d=c.modified.startLineNumber,h=c.original.length;const f=u===1&&d===1,p=u+h===n+1&&d+h===r+1;(f||p)&&h>=o+s?(f&&!p&&(h-=o),p&&!f&&(u+=o,d+=o,h-=o),l.push(new Q7(u,d,h,0,0))):h>=o*2+s&&(u+=o,d+=o,h-=o*2,l.push(new Q7(u,d,h,0,0)))}return l}get originalUnchangedRange(){return Qn.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Qn.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,n,r,s,o){this.originalLineNumber=e,this.modifiedLineNumber=n,this.lineCount=r,this._visibleLineCountTop=vr(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=vr(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=ni(this,a=>this.visibleLineCountTop.read(a)+this.visibleLineCountBottom.read(a)===this.lineCount&&!this.isDragged.read(a)),this.isDragged=vr(this,!1),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Qn.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Qn.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,n){const r=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(r,s,n)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,n){const r=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,r),n)}showMoreBelow(e=10,n){const r=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,r),n)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,n){const r=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;r<s?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+r,n):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+s,n)}showOriginalLine(e,n){const r=e-this.originalLineNumber,s=this.originalLineNumber+this.lineCount-e;r<s?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+s-r,this.getMaxVisibleLineCountTop()),n):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+r-s,this.getMaxVisibleLineCountBottom()),n)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,n,r){e=Math.max(Math.min(e,this.lineCount),0),n=Math.max(Math.min(n,this.lineCount-e),0),this._visibleLineCountTop.set(e,r),this._visibleLineCountBottom.set(n,r)}}var aK=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class NCt extends Le{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,n,r,s,o,a,l,c,u){super(),this._getViewZoneId=e,this._marginDomNode=n,this._modifiedEditor=r,this._diff=s,this._editor=o,this._viewLineCounts=a,this._originalTextModel=l,this._contextMenuService=c,this._clipboardService=u,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=en.asClassName(lt.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const d=this._modifiedEditor.getOption(66);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${d}px`,this._diffActions.style.lineHeight=`${d}px`,this._marginDomNode.appendChild(this._diffActions);let h=0;const f=r.getOption(126)&&!Kp,p=(g,m)=>{var _;this._contextMenuService.showContextMenu({domForShadowRoot:f&&(_=r.getDomNode())!==null&&_!==void 0?_:void 0,getAnchor:()=>({x:g,y:m}),getActions:()=>{const b=[],y=s.modified.isEmpty;return b.push(new Vl("diff.clipboard.copyDeletedContent",y?s.original.length>1?L("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):L("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):s.original.length>1?L("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):L("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>aK(this,void 0,void 0,function*(){const k=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());yield this._clipboardService.writeText(k)}))),s.original.length>1&&b.push(new Vl("diff.clipboard.copyDeletedLineContent",y?L("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",s.original.startLineNumber+h):L("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",s.original.startLineNumber+h),void 0,!0,()=>aK(this,void 0,void 0,function*(){let k=this._originalTextModel.getLineContent(s.original.startLineNumber+h);k===""&&(k=this._originalTextModel.getEndOfLineSequence()===0?`
`:`\r
`),yield this._clipboardService.writeText(k)}))),r.getOption(90)||b.push(new Vl("diff.inline.revertChange",L("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>aK(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),b},autoSelectFirstItem:!0})};this._register(As(this._diffActions,"mousedown",g=>{const{top:m,height:_}=no(this._diffActions),b=Math.floor(d/3);g.preventDefault(),p(g.posx,m+_+b)})),this._register(r.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(r.onMouseDown(g=>{g.event.rightButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),p(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,n,r){const{top:s}=no(e),o=n-s,a=Math.floor(o/r),l=a*r;if(this._diffActions.style.top=`${l}px`,this._viewLineCounts){let c=0;for(let u=0;u<this._viewLineCounts.length;u++)if(c+=this._viewLineCounts[u],a<c)return u}return a}}const j_e=$v("diffEditorWidget",{createHTML:i=>i});function MCt(i,e,n,r){Ta(r,e.fontInfo);const s=n.length>0,o=new jI(1e4);let a=0,l=0;const c=[];for(let f=0;f<i.lineTokens.length;f++){const p=f+1,g=i.lineTokens[f],m=i.lineBreakData[f],_=ru.filter(n,p,1,Number.MAX_SAFE_INTEGER);if(m){let b=0;for(const y of m.breakOffsets){const x=g.sliceAndInflate(b,y,0);a=Math.max(a,W_e(l,x,ru.extractWrapped(_,b,y),s,i.mightContainNonBasicASCII,i.mightContainRTL,e,o)),l++,b=y}c.push(m.breakOffsets.length)}else c.push(1),a=Math.max(a,W_e(l,g,_,s,i.mightContainNonBasicASCII,i.mightContainRTL,e,o)),l++}a+=e.scrollBeyondLastColumn;const u=o.build(),d=j_e?j_e.createHTML(u):u;r.innerHTML=d;const h=a*e.typicalHalfwidthCharacterWidth;return{heightInLines:l,minWidthInPx:h,viewLineCounts:c}}class PCt{constructor(e,n,r,s){this.lineTokens=e,this.lineBreakData=n,this.mightContainNonBasicASCII=r,this.mightContainRTL=s}}class Wae{static fromEditor(e){var n;const r=e.getOptions(),s=r.get(50),o=r.get(143);return new Wae(((n=e.getModel())===null||n===void 0?void 0:n.getOptions().tabSize)||0,s,r.get(33),s.typicalHalfwidthCharacterWidth,r.get(103),r.get(66),o.decorationsWidth,r.get(116),r.get(98),r.get(93),r.get(51))}constructor(e,n,r,s,o,a,l,c,u,d,h){this.tabSize=e,this.fontInfo=n,this.disableMonospaceOptimizations=r,this.typicalHalfwidthCharacterWidth=s,this.scrollBeyondLastColumn=o,this.lineHeight=a,this.lineDecorationsWidth=l,this.stopRenderingLineAfter=c,this.renderWhitespace=u,this.renderControlCharacters=d,this.fontLigatures=h}}function W_e(i,e,n,r,s,o,a,l){l.appendString('<div class="view-line'),r||l.appendString(" char-delete"),l.appendString('" style="top:'),l.appendString(String(i*a.lineHeight)),l.appendString('px;width:1000000px;">');const c=e.getLineContent(),u=fd.isBasicASCII(c,s),d=fd.containsRTL(c,u,o),h=T5(new X1(a.fontInfo.isMonospace&&!a.disableMonospaceOptimizations,a.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,u,d,0,e,n,a.tabSize,0,a.fontInfo.spaceWidth,a.fontInfo.middotWidth,a.fontInfo.wsmiddotWidth,a.stopRenderingLineAfter,a.renderWhitespace,a.renderControlCharacters,a.fontLigatures!==Uu.OFF,null),l);return l.appendString("</div>"),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}var OCt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},$_e=function(i,e){return function(n,r){e(n,r,i)}};let bte=class extends Le{constructor(e,n,r,s,o,a,l){super(),this._editors=e,this._diffModel=n,this._options=r,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=o,this._clipboardService=a,this._contextMenuService=l,this._originalTopPadding=vr(this,0),this._originalScrollOffset=vr(this,0),this._originalScrollOffsetAnimated=E_e(this._originalScrollOffset,this._store),this._modifiedTopPadding=vr(this,0),this._modifiedScrollOffset=vr(this,0),this._modifiedScrollOffsetAnimated=E_e(this._modifiedScrollOffset,this._store);let c=!1;const u=vr("state",0),d=this._register(new Ji(()=>{u.set(u.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(k=>{!c&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(k=>{!c&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(k=>{(k.hasChanged(144)||k.hasChanged(66))&&d.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(k=>{(k.hasChanged(144)||k.hasChanged(66))&&d.schedule()}));const h=this._diffModel.map(k=>k?oa(k.model.original.onDidChangeTokens,()=>k.model.original.tokenization.backgroundTokenizationState===2):void 0).map((k,D)=>k==null?void 0:k.read(D)),f=new Set,p=new Set,g=ni(k=>{const D=this._diffModel.read(k),R=D==null?void 0:D.diff.read(k);if(!D||!R)return null;u.read(k);const A=this._options.renderSideBySide.read(k);return z_e(this._editors.original,this._editors.modified,R.mappings,f,p,A)}),m=ni(k=>{var D;const R=(D=this._diffModel.read(k))===null||D===void 0?void 0:D.movedTextToCompare.read(k);if(!R)return null;u.read(k);const E=R.changes.map(A=>new tAe(A));return z_e(this._editors.original,this._editors.modified,E,f,p,!0)});function _(){const k=document.createElement("div");return k.className="diagonal-fill",k}const b=this._register(new Xe),y=ni(k=>{var D,R,E,A,M,N,P,O;b.clear();const B=g.read(k)||[],j=[],z=[],H=this._modifiedTopPadding.read(k);H>0&&z.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:H,showInHiddenAreas:!0,suppressMouseDown:!0});const Y=this._originalTopPadding.read(k);Y>0&&j.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:Y,showInHiddenAreas:!0,suppressMouseDown:!0});const X=this._options.renderSideBySide.read(k),Q=X||(D=this._editors.modified._getViewModel())===null||D===void 0?void 0:D.createLineBreaksComputer();if(Q){for(const Ee of B)if(Ee.diff)for(let je=Ee.originalRange.startLineNumber;je<Ee.originalRange.endLineNumberExclusive;je++)Q==null||Q.addRequest(this._editors.original.getModel().getLineContent(je),null,null)}const ie=(R=Q==null?void 0:Q.finalize())!==null&&R!==void 0?R:[];let K=0;const ee=this._editors.modified.getOption(66),le=(E=this._diffModel.read(k))===null||E===void 0?void 0:E.movedTextToCompare.read(k),ke=(M=(A=this._editors.original.getModel())===null||A===void 0?void 0:A.mightContainNonBasicASCII())!==null&&M!==void 0?M:!1,xe=(P=(N=this._editors.original.getModel())===null||N===void 0?void 0:N.mightContainRTL())!==null&&P!==void 0?P:!1,me=Wae.fromEditor(this._editors.modified);for(const Ee of B)if(Ee.diff&&!X){if(!Ee.originalRange.isEmpty){h.read(k);const qe=document.createElement("div");qe.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Ze=new PCt(Ee.originalRange.mapToLineArray(Rt=>this._editors.original.getModel().tokenization.getLineTokens(Rt)),Ee.originalRange.mapToLineArray(Rt=>ie[K++]),ke,xe),We=[];for(const Rt of Ee.diff.innerChanges||[])We.push(new tM(Rt.originalRange.delta(-(Ee.diff.original.startLineNumber-1)),pte.className,0));const ut=MCt(Ze,me,We,qe),st=document.createElement("div");if(st.className="inline-deleted-margin-view-zone",Ta(st,me.fontInfo),this._options.renderIndicators.read(k))for(let Rt=0;Rt<ut.heightInLines;Rt++){const Vt=document.createElement("div");Vt.className=`delete-sign ${en.asClassName(ZRe)}`,Vt.setAttribute("style",`position:absolute;top:${Rt*ee}px;width:${me.lineDecorationsWidth}px;height:${ee}px;right:0;`),st.appendChild(Vt)}let mt;b.add(new NCt(()=>fS(mt),st,this._editors.modified,Ee.diff,this._diffEditorWidget,ut.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Rt=0;Rt<ut.viewLineCounts.length;Rt++){const Vt=ut.viewLineCounts[Rt];Vt>1&&j.push({afterLineNumber:Ee.originalRange.startLineNumber+Rt,domNode:_(),heightInPx:(Vt-1)*ee,showInHiddenAreas:!0,suppressMouseDown:!0})}z.push({afterLineNumber:Ee.modifiedRange.startLineNumber-1,domNode:qe,heightInPx:ut.heightInLines*ee,minWidthInPx:ut.minWidthInPx,marginDomNode:st,setZoneId(Rt){mt=Rt},showInHiddenAreas:!0,suppressMouseDown:!0})}const je=document.createElement("div");je.className="gutter-delete",j.push({afterLineNumber:Ee.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Ee.modifiedHeightInPx,marginDomNode:je,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const je=Ee.modifiedHeightInPx-Ee.originalHeightInPx;if(je>0){if(le!=null&&le.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Ee.originalRange.endLineNumberExclusive-1))continue;j.push({afterLineNumber:Ee.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:je,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let qe=function(){const We=document.createElement("div");return We.className="arrow-revert-change "+en.asClassName(lt.arrowRight),tt("div",{},We)};if(le!=null&&le.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Ee.modifiedRange.endLineNumberExclusive-1))continue;let Ze;Ee.diff&&Ee.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(k)&&(Ze=qe()),z.push({afterLineNumber:Ee.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-je,marginDomNode:Ze,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Ee of(O=m.read(k))!==null&&O!==void 0?O:[]){if(!(le!=null&&le.lineRangeMapping.original.intersect(Ee.originalRange))||!(le!=null&&le.lineRangeMapping.modified.intersect(Ee.modifiedRange)))continue;const je=Ee.modifiedHeightInPx-Ee.originalHeightInPx;je>0?j.push({afterLineNumber:Ee.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:je,showInHiddenAreas:!0,suppressMouseDown:!0}):z.push({afterLineNumber:Ee.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-je,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:j,mod:z}});this._register(Xc(k=>{const D=Qp.capture(this._editors.modified),R=y.read(k);c=!0,this._editors.original.changeViewZones(E=>{for(const A of f)E.removeZone(A);f.clear();for(const A of R.orig){const M=E.addZone(A);A.setZoneId&&A.setZoneId(M),f.add(M)}}),this._editors.modified.changeViewZones(E=>{for(const A of p)E.removeZone(A);p.clear();for(const A of R.mod){const M=E.addZone(A);A.setZoneId&&A.setZoneId(M),p.add(M)}}),c=!1,D.restore(this._editors.modified)})),this._register(gn(()=>{this._editors.original.changeViewZones(k=>{for(const D of f)k.removeZone(D);f.clear()}),this._editors.modified.changeViewZones(k=>{for(const D of p)k.removeZone(D);p.clear()})}));let x=!1;this._register(this._editors.original.onDidScrollChange(k=>{k.scrollLeftChanged&&!x&&(x=!0,this._editors.modified.setScrollLeft(k.scrollLeft),x=!1)})),this._register(this._editors.modified.onDidScrollChange(k=>{k.scrollLeftChanged&&!x&&(x=!0,this._editors.original.setScrollLeft(k.scrollLeft),x=!1)})),this._originalScrollTop=oa(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=oa(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ur(k=>{const D=this._originalScrollTop.read(k)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(k))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(k));D!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(D,1)})),this._register(ur(k=>{const D=this._modifiedScrollTop.read(k)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(k))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(k));D!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(D,1)})),this._register(ur(k=>{var D;const R=(D=this._diffModel.read(k))===null||D===void 0?void 0:D.movedTextToCompare.read(k);let E=0;if(R){const A=this._editors.original.getTopForLineNumber(R.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(R.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-A}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};bte=OCt([$_e(5,qv),$_e(6,Ff)],bte);function z_e(i,e,n,r,s,o){const a=new Ev(V_e(i,r)),l=new Ev(V_e(e,s)),c=i.getOption(66),u=e.getOption(66),d=[];let h=0,f=0;function p(g,m){for(;;){let _=a.peek(),b=l.peek();if(_&&_.lineNumber>=g&&(_=void 0),b&&b.lineNumber>=m&&(b=void 0),!_&&!b)break;const y=_?_.lineNumber-h:Number.MAX_VALUE,x=b?b.lineNumber-f:Number.MAX_VALUE;y<x?(a.dequeue(),b={lineNumber:_.lineNumber-h+f,heightInPx:0}):y>x?(l.dequeue(),_={lineNumber:b.lineNumber-f+h,heightInPx:0}):(a.dequeue(),l.dequeue()),d.push({originalRange:Qn.ofLength(_.lineNumber,1),modifiedRange:Qn.ofLength(b.lineNumber,1),originalHeightInPx:c+_.heightInPx,modifiedHeightInPx:u+b.heightInPx,diff:void 0})}}for(const g of n){let x=function(k,D){var R,E,A,M;if(k<y||D<b)return;if(_)_=!1;else if(k===y||D===b)return;const N=new Qn(y,k),P=new Qn(b,D);if(N.isEmpty&&P.isEmpty)return;const O=(E=(R=a.takeWhile(j=>j.lineNumber<k))===null||R===void 0?void 0:R.reduce((j,z)=>j+z.heightInPx,0))!==null&&E!==void 0?E:0,B=(M=(A=l.takeWhile(j=>j.lineNumber<D))===null||A===void 0?void 0:A.reduce((j,z)=>j+z.heightInPx,0))!==null&&M!==void 0?M:0;d.push({originalRange:N,modifiedRange:P,originalHeightInPx:N.length*c+O,modifiedHeightInPx:P.length*u+B,diff:g.lineRangeMapping}),y=k,b=D};const m=g.lineRangeMapping;p(m.original.startLineNumber,m.modified.startLineNumber);let _=!0,b=m.modified.startLineNumber,y=m.original.startLineNumber;if(o)for(const k of m.innerChanges||[])k.originalRange.startColumn>1&&k.modifiedRange.startColumn>1&&x(k.originalRange.startLineNumber,k.modifiedRange.startLineNumber),k.originalRange.endColumn<i.getModel().getLineMaxColumn(k.originalRange.endLineNumber)&&x(k.originalRange.endLineNumber,k.modifiedRange.endLineNumber);x(m.original.endLineNumberExclusive,m.modified.endLineNumberExclusive),h=m.original.endLineNumberExclusive,f=m.modified.endLineNumberExclusive}return p(Number.MAX_VALUE,Number.MAX_VALUE),d}function V_e(i,e){const n=[],r=[],s=i.getOption(144).wrappingColumn!==-1,o=i._getViewModel().coordinatesConverter,a=i.getOption(66);if(s)for(let c=1;c<=i.getModel().getLineCount();c++){const u=o.getModelLineViewLineCount(c);u>1&&r.push({lineNumber:c,heightInPx:a*(u-1)})}for(const c of i.getWhitespaces()){if(e.has(c.id))continue;const u=c.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new ve(c.afterLineNumber,1)).lineNumber;n.push({lineNumber:u,heightInPx:c.height})}return Jwt(n,r,c=>c.lineNumber,(c,u)=>({lineNumber:c.lineNumber,heightInPx:c.heightInPx+u.heightInPx}))}var FCt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},BCt=function(i,e){return function(n,r){e(n,r,i)}},fp;let bv=fp=class extends Le{constructor(e,n,r,s,o,a,l,c){super(),this._editors=e,this._rootElement=n,this._diffModel=r,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=a,this._options=l,this._themeService=c;const u=oa(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=ni(p=>{const g=u.read(p),m=g.getColor(Qdt)||(g.getColor(Ydt)||EJ).transparent(2),_=g.getColor(Jdt)||(g.getColor(Zdt)||IJ).transparent(2);return{insertColor:m,removeColor:_}}),h=oa(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),f=oa(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(Xc((p,g)=>{if(!this._options.renderOverviewRuler.read(p))return;const m=Di(document.createElement("div"));m.setClassName("diffViewport"),m.setPosition("absolute");const _=Jo("div.diffOverview",{style:{position:"absolute",top:"0px",width:fp.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(S6(_,m.domNode)),g.add(As(_,ht.POINTER_DOWN,b=>{this._editors.modified.delegateVerticalScrollbarPointerDown(b)})),g.add(Be(_,ht.MOUSE_WHEEL,b=>{this._editors.modified.delegateScrollFromMouseWheelEvent(b)},{passive:!1})),g.add(S6(this._rootElement,_)),g.add(Xc((b,y)=>{const x=this._diffModel.read(b),k=this._editors.original.createOverviewRuler("original diffOverviewRuler");k&&(y.add(k),y.add(S6(_,k.getDomNode())));const D=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(D&&(y.add(D),y.add(S6(_,D.getDomNode()))),!k||!D)return;const R=Ku("viewZoneChanged",this._editors.original.onDidChangeViewZones),E=Ku("viewZoneChanged",this._editors.modified.onDidChangeViewZones),A=Ku("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),M=Ku("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);y.add(ur(N=>{var P;R.read(N),E.read(N),A.read(N),M.read(N);const O=d.read(N),B=(P=x==null?void 0:x.diff.read(N))===null||P===void 0?void 0:P.mappings;function j(Y,X,Q){const ie=Q._getViewModel();return ie?Y.filter(K=>K.length>0).map(K=>{const ee=ie.coordinatesConverter.convertModelPositionToViewPosition(new ve(K.startLineNumber,1)),le=ie.coordinatesConverter.convertModelPositionToViewPosition(new ve(K.endLineNumberExclusive,1)),ke=le.lineNumber-ee.lineNumber;return new KIe(ee.lineNumber,le.lineNumber,ke,X.toString())}):[]}const z=j((B||[]).map(Y=>Y.lineRangeMapping.original),O.removeColor,this._editors.original),H=j((B||[]).map(Y=>Y.lineRangeMapping.modified),O.insertColor,this._editors.modified);k==null||k.setZones(z),D==null||D.setZones(H)})),y.add(ur(N=>{const P=this._rootHeight.read(N),O=this._rootWidth.read(N),B=this._modifiedEditorLayoutInfo.read(N);if(B){const j=fp.ENTIRE_DIFF_OVERVIEW_WIDTH-2*fp.ONE_OVERVIEW_WIDTH;k.setLayout({top:0,height:P,right:j+fp.ONE_OVERVIEW_WIDTH,width:fp.ONE_OVERVIEW_WIDTH}),D.setLayout({top:0,height:P,right:0,width:fp.ONE_OVERVIEW_WIDTH});const z=h.read(N),H=f.read(N),Y=this._editors.modified.getOption(102),X=new HE(Y.verticalHasArrows?Y.arrowSize:0,Y.verticalScrollbarSize,0,B.height,H,z);m.setTop(X.getSliderPosition()),m.setHeight(X.getSliderSize())}else m.setTop(0),m.setHeight(0);_.style.height=P+"px",_.style.left=O-fp.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",m.setWidth(fp.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};bv.ONE_OVERVIEW_WIDTH=15;bv.ENTIRE_DIFF_OVERVIEW_WIDTH=fp.ONE_OVERVIEW_WIDTH*2;bv=fp=FCt([BCt(7,Do)],bv);ce("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},L("diffEditor.move.border","The border color for text that got moved in the diff editor."));ce("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},L("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class uz extends Le{constructor(){super(...arguments),this._id=++uz.idCounter,this._onDidDispose=this._register(new _e),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,n="api"){this._targetEditor.setPosition(e,n)}revealLine(e,n=0){this._targetEditor.revealLine(e,n)}revealLineInCenter(e,n=0){this._targetEditor.revealLineInCenter(e,n)}revealLineInCenterIfOutsideViewport(e,n=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,n)}revealLineNearTop(e,n=0){this._targetEditor.revealLineNearTop(e,n)}revealPosition(e,n=0){this._targetEditor.revealPosition(e,n)}revealPositionInCenter(e,n=0){this._targetEditor.revealPositionInCenter(e,n)}revealPositionInCenterIfOutsideViewport(e,n=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,n)}revealPositionNearTop(e,n=0){this._targetEditor.revealPositionNearTop(e,n)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,n="api"){this._targetEditor.setSelection(e,n)}setSelections(e,n="api"){this._targetEditor.setSelections(e,n)}revealLines(e,n,r=0){this._targetEditor.revealLines(e,n,r)}revealLinesInCenter(e,n,r=0){this._targetEditor.revealLinesInCenter(e,n,r)}revealLinesInCenterIfOutsideViewport(e,n,r=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,n,r)}revealLinesNearTop(e,n,r=0){this._targetEditor.revealLinesNearTop(e,n,r)}revealRange(e,n=0,r=!1,s=!0){this._targetEditor.revealRange(e,n,r,s)}revealRangeInCenter(e,n=0){this._targetEditor.revealRangeInCenter(e,n)}revealRangeInCenterIfOutsideViewport(e,n=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,n)}revealRangeNearTop(e,n=0){this._targetEditor.revealRangeNearTop(e,n)}revealRangeNearTopIfOutsideViewport(e,n=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,n)}revealRangeAtTop(e,n=0){this._targetEditor.revealRangeAtTop(e,n)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,n,r){this._targetEditor.trigger(e,n,r)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}uz.idCounter=0;var jCt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},H_e=function(i,e){return function(n,r){e(n,r,i)}};let yte=class extends Le{constructor(e,n,r,s,o,a,l){super(),this.originalEditorElement=e,this.modifiedEditorElement=n,this._options=r,this._createInnerEditor=o,this._instantiationService=a,this._keybindingService=l,this._onDidContentSizeChange=this._register(new _e),this.original=this._register(this._createLeftHandSideEditor(r.editorOptions.get(),s.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(r.editorOptions.get(),s.modifiedEditor||{})),this.modifiedModel=oa(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(az({createEmptyChangeSummary:()=>({}),handleChange:(c,u)=>(c.didChange(r.editorOptions)&&Object.assign(u,c.change.changedOptions),!0)},(c,u)=>{r.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,u)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,u))}))}_createLeftHandSideEditor(e,n){const r=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,r,n);return s.setContextValue("isInDiffLeftEditor",!0),s}_createRightHandSideEditor(e,n){const r=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,r,n);return s.setContextValue("isInDiffRightEditor",!0),s}_constructInnerEditor(e,n,r,s){const o=this._createInnerEditor(e,n,r,s);return this._register(o.onDidContentSizeChange(a=>{const l=this.original.getContentWidth()+this.modified.getContentWidth()+bv.ENTIRE_DIFF_OVERVIEW_WIDTH,c=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:c,contentWidth:l,contentHeightChanged:a.contentHeightChanged,contentWidthChanged:a.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,n){const r=this._adjustOptionsForSubEditor(n);return this._options.renderSideBySide.get()?(r.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},r.wordWrapOverride1=this._options.diffWordWrap.get()):(r.wordWrapOverride1="off",r.wordWrapOverride2="off",r.stickyScroll={enabled:!1},r.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),n.originalAriaLabel&&(r.ariaLabel=n.originalAriaLabel),r.ariaLabel=this._updateAriaLabel(r.ariaLabel),r.readOnly=!this._options.originalEditable.get(),r.dropIntoEditor={enabled:!r.readOnly},r.extraEditorClassName="original-in-monaco-diff-editor",r}_adjustOptionsForRightHandSide(e,n){const r=this._adjustOptionsForSubEditor(n);return n.modifiedAriaLabel&&(r.ariaLabel=n.modifiedAriaLabel),r.ariaLabel=this._updateAriaLabel(r.ariaLabel),r.wordWrapOverride1=this._options.diffWordWrap.get(),r.revealHorizontalRightPadding=rg.revealHorizontalRightPadding.defaultValue+bv.ENTIRE_DIFF_OVERVIEW_WIDTH,r.scrollbar.verticalHasArrows=!1,r.extraEditorClassName="modified-in-monaco-diff-editor",r}_adjustOptionsForSubEditor(e){const n=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return n.inDiffEditor=!0,n.automaticLayout=!1,n.scrollbar=Object.assign({},n.scrollbar||{}),n.scrollbar.vertical="visible",n.folding=!1,n.codeLens=this._options.diffCodeLens.get(),n.fixedOverflowWidgets=!0,n.minimap=Object.assign({},n.minimap||{}),n.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?n.stickyScroll={enabled:!1}:n.stickyScroll=this._options.editorOptions.get().stickyScroll,n}_updateAriaLabel(e){var n;e||(e="");const r=L("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(n=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||n===void 0?void 0:n.getAriaLabel());return this._options.accessibilityVerbose.get()?e+r:e?e.replaceAll(r,""):""}};yte=jCt([H_e(5,hn),H_e(6,sr)],yte);class WCt{get editorOptions(){return this._options}constructor(e,n){this.diffEditorWidth=n,this.couldShowInlineViewBecauseOfSize=ni(this,s=>this._options.read(s).renderSideBySide&&this.diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=ni(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=ni(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s))),this.readOnly=ni(this,s=>this._options.read(s).readOnly),this.shouldRenderRevertArrows=ni(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s))),this.renderIndicators=ni(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=ni(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=ni(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=ni(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=ni(this,s=>this._options.read(s).maxComputationTime),this.showMoves=ni(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=ni(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=ni(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=ni(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=ni(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=ni(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=ni(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=ni(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=ni(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=ni(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=ni(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=ni(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=ni(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const r=Object.assign(Object.assign({},e),U_e(e,ll));this._options=vr(this,r)}updateOptions(e){const n=U_e(e,this._options.get()),r=Object.assign(Object.assign(Object.assign({},this._options.get()),e),n);this._options.set(r,void 0,{changedOptions:e})}}function U_e(i,e){var n,r,s,o,a,l,c,u;return{enableSplitViewResizing:Ut(i.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:qrt(i.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Ut(i.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Ut(i.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:AC(i.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:AC(i.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Ut(i.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Ut(i.renderIndicators,e.renderIndicators),originalEditable:Ut(i.originalEditable,e.originalEditable),diffCodeLens:Ut(i.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Ut(i.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Rs(i.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Rs(i.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Ut(i.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Ut((n=i.experimental)===null||n===void 0?void 0:n.showMoves,e.experimental.showMoves),showEmptyDecorations:Ut((r=i.experimental)===null||r===void 0?void 0:r.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:Ut((o=(s=i.hideUnchangedRegions)===null||s===void 0?void 0:s.enabled)!==null&&o!==void 0?o:(a=i.experimental)===null||a===void 0?void 0:a.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:AC((l=i.hideUnchangedRegions)===null||l===void 0?void 0:l.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:AC((c=i.hideUnchangedRegions)===null||c===void 0?void 0:c.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:AC((u=i.hideUnchangedRegions)===null||u===void 0?void 0:u.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Ut(i.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Ut(i.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:AC(i.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Ut(i.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var $Ct=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},tA=function(i,e){return function(n,r){e(n,r,i)}};let yx=class extends uz{constructor(e,n,r,s,o,a,l,c){var u;super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._audioCueService=l,this._editorProgressService=c,this.elements=Jo("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Jo("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[tt("span",{},"No Changes")]),Jo("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Jo("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Jo("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(q7("diffModel",void 0)),this.onDidChangeModel=_t.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new O$([mn,this._contextKeyService])),this._boundarySashes=vr(this,void 0),this._accessibleDiffViewerShouldBeVisible=vr(this,!1),this._accessibleDiffViewerVisible=ni(this,m=>this._options.onlyShowAccessibleDiffViewer.read(m)?!0:this._accessibleDiffViewerShouldBeVisible.read(m)),this.movedBlocksLinesPart=vr(this,void 0),this._layoutInfo=ni(this,m=>{var _,b,y;const x=this._rootSizeObserver.width.read(m),k=this._rootSizeObserver.height.read(m),D=(_=this._sash.read(m))===null||_===void 0?void 0:_.sashLeft.read(m),R=D??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),E=x-R-(this._options.renderOverviewRuler.read(m)?bv.ENTIRE_DIFF_OVERVIEW_WIDTH:0),A=(y=(b=this.movedBlocksLinesPart.read(m))===null||b===void 0?void 0:b.width.read(m))!==null&&y!==void 0?y:0,M=R-A;return this.elements.original.style.width=M+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=E+"px",this.elements.modified.style.left=R+"px",this._editors.original.layout({width:M,height:k}),this._editors.modified.layout({width:E,height:k}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((m,_)=>m==null?void 0:m.diff.read(_)),this.onDidUpdateDiff=_t.fromObservableLight(this._diffValue),a.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(gn(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new eCt(this.elements.root,n.dimension)),this._rootSizeObserver.setAutomaticLayout((u=n.automaticLayout)!==null&&u!==void 0?u:!1),this._options=new WCt(n,this._rootSizeObserver.width),this._contextKeyService.createKey(oe.isEmbeddedDiffEditor.key,!1);const d=oe.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(ur(m=>{d.set(this._options.isInEmbeddedEditor.read(m))}));const h=oe.comparingMovedCode.bindTo(this._contextKeyService);this._register(ur(m=>{var _;h.set(!!(!((_=this._diffModel.read(m))===null||_===void 0)&&_.movedTextToCompare.read(m)))}));const f=oe.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(ur(m=>{f.set(this._options.couldShowInlineViewBecauseOfSize.read(m))})),this._editors=this._register(this._instantiationService.createInstance(yte,this.elements.original,this.elements.modified,this._options,r,(m,_,b,y)=>this._createInnerEditor(m,_,b,y))),this._sash=nO(this,(m,_)=>{const b=this._options.renderSideBySide.read(m);if(this.elements.root.classList.toggle("side-by-side",b),!b)return;const y=_.add(new wCt(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((x,k)=>x-(this._options.renderOverviewRuler.read(k)?bv.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return _.add(ur(x=>{const k=this._boundarySashes.read(x);k&&y.setBoundarySashes(k)})),y}),this._register(rO(this._sash)),this._register(Xc((m,_)=>{this.unchangedRangesFeature=_.add(this._instantiationService.createInstance(ny(gte,m),this._editors,this._diffModel,this._options))})),this._register(Xc((m,_)=>{_.add(new(ny(yCt,m))(this._editors,this._diffModel,this._options))})),this._register(Xc((m,_)=>{_.add(this._instantiationService.createInstance(ny(bte,m),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(Xc((m,_)=>{_.add(this._instantiationService.createInstance(ny(bv,m),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(b=>b.modifiedEditor),this._options))})),this._register(Xc((m,_)=>{this._accessibleDiffViewer=_.add(this._register(this._instantiationService.createInstance(ny(xy,m),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(b,y)=>this._accessibleDiffViewerShouldBeVisible.set(b,y),this._options.onlyShowAccessibleDiffViewer.map(b=>!b),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((b,y)=>{var x;return(x=b==null?void 0:b.diff.read(y))===null||x===void 0?void 0:x.mappings.map(k=>k.lineRangeMapping)}),this._editors)))}));const p=this._accessibleDiffViewerVisible.map(m=>m?"hidden":"visible");this._register(Gy(this.elements.modified,{visibility:p})),this._register(Gy(this.elements.original,{visibility:p})),this._createDiffEditorContributions(),a.addDiffEditor(this),this._register(rO(this._layoutInfo)),this._register(Xc((m,_)=>{this.movedBlocksLinesPart.set(_.add(new(ny(Xy,m))(this.elements.root,this._diffModel,this._layoutInfo.map(b=>b.originalEditor),this._layoutInfo.map(b=>b.modifiedEditor),this._editors)),void 0)})),this._register(Gy(this.elements.overlay,{width:this._layoutInfo.map((m,_)=>m.originalEditor.width+(this._options.renderSideBySide.read(_)?0:m.modifiedEditor.width)),visibility:ni(m=>{var _,b;return this._options.hideUnchangedRegions.read(m)&&((b=(_=this._diffModel.read(m))===null||_===void 0?void 0:_.diff.read(m))===null||b===void 0?void 0:b.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(m=>{var _,b;if(!m.event.rightButton&&m.target.position&&(!((_=m.target.element)===null||_===void 0)&&_.className.includes("arrow-revert-change"))){const y=m.target.position.lineNumber,x=m.target,k=this._diffModel.get();if(!k)return;const D=(b=k.diff.get())===null||b===void 0?void 0:b.mappings;if(!D)return;const R=D.find(E=>(x==null?void 0:x.detail.afterLineNumber)===E.lineRangeMapping.modified.startLineNumber-1||E.lineRangeMapping.modified.startLineNumber===y);if(!R)return;this.revert(R.lineRangeMapping),m.event.stopPropagation()}})),this._register(_t.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,m=>{var _,b;if((m==null?void 0:m.reason)===3){const y=(b=(_=this._diffModel.get())===null||_===void 0?void 0:_.diff.get())===null||b===void 0?void 0:b.mappings.find(x=>x.lineRangeMapping.modified.contains(m.position.lineNumber));y!=null&&y.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(fi.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):y!=null&&y.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(fi.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):y&&this._audioCueService.playAudioCue(fi.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((m,_)=>m==null?void 0:m.isDiffUpToDate.read(_));this._register(Xc((m,_)=>{if(g.read(m)===!1){const b=this._editorProgressService.show(!0,1e3);_.add(gn(()=>b.done()))}}))}_createInnerEditor(e,n,r,s){return e.createInstance(qE,n,r,s)}_createDiffEditorContributions(){const e=j2.getDiffEditorContributions();for(const n of e)try{this._register(this._instantiationService.createInstance(n.ctor,this))}catch(r){Ln(r)}}get _targetEditor(){return this._editors.modified}getEditorType(){return I5.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const n=this._editors.original.saveViewState(),r=this._editors.modified.saveViewState();return{original:n,modified:r,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var n;if(e&&e.original&&e.modified){const r=e;this._editors.original.restoreViewState(r.original),this._editors.modified.restoreViewState(r.modified),r.modelState&&((n=this._diffModel.get())===null||n===void 0||n.restoreSerializedState(r.modelState))}}createViewModel(e){return this._instantiationService.createInstance(vte,e,this._options,this)}getModel(){var e,n;return(n=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&n!==void 0?n:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const n=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(n?n.model.original:null),this._editors.modified.setModel(n?n.model.modified:null),Pr(r=>{this._diffModel.set(n,r)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const n=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return n?HCt(n):null}revert(e){var n;const r=(n=this._diffModel.get())===null||n===void 0?void 0:n.model;if(!r)return;const s=e.innerChanges?e.innerChanges.map(o=>({range:o.modifiedRange,text:r.original.getValueInRange(o.originalRange)})):[{range:e.modified.toExclusiveRange(),text:r.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",s)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,n;const r=this._editors.modified.hasWidgetFocus(),s=r?this._editors.modified:this._editors.original,o=r?this._editors.original:this._editors.modified;let a;const l=s.getSelection();if(l){const c=(n=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||n===void 0?void 0:n.mappings.map(u=>r?u.lineRangeMapping.flip():u.lineRangeMapping);if(c){const u=q_e(l.getStartPosition(),c),d=q_e(l.getEndPosition(),c);a=J.plusRange(u,d)}}return{destination:o,destinationSelection:a}}switchSide(){const{destination:e,destinationSelection:n}=this.mapToOtherSide();e.focus(),n&&e.setSelection(n)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const n=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();n&&Pr(r=>{for(const s of n)s.collapseAll(r)})}showAllUnchangedRegions(){var e;const n=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();n&&Pr(r=>{for(const s of n)s.showAll(r)})}};yx=$Ct([tA(3,mn),tA(4,hn),tA(5,Si),tA(6,X5),tA(7,Z1)],yx);function q_e(i,e){const n=G9(e,s=>s.original.startLineNumber<=i.lineNumber);if(!n)return J.fromPositions(i);if(n.original.endLineNumberExclusive<=i.lineNumber){const s=i.lineNumber-n.original.endLineNumberExclusive+n.modified.endLineNumberExclusive;return J.fromPositions(new ve(s,i.column))}if(!n.innerChanges)return J.fromPositions(new ve(n.modified.startLineNumber,1));const r=G9(n.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(i));if(!r){const s=i.lineNumber-n.original.startLineNumber+n.modified.startLineNumber;return J.fromPositions(new ve(s,i.column))}if(r.originalRange.containsPosition(i))return r.modifiedRange;{const s=zCt(r.originalRange.getEndPosition(),i);return J.fromPositions(VCt(r.modifiedRange.getEndPosition(),s))}}function zCt(i,e){return i.lineNumber===e.lineNumber?new NP(0,e.column-i.column):new NP(e.lineNumber-i.lineNumber,e.column-1)}function VCt(i,e){return e.lineCount===0?new ve(i.lineNumber,i.column+e.columnCount):new ve(i.lineNumber+e.lineCount,e.columnCount+1)}function HCt(i){return i.mappings.map(e=>{const n=e.lineRangeMapping;let r,s,o,a,l=n.innerChanges;return n.original.isEmpty?(r=n.original.startLineNumber-1,s=0,l=void 0):(r=n.original.startLineNumber,s=n.original.endLineNumberExclusive-1),n.modified.isEmpty?(o=n.modified.startLineNumber-1,a=0,l=void 0):(o=n.modified.startLineNumber,a=n.modified.endLineNumberExclusive-1),{originalStartLineNumber:r,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:a,charChanges:l==null?void 0:l.map(c=>({originalStartLineNumber:c.originalRange.startLineNumber,originalStartColumn:c.originalRange.startColumn,originalEndLineNumber:c.originalRange.endLineNumber,originalEndColumn:c.originalRange.endColumn,modifiedStartLineNumber:c.modifiedRange.startLineNumber,modifiedStartColumn:c.modifiedRange.startColumn,modifiedEndLineNumber:c.modifiedRange.endLineNumber,modifiedEndColumn:c.modifiedRange.endColumn}))}})}var $ae=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Rr=function(i,e){return function(n,r){e(n,r,i)}};let UCt=0,K_e=!1;function qCt(i){if(!i){if(K_e)return;K_e=!0}Gut(i||document.body)}let J7=class extends qE{constructor(e,n,r,s,o,a,l,c,u,d,h,f){const p=Object.assign({},n);p.ariaLabel=p.ariaLabel||x7.editorViewAccessibleLabel,p.ariaLabel=p.ariaLabel+";"+x7.accessibilityHelpMessage,super(e,p,{},r,s,o,a,c,u,d,h,f),l instanceof eI?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,qCt(p.ariaContainerElement)}addCommand(e,n,r){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++UCt,o=ze.deserialize(r);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,n,o),s}createContextKey(e,n){return this._contextKeyService.createKey(e,n)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Le.None;const n=e.id,r=e.label,s=ze.and(ze.equals("editorId",this.getId()),ze.deserialize(e.precondition)),o=e.keybindings,a=ze.and(s,ze.deserialize(e.keybindingContext)),l=e.contextMenuGroupId||null,c=e.contextMenuOrder||0,u=(p,...g)=>Promise.resolve(e.run(this,...g)),d=new Xe,h=this.getId()+":"+n;if(d.add(si.registerCommand(h,u)),l){const p={command:{id:h,title:r},when:s,group:l,order:c};d.add(sa.appendMenuItem(se.EditorContext,p))}if(Array.isArray(o))for(const p of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,p,u,a));const f=new GIe(h,r,r,s,(...p)=>Promise.resolve(e.run(this,...p)),this._contextKeyService);return this._actions.set(n,f),d.add(gn(()=>{this._actions.delete(n)})),d}_triggerCommand(e,n){if(this._codeEditorService instanceof m7)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,n)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,n)}};J7=$ae([Rr(2,hn),Rr(3,Si),Rr(4,us),Rr(5,mn),Rr(6,sr),Rr(7,Do),Rr(8,Ps),Rr(9,zv),Rr(10,dr),Rr(11,Et)],J7);let wte=class extends J7{constructor(e,n,r,s,o,a,l,c,u,d,h,f,p,g,m){const _=Object.assign({},n);U7(d,_,!1);const b=c.registerEditorContainer(e);typeof _.theme=="string"&&c.setTheme(_.theme),typeof _.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!_.autoDetectHighContrast);const y=_.model;delete _.model,super(e,_,r,s,o,a,l,c,u,h,g,m),this._configurationService=d,this._standaloneThemeService=c,this._register(b);let x;if(typeof y>"u"){const k=p.getLanguageIdByMimeType(_.language)||_.language||ad;x=nAe(f,p,_.value||"",k,void 0),this._ownsModel=!0}else x=y,this._ownsModel=!1;if(this._attachModel(x),x){const k={oldModelUrl:null,newModelUrl:x.uri};this._onDidChangeModel.fire(k)}}dispose(){super.dispose()}updateOptions(e){U7(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};wte=$ae([Rr(2,hn),Rr(3,Si),Rr(4,us),Rr(5,mn),Rr(6,sr),Rr(7,bd),Rr(8,Ps),Rr(9,ei),Rr(10,zv),Rr(11,Fr),Rr(12,Ar),Rr(13,dr),Rr(14,Et)],wte);let Cte=class extends yx{constructor(e,n,r,s,o,a,l,c,u,d,h,f){const p=Object.assign({},n);U7(c,p,!0);const g=a.registerEditorContainer(e);typeof p.theme=="string"&&a.setTheme(p.theme),typeof p.autoDetectHighContrast<"u"&&a.setAutoDetectHighContrast(!!p.autoDetectHighContrast),super(e,p,{},s,r,o,f,d),this._configurationService=c,this._standaloneThemeService=a,this._register(g)}dispose(){super.dispose()}updateOptions(e){U7(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,n,r){return e.createInstance(J7,n,r)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,n,r){return this.getModifiedEditor().addCommand(e,n,r)}createContextKey(e,n){return this.getModifiedEditor().createContextKey(e,n)}addAction(e){return this.getModifiedEditor().addAction(e)}};Cte=$ae([Rr(2,hn),Rr(3,mn),Rr(4,Si),Rr(5,bd),Rr(6,Ps),Rr(7,ei),Rr(8,Ff),Rr(9,Z1),Rr(10,qv),Rr(11,X5)],Cte);function nAe(i,e,n,r,s){if(n=n||"",!r){const o=n.indexOf(`
`);let a=n;return o!==-1&&(a=n.substring(0,o)),G_e(i,n,e.createByFilepathOrFirstLine(s||null,a),s)}return G_e(i,n,e.createById(r),s)}function G_e(i,e,n,r){return i.createModel(e,n,r)}var iAe=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function KCt(i,e,n){return un.initialize(n||{}).createInstance(wte,i,e)}function GCt(i){return un.get(Si).onCodeEditorAdd(n=>{i(n)})}function XCt(i){return un.get(Si).onDiffEditorAdd(n=>{i(n)})}function YCt(){return un.get(Si).listCodeEditors()}function ZCt(){return un.get(Si).listDiffEditors()}function QCt(i,e,n){return un.initialize(n||{}).createInstance(Cte,i,e)}function JCt(i){if(typeof i.id!="string"||typeof i.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return si.registerCommand(i.id,i.run)}function eSt(i){if(typeof i.id!="string"||typeof i.label!="string"||typeof i.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=ze.deserialize(i.precondition),n=(s,...o)=>Ho.runEditorCommand(s,o,e,(a,l,c)=>Promise.resolve(i.run(l,...c))),r=new Xe;if(r.add(si.registerCommand(i.id,n)),i.contextMenuGroupId){const s={command:{id:i.id,title:i.label},when:e,group:i.contextMenuGroupId,order:i.contextMenuOrder||0};r.add(sa.appendMenuItem(se.EditorContext,s))}if(Array.isArray(i.keybindings)){const s=un.get(sr);if(!(s instanceof eI))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=ze.and(e,ze.deserialize(i.keybindingContext));r.add(s.addDynamicKeybindings(i.keybindings.map(a=>({keybinding:a,command:i.id,when:o}))))}}return r}function tSt(i){return rAe([i])}function rAe(i){const e=un.get(sr);return e instanceof eI?e.addDynamicKeybindings(i.map(n=>({keybinding:n.keybinding,command:n.command,commandArgs:n.commandArgs,when:ze.deserialize(n.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Le.None)}function nSt(i,e,n){const r=un.get(Ar),s=r.getLanguageIdByMimeType(e)||e;return nAe(un.get(Fr),r,i,s,n)}function iSt(i,e){const n=un.get(Ar),r=n.getLanguageIdByMimeType(e)||e||ad;i.setLanguage(n.createById(r))}function rSt(i,e,n){i&&un.get(h_).changeOne(e,i.uri,n)}function sSt(i){un.get(h_).changeAll(i,[])}function oSt(i){return un.get(h_).read(i)}function aSt(i){return un.get(h_).onMarkerChanged(i)}function lSt(i){return un.get(Fr).getModel(i)}function cSt(){return un.get(Fr).getModels()}function uSt(i){return un.get(Fr).onModelAdded(i)}function dSt(i){return un.get(Fr).onModelRemoved(i)}function hSt(i){return un.get(Fr).onModelLanguageChanged(n=>{i({model:n.model,oldLanguage:n.oldLanguageId})})}function fSt(i){return wut(un.get(Fr),un.get(dr),i)}function pSt(i,e){const n=un.get(Ar),r=un.get(bd);return doe.colorizeElement(r,n,i,e).then(()=>{r.registerEditorContainer(i)})}function gSt(i,e,n){const r=un.get(Ar);return un.get(bd).registerEditorContainer(document.body),doe.colorize(r,i,e,n)}function mSt(i,e,n=4){return un.get(bd).registerEditorContainer(document.body),doe.colorizeModelLine(i,e,n)}function _St(i){const e=Zr.get(i);return e||{getInitialState:()=>FE,tokenize:(n,r,s)=>loe(i,s)}}function vSt(i,e){Zr.getOrCreate(e);const n=_St(e),r=Km(i),s=[];let o=n.getInitialState();for(let a=0,l=r.length;a<l;a++){const c=r[a],u=n.tokenize(c,!0,o);s[a]=u.tokens,o=u.endState}return s}function bSt(i,e){un.get(bd).defineTheme(i,e)}function ySt(i){un.get(bd).setTheme(i)}function wSt(){nJ.clearAllFontInfos()}function CSt(i,e){return si.registerCommand({id:i,handler:e})}function SSt(i){return un.get(fu).registerOpener({open(n){return iAe(this,void 0,void 0,function*(){return typeof n=="string"&&(n=Jt.parse(n)),i.open(n)})}})}function xSt(i){return un.get(Si).registerCodeEditorOpenHandler((n,r,s)=>iAe(this,void 0,void 0,function*(){var o;if(!r)return null;const a=(o=n.options)===null||o===void 0?void 0:o.selection;let l;return a&&typeof a.endLineNumber=="number"&&typeof a.endColumn=="number"?l=a:a&&(l={lineNumber:a.startLineNumber,column:a.startColumn}),(yield i.openCodeEditor(r,n.resource,l))?r:null}))}function kSt(){return{create:KCt,getEditors:YCt,getDiffEditors:ZCt,onDidCreateEditor:GCt,onDidCreateDiffEditor:XCt,createDiffEditor:QCt,addCommand:JCt,addEditorAction:eSt,addKeybindingRule:tSt,addKeybindingRules:rAe,createModel:nSt,setModelLanguage:iSt,setModelMarkers:rSt,getModelMarkers:oSt,removeAllMarkers:sSt,onDidChangeMarkers:aSt,getModels:cSt,getModel:lSt,onDidCreateModel:uSt,onWillDisposeModel:dSt,onDidChangeModelLanguage:hSt,createWebWorker:fSt,colorizeElement:pSt,colorize:gSt,colorizeModelLine:mSt,tokenize:vSt,defineTheme:bSt,setTheme:ySt,remeasureFonts:wSt,registerCommand:CSt,registerLinkOpener:SSt,registerEditorOpener:xSt,AccessibilitySupport:pQ,ContentWidgetPositionPreference:yQ,CursorChangeReason:wQ,DefaultEndOfLine:CQ,EditorAutoIndentStrategy:xQ,EditorOption:kQ,EndOfLinePreference:LQ,EndOfLineSequence:DQ,MinimapPosition:OQ,MouseTargetType:FQ,OverlayWidgetPositionPreference:BQ,OverviewRulerLane:jQ,GlyphMarginLane:EQ,RenderLineNumbersType:$Q,RenderMinimap:zQ,ScrollbarVisibility:HQ,ScrollType:VQ,TextEditorCursorBlinkingStyle:XQ,TextEditorCursorStyle:YQ,TrackedRangeStickiness:ZQ,WrappingIndent:QQ,InjectedTextCursorStops:TQ,PositionAffinity:WQ,ConfigurationChangedEvent:I2e,BareFontInfo:NS,FontInfo:tJ,TextModelResolvedOptions:c8,FindMatch:pP,ApplyUpdateResult:QN,EditorZoom:eh,EditorType:I5,EditorOptions:rg}}function LSt(i,e){if(!e||!Array.isArray(e))return!1;for(const n of e)if(!i(n))return!1;return!0}function x6(i,e){return typeof i=="boolean"?i:e}function X_e(i,e){return typeof i=="string"?i:e}function DSt(i){const e={};for(const n of i)e[n]=!0;return e}function Y_e(i,e=!1){e&&(i=i.map(function(r){return r.toLowerCase()}));const n=DSt(i);return e?function(r){return n[r.toLowerCase()]!==void 0&&n.hasOwnProperty(r.toLowerCase())}:function(r){return n[r]!==void 0&&n.hasOwnProperty(r)}}function Ste(i,e){e=e.replace(/@@/g,"");let n=0,r;do r=!1,e=e.replace(/@(\w+)/g,function(o,a){r=!0;let l="";if(typeof i[a]=="string")l=i[a];else if(i[a]&&i[a]instanceof RegExp)l=i[a].source;else throw i[a]===void 0?Lr(i,"language definition does not contain attribute '"+a+"', used at: "+e):Lr(i,"attribute reference '"+a+"' must be a string, used at: "+e);return WD(l)?"":"(?:"+l+")"}),n++;while(r&&n<5);e=e.replace(/\x01/g,"@");const s=(i.ignoreCase?"i":"")+(i.unicode?"u":"");return new RegExp(e,s)}function ESt(i,e,n,r){if(r<0)return i;if(r<e.length)return e[r];if(r>=100){r=r-100;const s=n.split(".");if(s.unshift(n),r<s.length)return s[r]}return null}function ISt(i,e,n,r){let s=-1,o=n,a=n.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);a&&(a[3]&&(s=parseInt(a[3]),a[2]&&(s=s+100)),o=a[4]);let l="~",c=o;!o||o.length===0?(l="!=",c=""):/^\w*$/.test(c)?l="==":(a=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),a&&(l=a[1],c=a[2]));let u;if((l==="~"||l==="!~")&&/^(\w|\|)*$/.test(c)){const d=Y_e(c.split("|"),i.ignoreCase);u=function(h){return l==="~"?d(h):!d(h)}}else if(l==="@"||l==="!@"){const d=i[c];if(!d)throw Lr(i,"the @ match target '"+c+"' is not defined, in rule: "+e);if(!LSt(function(f){return typeof f=="string"},d))throw Lr(i,"the @ match target '"+c+"' must be an array of strings, in rule: "+e);const h=Y_e(d,i.ignoreCase);u=function(f){return l==="@"?h(f):!h(f)}}else if(l==="~"||l==="!~")if(c.indexOf("$")<0){const d=Ste(i,"^"+c+"$");u=function(h){return l==="~"?d.test(h):!d.test(h)}}else u=function(d,h,f,p){return Ste(i,"^"+oy(i,c,h,f,p)+"$").test(d)};else if(c.indexOf("$")<0){const d=zy(i,c);u=function(h){return l==="=="?h===d:h!==d}}else{const d=zy(i,c);u=function(h,f,p,g,m){const _=oy(i,d,f,p,g);return l==="=="?h===_:h!==_}}return s===-1?{name:n,value:r,test:function(d,h,f,p){return u(d,d,h,f,p)}}:{name:n,value:r,test:function(d,h,f,p){const g=ESt(d,h,f,s);return u(g||"",d,h,f,p)}}}function xte(i,e,n){if(n){if(typeof n=="string")return n;if(n.token||n.token===""){if(typeof n.token!="string")throw Lr(i,"a 'token' attribute must be of type string, in rule: "+e);{const r={token:n.token};if(n.token.indexOf("$")>=0&&(r.tokenSubst=!0),typeof n.bracket=="string")if(n.bracket==="@open")r.bracket=1;else if(n.bracket==="@close")r.bracket=-1;else throw Lr(i,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(n.next){if(typeof n.next!="string")throw Lr(i,"the next state must be a string value in rule: "+e);{let s=n.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!Wut(i,oy(i,s,"",[],""))))throw Lr(i,"the next state '"+n.next+"' is not defined in rule: "+e);r.next=s}}return typeof n.goBack=="number"&&(r.goBack=n.goBack),typeof n.switchTo=="string"&&(r.switchTo=n.switchTo),typeof n.log=="string"&&(r.log=n.log),typeof n.nextEmbedded=="string"&&(r.nextEmbedded=n.nextEmbedded,i.usesEmbedded=!0),r}}else if(Array.isArray(n)){const r=[];for(let s=0,o=n.length;s<o;s++)r[s]=xte(i,e,n[s]);return{group:r}}else if(n.cases){const r=[];for(const o in n.cases)if(n.cases.hasOwnProperty(o)){const a=xte(i,e,n.cases[o]);o==="@default"||o==="@"||o===""?r.push({test:void 0,value:a,name:o}):o==="@eos"?r.push({test:function(l,c,u,d){return d},value:a,name:o}):r.push(ISt(i,e,o,a))}const s=i.defaultToken;return{test:function(o,a,l,c){for(const u of r)if(!u.test||u.test(o,a,l,c))return u.value;return s}}}else throw Lr(i,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+e)}else return{token:""}}class TSt{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,n){let r;if(typeof n=="string")r=n;else if(n instanceof RegExp)r=n.source;else throw Lr(e,"rules must start with a match string or regular expression: "+this.name);this.matchOnlyAtLineStart=r.length>0&&r[0]==="^",this.name=this.name+": "+r,this.regex=Ste(e,"^(?:"+(this.matchOnlyAtLineStart?r.substr(1):r)+")")}setAction(e,n){this.action=xte(e,this.name,n)}}function sAe(i,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const n={};n.languageId=i,n.includeLF=x6(e.includeLF,!1),n.noThrow=!1,n.maxStack=100,n.start=typeof e.start=="string"?e.start:null,n.ignoreCase=x6(e.ignoreCase,!1),n.unicode=x6(e.unicode,!1),n.tokenPostfix=X_e(e.tokenPostfix,"."+n.languageId),n.defaultToken=X_e(e.defaultToken,"source"),n.usesEmbedded=!1;const r=e;r.languageId=i,r.includeLF=n.includeLF,r.ignoreCase=n.ignoreCase,r.unicode=n.unicode,r.noThrow=n.noThrow,r.usesEmbedded=n.usesEmbedded,r.stateNames=e.tokenizer,r.defaultToken=n.defaultToken;function s(a,l,c){for(const u of c){let d=u.include;if(d){if(typeof d!="string")throw Lr(n,"an 'include' attribute must be a string at: "+a);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Lr(n,"include target '"+d+"' is not defined at: "+a);s(a+"."+d,l,e.tokenizer[d])}else{const h=new TSt(a);if(Array.isArray(u)&&u.length>=1&&u.length<=3)if(h.setRegex(r,u[0]),u.length>=3)if(typeof u[1]=="string")h.setAction(r,{token:u[1],next:u[2]});else if(typeof u[1]=="object"){const f=u[1];f.next=u[2],h.setAction(r,f)}else throw Lr(n,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+a);else h.setAction(r,u[1]);else{if(!u.regex)throw Lr(n,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+a);u.name&&typeof u.name=="string"&&(h.name=u.name),u.matchOnlyAtStart&&(h.matchOnlyAtLineStart=x6(u.matchOnlyAtLineStart,!1)),h.setRegex(r,u.regex),h.setAction(r,u.action)}l.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Lr(n,"a language definition must define the 'tokenizer' attribute as an object");n.tokenizer=[];for(const a in e.tokenizer)if(e.tokenizer.hasOwnProperty(a)){n.start||(n.start=a);const l=e.tokenizer[a];n.tokenizer[a]=new Array,s("tokenizer."+a,n.tokenizer[a],l)}if(n.usesEmbedded=r.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Lr(n,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const a of e.brackets){let l=a;if(l&&Array.isArray(l)&&l.length===3&&(l={token:l[2],open:l[0],close:l[1]}),l.open===l.close)throw Lr(n,"open and close brackets in a 'brackets' attribute must be different: "+l.open+`
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof l.open=="string"&&typeof l.token=="string"&&typeof l.close=="string")o.push({token:l.token+n.tokenPostfix,open:zy(n,l.open),close:zy(n,l.close)});else throw Lr(n,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return n.brackets=o,n.noThrow=!0,n}var RSt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function ASt(i){PE.registerLanguage(i)}function NSt(){let i=[];return i=i.concat(PE.getLanguages()),i}function MSt(i){return un.get(Ar).languageIdCodec.encodeLanguageId(i)}function PSt(i,e){return un.withServices(()=>{const r=un.get(Ar).onDidRequestRichLanguageFeatures(s=>{s===i&&(r.dispose(),e())});return r})}function OSt(i,e){return un.withServices(()=>{const r=un.get(Ar).onDidRequestBasicLanguageFeatures(s=>{s===i&&(r.dispose(),e())});return r})}function FSt(i,e){if(!un.get(Ar).isRegisteredLanguageId(i))throw new Error(`Cannot set configuration for unknown language ${i}`);return un.get(dr).register(i,e,100)}class BSt{constructor(e,n){this._languageId=e,this._actual=n}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,n,r){if(typeof this._actual.tokenize=="function")return sO.adaptTokenize(this._languageId,this._actual,e,r);throw new Error("Not supported!")}tokenizeEncoded(e,n,r){const s=this._actual.tokenizeEncoded(e,r);return new ZW(s.tokens,s.endState)}}class sO{constructor(e,n,r,s){this._languageId=e,this._actual=n,this._languageService=r,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,n){const r=[];let s=0;for(let o=0,a=e.length;o<a;o++){const l=e[o];let c=l.startIndex;o===0?c=0:c<s&&(c=s),r[o]=new rP(c,l.scopes,n),s=c}return r}static adaptTokenize(e,n,r,s){const o=n.tokenize(r,s),a=sO._toClassicTokens(o.tokens,e);let l;return o.endState.equals(s)?l=s:l=o.endState,new Bse(a,l)}tokenize(e,n,r){return sO.adaptTokenize(this._languageId,this._actual,e,r)}_toBinaryTokens(e,n){const r=e.encodeLanguageId(this._languageId),s=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let a=0,l=0;for(let u=0,d=n.length;u<d;u++){const h=n[u],f=s.match(r,h.scopes)|1024;if(a>0&&o[a-1]===f)continue;let p=h.startIndex;u===0?p=0:p<l&&(p=l),o[a++]=p,o[a++]=f,l=p}const c=new Uint32Array(a);for(let u=0;u<a;u++)c[u]=o[u];return c}tokenizeEncoded(e,n,r){const s=this._actual.tokenize(e,r),o=this._toBinaryTokens(this._languageService.languageIdCodec,s.tokens);let a;return s.endState.equals(r)?a=r:a=s.endState,new ZW(o,a)}}function jSt(i){return typeof i.getInitialState=="function"}function WSt(i){return"tokenizeEncoded"in i}function oAe(i){return i&&typeof i.then=="function"}function $St(i){const e=un.get(bd);if(i){const n=[null];for(let r=1,s=i.length;r<s;r++)n[r]=Te.fromHex(i[r]);e.setColorMapOverride(n)}else e.setColorMapOverride(null)}function aAe(i,e){return WSt(e)?new BSt(i,e):new sO(i,e,un.get(Ar),un.get(bd))}function zae(i,e){const n=new vot(()=>RSt(this,void 0,void 0,function*(){const r=yield Promise.resolve(e.create());return r?jSt(r)?aAe(i,r):new wP(un.get(Ar),un.get(bd),i,sAe(i,r),un.get(ei)):null}));return Zr.registerFactory(i,n)}function zSt(i,e){if(!un.get(Ar).isRegisteredLanguageId(i))throw new Error(`Cannot set tokens provider for unknown language ${i}`);return oAe(e)?zae(i,{create:()=>e}):Zr.register(i,aAe(i,e))}function VSt(i,e){const n=r=>new wP(un.get(Ar),un.get(bd),i,sAe(i,r),un.get(ei));return oAe(e)?zae(i,{create:()=>e}):Zr.register(i,n(e))}function HSt(i,e){return un.get(Et).referenceProvider.register(i,e)}function USt(i,e){return un.get(Et).renameProvider.register(i,e)}function qSt(i,e){return un.get(Et).signatureHelpProvider.register(i,e)}function KSt(i,e){return un.get(Et).hoverProvider.register(i,{provideHover:(r,s,o)=>{const a=r.getWordAtPosition(s);return Promise.resolve(e.provideHover(r,s,o)).then(l=>{if(l)return!l.range&&a&&(l.range=new J(s.lineNumber,a.startColumn,s.lineNumber,a.endColumn)),l.range||(l.range=new J(s.lineNumber,s.column,s.lineNumber,s.column)),l})}})}function GSt(i,e){return un.get(Et).documentSymbolProvider.register(i,e)}function XSt(i,e){return un.get(Et).documentHighlightProvider.register(i,e)}function YSt(i,e){return un.get(Et).linkedEditingRangeProvider.register(i,e)}function ZSt(i,e){return un.get(Et).definitionProvider.register(i,e)}function QSt(i,e){return un.get(Et).implementationProvider.register(i,e)}function JSt(i,e){return un.get(Et).typeDefinitionProvider.register(i,e)}function ext(i,e){return un.get(Et).codeLensProvider.register(i,e)}function txt(i,e,n){return un.get(Et).codeActionProvider.register(i,{providedCodeActionKinds:n==null?void 0:n.providedCodeActionKinds,documentation:n==null?void 0:n.documentation,provideCodeActions:(s,o,a,l)=>{const u=un.get(h_).read({resource:s.uri}).filter(d=>J.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:u,only:a.only,trigger:a.trigger},l)},resolveCodeAction:e.resolveCodeAction})}function nxt(i,e){return un.get(Et).documentFormattingEditProvider.register(i,e)}function ixt(i,e){return un.get(Et).documentRangeFormattingEditProvider.register(i,e)}function rxt(i,e){return un.get(Et).onTypeFormattingEditProvider.register(i,e)}function sxt(i,e){return un.get(Et).linkProvider.register(i,e)}function oxt(i,e){return un.get(Et).completionProvider.register(i,e)}function axt(i,e){return un.get(Et).colorProvider.register(i,e)}function lxt(i,e){return un.get(Et).foldingRangeProvider.register(i,e)}function cxt(i,e){return un.get(Et).declarationProvider.register(i,e)}function uxt(i,e){return un.get(Et).selectionRangeProvider.register(i,e)}function dxt(i,e){return un.get(Et).documentSemanticTokensProvider.register(i,e)}function hxt(i,e){return un.get(Et).documentRangeSemanticTokensProvider.register(i,e)}function fxt(i,e){return un.get(Et).inlineCompletionsProvider.register(i,e)}function pxt(i,e){return un.get(Et).inlayHintsProvider.register(i,e)}function gxt(){return{register:ASt,getLanguages:NSt,onLanguage:PSt,onLanguageEncountered:OSt,getEncodedLanguageId:MSt,setLanguageConfiguration:FSt,setColorMap:$St,registerTokensProviderFactory:zae,setTokensProvider:zSt,setMonarchTokensProvider:VSt,registerReferenceProvider:HSt,registerRenameProvider:USt,registerCompletionItemProvider:oxt,registerSignatureHelpProvider:qSt,registerHoverProvider:KSt,registerDocumentSymbolProvider:GSt,registerDocumentHighlightProvider:XSt,registerLinkedEditingRangeProvider:YSt,registerDefinitionProvider:ZSt,registerImplementationProvider:QSt,registerTypeDefinitionProvider:JSt,registerCodeLensProvider:ext,registerCodeActionProvider:txt,registerDocumentFormattingEditProvider:nxt,registerDocumentRangeFormattingEditProvider:ixt,registerOnTypeFormattingEditProvider:rxt,registerLinkProvider:sxt,registerColorProvider:axt,registerFoldingRangeProvider:lxt,registerDeclarationProvider:cxt,registerSelectionRangeProvider:uxt,registerDocumentSemanticTokensProvider:dxt,registerDocumentRangeSemanticTokensProvider:hxt,registerInlineCompletionsProvider:fxt,registerInlayHintsProvider:pxt,DocumentHighlightKind:SQ,CompletionItemKind:_Q,CompletionItemTag:vQ,CompletionItemInsertTextRule:mQ,SymbolKind:KQ,SymbolTag:GQ,IndentAction:IQ,CompletionTriggerKind:bQ,SignatureHelpTriggerKind:qQ,InlayHintKind:RQ,InlineCompletionTriggerKind:AQ,CodeActionTriggerType:gQ,FoldingRangeKind:Wl,SelectedSuggestionInfo:U2e}}const Vae=qn("IEditorCancelService"),lAe=new yt("cancellableOperation",!1,L("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));oi(Vae,class{constructor(){this._tokens=new WeakMap}add(i,e){let n=this._tokens.get(i);n||(n=i.invokeWithinContext(s=>{const o=lAe.bindTo(s.get(mn)),a=new jl;return{key:o,tokens:a}}),this._tokens.set(i,n));let r;return n.key.set(!0),r=n.tokens.push(e),()=>{r&&(r(),n.key.set(!n.tokens.isEmpty()),r=void 0)}}cancel(i){const e=this._tokens.get(i);if(!e)return;const n=e.tokens.pop();n&&(n.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class mxt extends Ns{constructor(e,n){super(n),this.editor=e,this._unregister=e.invokeWithinContext(r=>r.get(Vae).add(e,this))}dispose(){this._unregister(),super.dispose()}}ct(new class extends Ho{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:lAe})}runEditorCommand(i,e){i.get(Vae).cancel(e)}});let cAe=class kte{constructor(e,n){if(this.flags=n,(this.flags&1)!==0){const r=e.getModel();this.modelVersionId=r?ox("{0}#{1}",r.uri.toString(),r.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof kte))return!1;const n=e;return!(this.modelVersionId!==n.modelVersionId||this.scrollLeft!==n.scrollLeft||this.scrollTop!==n.scrollTop||!this.position&&n.position||this.position&&!n.position||this.position&&n.position&&!this.position.equals(n.position)||!this.selection&&n.selection||this.selection&&!n.selection||this.selection&&n.selection&&!this.selection.equalsRange(n.selection))}validate(e){return this._equals(new kte(e,this.flags))}};class x1 extends mxt{constructor(e,n,r,s){super(e,s),this._listener=new Xe,n&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!r||!J.containsPosition(r,o.position))&&this.cancel()})),n&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!r||!J.containsRange(r,o.selection))&&this.cancel()})),n&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),n&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class Hae extends Ns{constructor(e,n){super(n),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function n_(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===I5.ICodeEditor:!1}function uAe(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===I5.IDiffEditor:!1}function _xt(i){return!!i&&typeof i=="object"&&typeof i.onDidChangeActiveEditor=="function"}function dAe(i){return n_(i)?i:uAe(i)?i.getModifiedEditor():_xt(i)&&n_(i.activeCodeEditor)?i.activeCodeEditor:null}class tI{static _handleEolEdits(e,n){let r;const s=[];for(const o of n)typeof o.eol=="number"&&(r=o.eol),o.range&&typeof o.text=="string"&&s.push(o);return typeof r=="number"&&e.hasModel()&&e.getModel().pushEOL(r),s}static _isFullModelReplaceEdit(e,n){if(!e.hasModel())return!1;const r=e.getModel(),s=r.validateRange(n.range);return r.getFullModelRange().equalsRange(s)}static execute(e,n,r){r&&e.pushUndoStop();const s=Qp.capture(e),o=tI._handleEolEdits(e,n);o.length===1&&tI._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(a=>Vr.replace(J.lift(a.range),a.text))):e.executeEdits("formatEditsCommand",o.map(a=>Vr.replaceMove(J.lift(a.range),a.text))),r&&e.pushUndoStop(),s.restoreRelativeVerticalPositionOfCursor(e)}}class Z_e{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class vxt{constructor(e){if(this._set=new Set,e)for(const n of e)this.add(n)}add(e){this._set.add(Z_e.toKey(e))}has(e){return this._set.has(Z_e.toKey(e))}}var Jp=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function Uae(i){if(i=i.filter(s=>s.range),!i.length)return;let{range:e}=i[0];for(let s=1;s<i.length;s++)e=J.plusRange(e,i[s].range);const{startLineNumber:n,endLineNumber:r}=e;n===r?i.length===1?Ua(L("hint11","Made 1 formatting edit on line {0}",n)):Ua(L("hintn1","Made {0} formatting edits on line {1}",i.length,n)):i.length===1?Ua(L("hint1n","Made 1 formatting edit between lines {0} and {1}",n,r)):Ua(L("hintnn","Made {0} formatting edits between lines {1} and {2}",i.length,n,r))}function hAe(i,e,n){const r=[],s=new vxt,o=i.ordered(n);for(const l of o)r.push(l),l.extensionId&&s.add(l.extensionId);const a=e.ordered(n);for(const l of a){if(l.extensionId){if(s.has(l.extensionId))continue;s.add(l.extensionId)}r.push({displayName:l.displayName,extensionId:l.extensionId,provideDocumentFormattingEdits(c,u,d){return l.provideDocumentRangeFormattingEdits(c,c.getFullModelRange(),u,d)}})}return r}class wx{static setFormatterSelector(e){return{dispose:wx._selectors.unshift(e)}}static select(e,n,r){return Jp(this,void 0,void 0,function*(){if(e.length===0)return;const s=Vn.first(wx._selectors);if(s)return yield s(e,n,r)})}}wx._selectors=new jl;function fAe(i,e,n,r,s,o){return Jp(this,void 0,void 0,function*(){const a=i.get(hn),{documentRangeFormattingEditProvider:l}=i.get(Et),c=n_(e)?e.getModel():e,u=l.ordered(c),d=yield wx.select(u,c,r);d&&(s.report(d),yield a.invokeFunction(bxt,d,e,n,o))})}function bxt(i,e,n,r,s){var o,a;return Jp(this,void 0,void 0,function*(){const l=i.get(Wf),c=i.get(vd);let u,d;n_(n)?(u=n.getModel(),d=new x1(n,5,void 0,s)):(u=n,d=new Hae(n,s));const h=[];let f=0;for(const b of Lse(r).sort(J.compareRangesUsingStarts))f>0&&J.areIntersectingOrTouching(h[f-1],b)?h[f-1]=J.fromPositions(h[f-1].getStartPosition(),b.getEndPosition()):f=h.push(b);const p=b=>Jp(this,void 0,void 0,function*(){var y,x;c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(y=e.extensionId)===null||y===void 0?void 0:y.value,b);const k=(yield e.provideDocumentRangeFormattingEdits(u,b,u.getFormattingOptions(),d.token))||[];return c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(x=e.extensionId)===null||x===void 0?void 0:x.value,k),k}),g=(b,y)=>{if(!b.length||!y.length)return!1;const x=b.reduce((k,D)=>J.plusRange(k,D.range),b[0].range);if(!y.some(k=>J.intersectRanges(x,k.range)))return!1;for(const k of b)for(const D of y)if(J.intersectRanges(k.range,D.range))return!0;return!1},m=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(o=e.extensionId)===null||o===void 0?void 0:o.value,h);const b=(yield e.provideDocumentRangesFormattingEdits(u,h,u.getFormattingOptions(),d.token))||[];c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(a=e.extensionId)===null||a===void 0?void 0:a.value,b),_.push(b)}else{for(const b of h){if(d.token.isCancellationRequested)return!0;_.push(yield p(b))}for(let b=0;b<h.length;++b)for(let y=b+1;y<h.length;++y){if(d.token.isCancellationRequested)return!0;if(g(_[b],_[y])){const x=J.plusRange(h[b],h[y]),k=yield p(x);h.splice(y,1),h.splice(b,1),h.push(x),_.splice(y,1),_.splice(b,1),_.push(k),b=0,y=0}}}for(const b of _){if(d.token.isCancellationRequested)return!0;const y=yield l.computeMoreMinimalEdits(u.uri,b);y&&m.push(...y)}}finally{d.dispose()}if(m.length===0)return!1;if(n_(n))tI.execute(n,m,!0),Uae(m),n.revealPositionInCenterIfOutsideViewport(n.getPosition(),1);else{const[{range:b}]=m,y=new Ft(b.startLineNumber,b.startColumn,b.endLineNumber,b.endColumn);u.pushEditOperations([y],m.map(x=>({text:x.text,range:J.lift(x.range),forceMoveMarkers:!0})),x=>{for(const{range:k}of x)if(J.areIntersectingOrTouching(k,y))return[new Ft(k.startLineNumber,k.startColumn,k.endLineNumber,k.endColumn)];return null})}return!0})}function yxt(i,e,n,r,s){return Jp(this,void 0,void 0,function*(){const o=i.get(hn),a=i.get(Et),l=n_(e)?e.getModel():e,c=hAe(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),u=yield wx.select(c,l,n);u&&(r.report(u),yield o.invokeFunction(wxt,u,e,n,s))})}function wxt(i,e,n,r,s){return Jp(this,void 0,void 0,function*(){const o=i.get(Wf);let a,l;n_(n)?(a=n.getModel(),l=new x1(n,5,void 0,s)):(a=n,l=new Hae(n,s));let c;try{const u=yield e.provideDocumentFormattingEdits(a,a.getFormattingOptions(),l.token);if(c=yield o.computeMoreMinimalEdits(a.uri,u),l.token.isCancellationRequested)return!0}finally{l.dispose()}if(!c||c.length===0)return!1;if(n_(n))tI.execute(n,c,r!==2),r!==2&&(Uae(c),n.revealPositionInCenterIfOutsideViewport(n.getPosition(),1));else{const[{range:u}]=c,d=new Ft(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);a.pushEditOperations([d],c.map(h=>({text:h.text,range:J.lift(h.range),forceMoveMarkers:!0})),h=>{for(const{range:f}of h)if(J.areIntersectingOrTouching(f,d))return[new Ft(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)];return null})}return!0})}function Cxt(i,e,n,r,s,o){return Jp(this,void 0,void 0,function*(){const a=e.documentRangeFormattingEditProvider.ordered(n);for(const l of a){const c=yield Promise.resolve(l.provideDocumentRangeFormattingEdits(n,r,s,o)).catch(Us);if(Ka(c))return yield i.computeMoreMinimalEdits(n.uri,c)}})}function Sxt(i,e,n,r,s){return Jp(this,void 0,void 0,function*(){const o=hAe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,n);for(const a of o){const l=yield Promise.resolve(a.provideDocumentFormattingEdits(n,r,s)).catch(Us);if(Ka(l))return yield i.computeMoreMinimalEdits(n.uri,l)}})}function pAe(i,e,n,r,s,o,a){const l=e.onTypeFormattingEditProvider.ordered(n);return l.length===0||l[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(l[0].provideOnTypeFormattingEdits(n,r,s,o,a)).catch(Us).then(c=>i.computeMoreMinimalEdits(n.uri,c))}si.registerCommand("_executeFormatRangeProvider",function(i,...e){return Jp(this,void 0,void 0,function*(){const[n,r,s]=e;Ui(Jt.isUri(n)),Ui(J.isIRange(r));const o=i.get(Ec),a=i.get(Wf),l=i.get(Et),c=yield o.createModelReference(n);try{return Cxt(a,l,c.object.textEditorModel,J.lift(r),s,Hn.None)}finally{c.dispose()}})});si.registerCommand("_executeFormatDocumentProvider",function(i,...e){return Jp(this,void 0,void 0,function*(){const[n,r]=e;Ui(Jt.isUri(n));const s=i.get(Ec),o=i.get(Wf),a=i.get(Et),l=yield s.createModelReference(n);try{return Sxt(o,a,l.object.textEditorModel,r,Hn.None)}finally{l.dispose()}})});si.registerCommand("_executeFormatOnTypeProvider",function(i,...e){return Jp(this,void 0,void 0,function*(){const[n,r,s,o]=e;Ui(Jt.isUri(n)),Ui(ve.isIPosition(r)),Ui(typeof s=="string");const a=i.get(Ec),l=i.get(Wf),c=i.get(Et),u=yield a.createModelReference(n);try{return pAe(l,c,u.object.textEditorModel,ve.lift(r),s,o,Hn.None)}finally{u.dispose()}})});rg.wrappingIndent.defaultValue=0;rg.glyphMargin.defaultValue=!1;rg.autoIndent.defaultValue=3;rg.overviewRulerLanes.defaultValue=2;wx.setFormatterSelector((i,e,n)=>Promise.resolve(i[0]));const Gl=q2e();Gl.editor=kSt();Gl.languages=gxt();const gAe=Gl.CancellationTokenSource,mAe=Gl.Emitter,_Ae=Gl.KeyCode,vAe=Gl.KeyMod,bAe=Gl.Position,yAe=Gl.Range,wAe=Gl.Selection,CAe=Gl.SelectionDirection,SAe=Gl.MarkerSeverity,xAe=Gl.MarkerTag,kAe=Gl.Uri,LAe=Gl.Token,DAe=Gl.editor,EAe=Gl.languages,lK=globalThis.MonacoEnvironment;(lK!=null&&lK.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Gl);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const Z5=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:gAe,Emitter:mAe,KeyCode:_Ae,KeyMod:vAe,MarkerSeverity:SAe,MarkerTag:xAe,Position:bAe,Range:yAe,Selection:wAe,SelectionDirection:CAe,Token:LAe,Uri:kAe,editor:DAe,languages:EAe},Symbol.toStringTag,{value:"Module"})),xxt="modulepreload",kxt=function(i){return"/dashboard/"+i},Q_e={},zt=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=a(n.map(u=>{if(u=kxt(u),u in Q_e)return;Q_e[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":xxt,d||(f.as="script"),f.crossOrigin="",f.href=u,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,g)=>{f.addEventListener("load",p),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&o(l.reason);return e().catch(o)})};/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Lxt=Object.defineProperty,Dxt=Object.getOwnPropertyDescriptor,Ext=Object.getOwnPropertyNames,Ixt=Object.prototype.hasOwnProperty,Txt=(i,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ext(e))!Ixt.call(i,s)&&s!==n&&Lxt(i,s,{get:()=>e[s],enumerable:!(r=Dxt(e,s))||r.enumerable});return i},Rxt=(i,e,n)=>(Txt(i,e,"default"),n),wN={};Rxt(wN,Z5);var IAe={},cK={},TAe=class{constructor(i){xt(this,"_languageId");xt(this,"_loadingTriggered");xt(this,"_lazyLoadPromise");xt(this,"_lazyLoadPromiseResolve");xt(this,"_lazyLoadPromiseReject");this._languageId=i,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,n)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=n})}static getOrCreate(i){return cK[i]||(cK[i]=new TAe(i)),cK[i]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,IAe[this._languageId].loader().then(i=>this._lazyLoadPromiseResolve(i),i=>this._lazyLoadPromiseReject(i))),this._lazyLoadPromise}};function Gt(i){const e=i.id;IAe[e]=i,wN.languages.register(i);const n=TAe.getOrCreate(e);wN.languages.registerTokensProviderFactory(e,{create:async()=>(await n.load()).language}),wN.languages.onLanguageEncountered(e,async()=>{const r=await n.load();wN.languages.setLanguageConfiguration(e,r.conf)})}Gt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>zt(()=>import("./abap-Bs-KDgo-.js"),[])});Gt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>zt(()=>import("./apex-BB8ijgrA.js"),[])});Gt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>zt(()=>import("./azcli-CM0y7Ame.js"),[])});Gt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>zt(()=>import("./bat-Bfxf8Mzl.js"),[])});Gt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>zt(()=>import("./bicep-DJPqIr_M.js"),[])});Gt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>zt(()=>import("./cameligo-PnszTm2c.js"),[])});Gt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>zt(()=>import("./clojure-B3cFVYI-.js"),[])});Gt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>zt(()=>import("./coffee-D8tSzcLH.js"),[])});Gt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>zt(()=>import("./cpp-CP-cATHl.js"),[])});Gt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>zt(()=>import("./cpp-CP-cATHl.js"),[])});Gt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>zt(()=>import("./csharp-Dfj4WFqy.js"),[])});Gt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>zt(()=>import("./csp-D9HxVpWn.js"),[])});Gt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>zt(()=>import("./css-CkCHETKw.js"),[])});Gt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>zt(()=>import("./cypher-B50w5pq9.js"),[])});Gt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>zt(()=>import("./dart-DvROnYA_.js"),[])});Gt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>zt(()=>import("./dockerfile-C4f37Dvd.js"),[])});Gt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>zt(()=>import("./ecl-DW46Dzft.js"),[])});Gt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>zt(()=>import("./elixir-BIa5JtGe.js"),[])});Gt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>zt(()=>import("./flow9-ByI4Scwv.js"),[])});Gt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>zt(()=>import("./fsharp-Cgf6u04w.js"),[])});Gt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>zt(()=>import("./freemarker2-BmkYHwKA.js"),[]).then(i=>i.TagAutoInterpolationDollar)});Gt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>zt(()=>import("./freemarker2-BmkYHwKA.js"),[]).then(i=>i.TagAngleInterpolationDollar)});Gt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>zt(()=>import("./freemarker2-BmkYHwKA.js"),[]).then(i=>i.TagBracketInterpolationDollar)});Gt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>zt(()=>import("./freemarker2-BmkYHwKA.js"),[]).then(i=>i.TagAngleInterpolationBracket)});Gt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>zt(()=>import("./freemarker2-BmkYHwKA.js"),[]).then(i=>i.TagBracketInterpolationBracket)});Gt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>zt(()=>import("./freemarker2-BmkYHwKA.js"),[]).then(i=>i.TagAutoInterpolationDollar)});Gt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>zt(()=>import("./freemarker2-BmkYHwKA.js"),[]).then(i=>i.TagAutoInterpolationBracket)});Gt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>zt(()=>import("./go-CJfxPkej.js"),[])});Gt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>zt(()=>import("./graphql-CGlhcY2-.js"),[])});Gt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>zt(()=>import("./handlebars-ClKa4v-T.js"),[])});Gt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>zt(()=>import("./hcl-CTI7WNlW.js"),[])});Gt({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>zt(()=>import("./html-BH1s8kBD.js"),[])});Gt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>zt(()=>import("./ini-qJXHXiTY.js"),[])});Gt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>zt(()=>import("./java-Dnrl9822.js"),[])});Gt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>zt(()=>import("./javascript-C7a4RI8G.js"),__vite__mapDeps([0,1]))});Gt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>zt(()=>import("./julia-pqMLycLG.js"),[])});Gt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>zt(()=>import("./kotlin-DLX697jv.js"),[])});Gt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>zt(()=>import("./less-2ExdFhZM.js"),[])});Gt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>zt(()=>import("./lexon-ABKfEwhw.js"),[])});Gt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>zt(()=>import("./lua-CI0blgFs.js"),[])});Gt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>zt(()=>import("./liquid-CaPMVtxC.js"),[])});Gt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>zt(()=>import("./m3-yVPEHiu4.js"),[])});Gt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>zt(()=>import("./markdown-CjOKAnMy.js"),[])});Gt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>zt(()=>import("./mdx-gYledG3t.js"),[])});Gt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>zt(()=>import("./mips-B7KWClFm.js"),[])});Gt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>zt(()=>import("./msdax-N_40gjXO.js"),[])});Gt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>zt(()=>import("./mysql-CzgTwwi2.js"),[])});Gt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>zt(()=>import("./objective-c-CwAIQX-6.js"),[])});Gt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>zt(()=>import("./pascal-3SrKWnFX.js"),[])});Gt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>zt(()=>import("./pascaligo-Cv9Y0fbC.js"),[])});Gt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>zt(()=>import("./perl-DHxnJL0_.js"),[])});Gt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>zt(()=>import("./pgsql-DGJFw0qd.js"),[])});Gt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>zt(()=>import("./php-BA3Rqjpx.js"),[])});Gt({id:"pla",extensions:[".pla"],loader:()=>zt(()=>import("./pla-DKf5_u7N.js"),[])});Gt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>zt(()=>import("./postiats-Bup1kUyj.js"),[])});Gt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>zt(()=>import("./powerquery-BfbPeLER.js"),[])});Gt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>zt(()=>import("./powershell-DAsS7BG8.js"),[])});Gt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>zt(()=>import("./protobuf-Dzs34GPr.js"),[])});Gt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>zt(()=>import("./pug-CVuUMJ1K.js"),[])});Gt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>zt(()=>import("./python-Ddgi4jcf.js"),[])});Gt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>zt(()=>import("./qsharp-BgY1GbL_.js"),[])});Gt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>zt(()=>import("./r-C2Iz-cGs.js"),[])});Gt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>zt(()=>import("./razor-DDCHVRqO.js"),[])});Gt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>zt(()=>import("./redis-F7UxdB6U.js"),[])});Gt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>zt(()=>import("./redshift-CDF44XVS.js"),[])});Gt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>zt(()=>import("./restructuredtext-C_dzeD_4.js"),[])});Gt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>zt(()=>import("./ruby-BdxlVRg3.js"),[])});Gt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>zt(()=>import("./rust-gU8692nP.js"),[])});Gt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>zt(()=>import("./sb-CsAkPjmq.js"),[])});Gt({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>zt(()=>import("./scala-D_TH4Qyk.js"),[])});Gt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>zt(()=>import("./scheme-CTXRt_ZJ.js"),[])});Gt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>zt(()=>import("./scss-Rf_ppwBg.js"),[])});Gt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>zt(()=>import("./shell-osqRiq1b.js"),[])});Gt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>zt(()=>import("./solidity-BTHmi1CB.js"),[])});Gt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>zt(()=>import("./sophia-BRe4RArb.js"),[])});Gt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>zt(()=>import("./sparql-CaSv-uNl.js"),[])});Gt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>zt(()=>import("./sql-CHiRcria.js"),[])});Gt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>zt(()=>import("./st-CCGZ7KTi.js"),[])});Gt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>zt(()=>import("./swift-DeyDsJzf.js"),[])});Gt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>zt(()=>import("./systemverilog-RSGMMa-l.js"),[])});Gt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>zt(()=>import("./systemverilog-RSGMMa-l.js"),[])});Gt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>zt(()=>import("./tcl-B28K5YOH.js"),[])});Gt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>zt(()=>import("./twig-ChoE7Tfw.js"),[])});Gt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>zt(()=>import("./typescript-Jd3ZmU9m.js"),[])});Gt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>zt(()=>import("./vb-BCnlgLOU.js"),[])});Gt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>zt(()=>import("./wgsl-DlxrJ_uh.js"),[])});Gt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>zt(()=>import("./xml-DRiRd1Ut.js"),[])});Gt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>zt(()=>import("./yaml-CBhHykcq.js"),[])});/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Axt=Object.defineProperty,Nxt=Object.getOwnPropertyDescriptor,Mxt=Object.getOwnPropertyNames,Pxt=Object.prototype.hasOwnProperty,Oxt=(i,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Mxt(e))!Pxt.call(i,s)&&s!==n&&Axt(i,s,{get:()=>e[s],enumerable:!(r=Nxt(e,s))||r.enumerable});return i},Fxt=(i,e,n)=>(Oxt(i,e,"default"),n),KI={};Fxt(KI,Z5);var qae=class{constructor(e,n,r){xt(this,"_onDidChange",new KI.Emitter);xt(this,"_options");xt(this,"_modeConfiguration");xt(this,"_languageId");this._languageId=e,this.setOptions(n),this.setModeConfiguration(r)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Kae={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},Gae={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},RAe=new qae("css",Kae,Gae),AAe=new qae("scss",Kae,Gae),NAe=new qae("less",Kae,Gae);KI.languages.css={cssDefaults:RAe,lessDefaults:NAe,scssDefaults:AAe};function Xae(){return zt(()=>import("./cssMode-Ca5s3ClJ.js"),[])}KI.languages.onLanguage("less",()=>{Xae().then(i=>i.setupMode(NAe))});KI.languages.onLanguage("scss",()=>{Xae().then(i=>i.setupMode(AAe))});KI.languages.onLanguage("css",()=>{Xae().then(i=>i.setupMode(RAe))});/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Bxt=Object.defineProperty,jxt=Object.getOwnPropertyDescriptor,Wxt=Object.getOwnPropertyNames,$xt=Object.prototype.hasOwnProperty,zxt=(i,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Wxt(e))!$xt.call(i,s)&&s!==n&&Bxt(i,s,{get:()=>e[s],enumerable:!(r=jxt(e,s))||r.enumerable});return i},Vxt=(i,e,n)=>(zxt(i,e,"default"),n),dz={};Vxt(dz,Z5);var Hxt=class{constructor(e,n,r){xt(this,"_onDidChange",new dz.Emitter);xt(this,"_options");xt(this,"_modeConfiguration");xt(this,"_languageId");this._languageId=e,this.setOptions(n),this.setModeConfiguration(r)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Uxt={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},hz={format:Uxt,suggest:{},data:{useDefaultDataProvider:!0}};function fz(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===bM,documentFormattingEdits:i===bM,documentRangeFormattingEdits:i===bM}}var bM="html",J_e="handlebars",e0e="razor",MAe=pz(bM,hz,fz(bM)),qxt=MAe.defaults,PAe=pz(J_e,hz,fz(J_e)),Kxt=PAe.defaults,OAe=pz(e0e,hz,fz(e0e)),Gxt=OAe.defaults;dz.languages.html={htmlDefaults:qxt,razorDefaults:Gxt,handlebarDefaults:Kxt,htmlLanguageService:MAe,handlebarLanguageService:PAe,razorLanguageService:OAe,registerHTMLLanguageService:pz};function Xxt(){return zt(()=>import("./htmlMode-CmKaoTJQ.js"),[])}function pz(i,e=hz,n=fz(i)){const r=new Hxt(i,e,n);let s;const o=dz.languages.onLanguage(i,async()=>{s=(await Xxt()).setupMode(r)});return{defaults:r,dispose(){o.dispose(),s==null||s.dispose(),s=void 0}}}/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Yxt=Object.defineProperty,Zxt=Object.getOwnPropertyDescriptor,Qxt=Object.getOwnPropertyNames,Jxt=Object.prototype.hasOwnProperty,ekt=(i,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Qxt(e))!Jxt.call(i,s)&&s!==n&&Yxt(i,s,{get:()=>e[s],enumerable:!(r=Zxt(e,s))||r.enumerable});return i},tkt=(i,e,n)=>(ekt(i,e,"default"),n),Q5={};tkt(Q5,Z5);var nkt=class{constructor(e,n,r){xt(this,"_onDidChange",new Q5.Emitter);xt(this,"_diagnosticsOptions");xt(this,"_modeConfiguration");xt(this,"_languageId");this._languageId=e,this.setDiagnosticsOptions(n),this.setModeConfiguration(r)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},ikt={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},rkt={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},FAe=new nkt("json",ikt,rkt);Q5.languages.json={jsonDefaults:FAe};function skt(){return zt(()=>import("./jsonMode-LvqRkjE1.js"),[])}Q5.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Q5.languages.onLanguage("json",()=>{skt().then(i=>i.setupMode(FAe))});/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var okt=Object.defineProperty,akt=Object.getOwnPropertyDescriptor,lkt=Object.getOwnPropertyNames,ckt=Object.prototype.hasOwnProperty,ukt=(i,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lkt(e))!ckt.call(i,s)&&s!==n&&okt(i,s,{get:()=>e[s],enumerable:!(r=akt(e,s))||r.enumerable});return i},dkt=(i,e,n)=>(ukt(i,e,"default"),n),hkt="5.0.2",nI={};dkt(nI,Z5);var BAe=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(BAe||{}),jAe=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(jAe||{}),WAe=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(WAe||{}),$Ae=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))($Ae||{}),zAe=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(zAe||{}),VAe=class{constructor(i,e,n,r,s){xt(this,"_onDidChange",new nI.Emitter);xt(this,"_onDidExtraLibsChange",new nI.Emitter);xt(this,"_extraLibs");xt(this,"_removedExtraLibs");xt(this,"_eagerModelSync");xt(this,"_compilerOptions");xt(this,"_diagnosticsOptions");xt(this,"_workerOptions");xt(this,"_onDidExtraLibsChangeTimeout");xt(this,"_inlayHintsOptions");xt(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(n),this.setInlayHintsOptions(r),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(i,e){let n;if(typeof e>"u"?n=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:n=e,this._extraLibs[n]&&this._extraLibs[n].content===i)return{dispose:()=>{}};let r=1;return this._removedExtraLibs[n]&&(r=this._removedExtraLibs[n]+1),this._extraLibs[n]&&(r=this._extraLibs[n].version+1),this._extraLibs[n]={content:i,version:r},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[n];s&&s.version===r&&(delete this._extraLibs[n],this._removedExtraLibs[n]=r,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const n=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,r=e.content;let s=1;this._removedExtraLibs[n]&&(s=this._removedExtraLibs[n]+1),this._extraLibs[n]={content:r,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},fkt=hkt,HAe={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},UAe=new VAe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},HAe),qAe=new VAe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},HAe),pkt=()=>gz().then(i=>i.getTypeScriptWorker()),gkt=()=>gz().then(i=>i.getJavaScriptWorker());nI.languages.typescript={ModuleKind:BAe,JsxEmit:jAe,NewLineKind:WAe,ScriptTarget:$Ae,ModuleResolutionKind:zAe,typescriptVersion:fkt,typescriptDefaults:UAe,javascriptDefaults:qAe,getTypeScriptWorker:pkt,getJavaScriptWorker:gkt};function gz(){return zt(()=>import("./tsMode-DYDGR6Xc.js"),[])}nI.languages.onLanguage("typescript",()=>gz().then(i=>i.setupTypeScript(UAe)));nI.languages.onLanguage("javascript",()=>gz().then(i=>i.setupJavaScript(qAe)));class mkt extends md{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:L("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:lt.map,toggled:ze.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ze.has("isInDiffEditor"),menu:{when:ze.has("isInDiffEditor"),id:se.EditorTitle,order:22,group:"navigation"}})}run(e,...n){const r=e.get(ei),s=!r.getValue("diffEditor.hideUnchangedRegions.enabled");r.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}Ir(mkt);class KAe extends md{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:L("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:ze.has("isInDiffEditor")})}run(e,...n){const r=e.get(ei),s=!r.getValue("diffEditor.experimental.showMoves");r.updateValue("diffEditor.experimental.showMoves",s)}}Ir(KAe);class GAe extends md{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:L("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:ze.has("isInDiffEditor")})}run(e,...n){const r=e.get(ei),s=!r.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");r.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}Ir(GAe);sa.appendMenuItem(se.EditorTitle,{command:{id:new GAe().desc.id,title:L("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ze.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ze.has("isInDiffEditor")},order:11,group:"1_diff",when:ze.and(oe.diffEditorRenderSideBySideInlineBreakpointReached,ze.has("isInDiffEditor"))});sa.appendMenuItem(se.EditorTitle,{command:{id:new KAe().desc.id,title:L("showMoves","Show Moved Code Blocks"),icon:lt.move,toggled:OI.create("config.diffEditor.experimental.showMoves",!0),precondition:ze.has("isInDiffEditor")},order:10,group:"1_diff",when:ze.has("isInDiffEditor")});const mz={value:L("diffEditor","Diff Editor"),original:"Diff Editor"};class _kt extends og{constructor(){super({id:"diffEditor.switchSide",title:{value:L("switchSide","Switch Side"),original:"Switch Side"},icon:lt.arrowSwap,precondition:ze.has("isInDiffEditor"),f1:!0,category:mz})}runEditorCommand(e,n,r){const s=XI(e);if(s instanceof yx){if(r&&r.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}Ir(_kt);class vkt extends og{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:L("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:lt.close,precondition:oe.comparingMovedCode,f1:!1,category:mz,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,n,...r){const s=XI(e);s instanceof yx&&s.exitCompareMove()}}Ir(vkt);class bkt extends og{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:L("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:lt.fold,precondition:ze.has("isInDiffEditor"),f1:!0,category:mz})}runEditorCommand(e,n,...r){const s=XI(e);s instanceof yx&&s.collapseAllUnchangedRegions()}}Ir(bkt);class ykt extends og{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:L("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:lt.unfold,precondition:ze.has("isInDiffEditor"),f1:!0,category:mz})}runEditorCommand(e,n,...r){const s=XI(e);s instanceof yx&&s.showAllUnchangedRegions()}}Ir(ykt);const XAe={value:L("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class GI extends md{constructor(){super({id:GI.id,title:{value:L("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:XAe,precondition:ze.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const n=XI(e);n==null||n.accessibleDiffViewerNext()}}GI.id="editor.action.accessibleDiffViewer.next";sa.appendMenuItem(se.EditorTitle,{command:{id:GI.id,title:L("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ze.has("isInDiffEditor")},order:10,group:"2_diff",when:ze.and(oe.accessibleDiffViewerVisible.negate(),ze.has("isInDiffEditor"))});class J5 extends md{constructor(){super({id:J5.id,title:{value:L("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:XAe,precondition:ze.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const n=XI(e);n==null||n.accessibleDiffViewerPrev()}}J5.id="editor.action.accessibleDiffViewer.prev";function XI(i){var e;const n=i.get(Si),r=n.listDiffEditors(),s=(e=n.getFocusedCodeEditor())!==null&&e!==void 0?e:n.getActiveCodeEditor();if(!s)return null;for(let a=0,l=r.length;a<l;a++){const c=r[a];if(c.getModifiedEditor().getId()===s.getId()||c.getOriginalEditor().getId()===s.getId())return c}const o=xf();if(o)for(const a of r){const l=a.getContainerDomNode();if(wkt(l,o))return a}return null}function wkt(i,e){let n=e;for(;n;){if(n===i)return!0;n=n.parentElement}return!1}si.registerCommandAlias("editor.action.diffReview.next",GI.id);Ir(GI);si.registerCommandAlias("editor.action.diffReview.prev",J5.id);Ir(J5);var Ckt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Skt=function(i,e){return function(n,r){e(n,r,i)}},_z=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},Lte;const vz=new yt("selectionAnchorSet",!1);let Tv=Lte=class{static get(e){return e.getContribution(Lte.ID)}constructor(e,n){this.editor=e,this.selectionAnchorSetContextKey=vz.bindTo(n),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(n=>{this.decorationId&&n.removeDecoration(this.decorationId),this.decorationId=n.addDecoration(Ft.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Ea().appendText(L("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ua(L("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const n=this.editor.getPosition();this.editor.setSelection(Ft.fromPositions(e.getStartPosition(),n)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(n=>{n.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Tv.ID="editor.contrib.selectionAnchorController";Tv=Lte=Ckt([Skt(1,mn)],Tv);class xkt extends kt{constructor(){super({id:"editor.action.setSelectionAnchor",label:L("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2080),weight:100}})}run(e,n){var r;return _z(this,void 0,void 0,function*(){(r=Tv.get(n))===null||r===void 0||r.setSelectionAnchor()})}}class kkt extends kt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:L("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:vz})}run(e,n){var r;return _z(this,void 0,void 0,function*(){(r=Tv.get(n))===null||r===void 0||r.goToSelectionAnchor()})}}class Lkt extends kt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:L("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:vz,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2089),weight:100}})}run(e,n){var r;return _z(this,void 0,void 0,function*(){(r=Tv.get(n))===null||r===void 0||r.selectFromAnchorToCursor()})}}class Dkt extends kt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:L("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:vz,kbOpts:{kbExpr:oe.editorTextFocus,primary:9,weight:100}})}run(e,n){var r;return _z(this,void 0,void 0,function*(){(r=Tv.get(n))===null||r===void 0||r.cancelSelectionAnchor()})}}_i(Tv.ID,Tv,4);rt(xkt);rt(kkt);rt(Lkt);rt(Dkt);const Ekt=ce("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},L("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class Ikt extends kt{constructor(){super({id:"editor.action.jumpToBracket",label:L("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:3165,weight:100}})}run(e,n){var r;(r=kf.get(n))===null||r===void 0||r.jumpToBracket()}}class Tkt extends kt{constructor(){super({id:"editor.action.selectToBracket",label:L("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,n,r){var s;let o=!0;r&&r.selectBrackets===!1&&(o=!1),(s=kf.get(n))===null||s===void 0||s.selectToBracket(o)}}class Rkt extends kt{constructor(){super({id:"editor.action.removeBrackets",label:L("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:2561,weight:100}})}run(e,n){var r;(r=kf.get(n))===null||r===void 0||r.removeBrackets(this.id)}}class Akt{constructor(e,n,r){this.position=e,this.brackets=n,this.options=r}}class kf extends Le{static get(e){return e.getContribution(kf.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Ji(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(n=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(n=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(n=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(n=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(n=>{n.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),n=this._editor.getSelections().map(r=>{const s=r.getStartPosition(),o=e.bracketPairs.matchBracket(s);let a=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?a=o[1].getStartPosition():o[1].containsPosition(s)&&(a=o[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(s);if(l)a=l[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(s);c&&c.range&&(a=c.range.getStartPosition())}}return a?new Ft(a.lineNumber,a.column,a.lineNumber,a.column):new Ft(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(n),this._editor.revealRange(n[0])}selectToBracket(e){if(!this._editor.hasModel())return;const n=this._editor.getModel(),r=[];this._editor.getSelections().forEach(s=>{const o=s.getStartPosition();let a=n.bracketPairs.matchBracket(o);if(!a&&(a=n.bracketPairs.findEnclosingBrackets(o),!a)){const u=n.bracketPairs.findNextBracket(o);u&&u.range&&(a=n.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,c=null;if(a){a.sort(J.compareRangesUsingStarts);const[u,d]=a;if(l=e?u.getStartPosition():u.getEndPosition(),c=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const h=l;l=c,c=h}}l&&c&&r.push(new Ft(l.lineNumber,l.column,c.lineNumber,c.column))}),r.length>0&&(this._editor.setSelections(r),this._editor.revealRange(r[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const n=this._editor.getModel();this._editor.getSelections().forEach(r=>{const s=r.getPosition();let o=n.bracketPairs.matchBracket(s);o||(o=n.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let n=0;for(const r of this._lastBracketsData){const s=r.brackets;s&&(e[n++]={range:s[0],options:r.options},e[n++]={range:s[1],options:r.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const n=this._editor.getModel(),r=n.getVersionId();let s=[];this._lastVersionId===r&&(s=this._lastBracketsData);const o=[];let a=0;for(let h=0,f=e.length;h<f;h++){const p=e[h];p.isEmpty()&&(o[a++]=p.getStartPosition())}o.length>1&&o.sort(ve.compare);const l=[];let c=0,u=0;const d=s.length;for(let h=0,f=o.length;h<f;h++){const p=o[h];for(;u<d&&s[u].position.isBefore(p);)u++;if(u<d&&s[u].position.equals(p))l[c++]=s[u];else{let g=n.bracketPairs.matchBracket(p,20),m=kf._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!g&&this._matchBrackets==="always"&&(g=n.bracketPairs.findEnclosingBrackets(p,20),m=kf._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[c++]=new Akt(p,g,m)}}this._lastBracketsData=l,this._lastVersionId=r}}kf.ID="editor.contrib.bracketMatchingController";kf._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=kn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Qr(Ekt),position:hd.Center}});kf._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=kn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});_i(kf.ID,kf,1);rt(Tkt);rt(Ikt);rt(Rkt);sa.appendMenuItem(se.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:L({},"Go to &&Bracket")},order:2});class Nkt{constructor(e,n){this._selection=e,this._isMovingLeft=n}getEditOperations(e,n){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const r=this._selection.startLineNumber,s=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&s===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(r)))if(this._isMovingLeft){const a=new J(r,s-1,r,s),l=e.getValueInRange(a);n.addEditOperation(a,null),n.addEditOperation(new J(r,o,r,o),l)}else{const a=new J(r,o,r,o+1),l=e.getValueInRange(a);n.addEditOperation(a,null),n.addEditOperation(new J(r,s,r,s),l)}}computeCursorState(e,n){return this._isMovingLeft?new Ft(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Ft(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class YAe extends kt{constructor(e,n){super(n),this.left=e}run(e,n){if(!n.hasModel())return;const r=[],s=n.getSelections();for(const o of s)r.push(new Nkt(o,this.left));n.pushUndoStop(),n.executeCommands(this.id,r),n.pushUndoStop()}}class Mkt extends YAe{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:L("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:oe.writable})}}class Pkt extends YAe{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:L("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:oe.writable})}}rt(Mkt);rt(Pkt);class Okt extends kt{constructor(){super({id:"editor.action.transposeLetters",label:L("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:oe.writable,kbOpts:{kbExpr:oe.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,n){if(!n.hasModel())return;const r=n.getModel(),s=[],o=n.getSelections();for(const a of o){if(!a.isEmpty())continue;const l=a.startLineNumber,c=a.startColumn,u=r.getLineMaxColumn(l);if(l===1&&(c===1||c===2&&u===2))continue;const d=c===u?a.getPosition():Ri.rightPosition(r,a.getPosition().lineNumber,a.getPosition().column),h=Ri.leftPosition(r,d),f=Ri.leftPosition(r,h),p=r.getValueInRange(J.fromPositions(f,h)),g=r.getValueInRange(J.fromPositions(h,d)),m=J.fromPositions(f,d);s.push(new Sa(m,g+p))}s.length>0&&(n.pushUndoStop(),n.executeCommands(this.id,s),n.pushUndoStop())}}rt(Okt);var Fkt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const Cx="9_cutcopypaste",Bkt=Um||document.queryCommandSupported("cut"),ZAe=Um||document.queryCommandSupported("copy"),jkt=typeof navigator.clipboard>"u"||gh?document.queryCommandSupported("paste"):!0;function Yae(i){return i.register(),i}const Wkt=Bkt?Yae(new BI({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Um?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:se.MenubarEditMenu,group:"2_ccp",title:L({},"Cu&&t"),order:1},{menuId:se.EditorContext,group:Cx,title:L("actions.clipboard.cutLabel","Cut"),when:oe.writable,order:1},{menuId:se.CommandPalette,group:"",title:L("actions.clipboard.cutLabel","Cut"),order:1},{menuId:se.SimpleEditorContext,group:Cx,title:L("actions.clipboard.cutLabel","Cut"),when:oe.writable,order:1}]})):void 0,$kt=ZAe?Yae(new BI({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Um?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:se.MenubarEditMenu,group:"2_ccp",title:L({},"&&Copy"),order:2},{menuId:se.EditorContext,group:Cx,title:L("actions.clipboard.copyLabel","Copy"),order:2},{menuId:se.CommandPalette,group:"",title:L("actions.clipboard.copyLabel","Copy"),order:1},{menuId:se.SimpleEditorContext,group:Cx,title:L("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;sa.appendMenuItem(se.MenubarEditMenu,{submenu:se.MenubarCopy,title:{value:L("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});sa.appendMenuItem(se.EditorContext,{submenu:se.EditorContextCopy,title:{value:L("copy as","Copy As"),original:"Copy As"},group:Cx,order:3});sa.appendMenuItem(se.EditorContext,{submenu:se.EditorContextShare,title:{value:L("share","Share"),original:"Share"},group:"11_share",order:-1,when:ze.and(ze.notEquals("resourceScheme","output"),oe.editorTextFocus)});sa.appendMenuItem(se.EditorTitleContext,{submenu:se.EditorTitleContextShare,title:{value:L("share","Share"),original:"Share"},group:"11_share",order:-1});sa.appendMenuItem(se.ExplorerContext,{submenu:se.ExplorerContextShare,title:{value:L("share","Share"),original:"Share"},group:"11_share",order:-1});const uK=jkt?Yae(new BI({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Um?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:se.MenubarEditMenu,group:"2_ccp",title:L({},"&&Paste"),order:4},{menuId:se.EditorContext,group:Cx,title:L("actions.clipboard.pasteLabel","Paste"),when:oe.writable,order:4},{menuId:se.CommandPalette,group:"",title:L("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:se.SimpleEditorContext,group:Cx,title:L("actions.clipboard.pasteLabel","Paste"),when:oe.writable,order:4}]})):void 0;class zkt extends kt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:L("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:0,weight:100}})}run(e,n){!n.hasModel()||!n.getOption(37)&&n.getSelection().isEmpty()||(RJ.forceCopyWithSyntaxHighlighting=!0,n.focus(),n.getContainerDomNode().ownerDocument.execCommand("copy"),RJ.forceCopyWithSyntaxHighlighting=!1)}}function QAe(i,e){i&&(i.addImplementation(1e4,"code-editor",(n,r)=>{const s=n.get(Si).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const o=s.getOption(37),a=s.getSelection();return a&&a.isEmpty()&&!o||s.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(n,r)=>(u$().execCommand(e),!0)))}QAe(Wkt,"cut");QAe($kt,"copy");uK&&(uK.addImplementation(1e4,"code-editor",(i,e)=>{const n=i.get(Si),r=i.get(qv),s=n.getFocusedCodeEditor();return s&&s.hasTextFocus()?!s.getContainerDomNode().ownerDocument.execCommand("paste")&&H1?Fkt(void 0,void 0,void 0,function*(){const a=yield r.readText();if(a!==""){const l=EP.INSTANCE.get(a);let c=!1,u=null,d=null;l&&(c=s.getOption(37)&&!!l.isFromEmptySelection,u=typeof l.multicursorText<"u"?l.multicursorText:null,d=l.mode),s.trigger("keyboard","paste",{text:a,pasteOnNewLine:c,multicursorText:u,mode:d})}}):!0:!1}),uK.addImplementation(0,"generic-dom",(i,e)=>(u$().execCommand("paste"),!0)));ZAe&&rt(zkt);var Vkt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class cn{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+cn.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new cn(this.value+cn.sep+e)}}cn.sep=".";cn.None=new cn("@@none@@");cn.Empty=new cn("");cn.QuickFix=new cn("quickfix");cn.Refactor=new cn("refactor");cn.RefactorExtract=cn.Refactor.append("extract");cn.RefactorInline=cn.Refactor.append("inline");cn.RefactorMove=cn.Refactor.append("move");cn.RefactorRewrite=cn.Refactor.append("rewrite");cn.Notebook=new cn("notebook");cn.Source=new cn("source");cn.SourceOrganizeImports=cn.Source.append("organizeImports");cn.SourceFixAll=cn.Source.append("fixAll");cn.SurroundWith=cn.Refactor.append("surround");var uu;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(uu||(uu={}));function Hkt(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(n=>JAe(e,n,i.include))||!i.includeSourceActions&&cn.Source.contains(e))}function Ukt(i,e){const n=e.kind?new cn(e.kind):void 0;return!(i.include&&(!n||!i.include.contains(n))||i.excludes&&n&&i.excludes.some(r=>JAe(n,r,i.include))||!i.includeSourceActions&&n&&cn.Source.contains(n)||i.onlyIncludePreferredActions&&!e.isPreferred)}function JAe(i,e,n){return!(!e.contains(i)||n&&e.contains(n))}class mm{static fromUser(e,n){return!e||typeof e!="object"?new mm(n.kind,n.apply,!1):new mm(mm.getKindFromUser(e,n.kind),mm.getApplyFromUser(e,n.apply),mm.getPreferredUser(e))}static getApplyFromUser(e,n){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return n}}static getKindFromUser(e,n){return typeof e.kind=="string"?new cn(e.kind):n}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,n,r){this.kind=e,this.apply=n,this.preferred=r}}class qkt{constructor(e,n,r){this.action=e,this.provider=n,this.highlightRange=r}resolve(e){var n;return Vkt(this,void 0,void 0,function*(){if(!((n=this.provider)===null||n===void 0)&&n.resolveCodeAction&&!this.action.edit){let r;try{r=yield this.provider.resolveCodeAction(this.action,e)}catch(s){Us(s)}r&&(this.action.edit=r.edit)}return this})}}var ej=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const eNe="editor.action.codeAction",Zae="editor.action.quickFix",tNe="editor.action.autoFix",nNe="editor.action.refactor",iNe="editor.action.sourceAction",Qae="editor.action.organizeImports",Jae="editor.action.fixAll";class yM extends Le{static codeActionsPreferredComparator(e,n){return e.isPreferred&&!n.isPreferred?-1:!e.isPreferred&&n.isPreferred?1:0}static codeActionsComparator({action:e},{action:n}){return Ka(e.diagnostics)?Ka(n.diagnostics)?yM.codeActionsPreferredComparator(e,n):-1:Ka(n.diagnostics)?1:yM.codeActionsPreferredComparator(e,n)}constructor(e,n,r){super(),this.documentation=n,this._register(r),this.allActions=[...e].sort(yM.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&cn.QuickFix.contains(new cn(e.kind))&&!!e.isPreferred)}}const t0e={actions:[],documentation:void 0};function wM(i,e,n,r,s,o){var a;return ej(this,void 0,void 0,function*(){const l=r.filter||{},c=Object.assign(Object.assign({},l),{excludes:[...l.excludes||[],cn.Notebook]}),u={only:(a=l.include)===null||a===void 0?void 0:a.value,trigger:r.type},d=new Hae(e,o),h=r.type===2,f=Kkt(i,e,h?c:l),p=new Xe,g=f.map(_=>ej(this,void 0,void 0,function*(){try{s.report(_);const b=yield _.provideCodeActions(e,n,u,d.token);if(b&&p.add(b),d.token.isCancellationRequested)return t0e;const y=((b==null?void 0:b.actions)||[]).filter(k=>k&&Ukt(l,k)),x=Xkt(_,y,l.include);return{actions:y.map(k=>new qkt(k,_)),documentation:x}}catch(b){if(sg(b))throw b;return Us(b),t0e}})),m=i.onDidChange(()=>{const _=i.all(e);ys(_,f)||d.cancel()});try{const _=yield Promise.all(g),b=_.map(x=>x.actions).flat(),y=[...Hm(_.map(x=>x.documentation)),...Gkt(i,e,r,b)];return new yM(b,y,p)}finally{m.dispose(),d.dispose()}})}function Kkt(i,e,n){return i.all(e).filter(r=>r.providedCodeActionKinds?r.providedCodeActionKinds.some(s=>Hkt(n,new cn(s))):!0)}function*Gkt(i,e,n,r){var s,o,a;if(e&&r.length)for(const l of i.all(e))l._getAdditionalMenuItems&&(yield*(s=l._getAdditionalMenuItems)===null||s===void 0?void 0:s.call(l,{trigger:n.type,only:(a=(o=n.filter)===null||o===void 0?void 0:o.include)===null||a===void 0?void 0:a.value},r.map(c=>c.action)))}function Xkt(i,e,n){if(!i.documentation)return;const r=i.documentation.map(s=>({kind:new cn(s.kind),command:s.command}));if(n){let s;for(const o of r)o.kind.contains(n)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s==null?void 0:s.command}for(const s of e)if(s.kind){for(const o of r)if(o.kind.contains(new cn(s.kind)))return o.command}}var tj;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions"})(tj||(tj={}));function Ykt(i,e,n,r,s=Hn.None){var o;return ej(this,void 0,void 0,function*(){const a=i.get($5),l=i.get(us),c=i.get(_d),u=i.get(Ps);if(c.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:n}),yield e.resolve(s),!s.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(yield a.apply(e.action.edit,{editor:r==null?void 0:r.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:n!==tj.OnSave,showPreview:r==null?void 0:r.preview})).isApplied)&&e.action.command)try{yield l.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const h=Zkt(d);u.error(typeof h=="string"?h:L("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function Zkt(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}si.registerCommand("_executeCodeActionProvider",function(i,e,n,r,s){return ej(this,void 0,void 0,function*(){if(!(e instanceof Jt))throw uh();const{codeActionProvider:o}=i.get(Et),a=i.get(Fr).getModel(e);if(!a)throw uh();const l=Ft.isISelection(n)?Ft.liftSelection(n):J.isIRange(n)?a.validateRange(n):void 0;if(!l)throw uh();const c=typeof r=="string"?new cn(r):void 0,u=yield wM(o,a,l,{type:1,triggerAction:uu.Default,filter:{includeSourceActions:!0,include:c}},_v.None,Hn.None),d=[],h=Math.min(u.validActions.length,typeof s=="number"?s:0);for(let f=0;f<h;f++)d.push(u.validActions[f].resolve(Hn.None));try{return yield Promise.all(d),u.validActions.map(f=>f.action)}finally{setTimeout(()=>u.dispose(),100)}})});var Qkt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Jkt=function(i,e){return function(n,r){e(n,r,i)}},Dte;let nj=Dte=class{constructor(e){this.keybindingService=e}getResolver(){const e=new K1(()=>this.keybindingService.getKeybindings().filter(n=>Dte.codeActionCommands.indexOf(n.command)>=0).filter(n=>n.resolvedKeybinding).map(n=>{let r=n.commandArgs;return n.command===Qae?r={kind:cn.SourceOrganizeImports.value}:n.command===Jae&&(r={kind:cn.SourceFixAll.value}),Object.assign({resolvedKeybinding:n.resolvedKeybinding},mm.fromUser(r,{kind:cn.None,apply:"never"}))}));return n=>{if(n.kind){const r=this.bestKeybindingForCodeAction(n,e.value);return r==null?void 0:r.resolvedKeybinding}}}bestKeybindingForCodeAction(e,n){if(!e.kind)return;const r=new cn(e.kind);return n.filter(s=>s.kind.contains(r)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}};nj.codeActionCommands=[nNe,eNe,iNe,Qae,Jae];nj=Dte=Qkt([Jkt(0,sr)],nj);ce("symbolIcon.arrayForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.booleanForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},L("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.colorForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.constantForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},L("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},L("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},L("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},L("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},L("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.fileForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.folderForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},L("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},L("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.keyForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.keywordForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},L("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.moduleForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.namespaceForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.nullForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.numberForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.objectForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.operatorForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.packageForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.propertyForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.referenceForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.snippetForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.stringForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.structForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.textForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.typeParameterForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.unitForeground",{dark:ot,light:ot,hcDark:ot,hcLight:ot},L("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ce("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},L("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const rNe=Object.freeze({kind:cn.Empty,title:L("codeAction.widget.id.more","More Actions...")}),eLt=Object.freeze([{kind:cn.QuickFix,title:L("codeAction.widget.id.quickfix","Quick Fix")},{kind:cn.RefactorExtract,title:L("codeAction.widget.id.extract","Extract"),icon:lt.wrench},{kind:cn.RefactorInline,title:L("codeAction.widget.id.inline","Inline"),icon:lt.wrench},{kind:cn.RefactorRewrite,title:L("codeAction.widget.id.convert","Rewrite"),icon:lt.wrench},{kind:cn.RefactorMove,title:L("codeAction.widget.id.move","Move"),icon:lt.wrench},{kind:cn.SurroundWith,title:L("codeAction.widget.id.surround","Surround With"),icon:lt.symbolSnippet},{kind:cn.Source,title:L("codeAction.widget.id.source","Source Action"),icon:lt.symbolFile},rNe]);function tLt(i,e,n){if(!e)return i.map(o=>{var a;return{kind:"action",item:o,group:rNe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((a=o.action.edit)===null||a===void 0)&&a.edits.length)}});const r=eLt.map(o=>({group:o,actions:[]}));for(const o of i){const a=o.action.kind?new cn(o.action.kind):cn.None;for(const l of r)if(l.group.kind.contains(a)){l.actions.push(o);break}}const s=[];for(const o of r)if(o.actions.length){s.push({kind:"header",group:o.group});for(const a of o.actions)s.push({kind:"action",item:a,group:o.group,label:a.action.title,disabled:!!a.action.disabled,keybinding:n(a.action)})}return s}var nLt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},iLt=function(i,e){return function(n,r){e(n,r,i)}},Ete,S2;(function(i){i.Hidden={type:0};class e{constructor(r,s,o,a){this.actions=r,this.trigger=s,this.editorPosition=o,this.widgetPosition=a,this.type=1}}i.Showing=e})(S2||(S2={}));let Sx=Ete=class extends Le{constructor(e,n){super(),this._editor=e,this._onClick=this._register(new _e),this.onClick=this._onClick.event,this._state=S2.Hidden,this._domNode=tt("div.lightBulbWidget"),this._register(or.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(r=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),this._register(qat(this._domNode,r=>{if(this.state.type!==1)return;this._editor.focus(),r.preventDefault();const{top:s,height:o}=no(this._domNode),a=this._editor.getOption(66);let l=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(l+=a),this._onClick.fire({x:r.posx,y:s+o+l,actions:this.state.actions,trigger:this.state.trigger})})),this._register(Be(this._domNode,"mouseenter",r=>{(r.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(_t.runAndSubscribe(n.onDidUpdateKeybindings,()=>{var r,s,o,a;this._preferredKbLabel=(s=(r=n.lookupKeybinding(tNe))===null||r===void 0?void 0:r.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(a=(o=n.lookupKeybinding(Zae))===null||o===void 0?void 0:o.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,n,r){if(e.validActions.length<=0)return this.hide();const s=this._editor.getOptions();if(!s.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:a,column:l}=o.validatePosition(r),c=o.getOptions().tabSize,u=s.get(50),d=o.getLineContent(a),h=A$(d,c),f=u.spaceWidth*h>22,p=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let g=a;if(!f){if(a>1&&!p(a-1))g-=1;else if(!p(a+1))g+=1;else if(l*u.spaceWidth<22)return this.hide()}this.state=new S2.Showing(e,n,r,{position:{lineNumber:g,column:1},preference:Ete._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==S2.Hidden&&(this.state=S2.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix&&(this._domNode.classList.remove(...en.asClassNameArray(lt.lightBulb)),this._domNode.classList.add(...en.asClassNameArray(lt.lightbulbAutofix)),this._preferredKbLabel)){this.title=L("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...en.asClassNameArray(lt.lightbulbAutofix)),this._domNode.classList.add(...en.asClassNameArray(lt.lightBulb)),this._quickFixKbLabel?this.title=L("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=L("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};Sx.ID="editor.contrib.lightbulbWidget";Sx._posPref=[0];Sx=Ete=nLt([iLt(1,sr)],Sx);var rLt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},n0e=function(i,e){return function(n,r){e(n,r,i)}},sNe=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},Ite;let Rv=Ite=class{constructor(e,n,r){this._options=e,this._languageService=n,this._openerService=r,this._onDidRenderAsync=new _e,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,n,r){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new Xe,o=s.add(H$(e,Object.assign(Object.assign({},this._getRenderOptions(e,s)),n),r));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>s.dispose()}}_getRenderOptions(e,n){return{codeBlockRenderer:(r,s)=>sNe(this,void 0,void 0,function*(){var o,a,l;let c;r?c=this._languageService.getLanguageIdByLanguageName(r):this._options.editor&&(c=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),c||(c=ad);const u=yield C_t(this._languageService,s,c),d=document.createElement("span");if(d.innerHTML=(l=(a=Ite._ttpTokenizer)===null||a===void 0?void 0:a.createHTML(u))!==null&&l!==void 0?l:u,this._options.editor){const h=this._options.editor.getOption(50);Ta(d,h)}else this._options.codeBlockFontFamily&&(d.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(d.style.fontSize=this._options.codeBlockFontSize),d}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:r=>oNe(this._openerService,r,e.isTrusted),disposables:n}}}};Rv._ttpTokenizer=$v("tokenizeToString",{createHTML(i){return i}});Rv=Ite=rLt([n0e(1,Ar),n0e(2,fu)],Rv);function oNe(i,e,n){return sNe(this,void 0,void 0,function*(){try{return yield i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:sLt(n)})}catch(r){return Ln(r),!1}})}function sLt(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var oLt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},i0e=function(i,e){return function(n,r){e(n,r,i)}},E8;let au=E8=class{static get(e){return e.getContribution(E8.ID)}constructor(e,n,r){this._openerService=r,this._messageWidget=new ha,this._messageListeners=new Xe,this._mouseOverMessage=!1,this._editor=e,this._visible=E8.MESSAGE_VISIBLE.bindTo(n)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,n){Ua(Hy(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Hy(e)?H$(e,{actionHandler:{callback:s=>oNe(this._openerService,s,Hy(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new r0e(this._editor,n,typeof e=="string"?e:this._message.element),this._messageListeners.add(_t.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Ia(xf(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(Be(this._messageWidget.value.getDomNode(),ht.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(Be(this._messageWidget.value.getDomNode(),ht.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let r;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(r?r.containsPosition(s.target.position)||this.closeMessage():r=new J(n.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(r0e.fadeOut(this._messageWidget.value))}};au.ID="editor.contrib.messageController";au.MESSAGE_VISIBLE=new yt("messageVisible",!1,L("messageVisible","Whether the editor is currently showing an inline message"));au=E8=oLt([i0e(1,mn),i0e(2,fu)],au);const aLt=Ho.bindToContribution(au.get);ct(new aLt({id:"leaveEditorMessage",precondition:au.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:130,primary:9}}));let r0e=class{static fadeOut(e){const n=()=>{e.dispose(),clearTimeout(r),e.getDomNode().removeEventListener("animationend",n)},r=setTimeout(n,110);return e.getDomNode().addEventListener("animationend",n),e.getDomNode().classList.add("fadeOut"),{dispose:n}}constructor(e,{lineNumber:n,column:r},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(n,n,0),this._position={lineNumber:n,column:r},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const a=document.createElement("div");typeof s=="string"?(a.classList.add("message"),a.textContent=s):(s.classList.add("message"),a.appendChild(s)),this._domNode.appendChild(a);const l=document.createElement("div");l.classList.add("anchor","below"),this._domNode.appendChild(l),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};_i(au.ID,au,4);var aNe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Tte=function(i,e){return function(n,r){e(n,r,i)}},lLt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const lNe="acceptSelectedCodeAction",cNe="previewSelectedCodeAction";class cLt{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const n=document.createElement("span");return e.append(n),{container:e,text:n}}renderElement(e,n,r){var s,o;r.text.textContent=(o=(s=e.group)===null||s===void 0?void 0:s.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let Rte=class{get templateId(){return"action"}constructor(e,n){this._supportsPreview=e,this._keybindingService=n}renderTemplate(e){e.classList.add(this.templateId);const n=document.createElement("div");n.className="icon",e.append(n);const r=document.createElement("span");r.className="title",e.append(r);const s=new q5(e,Zu);return{container:e,icon:n,text:r,keybinding:s}}renderElement(e,n,r){var s,o,a;if(!((s=e.group)===null||s===void 0)&&s.icon?(r.icon.className=en.asClassName(e.group.icon),e.group.icon.color&&(r.icon.style.color=wt(e.group.icon.color.id))):(r.icon.className=en.asClassName(lt.lightBulb),r.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;r.text.textContent=uNe(e.label),r.keybinding.set(e.keybinding),ilt(!!e.keybinding,r.keybinding.element);const l=(o=this._keybindingService.lookupKeybinding(lNe))===null||o===void 0?void 0:o.getLabel(),c=(a=this._keybindingService.lookupKeybinding(cNe))===null||a===void 0?void 0:a.getLabel();r.container.classList.toggle("option-disabled",e.disabled),e.disabled?r.container.title=e.label:l&&c?this._supportsPreview&&e.canPreview?r.container.title=L({},"{0} to apply, {1} to preview",l,c):r.container.title=L({},"{0} to apply",l):r.container.title=""}disposeTemplate(e){}};Rte=aNe([Tte(1,sr)],Rte);class uLt extends UIEvent{constructor(){super("acceptSelectedAction")}}class s0e extends UIEvent{constructor(){super("previewSelectedAction")}}function dLt(i){if(i.kind==="action")return i.label}let Ate=class extends Le{constructor(e,n,r,s,o,a){super(),this._delegate=s,this._contextViewService=o,this._keybindingService=a,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Ns),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const l={getHeight:c=>c.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:c=>c.kind};this._list=this._register(new Bf(e,this.domNode,l,[new Rte(n,this._keybindingService),new cLt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:dLt},accessibilityProvider:{getAriaLabel:c=>{if(c.kind==="action"){let u=c.label?uNe(c==null?void 0:c.label):"";return c.disabled&&(u=L({},"{0}, Disabled Reason: {1}",u,c.disabled)),u}return null},getWidgetAriaLabel:()=>L({},"Action Widget"),getRole:c=>c.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(tk),this._register(this._list.onMouseClick(c=>this.onListClick(c))),this._register(this._list.onMouseOver(c=>this.onListHover(c))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(c=>this.onListSelection(c))),this._allMenuItems=r,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const n=this._allMenuItems.filter(u=>u.kind==="header").length,s=this._allMenuItems.length*this._actionLineHeight+n*this._headerLineHeight-n*this._actionLineHeight;this._list.layout(s);const o=this._allMenuItems.map((u,d)=>{const h=document.getElementById(this._list.getElementID(d));if(h){h.style.width="auto";const f=h.getBoundingClientRect().width;return h.style.width="",f}return 0}),a=Math.max(...o,e),c=Math.min(s,document.body.clientHeight*.7);return this._list.layout(c,a),this.domNode.style.height=`${c}px`,this._list.domFocus(),a}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const n=this._list.getFocus();if(n.length===0)return;const r=n[0],s=this._list.element(r);if(!this.focusCondition(s))return;const o=e?new s0e:new uLt;this._list.setSelection([r],o)}onListSelection(e){if(!e.elements.length)return;const n=e.elements[0];n.item&&this.focusCondition(n)?this._delegate.onSelect(n.item,e.browserEvent instanceof s0e):this._list.setSelection([])}onFocus(){var e,n;this._list.domFocus();const r=this._list.getFocus();if(r.length===0)return;const s=r[0],o=this._list.element(s);(n=(e=this._delegate).onFocus)===null||n===void 0||n.call(e,o.item)}onListHover(e){return lLt(this,void 0,void 0,function*(){const n=e.element;if(n&&n.item&&this.focusCondition(n)){if(this._delegate.onHover&&!n.disabled&&n.kind==="action"){const r=yield this._delegate.onHover(n.item,this.cts.token);n.canPreview=r?r.canPreview:void 0}e.index&&this._list.splice(e.index,1,[n])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])})}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Ate=aNe([Tte(4,Vv),Tte(5,sr)],Ate);function uNe(i){return i.replace(/\r\n|\r|\n/g," ")}var hLt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},dK=function(i,e){return function(n,r){e(n,r,i)}};ce("actionBar.toggledBackground",{dark:mS,light:mS,hcDark:mS,hcLight:mS},L("actionBar.toggledBackground","Background color for toggled action items in action bar."));const xx={Visible:new yt("codeActionMenuVisible",!1,L("codeActionMenuVisible","Whether the action widget list is visible"))},ok=qn("actionWidgetService");let kx=class extends Le{get isVisible(){return xx.Visible.getValue(this._contextKeyService)||!1}constructor(e,n,r){super(),this._contextViewService=e,this._contextKeyService=n,this._instantiationService=r,this._list=this._register(new ha)}show(e,n,r,s,o,a,l){const c=xx.Visible.bindTo(this._contextKeyService),u=this._instantiationService.createInstance(Ate,e,n,r,s);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(c.set(!0),this._renderWidget(d,u,l??[])),onHide:d=>{c.reset(),this._onWidgetClosed(d)}},a,!1)}acceptSelected(e){var n;(n=this._list.value)===null||n===void 0||n.acceptSelected(e)}focusPrevious(){var e,n;(n=(e=this._list)===null||e===void 0?void 0:e.value)===null||n===void 0||n.focusPrevious()}focusNext(){var e,n;(n=(e=this._list)===null||e===void 0?void 0:e.value)===null||n===void 0||n.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,n,r){var s;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=n,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const a=new Xe,l=document.createElement("div"),c=e.appendChild(l);c.classList.add("context-view-block"),a.add(Be(c,ht.MOUSE_DOWN,g=>g.stopPropagation()));const u=document.createElement("div"),d=e.appendChild(u);d.classList.add("context-view-pointerBlock"),a.add(Be(d,ht.POINTER_MOVE,()=>d.remove())),a.add(Be(d,ht.MOUSE_DOWN,()=>d.remove()));let h=0;if(r.length){const g=this._createActionBar(".action-widget-action-bar",r);g&&(o.appendChild(g.getContainer().parentElement),a.add(g),h=g.getContainer().offsetWidth)}const f=(s=this._list.value)===null||s===void 0?void 0:s.layout(h);o.style.width=`${f}px`;const p=a.add(Gm(e));return a.add(p.onDidBlur(()=>this.hide())),a}_createActionBar(e,n){if(!n.length)return;const r=tt(e),s=new wh(r);return s.push(n,{icon:!1,label:!0}),s}_onWidgetClosed(e){var n;(n=this._list.value)===null||n===void 0||n.hide(e)}};kx=hLt([dK(0,Vv),dK(1,mn),dK(2,hn)],kx);oi(ok,kx,1);const e4=1100;Ir(class extends md{constructor(){super({id:"hideCodeActionWidget",title:{value:L("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:xx.Visible,keybinding:{weight:e4,primary:9,secondary:[1033]}})}run(i){i.get(ok).hide()}});Ir(class extends md{constructor(){super({id:"selectPrevCodeAction",title:{value:L("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:xx.Visible,keybinding:{weight:e4,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(ok);e instanceof kx&&e.focusPrevious()}});Ir(class extends md{constructor(){super({id:"selectNextCodeAction",title:{value:L("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:xx.Visible,keybinding:{weight:e4,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(ok);e instanceof kx&&e.focusNext()}});Ir(class extends md{constructor(){super({id:lNe,title:{value:L("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:xx.Visible,keybinding:{weight:e4,primary:3,secondary:[2137]}})}run(i){const e=i.get(ok);e instanceof kx&&e.acceptSelected()}});Ir(class extends md{constructor(){super({id:cNe,title:{value:L("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:xx.Visible,keybinding:{weight:e4,primary:2051}})}run(i){const e=i.get(ok);e instanceof kx&&e.acceptSelected(!0)}});var fLt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const dNe=new yt("supportedCodeAction","");class pLt extends Le{constructor(e,n,r,s=250){super(),this._editor=e,this._markerService=n,this._signalChange=r,this._delay=s,this._autoTriggerTimer=this._register(new Mf),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const n=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(n?{trigger:e,selection:n}:void 0)}_onMarkerChanges(e){const n=this._editor.getModel();n&&e.some(r=>Noe(r,n.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:uu.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const n=this._editor.getModel(),r=this._editor.getSelection();if(r.isEmpty()&&e.type===2){const{lineNumber:s,column:o}=r.getPosition(),a=n.getLineContent(s);if(a.length===0)return;if(o===1){if(/\s/.test(a[0]))return}else if(o===n.getLineMaxColumn(s)){if(/\s/.test(a[a.length-1]))return}else if(/\s/.test(a[o-2])&&/\s/.test(a[o-1]))return}return r}}var JC;(function(i){i.Empty={type:0};class e{constructor(r,s,o){this.trigger=r,this.position=s,this._cancellablePromise=o,this.type=1,this.actions=o.catch(a=>{if(sg(a))return hNe;throw a})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(JC||(JC={}));const hNe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class gLt extends Le{constructor(e,n,r,s,o,a){super(),this._editor=e,this._registry=n,this._markerService=r,this._progressService=o,this._configurationService=a,this._codeActionOracle=this._register(new ha),this._state=JC.Empty,this._onDidChangeState=this._register(new _e),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=dNe.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(JC.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const n=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:n==null?void 0:n.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(JC.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const n=this._registry.all(e).flatMap(r=>{var s;return(s=r.providedCodeActionKinds)!==null&&s!==void 0?s:[]});this._supportedCodeActions.set(n.join(" ")),this._codeActionOracle.value=new pLt(this._editor,this._markerService,r=>{var s;if(!r){this.setState(JC.Empty);return}const o=r.selection.getStartPosition(),a=go(l=>fLt(this,void 0,void 0,function*(){var c,u,d,h,f,p;if(this._settingEnabledNearbyQuickfixes()&&r.trigger.type===1&&(r.trigger.triggerAction===uu.QuickFix||!((u=(c=r.trigger.filter)===null||c===void 0?void 0:c.include)===null||u===void 0)&&u.contains(cn.QuickFix))){const g=yield wM(this._registry,e,r.selection,r.trigger,_v.None,l);if(l.isCancellationRequested)return hNe;if(!((d=g.validActions)===null||d===void 0?void 0:d.some(_=>_.action.kind?cn.QuickFix.contains(new cn(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const b=r.selection.getPosition();let y=b,x=Number.MAX_VALUE,k=!1;for(const D of _){const R=D.endColumn,E=D.endLineNumber,A=D.startLineNumber;(E===b.lineNumber||A===b.lineNumber)&&Math.abs(b.column-R)<x&&(x=Math.abs(b.column-R),k=!0,y=new ve(E,R))}if(k){const D={type:r.trigger.type,triggerAction:r.trigger.triggerAction,filter:{include:!((h=r.trigger.filter)===null||h===void 0)&&h.include?(f=r.trigger.filter)===null||f===void 0?void 0:f.include:cn.QuickFix},autoApply:r.trigger.autoApply,context:{notAvailableMessage:((p=r.trigger.context)===null||p===void 0?void 0:p.notAvailableMessage)||"",position:y}},R=new Ft(y.lineNumber,y.column,y.lineNumber,y.column),E=yield wM(this._registry,e,R,D,_v.None,l),A=[...g.validActions];return E.validActions.length!==0&&(E.validActions.forEach(M=>{M.highlightRange=M.action.isPreferred}),A.push(...E.validActions)),{validActions:A,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return wM(this._registry,e,r.selection,r.trigger,_v.None,l)}));r.trigger.type===1&&((s=this._progressService)===null||s===void 0||s.showWhile(a,250)),this.setState(new JC.Triggered(r.trigger,o,a))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:uu.Default})}else this._supportedCodeActions.reset()}trigger(e){var n;(n=this._codeActionOracle.value)===null||n===void 0||n.trigger(e)}setState(e,n){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!n&&!this._disposed&&this._onDidChangeState.fire(e))}}var mLt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},e0=function(i,e){return function(n,r){e(n,r,i)}},nA=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},I8;const _Lt="quickfix-edit-highlight";let k1=I8=class extends Le{static get(e){return e.getContribution(I8.ID)}constructor(e,n,r,s,o,a,l,c,u,d){super(),this._commandService=l,this._configurationService=c,this._actionWidgetService=u,this._instantiationService=d,this._activeCodeActions=this._register(new ha),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new gLt(this._editor,o.codeActionProvider,n,r,a,c)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new K1(()=>{const h=this._editor.getContribution(Sx.ID);return h&&this._register(h.onClick(f=>this.showCodeActionList(f.actions,f,{includeDisabledActions:!1,fromLightbulb:!0}))),h}),this._resolver=s.createInstance(nj),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,n,r){return this.showCodeActionList(n,r,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,n,r,s){var o;if(!this._editor.hasModel())return;(o=au.get(this._editor))===null||o===void 0||o.closeMessage();const a=this._editor.getPosition();this._trigger({type:1,triggerAction:n,filter:r,autoApply:s,context:{notAvailableMessage:e,position:a}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,n,r){return nA(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(Ykt,e,tj.FromCodeActions,{preview:r,editor:this._editor})}finally{n&&this._trigger({type:2,triggerAction:uu.QuickFix,filter:{}})}})}update(e){var n,r,s,o,a,l,c;return nA(this,void 0,void 0,function*(){if(e.type!==1){(n=this._lightBulbWidget.rawValue)===null||n===void 0||n.hide();return}let u;try{u=yield e.actions}catch(d){Ln(d);return}if(!this._disposed)if((r=this._lightBulbWidget.value)===null||r===void 0||r.update(u,e.trigger,e.position),e.trigger.type===1){if(!((s=e.trigger.filter)===null||s===void 0)&&s.include){const h=this.tryGetValidActionToApply(e.trigger,u);if(h){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),yield this._applyCodeAction(h,!1,!1)}finally{u.dispose()}return}if(e.trigger.context){const f=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,u);if(f&&f.action.disabled){(a=au.get(this._editor))===null||a===void 0||a.showMessage(f.action.disabled,e.trigger.context.position),u.dispose();return}}}const d=!!(!((l=e.trigger.filter)===null||l===void 0)&&l.include);if(e.trigger.context&&(!u.allActions.length||!d&&!u.validActions.length)){(c=au.get(this._editor))===null||c===void 0||c.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=u,u.dispose();return}this._activeCodeActions.value=u,this.showCodeActionList(u,this.toCoords(e.position),{includeDisabledActions:d,fromLightbulb:!1})}else this._actionWidgetService.isVisible?u.dispose():this._activeCodeActions.value=u})}getInvalidActionThatWouldHaveBeenApplied(e,n){if(n.allActions.length&&(e.autoApply==="first"&&n.validActions.length===0||e.autoApply==="ifSingle"&&n.allActions.length===1))return n.allActions.find(({action:r})=>r.disabled)}tryGetValidActionToApply(e,n){if(n.validActions.length&&(e.autoApply==="first"&&n.validActions.length>0||e.autoApply==="ifSingle"&&n.validActions.length===1))return n.validActions[0]}showCodeActionList(e,n,r){return nA(this,void 0,void 0,function*(){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const a=r.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!a.length)return;const l=ve.isIPosition(n)?this.toCoords(n):n,c={onSelect:(u,d)=>nA(this,void 0,void 0,function*(){this._applyCodeAction(u,!0,!!d),this._actionWidgetService.hide(),s.clear()}),onHide:()=>{var u;(u=this._editor)===null||u===void 0||u.focus(),s.clear()},onHover:(u,d)=>nA(this,void 0,void 0,function*(){var h;if(yield u.resolve(d),!d.isCancellationRequested)return{canPreview:!!(!((h=u.action.edit)===null||h===void 0)&&h.edits.length)}}),onFocus:u=>{var d,h;if(u&&u.highlightRange&&u.action.diagnostics){const f=[{range:u.action.diagnostics[0],options:I8.DECORATION}];s.set(f);const p=u.action.diagnostics[0],g=(h=(d=this._editor.getModel())===null||d===void 0?void 0:d.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))===null||h===void 0?void 0:h.word;v1(L("editingNewSelection","Context: {0} at line {1} and column {2}.",g,p.startLineNumber,p.startColumn))}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,tLt(a,this._shouldShowHeaders(),this._resolver.getResolver()),c,l,o,this._getActionBarActions(e,n,r))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const n=this._editor.getScrolledVisiblePosition(e),r=no(this._editor.getDomNode()),s=r.left+n.left,o=r.top+n.top+n.height;return{x:s,y:o}}_shouldShowHeaders(){var e;const n=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:n==null?void 0:n.uri})}_getActionBarActions(e,n,r){if(r.fromLightbulb)return[];const s=e.documentation.map(o=>{var a;return{id:o.id,label:o.title,tooltip:(a=o.tooltip)!==null&&a!==void 0?a:"",class:void 0,enabled:!0,run:()=>{var l;return this._commandService.executeCommand(o.id,...(l=o.arguments)!==null&&l!==void 0?l:[])}}});return r.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:L("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,n,r))}:{id:"showMoreActions",label:L("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,n,r))}),s}};k1.ID="editor.contrib.codeActionController";k1.DECORATION=kn.register({description:"quickfix-highlight",className:_Lt});k1=I8=mLt([e0(1,h_),e0(2,mn),e0(3,hn),e0(4,Et),e0(5,Z1),e0(6,us),e0(7,ei),e0(8,ok),e0(9,hn)],k1);Of((i,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",i.getColor(xm));const r=i.getColor(by);r&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Vp(i.type)?"dotted":"solid"} ${r}; box-sizing: border-box; }`)});function t4(i){return ze.regex(dNe.keys()[0],new RegExp("(\\s|^)"+dd(i.value)+"\\b"))}const ele={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:L("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:L("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[L("args.schema.apply.first","Always apply the first returned code action."),L("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),L("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:L("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function ak(i,e,n,r,s=uu.Default){if(i.hasModel()){const o=k1.get(i);o==null||o.manualTriggerAtCurrentPosition(e,s,n,r)}}class vLt extends kt{constructor(){super({id:Zae,label:L("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ze.and(oe.writable,oe.hasCodeActionsProvider),kbOpts:{kbExpr:oe.textInputFocus,primary:2137,weight:100}})}run(e,n){return ak(n,L("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,uu.QuickFix)}}class bLt extends Ho{constructor(){super({id:eNe,precondition:ze.and(oe.writable,oe.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:ele}]}})}runEditorCommand(e,n,r){const s=mm.fromUser(r,{kind:cn.Empty,apply:"ifSingle"});return ak(n,typeof(r==null?void 0:r.kind)=="string"?s.preferred?L("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",r.kind):L("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",r.kind):s.preferred?L("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):L("editor.action.codeAction.noneMessage","No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class yLt extends kt{constructor(){super({id:nNe,label:L("refactor.label","Refactor..."),alias:"Refactor...",precondition:ze.and(oe.writable,oe.hasCodeActionsProvider),kbOpts:{kbExpr:oe.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ze.and(oe.writable,t4(cn.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:ele}]}})}run(e,n,r){const s=mm.fromUser(r,{kind:cn.Refactor,apply:"never"});return ak(n,typeof(r==null?void 0:r.kind)=="string"?s.preferred?L("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",r.kind):L("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",r.kind):s.preferred?L("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):L("editor.action.refactor.noneMessage","No refactorings available"),{include:cn.Refactor.contains(s.kind)?s.kind:cn.None,onlyIncludePreferredActions:s.preferred},s.apply,uu.Refactor)}}class wLt extends kt{constructor(){super({id:iNe,label:L("source.label","Source Action..."),alias:"Source Action...",precondition:ze.and(oe.writable,oe.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ze.and(oe.writable,t4(cn.Source))},description:{description:"Source Action...",args:[{name:"args",schema:ele}]}})}run(e,n,r){const s=mm.fromUser(r,{kind:cn.Source,apply:"never"});return ak(n,typeof(r==null?void 0:r.kind)=="string"?s.preferred?L("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",r.kind):L("editor.action.source.noneMessage.kind","No source actions for '{0}' available",r.kind):s.preferred?L("editor.action.source.noneMessage.preferred","No preferred source actions available"):L("editor.action.source.noneMessage","No source actions available"),{include:cn.Source.contains(s.kind)?s.kind:cn.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply,uu.SourceAction)}}class CLt extends kt{constructor(){super({id:Qae,label:L("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ze.and(oe.writable,t4(cn.SourceOrganizeImports)),kbOpts:{kbExpr:oe.textInputFocus,primary:1581,weight:100}})}run(e,n){return ak(n,L("editor.action.organize.noneMessage","No organize imports action available"),{include:cn.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",uu.OrganizeImports)}}class SLt extends kt{constructor(){super({id:Jae,label:L("fixAll.label","Fix All"),alias:"Fix All",precondition:ze.and(oe.writable,t4(cn.SourceFixAll))})}run(e,n){return ak(n,L("fixAll.noneMessage","No fix all action available"),{include:cn.SourceFixAll,includeSourceActions:!0},"ifSingle",uu.FixAll)}}class xLt extends kt{constructor(){super({id:tNe,label:L("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ze.and(oe.writable,t4(cn.QuickFix)),kbOpts:{kbExpr:oe.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,n){return ak(n,L("editor.action.autoFix.noneMessage","No auto fixes available"),{include:cn.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",uu.AutoFix)}}_i(k1.ID,k1,3);_i(Sx.ID,Sx,4);rt(vLt);rt(yLt);rt(wLt);rt(CLt);rt(xLt);rt(SLt);ct(new bLt);Kr.as(ag.Configuration).registerConfiguration(Object.assign(Object.assign({},j$),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:L("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));Kr.as(ag.Configuration).registerConfiguration(Object.assign(Object.assign({},j$),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:L("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var o0e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class Nte{constructor(){this.lenses=[],this._disposables=new Xe}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,n){this._disposables.add(e);for(const r of e.lenses)this.lenses.push({symbol:r,provider:n})}}function fNe(i,e,n){return o0e(this,void 0,void 0,function*(){const r=i.ordered(e),s=new Map,o=new Nte,a=r.map((l,c)=>o0e(this,void 0,void 0,function*(){s.set(l,c);try{const u=yield Promise.resolve(l.provideCodeLenses(e,n));u&&o.add(u,l)}catch(u){Us(u)}}));return yield Promise.all(a),o.lenses=o.lenses.sort((l,c)=>l.symbol.range.startLineNumber<c.symbol.range.startLineNumber?-1:l.symbol.range.startLineNumber>c.symbol.range.startLineNumber?1:s.get(l.provider)<s.get(c.provider)?-1:s.get(l.provider)>s.get(c.provider)?1:l.symbol.range.startColumn<c.symbol.range.startColumn?-1:l.symbol.range.startColumn>c.symbol.range.startColumn?1:0),o})}si.registerCommand("_executeCodeLensProvider",function(i,...e){let[n,r]=e;Ui(Jt.isUri(n)),Ui(typeof r=="number"||!r);const{codeLensProvider:s}=i.get(Et),o=i.get(Fr).getModel(n);if(!o)throw uh();const a=[],l=new Xe;return fNe(s,o,Hn.None).then(c=>{l.add(c);const u=[];for(const d of c.lenses)r==null||d.symbol.command?a.push(d.symbol):r-- >0&&d.provider.resolveCodeLens&&u.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,Hn.None)).then(h=>a.push(h||d.symbol)));return Promise.all(u)}).then(()=>a).finally(()=>{setTimeout(()=>l.dispose(),100)})});var kLt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},LLt=function(i,e){return function(n,r){e(n,r,i)}};const pNe=qn("ICodeLensCache");class a0e{constructor(e,n){this.lineCount=e,this.data=n}}let Mte=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new G1(20,.75);const n="codelens/cache";Z0(()=>e.remove(n,1));const r="codelens/cache2",s=e.get(r,1,"{}");this._deserialize(s),_t.once(e.onWillSaveState)(o=>{o.reason===E7.SHUTDOWN&&e.store(r,this._serialize(),1,1)})}put(e,n){const r=n.lenses.map(a=>{var l;return{range:a.symbol.range,command:a.symbol.command&&{id:"",title:(l=a.symbol.command)===null||l===void 0?void 0:l.title}}}),s=new Nte;s.add({lenses:r,dispose:()=>{}},this._fakeProvider);const o=new a0e(e.getLineCount(),s);this._cache.set(e.uri.toString(),o)}get(e){const n=this._cache.get(e.uri.toString());return n&&n.lineCount===e.getLineCount()?n.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[n,r]of this._cache){const s=new Set;for(const o of r.data.lenses)s.add(o.symbol.range.startLineNumber);e[n]={lineCount:r.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const n=JSON.parse(e);for(const r in n){const s=n[r],o=[];for(const l of s.lines)o.push({range:new J(l,1,l,11)});const a=new Nte;a.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(r,new a0e(s.lineCount,a))}}catch{}}};Mte=kLt([LLt(0,jf)],Mte);oi(pNe,Mte,1);class DLt{constructor(e,n,r){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=n,this._onHeight=r,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class bz{constructor(e,n){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${bz._idPool++}`,this.updatePosition(n),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,n){this._commands.clear();const r=[];let s=!1;for(let o=0;o<e.length;o++){const a=e[o];if(a&&(s=!0,a.command)){const l=Uy(a.command.title.trim());a.command.id?(r.push(tt("a",{id:String(o),title:a.command.tooltip,role:"button"},...l)),this._commands.set(String(o),a.command)):r.push(tt("span",{title:a.command.tooltip},...l)),o+1<e.length&&r.push(tt("span",void 0," | "))}}s?(ca(this._domNode,...r),this._isEmpty&&n&&this._domNode.classList.add("fadein"),this._isEmpty=!1):ca(this._domNode,tt("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const n=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:n},preference:[1]}}getPosition(){return this._widgetPosition||null}}bz._idPool=0;class hK{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,n){this._addDecorations.push(e),this._addDecorationsCallbacks.push(n)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const n=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let r=0,s=n.length;r<s;r++)this._addDecorationsCallbacks[r](n[r])}}const l0e=kn.register({collapseOnReplaceEdit:!0,description:"codelens"});class c0e{constructor(e,n,r,s,o,a){this._isDisposed=!1,this._editor=n,this._data=e,this._decorationIds=[];let l;const c=[];this._data.forEach((u,d)=>{u.symbol.command&&c.push(u.symbol),r.addDecoration({range:u.symbol.range,options:l0e},h=>this._decorationIds[d]=h),l?l=J.plusRange(l,u.symbol.range):l=J.lift(u.symbol.range)}),this._viewZone=new DLt(l.startLineNumber-1,o,a),this._viewZoneId=s.addZone(this._viewZone),c.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(c,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new bz(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,n){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],n==null||n.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,n)=>{const r=this._editor.getModel().getDecorationRange(e),s=this._data[n].symbol;return!!(r&&J.isEmpty(s.range)===r.isEmpty())})}updateCodeLensSymbols(e,n){this._decorationIds.forEach(n.removeDecoration,n),this._decorationIds=[],this._data=e,this._data.forEach((r,s)=>{n.addDecoration({range:r.symbol.range,options:l0e},o=>this._decorationIds[s]=o)})}updateHeight(e,n){this._viewZone.heightInPx=e,n.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let n=0;n<this._decorationIds.length;n++){const r=e.getDecorationRange(this._decorationIds[n]);r&&(this._data[n].symbol.range=r)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let n=0;n<this._data.length;n++){const r=e[n];if(r){const{symbol:s}=this._data[n];s.command=r.command||s.command}}}getCommand(e){var n;return(n=this._contentWidget)===null||n===void 0?void 0:n.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const n=this._editor.getModel().getDecorationRange(this._decorationIds[0]);n&&(this._viewZone.afterLineNumber=n.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(n.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}var ELt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},iA=function(i,e){return function(n,r){e(n,r,i)}},gNe=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let iI=class{constructor(e,n,r,s,o,a){this._editor=e,this._languageFeaturesService=n,this._commandService=s,this._notificationService=o,this._codeLensCache=a,this._disposables=new Xe,this._localToDispose=new Xe,this._lenses=[],this._oldCodeLensModels=new Xe,this._provideCodeLensDebounce=r.for(n.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=r.for(n.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Ji(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(l=>{(l.hasChanged(50)||l.hasChanged(19)||l.hasChanged(18))&&this._updateLensStyle(),l.hasChanged(17)&&this._onModelChange()})),this._disposables.add(n.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let n=this._editor.getOption(19);return(!n||n<5)&&(n=this._editor.getOption(52)*.9|0),{fontSize:n,codeLensHeight:n*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:n}=this._getLayoutInfo(),r=this._editor.getOption(18),s=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${n}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",s.fontFeatureSettings),r&&(o.setProperty("--vscode-editorCodeLens-fontFamily",r),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",su.fontFamily)),this._editor.changeViewZones(a=>{for(const l of this._lenses)l.updateHeight(e,a)})}_localDispose(){var e,n,r;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(r=this._currentCodeLensModel)===null||r===void 0||r.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const n=this._codeLensCache.get(e);if(n&&this._renderCodeLensSymbols(n),!this._languageFeaturesService.codeLensProvider.has(e)){n&&this._localToDispose.add(g1(()=>{const s=this._codeLensCache.get(e);n===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const s of this._languageFeaturesService.codeLensProvider.all(e))if(typeof s.onDidChange=="function"){const o=s.onDidChange(()=>r.schedule());this._localToDispose.add(o)}const r=new Ji(()=>{var s;const o=Date.now();(s=this._getCodeLensModelPromise)===null||s===void 0||s.cancel(),this._getCodeLensModelPromise=go(a=>fNe(this._languageFeaturesService.codeLensProvider,e,a)),this._getCodeLensModelPromise.then(a=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=a,this._codeLensCache.put(e,a);const l=this._provideCodeLensDebounce.update(e,Date.now()-o);r.delay=l,this._renderCodeLensSymbols(a),this._resolveCodeLensesInViewportSoon()},Ln)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(r),this._localToDispose.add(gn(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var s;this._editor.changeDecorations(o=>{this._editor.changeViewZones(a=>{const l=[];let c=-1;this._lenses.forEach(d=>{!d.isValid()||c===d.getLineNumber()?l.push(d):(d.update(a),c=d.getLineNumber())});const u=new hK;l.forEach(d=>{d.dispose(u,a),this._lenses.splice(this._lenses.indexOf(d),1)}),u.commit(o)})}),r.schedule(),this._resolveCodeLensesScheduler.cancel(),(s=this._resolveCodeLensesPromise)===null||s===void 0||s.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{r.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{r.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(gn(()=>{if(this._editor.getModel()){const s=Qp.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(a=>{this._disposeAllLenses(o,a)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==9)return;let o=s.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const a of this._lenses){const l=a.getCommand(o);if(l){this._commandService.executeCommand(l.id,...l.arguments||[]).catch(c=>this._notificationService.error(c));break}}})),r.schedule()}_disposeAllLenses(e,n){const r=new hK;for(const s of this._lenses)s.dispose(r,n);e&&r.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const n=this._editor.getModel().getLineCount(),r=[];let s;for(const l of e.lenses){const c=l.symbol.range.startLineNumber;c<1||c>n||(s&&s[s.length-1].symbol.range.startLineNumber===c?s.push(l):(s=[l],r.push(s)))}if(!r.length&&!this._lenses.length)return;const o=Qp.capture(this._editor),a=this._getLayoutInfo();this._editor.changeDecorations(l=>{this._editor.changeViewZones(c=>{const u=new hK;let d=0,h=0;for(;h<r.length&&d<this._lenses.length;){const f=r[h][0].symbol.range.startLineNumber,p=this._lenses[d].getLineNumber();p<f?(this._lenses[d].dispose(u,c),this._lenses.splice(d,1)):p===f?(this._lenses[d].updateCodeLensSymbols(r[h],u),h++,d++):(this._lenses.splice(d,0,new c0e(r[h],this._editor,u,c,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),d++,h++)}for(;d<this._lenses.length;)this._lenses[d].dispose(u,c),this._lenses.splice(d,1);for(;h<r.length;)this._lenses.push(new c0e(r[h],this._editor,u,c,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;u.commit(l)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const n=this._editor.getModel();if(!n)return;const r=[],s=[];if(this._lenses.forEach(l=>{const c=l.computeIfNecessary(n);c&&(r.push(c),s.push(l))}),r.length===0)return;const o=Date.now(),a=go(l=>{const c=r.map((u,d)=>{const h=new Array(u.length),f=u.map((p,g)=>!p.symbol.command&&typeof p.provider.resolveCodeLens=="function"?Promise.resolve(p.provider.resolveCodeLens(n,p.symbol,l)).then(m=>{h[g]=m},Us):(h[g]=p.symbol,Promise.resolve(void 0)));return Promise.all(f).then(()=>{!l.isCancellationRequested&&!s[d].isDisposed()&&s[d].updateCommands(h)})});return Promise.all(c)});this._resolveCodeLensesPromise=a,this._resolveCodeLensesPromise.then(()=>{const l=this._resolveCodeLensesDebounce.update(n,Date.now()-o);this._resolveCodeLensesScheduler.delay=l,this._currentCodeLensModel&&this._codeLensCache.put(n,this._currentCodeLensModel),this._oldCodeLensModels.clear(),a===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},l=>{Ln(l),a===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return gNe(this,void 0,void 0,function*(){return yield this._getCodeLensModelPromise,yield this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel})}};iI.ID="css.editor.codeLens";iI=ELt([iA(1,Et),iA(2,xh),iA(3,us),iA(4,Ps),iA(5,pNe)],iI);_i(iI.ID,iI,1);rt(class extends kt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:oe.hasCodeLensProvider,label:L("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,n){return gNe(this,void 0,void 0,function*(){if(!n.hasModel())return;const r=e.get(lg),s=e.get(us),o=e.get(Ps),a=n.getSelection().positionLineNumber,l=n.getContribution(iI.ID);if(!l)return;const c=yield l.getModel();if(!c)return;const u=[];for(const f of c.lenses)f.symbol.command&&f.symbol.range.startLineNumber===a&&u.push({label:f.symbol.command.title,command:f.symbol.command});if(u.length===0)return;const d=yield r.pick(u,{canPickMany:!1,placeHolder:L("placeHolder","Select a command")});if(!d)return;let h=d.command;if(c.isDisposed){const f=yield l.getModel(),p=f==null?void 0:f.lenses.find(g=>{var m;return g.symbol.range.startLineNumber===a&&((m=g.symbol.command)===null||m===void 0?void 0:m.title)===h.title});if(!p||!p.symbol.command)return;h=p.symbol.command}try{yield s.executeCommand(h.id,...h.arguments||[])}catch(f){o.error(f)}})}});var ILt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},fK=function(i,e){return function(n,r){e(n,r,i)}},TLt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class tle{constructor(e,n){this._editorWorkerClient=new aoe(e,!1,"editorWorkerService",n)}provideDocumentColors(e,n){return TLt(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,n,r){const s=n.range,o=n.color,a=o.alpha,l=new Te(new ii(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),a)),c=a?Te.Format.CSS.formatRGB(l):Te.Format.CSS.formatRGBA(l),u=a?Te.Format.CSS.formatHSL(l):Te.Format.CSS.formatHSLA(l),d=a?Te.Format.CSS.formatHex(l):Te.Format.CSS.formatHexA(l),h=[];return h.push({label:c,textEdit:{range:s,text:c}}),h.push({label:u,textEdit:{range:s,text:u}}),h.push({label:d,textEdit:{range:s,text:d}}),h}}let Pte=class extends Le{constructor(e,n,r){super(),this._register(r.colorProvider.register("*",new tle(e,n)))}};Pte=ILt([fK(0,Fr),fK(1,dr),fK(2,Et)],Pte);sz(Pte);var n4=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function mNe(i,e,n,r=!0){return n4(this,void 0,void 0,function*(){return nle(new RLt,i,e,n,r)})}function _Ne(i,e,n,r){return Promise.resolve(n.provideColorPresentations(i,e,r))}class RLt{constructor(){}compute(e,n,r,s){return n4(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(n,r);if(Array.isArray(o))for(const a of o)s.push({colorInfo:a,provider:e});return Array.isArray(o)})}}class ALt{constructor(){}compute(e,n,r,s){return n4(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(n,r);if(Array.isArray(o))for(const a of o)s.push({range:a.range,color:[a.color.red,a.color.green,a.color.blue,a.color.alpha]});return Array.isArray(o)})}}class NLt{constructor(e){this.colorInfo=e}compute(e,n,r,s){return n4(this,void 0,void 0,function*(){const o=yield e.provideColorPresentations(n,this.colorInfo,Hn.None);return Array.isArray(o)&&s.push(...o),Array.isArray(o)})}}function nle(i,e,n,r,s){return n4(this,void 0,void 0,function*(){let o=!1,a;const l=[],c=e.ordered(n);for(let u=c.length-1;u>=0;u--){const d=c[u];if(d instanceof tle)a=d;else try{(yield i.compute(d,n,r,l))&&(o=!0)}catch(h){Us(h)}}return o?l:a&&s?(yield i.compute(a,n,r,l),l):[]})}function vNe(i,e){const{colorProvider:n}=i.get(Et),r=i.get(Fr).getModel(e);if(!r)throw uh();const s=i.get(ei).getValue("editor.defaultColorDecorators",{resource:e});return{model:r,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:s}}si.registerCommand("_executeDocumentColorProvider",function(i,...e){const[n]=e;if(!(n instanceof Jt))throw uh();const{model:r,colorProviderRegistry:s,isDefaultColorDecoratorsEnabled:o}=vNe(i,n);return nle(new ALt,s,r,Hn.None,o)});si.registerCommand("_executeColorPresentationProvider",function(i,...e){const[n,r]=e,{uri:s,range:o}=r;if(!(s instanceof Jt)||!Array.isArray(n)||n.length!==4||!J.isIRange(o))throw uh();const{model:a,colorProviderRegistry:l,isDefaultColorDecoratorsEnabled:c}=vNe(i,s),[u,d,h,f]=n;return nle(new NLt({range:o,color:{red:u,green:d,blue:h,alpha:f}}),l,a,Hn.None,c)});var MLt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},pK=function(i,e){return function(n,r){e(n,r,i)}},u0e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},Ote;const bNe=Object.create({});let L1=Ote=class extends Le{constructor(e,n,r,s){super(),this._editor=e,this._configurationService=n,this._languageFeaturesService=r,this._localToDispose=this._register(new Xe),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new A5(this._editor),this._decoratorLimitReporter=new PLt,this._colorDecorationClassRefs=this._register(new Xe),this._debounceInformation=s.for(r.colorProvider,"Document Colors",{min:Ote.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(r.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const a=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const l=a!==this._isColorDecoratorsEnabled||o.hasChanged(21),c=o.hasChanged(145);(l||c)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const n=e.getLanguageId(),r=this._configurationService.getValue(n);if(r&&typeof r=="object"){const s=r.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Mf,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return u0e(this,void 0,void 0,function*(){this._computePromise=go(e=>u0e(this,void 0,void 0,function*(){const n=this._editor.getModel();if(!n)return[];const r=new Xa(!1),s=yield mNe(this._languageFeaturesService.colorProvider,n,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(n,r.elapsed()),s}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Ln(e)}})}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const n=e.map(r=>({range:{startLineNumber:r.colorInfo.range.startLineNumber,startColumn:r.colorInfo.range.startColumn,endLineNumber:r.colorInfo.range.endLineNumber,endColumn:r.colorInfo.range.endColumn},options:kn.EMPTY}));this._editor.changeDecorations(r=>{this._decorationsIds=r.deltaDecorations(this._decorationsIds,n),this._colorDatas=new Map,this._decorationsIds.forEach((s,o)=>this._colorDatas.set(s,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const n=[],r=this._editor.getOption(21);for(let o=0;o<e.length&&n.length<r;o++){const{red:a,green:l,blue:c,alpha:u}=e[o].colorInfo.color,d=new ii(Math.round(a*255),Math.round(l*255),Math.round(c*255),u),h=`rgba(${d.r}, ${d.g}, ${d.b}, ${d.a})`,f=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:h}));n.push({range:{startLineNumber:e[o].colorInfo.range.startLineNumber,startColumn:e[o].colorInfo.range.startColumn,endLineNumber:e[o].colorInfo.range.endLineNumber,endColumn:e[o].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:eEe,inlineClassName:`${f.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:bNe}}})}const s=r<e.length?r:!1;this._decoratorLimitReporter.update(e.length,s),this._colorDecoratorIds.set(n)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const n=this._editor.getModel();if(!n)return null;const r=n.getDecorationsInRange(J.fromPositions(e,e)).filter(s=>this._colorDatas.has(s.id));return r.length===0?null:this._colorDatas.get(r[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};L1.ID="editor.contrib.colorDetector";L1.RECOMPUTE_TIME=1e3;L1=Ote=MLt([pK(1,ei),pK(2,Et),pK(3,xh)],L1);class PLt{constructor(){this._onDidChange=new _e,this._computed=0,this._limited=!1}update(e,n){(e!==this._computed||n!==this._limited)&&(this._computed=e,this._limited=n,this._onDidChange.fire())}}_i(L1.ID,L1,1);class OLt{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,n,r){this.presentationIndex=r,this._onColorFlushed=new _e,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new _e,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new _e,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=n}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,n){let r=-1;for(let s=0;s<this.colorPresentations.length;s++)if(n.toLowerCase()===this.colorPresentations[s].label){r=s;break}if(r===-1){const s=n.split("(")[0].toLowerCase();for(let o=0;o<this.colorPresentations.length;o++)if(this.colorPresentations[o].label.toLowerCase().startsWith(s)){r=o;break}}r!==-1&&r!==this.presentationIndex&&(this.presentationIndex=r,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const Gu=tt;class FLt extends Le{constructor(e,n,r,s=!1){super(),this.model=n,this.showingStandaloneColorPicker=s,this._closeButton=null,this._domNode=Gu(".colorpicker-header"),He(e,this._domNode),this._pickedColorNode=He(this._domNode,Gu(".picked-color")),He(this._pickedColorNode,Gu("span.codicon.codicon-color-mode")),this._pickedColorPresentation=He(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const o=L("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",o),this._originalColorNode=He(this._domNode,Gu(".original-color")),this._originalColorNode.style.backgroundColor=Te.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=r.getColorTheme().getColor(e7)||Te.white,this._register(r.onDidColorThemeChange(a=>{this.backgroundColor=a.getColor(e7)||Te.white})),this._register(Be(this._pickedColorNode,ht.CLICK,()=>this.model.selectNextColorPresentation())),this._register(Be(this._originalColorNode,ht.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(n.onDidChangeColor(this.onDidChangeColor,this)),this._register(n.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=Te.Format.CSS.format(n.color)||"",this._pickedColorNode.classList.toggle("light",n.color.rgba.a<.5?this.backgroundColor.isLighter():n.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new BLt(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Te.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}let BLt=class extends Le{constructor(e){super(),this._onClicked=this._register(new _e),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),He(e,this._button);const n=document.createElement("div");n.classList.add("close-button-inner-div"),He(this._button,n),He(n,Gu(".button"+en.asCSSSelector(ws("color-picker-close",lt.close,L("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}};class jLt extends Le{constructor(e,n,r,s=!1){super(),this.model=n,this.pixelRatio=r,this._insertButton=null,this._domNode=Gu(".colorpicker-body"),He(e,this._domNode),this._saturationBox=new WLt(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new $Lt(this._domNode,this.model,s),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new zLt(this._domNode,this.model,s),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),s&&(this._insertButton=this._register(new VLt(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:n}){const r=this.model.color.hsva;this.model.color=new Te(new vm(r.h,e,n,r.a))}onDidOpacityChange(e){const n=this.model.color.hsva;this.model.color=new Te(new vm(n.h,n.s,n.v,e))}onDidHueChange(e){const n=this.model.color.hsva,r=(1-e)*360;this.model.color=new Te(new vm(r===360?0:r,n.s,n.v,n.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class WLt extends Le{constructor(e,n,r){super(),this.model=n,this.pixelRatio=r,this._onDidChange=new _e,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new _e,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Gu(".saturation-wrap"),He(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",He(this._domNode,this._canvas),this.selection=Gu(".saturation-selection"),He(this._domNode,this.selection),this.layout(),this._register(Be(this._domNode,ht.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new $I);const n=no(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangePosition(s.pageX-n.left,s.pageY-n.top),()=>null);const r=Be(e.target.ownerDocument,ht.POINTER_UP,()=>{this._onColorFlushed.fire(),r.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,n){const r=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-n/this.height));this.paintSelection(r,s),this._onDidChange.fire({s:r,v:s})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,n=new Te(new vm(e.h,1,1,1)),r=this._canvas.getContext("2d"),s=r.createLinearGradient(0,0,this._canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const o=r.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),r.rect(0,0,this._canvas.width,this._canvas.height),r.fillStyle=Te.Format.CSS.format(n),r.fill(),r.fillStyle=s,r.fill(),r.fillStyle=o,r.fill()}paintSelection(e,n){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-n*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const n=e.hsva;this.paintSelection(n.s,n.v)}}class yNe extends Le{constructor(e,n,r=!1){super(),this.model=n,this._onDidChange=new _e,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new _e,this.onColorFlushed=this._onColorFlushed.event,r?(this.domNode=He(e,Gu(".standalone-strip")),this.overlay=He(this.domNode,Gu(".standalone-overlay"))):(this.domNode=He(e,Gu(".strip")),this.overlay=He(this.domNode,Gu(".overlay"))),this.slider=He(this.domNode,Gu(".slider")),this.slider.style.top="0px",this._register(Be(this.domNode,ht.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(n.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const n=this.getValue(e);this.updateSliderPosition(n)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const n=this._register(new $I),r=no(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),n.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-r.top),()=>null);const s=Be(e.target.ownerDocument,ht.POINTER_UP,()=>{this._onColorFlushed.fire(),s.dispose(),n.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const n=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(n),this._onDidChange.fire(n)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class $Lt extends yNe{constructor(e,n,r=!1){super(e,n,r),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:n,g:r,b:s}=e.rgba,o=new Te(new ii(n,r,s,1)),a=new Te(new ii(n,r,s,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${a} 100%)`}getValue(e){return e.hsva.a}}class zLt extends yNe{constructor(e,n,r=!1){super(e,n,r),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class VLt extends Le{constructor(e){super(),this._onClicked=this._register(new _e),this.onClicked=this._onClicked.event,this._button=He(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=n=>{this._onClicked.fire()}}get button(){return this._button}}class HLt extends Pf{constructor(e,n,r,s,o=!1){super(),this.model=n,this.pixelRatio=r,this._register(lP.onDidChange(()=>this.layout()));const a=Gu(".colorpicker-widget");e.appendChild(a),this.header=this._register(new FLt(a,this.model,s,o)),this.body=this._register(new jLt(a,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var wNe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},CNe=function(i,e){return function(n,r){e(n,r,i)}},rI=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class ULt{constructor(e,n,r,s){this.owner=e,this.range=n,this.model=r,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let ij=class{constructor(e,n){this._editor=e,this._themeService=n,this.hoverOrdinal=2}computeSync(e,n){return[]}computeAsync(e,n,r){return zs.fromPromise(this._computeAsync(e,n,r))}_computeAsync(e,n,r){return rI(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const s=L1.get(this._editor);if(!s)return[];for(const o of n){if(!s.isColorDecoration(o))continue;const a=s.getColorData(o.range.getStartPosition());if(a)return[yield SNe(this,this._editor.getModel(),a.colorInfo,a.provider)]}return[]})}renderHoverParts(e,n){return xNe(this,this._editor,this._themeService,n,e)}};ij=wNe([CNe(1,Do)],ij);class qLt{constructor(e,n,r,s){this.owner=e,this.range=n,this.model=r,this.provider=s}}let oO=class{constructor(e,n){this._editor=e,this._themeService=n,this._color=null}createColorHover(e,n,r){return rI(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!L1.get(this._editor))return null;const o=yield mNe(r,this._editor.getModel(),Hn.None);let a=null,l=null;for(const h of o){const f=h.colorInfo;J.containsRange(f.range,e.range)&&(a=f,l=h.provider)}const c=a??e,u=l??n,d=!!a;return{colorHover:yield SNe(this,this._editor.getModel(),c,u),foundInEditor:d}})}updateEditorModel(e){return rI(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const n=e.model;let r=new J(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield T8(this._editor.getModel(),n,this._color,r,e),r=kNe(this._editor,r,n))})}renderHoverParts(e,n){return xNe(this,this._editor,this._themeService,n,e)}set color(e){this._color=e}get color(){return this._color}};oO=wNe([CNe(1,Do)],oO);function SNe(i,e,n,r){return rI(this,void 0,void 0,function*(){const s=e.getValueInRange(n.range),{red:o,green:a,blue:l,alpha:c}=n.color,u=new ii(Math.round(o*255),Math.round(a*255),Math.round(l*255),c),d=new Te(u),h=yield _Ne(e,n,r,Hn.None),f=new OLt(d,[],0);return f.colorPresentations=h||[],f.guessColorPresentation(d,s),i instanceof ij?new ULt(i,J.lift(n.range),f,r):new qLt(i,J.lift(n.range),f,r)})}function xNe(i,e,n,r,s){if(r.length===0||!e.hasModel())return Le.None;if(s.setMinimumDimensions){const f=e.getOption(66)+8;s.setMinimumDimensions(new bi(302,f))}const o=new Xe,a=r[0],l=e.getModel(),c=a.model,u=o.add(new HLt(s.fragment,c,e.getOption(141),n,i instanceof oO));s.setColorPicker(u);let d=!1,h=new J(a.range.startLineNumber,a.range.startColumn,a.range.endLineNumber,a.range.endColumn);if(i instanceof oO){const f=r[0].model.color;i.color=f,T8(l,c,f,h,a),o.add(c.onColorFlushed(p=>{i.color=p}))}else o.add(c.onColorFlushed(f=>rI(this,void 0,void 0,function*(){yield T8(l,c,f,h,a),d=!0,h=kNe(e,h,c,s)})));return o.add(c.onDidChangeColor(f=>{T8(l,c,f,h,a)})),o.add(e.onDidChangeModelContent(f=>{d?d=!1:(s.hide(),e.focus())})),o}function kNe(i,e,n,r){let s,o;if(n.presentation.textEdit){s=[n.presentation.textEdit],o=new J(n.presentation.textEdit.range.startLineNumber,n.presentation.textEdit.range.startColumn,n.presentation.textEdit.range.endLineNumber,n.presentation.textEdit.range.endColumn);const a=i.getModel()._setTrackedRange(null,o,3);i.pushUndoStop(),i.executeEdits("colorpicker",s),o=i.getModel()._getTrackedRange(a)||o}else s=[{range:e,text:n.presentation.label,forceMoveMarkers:!1}],o=e.setEndPosition(e.endLineNumber,e.startColumn+n.presentation.label.length),i.pushUndoStop(),i.executeEdits("colorpicker",s);return n.presentation.additionalTextEdits&&(s=[...n.presentation.additionalTextEdits],i.executeEdits("colorpicker",s),r&&r.hide()),i.pushUndoStop(),o}function T8(i,e,n,r,s){return rI(this,void 0,void 0,function*(){const o=yield _Ne(i,{range:r,color:{red:n.rgba.r/255,green:n.rgba.g/255,blue:n.rgba.b/255,alpha:n.rgba.a}},s.provider,Hn.None);e.colorPresentations=o||[]})}function Fte(i,e){return!!i[e]}class gK{constructor(e,n){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Fte(e.event,n.triggerModifier),this.hasSideBySideModifier=Fte(e.event,n.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class d0e{constructor(e,n){this.keyCodeIsTriggerKey=e.keyCode===n.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===n.triggerSideBySideKey,this.hasTriggerModifier=Fte(e,n.triggerModifier)}}class k6{constructor(e,n,r,s){this.triggerKey=e,this.triggerModifier=n,this.triggerSideBySideKey=r,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function h0e(i){return i==="altKey"?ri?new k6(57,"metaKey",6,"altKey"):new k6(5,"ctrlKey",6,"altKey"):ri?new k6(6,"altKey",57,"metaKey"):new k6(6,"altKey",5,"ctrlKey")}class yz extends Le{constructor(e,n){var r;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new _e),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new _e),this.onExecute=this._onExecute.event,this._onCancel=this._register(new _e),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(r=n==null?void 0:n.extractLineNumberFromMouseEvent)!==null&&r!==void 0?r:s=>s.target.position?s.target.position.lineNumber:0,this._opts=h0e(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(s=>{if(s.hasChanged(77)){const o=h0e(this._editor.getOption(77));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(s=>this._onEditorMouseMove(new gK(s,this._opts)))),this._register(this._editor.onMouseDown(s=>this._onEditorMouseDown(new gK(s,this._opts)))),this._register(this._editor.onMouseUp(s=>this._onEditorMouseUp(new gK(s,this._opts)))),this._register(this._editor.onKeyDown(s=>this._onEditorKeyDown(new d0e(s,this._opts)))),this._register(this._editor.onKeyUp(s=>this._onEditorKeyUp(new d0e(s,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(s=>this._onDidChangeCursorSelection(s))),this._register(this._editor.onDidChangeModel(s=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(s=>{(s.scrollTopChanged||s.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const n=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===n&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var KLt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},t0=function(i,e){return function(n,r){e(n,r,i)}};let D1=class extends qE{constructor(e,n,r,s,o,a,l,c,u,d,h,f,p){super(e,Object.assign(Object.assign({},s.getRawOptions()),{overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()}),r,o,a,l,c,u,d,h,f,p),this._parentEditor=s,this._overwriteOptions=n,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){XW(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};D1=KLt([t0(4,hn),t0(5,Si),t0(6,us),t0(7,mn),t0(8,Do),t0(9,Ps),t0(10,zv),t0(11,dr),t0(12,Et)],D1);const f0e=new Te(new ii(0,122,204)),GLt={showArrow:!0,showFrame:!0,className:"",frameColor:f0e,arrowColor:f0e,keepEditorSelection:!1},XLt="vs.editor.contrib.zoneWidget";class YLt{constructor(e,n,r,s,o,a,l,c){this.id="",this.domNode=e,this.afterLineNumber=n,this.afterColumn=r,this.heightInLines=s,this.showInHiddenAreas=l,this.ordinal=c,this._onDomNodeTop=o,this._onComputedHeight=a}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class ZLt{constructor(e,n){this._id=e,this._domNode=n}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class wz{constructor(e){this._editor=e,this._ruleName=wz._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),cpe(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){cpe(this._ruleName),cJ(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:J.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}wz._IdGenerator=new lae(".arrow-decoration-");class QLt{constructor(e,n={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Xe,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=T0(n),XW(this.options,GLt,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(r=>{const s=this._getWidth(r);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(r)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new wz(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var n;if(this.domNode.style.height=`${e}px`,this.container){const r=e-this._decoratingElementsHeight();this.container.style.height=`${r}px`;const s=this.editor.getLayoutInfo();this._doLayout(r,this._getWidth(s))}(n=this._resizeSash)===null||n===void 0||n.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,n){const r=J.isIRange(e)?J.lift(e):J.fromPositions(e);this._isShowing=!0,this._showImpl(r,n),this._isShowing=!1,this._positionMarkerId.set([{range:r,options:kn.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(n=>{this._viewZone&&n.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let n=0;if(this.options.showArrow){const r=Math.round(e/3);n+=2*r}if(this.options.showFrame){const r=Math.round(e/9);n+=2*r}return n}_showImpl(e,n){const r=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const a=document.createElement("div");a.style.overflow="hidden";const l=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const f=Math.max(12,this.editor.getLayoutInfo().height/l*.8);n=Math.min(n,f)}let c=0,u=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(l/3),this._arrow.height=c,this._arrow.show(r)),this.options.showFrame&&(u=Math.round(l/9)),this.editor.changeViewZones(f=>{this._viewZone&&f.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new YLt(a,r.lineNumber,r.column,n,p=>this._onViewZoneTop(p),p=>this._onViewZoneHeight(p),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=f.addZone(this._viewZone),this._overlayWidget=new ZLt(XLt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const f=this.options.frameWidth?this.options.frameWidth:u;this.container.style.borderTopWidth=f+"px",this.container.style.borderBottomWidth=f+"px"}const d=n*l-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const f=h.validateRange(new J(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(f,f.startLineNumber===h.getLineCount())}}revealRange(e,n){n?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,n){this.container&&(n&&this.container.classList.remove(n),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,n){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(n=>{this._viewZone&&(this._viewZone.heightInLines=e,n.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new ja(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(n=>{this._viewZone&&(e={startY:n.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(n=>{if(e){const r=(n.currentY-e.startY)/this.editor.getOption(66),s=r<0?Math.ceil(r):Math.floor(r),o=e.heightInLines+s;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var LNe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},DNe=function(i,e){return function(n,r){e(n,r,i)}};const ENe=qn("IPeekViewService");oi(ENe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const n=this._widgets.get(i);n&&(n.listener.dispose(),n.widget.dispose());const r=()=>{const s=this._widgets.get(i);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(r)})}},1);var xc;(function(i){i.inPeekEditor=new yt("inReferenceSearchEditor",!0,L("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(xc||(xc={}));let aO=class{constructor(e,n){e instanceof D1&&xc.inPeekEditor.bindTo(n)}dispose(){}};aO.ID="editor.contrib.referenceController";aO=LNe([DNe(1,mn)],aO);_i(aO.ID,aO,0);function JLt(i){const e=i.get(Si).getFocusedCodeEditor();return e instanceof D1?e.getParentEditor():e}const eDt={headerBackgroundColor:Te.white,primaryHeadingColor:Te.fromHex("#333333"),secondaryHeadingColor:Te.fromHex("#6c6c6cb3")};let rj=class extends QLt{constructor(e,n,r){super(e,n),this.instantiationService=r,this._onDidClose=new _e,this.onDidClose=this._onDidClose.event,XW(this.options,eDt,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const n=this.options;e.headerBackgroundColor&&(n.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(n.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(n.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=tt(".head"),this._bodyElement=tt(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,n){this._titleElement=tt(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),As(this._titleElement,"click",o=>this._onTitleClick(o))),He(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=tt("span.filename"),this._secondaryHeading=tt("span.dirname"),this._metaHeading=tt("span.meta"),He(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const r=tt(".peekview-actions");He(this._headElement,r);const s=this._getActionBarOptions();this._actionbarWidget=new wh(r,s),this._disposables.add(this._actionbarWidget),n||this._actionbarWidget.push(new Vl("peekview.close",L("label.close","Close"),en.asClassName(lt.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:oyt.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,n){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),n?this._secondaryHeading.innerText=n:la(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Jc(this._metaHeading)):Pl(this._metaHeading))}_doLayout(e,n){if(!this._isShowing&&e<0){this.dispose();return}const r=Math.ceil(this.editor.getOption(66)*1.2),s=Math.round(e-(r+2));this._doLayoutHead(r,n),this._doLayoutBody(s,n)}_doLayoutHead(e,n){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,n){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};rj=LNe([DNe(2,hn)],rj);const tDt=ce("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Te.black,hcLight:Te.white},L("peekViewTitleBackground","Background color of the peek view title area.")),INe=ce("peekViewTitleLabel.foreground",{dark:Te.white,light:Te.black,hcDark:Te.white,hcLight:_f},L("peekViewTitleForeground","Color of the peek view title.")),TNe=ce("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},L("peekViewTitleInfoForeground","Color of the peek view title info.")),nDt=ce("peekView.border",{dark:_c,light:_c,hcDark:Jn,hcLight:Jn},L("peekViewBorder","Color of the peek view borders and arrow.")),iDt=ce("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Te.black,hcLight:Te.white},L("peekViewResultsBackground","Background color of the peek view result list."));ce("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Te.white,hcLight:_f},L("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));ce("peekViewResult.fileForeground",{dark:Te.white,light:"#1E1E1E",hcDark:Te.white,hcLight:_f},L("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));ce("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},L("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));ce("peekViewResult.selectionForeground",{dark:Te.white,light:"#6C6C6C",hcDark:Te.white,hcLight:_f},L("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const ky=ce("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Te.black,hcLight:Te.white},L("peekViewEditorBackground","Background color of the peek view editor."));ce("peekViewEditorGutter.background",{dark:ky,light:ky,hcDark:ky,hcLight:ky},L("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));ce("peekViewEditorStickyScroll.background",{dark:ky,light:ky,hcDark:ky,hcLight:ky},L("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));ce("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},L("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));ce("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},L("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));ce("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Dr,hcLight:Dr},L("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var rDt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class E1{constructor(e,n,r,s){this.isProviderFirst=e,this.parent=n,this.link=r,this._rangeCallback=s,this.id=yee.nextId()}get uri(){return this.link.uri}get range(){var e,n;return(n=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&n!==void 0?n:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const n=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return n?L({},"{0} in {1} on line {2} at column {3}",n.value,yh(this.uri),this.range.startLineNumber,this.range.startColumn):L("aria.oneReference","in {0} on line {1} at column {2}",yh(this.uri),this.range.startLineNumber,this.range.startColumn)}}class sDt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,n=8){const r=this._modelReference.object.textEditorModel;if(!r)return;const{startLineNumber:s,startColumn:o,endLineNumber:a,endColumn:l}=e,c=r.getWordUntilPosition({lineNumber:s,column:o-n}),u=new J(s,c.startColumn,s,o),d=new J(a,l,a,1073741824),h=r.getValueInRange(u).replace(/^\s+/,""),f=r.getValueInRange(e),p=r.getValueInRange(d).replace(/\s+$/,"");return{value:h+f+p,highlight:{start:h.length,end:h.length+f.length}}}}class lO{constructor(e,n){this.parent=e,this.uri=n,this.children=[],this._previews=new Va}dispose(){Mi(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?L("aria.fileReferences.1","1 symbol in {0}, full path {1}",yh(this.uri),this.uri.fsPath):L("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,yh(this.uri),this.uri.fsPath)}resolve(e){return rDt(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const n of this.children)if(!this._previews.has(n.uri))try{const r=yield e.createModelReference(n.uri);this._previews.set(n.uri,new sDt(r))}catch(r){Ln(r)}return this})}}class lu{constructor(e,n){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new _e,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=n;const[r]=e;e.sort(lu._compareReferences);let s;for(const o of e)if((!s||!Er.isEqual(s.uri,o.uri,!0))&&(s=new lO(this,o.uri),this.groups.push(s)),s.children.length===0||lu._compareReferences(o,s.children[s.children.length-1])!==0){const a=new E1(r===o,s,o,l=>this._onDidChangeReferenceRange.fire(l));this.references.push(a),s.children.push(a)}}dispose(){Mi(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new lu(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?L("aria.result.0","No results found"):this.references.length===1?L("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?L("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):L("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,n){const{parent:r}=e;let s=r.children.indexOf(e);const o=r.children.length,a=r.parent.groups.length;return a===1||n&&s+1<o||!n&&s>0?(n?s=(s+1)%o:s=(s+o-1)%o,r.children[s]):(s=r.parent.groups.indexOf(r),n?(s=(s+1)%a,r.parent.groups[s].children[0]):(s=(s+a-1)%a,r.parent.groups[s].children[r.parent.groups[s].children.length-1]))}nearestReference(e,n){const r=this.references.map((s,o)=>({idx:o,prefixLen:ax(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-n.lineNumber)*100+Math.abs(s.range.startColumn-n.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLen<o.prefixLen?1:s.offsetDist<o.offsetDist?-1:s.offsetDist>o.offsetDist?1:0)[0];if(r)return this.references[r.idx]}referenceAt(e,n){for(const r of this.references)if(r.uri.toString()===e.toString()&&J.containsPosition(r.range,n))return r}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,n){return Er.compare(e.uri,n.uri)||J.compareRangesUsingStarts(e.range,n.range)}}var Cz=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Sz=function(i,e){return function(n,r){e(n,r,i)}},Bte;let jte=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof lu||e instanceof lO}getChildren(e){if(e instanceof lu)return e.groups;if(e instanceof lO)return e.resolve(this._resolverService).then(n=>n.children);throw new Error("bad tree")}};jte=Cz([Sz(0,Ec)],jte);class oDt{getHeight(){return 23}getTemplateId(e){return e instanceof lO?cO.id:i4.id}}let Wte=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var n;if(e instanceof E1){const r=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(r)return r.value}return yh(e.uri)}};Wte=Cz([Sz(0,sr)],Wte);class aDt{getId(e){return e instanceof E1?e.id:e.uri}}let $te=class extends Le{constructor(e,n){super(),this._labelService=n;const r=document.createElement("div");r.classList.add("reference-file"),this.file=this._register(new z7(r,{supportHighlights:!0})),this.badge=new Hee(He(r,tt(".count")),{},iRe),e.appendChild(r)}set(e,n){const r=M$(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(r,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:n});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(L("referencesCount","{0} references",s)):this.badge.setTitleFormat(L("referenceCount","{0} reference",s))}};$te=Cz([Sz(1,KE)],$te);let cO=Bte=class{constructor(e){this._instantiationService=e,this.templateId=Bte.id}renderTemplate(e){return this._instantiationService.createInstance($te,e)}renderElement(e,n,r){r.set(e.element,z5(e.filterData))}disposeTemplate(e){e.dispose()}};cO.id="FileReferencesRenderer";cO=Bte=Cz([Sz(0,hn)],cO);class lDt{constructor(e){this.label=new Ky(e)}set(e,n){var r;const s=(r=e.parent.getPreview(e))===null||r===void 0?void 0:r.preview(e.range);if(!s||!s.value)this.label.set(`${yh(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:a}=s;n&&!Hp.isDefault(n)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,z5(n))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[a]))}}}class i4{constructor(){this.templateId=i4.id}renderTemplate(e){return new lDt(e)}renderElement(e,n,r){r.set(e.element,e.filterData)}disposeTemplate(){}}i4.id="OneReferenceRenderer";class cDt{getWidgetAriaLabel(){return L("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var uDt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},n0=function(i,e){return function(n,r){e(n,r,i)}},p0e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class xz{constructor(e,n){this._editor=e,this._model=n,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Xe,this._callOnModelChange=new Xe,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const n of this._model.references)if(n.uri.toString()===e.uri.toString()){this._addDecorations(n.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const n=[],r=[];for(let s=0,o=e.children.length;s<o;s++){const a=e.children[s];this._decorationIgnoreSet.has(a.id)||a.uri.toString()===this._editor.getModel().uri.toString()&&(n.push({range:a.range,options:xz.DecorationOptions}),r.push(s))}this._editor.changeDecorations(s=>{const o=s.deltaDecorations([],n);for(let a=0;a<o.length;a++)this._decorations.set(o[a],e.children[r[a]])})}_onDecorationChanged(){const e=[],n=this._editor.getModel();if(n){for(const[r,s]of this._decorations){const o=n.getDecorationRange(r);if(!o)continue;let a=!1;if(!J.equalsRange(o,s.range)){if(J.spansMultipleLines(o))a=!0;else{const l=s.range.endColumn-s.range.startColumn,c=o.endColumn-o.startColumn;l!==c&&(a=!0)}a?(this._decorationIgnoreSet.add(s.id),e.push(r)):s.range=o}}for(let r=0,s=e.length;r<s;r++)this._decorations.delete(e[r]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}xz.DecorationOptions=kn.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class dDt{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let n,r;try{const s=JSON.parse(e);n=s.ratio,r=s.heightInLines}catch{}return{ratio:n||.7,heightInLines:r||18}}}class hDt extends Wee{}let zte=class extends rj{constructor(e,n,r,s,o,a,l,c,u,d,h,f){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},a),this._defaultTreeKeyboardSupport=n,this.layoutData=r,this._textModelResolverService=o,this._instantiationService=a,this._peekViewService=l,this._uriLabel=c,this._undoRedoService=u,this._keybindingService=d,this._languageService=h,this._languageConfigurationService=f,this._disposeOnNewModel=new Xe,this._callOnDispose=new Xe,this._onDidSelectReference=new _e,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new bi(0,0),this._applyTheme(s.getColorTheme()),this._callOnDispose.add(s.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),Mi(this._preview),Mi(this._previewNotAvailableMessage),Mi(this._tree),Mi(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const n=e.getColor(nDt)||Te.transparent;this.style({arrowColor:n,frameColor:n,headerBackgroundColor:e.getColor(tDt)||Te.transparent,primaryHeadingColor:e.getColor(INe),secondaryHeadingColor:e.getColor(TNe)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=He(e,tt("div.messages")),Pl(this._messageContainer),this._splitView=new cRe(e,{orientation:1}),this._previewContainer=He(e,tt("div.preview.inline"));const n={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(D1,this._previewContainer,n,{},this.editor),Pl(this._previewContainer),this._previewNotAvailableMessage=new Qm(L("missingPreviewMessage","no preview available"),ad,Qm.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=He(e,tt("div.ref-tree.inline"));const r={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new cDt,keyboardNavigationLabelProvider:this._instantiationService.createInstance(Wte),identityProvider:new aDt,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:iDt}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(As(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(hDt,"ReferencesWidget",this._treeContainer,new oDt,[this._instantiationService.createInstance(cO),this._instantiationService.createInstance(i4)],this._instantiationService.createInstance(jte),r),this._splitView.addView({onDidChange:_t.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},B7.Distribute),this._splitView.addView({onDidChange:_t.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},B7.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,a)=>{o instanceof E1&&(a==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:a,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")}),Pl(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,n){super._doLayoutBody(e,n),this._dim=new bi(n,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(n),this._splitView.resizeView(0,n*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=L("noResults","No results"),Jc(this._messageContainer),Promise.resolve(void 0)):(Pl(this._messageContainer),this._decorationsManager=new xz(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:n,target:r}=e;if(n.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:r.range},kind:n.ctrlKey||n.metaKey||n.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Jc(this._treeContainer),Jc(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof E1)return e;if(e instanceof lO&&e.children.length>0)return e.children[0]}revealReference(e){return p0e(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,n){return p0e(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Pn.inMemory?this.setTitle(Xgt(e.uri),this._uriLabel.getUriLabel(M$(e.uri))):this.setTitle(L("peekView.alternateTitle","References"));const r=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(n&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const s=yield r;if(!this._model){s.dispose();return}Mi(this._previewModelReference);const o=s.object;if(o){const a=this._preview.getModel()===o.textEditorModel?0:1,l=J.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(l),this._preview.revealRangeInCenter(l,a)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()})}};zte=uDt([n0(3,Do),n0(4,Ec),n0(5,hn),n0(6,ENe),n0(7,KE),n0(8,P$),n0(9,sr),n0(10,Ar),n0(11,dr)],zte);var fDt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},oD=function(i,e){return function(n,r){e(n,r,i)}},g0e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},R8;const lk=new yt("referenceSearchVisible",!1,L("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let I1=R8=class{static get(e){return e.getContribution(R8.ID)}constructor(e,n,r,s,o,a,l,c){this._defaultTreeKeyboardSupport=e,this._editor=n,this._editorService=s,this._notificationService=o,this._instantiationService=a,this._storageService=l,this._configurationService=c,this._disposables=new Xe,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=lk.bindTo(r)}dispose(){var e,n;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(n=this._model)===null||n===void 0||n.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,n,r){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=r,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",a=dDt.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(zte,this._editor,this._defaultTreeKeyboardSupport,a),this._widget.setTitle(L("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{n.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(c=>{const{element:u,kind:d}=c;if(u)switch(d){case"open":(c.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(u,!1,!1);break;case"side":this.openReference(u,!0,!1);break;case"goto":r?this._gotoReference(u,!0):this.openReference(u,!1,!0);break}}));const l=++this._requestIdPool;n.then(c=>{var u;if(l!==this._requestIdPool||!this._widget){c.dispose();return}return(u=this._model)===null||u===void 0||u.dispose(),this._model=c,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(L("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,h=new ve(e.startLineNumber,e.startColumn),f=this._model.nearestReference(d,h);if(f)return this._widget.setSelection(f).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},c=>{this._notificationService.error(c)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return g0e(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const n=this._widget.position;if(!n)return;const r=this._model.nearestReference(this._editor.getModel().uri,n);if(!r)return;const s=this._model.nextOrPreviousReference(r,e),o=this._editor.hasTextFocus(),a=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(s),yield this._gotoReference(s,!1),o?this._editor.focus():this._widget&&a&&this._widget.focusOnPreviewEditor()})}revealReference(e){return g0e(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var n,r;(n=this._widget)===null||n===void 0||n.dispose(),(r=this._model)===null||r===void 0||r.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,n){var r;(r=this._widget)===null||r===void 0||r.hide(),this._ignoreModelChangeEvent=!0;const s=J.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:s,selectionSource:"code.jump",pinned:n}},this._editor).then(o=>{var a;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(s),this._widget.focusOnReferenceTree();else{const l=R8.get(o),c=this._model.clone();this.closeWidget(),o.focus(),l==null||l.toggleWidget(s,go(u=>Promise.resolve(c)),(a=this._peekMode)!==null&&a!==void 0?a:!1)}},o=>{this._ignoreModelChangeEvent=!1,Ln(o)})}openReference(e,n,r){n||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:"code.jump",pinned:r}},this._editor,n)}};I1.ID="editor.contrib.referencesController";I1=R8=fDt([oD(2,mn),oD(3,Si),oD(4,Ps),oD(5,hn),oD(6,jf),oD(7,ei)],I1);function ck(i,e){const n=JLt(i);if(!n)return;const r=I1.get(n);r&&e(r)}Sc.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:ro(2089,60),when:ze.or(lk,xc.inPeekEditor),handler(i){ck(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Sc.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:ze.or(lk,xc.inPeekEditor),handler(i){ck(i,e=>{e.goToNextOrPreviousReference(!0)})}});Sc.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:ze.or(lk,xc.inPeekEditor),handler(i){ck(i,e=>{e.goToNextOrPreviousReference(!1)})}});si.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");si.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");si.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");si.registerCommand("closeReferenceSearch",i=>ck(i,e=>e.closeWidget()));Sc.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:ze.and(xc.inPeekEditor,ze.not("config.editor.stablePeek"))});Sc.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:ze.and(lk,ze.not("config.editor.stablePeek"))});Sc.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ze.and(lk,xRe,xae.negate(),kae.negate()),handler(i){var e;const r=(e=i.get(Lh).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(r)&&r[0]instanceof E1&&ck(i,s=>s.revealReference(r[0]))}});Sc.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ze.and(lk,xRe,xae.negate(),kae.negate()),handler(i){var e;const r=(e=i.get(Lh).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(r)&&r[0]instanceof E1&&ck(i,s=>s.openReference(r[0],!0,!0))}});si.registerCommand("openReference",i=>{var e;const r=(e=i.get(Lh).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(r)&&r[0]instanceof E1&&ck(i,s=>s.openReference(r[0],!1,!0))});var RNe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},CN=function(i,e){return function(n,r){e(n,r,i)}};const ile=new yt("hasSymbols",!1,L("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),kz=qn("ISymbolNavigationService");let Vte=class{constructor(e,n,r,s){this._editorService=n,this._notificationService=r,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=ile.bindTo(e)}reset(){var e,n;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(n=this._currentMessage)===null||n===void 0||n.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const n=e.parent.parent;if(n.references.length<=1){this.reset();return}this._currentModel=n,this._currentIdx=n.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const r=new Hte(this._editorService),s=r.onDidChange(o=>{if(this._ignoreEditorChange)return;const a=this._editorService.getActiveCodeEditor();if(!a)return;const l=a.getModel(),c=a.getPosition();if(!l||!c)return;let u=!1,d=!1;for(const h of n.references)if(Noe(h.uri,l.uri))u=!0,d=d||J.containsPosition(h.range,c);else if(u)break;(!u||!d)&&this.reset()});this._currentState=Sf(r,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const n=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:n.uri,options:{selection:J.collapseToStart(n.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const n=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),r=n?L("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,n.getLabel()):L("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(r)}};Vte=RNe([CN(0,mn),CN(1,Si),CN(2,Ps),CN(3,sr)],Vte);oi(kz,Vte,1);ct(new class extends Ho{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:ile,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(kz).revealNext(e)}});Sc.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:ile,primary:9,handler(i){i.get(kz).reset()}});let Hte=class{constructor(e){this._listener=new Map,this._disposables=new Xe,this._onDidChange=new _e,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),Mi(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Sf(e.onDidChangeCursorPosition(n=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(n=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var n;(n=this._listener.get(e))===null||n===void 0||n.dispose(),this._listener.delete(e)}};Hte=RNe([CN(0,Si)],Hte);var rle=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function r4(i,e,n,r){return rle(this,void 0,void 0,function*(){const o=n.ordered(i).map(l=>Promise.resolve(r(l,i,e)).then(void 0,c=>{Us(c)})),a=yield Promise.all(o);return Hm(a.flat())})}function Lz(i,e,n,r){return r4(e,n,i,(s,o,a)=>s.provideDefinition(o,a,r))}function ANe(i,e,n,r){return r4(e,n,i,(s,o,a)=>s.provideDeclaration(o,a,r))}function NNe(i,e,n,r){return r4(e,n,i,(s,o,a)=>s.provideImplementation(o,a,r))}function MNe(i,e,n,r){return r4(e,n,i,(s,o,a)=>s.provideTypeDefinition(o,a,r))}function Dz(i,e,n,r,s){return r4(e,n,i,(o,a,l)=>rle(this,void 0,void 0,function*(){const c=yield o.provideReferences(a,l,{includeDeclaration:!0},s);if(!r||!c||c.length!==2)return c;const u=yield o.provideReferences(a,l,{includeDeclaration:!1},s);return u&&u.length===1?u:c}))}function s4(i){return rle(this,void 0,void 0,function*(){const e=yield i(),n=new lu(e,""),r=n.references.map(s=>s.link);return n.dispose(),r})}d_("_executeDefinitionProvider",(i,e,n)=>{const r=i.get(Et),s=Lz(r.definitionProvider,e,n,Hn.None);return s4(()=>s)});d_("_executeTypeDefinitionProvider",(i,e,n)=>{const r=i.get(Et),s=MNe(r.typeDefinitionProvider,e,n,Hn.None);return s4(()=>s)});d_("_executeDeclarationProvider",(i,e,n)=>{const r=i.get(Et),s=ANe(r.declarationProvider,e,n,Hn.None);return s4(()=>s)});d_("_executeReferenceProvider",(i,e,n)=>{const r=i.get(Et),s=Dz(r.referenceProvider,e,n,!1,Hn.None);return s4(()=>s)});d_("_executeImplementationProvider",(i,e,n)=>{const r=i.get(Et),s=NNe(r.implementationProvider,e,n,Hn.None);return s4(()=>s)});var Lf=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},rA,sA,oA,L6,D6,E6,I6,T6;sa.appendMenuItem(se.EditorContext,{submenu:se.EditorContextPeek,title:L("peek.submenu","Peek"),group:"navigation",order:100});class sI{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof sI||ve.isIPosition(e.position)&&e.model)}constructor(e,n){this.model=e,this.position=n}}class hl extends og{static all(){return hl._allSymbolNavigationCommands.values()}static _patchConfig(e){const n=Object.assign(Object.assign({},e),{f1:!0});if(n.menu)for(const r of Vn.wrap(n.menu))(r.id===se.EditorContext||r.id===se.EditorContextPeek)&&(r.when=ze.and(e.precondition,r.when));return n}constructor(e,n){super(hl._patchConfig(n)),this.configuration=e,hl._allSymbolNavigationCommands.set(n.id,this)}runEditorCommand(e,n,r,s){if(!n.hasModel())return Promise.resolve(void 0);const o=e.get(Ps),a=e.get(Si),l=e.get(Z1),c=e.get(kz),u=e.get(Et),d=e.get(hn),h=n.getModel(),f=n.getPosition(),p=sI.is(r)?r:new sI(h,f),g=new x1(n,5),m=h$(this._getLocationModel(u,p.model,p.position,g.token),g.token).then(_=>Lf(this,void 0,void 0,function*(){var b;if(!_||g.token.isCancellationRequested)return;Ua(_.ariaMessage);let y;if(_.referenceAt(h.uri,f)){const k=this._getAlternativeCommand(n);!hl._activeAlternativeCommands.has(k)&&hl._allSymbolNavigationCommands.has(k)&&(y=hl._allSymbolNavigationCommands.get(k))}const x=_.references.length;if(x===0){if(!this.configuration.muteMessage){const k=h.getWordAtPosition(f);(b=au.get(n))===null||b===void 0||b.showMessage(this._getNoResultFoundMessage(k),f)}}else if(x===1&&y)hl._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(k=>y.runEditorCommand(k,n,r,s).finally(()=>{hl._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(a,c,n,_,s)}),_=>{o.error(_)}).finally(()=>{g.dispose()});return l.showWhile(m,250),m}_onResult(e,n,r,s,o){return Lf(this,void 0,void 0,function*(){const a=this._getGoToPreference(r);if(!(r instanceof D1)&&(this.configuration.openInPeek||a==="peek"&&s.references.length>1))this._openInPeek(r,s,o);else{const l=s.firstReference(),c=s.references.length>1&&a==="gotoAndPeek",u=yield this._openReference(r,e,l,this.configuration.openToSide,!c);c&&u?this._openInPeek(u,s,o):s.dispose(),a==="goto"&&n.put(l)}})}_openReference(e,n,r,s,o){return Lf(this,void 0,void 0,function*(){let a;if(got(r)&&(a=r.targetSelectionRange),a||(a=r.range),!a)return;const l=yield n.openCodeEditor({resource:r.uri,options:{selection:J.collapseToStart(a),selectionRevealType:3,selectionSource:"code.jump"}},e,s);if(l){if(o){const c=l.getModel(),u=l.createDecorationsCollection([{range:a,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{l.getModel()===c&&u.clear()},350)}return l}})}_openInPeek(e,n,r){const s=I1.get(e);s&&e.hasModel()?s.toggleWidget(r??e.getSelection(),go(o=>Promise.resolve(n)),this.configuration.openInPeek):n.dispose()}}hl._allSymbolNavigationCommands=new Map;hl._activeAlternativeCommands=new Set;class o4 extends hl{_getLocationModel(e,n,r,s){return Lf(this,void 0,void 0,function*(){return new lu(yield Lz(e.definitionProvider,n,r,s),L("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?L("noResultWord","No definition found for '{0}'",e.word):L("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Ir((rA=class extends o4{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:rA.id,title:{value:L("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:L({},"Go to &&Definition")},precondition:ze.and(oe.hasDefinitionProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:[{when:oe.editorTextFocus,primary:70,weight:100},{when:ze.and(oe.editorTextFocus,wRe),primary:2118,weight:100}],menu:[{id:se.EditorContext,group:"navigation",order:1.1},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),si.registerCommandAlias("editor.action.goToDeclaration",rA.id)}},rA.id="editor.action.revealDefinition",rA));Ir((sA=class extends o4{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:sA.id,title:{value:L("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:ze.and(oe.hasDefinitionProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:[{when:oe.editorTextFocus,primary:ro(2089,70),weight:100},{when:ze.and(oe.editorTextFocus,wRe),primary:ro(2089,2118),weight:100}]}),si.registerCommandAlias("editor.action.openDeclarationToTheSide",sA.id)}},sA.id="editor.action.revealDefinitionAside",sA));Ir((oA=class extends o4{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:oA.id,title:{value:L("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:ze.and(oe.hasDefinitionProvider,xc.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:se.EditorContextPeek,group:"peek",order:2}}),si.registerCommandAlias("editor.action.previewDeclaration",oA.id)}},oA.id="editor.action.peekDefinition",oA));class PNe extends hl{_getLocationModel(e,n,r,s){return Lf(this,void 0,void 0,function*(){return new lu(yield ANe(e.declarationProvider,n,r,s),L("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?L("decl.noResultWord","No declaration found for '{0}'",e.word):L("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Ir((L6=class extends PNe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:L6.id,title:{value:L("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:L({},"Go to &&Declaration")},precondition:ze.and(oe.hasDeclarationProvider,oe.isInWalkThroughSnippet.toNegated()),menu:[{id:se.EditorContext,group:"navigation",order:1.3},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?L("decl.noResultWord","No declaration found for '{0}'",e.word):L("decl.generic.noResults","No declaration found")}},L6.id="editor.action.revealDeclaration",L6));Ir(class extends PNe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:L("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:ze.and(oe.hasDeclarationProvider,xc.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),menu:{id:se.EditorContextPeek,group:"peek",order:3}})}});class ONe extends hl{_getLocationModel(e,n,r,s){return Lf(this,void 0,void 0,function*(){return new lu(yield MNe(e.typeDefinitionProvider,n,r,s),L("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?L("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):L("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Ir((D6=class extends ONe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:D6.ID,title:{value:L("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:L({},"Go to &&Type Definition")},precondition:ze.and(oe.hasTypeDefinitionProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:0,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.4},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},D6.ID="editor.action.goToTypeDefinition",D6));Ir((E6=class extends ONe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:E6.ID,title:{value:L("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:ze.and(oe.hasTypeDefinitionProvider,xc.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),menu:{id:se.EditorContextPeek,group:"peek",order:4}})}},E6.ID="editor.action.peekTypeDefinition",E6));class FNe extends hl{_getLocationModel(e,n,r,s){return Lf(this,void 0,void 0,function*(){return new lu(yield NNe(e.implementationProvider,n,r,s),L("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?L("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):L("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Ir((I6=class extends FNe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:I6.ID,title:{value:L("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:L({},"Go to &&Implementations")},precondition:ze.and(oe.hasImplementationProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:2118,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.45},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},I6.ID="editor.action.goToImplementation",I6));Ir((T6=class extends FNe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:T6.ID,title:{value:L("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:ze.and(oe.hasImplementationProvider,xc.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:3142,weight:100},menu:{id:se.EditorContextPeek,group:"peek",order:5}})}},T6.ID="editor.action.peekImplementation",T6));class BNe extends hl{_getNoResultFoundMessage(e){return e?L("references.no","No references found for '{0}'",e.word):L("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Ir(class extends BNe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:L("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:L({},"Go to &&References")},precondition:ze.and(oe.hasReferenceProvider,xc.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:1094,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.45},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,n,r,s){return Lf(this,void 0,void 0,function*(){return new lu(yield Dz(e.referenceProvider,n,r,!0,s),L("ref.title","References"))})}});Ir(class extends BNe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:L("references.action.label","Peek References"),original:"Peek References"},precondition:ze.and(oe.hasReferenceProvider,xc.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),menu:{id:se.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,n,r,s){return Lf(this,void 0,void 0,function*(){return new lu(yield Dz(e.referenceProvider,n,r,!1,s),L("ref.title","References"))})}});class pDt extends hl{constructor(e,n,r){super(e,{id:"editor.action.goToLocation",title:{value:L("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:ze.and(xc.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated())}),this._references=n,this._gotoMultipleBehaviour=r}_getLocationModel(e,n,r,s){return Lf(this,void 0,void 0,function*(){return new lu(this._references,L("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&L("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var n;return(n=this._gotoMultipleBehaviour)!==null&&n!==void 0?n:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}si.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Jt},{name:"position",description:"The position at which to start",constraint:ve.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(i,e,n,r,s,o,a)=>Lf(void 0,void 0,void 0,function*(){Ui(Jt.isUri(e)),Ui(ve.isIPosition(n)),Ui(Array.isArray(r)),Ui(typeof s>"u"||typeof s=="string"),Ui(typeof a>"u"||typeof a=="boolean");const l=i.get(Si),c=yield l.openCodeEditor({resource:e},l.getFocusedCodeEditor());if(n_(c))return c.setPosition(n),c.revealPositionInCenterIfOutsideViewport(n,0),c.invokeWithinContext(u=>{const d=new class extends pDt{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!a,openToSide:!1},r,s);u.get(hn).invokeFunction(d.run.bind(d),c)})})});si.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Jt},{name:"position",description:"The position at which to start",constraint:ve.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(i,e,n,r,s)=>Lf(void 0,void 0,void 0,function*(){i.get(us).executeCommand("editor.action.goToLocations",e,n,r,s,void 0,!0)})});si.registerCommand({id:"editor.action.findReferences",handler:(i,e,n)=>{Ui(Jt.isUri(e)),Ui(ve.isIPosition(n));const r=i.get(Et),s=i.get(Si);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!n_(o)||!o.hasModel())return;const a=I1.get(o);if(!a)return;const l=go(u=>Dz(r.referenceProvider,o.getModel(),ve.lift(n),!1,u).then(d=>new lu(d,L("ref.title","References")))),c=new J(n.lineNumber,n.column,n.lineNumber,n.column);return Promise.resolve(a.toggleWidget(c,l,!1))})}});si.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var gDt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mK=function(i,e){return function(n,r){e(n,r,i)}},m0e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},SN;let Lx=SN=class{constructor(e,n,r,s){this.textModelResolverService=n,this.languageService=r,this.languageFeaturesService=s,this.toUnhook=new Xe,this.toUnhookForKeyboard=new Xe,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new yz(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([a,l])=>{this.startFindDefinitionFromMouse(a,l??void 0)})),this.toUnhook.add(o.onExecute(a=>{this.isEnabled(a)&&this.gotoDefinition(a.target.position,a.hasSideBySideModifier).catch(l=>{Ln(l)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(SN.ID)}startFindDefinitionFromCursor(e){return m0e(this,void 0,void 0,function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(n=>{n&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,n){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,n)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const r=e.target.position;this.startFindDefinition(r)}startFindDefinition(e){var n;return m0e(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const r=e?(n=this.editor.getModel())===null||n===void 0?void 0:n.getWordAtPosition(e):null;if(!r){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===r.startColumn&&this.currentWordAtPosition.endColumn===r.endColumn&&this.currentWordAtPosition.word===r.word)return;this.currentWordAtPosition=r;const s=new cAe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=go(l=>this.findDefinition(e,l));let o;try{o=yield this.previousPromise}catch(l){Ln(l);return}if(!o||!o.length||!s.validate(this.editor)){this.removeLinkDecorations();return}const a=o[0].originSelectionRange?J.lift(o[0].originSelectionRange):new J(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn);if(o.length>1){let l=a;for(const{originSelectionRange:c}of o)c&&(l=J.plusRange(l,c));this.addDecoration(l,new Ea().appendText(L("multipleResults","Click to show {0} definitions.",o.length)))}else{const l=o[0];if(!l.uri)return;this.textModelResolverService.createModelReference(l.uri).then(c=>{if(!c.object||!c.object.textEditorModel){c.dispose();return}const{object:{textEditorModel:u}}=c,{startLineNumber:d}=l.range;if(d<1||d>u.getLineCount()){c.dispose();return}const h=this.getPreviewValue(u,d,l),f=this.languageService.guessLanguageIdByFilepathOrFirstLine(u.uri);this.addDecoration(a,h?new Ea().appendCodeblock(f||"",h):void 0),c.dispose()})}})}getPreviewValue(e,n,r){let s=r.range;return s.endLineNumber-s.startLineNumber>=SN.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,n)),this.stripIndentationFromPreviewRange(e,n,s)}stripIndentationFromPreviewRange(e,n,r){let o=e.getLineFirstNonWhitespaceColumn(n);for(let l=n+1;l<r.endLineNumber;l++){const c=e.getLineFirstNonWhitespaceColumn(l);o=Math.min(o,c)}return e.getValueInRange(r).replace(new RegExp(`^\\s{${o-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,n){const r=e.getLineFirstNonWhitespaceColumn(n),s=Math.min(e.getLineCount(),n+SN.MAX_SOURCE_PREVIEW_LINES);let o=n+1;for(;o<s;o++){const a=e.getLineFirstNonWhitespaceColumn(o);if(r===a)break}return new J(n,1,o+1,1)}addDecoration(e,n){const r={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:n}};this.linkDecorations.set([r])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,n){var r;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((r=e.target.detail.injectedText)===null||r===void 0?void 0:r.options)instanceof S1)&&(e.hasTriggerModifier||(n?n.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,n){const r=this.editor.getModel();return r?Lz(this.languageFeaturesService.definitionProvider,r,e,n):Promise.resolve(null)}gotoDefinition(e,n){return this.editor.setPosition(e),this.editor.invokeWithinContext(r=>{const s=!n&&this.editor.getOption(87)&&!this.isInPeekEditor(r);return new o4({openToSide:n,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r)})}isInPeekEditor(e){const n=e.get(mn);return xc.inPeekEditor.getValue(n)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Lx.ID="editor.contrib.gotodefinitionatposition";Lx.MAX_SOURCE_PREVIEW_LINES=8;Lx=SN=gDt([mK(1,Ec),mK(2,Ar),mK(3,Et)],Lx);_i(Lx.ID,Lx,2);const R6=tt;class jNe extends Le{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new P5(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class sle extends Le{static render(e,n,r){return new sle(e,n,r)}constructor(e,n,r){super(),this.actionContainer=He(e,R6("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=He(this.actionContainer,R6("a.action")),this.action.setAttribute("role","button"),n.iconClass&&He(this.action,R6(`span.icon.${n.iconClass}`));const s=He(this.action,R6("span"));s.textContent=r?`${n.label} (${r})`:n.label,this._register(Be(this.actionContainer,ht.CLICK,o=>{o.stopPropagation(),o.preventDefault(),n.run(this.actionContainer)})),this._register(Be(this.actionContainer,ht.KEY_DOWN,o=>{const a=new yr(o);(a.equals(3)||a.equals(10))&&(o.stopPropagation(),o.preventDefault(),n.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function mDt(i,e){return i&&e?L("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?L("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var _Dt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},vDt=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],n;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=i[o]&&function(a){return new Promise(function(l,c){a=i[o](a),s(l,c,a.done,a.value)})}}function s(o,a,l,c){Promise.resolve(c).then(function(u){o({value:u,done:l})},a)}};let bDt=class{constructor(e,n,r){this.value=e,this.isComplete=n,this.hasLoadingMessage=r}};class WNe extends Le{constructor(e,n){super(),this._editor=e,this._computer=n,this._onResult=this._register(new _e),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Ji(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Ji(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Ji(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,n=!0){this._state=e,n&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=mlt(e=>this._computer.computeAsync(e)),_Dt(this,void 0,void 0,function*(){var e,n,r,s;try{try{for(var o=!0,a=vDt(this._asyncIterable),l;l=yield a.next(),e=l.done,!e;o=!0){s=l.value,o=!1;const c=s;c&&(this._result.push(c),this._fireResult())}}catch(c){n={error:c}}finally{try{!o&&!e&&(r=a.return)&&(yield r.call(a))}finally{if(n)throw n.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(c){Ln(c)}})):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,n=this._state===4;this._onResult.fire(new bDt(this._result.slice(0),e,n))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class _K{constructor(e,n,r,s){this.priority=e,this.range=n,this.initialMousePosX=r,this.initialMousePosY=s,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,n){return e.type===1&&n.lineNumber===this.range.startLineNumber}}class A8{constructor(e,n,r,s,o,a){this.priority=e,this.owner=n,this.range=r,this.initialMousePosX=s,this.initialMousePosY=o,this.supportsMarkerHover=a,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,n){return e.type===2&&this.owner===e.owner}}const uk=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class ole{constructor(){this._onDidWillResize=new _e,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new _e,this.onDidResize=this._onDidResize.event,this._sashListener=new Xe,this._size=new bi(0,0),this._minSize=new bi(0,0),this._maxSize=new bi(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new ja(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new ja(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new ja(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:O7.North}),this._southSash=new ja(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:O7.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,n=0,r=0;this._sashListener.add(_t.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,n=0,r=0)})),this._sashListener.add(_t.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,n=0,r=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(r=s.currentX-s.startX,this.layout(e.height+n,e.width+r),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(r=-(s.currentX-s.startX),this.layout(e.height+n,e.width+r),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(n=-(s.currentY-s.startY),this.layout(e.height+n,e.width+r),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(n=s.currentY-s.startY,this.layout(e.height+n,e.width+r),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(_t.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(_t.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,n,r,s){this._northSash.state=e?3:0,this._eastSash.state=n?3:0,this._southSash.state=r?3:0,this._westSash.state=s?3:0}layout(e=this.size.height,n=this.size.width){const{height:r,width:s}=this._minSize,{height:o,width:a}=this._maxSize;e=Math.max(r,Math.min(o,e)),n=Math.max(s,Math.min(a,n));const l=new bi(n,e);bi.equals(l,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=n+"px",this._size=l,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const yDt=30,wDt=24;class CDt extends Le{constructor(e,n=new bi(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new ole),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=bi.lift(n),this._resizableNode.layout(n.height,n.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(r=>{this._resize(new bi(r.dimension.width,r.dimension.height)),r.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?ve.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const n=this._editor.getDomNode(),r=this._editor.getScrolledVisiblePosition(e);return!n||!r?void 0:no(n).top+r.top-yDt}_availableVerticalSpaceBelow(e){const n=this._editor.getDomNode(),r=this._editor.getScrolledVisiblePosition(e);if(!n||!r)return;const s=no(n),o=FI(n.ownerDocument.body),a=s.top+r.top+r.height;return o.height-a-wDt}_findPositionPreference(e,n){var r,s;const o=Math.min((r=this._availableVerticalSpaceBelow(n))!==null&&r!==void 0?r:1/0,e),a=Math.min((s=this._availableVerticalSpaceAbove(n))!==null&&s!==void 0?s:1/0,e),l=Math.min(Math.max(a,o),e),c=Math.min(e,l);let u;return this._editor.getOption(60).above?u=c<=a?1:2:u=c<=o?2:1,u===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),u}_resize(e){this._resizableNode.layout(e.height,e.width)}}var ale=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},SS=function(i,e){return function(n,r){e(n,r,i)}},N8,Ug;const _0e=tt;let sj=N8=class extends Le{constructor(e,n,r){super(),this._editor=e,this._instantiationService=n,this._keybindingService=r,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Yy,this._editor)),this._participants=[];for(const s of uk.getAll())this._participants.push(this._instantiationService.createInstance(s,this._editor));this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new aj(this._editor,this._participants),this._hoverOperation=this._register(new WNe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{if(!this._computer.anchor)return;const o=s.hasLoadingMessage?this._addLoadingMessage(s.value):s.value;this._withResult(new $Ne(this._computer.anchor,o,s.isComplete))})),this._register(As(this._widget.getDomNode(),"keydown",s=>{s.equals(9)&&this.hide()})),this._register(Zr.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const n=[];for(const s of this._participants)if(s.suggestHoverAnchor){const o=s.suggestHoverAnchor(e);o&&n.push(o)}const r=e.target;if(r.type===6&&n.push(new _K(0,r.range,e.event.posx,e.event.posy)),r.type===7){const s=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!r.detail.isAfterLines&&typeof r.detail.horizontalDistanceToText=="number"&&r.detail.horizontalDistanceToText<s&&n.push(new _K(0,r.range,e.event.posx,e.event.posy))}return n.length===0?this._startShowingOrUpdateHover(null,0,0,!1,e):(n.sort((s,o)=>o.priority-s.priority),this._startShowingOrUpdateHover(n[0],0,0,!1,e))}startShowingAtRange(e,n,r,s){this._startShowingOrUpdateHover(new _K(0,e,void 0,void 0),n,r,s,null)}_startShowingOrUpdateHover(e,n,r,s,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,n,r,s,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,n,r,s,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,n,r,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,n,r,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,n,r,s,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=s,this._computer.source=r,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(n))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const n of this._participants)if(n.createLoadingMessage){const r=n.createLoadingMessage(this._computer.anchor);if(r)return e.slice(0).concat([r])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,n){const{showAtPosition:r,showAtSecondaryPosition:s,highlightRange:o}=N8.computeHoverRanges(this._editor,e.range,n),a=new Xe,l=a.add(new oj(this._keybindingService)),c=document.createDocumentFragment();let u=null;const d={fragment:c,statusBar:l,setColorPicker:f=>u=f,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:f=>this._widget.setMinimumDimensions(f),hide:()=>this.hide()};for(const f of this._participants){const p=n.filter(g=>g.owner===f);p.length>0&&a.add(f.renderHoverParts(d,p))}const h=n.some(f=>f.isBeforeContent);if(l.hasContent&&c.appendChild(l.hoverElement),c.hasChildNodes()){if(o){const f=this._editor.createDecorationsCollection();f.set([{range:o,options:N8._DECORATION_OPTIONS}]),a.add(gn(()=>{f.clear()}))}this._widget.showAt(c,new xDt(u,r,s,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,h,e.initialMousePosX,e.initialMousePosY,a))}else a.dispose()}static computeHoverRanges(e,n,r){let s=1;if(e.hasModel()){const u=e._getViewModel(),d=u.coordinatesConverter,h=d.convertModelRangeToViewRange(n),f=new ve(h.startLineNumber,u.getLineMinColumn(h.startLineNumber));s=d.convertViewPositionToModelPosition(f).column}const o=n.startLineNumber;let a=n.startColumn,l=r[0].range,c=null;for(const u of r)l=J.plusRange(l,u.range),u.range.startLineNumber===o&&u.range.endLineNumber===o&&(a=Math.max(Math.min(a,u.range.startColumn),s)),u.forceShowAtRange&&(c=u.range);return{showAtPosition:c?c.getStartPosition():new ve(o,n.startColumn),showAtSecondaryPosition:c?c.getStartPosition():new ve(o,a),highlightRange:l}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};sj._DECORATION_OPTIONS=kn.register({description:"content-hover-highlight",className:"hoverHighlight"});sj=N8=ale([SS(1,hn),SS(2,sr)],sj);class $Ne{constructor(e,n,r){this.anchor=e,this.messages=n,this.isComplete=r}filter(e){const n=this.messages.filter(r=>r.isValidForHoverAnchor(e));return n.length===this.messages.length?this:new SDt(this,this.anchor,n,this.isComplete)}}class SDt extends $Ne{constructor(e,n,r,s){super(n,r,s),this.original=e}filter(e){return this.original.filter(e)}}class xDt{constructor(e,n,r,s,o,a,l,c,u,d){this.colorPicker=e,this.showAtPosition=n,this.showAtSecondaryPosition=r,this.preferAbove=s,this.stoleFocus=o,this.source=a,this.isBeforeContent=l,this.initialMousePosX=c,this.initialMousePosY=u,this.disposables=d,this.closestMouseDistance=void 0}}const v0e=30,vK=10,kDt=6;let Yy=Ug=class extends CDt{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,n,r,s,o){const a=e.getOption(66)+8,l=150,c=new bi(l,a);super(e,c),this._configurationService=r,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new jNe),this._minimumSize=c,this._hoverVisibleKey=oe.hoverVisible.bindTo(n),this._hoverFocusedKey=oe.hoverFocused.bindTo(n),He(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(50)&&this._updateFont()}));const u=this._register(Gm(this._resizableNode.domNode));this._register(u.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(u.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Ug.ID}static _applyDimensions(e,n,r){const s=typeof n=="number"?`${n}px`:n,o=typeof r=="number"?`${r}px`:r;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,n){const r=this._hover.contentsDomNode;return Ug._applyDimensions(r,e,n)}_setContainerDomNodeDimensions(e,n){const r=this._hover.containerDomNode;return Ug._applyDimensions(r,e,n)}_setHoverWidgetDimensions(e,n){this._setContentsDomNodeDimensions(e,n),this._setContainerDomNodeDimensions(e,n),this._layoutContentWidget()}static _applyMaxDimensions(e,n,r){const s=typeof n=="number"?`${n}px`:n,o=typeof r=="number"?`${r}px`:r;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,n){Ug._applyMaxDimensions(this._hover.contentsDomNode,e,n),Ug._applyMaxDimensions(this._hover.containerDomNode,e,n),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,n=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==n&&(e.style.paddingBottom=n)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const n=e.width,r=e.height;this._setHoverWidgetDimensions(n,r),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(n,r-vK))}_updateResizableNodeMaxDimensions(){var e,n;const r=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,s=(n=this._findMaximumRenderingHeight())!==null&&n!==void 0?n:1/0;this._resizableNode.maxSize=new bi(r,s),this._setHoverWidgetMaxDimensions(r,s)}_resize(e){var n,r;Ug._lastDimensions=new bi(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(r=(n=this._visibleData)===null||n===void 0?void 0:n.colorPicker)===null||r===void 0||r.layout()}_findAvailableSpaceVertically(){var e;const n=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(n)return this._positionPreference===1?this._availableVerticalSpaceAbove(n):this._availableVerticalSpaceBelow(n)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let n=kDt;return Array.from(this._hover.contentsDomNode.children).forEach(r=>{n+=r.clientHeight}),this._hasHorizontalScrollbar()&&(n+=vK),Math.min(e,n)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(n=>n.scrollWidth>n.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),n=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<n?FI(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,n){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=n,!1;const r=no(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=b0e(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,r.left,r.top,r.width,r.height));const s=b0e(e,n,r.left,r.top,r.width,r.height);return s>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,s),!0)}_setHoverData(e){var n;(n=this._visibleData)===null||n===void 0||n.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:n}=this._editor.getOption(50),r=this._hover.contentsDomNode;r.style.fontSize=`${e}px`,r.style.lineHeight=`${n/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(n=>this._editor.applyFontInfo(n))}_updateContent(e){const n=this._hover.contentsDomNode;n.style.paddingBottom="",n.textContent="",n.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,Ug._lastDimensions.height),n=Math.max(this._editor.getLayoutInfo().width*.66,500,Ug._lastDimensions.width);this._setHoverWidgetMaxDimensions(n,e)}_render(e,n){this._setHoverData(n),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,n){var r,s,o,a;if(!this._editor||!this._editor.hasModel())return;this._render(e,n);const l=gS(this._hover.containerDomNode),c=n.showAtPosition;this._positionPreference=(r=this._findPositionPreference(l,c))!==null&&r!==void 0?r:1,this.onContentsChanged(),n.stoleFocus&&this._hover.containerDomNode.focus(),(s=n.colorPicker)===null||s===void 0||s.layout();const u=mDt(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(a=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&a!==void 0?a:"");u&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+u)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new bi(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var n;const r=this._hover.containerDomNode,s=this._hover.contentsDomNode,o=(n=this._findMaximumRenderingHeight())!==null&&n!==void 0?n:1/0;this._setContainerDomNodeDimensions(dc(r),Math.min(o,e)),this._setContentsDomNodeDimensions(dc(s),Math.min(o,e-vK))}setMinimumDimensions(e){this._minimumSize=new bi(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new bi(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const n=this._hover.containerDomNode;let r=gS(n),s=dc(n);if(this._resizableNode.layout(r,s),this._setHoverWidgetDimensions(s,r),r=gS(n),s=dc(n),this._contentWidth=s,this._updateMinimumWidth(),this._resizableNode.layout(r,s),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(r)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=gS(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,n=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-n.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,n=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+n.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-v0e})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+v0e})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,n=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-n})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,n=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+n})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Yy.ID="editor.contrib.resizableContentHoverWidget";Yy._lastDimensions=new bi(0,0);Yy=Ug=ale([SS(1,mn),SS(2,ei),SS(3,zv),SS(4,sr)],Yy);let oj=class extends Le{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=_0e("div.hover-row.status-bar"),this.actionsElement=He(this.hoverElement,_0e("div.actions"))}addAction(e){const n=this._keybindingService.lookupKeybinding(e.commandId),r=n?n.getLabel():null;return this._hasContent=!0,this._register(sle.render(this.actionsElement,e,r))}append(e){const n=He(this.actionsElement,e);return this._hasContent=!0,n}};oj=ale([SS(0,sr)],oj);class aj{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,n){this._editor=e,this._participants=n,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,n){if(n.type!==1&&!n.supportsMarkerHover)return[];const r=e.getModel(),s=n.range.startLineNumber;if(s>r.getLineCount())return[];const o=r.getLineMaxColumn(s);return e.getLineDecorations(s).filter(a=>{if(a.options.isWholeLine)return!0;const l=a.range.startLineNumber===s?a.range.startColumn:1,c=a.range.endLineNumber===s?a.range.endColumn:o;if(a.options.showIfCollapsed){if(l>n.range.startColumn+1||n.range.endColumn-1>c)return!1}else if(l>n.range.startColumn||n.range.endColumn>c)return!1;return!0})}computeAsync(e){const n=this._anchor;if(!this._editor.hasModel()||!n)return zs.EMPTY;const r=aj._getLineDecorations(this._editor,n);return zs.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(n,r,e):zs.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=aj._getLineDecorations(this._editor,this._anchor);let n=[];for(const r of this._participants)n=n.concat(r.computeSync(this._anchor,e));return Hm(n)}}function b0e(i,e,n,r,s,o){const a=n+s/2,l=r+o/2,c=Math.max(Math.abs(i-a)-s/2,0),u=Math.max(Math.abs(e-l)-o/2,0);return Math.sqrt(c*c+u*u)}const y0e=tt;class oE extends Le{constructor(e,n,r){super(),this._renderDisposeables=this._register(new Xe),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new jNe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Rv({editor:this._editor},n,r)),this._computer=new LDt(this._editor),this._hoverOperation=this._register(new WNe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{this._withResult(s.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return oE.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(n=>this._editor.applyFontInfo(n))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,n){this._renderDisposeables.clear();const r=document.createDocumentFragment();for(const s of n){const o=y0e("div.hover-row.markdown-hover"),a=He(o,y0e("div.hover-contents")),l=this._renderDisposeables.add(this._markdownRenderer.render(s.value));a.appendChild(l.element),r.appendChild(o)}this._updateContents(r),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const n=this._editor.getLayoutInfo(),r=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),o=this._editor.getOption(66),a=this._hover.containerDomNode.clientHeight,l=r-s-(a-o)/2;this._hover.containerDomNode.style.left=`${n.glyphMarginLeft+n.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(l),0)}px`}}oE.ID="editor.contrib.modesGlyphHoverWidget";class LDt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=s=>({value:s}),n=this._editor.getLineDecorations(this._lineNumber),r=[];if(!n)return r;for(const s of n){if(!s.options.glyphMarginClassName)continue;const o=s.options.glyphMarginHoverMessage;!o||YE(o)||r.push(...Lse(o).map(e))}return r}}var DDt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class EDt{constructor(e,n,r){this.provider=e,this.hover=n,this.ordinal=r}}function IDt(i,e,n,r,s){return DDt(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(i.provideHover(n,r,s));if(o&&RDt(o))return new EDt(i,o,e)}catch(o){Us(o)}})}function lle(i,e,n,r){const o=i.ordered(e).map((a,l)=>IDt(a,l,e,n,r));return zs.fromPromises(o).coalesce()}function TDt(i,e,n,r){return lle(i,e,n,r).map(s=>s.hover).toPromise()}d_("_executeHoverProvider",(i,e,n)=>{const r=i.get(Et);return TDt(r.hoverProvider,e,n,Hn.None)});function RDt(i){const e=typeof i.range<"u",n=typeof i.contents<"u"&&i.contents&&i.contents.length>0;return e&&n}var ADt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},A6=function(i,e){return function(n,r){e(n,r,i)}};const w0e=tt;class Tp{constructor(e,n,r,s,o){this.owner=e,this.range=n,this.contents=r,this.isBeforeContent=s,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let lj=class{constructor(e,n,r,s,o){this._editor=e,this._languageService=n,this._openerService=r,this._configurationService=s,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new Tp(this,e.range,[new Ea().appendText(L("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,n){if(!this._editor.hasModel()||e.type!==1)return[];const r=this._editor.getModel(),s=e.range.startLineNumber,o=r.getLineMaxColumn(s),a=[];let l=1e3;const c=r.getLineLength(s),u=r.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(116),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:u});let f=!1;d>=0&&c>d&&e.range.startColumn>=d&&(f=!0,a.push(new Tp(this,e.range,[{value:L("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,l++))),!f&&typeof h=="number"&&c>=h&&a.push(new Tp(this,e.range,[{value:L("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,l++));let p=!1;for(const g of n){const m=g.range.startLineNumber===s?g.range.startColumn:1,_=g.range.endLineNumber===s?g.range.endColumn:o,b=g.options.hoverMessage;if(!b||YE(b))continue;g.options.beforeContentClassName&&(p=!0);const y=new J(e.range.startLineNumber,m,e.range.startLineNumber,_);a.push(new Tp(this,y,Lse(b),p,l++))}return a}computeAsync(e,n,r){if(!this._editor.hasModel()||e.type!==1)return zs.EMPTY;const s=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(s))return zs.EMPTY;const o=new ve(e.range.startLineNumber,e.range.startColumn);return lle(this._languageFeaturesService.hoverProvider,s,o,r).filter(a=>!YE(a.hover.contents)).map(a=>{const l=a.hover.range?J.lift(a.hover.range):e.range;return new Tp(this,l,a.hover.contents,!1,a.ordinal)})}renderHoverParts(e,n){return zNe(e,n,this._editor,this._languageService,this._openerService)}};lj=ADt([A6(1,Ar),A6(2,fu),A6(3,ei),A6(4,Et)],lj);function zNe(i,e,n,r,s){e.sort((a,l)=>a.ordinal-l.ordinal);const o=new Xe;for(const a of e)for(const l of a.contents){if(YE(l))continue;const c=w0e("div.hover-row.markdown-hover"),u=He(c,w0e("div.hover-contents")),d=o.add(new Rv({editor:n},r,s));o.add(d.onDidRenderAsync(()=>{u.className="hover-contents code-hover-contents",i.onContentsChanged()}));const h=o.add(d.render(l));u.appendChild(h.element),i.fragment.appendChild(c)}return o}var VNe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cj=function(i,e){return function(n,r){e(n,r,i)}};class C0e{constructor(e,n,r){this.marker=e,this.index=n,this.total=r}}let Ute=class{constructor(e,n,r){this._markerService=n,this._configService=r,this._onDidChange=new _e,this.onDidChange=this._onDidChange.event,this._dispoables=new Xe,this._markers=[],this._nextIdx=-1,Jt.isUri(e)?this._resourceFilter=l=>l.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(l,c)=>{let u=aP(l.resource.toString(),c.resource.toString());return u===0&&(s==="position"?u=J.compareRangesUsingStarts(l,c)||es.compare(l.severity,c.severity):u=es.compare(l.severity,c.severity)||J.compareRangesUsingStarts(l,c)),u},a=()=>{this._markers=this._markerService.read({resource:Jt.isUri(e)?e:void 0,severities:es.Error|es.Warning|es.Info}),typeof e=="function"&&(this._markers=this._markers.filter(l=>this._resourceFilter(l.resource))),this._markers.sort(o)};a(),this._dispoables.add(n.onMarkerChanged(l=>{(!this._resourceFilter||l.some(c=>this._resourceFilter(c)))&&(a(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new C0e(e,this._nextIdx+1,this._markers.length)}_initIdx(e,n,r){let s=!1,o=this._markers.findIndex(a=>a.resource.toString()===e.uri.toString());o<0&&(o=JM(this._markers,{resource:e.uri},(a,l)=>aP(a.resource.toString(),l.resource.toString())),o<0&&(o=~o));for(let a=o;a<this._markers.length;a++){let l=J.lift(this._markers[a]);if(l.isEmpty()){const c=e.getWordAtPosition(l.getStartPosition());c&&(l=new J(l.startLineNumber,c.startColumn,l.startLineNumber,c.endColumn))}if(n&&(l.containsPosition(n)||n.isBeforeOrEqual(l.getStartPosition()))){this._nextIdx=a,s=!0;break}if(this._markers[a].resource.toString()!==e.uri.toString())break}s||(this._nextIdx=r?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,n,r){if(this._markers.length===0)return!1;const s=this._nextIdx;return this._nextIdx===-1?this._initIdx(n,r,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),s!==this._nextIdx}find(e,n){let r=this._markers.findIndex(s=>s.resource.toString()===e.toString());if(!(r<0)){for(;r<this._markers.length;r++)if(J.containsPosition(this._markers[r],n))return new C0e(this._markers[r],r+1,this._markers.length)}}};Ute=VNe([cj(1,h_),cj(2,ei)],Ute);const HNe=qn("IMarkerNavigationService");let qte=class{constructor(e,n){this._markerService=e,this._configService=n,this._provider=new jl}getMarkerList(e){for(const n of this._provider){const r=n.getMarkerList(e);if(r)return r}return new Ute(e,this._markerService,this._configService)}};qte=VNe([cj(0,h_),cj(1,ei)],qte);oi(HNe,qte,1);var Kte;(function(i){function e(n){switch(n){case vs.Ignore:return"severity-ignore "+en.asClassName(lt.info);case vs.Info:return en.asClassName(lt.info);case vs.Warning:return en.asClassName(lt.warning);case vs.Error:return en.asClassName(lt.error);default:return""}}i.className=e})(Kte||(Kte={}));var NDt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},aD=function(i,e){return function(n,r){e(n,r,i)}},Gte;class MDt{constructor(e,n,r,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Xe,this._editor=n;const a=document.createElement("div");a.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),a.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),a.appendChild(this._relatedBlock),this._disposables.add(As(this._relatedBlock,"click",l=>{l.preventDefault();const c=this._relatedDiagnostics.get(l.target);c&&r(c)})),this._scrollable=new kIe(a,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(l=>{a.style.left=`-${l.scrollLeft}px`,a.style.top=`-${l.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Mi(this._disposables)}update(e){const{source:n,message:r,relatedInformation:s,code:o}=e;let a=((n==null?void 0:n.length)||0)+2;o&&(typeof o=="string"?a+=o.length:a+=o.value.length);const l=Km(r);this._lines=l.length,this._longestLineLength=0;for(const f of l)this._longestLineLength=Math.max(f.length+a,this._longestLineLength);la(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let c=this._messageBlock;for(const f of l)c=document.createElement("div"),c.innerText=f,f===""&&(c.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(c);if(n||o){const f=document.createElement("span");if(f.classList.add("details"),c.appendChild(f),n){const p=document.createElement("span");p.innerText=n,p.classList.add("source"),f.appendChild(p)}if(o)if(typeof o=="string"){const p=document.createElement("span");p.innerText=`(${o})`,p.classList.add("code"),f.appendChild(p)}else{this._codeLink=tt("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const p=He(this._codeLink,tt("span"));p.innerText=o.value,f.appendChild(this._codeLink)}}if(la(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Ka(s)){const f=this._relatedBlock.appendChild(document.createElement("div"));f.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const p of s){const g=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(p.resource)}(${p.startLineNumber}, ${p.startColumn}): `,m.title=this._labelService.getUriLabel(p.resource),this._relatedDiagnostics.set(m,p);const _=document.createElement("span");_.innerText=p.message,g.appendChild(m),g.appendChild(_),this._lines+=1,f.appendChild(g)}}const u=this._editor.getOption(50),d=Math.ceil(u.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=u.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,n){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${n}px`,this._scrollable.setScrollDimensions({width:n,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let n="";switch(e.severity){case es.Error:n=L("Error","Error");break;case es.Warning:n=L("Warning","Warning");break;case es.Info:n=L("Info","Info");break;case es.Hint:n=L("Hint","Hint");break}let r=L("marker aria","{0} at {1}. ",n,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(r=`${s.getLineContent(e.startLineNumber)}, ${r}`),r}}let oI=Gte=class extends rj{constructor(e,n,r,s,o,a,l){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=n,this._openerService=r,this._menuService=s,this._contextKeyService=a,this._labelService=l,this._callOnDispose=new Xe,this._onDidSelectRelatedInformation=new _e,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=es.Warning,this._backgroundColor=Te.white,this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(BDt);let n=Xte,r=PDt;this._severity===es.Warning?(n=M8,r=ODt):this._severity===es.Info&&(n=Yte,r=FDt);const s=e.getColor(n),o=e.getColor(r);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(INe),secondaryHeadingColor:e.getColor(TNe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const n=[],r=this._menuService.createMenu(Gte.TitleMenu,this._contextKeyService);sRe(r,void 0,n),this._actionbarWidget.push(n,{label:!1,icon:!0,index:0}),r.dispose()}_fillTitleIcon(e){this._icon=He(e,tt(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new MDt(this._container,this.editor,n=>this._onDidSelectRelatedInformation.fire(n),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,n,r){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const s=J.lift(e),o=this.editor.getPosition(),a=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(a,this.computeRequiredHeight());const l=this.editor.getModel();if(l){const c=r>1?L("problems","{0} of {1} problems",n,r):L("change","{0} of {1} problem",n,r);this.setTitle(yh(l.uri),c)}this._icon.className=`codicon ${Kte.className(es.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(a,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,n){super._doLayoutBody(e,n),this._heightInPixel=e,this._message.layout(e,n),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};oI.TitleMenu=new se("gotoErrorTitleMenu");oI=Gte=NDt([aD(1,Do),aD(2,fu),aD(3,c_),aD(4,hn),aD(5,mn),aD(6,KE)],oI);const S0e=kP(wm,Idt),x0e=kP(Ju,SP),k0e=kP(_c,xP),Xte=ce("editorMarkerNavigationError.background",{dark:S0e,light:S0e,hcDark:Jn,hcLight:Jn},L("editorMarkerNavigationError","Editor marker navigation widget error color.")),PDt=ce("editorMarkerNavigationError.headerBackground",{dark:Ht(Xte,.1),light:Ht(Xte,.1),hcDark:null,hcLight:null},L("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),M8=ce("editorMarkerNavigationWarning.background",{dark:x0e,light:x0e,hcDark:Jn,hcLight:Jn},L("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),ODt=ce("editorMarkerNavigationWarning.headerBackground",{dark:Ht(M8,.1),light:Ht(M8,.1),hcDark:"#0C141F",hcLight:Ht(M8,.2)},L("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),Yte=ce("editorMarkerNavigationInfo.background",{dark:k0e,light:k0e,hcDark:Jn,hcLight:Jn},L("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),FDt=ce("editorMarkerNavigationInfo.headerBackground",{dark:Ht(Yte,.1),light:Ht(Yte,.1),hcDark:null,hcLight:null},L("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),BDt=ce("editorMarkerNavigation.background",{dark:Lo,light:Lo,hcDark:Lo,hcLight:Lo},L("editorMarkerNavigationBackground","Editor marker navigation widget background."));var jDt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},N6=function(i,e){return function(n,r){e(n,r,i)}},UNe=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},xN;let T1=xN=class{static get(e){return e.getContribution(xN.ID)}constructor(e,n,r,s,o){this._markerNavigationService=n,this._contextKeyService=r,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new Xe,this._editor=e,this._widgetVisible=qNe.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let n=!1;return this._model&&(n=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),n&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(oI,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(r=>{var s,o,a;(!(!((s=this._model)===null||s===void 0)&&s.selected)||!J.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,r.position))&&((a=this._model)===null||a===void 0||a.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const r=this._model.find(this._editor.getModel().uri,this._widget.position);r?this._widget.updateMarker(r.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(r=>{this._editorService.openCodeEditor({resource:r.resource,options:{pinned:!0,revealIfOpened:!0,selection:J.lift(r).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const n=this._getOrCreateModel(this._editor.getModel().uri);n.resetIndex(),n.move(!0,this._editor.getModel(),new ve(e.startLineNumber,e.startColumn)),n.selected&&this._widget.showAtMarker(n.selected.marker,n.selected.index,n.selected.total)}}nagivate(e,n){var r,s;return UNe(this,void 0,void 0,function*(){if(this._editor.hasModel()){const o=this._getOrCreateModel(n?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const a=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);a&&((r=xN.get(a))===null||r===void 0||r.close(),(s=xN.get(a))===null||s===void 0||s.nagivate(e,n))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};T1.ID="editor.contrib.markerController";T1=xN=jDt([N6(1,HNe),N6(2,mn),N6(3,Si),N6(4,hn)],T1);class Ez extends kt{constructor(e,n,r){super(r),this._next=e,this._multiFile=n}run(e,n){var r;return UNe(this,void 0,void 0,function*(){n.hasModel()&&((r=T1.get(n))===null||r===void 0||r.nagivate(this._next,this._multiFile))})}}class Zy extends Ez{constructor(){super(!0,!1,{id:Zy.ID,label:Zy.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:578,weight:100},menuOpts:{menuId:oI.TitleMenu,title:Zy.LABEL,icon:ws("marker-navigation-next",lt.arrowDown,L("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Zy.ID="editor.action.marker.next";Zy.LABEL=L("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class $S extends Ez{constructor(){super(!1,!1,{id:$S.ID,label:$S.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:1602,weight:100},menuOpts:{menuId:oI.TitleMenu,title:$S.LABEL,icon:ws("marker-navigation-previous",lt.arrowUp,L("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}$S.ID="editor.action.marker.prev";$S.LABEL=L("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class WDt extends Ez{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:L("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:66,weight:100},menuOpts:{menuId:se.MenubarGoMenu,title:L({},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class $Dt extends Ez{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:L("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:1090,weight:100},menuOpts:{menuId:se.MenubarGoMenu,title:L({},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}_i(T1.ID,T1,4);rt(Zy);rt($S);rt(WDt);rt($Dt);const qNe=new yt("markersNavigationVisible",!1),zDt=Ho.bindToContribution(T1.get);ct(new zDt({id:"closeMarkersNavigation",precondition:qNe,handler:i=>i.close(),kbOpts:{weight:150,kbExpr:oe.focus,primary:9,secondary:[1033]}}));var VDt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},bK=function(i,e){return function(n,r){e(n,r,i)}};const Uh=tt;class HDt{constructor(e,n,r){this.owner=e,this.range=n,this.marker=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const L0e={type:1,filter:{include:cn.QuickFix},triggerAction:uu.QuickFixHover};let Zte=class{constructor(e,n,r,s){this._editor=e,this._markerDecorationsService=n,this._openerService=r,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,n){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const r=this._editor.getModel(),s=e.range.startLineNumber,o=r.getLineMaxColumn(s),a=[];for(const l of n){const c=l.range.startLineNumber===s?l.range.startColumn:1,u=l.range.endLineNumber===s?l.range.endColumn:o,d=this._markerDecorationsService.getMarker(r.uri,l);if(!d)continue;const h=new J(e.range.startLineNumber,c,e.range.startLineNumber,u);a.push(new HDt(this,h,d))}return a}renderHoverParts(e,n){if(!n.length)return Le.None;const r=new Xe;n.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,r)));const s=n.length===1?n[0]:n.sort((o,a)=>es.compare(o.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,s,r),r}renderMarkerHover(e,n){const r=Uh("div.hover-row"),s=He(r,Uh("div.marker.hover-contents")),{source:o,message:a,code:l,relatedInformation:c}=e.marker;this._editor.applyFontInfo(s);const u=He(s,Uh("span"));if(u.style.whiteSpace="pre-wrap",u.innerText=a,o||l)if(l&&typeof l!="string"){const d=Uh("span");if(o){const g=He(d,Uh("span"));g.innerText=o}const h=He(d,Uh("a.code-link"));h.setAttribute("href",l.target.toString()),n.add(Be(h,"click",g=>{this._openerService.open(l.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const f=He(h,Uh("span"));f.innerText=l.value;const p=He(s,d);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{const d=He(s,Uh("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&l?`${o}(${l})`:o||`(${l})`}if(Ka(c))for(const{message:d,resource:h,startLineNumber:f,startColumn:p}of c){const g=He(s,Uh("div"));g.style.marginTop="8px";const m=He(g,Uh("a"));m.innerText=`${yh(h)}(${f}, ${p}): `,m.style.cursor="pointer",n.add(Be(m,"click",b=>{b.stopPropagation(),b.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:f,startColumn:p}}}).catch(Ln)}));const _=He(g,Uh("span"));_.innerText=d,this._editor.applyFontInfo(_)}return r}renderMarkerStatusbar(e,n,r){if((n.marker.severity===es.Error||n.marker.severity===es.Warning||n.marker.severity===es.Info)&&e.statusBar.addAction({label:L("view problem","View Problem"),commandId:Zy.ID,run:()=>{var s;e.hide(),(s=T1.get(this._editor))===null||s===void 0||s.showAtMarker(n.marker),this._editor.focus()}}),!this._editor.getOption(90)){const s=e.statusBar.append(Uh("div"));this.recentMarkerCodeActionsInfo&&(M7.makeKey(this.recentMarkerCodeActionsInfo.marker)===M7.makeKey(n.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=L("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Le.None:r.add(g1(()=>s.textContent=L("checkingForQuickFixes","Checking for quick fixes..."),200));s.textContent||(s.textContent=" ");const a=this.getCodeActions(n.marker);r.add(gn(()=>a.cancel())),a.then(l=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:n.marker,hasCodeActions:l.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){l.dispose(),s.textContent=L("noQuickFixes","No quick fixes available");return}s.style.display="none";let c=!1;r.add(gn(()=>{c||l.dispose()})),e.statusBar.addAction({label:L("quick fixes","Quick Fix..."),commandId:Zae,run:u=>{c=!0;const d=k1.get(this._editor),h=no(u);e.hide(),d==null||d.showCodeActions(L0e,l,{x:h.left,y:h.top,width:h.width,height:h.height})}})},Ln)}}getCodeActions(e){return go(n=>wM(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new J(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),L0e,_v.None,n))}};Zte=VDt([bK(1,hoe),bK(2,fu),bK(3,Et)],Zte);const KNe="editor.action.inlineSuggest.commit",GNe="editor.action.inlineSuggest.showPrevious",XNe="editor.action.inlineSuggest.showNext";var UDt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class qDt extends Le{constructor(e,n,r={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Ust),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Xe),this.options=r,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new uO(()=>{var s;return(s=this.toggleMenuActionViewItem)===null||s===void 0?void 0:s.show()},r.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new wh(this.element,{orientation:r.orientation,ariaLabel:r.ariaLabel,actionRunner:r.actionRunner,allowContextMenu:r.allowContextMenu,highlightToggledItems:r.highlightToggledItems,actionViewItemProvider:(s,o)=>{var a;if(s.id===uO.ID)return this.toggleMenuActionViewItem=new D7(s,s.menuActions,n,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:en.asClassNameArray((a=r.moreIcon)!==null&&a!==void 0?a:lt.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(r.actionViewItemProvider){const l=r.actionViewItemProvider(s,o);if(l)return l}if(s instanceof NE){const l=new D7(s,s.actions,n,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return l.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(l),this.disposables.add(this._onDidChangeDropdownVisibility.add(l.onDidChangeVisibility)),l}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,n){this.clear();const r=e?e.slice(0):[];this.hasSecondaryActions=!!(n&&n.length>0),this.hasSecondaryActions&&n&&(this.toggleMenuAction.menuActions=n.slice(0),r.push(this.toggleMenuAction)),r.forEach(s=>{this.actionBar.push(s,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(s)})})}getKeybindingLabel(e){var n,r,s;const o=this.lookupKeybindings?(r=(n=this.options).getKeyBinding)===null||r===void 0?void 0:r.call(n,e):void 0;return(s=o==null?void 0:o.getLabel())!==null&&s!==void 0?s:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class uO extends Vl{constructor(e,n){n=n||L("moreActions","More Actions..."),super(uO.ID,n,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return UDt(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}uO.ID="toolbar.toggle.more";var KDt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},aA=function(i,e){return function(n,r){e(n,r,i)}};let Qte=class extends qDt{constructor(e,n,r,s,o,a,l){super(e,o,Object.assign(Object.assign({getKeyBinding:u=>{var d;return(d=a.lookupKeybinding(u.id))!==null&&d!==void 0?d:void 0}},n),{allowContextMenu:!0,skipTelemetry:typeof(n==null?void 0:n.telemetrySource)=="string"})),this._options=n,this._menuService=r,this._contextKeyService=s,this._contextMenuService=o,this._sessionDisposables=this._store.add(new Xe);const c=n==null?void 0:n.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(u=>l.publicLog2("workbenchActionExecuted",{id:u.action.id,from:c})))}setActions(e,n=[],r){var s,o,a;this._sessionDisposables.clear();const l=e.slice(),c=n.slice(),u=[];let d=0;const h=[];let f=!1;if(((s=this._options)===null||s===void 0?void 0:s.hiddenItemStrategy)!==-1)for(let p=0;p<l.length;p++){const g=l[p];!(g instanceof If)&&!(g instanceof dP)||g.hideActions&&(u.push(g.hideActions.toggle),g.hideActions.toggle.checked&&d++,g.hideActions.isHidden&&(f=!0,l[p]=void 0,((o=this._options)===null||o===void 0?void 0:o.hiddenItemStrategy)!==0&&(h[p]=g)))}if(((a=this._options)===null||a===void 0?void 0:a.overflowBehavior)!==void 0){const p=fyt(new Set(this._options.overflowBehavior.exempted),Vn.map(l,_=>_==null?void 0:_.id)),g=this._options.overflowBehavior.maxItems-p.size;let m=0;for(let _=0;_<l.length;_++){const b=l[_];b&&(m++,!p.has(b.id)&&m>=g&&(l[_]=void 0,h[_]=b))}}Mfe(l),Mfe(h),super.setActions(l,Vo.join(h,c)),u.length>0&&this._sessionDisposables.add(Be(this.getElement(),"contextmenu",p=>{var g,m,_,b,y;const x=new rh(p),k=this.getItemAction(x.target);if(!k)return;x.preventDefault(),x.stopPropagation();let D=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){D=!0;for(let A=0;A<u.length;A++)if(u[A].checked){u[A]=B2({id:k.id,label:k.label,checked:!0,enabled:!1,run(){}});break}}let R;if(!D&&(k instanceof If||k instanceof dP)){if(!k.hideActions)return;R=k.hideActions.hide}else R=B2({id:"label",label:L("hide","Hide"),enabled:!1,run(){}});const E=Vo.join([R],u);!((m=this._options)===null||m===void 0)&&m.resetMenu&&!r&&(r=[this._options.resetMenu]),f&&r&&(E.push(new Vo),E.push(B2({id:"resetThisMenu",label:L("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(r)}))),this._contextMenuService.showContextMenu({getAnchor:()=>x,getActions:()=>E,menuId:(_=this._options)===null||_===void 0?void 0:_.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(b=this._options)===null||b===void 0?void 0:b.menuOptions),skipTelemetry:typeof((y=this._options)===null||y===void 0?void 0:y.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};Qte=KDt([aA(2,c_),aA(3,mn),aA(4,Ff),aA(5,sr),aA(6,_d)],Qte);var cle=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Rp=function(i,e){return function(n,r){e(n,r,i)}},P8;let Jte=class extends Le{constructor(e,n,r){super(),this.editor=e,this.model=n,this.instantiationService=r,this.alwaysShowToolbar=oa(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=ni(this,s=>{var o,a,l;const c=(o=this.model.read(s))===null||o===void 0?void 0:o.ghostText.read(s);if(!this.alwaysShowToolbar.read(s)||!c||c.parts.length===0)return this.sessionPosition=void 0,null;const u=c.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==c.lineNumber&&(this.sessionPosition=void 0);const d=new ve(c.lineNumber,Math.min(u,(l=(a=this.sessionPosition)===null||a===void 0?void 0:a.column)!==null&&l!==void 0?l:Number.MAX_SAFE_INTEGER));return this.sessionPosition=d,d}),this._register(Xc((s,o)=>{const a=this.model.read(s);if(!a||!this.alwaysShowToolbar.read(s))return;const l=o.add(this.instantiationService.createInstance(R1,this.editor,!0,this.position,a.selectedInlineCompletionIndex,a.inlineCompletionsCount,a.selectedInlineCompletion.map(c=>{var u;return(u=c==null?void 0:c.inlineCompletion.source.inlineCompletions.commands)!==null&&u!==void 0?u:[]})));e.addContentWidget(l),o.add(gn(()=>e.removeContentWidget(l))),o.add(ur(c=>{this.position.read(c)&&a.lastTriggerKind.read(c)!==pv.Explicit&&a.triggerExplicitly()}))}))}};Jte=cle([Rp(2,hn)],Jte);const GDt=ws("inline-suggestion-hints-next",lt.chevronRight,L("parameterHintsNextIcon","Icon for show next parameter hint.")),XDt=ws("inline-suggestion-hints-previous",lt.chevronLeft,L("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let R1=P8=class extends Le{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,n,r){const s=new Vl(e,n,r,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let a=n;return o&&(a=L({},"{0} ({1})",n,o.getLabel())),s.tooltip=a,s}constructor(e,n,r,s,o,a,l,c,u,d,h){super(),this.editor=e,this.withBorder=n,this._position=r,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=a,this._commandService=l,this.keybindingService=u,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${P8.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Jo("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Jo("div@toolBar")]),this.previousAction=this.createCommandAction(GNe,L("previous","Previous"),en.asClassName(XDt)),this.availableSuggestionCountAction=new Vl("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(XNe,L("next","Next"),en.asClassName(GDt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(se.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Ji(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Ji(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(c.createInstance(ene,this.nodes.toolBar,se.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:f=>f.startsWith("primary")},actionViewItemProvider:(f,p)=>{if(f instanceof If)return c.createInstance(ZDt,f,void 0);if(f===this.availableSuggestionCountAction){const g=new YDt(void 0,f,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(f=>{P8._dropDownVisible=f})),this._register(ur(f=>{this._position.read(f),this.editor.layoutContentWidget(this)})),this._register(ur(f=>{const p=this._suggestionCount.read(f),g=this._currentSuggestionIdx.read(f);p!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${p}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),p!==void 0&&p>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(ur(f=>{const p=this._extraCommands.read(f);if(ys(this.lastCommands,p))return;this.lastCommands=p;const g=p.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:_=>this._commandService.executeCommand(m.id)}));for(const[m,_]of this.inlineCompletionsActionsMenus.getActions())for(const b of _)b instanceof If&&g.push(b);g.length>0&&g.unshift(new Vo),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};R1._dropDownVisible=!1;R1.id=0;R1=P8=cle([Rp(6,us),Rp(7,hn),Rp(8,sr),Rp(9,mn),Rp(10,c_)],R1);class YDt extends ZE{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let ZDt=class extends mx{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const n=Jo("div.keybinding").root;new q5(n,Zu,Object.assign({disableTitle:!0},R1t)).set(e),this.label.textContent=this._action.label,this.label.appendChild(n),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},ene=class extends Qte{constructor(e,n,r,s,o,a,l,c){super(e,Object.assign({resetMenu:n},r),s,o,a,l,c),this.menuId=n,this.options2=r,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,n,r,s,o,a,l;const c=[],u=[];sRe(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:c,secondary:u},(r=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||r===void 0?void 0:r.primaryGroup,(o=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(l=(a=this.options2)===null||a===void 0?void 0:a.toolbarOptions)===null||l===void 0?void 0:l.useSeparatorsInPrimaryActions),u.push(...this.additionalActions),c.unshift(...this.prependedPrimaryActions),this.setActions(c,u)}setPrependedPrimaryActions(e){ys(this.prependedPrimaryActions,e,(n,r)=>n===r)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){ys(this.additionalActions,e,(n,r)=>n===r)||(this.additionalActions=e,this.updateToolbar())}};ene=cle([Rp(3,c_),Rp(4,mn),Rp(5,Ff),Rp(6,sr),Rp(7,_d)],ene);var QDt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},M6=function(i,e){return function(n,r){e(n,r,i)}},tne;let kc=tne=class extends Le{static get(e){return e.getContribution(tne.ID)}constructor(e,n,r,s,o){super(),this._editor=e,this._instantiationService=n,this._openerService=r,this._languageService=s,this._keybindingService=o,this._toUnhook=new Xe,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Ji(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})),this._register(this._editor.onMouseLeave(()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}))}_hookEvents(){const e=()=>this._hideWidgets(),n=this._editor.getOption(60);this._isHoverEnabled=n.enabled,this._isHoverSticky=n.sticky,this._hidingDelay=n.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(r=>this._onEditorMouseDown(r))),this._toUnhook.add(this._editor.onMouseUp(r=>this._onEditorMouseUp(r))),this._toUnhook.add(this._editor.onMouseMove(r=>this._onEditorMouseMove(r))),this._toUnhook.add(this._editor.onKeyDown(r=>this._onKeyDown(r)))):(this._toUnhook.add(this._editor.onMouseMove(r=>this._onEditorMouseMove(r))),this._toUnhook.add(this._editor.onKeyDown(r=>this._onKeyDown(r)))),this._toUnhook.add(this._editor.onMouseLeave(r=>this._onEditorMouseLeave(r))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(r=>this._onEditorScrollChanged(r)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var n;this._isMouseDown=!0;const r=e.target;if(r.type===9&&r.detail===Yy.ID){this._hoverClicked=!0;return}r.type===12&&r.detail===oE.ID||(r.type!==12&&(this._hoverClicked=!1),!((n=this._contentWidget)===null||n===void 0)&&n.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var n,r;const s=e.event.browserEvent.relatedTarget;!((n=this._contentWidget)===null||n===void 0)&&n.widget.isResizing||!((r=this._contentWidget)===null||r===void 0)&&r.containsNode(s)||this._hideWidgets()}_isMouseOverWidget(e){var n,r,s,o,a;const l=e.target;return!!(this._isHoverSticky&&l.type===9&&l.detail===Yy.ID||this._isHoverSticky&&(!((n=this._contentWidget)===null||n===void 0)&&n.containsNode((r=e.event.browserEvent.view)===null||r===void 0?void 0:r.document.activeElement))&&!(!((o=(s=e.event.browserEvent.view)===null||s===void 0?void 0:s.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&l.type===9&&l.detail===Yy.ID&&(!((a=this._contentWidget)===null||a===void 0)&&a.isColorPickerVisible)||this._isHoverSticky&&l.type===12&&l.detail===oE.ID)}_onEditorMouseMove(e){var n,r,s,o;if(this._mouseMoveEvent=e,!((n=this._contentWidget)===null||n===void 0)&&n.isFocused||!((r=this._contentWidget)===null||r===void 0)&&r.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((s=this._contentWidget)===null||s===void 0)&&s.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var n,r,s;if(!e)return;const o=e.target,a=(n=o.element)===null||n===void 0?void 0:n.classList.contains("colorpicker-color-decoration"),l=this._editor.getOption(146);if(a&&(l==="click"&&!this._hoverActivatedByColorDecoratorClick||l==="hover"&&!this._isHoverEnabled||l==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!a&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(r=this._glyphWidget)===null||r===void 0||r.hide();return}if(o.type===2&&o.position){(s=this._contentWidget)===null||s===void 0||s.hide(),this._glyphWidget||(this._glyphWidget=new oE(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(o.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var n;if(!this._editor.hasModel())return;const r=this._keybindingService.softDispatch(e,this._editor.getDomNode()),s=r.kind===1||r.kind===2&&r.commandId==="editor.action.showHover"&&((n=this._contentWidget)===null||n===void 0?void 0:n.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!s&&this._hideWidgets()}_hideWidgets(){var e,n,r;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||R1.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(n=this._glyphWidget)===null||n===void 0||n.hide(),(r=this._contentWidget)===null||r===void 0||r.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(sj,this._editor)),this._contentWidget}showContentHover(e,n,r,s,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,n,r,s)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,n;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(n=this._contentWidget)===null||n===void 0||n.dispose()}};kc.ID="editor.contrib.hover";kc=tne=QDt([M6(1,hn),M6(2,fu),M6(3,Ar),M6(4,sr)],kc);class JDt extends kt{constructor(){super({id:"editor.action.showHover",label:L({},"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2087),weight:100}})}run(e,n,r){if(!n.hasModel())return;const s=kc.get(n);if(!s)return;const o=n.getPosition(),a=new J(o.lineNumber,o.column,o.lineNumber,o.column),l=n.getOption(2)===2||!!(r!=null&&r.focus);s.isHoverVisible?s.focus():s.showContentHover(a,1,1,l)}}class e2t extends kt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:L({},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,n){const r=kc.get(n);if(!r)return;const s=n.getPosition();if(!s)return;const o=new J(s.lineNumber,s.column,s.lineNumber,s.column),a=Lx.get(n);if(!a)return;a.startFindDefinitionFromCursor(s).then(()=>{r.showContentHover(o,1,1,!0)})}}class t2t extends kt{constructor(){super({id:"editor.action.scrollUpHover",label:L({},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:16,weight:100}})}run(e,n){const r=kc.get(n);r&&r.scrollUp()}}class n2t extends kt{constructor(){super({id:"editor.action.scrollDownHover",label:L({},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:18,weight:100}})}run(e,n){const r=kc.get(n);r&&r.scrollDown()}}class i2t extends kt{constructor(){super({id:"editor.action.scrollLeftHover",label:L({},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:15,weight:100}})}run(e,n){const r=kc.get(n);r&&r.scrollLeft()}}class r2t extends kt{constructor(){super({id:"editor.action.scrollRightHover",label:L({},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:17,weight:100}})}run(e,n){const r=kc.get(n);r&&r.scrollRight()}}class s2t extends kt{constructor(){super({id:"editor.action.pageUpHover",label:L({},"Page Up Hover"),alias:"Page Up Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,n){const r=kc.get(n);r&&r.pageUp()}}class o2t extends kt{constructor(){super({id:"editor.action.pageDownHover",label:L({},"Page Down Hover"),alias:"Page Down Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,n){const r=kc.get(n);r&&r.pageDown()}}class a2t extends kt{constructor(){super({id:"editor.action.goToTopHover",label:L({},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,n){const r=kc.get(n);r&&r.goToTop()}}class l2t extends kt{constructor(){super({id:"editor.action.goToBottomHover",label:L({},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,n){const r=kc.get(n);r&&r.goToBottom()}}_i(kc.ID,kc,2);rt(JDt);rt(e2t);rt(t2t);rt(n2t);rt(i2t);rt(r2t);rt(s2t);rt(o2t);rt(a2t);rt(l2t);uk.register(lj);uk.register(Zte);Of((i,e)=>{const n=i.getColor(Hdt);n&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${n.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${n.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${n.transparent(.5)}; }`))});class nne extends Le{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(n=>this.onMouseDown(n)))}dispose(){super.dispose()}onMouseDown(e){const n=this._editor.getOption(146);if(n!=="click"&&n!=="clickAndHover")return;const r=e.target;if(r.type!==6||!r.detail.injectedText||r.detail.injectedText.options.attachedData!==bNe||!r.range)return;const s=this._editor.getContribution(kc.ID);if(s&&!s.isColorPickerVisible){const o=new J(r.range.startLineNumber,r.range.startColumn+1,r.range.endLineNumber,r.range.endColumn+1);s.showContentHover(o,1,0,!1,!0)}}}nne.ID="editor.contrib.colorContribution";_i(nne.ID,nne,2);uk.register(ij);var YNe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},kp=function(i,e){return function(n,r){e(n,r,i)}},D0e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},ine,rne;let A1=ine=class extends Le{constructor(e,n,r,s,o,a,l){super(),this._editor=e,this._modelService=r,this._keybindingService=s,this._instantiationService=o,this._languageFeatureService=a,this._languageConfigurationService=l,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=oe.standaloneColorPickerVisible.bindTo(n),this._standaloneColorPickerFocused=oe.standaloneColorPickerFocused.bindTo(n)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new uj(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(ine.ID)}};A1.ID="editor.contrib.standaloneColorPickerController";A1=ine=YNe([kp(1,mn),kp(2,Fr),kp(3,sr),kp(4,hn),kp(5,Et),kp(6,dr)],A1);_i(A1.ID,A1,1);const E0e=8,c2t=22;let uj=rne=class extends Le{constructor(e,n,r,s,o,a,l,c){var u;super(),this._editor=e,this._standaloneColorPickerVisible=n,this._standaloneColorPickerFocused=r,this._modelService=o,this._keybindingService=a,this._languageFeaturesService=l,this._languageConfigurationService=c,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new _e),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=s.createInstance(oO,this._editor),this._position=(u=this._editor._getViewModel())===null||u===void 0?void 0:u.getPrimaryCursorState().modelState.position;const d=this._editor.getSelection(),h=d?{startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},f=this._register(Gm(this._body));this._register(f.onDidBlur(p=>{this.hide()})),this._register(f.onDidFocus(p=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(p=>{var g;const m=(g=p.target.element)===null||g===void 0?void 0:g.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(p=>{this._render(p.value,p.foundInEditor)})),this._start(h),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return rne.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}_start(e){return D0e(this,void 0,void 0,function*(){const n=yield this._computeAsync(e);n&&this._onResult.fire(new u2t(n.result,n.foundInEditor))})}_computeAsync(e){return D0e(this,void 0,void 0,function*(){if(!this._editor.hasModel())return null;const n={range:e,color:{red:0,green:0,blue:0,alpha:1}},r=yield this._standaloneColorPickerParticipant.createColorHover(n,new tle(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return r?{result:r.colorHover,foundInEditor:r.foundInEditor}:null})}_render(e,n){const r=document.createDocumentFragment(),s=this._register(new oj(this._keybindingService));let o;const a={fragment:r,statusBar:s,setColorPicker:m=>o=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(a,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(r),o.layout();const l=o.body,c=l.saturationBox.domNode.clientWidth,u=l.domNode.clientWidth-c-c2t-E0e,d=o.body.enterButton;d==null||d.onClicked(()=>{this.updateEditor(),this.hide()});const h=o.header,f=h.pickedColorNode;f.style.width=c+E0e+"px";const p=h.originalColorNode;p.style.width=u+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),n&&(d&&(d.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};uj.ID="editor.contrib.standaloneColorPickerWidget";uj=rne=YNe([kp(3,hn),kp(4,Fr),kp(5,sr),kp(6,Et),kp(7,dr)],uj);class u2t{constructor(e,n){this.value=e,this.foundInEditor=n}}class d2t extends og{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:L("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:L({},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:se.CommandPalette}]})}runEditorCommand(e,n){var r;(r=A1.get(n))===null||r===void 0||r.showOrFocus()}}class h2t extends kt{constructor(){super({id:"editor.action.hideColorPicker",label:L({},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:oe.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,n){var r;(r=A1.get(n))===null||r===void 0||r.hide()}}class f2t extends kt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:L({},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:oe.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,n){var r;(r=A1.get(n))===null||r===void 0||r.insertColor()}}rt(h2t);rt(f2t);Ir(d2t);class Ly{constructor(e,n,r){this.languageConfigurationService=r,this._selection=e,this._insertSpace=n,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,n,r){if(r<0)return!1;const s=n.length,o=e.length;if(r+s>o)return!1;for(let a=0;a<s;a++){const l=e.charCodeAt(r+a),c=n.charCodeAt(a);if(l!==c&&!(l>=65&&l<=90&&l+32===c)&&!(c>=65&&c<=90&&c+32===l))return!1}return!0}_createOperationsForBlockComment(e,n,r,s,o,a){const l=e.startLineNumber,c=e.startColumn,u=e.endLineNumber,d=e.endColumn,h=o.getLineContent(l),f=o.getLineContent(u);let p=h.lastIndexOf(n,c-1+n.length),g=f.indexOf(r,d-1-r.length);if(p!==-1&&g!==-1)if(l===u)h.substring(p+n.length,g).indexOf(r)>=0&&(p=-1,g=-1);else{const _=h.substring(p+n.length),b=f.substring(0,g);(_.indexOf(r)>=0||b.indexOf(r)>=0)&&(p=-1,g=-1)}let m;p!==-1&&g!==-1?(s&&p+n.length<h.length&&h.charCodeAt(p+n.length)===32&&(n=n+" "),s&&g>0&&f.charCodeAt(g-1)===32&&(r=" "+r,g-=1),m=Ly._createRemoveBlockCommentOperations(new J(l,p+n.length+1,u,g+1),n,r)):(m=Ly._createAddBlockCommentOperations(e,n,r,this._insertSpace),this._usedEndToken=m.length===1?r:null);for(const _ of m)a.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,n,r){const s=[];return J.isEmpty(e)?s.push(Vr.delete(new J(e.startLineNumber,e.startColumn-n.length,e.endLineNumber,e.endColumn+r.length))):(s.push(Vr.delete(new J(e.startLineNumber,e.startColumn-n.length,e.startLineNumber,e.startColumn))),s.push(Vr.delete(new J(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+r.length)))),s}static _createAddBlockCommentOperations(e,n,r,s){const o=[];return J.isEmpty(e)?o.push(Vr.replace(new J(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),n+" "+r)):(o.push(Vr.insert(new ve(e.startLineNumber,e.startColumn),n+(s?" ":""))),o.push(Vr.insert(new ve(e.endLineNumber,e.endColumn),(s?" ":"")+r))),o}getEditOperations(e,n){const r=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenization.tokenizeIfCheap(r);const o=e.getLanguageIdAtPosition(r,s),a=this.languageConfigurationService.getLanguageConfiguration(o).comments;!a||!a.blockCommentStartToken||!a.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,a.blockCommentStartToken,a.blockCommentEndToken,this._insertSpace,e,n)}computeCursorState(e,n){const r=n.getInverseEditOperations();if(r.length===2){const s=r[0],o=r[1];return new Ft(s.range.endLineNumber,s.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const s=r[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new Ft(s.endLineNumber,s.endColumn+o,s.endLineNumber,s.endColumn+o)}}}class D0{constructor(e,n,r,s,o,a,l){this.languageConfigurationService=e,this._selection=n,this._tabSize=r,this._type=s,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=a,this._ignoreFirstLine=l||!1}static _gatherPreflightCommentStrings(e,n,r,s){e.tokenization.tokenizeIfCheap(n);const o=e.getLanguageIdAtPosition(n,1),a=s.getLanguageConfiguration(o).comments,l=a?a.lineCommentToken:null;if(!l)return null;const c=[];for(let u=0,d=r-n+1;u<d;u++)c[u]={ignore:!1,commentStr:l,commentStrOffset:0,commentStrLength:l.length};return c}static _analyzeLines(e,n,r,s,o,a,l,c){let u=!0,d;e===0?d=!0:e===1?d=!1:d=!0;for(let h=0,f=s.length;h<f;h++){const p=s[h],g=o+h;if(g===o&&l){p.ignore=!0;continue}const m=r.getLineContent(g),_=ml(m);if(_===-1){p.ignore=a,p.commentStrOffset=m.length;continue}if(u=!1,p.ignore=!1,p.commentStrOffset=_,d&&!Ly._haystackHasNeedleAtOffset(m,p.commentStr,_)&&(e===0?d=!1:e===1||(p.ignore=!0)),d&&n){const b=_+p.commentStrLength;b<m.length&&m.charCodeAt(b)===32&&(p.commentStrLength+=1)}}if(e===0&&u){d=!1;for(let h=0,f=s.length;h<f;h++)s[h].ignore=!1}return{supported:!0,shouldRemoveComments:d,lines:s}}static _gatherPreflightData(e,n,r,s,o,a,l,c){const u=D0._gatherPreflightCommentStrings(r,s,o,c);return u===null?{supported:!1}:D0._analyzeLines(e,n,r,u,s,a,l,c)}_executeLineComments(e,n,r,s){let o;r.shouldRemoveComments?o=D0._createRemoveLineCommentsOperations(r.lines,s.startLineNumber):(D0._normalizeInsertionPoint(e,r.lines,s.startLineNumber,this._tabSize),o=this._createAddLineCommentsOperations(r.lines,s.startLineNumber));const a=new ve(s.positionLineNumber,s.positionColumn);for(let l=0,c=o.length;l<c;l++)n.addEditOperation(o[l].range,o[l].text),J.isEmpty(o[l].range)&&J.getStartPosition(o[l].range).equals(a)&&e.getLineContent(a.lineNumber).length+1===a.column&&(this._deltaColumn=(o[l].text||"").length);this._selectionId=n.trackSelection(s)}_attemptRemoveBlockComment(e,n,r,s){let o=n.startLineNumber,a=n.endLineNumber;const l=s.length+Math.max(e.getLineFirstNonWhitespaceColumn(n.startLineNumber),n.startColumn);let c=e.getLineContent(o).lastIndexOf(r,l-1),u=e.getLineContent(a).indexOf(s,n.endColumn-1-r.length);return c!==-1&&u===-1&&(u=e.getLineContent(o).indexOf(s,c+r.length),a=o),c===-1&&u!==-1&&(c=e.getLineContent(a).lastIndexOf(r,u),o=a),n.isEmpty()&&(c===-1||u===-1)&&(c=e.getLineContent(o).indexOf(r),c!==-1&&(u=e.getLineContent(o).indexOf(s,c+r.length))),c!==-1&&e.getLineContent(o).charCodeAt(c+r.length)===32&&(r+=" "),u!==-1&&e.getLineContent(a).charCodeAt(u-1)===32&&(s=" "+s,u-=1),c!==-1&&u!==-1?Ly._createRemoveBlockCommentOperations(new J(o,c+r.length+1,a,u+1),r,s):null}_executeBlockComment(e,n,r){e.tokenization.tokenizeIfCheap(r.startLineNumber);const s=e.getLanguageIdAtPosition(r.startLineNumber,1),o=this.languageConfigurationService.getLanguageConfiguration(s).comments;if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const a=o.blockCommentStartToken,l=o.blockCommentEndToken;let c=this._attemptRemoveBlockComment(e,r,a,l);if(!c){if(r.isEmpty()){const u=e.getLineContent(r.startLineNumber);let d=ml(u);d===-1&&(d=u.length),c=Ly._createAddBlockCommentOperations(new J(r.startLineNumber,d+1,r.startLineNumber,u.length+1),a,l,this._insertSpace)}else c=Ly._createAddBlockCommentOperations(new J(r.startLineNumber,e.getLineFirstNonWhitespaceColumn(r.startLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),a,l,this._insertSpace);c.length===1&&(this._deltaColumn=a.length+1)}this._selectionId=n.trackSelection(r);for(const u of c)n.addEditOperation(u.range,u.text)}getEditOperations(e,n){let r=this._selection;if(this._moveEndPositionDown=!1,r.startLineNumber===r.endLineNumber&&this._ignoreFirstLine){n.addEditOperation(new J(r.startLineNumber,e.getLineMaxColumn(r.startLineNumber),r.startLineNumber+1,1),r.startLineNumber===e.getLineCount()?"":`
`),this._selectionId=n.trackSelection(r);return}r.startLineNumber<r.endLineNumber&&r.endColumn===1&&(this._moveEndPositionDown=!0,r=r.setEndPosition(r.endLineNumber-1,e.getLineMaxColumn(r.endLineNumber-1)));const s=D0._gatherPreflightData(this._type,this._insertSpace,e,r.startLineNumber,r.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return s.supported?this._executeLineComments(e,n,s,r):this._executeBlockComment(e,n,r)}computeCursorState(e,n){let r=n.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(r=r.setEndPosition(r.endLineNumber+1,1)),new Ft(r.selectionStartLineNumber,r.selectionStartColumn+this._deltaColumn,r.positionLineNumber,r.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,n){const r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s];a.ignore||r.push(Vr.delete(new J(n+s,a.commentStrOffset+1,n+s,a.commentStrOffset+a.commentStrLength+1)))}return r}_createAddLineCommentsOperations(e,n){const r=[],s=this._insertSpace?" ":"";for(let o=0,a=e.length;o<a;o++){const l=e[o];l.ignore||r.push(Vr.insert(new ve(n+o,l.commentStrOffset+1),l.commentStr+s))}return r}static nextVisibleColumn(e,n,r,s){return r?e+(n-e%n):e+s}static _normalizeInsertionPoint(e,n,r,s){let o=1073741824,a,l;for(let c=0,u=n.length;c<u;c++){if(n[c].ignore)continue;const d=e.getLineContent(r+c);let h=0;for(let f=0,p=n[c].commentStrOffset;h<o&&f<p;f++)h=D0.nextVisibleColumn(h,s,d.charCodeAt(f)===9,1);h<o&&(o=h)}o=Math.floor(o/s)*s;for(let c=0,u=n.length;c<u;c++){if(n[c].ignore)continue;const d=e.getLineContent(r+c);let h=0;for(a=0,l=n[c].commentStrOffset;h<o&&a<l;a++)h=D0.nextVisibleColumn(h,s,d.charCodeAt(a)===9,1);h>o?n[c].commentStrOffset=a-1:n[c].commentStrOffset=a}}}class ule extends kt{constructor(e,n){super(n),this._type=e}run(e,n){const r=e.get(dr);if(!n.hasModel())return;const s=n.getModel(),o=[],a=s.getOptions(),l=n.getOption(23),c=n.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));c.sort((d,h)=>J.compareRangesUsingStarts(d.selection,h.selection));let u=c[0];for(let d=1;d<c.length;d++){const h=c[d];u.selection.endLineNumber===h.selection.startLineNumber&&(u.index<h.index?h.ignoreFirstLine=!0:(u.ignoreFirstLine=!0,u=h))}for(const d of c)o.push(new D0(r,d.selection,a.tabSize,this._type,l.insertSpace,l.ignoreEmptyLines,d.ignoreFirstLine));n.pushUndoStop(),n.executeCommands(this.id,o),n.pushUndoStop()}}class p2t extends ule{constructor(){super(0,{id:"editor.action.commentLine",label:L("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:se.MenubarEditMenu,group:"5_insert",title:L({},"&&Toggle Line Comment"),order:1}})}}class g2t extends ule{constructor(){super(1,{id:"editor.action.addCommentLine",label:L("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2081),weight:100}})}}class m2t extends ule{constructor(){super(2,{id:"editor.action.removeCommentLine",label:L("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2099),weight:100}})}}class _2t extends kt{constructor(){super({id:"editor.action.blockComment",label:L("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:se.MenubarEditMenu,group:"5_insert",title:L({},"Toggle &&Block Comment"),order:2}})}run(e,n){const r=e.get(dr);if(!n.hasModel())return;const s=n.getOption(23),o=[],a=n.getSelections();for(const l of a)o.push(new Ly(l,s.insertSpace,r));n.pushUndoStop(),n.executeCommands(this.id,o),n.pushUndoStop()}}rt(p2t);rt(g2t);rt(m2t);rt(_2t);var v2t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},oC=function(i,e){return function(n,r){e(n,r,i)}},sne;let aI=sne=class{static get(e){return e.getContribution(sne.ID)}constructor(e,n,r,s,o,a,l,c){this._contextMenuService=n,this._contextViewService=r,this._contextKeyService=s,this._keybindingService=o,this._menuService=a,this._configurationService=l,this._workspaceContextService=c,this._toDispose=new Xe,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(u=>this._onContextMenu(u))),this._toDispose.add(this._editor.onMouseWheel(u=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=u.srcElement;h.shadowRoot&&dx(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(u=>{this._editor.getOption(24)&&u.keyCode===58&&(u.preventDefault(),u.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let r=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){r=!0;break}r||this._editor.setPosition(e.target.position)}let n=null;e.target.type!==1&&(n=e.event),this.showContextMenu(n)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const n=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?se.SimpleEditorContext:se.EditorContext);n.length>0&&this._doShowContextMenu(n,e)}_getMenuActions(e,n){const r=[],s=this._menuService.createMenu(n,this._contextKeyService),o=s.getActions({arg:e.uri});s.dispose();for(const a of o){const[,l]=a;let c=0;for(const u of l)if(u instanceof dP){const d=this._getMenuActions(e,u.item.submenu);d.length>0&&(r.push(new NE(u.id,u.label,d)),c++)}else r.push(u),c++;c&&r.push(new Vo)}return r.length&&r.pop(),r}_doShowContextMenu(e,n=null){if(!this._editor.hasModel())return;const r=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let s=n;if(!s){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const a=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),l=no(this._editor.getDomNode()),c=l.left+a.left,u=l.top+a.top+a.height;s={x:c,y:u}}const o=this._editor.getOption(126)&&!Kp;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>s,getActions:()=>e,getActionViewItem:a=>{const l=this._keybindingFor(a);if(l)return new ZE(a,a,{label:!0,keybinding:l.getLabel(),isMenu:!0});const c=a;return typeof c.getActionViewItem=="function"?c.getActionViewItem():new ZE(a,a,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:a=>this._keybindingFor(a),onHide:a=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:r})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||uvt(this._workspaceContextService.getWorkspace()))return;const n=this._editor.getOption(72);let r=0;const s=u=>({id:`menu-action-${++r}`,label:u.label,tooltip:"",class:void 0,enabled:typeof u.enabled>"u"?!0:u.enabled,checked:u.checked,run:u.run}),o=(u,d)=>new NE(`menu-action-${++r}`,u,d,void 0),a=(u,d,h,f,p)=>{if(!d)return s({label:u,enabled:d,run:()=>{}});const g=_=>()=>{this._configurationService.updateValue(h,_)},m=[];for(const _ of p)m.push(s({label:_.label,checked:f===_.value,run:g(_.value)}));return o(u,m)},l=[];l.push(s({label:L("context.minimap.minimap","Minimap"),checked:n.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!n.enabled)}})),l.push(new Vo),l.push(s({label:L("context.minimap.renderCharacters","Render Characters"),enabled:n.enabled,checked:n.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!n.renderCharacters)}})),l.push(a(L("context.minimap.size","Vertical size"),n.enabled,"editor.minimap.size",n.size,[{label:L("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:L("context.minimap.size.fill","Fill"),value:"fill"},{label:L("context.minimap.size.fit","Fit"),value:"fit"}])),l.push(a(L("context.minimap.slider","Slider"),n.enabled,"editor.minimap.showSlider",n.showSlider,[{label:L("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:L("context.minimap.slider.always","Always"),value:"always"}]));const c=this._editor.getOption(126)&&!Kp;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:c?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>l,onHide:u=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};aI.ID="editor.contrib.contextmenu";aI=sne=v2t([oC(1,Ff),oC(2,Vv),oC(3,mn),oC(4,sr),oC(5,c_),oC(6,ei),oC(7,px)],aI);class b2t extends kt{constructor(){super({id:"editor.action.showContextMenu",label:L("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:1092,weight:100}})}run(e,n){var r;(r=aI.get(n))===null||r===void 0||r.showContextMenu()}}_i(aI.ID,aI,2);rt(b2t);class yK{constructor(e){this.selections=e}equals(e){const n=this.selections.length,r=e.selections.length;if(n!==r)return!1;for(let s=0;s<n;s++)if(!this.selections[s].equalsSelection(e.selections[s]))return!1;return!0}}class wK{constructor(e,n,r){this.cursorState=e,this.scrollTop=n,this.scrollLeft=r}}class Dx extends Le{static get(e){return e.getContribution(Dx.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(n=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(n=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(n=>{if(this._isCursorUndoRedo||!n.oldSelections||n.oldModelVersionId!==n.modelVersionId)return;const r=new yK(n.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(r)||(this._undoStack.push(new wK(r,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new wK(new yK(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new wK(new yK(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}Dx.ID="editor.contrib.cursorUndoRedoController";class y2t extends kt{constructor(){super({id:"cursorUndo",label:L("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:2099,weight:100}})}run(e,n,r){var s;(s=Dx.get(n))===null||s===void 0||s.cursorUndo()}}class w2t extends kt{constructor(){super({id:"cursorRedo",label:L("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,n,r){var s;(s=Dx.get(n))===null||s===void 0||s.cursorRedo()}}_i(Dx.ID,Dx,0);rt(y2t);rt(w2t);class C2t{constructor(e,n,r){this.selection=e,this.targetPosition=n,this.copy=r,this.targetSelection=null}getEditOperations(e,n){const r=e.getValueInRange(this.selection);if(this.copy||n.addEditOperation(this.selection,null),n.addEditOperation(new J(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),r),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Ft(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new Ft(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber<this.selection.endLineNumber){this.targetSelection=new Ft(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new Ft(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column-this.selection.endColumn+this.selection.startColumn:this.targetPosition.column-this.selection.endColumn+this.selection.startColumn,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new Ft(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,n){return this.targetSelection}}function lD(i){return ri?i.altKey:i.ctrlKey}class yv extends Le{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(n))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(n))),this._register(this._editor.onMouseDrag(n=>this._onEditorMouseDrag(n))),this._register(this._editor.onMouseDrop(n=>this._onEditorMouseDrop(n))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(n=>this.onEditorKeyDown(n))),this._register(this._editor.onKeyUp(n=>this.onEditorKeyUp(n))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(lD(e)&&(this._modifierPressed=!0),this._mouseDown&&lD(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(lD(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===yv.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const n=e.target;if(this._dragSelection===null){const s=(this._editor.getSelections()||[]).filter(o=>n.position&&o.containsPosition(n.position));if(s.length===1)this._dragSelection=s[0];else return}lD(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),n.position&&(this._dragSelection.containsPosition(n.position)?this._removeDecoration():this.showAt(n.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const n=new ve(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let r=null;if(e.event.shiftKey){const s=this._editor.getSelection();if(s){const{selectionStartLineNumber:o,selectionStartColumn:a}=s;r=[new Ft(o,a,n.lineNumber,n.column)]}}else r=(this._editor.getSelections()||[]).map(s=>s.containsPosition(n)?new Ft(n.lineNumber,n.column,n.lineNumber,n.column):s);this._editor.setSelections(r||[],"mouse",3)}else(!this._dragSelection.containsPosition(n)||(lD(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(n)||this._dragSelection.getStartPosition().equals(n)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(yv.ID,new C2t(this._dragSelection,n,lD(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new J(e.lineNumber,e.column,e.lineNumber,e.column),options:yv._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}yv.ID="editor.contrib.dragAndDrop";yv.TRIGGER_KEY_VALUE=ri?6:5;yv._DECORATION_OPTIONS=kn.register({description:"dnd-target",className:"dnd-target"});_i(yv.ID,yv,2);const Iz=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(r){for(let s=0;s<r.length;s++)r[s]=Math.floor(Math.random()*256);return r};const e=new Uint8Array(16),n=[];for(let r=0;r<256;r++)n.push(r.toString(16).padStart(2,"0"));return function(){i(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let s=0,o="";return o+=n[e[s++]],o+=n[e[s++]],o+=n[e[s++]],o+=n[e[s++]],o+="-",o+=n[e[s++]],o+=n[e[s++]],o+="-",o+=n[e[s++]],o+=n[e[s++]],o+="-",o+=n[e[s++]],o+=n[e[s++]],o+="-",o+=n[e[s++]],o+=n[e[s++]],o+=n[e[s++]],o+=n[e[s++]],o+=n[e[s++]],o+=n[e[s++]],o}}();var ZNe=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function dle(i){return{asString:()=>ZNe(this,void 0,void 0,function*(){return i}),asFile:()=>{},value:typeof i=="string"?i:void 0}}function S2t(i,e,n){const r={id:Iz(),name:i,uri:e,data:n};return{asString:()=>ZNe(this,void 0,void 0,function*(){return""}),asFile:()=>r,value:void 0}}class QNe{constructor(){this._entries=new Map}get size(){let e=0;for(const n of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const n=[...this._entries.keys()];return Vn.some(this,([r,s])=>s.asFile())&&n.push("files"),eMe(dj(e),n)}get(e){var n;return(n=this._entries.get(this.toKey(e)))===null||n===void 0?void 0:n[0]}append(e,n){const r=this._entries.get(e);r?r.push(n):this._entries.set(this.toKey(e),[n])}replace(e,n){this._entries.set(this.toKey(e),[n])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,n]of this._entries)for(const r of n)yield[e,r]}toKey(e){return dj(e)}}function dj(i){return i.toLowerCase()}function JNe(i,e){return eMe(dj(i),e.map(dj))}function eMe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const n=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!n)return!1;const[r,s,o]=n;return o==="*"?e.some(a=>a.startsWith(s+"/")):!1}const Tz=Object.freeze({create:i=>l1(i.map(e=>e.toString())).join(`\r
`),split:i=>i.split(`\r
`),parse:i=>Tz.split(i).filter(e=>!e.startsWith("#"))}),I0e={EDITORS:"CodeEditors",FILES:"CodeFiles"};class x2t{}const k2t={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Kr.add(k2t.DragAndDropContribution,new x2t);class dO{constructor(){}static getInstance(){return dO.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}dO.INSTANCE=new dO;var L2t=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function tMe(i){const e=new QNe;for(const n of i.items){const r=n.type;if(n.kind==="string"){const s=new Promise(o=>n.getAsString(o));e.append(r,dle(s))}else if(n.kind==="file"){const s=n.getAsFile();s&&e.append(r,D2t(s))}}return e}function D2t(i){const e=i.path?Jt.parse(i.path):void 0;return S2t(i.name,e,()=>L2t(this,void 0,void 0,function*(){return new Uint8Array(yield i.arrayBuffer())}))}const E2t=Object.freeze([I0e.EDITORS,I0e.FILES,VP.RESOURCES,VP.INTERNAL_URI_LIST]);function nMe(i,e=!1){const n=tMe(i),r=n.get(VP.INTERNAL_URI_LIST);if(r)n.replace(bs.uriList,r);else if(e||!n.has(bs.uriList)){const s=[];for(const o of i.items){const a=o.getAsFile();if(a){const l=a.path;try{l?s.push(Jt.file(l).toString()):s.push(Jt.parse(a.name,!0).toString())}catch{}}}s.length&&n.replace(bs.uriList,dle(Tz.create(s)))}for(const s of E2t)n.delete(s);return n}function I2t(i,e,n){var r,s;return{edits:[...e.map(o=>new mv(i,typeof n.insertText=="string"?{range:o,text:n.insertText,insertAsSnippet:!1}:{range:o,text:n.insertText.snippet,insertAsSnippet:!0})),...(s=(r=n.additionalEdit)===null||r===void 0?void 0:r.edits)!==null&&s!==void 0?s:[]]}}function iMe(i){var e;function n(l,c){return"providerId"in l&&l.providerId===c.providerId||"mimeType"in l&&l.mimeType===c.handledMimeType}const r=new Map;for(const l of i)for(const c of(e=l.yieldTo)!==null&&e!==void 0?e:[])for(const u of i)if(u!==l&&n(c,u)){let d=r.get(l);d||(d=[],r.set(l,d)),d.push(u)}if(!r.size)return Array.from(i);const s=new Set,o=[];function a(l){if(!l.length)return[];const c=l[0];if(o.includes(c))return console.warn(`Yield to cycle detected for ${c.providerId}`),l;if(s.has(c))return a(l.slice(1));let u=[];const d=r.get(c);return d&&(o.push(c),u=a(d),o.pop()),s.add(c),[...u,c,...a(l.slice(1))]}return a(Array.from(i))}var T2t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},R2t=function(i,e){return function(n,r){e(n,r,i)}},A2t=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const N2t=kn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:eEe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class Rz extends Le{constructor(e,n,r,s,o){super(),this.typeId=e,this.editor=n,this.range=r,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=tt(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const n=tt("span.icon");this.domNode.append(n),n.classList.add(...en.asClassNameArray(lt.loading),"codicon-modifier-spin");const r=()=>{const s=this.editor.getOption(66);this.domNode.style.height=`${s}px`,this.domNode.style.width=`${Math.ceil(.8*s)}px`};r(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(52)||s.hasChanged(66))&&r()})),this._register(Be(this.domNode,ht.CLICK,s=>{this.delegate.cancel()}))}getId(){return Rz.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}Rz.baseId="editor.widget.inlineProgressWidget";let hj=class extends Le{constructor(e,n,r){super(),this.id=e,this._editor=n,this._instantiationService=r,this._showDelay=500,this._showPromise=this._register(new ha),this._currentWidget=new ha,this._operationIdPool=0,this._currentDecorations=n.createDecorationsCollection()}showWhile(e,n,r){return A2t(this,void 0,void 0,function*(){const s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=g1(()=>{const o=J.fromPositions(e);this._currentDecorations.set([{range:o,options:N2t}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Rz,this.id,this._editor,o,n,r))},this._showDelay);try{return yield r}finally{this._currentOperation===s&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};hj=T2t([R2t(2,hn)],hj);var rMe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},CM=function(i,e){return function(n,r){e(n,r,i)}},T0e=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},one;let fj=one=class extends Le{constructor(e,n,r,s,o,a,l,c,u,d){super(),this.typeId=e,this.editor=n,this.showCommand=s,this.range=o,this.edits=a,this.onSelectNewEdit=l,this._contextMenuService=c,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=r.bindTo(u),this.visibleContext.set(!0),this._register(gn(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(gn(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{o.containsPosition(h.position)||this.dispose()})),this._register(_t.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const n=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(n?` (${n})`:"")}create(){this.domNode=tt(".post-edit-widget"),this.button=this._register(new Vee(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(Be(this.domNode,ht.CLICK,()=>this.showSelector()))}getId(){return one.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=no(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,n)=>B2({id:"",label:e.label,checked:n===this.edits.activeEditIndex,run:()=>{if(n!==this.edits.activeEditIndex)return this.onSelectNewEdit(n)}}))})}};fj.baseId="editor.widget.postEditWidget";fj=one=rMe([CM(7,Ff),CM(8,mn),CM(9,sr)],fj);let pj=class extends Le{constructor(e,n,r,s,o,a){super(),this._id=e,this._editor=n,this._visibleContext=r,this._showCommand=s,this._instantiationService=o,this._bulkEditService=a,this._currentWidget=this._register(new ha),this._register(_t.any(n.onDidChangeModel,n.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,n,r,s){var o,a;return T0e(this,void 0,void 0,function*(){const l=this._editor.getModel();if(!l||!e.length)return;const c=n.allEdits[n.activeEditIndex];if(!c)return;let u=[];(typeof c.insertText=="string"?c.insertText==="":c.insertText.snippet==="")?u=[]:u=e.map(_=>new mv(l.uri,typeof c.insertText=="string"?{range:_,text:c.insertText,insertAsSnippet:!1}:{range:_,text:c.insertText.snippet,insertAsSnippet:!0}));const h={edits:[...u,...(a=(o=c.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&a!==void 0?a:[]]},f=e[0],p=l.deltaDecorations([],[{range:f,options:{description:"paste-line-suffix",stickiness:0}}]);let g,m;try{g=yield this._bulkEditService.apply(h,{editor:this._editor,token:s}),m=l.getDecorationRange(p[0])}finally{l.deltaDecorations(p,[])}r&&g.isApplied&&n.allEdits.length>1&&this.show(m??f,n,_=>T0e(this,void 0,void 0,function*(){const b=this._editor.getModel();b&&(yield b.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:_,allEdits:n.allEdits},r,s))}))})}show(e,n,r){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(fj,this._id,this._editor,this._visibleContext,this._showCommand,e,n,r))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};pj=rMe([CM(4,hn),CM(5,$5)],pj);var M2t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cD=function(i,e){return function(n,r){e(n,r,i)}},i0=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},ane;const sMe="editor.changePasteType",oMe=new yt("pasteWidgetVisible",!1,L("pasteWidgetVisible","Whether the paste widget is showing")),CK="application/vnd.code.copyMetadata";let Ex=ane=class extends Le{static get(e){return e.getContribution(ane.ID)}constructor(e,n,r,s,o,a,l){super(),this._bulkEditService=r,this._clipboardService=s,this._languageFeaturesService=o,this._quickInputService=a,this._progressService=l,this._editor=e;const c=e.getContainerDomNode();this._register(Be(c,"copy",u=>this.handleCopy(u))),this._register(Be(c,"cut",u=>this.handleCopy(u))),this._register(Be(c,"paste",u=>this.handlePaste(u),!0)),this._pasteProgressManager=this._register(new hj("pasteIntoEditor",e,n)),this._postPasteWidgetManager=this._register(n.createInstance(pj,"pasteIntoEditor",e,oMe,{id:sMe,label:L("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},u$().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var n,r;if(!this._editor.hasTextFocus()||(H1&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const s=this._editor.getModel(),o=this._editor.getSelections();if(!s||!(o!=null&&o.length))return;const a=this._editor.getOption(37);let l=o;const c=o.length===1&&o[0].isEmpty();if(c){if(!a)return;l=[new J(l[0].startLineNumber,1,l[0].startLineNumber,1+s.getLineLength(l[0].startLineNumber))]}const u=(n=this._editor._getViewModel())===null||n===void 0?void 0:n.getPlainTextToCopy(o,a,Aa),h={multicursorText:Array.isArray(u)?u:null,pasteOnNewLine:c,mode:null},f=this._languageFeaturesService.documentPasteEditProvider.ordered(s).filter(b=>!!b.prepareDocumentPaste);if(!f.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:h});return}const p=tMe(e.clipboardData),g=f.flatMap(b=>{var y;return(y=b.copyMimeTypes)!==null&&y!==void 0?y:[]}),m=Iz();this.setCopyMetadata(e.clipboardData,{id:m,providerCopyMimeTypes:g,defaultPastePayload:h});const _=go(b=>i0(this,void 0,void 0,function*(){const y=Hm(yield Promise.all(f.map(x=>i0(this,void 0,void 0,function*(){try{return yield x.prepareDocumentPaste(s,l,p,b)}catch(k){console.error(k);return}}))));y.reverse();for(const x of y)for(const[k,D]of x)p.replace(k,D);return p}));(r=this._currentCopyOperation)===null||r===void 0||r.dataTransferPromise.cancel(),this._currentCopyOperation={handle:m,dataTransferPromise:_}}handlePaste(e){var n,r;return i0(this,void 0,void 0,function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;(n=this._currentPasteOperation)===null||n===void 0||n.cancel(),this._currentPasteOperation=void 0;const s=this._editor.getModel(),o=this._editor.getSelections();if(!(o!=null&&o.length)||!s||!this.isPasteAsEnabled())return;const a=this.fetchCopyMetadata(e),l=nMe(e.clipboardData);l.delete(CK);const c=[...e.clipboardData.types,...(r=a==null?void 0:a.providerCopyMimeTypes)!==null&&r!==void 0?r:[],bs.uriList],u=this._languageFeaturesService.documentPasteEditProvider.ordered(s).filter(d=>{var h;return(h=d.pasteMimeTypes)===null||h===void 0?void 0:h.some(f=>JNe(f,c))});u.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,u,o,l,a):this.doPasteInline(u,o,l,a))})}doPasteInline(e,n,r,s){const o=go(a=>i0(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new x1(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(r,s,u.token),u.token.isCancellationRequested)return;const d=e.filter(f=>R0e(f,r));if(!d.length||d.length===1&&d[0].id==="text"){yield this.applyDefaultPasteHandler(r,s,u.token);return}const h=yield this.getPasteEdits(d,r,c,n,u.token);if(u.token.isCancellationRequested)return;if(h.length===1&&h[0].providerId==="text"){yield this.applyDefaultPasteHandler(r,s,u.token);return}if(h.length){const f=l.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(n,{activeEditIndex:0,allEdits:h},f,u.token)}yield this.applyDefaultPasteHandler(r,s,u.token)}finally{u.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(n[0].getEndPosition(),L("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),o),this._currentPasteOperation=o}showPasteAsPick(e,n,r,s,o){const a=go(l=>i0(this,void 0,void 0,function*(){const c=this._editor;if(!c.hasModel())return;const u=c.getModel(),d=new x1(c,3,void 0,l);try{if(yield this.mergeInDataFromCopy(s,o,d.token),d.token.isCancellationRequested)return;let h=n.filter(m=>R0e(m,s));e&&(h=h.filter(m=>m.id===e));const f=yield this.getPasteEdits(h,s,u,r,d.token);if(d.token.isCancellationRequested||!f.length)return;let p;if(e)p=f.at(0);else{const m=yield this._quickInputService.pick(f.map(_=>({label:_.label,description:_.providerId,detail:_.detail,edit:_})),{placeHolder:L("pasteAsPickerPlaceholder","Select Paste Action")});p=m==null?void 0:m.edit}if(!p)return;const g=I2t(u.uri,r,p);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:L("pasteAsProgress","Running paste handlers")},()=>a)}setCopyMetadata(e,n){e.setData(CK,JSON.stringify(n))}fetchCopyMetadata(e){var n;if(!e.clipboardData)return;const r=e.clipboardData.getData(CK);if(r)try{return JSON.parse(r)}catch{return}const[s,o]=AJ.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(n=o.multicursorText)!==null&&n!==void 0?n:null,pasteOnNewLine:!!o.isFromEmptySelection}}}mergeInDataFromCopy(e,n,r){var s;return i0(this,void 0,void 0,function*(){if(n!=null&&n.id&&((s=this._currentCopyOperation)===null||s===void 0?void 0:s.handle)===n.id){const o=yield this._currentCopyOperation.dataTransferPromise;if(r.isCancellationRequested)return;for(const[a,l]of o)e.replace(a,l)}if(!e.has(bs.uriList)){const o=yield this._clipboardService.readResources();if(r.isCancellationRequested)return;o.length&&e.append(bs.uriList,dle(Tz.create(o)))}})}getPasteEdits(e,n,r,s,o){return i0(this,void 0,void 0,function*(){const a=yield h$(Promise.all(e.map(c=>i0(this,void 0,void 0,function*(){var u;try{const d=yield(u=c.provideDocumentPasteEdits)===null||u===void 0?void 0:u.call(c,r,s,n,o);if(d)return Object.assign(Object.assign({},d),{providerId:c.id})}catch(d){console.error(d)}}))),o),l=Hm(a??[]);return iMe(l)})}applyDefaultPasteHandler(e,n,r){var s,o,a;return i0(this,void 0,void 0,function*(){const l=(s=e.get(bs.text))!==null&&s!==void 0?s:e.get("text");if(!l)return;const c=yield l.asString();if(r.isCancellationRequested)return;const u={text:c,pasteOnNewLine:(o=n==null?void 0:n.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(a=n==null?void 0:n.defaultPastePayload.multicursorText)!==null&&a!==void 0?a:null,mode:null};this._editor.trigger("keyboard","paste",u)})}};Ex.ID="editor.contrib.copyPasteActionController";Ex=ane=M2t([cD(1,hn),cD(2,$5),cD(3,qv),cD(4,Et),cD(5,lg),cD(6,NTe)],Ex);function R0e(i,e){var n;return!!(!((n=i.pasteMimeTypes)===null||n===void 0)&&n.some(r=>e.matches(r)))}var hle=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},hO=function(i,e){return function(n,r){e(n,r,i)}},lI=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const fle=L("builtIn","Built-in");class ple{provideDocumentPasteEdits(e,n,r,s){return lI(this,void 0,void 0,function*(){const o=yield this.getEdit(r,s);return o?{insertText:o.insertText,label:o.label,detail:o.detail,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}provideDocumentOnDropEdits(e,n,r,s){return lI(this,void 0,void 0,function*(){const o=yield this.getEdit(r,s);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}}class aMe extends ple{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[bs.text],this.pasteMimeTypes=[bs.text]}getEdit(e,n){return lI(this,void 0,void 0,function*(){const r=e.get(bs.text);if(!r||e.has(bs.uriList))return;const s=yield r.asString();return{handledMimeType:bs.text,label:L("text.label","Insert Plain Text"),detail:fle,insertText:s}})}}class lMe extends ple{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[bs.uriList],this.pasteMimeTypes=[bs.uriList]}getEdit(e,n){return lI(this,void 0,void 0,function*(){const r=yield cMe(e);if(!r.length||n.isCancellationRequested)return;let s=0;const o=r.map(({uri:l,originalText:c})=>l.scheme===Pn.file?l.fsPath:(s++,c)).join(" ");let a;return s>0?a=r.length>1?L("defaultDropProvider.uriList.uris","Insert Uris"):L("defaultDropProvider.uriList.uri","Insert Uri"):a=r.length>1?L("defaultDropProvider.uriList.paths","Insert Paths"):L("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:bs.uriList,insertText:o,label:a,detail:fle}})}}let gj=class extends ple{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[bs.uriList],this.pasteMimeTypes=[bs.uriList]}getEdit(e,n){return lI(this,void 0,void 0,function*(){const r=yield cMe(e);if(!r.length||n.isCancellationRequested)return;const s=Hm(r.map(({uri:o})=>{const a=this._workspaceContextService.getWorkspaceFolder(o);return a?Jgt(a.uri,o):void 0}));if(s.length)return{handledMimeType:bs.uriList,insertText:s.join(" "),label:r.length>1?L("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):L("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:fle}})}};gj=hle([hO(0,px)],gj);function cMe(i){return lI(this,void 0,void 0,function*(){const e=i.get(bs.uriList);if(!e)return[];const n=yield e.asString(),r=[];for(const s of Tz.parse(n))try{r.push({uri:Jt.parse(s),originalText:s})}catch{}return r})}let lne=class extends Le{constructor(e,n){super(),this._register(e.documentOnDropEditProvider.register("*",new aMe)),this._register(e.documentOnDropEditProvider.register("*",new lMe)),this._register(e.documentOnDropEditProvider.register("*",new gj(n)))}};lne=hle([hO(0,Et),hO(1,px)],lne);let cne=class extends Le{constructor(e,n){super(),this._register(e.documentPasteEditProvider.register("*",new aMe)),this._register(e.documentPasteEditProvider.register("*",new lMe)),this._register(e.documentPasteEditProvider.register("*",new gj(n)))}};cne=hle([hO(0,Et),hO(1,px)],cne);_i(Ex.ID,Ex,0);sz(cne);ct(new class extends Ho{constructor(){super({id:sMe,precondition:oMe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,n){var r;return(r=Ex.get(e))===null||r===void 0?void 0:r.changePasteType()}});rt(class extends kt{constructor(){super({id:"editor.action.pasteAs",label:L("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:L("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,n){var r;const s=typeof(n==null?void 0:n.id)=="string"?n.id:void 0;return(r=Ex.get(e))===null||r===void 0?void 0:r.pasteAs(s)}});class P2t{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const n=this._dragOperations.get(e);return this._dragOperations.delete(e),n}}}class A0e{constructor(e){this.identifier=e}}const uMe=qn("treeViewsDndService");oi(uMe,P2t,1);var O2t=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},P6=function(i,e){return function(n,r){e(n,r,i)}},lA=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},une;const dMe="editor.experimental.dropIntoEditor.defaultProvider",hMe="editor.changeDropType",fMe=new yt("dropWidgetVisible",!1,L("dropWidgetVisible","Whether the drop widget is showing"));let cI=une=class extends Le{static get(e){return e.getContribution(une.ID)}constructor(e,n,r,s,o){super(),this._configService=r,this._languageFeaturesService=s,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=dO.getInstance(),this._dropProgressManager=this._register(n.createInstance(hj,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(n.createInstance(pj,"dropIntoEditor",e,fMe,{id:hMe,label:L("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(a=>this.onDropIntoEditor(e,a.position,a.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,n,r){var s;return lA(this,void 0,void 0,function*(){if(!r.dataTransfer||!e.hasModel())return;(s=this._currentOperation)===null||s===void 0||s.cancel(),e.focus(),e.setPosition(n);const o=go(a=>lA(this,void 0,void 0,function*(){const l=new x1(e,1,void 0,a);try{const c=yield this.extractDataTransferData(r);if(c.size===0||l.token.isCancellationRequested)return;const u=e.getModel();if(!u)return;const d=this._languageFeaturesService.documentOnDropEditProvider.ordered(u).filter(f=>f.dropMimeTypes?f.dropMimeTypes.some(p=>c.matches(p)):!0),h=yield this.getDropEdits(d,u,n,c,l);if(l.token.isCancellationRequested)return;if(h.length){const f=this.getInitialActiveEditIndex(u,h),p=e.getOption(36).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([J.fromPositions(n)],{activeEditIndex:f,allEdits:h},p,a)}}finally{l.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(n,L("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o})}getDropEdits(e,n,r,s,o){return lA(this,void 0,void 0,function*(){const a=yield h$(Promise.all(e.map(c=>lA(this,void 0,void 0,function*(){try{const u=yield c.provideDocumentOnDropEdits(n,r,s,o.token);if(u)return Object.assign(Object.assign({},u),{providerId:c.id})}catch(u){console.error(u)}}))),o.token),l=Hm(a??[]);return iMe(l)})}getInitialActiveEditIndex(e,n){const r=this._configService.getValue(dMe,{resource:e.uri});for(const[s,o]of Object.entries(r)){const a=n.findIndex(l=>o===l.providerId&&l.handledMimeType&&JNe(s,[l.handledMimeType]));if(a>=0)return a}return 0}extractDataTransferData(e){return lA(this,void 0,void 0,function*(){if(!e.dataTransfer)return new QNe;const n=nMe(e.dataTransfer);if(this.treeItemsTransfer.hasData(A0e.prototype)){const r=this.treeItemsTransfer.getData(A0e.prototype);if(Array.isArray(r))for(const s of r){const o=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(s.identifier);if(o)for(const[a,l]of o)n.replace(a,l)}}return n})}};cI.ID="editor.contrib.dropIntoEditorController";cI=une=O2t([P6(1,hn),P6(2,ei),P6(3,Et),P6(4,uMe)],cI);_i(cI.ID,cI,2);ct(new class extends Ho{constructor(){super({id:hMe,precondition:fMe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,n){var r;(r=cI.get(e))===null||r===void 0||r.changeDropType()}});sz(lne);Kr.as(ag.Configuration).registerConfiguration(Object.assign(Object.assign({},j$),{properties:{[dMe]:{type:"object",scope:5,description:L("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class ul{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(n=>this._editor.getModel().getDecorationRange(n)).filter(n=>!!n);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const n=this._decorations.indexOf(e);return n>=0?n+1:1}getDecorationRangeAt(e){const n=e<this._decorations.length?this._decorations[e]:null;return n?this._editor.getModel().getDecorationRange(n):null}getCurrentMatchesPosition(e){const n=this._editor.getModel().getDecorationsInRange(e);for(const r of n){const s=r.options;if(s===ul._FIND_MATCH_DECORATION||s===ul._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(r.id)}return 0}setCurrentFindMatch(e){let n=null,r=0;if(e)for(let s=0,o=this._decorations.length;s<o;s++){const a=this._editor.getModel().getDecorationRange(this._decorations[s]);if(e.equalsRange(a)){n=this._decorations[s],r=s+1;break}}return(this._highlightedDecorationId!==null||n!==null)&&this._editor.changeDecorations(s=>{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,ul._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),n!==null&&(this._highlightedDecorationId=n,s.changeDecorationOptions(this._highlightedDecorationId,ul._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),n!==null){let o=this._editor.getModel().getDecorationRange(n);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const a=o.endLineNumber-1,l=this._editor.getModel().getLineMaxColumn(a);o=new J(o.startLineNumber,o.startColumn,a,l)}this._rangeHighlightDecorationId=s.addDecoration(o,ul._RANGE_HIGHLIGHT_DECORATION)}}),r}set(e,n){this._editor.changeDecorations(r=>{let s=ul._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=ul._FIND_MATCH_NO_OVERVIEW_DECORATION;const l=this._editor.getModel().getLineCount(),u=this._editor.getLayoutInfo().height/l,d=Math.max(2,Math.ceil(3/u));let h=e[0].range.startLineNumber,f=e[0].range.endLineNumber;for(let p=1,g=e.length;p<g;p++){const m=e[p].range;f+d>=m.startLineNumber?m.endLineNumber>f&&(f=m.endLineNumber):(o.push({range:new J(h,1,f,1),options:ul._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,f=m.endLineNumber)}o.push({range:new J(h,1,f,1),options:ul._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const a=new Array(e.length);for(let l=0,c=e.length;l<c;l++)a[l]={range:e[l].range,options:s};this._decorations=r.deltaDecorations(this._decorations,a),this._overviewRulerApproximateDecorations=r.deltaDecorations(this._overviewRulerApproximateDecorations,o),this._rangeHighlightDecorationId&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(l=>r.removeDecoration(l)),this._findScopeDecorationIds=[]),n!=null&&n.length&&(this._findScopeDecorationIds=n.map(l=>r.addDecoration(l,ul._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let n=this._decorations.length-1;n>=0;n--){const r=this._decorations[n],s=this._editor.getModel().getDecorationRange(r);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumber<e.lineNumber)return s;if(!(s.endColumn>e.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let n=0,r=this._decorations.length;n<r;n++){const s=this._decorations[n],o=this._editor.getModel().getDecorationRange(s);if(!(!o||o.startLineNumber<e.lineNumber)){if(o.startLineNumber>e.lineNumber)return o;if(!(o.startColumn<e.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}}ul._CURRENT_FIND_MATCH_DECORATION=kn.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:Qr(voe),position:hd.Center},minimap:{color:Qr(h2),position:ou.Inline}});ul._FIND_MATCH_DECORATION=kn.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:Qr(voe),position:hd.Center},minimap:{color:Qr(h2),position:ou.Inline}});ul._FIND_MATCH_NO_OVERVIEW_DECORATION=kn.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});ul._FIND_MATCH_ONLY_OVERVIEW_DECORATION=kn.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:Qr(voe),position:hd.Center}});ul._RANGE_HIGHLIGHT_DECORATION=kn.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});ul._FIND_SCOPE_DECORATION=kn.register({description:"find-scope",className:"findScope",isWholeLine:!0});class F2t{constructor(e,n,r){this._editorSelection=e,this._ranges=n,this._replaceStrings=r,this._trackedEditorSelectionId=null}getEditOperations(e,n){if(this._ranges.length>0){const r=[];for(let a=0;a<this._ranges.length;a++)r.push({range:this._ranges[a],text:this._replaceStrings[a]});r.sort((a,l)=>J.compareRangesUsingStarts(a.range,l.range));const s=[];let o=r[0];for(let a=1;a<r.length;a++)o.range.endLineNumber===r[a].range.startLineNumber&&o.range.endColumn===r[a].range.startColumn?(o.range=o.range.plusRange(r[a].range),o.text=o.text+r[a].text):(s.push(o),o=r[a]);s.push(o);for(const a of s)n.addEditOperation(a.range,a.text)}this._trackedEditorSelectionId=n.trackSelection(this._editorSelection)}computeCursorState(e,n){return n.getTrackedSelection(this._trackedEditorSelectionId)}}function pMe(i,e){if(i&&i[0]!==""){const n=N0e(i,e,"-"),r=N0e(i,e,"_");return n&&!r?M0e(i,e,"-"):!n&&r?M0e(i,e,"_"):i[0].toUpperCase()===i[0]?e.toUpperCase():i[0].toLowerCase()===i[0]?e.toLowerCase():Tot(i[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function N0e(i,e,n){return i[0].indexOf(n)!==-1&&e.indexOf(n)!==-1&&i[0].split(n).length===e.split(n).length}function M0e(i,e,n){const r=e.split(n),s=i[0].split(n);let o="";return r.forEach((a,l)=>{o+=pMe([s[l]],a)+n}),o.slice(0,-1)}class P0e{constructor(e){this.staticValue=e,this.kind=0}}class B2t{constructor(e){this.pieces=e,this.kind=1}}class uI{static fromStaticValue(e){return new uI([zS.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new P0e(""):e.length===1&&e[0].staticValue!==null?this._state=new P0e(e[0].staticValue):this._state=new B2t(e)}buildReplaceString(e,n){if(this._state.kind===0)return n?pMe(e,this._state.staticValue):this._state.staticValue;let r="";for(let s=0,o=this._state.pieces.length;s<o;s++){const a=this._state.pieces[s];if(a.staticValue!==null){r+=a.staticValue;continue}let l=uI._substitute(a.matchIndex,e);if(a.caseOps!==null&&a.caseOps.length>0){const c=[],u=a.caseOps.length;let d=0;for(let h=0,f=l.length;h<f;h++){if(d>=u){c.push(l.slice(h));break}switch(a.caseOps[d]){case"U":c.push(l[h].toUpperCase());break;case"u":c.push(l[h].toUpperCase()),d++;break;case"L":c.push(l[h].toLowerCase());break;case"l":c.push(l[h].toLowerCase()),d++;break;default:c.push(l[h])}}l=c.join("")}r+=l}return r}static _substitute(e,n){if(n===null)return"";if(e===0)return n[0];let r="";for(;e>0;){if(e<n.length)return(n[e]||"")+r;r=String(e%10)+r,e=Math.floor(e/10)}return"$"+r}}class zS{static staticValue(e){return new zS(e,-1,null)}static caseOps(e,n){return new zS(null,e,n)}constructor(e,n,r){this.staticValue=e,this.matchIndex=n,!r||r.length===0?this.caseOps=null:this.caseOps=r.slice(0)}}class j2t{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,n){this._emitStatic(e),this._lastCharIndex=n}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,n,r){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=zS.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=zS.caseOps(e,r),this._lastCharIndex=n}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=zS.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new uI(this._result)}}function W2t(i){if(!i||i.length===0)return new uI(null);const e=[],n=new j2t(i);for(let r=0,s=i.length;r<s;r++){const o=i.charCodeAt(r);if(o===92){if(r++,r>=s)break;const a=i.charCodeAt(r);switch(a){case 92:n.emitUnchanged(r-1),n.emitStatic("\\",r+1);break;case 110:n.emitUnchanged(r-1),n.emitStatic(`
`,r+1);break;case 116:n.emitUnchanged(r-1),n.emitStatic(" ",r+1);break;case 117:case 85:case 108:case 76:n.emitUnchanged(r-1),n.emitStatic("",r+1),e.push(String.fromCharCode(a));break}continue}if(o===36){if(r++,r>=s)break;const a=i.charCodeAt(r);if(a===36){n.emitUnchanged(r-1),n.emitStatic("$",r+1);continue}if(a===48||a===38){n.emitUnchanged(r-1),n.emitMatchIndex(0,r+1,e),e.length=0;continue}if(49<=a&&a<=57){let l=a-48;if(r+1<s){const c=i.charCodeAt(r+1);if(48<=c&&c<=57){r++,l=l*10+(c-48),n.emitUnchanged(r-2),n.emitMatchIndex(l,r+1,e),e.length=0;continue}}n.emitUnchanged(r-1),n.emitMatchIndex(l,r+1,e),e.length=0;continue}}}return n.finalize()}const Kv=new yt("findWidgetVisible",!1);Kv.toNegated();const Az=new yt("findInputFocussed",!1),gle=new yt("replaceInputFocussed",!1),O6={primary:545,mac:{primary:2593}},F6={primary:565,mac:{primary:2613}},B6={primary:560,mac:{primary:2608}},j6={primary:554,mac:{primary:2602}},W6={primary:558,mac:{primary:2606}},mr={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",GoToMatchFindAction:"editor.action.goToMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},Dy=19999,$2t=240;class SM{constructor(e,n){this._toDispose=new Xe,this._editor=e,this._state=n,this._isDisposed=!1,this._startSearchingTimer=new Mf,this._decorations=new ul(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new Ji(()=>this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(r=>{(r.reason===3||r.reason===5||r.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(r=>{this._ignoreModelContentChanged||(r.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(r=>this._onStateChanged(r))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Mi(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},$2t)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,n){return n||e.getFullModelRange()}research(e,n){let r=null;typeof n<"u"?n!==null&&(Array.isArray(n)?r=n:r=[n]):r=this._decorations.getFindScopes(),r!==null&&(r=r.map(l=>{if(l.startLineNumber!==l.endLineNumber){let c=l.endLineNumber;return l.endColumn===1&&(c=c-1),new J(l.startLineNumber,1,c,this._editor.getModel().getLineMaxColumn(c))}return l}));const s=this._findMatches(r,!1,Dy);this._decorations.set(s,r);const o=this._editor.getSelection();let a=this._decorations.getCurrentMatchesPosition(o);if(a===0&&s.length>0){const l=_P(s.map(c=>c.range),c=>J.compareRangesUsingStarts(c,o)>=0);a=l>0?l-1+1:a}this._state.changeMatchInfo(a,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const n=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(n,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const n=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:r,column:s}=e;const o=this._editor.getModel();return n||s===1?(r===1?r=o.getLineCount():r--,s=o.getLineMaxColumn(r)):s--,new ve(r,s)}_moveToPrevMatch(e,n=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()<Dy){let d=this._decorations.matchBeforePosition(e);d&&d.isEmpty()&&d.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),d=this._decorations.matchBeforePosition(e)),d&&this._setCurrentFindMatch(d);return}if(this._cannotFind())return;const r=this._decorations.getFindScope(),s=SM._getSearchRange(this._editor.getModel(),r);s.getEndPosition().isBefore(e)&&(e=s.getEndPosition()),e.isBefore(s.getStartPosition())&&(e=s.getEndPosition());const{lineNumber:o,column:a}=e,l=this._editor.getModel();let c=new ve(o,a),u=l.findPreviousMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,!1);if(u&&u.range.isEmpty()&&u.range.getStartPosition().equals(c)&&(c=this._prevSearchPosition(c),u=l.findPreviousMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,!1)),!!u){if(!n&&!s.containsRange(u.range))return this._moveToPrevMatch(u.range.getStartPosition(),!0);this._setCurrentFindMatch(u.range)}}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){const n=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:r,column:s}=e;const o=this._editor.getModel();return n||s===o.getLineMaxColumn(r)?(r===o.getLineCount()?r=1:r++,s=1):s++,new ve(r,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const r=this._decorations.matchBeforePosition(e);r&&this._setCurrentFindMatch(r);return}if(this._decorations.getCount()<Dy){let r=this._decorations.matchAfterPosition(e);r&&r.isEmpty()&&r.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),r=this._decorations.matchAfterPosition(e)),r&&this._setCurrentFindMatch(r);return}const n=this._getNextMatch(e,!1,!0);n&&this._setCurrentFindMatch(n.range)}_getNextMatch(e,n,r,s=!1){if(this._cannotFind())return null;const o=this._decorations.getFindScope(),a=SM._getSearchRange(this._editor.getModel(),o);a.getEndPosition().isBefore(e)&&(e=a.getStartPosition()),e.isBefore(a.getStartPosition())&&(e=a.getStartPosition());const{lineNumber:l,column:c}=e,u=this._editor.getModel();let d=new ve(l,c),h=u.findNextMatch(this._state.searchString,d,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,n);return r&&h&&h.range.isEmpty()&&h.range.getStartPosition().equals(d)&&(d=this._nextSearchPosition(d),h=u.findNextMatch(this._state.searchString,d,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,n)),h?!s&&!a.containsRange(h.range)?this._getNextMatch(h.range.getEndPosition(),n,r,!0):h:null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_moveToMatch(e){const n=this._decorations.getDecorationRangeAt(e);n&&this._setCurrentFindMatch(n)}moveToMatch(e){this._moveToMatch(e)}_getReplacePattern(){return this._state.isRegex?W2t(this._state.replaceString):uI.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),n=this._editor.getSelection(),r=this._getNextMatch(n.getStartPosition(),!0,!1);if(r)if(n.equalsRange(r.range)){const s=e.buildReplaceString(r.matches,this._state.preserveCase),o=new Sa(n,s);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new ve(n.startLineNumber,n.startColumn+s.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(r.range)}_findMatches(e,n,r){const s=(e||[null]).map(o=>SM._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,n,r)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Dy?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const n=new MC(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!n)return;let r=n.regex;if(!r.multiline){let h="mu";r.ignoreCase&&(h+="i"),r.global&&(h+="g"),r=new RegExp(r.source,h)}const s=this._editor.getModel(),o=s.getValue(1),a=s.getFullModelRange(),l=this._getReplacePattern();let c;const u=this._state.preserveCase;l.hasReplacementPatterns||u?c=o.replace(r,function(){return l.buildReplaceString(arguments,u)}):c=o.replace(r,l.buildReplaceString(null,u));const d=new Doe(a,c,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const n=this._getReplacePattern(),r=this._findMatches(e,n.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let a=0,l=r.length;a<l;a++)s[a]=n.buildReplaceString(r[a].matches,this._state.preserveCase);const o=new F2t(this._editor.getSelection(),r.map(a=>a.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let r=this._findMatches(e,!1,1073741824).map(o=>new Ft(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,a=r.length;o<a;o++)if(r[o].equalsRange(s)){r=[s].concat(r.slice(0,o)).concat(r.slice(o+1));break}this._editor.setSelections(r)}_executeEditorCommand(e,n){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,n),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}class Nz extends Pf{constructor(e,n,r){super(),this._hideSoon=this._register(new Ji(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=n,this._keybindingService=r,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:wt(goe),inputActiveOptionForeground:wt(moe),inputActiveOptionBackground:wt(mS)};this.caseSensitive=this._register(new uRe(Object.assign({appendTitle:this._keybindingLabelFor(mr.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},s))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new dRe(Object.assign({appendTitle:this._keybindingLabelFor(mr.ToggleWholeWordCommand),isChecked:this._state.wholeWord},s))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new hRe(Object.assign({appendTitle:this._keybindingLabelFor(mr.ToggleRegexCommand),isChecked:this._state.isRegex},s))),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let a=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(Be(this._domNode,ht.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(Be(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const n=this._keybindingService.lookupKeybinding(e);return n?` (${n.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Nz.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}Nz.ID="editor.contrib.findOptionsWidget";function $6(i,e){return i===1?!0:i===2?!1:e}class z2t extends Le{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return $6(this._isRegexOverride,this._isRegex)}get wholeWord(){return $6(this._wholeWordOverride,this._wholeWord)}get matchCase(){return $6(this._matchCaseOverride,this._matchCase)}get preserveCase(){return $6(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new _e),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,n,r){const s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;n===0&&(e=0),e>n&&(e=n),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,o=!0),this._matchesCount!==n&&(this._matchesCount=n,s.matchesCount=!0,o=!0),typeof r<"u"&&(J.equalsRange(this._currentMatch,r)||(this._currentMatch=r,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,n,r=!0){var s;const o={moveCursor:n,updateHistory:r,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let a=!1;const l=this.isRegex,c=this.wholeWord,u=this.matchCase,d=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,a=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,a=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,a=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,a=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((s=e.searchScope)===null||s===void 0)&&s.every(h=>{var f;return(f=this._searchScope)===null||f===void 0?void 0:f.some(p=>!J.equalsRange(p,h))})||(this._searchScope=e.searchScope,o.searchScope=!0,a=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,a=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,a=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,a=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,l!==this.isRegex&&(a=!0,o.isRegex=!0),c!==this.wholeWord&&(a=!0,o.wholeWord=!0),u!==this.matchCase&&(a=!0,o.matchCase=!0),d!==this.preserveCase&&(a=!0,o.preserveCase=!0),a&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=Dy}}const V2t=L("defaultLabel","input"),H2t=L("label.preserveCaseToggle","Preserve Case");class U2t extends qI{constructor(e){super({icon:lt.preserveCase,title:H2t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class q2t extends Pf{constructor(e,n,r,s){super(),this._showOptionButtons=r,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new _e),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new _e),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new _e),this._onInput=this._register(new _e),this._onKeyUp=this._register(new _e),this._onPreserveCaseKeyDown=this._register(new _e),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=n,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||V2t;const o=s.appendPreserveCaseLabel||"",a=s.history||[],l=!!s.flexibleHeight,c=!!s.flexibleWidth,u=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new fRe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:s.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u,inputBoxStyles:s.inputBoxStyles})),this.preserveCase=this._register(new U2t(Object.assign({appendTitle:o,isChecked:!1},s.toggleStyles))),this._register(this.preserveCase.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(f=>{this._onPreserveCaseKeyDown.fire(f)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(15)||f.equals(17)||f.equals(9)){const p=d.indexOf(document.activeElement);if(p>=0){let g=-1;f.equals(17)?g=(p+1)%d.length:f.equals(15)&&(p===0?g=d.length-1:g=p-1),f.equals(9)?(d[p].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),Nn.stop(f,!0)}}});const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,f=>this._onKeyDown.fire(f)),this.onkeyup(this.inputBox.inputElement,f=>this._onKeyUp.fire(f)),this.oninput(this.inputBox.inputElement,f=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,f=>this._onMouseDown.fire(f))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var gMe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mMe=function(i,e){return function(n,r){e(n,r,i)}};const mle=new yt("suggestWidgetVisible",!1,L("suggestWidgetVisible","Whether suggestion are visible")),_le="historyNavigationWidgetFocus",_Me="historyNavigationForwardsEnabled",vMe="historyNavigationBackwardsEnabled";let wv;const z6=[];function bMe(i,e){if(z6.includes(e))throw new Error("Cannot register the same widget multiple times");z6.push(e);const n=new Xe,r=new yt(_le,!1).bindTo(i),s=new yt(_Me,!0).bindTo(i),o=new yt(vMe,!0).bindTo(i),a=()=>{r.set(!0),wv=e},l=()=>{r.set(!1),wv===e&&(wv=void 0)};return e.element===document.activeElement&&a(),n.add(e.onDidFocus(()=>a())),n.add(e.onDidBlur(()=>l())),n.add(gn(()=>{z6.splice(z6.indexOf(e),1),l()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){n.dispose()}}}let dne=class extends pRe{constructor(e,n,r,s){super(e,n,r);const o=this._register(s.createScoped(this.inputBox.element));this._register(bMe(o,this.inputBox))}};dne=gMe([mMe(3,mn)],dne);let hne=class extends q2t{constructor(e,n,r,s,o=!1){super(e,n,o,r);const a=this._register(s.createScoped(this.inputBox.element));this._register(bMe(a,this.inputBox))}};hne=gMe([mMe(3,mn)],hne);Sc.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:ze.and(ze.has(_le),ze.equals(vMe,!0),ze.not("isComposing"),mle.isEqualTo(!1)),primary:16,secondary:[528],handler:i=>{wv==null||wv.showPreviousValue()}});Sc.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:ze.and(ze.has(_le),ze.equals(_Me,!0),ze.not("isComposing"),mle.isEqualTo(!1)),primary:18,secondary:[530],handler:i=>{wv==null||wv.showNextValue()}});function O0e(i){var e,n;return((e=i.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((n=i.lookupKeybinding("history.showNext"))===null||n===void 0?void 0:n.getElectronAccelerator())==="Down"}var K2t=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const G2t=ws("find-selection",lt.selection,L("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),F0e=ws("find-collapsed",lt.chevronRight,L("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),B0e=ws("find-expanded",lt.chevronDown,L("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),X2t=ws("find-replace",lt.replace,L("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),Y2t=ws("find-replace-all",lt.replaceAll,L("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),Z2t=ws("find-previous-match",lt.arrowUp,L("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),Q2t=ws("find-next-match",lt.arrowDown,L("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),J2t=L("label.findDialog","Find / Replace"),eEt=L("label.find","Find"),tEt=L("placeholder.find","Find"),nEt=L("label.previousMatchButton","Previous Match"),iEt=L("label.nextMatchButton","Next Match"),rEt=L("label.toggleSelectionFind","Find in Selection"),sEt=L("label.closeButton","Close"),oEt=L("label.replace","Replace"),aEt=L("placeholder.replace","Replace"),lEt=L("label.replaceButton","Replace"),cEt=L("label.replaceAllButton","Replace All"),uEt=L("label.toggleReplaceButton","Toggle Replace"),dEt=L("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Dy),hEt=L("label.matchesLocation","{0} of {1}"),j0e=L("label.noResults","No results"),Wg=419,fEt=275,pEt=fEt-54;let cA=69;const gEt=33,W0e="ctrlEnterReplaceAll.windows.donotask",$0e=ri?256:2048;class SK{constructor(e){this.afterLineNumber=e,this.heightInPx=gEt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function z0e(i,e,n){const r=!!e.match(/\n/);if(n&&r&&n.selectionStart>0){i.stopPropagation();return}}function V0e(i,e,n){const r=!!e.match(/\n/);if(n&&r&&n.selectionEnd<n.value.length){i.stopPropagation();return}}class Mz extends Pf{constructor(e,n,r,s,o,a,l,c,u){super(),this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=n,this._state=r,this._contextViewProvider=s,this._keybindingService=o,this._contextKeyService=a,this._storageService=c,this._notificationService=u,this._ctrlEnterReplaceAllWarningPrompted=!!c.getBoolean(W0e,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new Rf(500),this._register(gn(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(143)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(41)){const h=this._codeEditor.getOption(41).loop;this._state.change({loop:h},!1);const f=this._codeEditor.getOption(41).addExtraSpaceOnTop;f&&!this._viewZone&&(this._viewZone=new SK(0),this._showViewZone()),!f&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>K2t(this,void 0,void 0,function*(){if(this._isVisible){const d=yield this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}}))),this._findInputFocused=Az.bindTo(a),this._findFocusTracker=this._register(Gm(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=gle.bindTo(a),this._replaceFocusTracker=this._register(Gm(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new SK(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return Mz.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(90)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=dc(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const n=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",n),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,Ln)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=cA+"px",this._state.matchesCount>=Dy?this._matchesCount.title=dEt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let n=String(this._state.matchesCount);this._state.matchesCount>=Dy&&(n+="+");let r=String(this._state.matchesPosition);r==="0"&&(r="?"),e=ox(hEt,r,n)}else e=j0e;this._matchesCount.appendChild(document.createTextNode(e)),Ua(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),cA=Math.max(cA,this._matchesCount.clientWidth)}_getAriaLabel(e,n,r){if(e===j0e)return r===""?L("ariaSearchNoResultEmpty","{0} found",e):L("ariaSearchNoResult","{0} found for '{1}'",e,r);if(n){const s=L("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,r,n.startLineNumber+":"+n.startColumn),o=this._codeEditor.getModel();return o&&n.startLineNumber<=o.getLineCount()&&n.startLineNumber>=1?`${o.getLineContent(n.startLineNumber)}, ${s}`:s}return L("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,r)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),n=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,r=this._toggleSelectionFind.checked;this._isVisible&&(r||n)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,n=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&n&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&n&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const r=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&r)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const r=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=r;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let n=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const r=this._codeEditor.getDomNode();if(r){const s=no(r),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),a=s.left+(o?o.left:0),l=o?o.top:0;if(this._viewZone&&l<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(n=!1);const c=yEe(this._domNode).left;a>c&&(n=!1);const u=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(u?u.left:0)>c&&(n=!1)}}}this._showViewZone(n)}}_hide(e){this._revealTimeouts.forEach(n=>{clearTimeout(n)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const r=this._viewZone;this._viewZoneId!==void 0||!r||this._codeEditor.changeViewZones(s=>{r.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(r),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+r.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new SK(0));const r=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===r.heightInPx)return;const a=o-r.heightInPx;r.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+a);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(83).top,o<=0)return;r.heightInPx=o,this._viewZoneId=s.addZone(r),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!Zse(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const r=e.width,s=e.minimap.minimapWidth;let o=!1,a=!1,l=!1;if(this._resized&&dc(this._domNode)>Wg){this._domNode.style.maxWidth=`${r-28-s-15}px`,this._replaceInput.width=dc(this._findInput.domNode);return}if(Wg+28+s>=r&&(a=!0),Wg+28+s-cA>=r&&(l=!0),Wg+28+s-cA>=r+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",l),this._domNode.classList.toggle("reduced-find-widget",a),!l&&!o&&(this._domNode.style.maxWidth=`${r-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:l,reducedFindWidget:a}),this._resized){const c=this._findInput.inputBox.element.clientWidth;c>0&&(this._replaceInput.width=c)}else this._isReplaceVisible&&(this._replaceInput.width=dc(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(n=>{n.endColumn===1&&n.endLineNumber>n.startLineNumber&&(n=n.setEndPosition(n.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(n.endLineNumber-1)));const r=this._state.currentMatch;return n.startLineNumber!==n.endLineNumber&&!J.equalsRange(n,r)?n:null}).filter(n=>!!n),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals($0e|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(`
`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return z0e(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return V0e(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals($0e|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Aa&&Um&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(L("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(W0e,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(`
`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return z0e(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return V0e(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const n=this._keybindingService.lookupKeybinding(e);return n?` (${n.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new dne(null,this._contextViewProvider,{width:pEt,label:eEt,placeholder:tEt,appendCaseSensitiveLabel:this._keybindingLabelFor(mr.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(mr.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(mr.ToggleRegexCommand),validation:c=>{if(c.length===0||!this._findInput.getRegex())return null;try{return new RegExp(c,"gu"),null}catch(u){return{content:u.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>O0e(this._keybindingService),inputBoxStyles:T7,toggleStyles:I7},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(c=>this._onFindInputKeyDown(c))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(c=>{c.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),c.preventDefault())})),this._register(this._findInput.onRegexKeyDown(c=>{c.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),c.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(c=>{this._tryUpdateHeight()&&this._showViewZone()})),_l&&this._register(this._findInput.onMouseDown(c=>this._onFindInputMouseDown(c))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new uD({label:nEt+this._keybindingLabelFor(mr.PreviousMatchFindAction),icon:Z2t,onTrigger:()=>{fS(this._codeEditor.getAction(mr.PreviousMatchFindAction)).run().then(void 0,Ln)}})),this._nextBtn=this._register(new uD({label:iEt+this._keybindingLabelFor(mr.NextMatchFindAction),icon:Q2t,onTrigger:()=>{fS(this._codeEditor.getAction(mr.NextMatchFindAction)).run().then(void 0,Ln)}}));const r=document.createElement("div");r.className="find-part",r.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",r.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new qI({icon:G2t,title:rEt+this._keybindingLabelFor(mr.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:wt(mS),inputActiveOptionBorder:wt(goe),inputActiveOptionForeground:wt(moe)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const c=this._codeEditor.getSelections();c.map(u=>(u.endColumn===1&&u.endLineNumber>u.startLineNumber&&(u=u.setEndPosition(u.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(u.endLineNumber-1))),u.isEmpty()?null:u)).filter(u=>!!u),c.length&&this._state.change({searchScope:c},!0)}}else this._state.change({searchScope:null},!0)})),s.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new uD({label:sEt+this._keybindingLabelFor(mr.CloseFindWidgetCommand),icon:FRe,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:c=>{c.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),c.preventDefault())}})),this._replaceInput=this._register(new hne(null,void 0,{label:oEt,placeholder:aEt,appendPreserveCaseLabel:this._keybindingLabelFor(mr.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>O0e(this._keybindingService),inputBoxStyles:T7,toggleStyles:I7},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(c=>this._onReplaceInputKeyDown(c))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(c=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(c=>{c.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),c.preventDefault())})),this._replaceBtn=this._register(new uD({label:lEt+this._keybindingLabelFor(mr.ReplaceOneAction),icon:X2t,onTrigger:()=>{this._controller.replace()},onKeyDown:c=>{c.equals(1026)&&(this._closeBtn.focus(),c.preventDefault())}})),this._replaceAllBtn=this._register(new uD({label:cEt+this._keybindingLabelFor(mr.ReplaceAllAction),icon:Y2t,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const a=document.createElement("div");a.className="replace-actions",o.appendChild(a),a.appendChild(this._replaceBtn.domNode),a.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new uD({label:uEt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=dc(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=J2t,this._domNode.role="dialog",this._domNode.style.width=`${Wg}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(r),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new ja(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let l=Wg;this._register(this._resizeSash.onDidStart(()=>{l=dc(this._domNode)})),this._register(this._resizeSash.onDidChange(c=>{this._resized=!0;const u=l+c.startX-c.currentX;if(u<Wg)return;const d=parseFloat(c$(this._domNode).maxWidth)||0;u>d||(this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=dc(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const c=dc(this._domNode);if(c<Wg)return;let u=Wg;if(!this._resized||c===Wg){const d=this._codeEditor.getLayoutInfo();u=d.width-28-d.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=dc(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}Mz.ID="editor.contrib.findWidget";class uD extends Pf{constructor(e){super(),this._opts=e;let n="button";this._opts.className&&(n=n+" "+this._opts.className),this._opts.icon&&(n=n+" "+en.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=n,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,r=>{this._opts.onTrigger(),r.preventDefault()}),this.onkeydown(this._domNode,r=>{var s,o;if(r.equals(10)||r.equals(3)){this._opts.onTrigger(),r.preventDefault();return}(o=(s=this._opts).onKeyDown)===null||o===void 0||o.call(s,r)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...en.asClassNameArray(F0e)),this._domNode.classList.add(...en.asClassNameArray(B0e))):(this._domNode.classList.remove(...en.asClassNameArray(B0e)),this._domNode.classList.add(...en.asClassNameArray(F0e)))}}Of((i,e)=>{const n=(m,_)=>{_&&e.addRule(`.monaco-editor ${m} { background-color: ${_}; }`)};n(".findMatch",i.getColor(xm)),n(".currentFindMatch",i.getColor(Wdt)),n(".findScope",i.getColor($dt));const r=i.getColor(cs);n(".find-widget",r);const s=i.getColor(bm);s&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${s}; }`);const o=i.getColor(poe);o&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${o}; border-right: 1px solid ${o}; border-bottom: 1px solid ${o}; }`);const a=i.getColor(by);a&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Vp(i.type)?"dotted":"solid"} ${a}; box-sizing: border-box; }`);const l=i.getColor(zdt);l&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${l}; padding: 1px; box-sizing: border-box; }`);const c=i.getColor(Vdt);c&&e.addRule(`.monaco-editor .findScope { border: 1px ${Vp(i.type)?"dashed":"solid"} ${c}; }`);const u=i.getColor(Jn);u&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${u}; }`);const d=i.getColor(Cm);d&&e.addRule(`.monaco-editor .find-widget { color: ${d}; }`);const h=i.getColor(cdt);h&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${h}; }`);const f=i.getColor(Rdt);if(f)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${f}; }`);else{const m=i.getColor(Sm);m&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${m}; }`)}const p=i.getColor(TJ);p&&e.addRule(`
.monaco-editor .find-widget .button:not(.disabled):hover,
.monaco-editor .find-widget .codicon-find-selection:hover {
background-color: ${p} !important;
}
`);const g=i.getColor(Qu);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var yMe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},vp=function(i,e){return function(n,r){e(n,r,i)}},Ix=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},fne;const mEt=524288;function pne(i,e="single",n=!1){if(!i.hasModel())return null;const r=i.getSelection();if(e==="single"&&r.startLineNumber===r.endLineNumber||e==="multiple"){if(r.isEmpty()){const s=i.getConfiguredWordAtPosition(r.getStartPosition());if(s&&n===!1)return s.word}else if(i.getModel().getValueLengthInRange(r)<mEt)return i.getModel().getValueInRange(r)}return null}let Ul=fne=class extends Le{get editor(){return this._editor}static get(e){return e.getContribution(fne.ID)}constructor(e,n,r,s,o){super(),this._editor=e,this._findWidgetVisible=Kv.bindTo(n),this._contextKeyService=n,this._storageService=r,this._clipboardService=s,this._notificationService=o,this._updateHistoryDelayer=new Rf(500),this._state=this._register(new z2t),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(a=>this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!Az.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){const e=this._editor.getSelections();e.map(n=>(n.endColumn===1&&n.endLineNumber>n.startLineNumber&&(n=n.setEndPosition(n.endLineNumber-1,this._editor.getModel().getLineMaxColumn(n.endLineNumber-1))),n.isEmpty()?null:n)).filter(n=>!!n),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=dd(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,n){return Ix(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const r=Object.assign(Object.assign({},n),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const s=pne(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?r.searchString=dd(s):r.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=pne(this._editor,e.seedSearchStringFromSelection);s&&(r.searchString=s)}if(!r.searchString&&e.seedSearchStringFromGlobalClipboard){const s=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(r.searchString=s)}if(e.forceRevealReplace||r.isReplaceRevealed?r.isReplaceRevealed=!0:this._findWidgetVisible.get()||(r.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(r.searchScope=s)}r.loop=e.loop,this._state.change(r,!1),this._model||(this._model=new SM(this._editor,this._state))})}start(e,n){return this._start(e,n)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(L("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return Ix(this,void 0,void 0,function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};Ul.ID="editor.contrib.findController";Ul=fne=yMe([vp(1,mn),vp(2,jf),vp(3,qv),vp(4,Ps)],Ul);let gne=class extends Ul{constructor(e,n,r,s,o,a,l,c){super(e,r,l,c,a),this._contextViewService=n,this._keybindingService=s,this._themeService=o,this._widget=null,this._findOptionsWidget=null}_start(e,n){const r=Object.create(null,{_start:{get:()=>super._start}});return Ix(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const s=this._editor.getSelection();let o=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":{o=!!s&&s.startLineNumber!==s.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||o,yield r._start.call(this,e,n),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())})}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new Mz(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new Nz(this._editor,this._state,this._keybindingService))}};gne=yMe([vp(1,Vv),vp(2,mn),vp(3,sr),vp(4,Do),vp(5,Ps),vp(6,jf),vp(7,qv)],gne);const _Et=EEe(new DEe({id:mr.StartFindAction,label:L("startFindAction","Find"),alias:"Find",precondition:ze.or(oe.focus,ze.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:se.MenubarEditMenu,group:"3_find",title:L({},"&&Find"),order:1}}));_Et.addImplementation(0,(i,e,n)=>{const r=Ul.get(e);return r?r.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const vEt={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},regex:{type:"boolean"},regexOverride:{type:"number",description:L("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:L("actions.find.wholeWordOverride",`Overrides "Match Whole Word" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:L("actions.find.matchCaseOverride",`Overrides "Math Case" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:L("actions.find.preserveCaseOverride",`Overrides "Preserve Case" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},findInSelection:{type:"boolean"}}}}]};class bEt extends kt{constructor(){super({id:mr.StartFindWithArgs,label:L("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:vEt})}run(e,n,r){return Ix(this,void 0,void 0,function*(){const s=Ul.get(n);if(s){const o=r?{searchString:r.searchString,replaceString:r.replaceString,isReplaceRevealed:r.replaceString!==void 0,isRegex:r.isRegex,wholeWord:r.matchWholeWord,matchCase:r.isCaseSensitive,preserveCase:r.preserveCase}:{};yield s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&n.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:n.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(r==null?void 0:r.findInSelection)||!1,loop:n.getOption(41).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}})}}class yEt extends kt{constructor(){super({id:mr.StartFindWithSelection,label:L("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,n){return Ix(this,void 0,void 0,function*(){const r=Ul.get(n);r&&(yield r.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:n.getOption(41).loop}),r.setGlobalBufferTerm(r.getState().searchString))})}}class wMe extends kt{run(e,n){return Ix(this,void 0,void 0,function*(){const r=Ul.get(n);r&&!this._run(r)&&(yield r.start({forceRevealReplace:!1,seedSearchStringFromSelection:r.getState().searchString.length===0&&n.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:n.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:n.getOption(41).loop}),this._run(r))})}}class wEt extends wMe{constructor(){super({id:mr.NextMatchFindAction,label:L("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:oe.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:ze.and(oe.focus,Az),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class CEt extends wMe{constructor(){super({id:mr.PreviousMatchFindAction,label:L("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:oe.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:ze.and(oe.focus,Az),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class SEt extends kt{constructor(){super({id:mr.GoToMatchFindAction,label:L("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Kv}),this._highlightDecorations=[]}run(e,n,r){const s=Ul.get(n);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(Ps).notify({severity:F$.Warning,message:L("findMatchAction.noResults","No matches. Try searching for something else.")});return}const l=e.get(lg).createInputBox();l.placeholder=L("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const c=d=>{const h=parseInt(d);if(isNaN(h))return;const f=s.getState().matchesCount;if(h>0&&h<=f)return h-1;if(h<0&&h>=-f)return f+h},u=d=>{const h=c(d);if(typeof h=="number"){l.validationMessage=void 0,s.goToMatch(h);const f=s.getState().currentMatch;f&&this.addDecorations(n,f)}else l.validationMessage=L("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(n)};l.onDidChangeValue(d=>{u(d)}),l.onDidAccept(()=>{const d=c(l.value);typeof d=="number"?(s.goToMatch(d),l.hide()):l.validationMessage=L("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount)}),l.onDidHide(()=>{this.clearDecorations(n),l.dispose()}),l.show()}clearDecorations(e){e.changeDecorations(n=>{this._highlightDecorations=n.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,n){e.changeDecorations(r=>{this._highlightDecorations=r.deltaDecorations(this._highlightDecorations,[{range:n,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:n,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:Qr(TIe),position:hd.Full}}}])})}}class CMe extends kt{run(e,n){return Ix(this,void 0,void 0,function*(){const r=Ul.get(n);if(!r)return;const s=pne(n,"single",!1);s&&r.setSearchString(s),this._run(r)||(yield r.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:n.getOption(41).loop}),this._run(r))})}}class xEt extends CMe{constructor(){super({id:mr.NextSelectionMatchFindAction,label:L("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class kEt extends CMe{constructor(){super({id:mr.PreviousSelectionMatchFindAction,label:L("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const LEt=EEe(new DEe({id:mr.StartFindReplaceAction,label:L("startReplace","Replace"),alias:"Replace",precondition:ze.or(oe.focus,ze.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:se.MenubarEditMenu,group:"3_find",title:L({},"&&Replace"),order:2}}));LEt.addImplementation(0,(i,e,n)=>{if(!e.hasModel()||e.getOption(90))return!1;const r=Ul.get(e);if(!r)return!1;const s=e.getSelection(),o=r.isFindInputFocused(),a=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,l=o||a?2:1;return r.start({forceRevealReplace:!0,seedSearchStringFromSelection:a?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:l,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});_i(Ul.ID,gne,0);rt(bEt);rt(yEt);rt(wEt);rt(CEt);rt(SEt);rt(xEt);rt(kEt);const cg=Ho.bindToContribution(Ul.get);ct(new cg({id:mr.CloseFindWidgetCommand,precondition:Kv,handler:i=>i.closeFindWidget(),kbOpts:{weight:105,kbExpr:ze.and(oe.focus,ze.not("isComposing")),primary:9,secondary:[1033]}}));ct(new cg({id:mr.ToggleCaseSensitiveCommand,precondition:void 0,handler:i=>i.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:oe.focus,primary:O6.primary,mac:O6.mac,win:O6.win,linux:O6.linux}}));ct(new cg({id:mr.ToggleWholeWordCommand,precondition:void 0,handler:i=>i.toggleWholeWords(),kbOpts:{weight:105,kbExpr:oe.focus,primary:F6.primary,mac:F6.mac,win:F6.win,linux:F6.linux}}));ct(new cg({id:mr.ToggleRegexCommand,precondition:void 0,handler:i=>i.toggleRegex(),kbOpts:{weight:105,kbExpr:oe.focus,primary:B6.primary,mac:B6.mac,win:B6.win,linux:B6.linux}}));ct(new cg({id:mr.ToggleSearchScopeCommand,precondition:void 0,handler:i=>i.toggleSearchScope(),kbOpts:{weight:105,kbExpr:oe.focus,primary:j6.primary,mac:j6.mac,win:j6.win,linux:j6.linux}}));ct(new cg({id:mr.TogglePreserveCaseCommand,precondition:void 0,handler:i=>i.togglePreserveCase(),kbOpts:{weight:105,kbExpr:oe.focus,primary:W6.primary,mac:W6.mac,win:W6.win,linux:W6.linux}}));ct(new cg({id:mr.ReplaceOneAction,precondition:Kv,handler:i=>i.replace(),kbOpts:{weight:105,kbExpr:oe.focus,primary:3094}}));ct(new cg({id:mr.ReplaceOneAction,precondition:Kv,handler:i=>i.replace(),kbOpts:{weight:105,kbExpr:ze.and(oe.focus,gle),primary:3}}));ct(new cg({id:mr.ReplaceAllAction,precondition:Kv,handler:i=>i.replaceAll(),kbOpts:{weight:105,kbExpr:oe.focus,primary:2563}}));ct(new cg({id:mr.ReplaceAllAction,precondition:Kv,handler:i=>i.replaceAll(),kbOpts:{weight:105,kbExpr:ze.and(oe.focus,gle),primary:void 0,mac:{primary:2051}}}));ct(new cg({id:mr.SelectAllMatchesAction,precondition:Kv,handler:i=>i.selectAllMatches(),kbOpts:{weight:105,kbExpr:oe.focus,primary:515}}));const DEt={0:" ",1:"u",2:"r"},H0e=65535,bp=16777215,U0e=4278190080;class xK{constructor(e){const n=Math.ceil(e/32);this._states=new Uint32Array(n)}get(e){const n=e/32|0,r=e%32;return(this._states[n]&1<<r)!==0}set(e,n){const r=e/32|0,s=e%32,o=this._states[r];n?this._states[r]=o|1<<s:this._states[r]=o&~(1<<s)}}class zu{constructor(e,n,r){if(e.length!==n.length||e.length>H0e)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=n,this._collapseStates=new xK(e.length),this._userDefinedStates=new xK(e.length),this._recoveredStates=new xK(e.length),this._types=r,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],n=(r,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=r&&this.getEndLineNumber(o)>=s};for(let r=0,s=this._startIndexes.length;r<s;r++){const o=this._startIndexes[r],a=this._endIndexes[r];if(o>bp||a>bp)throw new Error("startLineNumber or endLineNumber must not exceed "+bp);for(;e.length>0&&!n(o,a);)e.pop();const l=e.length>0?e[e.length-1]:-1;e.push(r),this._startIndexes[r]=o+((l&255)<<24),this._endIndexes[r]=a+((l&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&bp}getEndLineNumber(e){return this._endIndexes[e]&bp}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,n){this._collapseStates.set(e,n)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,n){return this._userDefinedStates.set(e,n)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,n){return this._recoveredStates.set(e,n)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,n){n===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):n===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,n){let r=!1;if(this._types)for(let s=0;s<this._types.length;s++)this._types[s]===e&&(this.setCollapsed(s,n),r=!0);return r}toRegion(e){return new EEt(this,e)}getParentIndex(e){this.ensureParentIndices();const n=((this._startIndexes[e]&U0e)>>>24)+((this._endIndexes[e]&U0e)>>>16);return n===H0e?-1:n}contains(e,n){return this.getStartLineNumber(e)<=n&&this.getEndLineNumber(e)>=n}findIndex(e){let n=0,r=this._startIndexes.length;if(r===0)return-1;for(;n<r;){const s=Math.floor((n+r)/2);e<this.getStartLineNumber(s)?r=s:n=s+1}return n-1}findRange(e){let n=this.findIndex(e);if(n>=0){if(this.getEndLineNumber(n)>=e)return n;for(n=this.getParentIndex(n);n!==-1;){if(this.contains(n,e))return n;n=this.getParentIndex(n)}}return-1}toString(){const e=[];for(let n=0;n<this.length;n++)e[n]=`[${DEt[this.getSource(n)]}${this.isCollapsed(n)?"+":"-"}] ${this.getStartLineNumber(n)}/${this.getEndLineNumber(n)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&bp,endLineNumber:this._endIndexes[e]&bp,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const n=e.length,r=new Uint32Array(n),s=new Uint32Array(n);let o=[],a=!1;for(let c=0;c<n;c++){const u=e[c];r[c]=u.startLineNumber,s[c]=u.endLineNumber,o.push(u.type),u.type&&(a=!0)}a||(o=void 0);const l=new zu(r,s,o);for(let c=0;c<n;c++)e[c].isCollapsed&&l.setCollapsed(c,!0),l.setSource(c,e[c].source);return l}static sanitizeAndMerge(e,n,r){r=r??Number.MAX_VALUE;const s=(m,_)=>Array.isArray(m)?b=>b<_?m[b]:void 0:b=>b<_?m.toFoldRange(b):void 0,o=s(e,e.length),a=s(n,n.length);let l=0,c=0,u=o(0),d=a(0);const h=[];let f,p=0;const g=[];for(;u||d;){let m;if(d&&(!u||u.startLineNumber>=d.startLineNumber))u&&u.startLineNumber===d.startLineNumber?(d.source===1?m=d:(m=u,m.isCollapsed=d.isCollapsed&&u.endLineNumber===d.endLineNumber,m.source=0),u=o(++l)):(m=d,d.isCollapsed&&d.source===0&&(m.source=2)),d=a(++c);else{let _=c,b=d;for(;;){if(!b||b.startLineNumber>u.endLineNumber){m=u;break}if(b.source===1&&b.endLineNumber>u.endLineNumber)break;b=a(++_)}u=o(++l)}if(m){for(;f&&f.endLineNumber<m.startLineNumber;)f=h.pop();m.endLineNumber>m.startLineNumber&&m.startLineNumber>p&&m.endLineNumber<=r&&(!f||f.endLineNumber>=m.endLineNumber)&&(g.push(m),p=m.startLineNumber,f&&h.push(f),f=m)}}return g}}class EEt{constructor(e,n){this.ranges=e,this.index=n}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class IEt{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,n){this._updateEventEmitter=new _e,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=n,this._regions=new zu(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((r,s)=>r.regionIndex-s.regionIndex);const n={};this._decorationProvider.changeDecorations(r=>{let s=0,o=-1,a=-1;const l=c=>{for(;s<c;){const u=this._regions.getEndLineNumber(s),d=this._regions.isCollapsed(s);if(u<=o){const h=this.regions.getSource(s)!==0;r.changeDecorationOptions(this._editorDecorationIds[s],this._decorationProvider.getDecorationOption(d,u<=a,h))}d&&u>a&&(a=u),s++}};for(const c of e){const u=c.regionIndex,d=this._editorDecorationIds[u];if(d&&!n[d]){n[d]=!0,l(u);const h=!this._regions.isCollapsed(u);this._regions.setCollapsed(u,h),o=Math.max(o,this._regions.getEndLineNumber(u))}}l(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const n=new Array,r=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;s<this._regions.length;s++){const o=this._regions.toFoldRange(s);(o.source===0||!r(o))&&n.push(o)}this.updatePost(zu.fromFoldRanges(n))}update(e,n=[]){const r=this._currentFoldedOrManualRanges(n),s=zu.sanitizeAndMerge(e,r,this._textModel.getLineCount());this.updatePost(zu.fromFoldRanges(s))}updatePost(e){const n=[];let r=-1;for(let s=0,o=e.length;s<o;s++){const a=e.getStartLineNumber(s),l=e.getEndLineNumber(s),c=e.isCollapsed(s),u=e.getSource(s)!==0,d={startLineNumber:a,startColumn:this._textModel.getLineMaxColumn(a),endLineNumber:l,endColumn:this._textModel.getLineMaxColumn(l)+1};n.push({range:d,options:this._decorationProvider.getDecorationOption(c,l<=r,u)}),c&&l>r&&(r=l)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,n)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const n=(s,o)=>{for(const a of e)if(s<a&&a<=o)return!0;return!1},r=[];for(let s=0,o=this._regions.length;s<o;s++){let a=this.regions.isCollapsed(s);const l=this.regions.getSource(s);if(a||l!==0){const c=this._regions.toFoldRange(s),u=this._textModel.getDecorationRange(this._editorDecorationIds[s]);u&&(a&&n(u.startLineNumber,u.endLineNumber)&&(a=!1),r.push({startLineNumber:u.startLineNumber,endLineNumber:u.endLineNumber,type:c.type,isCollapsed:a,source:l}))}}return r}getMemento(){const e=this._currentFoldedOrManualRanges(),n=[],r=this._textModel.getLineCount();for(let s=0,o=e.length;s<o;s++){const a=e[s];if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>r)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);n.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,isCollapsed:a.isCollapsed,source:a.source,checksum:l})}return n.length>0?n:void 0}applyMemento(e){var n,r;if(!Array.isArray(e))return;const s=[],o=this._textModel.getLineCount();for(const l of e){if(l.startLineNumber>=l.endLineNumber||l.startLineNumber<1||l.endLineNumber>o)continue;const c=this._getLinesChecksum(l.startLineNumber+1,l.endLineNumber);(!l.checksum||c===l.checksum)&&s.push({startLineNumber:l.startLineNumber,endLineNumber:l.endLineNumber,type:void 0,isCollapsed:(n=l.isCollapsed)!==null&&n!==void 0?n:!0,source:(r=l.source)!==null&&r!==void 0?r:0})}const a=zu.sanitizeAndMerge(this._regions,s,o);this.updatePost(zu.fromFoldRanges(a))}_getLinesChecksum(e,n){return KEe(this._textModel.getLineContent(e)+this._textModel.getLineContent(n))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,n){const r=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const a=this._regions.toRegion(s);(!n||n(a,o))&&r.push(a),o++,s=a.parentIndex}}return r}getRegionAtLine(e){if(this._regions){const n=this._regions.findRange(e);if(n>=0)return this._regions.toRegion(n)}return null}getRegionsInside(e,n){const r=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(n&&n.length===2){const a=[];for(let l=s,c=this._regions.length;l<c;l++){const u=this._regions.toRegion(l);if(this._regions.getStartLineNumber(l)<o){for(;a.length>0&&!u.containedBy(a[a.length-1]);)a.pop();a.push(u),n(u,a.length)&&r.push(u)}else break}}else for(let a=s,l=this._regions.length;a<l;a++){const c=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<o)(!n||n(c))&&r.push(c);else break}return r}}function SMe(i,e,n){const r=[];for(const s of n){const o=i.getRegionAtLine(s);if(o){const a=!o.isCollapsed;if(r.push(o),e>1){const l=i.getRegionsInside(o,(c,u)=>c.isCollapsed!==a&&u<e);r.push(...l)}}}i.toggleCollapseState(r)}function YI(i,e,n=Number.MAX_VALUE,r){const s=[];if(r&&r.length>0)for(const o of r){const a=i.getRegionAtLine(o);if(a&&(a.isCollapsed!==e&&s.push(a),n>1)){const l=i.getRegionsInside(a,(c,u)=>c.isCollapsed!==e&&u<n);s.push(...l)}}else{const o=i.getRegionsInside(null,(a,l)=>a.isCollapsed!==e&&l<n);s.push(...o)}i.toggleCollapseState(s)}function xMe(i,e,n,r){const s=[];for(const o of r){const a=i.getAllRegionsAtLine(o,(l,c)=>l.isCollapsed!==e&&c<=n);s.push(...a)}i.toggleCollapseState(s)}function TEt(i,e,n){const r=[];for(const s of n){const o=i.getAllRegionsAtLine(s,a=>a.isCollapsed!==e);o.length>0&&r.push(o[0])}i.toggleCollapseState(r)}function REt(i,e,n,r){const s=(a,l)=>l===e&&a.isCollapsed!==n&&!r.some(c=>a.containsLine(c)),o=i.getRegionsInside(null,s);i.toggleCollapseState(o)}function kMe(i,e,n){const r=[];for(const a of n){const l=i.getAllRegionsAtLine(a,void 0);l.length>0&&r.push(l[0])}const s=a=>r.every(l=>!l.containedBy(a)&&!a.containedBy(l))&&a.isCollapsed!==e,o=i.getRegionsInside(null,s);i.toggleCollapseState(o)}function vle(i,e,n){const r=i.textModel,s=i.regions,o=[];for(let a=s.length-1;a>=0;a--)if(n!==s.isCollapsed(a)){const l=s.getStartLineNumber(a);e.test(r.getLineContent(l))&&o.push(s.toRegion(a))}i.toggleCollapseState(o)}function ble(i,e,n){const r=i.regions,s=[];for(let o=r.length-1;o>=0;o--)n!==r.isCollapsed(o)&&e===r.getType(o)&&s.push(r.toRegion(o));i.toggleCollapseState(s)}function AEt(i,e){let n=null;const r=e.getRegionAtLine(i);if(r!==null&&(n=r.startLineNumber,i===n)){const s=r.parentIndex;s!==-1?n=e.regions.getStartLineNumber(s):n=null}return n}function NEt(i,e){let n=e.getRegionAtLine(i);if(n!==null&&n.startLineNumber===i){if(i!==n.startLineNumber)return n.startLineNumber;{const r=n.parentIndex;let s=0;for(r!==-1&&(s=e.regions.getStartLineNumber(n.parentIndex));n!==null;)if(n.regionIndex>0){if(n=e.regions.toRegion(n.regionIndex-1),n.startLineNumber<=s)return null;if(n.parentIndex===r)return n.startLineNumber}else return null}}else if(e.regions.length>0)for(n=e.regions.toRegion(e.regions.length-1);n!==null;){if(n.startLineNumber<i)return n.startLineNumber;n.regionIndex>0?n=e.regions.toRegion(n.regionIndex-1):n=null}return null}function MEt(i,e){let n=e.getRegionAtLine(i);if(n!==null&&n.startLineNumber===i){const r=n.parentIndex;let s=0;if(r!==-1)s=e.regions.getEndLineNumber(n.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;n!==null;)if(n.regionIndex<e.regions.length){if(n=e.regions.toRegion(n.regionIndex+1),n.startLineNumber>=s)return null;if(n.parentIndex===r)return n.startLineNumber}else return null}else if(e.regions.length>0)for(n=e.regions.toRegion(0);n!==null;){if(n.startLineNumber>i)return n.startLineNumber;n.regionIndex<e.regions.length?n=e.regions.toRegion(n.regionIndex+1):n=null}return null}class PEt{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new _e,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(n=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(n=>n.range.endLineNumber!==n.range.startLineNumber||y1(n.text)[0]!==0))}updateHiddenRanges(){let e=!1;const n=[];let r=0,s=0,o=Number.MAX_VALUE,a=-1;const l=this._foldingModel.regions;for(;r<l.length;r++){if(!l.isCollapsed(r))continue;const c=l.getStartLineNumber(r)+1,u=l.getEndLineNumber(r);o<=c&&u<=a||(!e&&s<this._hiddenRanges.length&&this._hiddenRanges[s].startLineNumber===c&&this._hiddenRanges[s].endLineNumber===u?(n.push(this._hiddenRanges[s]),s++):(e=!0,n.push(new J(c,1,u,1))),o=c,a=u)}(this._hasLineChanges||e||s<this._hiddenRanges.length)&&this.applyHiddenRanges(n)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return q0e(this._hiddenRanges,e)!==null}adjustSelections(e){let n=!1;const r=this._foldingModel.textModel;let s=null;const o=a=>((!s||!OEt(a,s))&&(s=q0e(this._hiddenRanges,a)),s?s.startLineNumber-1:null);for(let a=0,l=e.length;a<l;a++){let c=e[a];const u=o(c.startLineNumber);u&&(c=c.setStartPosition(u,r.getLineMaxColumn(u)),n=!0);const d=o(c.endLineNumber);d&&(c=c.setEndPosition(d,r.getLineMaxColumn(d)),n=!0),e[a]=c}return n}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function OEt(i,e){return i>=e.startLineNumber&&i<=e.endLineNumber}function q0e(i,e){const n=_P(i,r=>e<r.startLineNumber)-1;return n>=0&&i[n].endLineNumber>=e?i[n]:null}const FEt=5e3,BEt="indent";class yle{constructor(e,n,r){this.editorModel=e,this.languageConfigurationService=n,this.foldingRangesLimit=r,this.id=BEt}dispose(){}compute(e){const n=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,r=n&&!!n.offSide,s=n&&n.markers;return Promise.resolve($Et(this.editorModel,r,s,this.foldingRangesLimit))}}let jEt=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,n,r){if(e>bp||n>bp)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=n,this._length++,r<1e3&&(this._indentOccurrences[r]=(this._indentOccurrences[r]||0)+1)}toIndentRanges(e){const n=this._foldingRangesLimit.limit;if(this._length<=n){this._foldingRangesLimit.update(this._length,!1);const r=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,a=0;o>=0;o--,a++)r[a]=this._startIndexes[o],s[a]=this._endIndexes[o];return new zu(r,s)}else{this._foldingRangesLimit.update(this._length,n);let r=0,s=this._indentOccurrences.length;for(let c=0;c<this._indentOccurrences.length;c++){const u=this._indentOccurrences[c];if(u){if(u+r>n){s=c;break}r+=u}}const o=e.getOptions().tabSize,a=new Uint32Array(n),l=new Uint32Array(n);for(let c=this._length-1,u=0;c>=0;c--){const d=this._startIndexes[c],h=e.getLineContent(d),f=A$(h,o);(f<s||f===s&&r++<n)&&(a[u]=d,l[u]=this._endIndexes[c],u++)}return new zu(a,l)}}};const WEt={limit:FEt,update:()=>{}};function $Et(i,e,n,r=WEt){const s=i.getOptions().tabSize,o=new jEt(r);let a;n&&(a=new RegExp(`(${n.start.source})|(?:${n.end.source})`));const l=[],c=i.getLineCount()+1;l.push({indent:-1,endAbove:c,line:c});for(let u=i.getLineCount();u>0;u--){const d=i.getLineContent(u),h=A$(d,s);let f=l[l.length-1];if(h===-1){e&&(f.endAbove=u);continue}let p;if(a&&(p=d.match(a)))if(p[1]){let g=l.length-1;for(;g>0&&l[g].indent!==-2;)g--;if(g>0){l.length=g+1,f=l[g],o.insertFirst(u,f.line,h),f.line=u,f.indent=h,f.endAbove=u;continue}}else{l.push({indent:-2,endAbove:u,line:u});continue}if(f.indent>h){do l.pop(),f=l[l.length-1];while(f.indent>h);const g=f.endAbove-1;g-u>=1&&o.insertFirst(u,g,h)}f.indent===h?f.endAbove=u:l.push({indent:h,endAbove:u,line:u})}return o.toIndentRanges(i)}const zEt=ce("editor.foldBackground",{light:Ht(vy,.3),dark:Ht(vy,.3),hcDark:null,hcLight:null},L("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);ce("editorGutter.foldingControlForeground",{dark:_y,light:_y,hcDark:_y,hcLight:_y},L("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const Pz=ws("folding-expanded",lt.chevronDown,L("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),Oz=ws("folding-collapsed",lt.chevronRight,L("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),LMe=ws("folding-manual-collapsed",Oz,L("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),DMe=ws("folding-manual-expanded",Pz,L("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),wle={color:Qr(zEt),position:ou.Inline};class Ws{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,n,r){return n?Ws.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ws.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ws.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ws.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?r?this.showFoldingHighlights?Ws.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ws.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ws.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ws.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?r?Ws.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ws.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:r?Ws.MANUALLY_EXPANDED_VISUAL_DECORATION:Ws.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Ws.COLLAPSED_VISUAL_DECORATION=kn.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:en.asClassName(Oz)});Ws.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=kn.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:wle,isWholeLine:!0,firstLineDecorationClassName:en.asClassName(Oz)});Ws.MANUALLY_COLLAPSED_VISUAL_DECORATION=kn.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:en.asClassName(LMe)});Ws.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=kn.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:wle,isWholeLine:!0,firstLineDecorationClassName:en.asClassName(LMe)});Ws.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=kn.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Ws.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=kn.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:wle,isWholeLine:!0});Ws.EXPANDED_VISUAL_DECORATION=kn.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+en.asClassName(Pz)});Ws.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=kn.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:en.asClassName(Pz)});Ws.MANUALLY_EXPANDED_VISUAL_DECORATION=kn.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+en.asClassName(DMe)});Ws.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=kn.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:en.asClassName(DMe)});Ws.NO_CONTROLS_EXPANDED_RANGE_DECORATION=kn.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Ws.HIDDEN_RANGE_DECORATION=kn.register({description:"folding-hidden-range-decoration",stickiness:1});const VEt={},HEt="syntax";class Cle{constructor(e,n,r,s,o){this.editorModel=e,this.providers=n,this.handleFoldingRangesChange=r,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=HEt,this.disposables=new Xe,o&&this.disposables.add(o);for(const a of n)typeof a.onDidChange=="function"&&this.disposables.add(a.onDidChange(r))}compute(e){return UEt(this.providers,this.editorModel,e).then(n=>{var r,s;return n?KEt(n,this.foldingRangesLimit):(s=(r=this.fallbackRangeProvider)===null||r===void 0?void 0:r.compute(e))!==null&&s!==void 0?s:null})}dispose(){this.disposables.dispose()}}function UEt(i,e,n){let r=null;const s=i.map((o,a)=>Promise.resolve(o.provideFoldingRanges(e,VEt,n)).then(l=>{if(!n.isCancellationRequested&&Array.isArray(l)){Array.isArray(r)||(r=[]);const c=e.getLineCount();for(const u of l)u.start>0&&u.end>u.start&&u.end<=c&&r.push({start:u.start,end:u.end,rank:a,kind:u.kind})}},Us));return Promise.all(s).then(o=>r)}class qEt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,n,r,s){if(e>bp||n>bp)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=n,this._nestingLevels[o]=s,this._types[o]=r,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let s=0;s<this._length;s++)n[s]=this._startIndexes[s],r[s]=this._endIndexes[s];return new zu(n,r,this._types)}else{this._foldingRangesLimit.update(this._length,e);let n=0,r=this._nestingLevelCounts.length;for(let l=0;l<this._nestingLevelCounts.length;l++){const c=this._nestingLevelCounts[l];if(c){if(c+n>e){r=l;break}n+=c}}const s=new Uint32Array(e),o=new Uint32Array(e),a=[];for(let l=0,c=0;l<this._length;l++){const u=this._nestingLevels[l];(u<r||u===r&&n++<e)&&(s[c]=this._startIndexes[l],o[c]=this._endIndexes[l],a[c]=this._types[l],c++)}return new zu(s,o,a)}}}function KEt(i,e){const n=i.sort((a,l)=>{let c=a.start-l.start;return c===0&&(c=a.rank-l.rank),c}),r=new qEt(e);let s;const o=[];for(const a of n)if(!s)s=a,r.add(a.start,a.end,a.kind&&a.kind.value,o.length);else if(a.start>s.start)if(a.end<=s.end)o.push(s),s=a,r.add(a.start,a.end,a.kind&&a.kind.value,o.length);else{if(a.start>s.end){do s=o.pop();while(s&&a.start>s.end);s&&o.push(s),s=a}r.add(a.start,a.end,a.kind&&a.kind.value,o.length)}return r.toIndentRanges()}var GEt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},uA=function(i,e){return function(n,r){e(n,r,i)}},XEt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},VD;const Za=new yt("foldingEnabled",!1);let i_=VD=class extends Le{static get(e){return e.getContribution(VD.ID)}static getFoldingRangeProviders(e,n){var r,s;const o=e.foldingRangeProvider.ordered(n);return(s=(r=VD._foldingRangeSelector)===null||r===void 0?void 0:r.call(VD,o,n))!==null&&s!==void 0?s:o}constructor(e,n,r,s,o,a){super(),this.contextKeyService=n,this.languageConfigurationService=r,this.languageFeaturesService=a,this.localToDispose=this._register(new Xe),this.editor=e,this._foldingLimitReporter=new EMe(e);const l=this.editor.getOptions();this._isEnabled=l.get(43),this._useFoldingProviders=l.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=l.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=l.get(46),this.updateDebounceInfo=o.for(a.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ws(e),this.foldingDecorationProvider.showFoldingControls=l.get(109),this.foldingDecorationProvider.showFoldingHighlights=l.get(45),this.foldingEnabled=Za.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(c=>{if(c.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),c.hasChanged(47)&&this.onModelChanged(),c.hasChanged(109)||c.hasChanged(45)){const u=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=u.get(109),this.foldingDecorationProvider.showFoldingHighlights=u.get(45),this.triggerFoldingModelChanged()}c.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),c.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),c.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const n=this.foldingModel.getMemento(),r=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:n,lineCount:e.getLineCount(),provider:r,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const n=this.editor.getModel();if(!(!n||!this._isEnabled||n.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new IEt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new PEt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(n=>this.onHiddenRangesChanges(n))),this.updateScheduler=new Rf(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Ji(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(n=>this.onDidChangeModelContent(n))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(n=>this.onEditorMouseDown(n))),this.localToDispose.add(this.editor.onMouseUp(n=>this.onEditorMouseUp(n))),this.localToDispose.add({dispose:()=>{var n,r;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(n=this.updateScheduler)===null||n===void 0||n.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(r=this.rangeProvider)===null||r===void 0||r.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const n=new yle(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=n,this._useFoldingProviders&&this.foldingModel){const r=VD.getFoldingRangeProviders(this.languageFeaturesService,e);r.length>0&&(this.rangeProvider=new Cle(e,r,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,n))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var n;(n=this.hiddenRangeModel)===null||n===void 0||n.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const n=new Xa,r=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=go(o=>r.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let a;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(Wl.Imports.value,!0);d&&(a=Qp.capture(this.editor),this._currentModelHasFoldedImports=d)}const l=this.editor.getSelections(),c=l?l.map(d=>d.startLineNumber):[];e.update(o,c),a==null||a.restore(this.editor);const u=this.updateDebounceInfo.update(e.textModel,n.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=u)}return e})}).then(void 0,e=>(Ln(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const n=this.editor.getSelections();n&&this.hiddenRangeModel.adjustSelections(n)&&this.editor.setSelections(n)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(n=>{if(n){const r=this.editor.getSelections();if(r&&r.length>0){const s=[];for(const o of r){const a=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(a)&&s.push(...n.getAllRegionsAtLine(a,l=>l.isCollapsed&&a>l.startLineNumber))}s.length&&(n.toggleCollapseState(s),this.reveal(r[0].getPosition()))}}}).then(void 0,Ln)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const n=e.target.range;let r=!1;switch(e.target.type){case 4:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;r=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&n.startColumn===s.getLineMaxColumn(n.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:n.startLineNumber,iconClicked:r}}onEditorMouseUp(e){const n=this.foldingModel;if(!n||!this.mouseDownInfo||!e.target)return;const r=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==r)return;if(s){if(e.target.type!==4)return}else{const l=this.editor.getModel();if(!l||o.startColumn!==l.getLineMaxColumn(r))return}const a=n.getRegionAtLine(r);if(a&&a.startLineNumber===r){const l=a.isCollapsed;if(s||l){const c=e.event.altKey;let u=[];if(c){const d=f=>!f.containedBy(a)&&!a.containedBy(f),h=n.getRegionsInside(null,d);for(const f of h)f.isCollapsed&&u.push(f);u.length===0&&(u=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of n.getRegionsInside(a))h.isCollapsed===l&&u.push(h);(l||!d||u.length===0)&&u.push(a)}n.toggleCollapseState(u),this.reveal({lineNumber:r,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};i_.ID="editor.contrib.folding";i_=VD=GEt([uA(1,mn),uA(2,dr),uA(3,Ps),uA(4,xh),uA(5,Et)],i_);class EMe{constructor(e){this.editor=e,this._onDidChange=new _e,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,n){(e!==this._computed||n!==this._limited)&&(this._computed=e,this._limited=n,this._onDidChange.fire())}}class bl extends kt{runEditorCommand(e,n,r){const s=e.get(dr),o=i_.get(n);if(!o)return;const a=o.getFoldingModel();if(a)return this.reportTelemetry(e,n),a.then(l=>{if(l){this.invoke(o,l,n,r,s);const c=n.getSelection();c&&o.reveal(c.getStartPosition())}})}getSelectedLines(e){const n=e.getSelections();return n?n.map(r=>r.startLineNumber):[]}getLineNumbers(e,n){return e&&e.selectionLines?e.selectionLines.map(r=>r+1):this.getSelectedLines(n)}run(e,n){}}function IMe(i){if(!nu(i)){if(!Bl(i))return!1;const e=i;if(!nu(e.levels)&&!c1(e.levels)||!nu(e.direction)&&!zl(e.direction)||!nu(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(c1)))return!1}return!0}class YEt extends bl{constructor(){super({id:"editor.unfold",label:L("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument:
* 'levels': Number of levels to unfold. If not set, defaults to 1.
* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.
`,constraint:IMe,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,n,r,s){const o=s&&s.levels||1,a=this.getLineNumbers(s,r);s&&s.direction==="up"?xMe(n,!1,o,a):YI(n,!1,o,a)}}class ZEt extends bl{constructor(){super({id:"editor.unfoldRecursively",label:L("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2142),weight:100}})}invoke(e,n,r,s){YI(n,!1,Number.MAX_VALUE,this.getSelectedLines(r))}}class QEt extends bl{constructor(){super({id:"editor.fold",label:L("foldAction.label","Fold"),alias:"Fold",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument:
* 'levels': Number of levels to fold.
* 'direction': If 'up', folds given number of levels up otherwise folds down.
* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.
If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.
`,constraint:IMe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,n,r,s){const o=this.getLineNumbers(s,r),a=s&&s.levels,l=s&&s.direction;typeof a!="number"&&typeof l!="string"?TEt(n,!0,o):l==="up"?xMe(n,!0,a||1,o):YI(n,!0,a||1,o)}}class JEt extends bl{constructor(){super({id:"editor.toggleFold",label:L("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2090),weight:100}})}invoke(e,n,r){const s=this.getSelectedLines(r);SMe(n,1,s)}}class eIt extends bl{constructor(){super({id:"editor.foldRecursively",label:L("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2140),weight:100}})}invoke(e,n,r){const s=this.getSelectedLines(r);YI(n,!0,Number.MAX_VALUE,s)}}class tIt extends bl{constructor(){super({id:"editor.foldAllBlockComments",label:L("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2138),weight:100}})}invoke(e,n,r,s,o){if(n.regions.hasTypes())ble(n,Wl.Comment.value,!0);else{const a=r.getModel();if(!a)return;const l=o.getLanguageConfiguration(a.getLanguageId()).comments;if(l&&l.blockCommentStartToken){const c=new RegExp("^\\s*"+dd(l.blockCommentStartToken));vle(n,c,!0)}}}}class nIt extends bl{constructor(){super({id:"editor.foldAllMarkerRegions",label:L("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2077),weight:100}})}invoke(e,n,r,s,o){if(n.regions.hasTypes())ble(n,Wl.Region.value,!0);else{const a=r.getModel();if(!a)return;const l=o.getLanguageConfiguration(a.getLanguageId()).foldingRules;if(l&&l.markers&&l.markers.start){const c=new RegExp(l.markers.start);vle(n,c,!0)}}}}class iIt extends bl{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:L("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2078),weight:100}})}invoke(e,n,r,s,o){if(n.regions.hasTypes())ble(n,Wl.Region.value,!1);else{const a=r.getModel();if(!a)return;const l=o.getLanguageConfiguration(a.getLanguageId()).foldingRules;if(l&&l.markers&&l.markers.start){const c=new RegExp(l.markers.start);vle(n,c,!1)}}}}class rIt extends bl{constructor(){super({id:"editor.foldAllExcept",label:L("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2136),weight:100}})}invoke(e,n,r){const s=this.getSelectedLines(r);kMe(n,!0,s)}}class sIt extends bl{constructor(){super({id:"editor.unfoldAllExcept",label:L("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2134),weight:100}})}invoke(e,n,r){const s=this.getSelectedLines(r);kMe(n,!1,s)}}class oIt extends bl{constructor(){super({id:"editor.foldAll",label:L("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2069),weight:100}})}invoke(e,n,r){YI(n,!0)}}class aIt extends bl{constructor(){super({id:"editor.unfoldAll",label:L("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2088),weight:100}})}invoke(e,n,r){YI(n,!1)}}class Tx extends bl{getFoldingLevel(){return parseInt(this.id.substr(Tx.ID_PREFIX.length))}invoke(e,n,r){REt(n,this.getFoldingLevel(),!0,this.getSelectedLines(r))}}Tx.ID_PREFIX="editor.foldLevel";Tx.ID=i=>Tx.ID_PREFIX+i;class lIt extends bl{constructor(){super({id:"editor.gotoParentFold",label:L("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,weight:100}})}invoke(e,n,r){const s=this.getSelectedLines(r);if(s.length>0){const o=AEt(s[0],n);o!==null&&r.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class cIt extends bl{constructor(){super({id:"editor.gotoPreviousFold",label:L("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,weight:100}})}invoke(e,n,r){const s=this.getSelectedLines(r);if(s.length>0){const o=NEt(s[0],n);o!==null&&r.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class uIt extends bl{constructor(){super({id:"editor.gotoNextFold",label:L("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,weight:100}})}invoke(e,n,r){const s=this.getSelectedLines(r);if(s.length>0){const o=MEt(s[0],n);o!==null&&r.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class dIt extends bl{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:L("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2135),weight:100}})}invoke(e,n,r){var s;const o=[],a=r.getSelections();if(a){for(const l of a){let c=l.endLineNumber;l.endColumn===1&&--c,c>l.startLineNumber&&(o.push({startLineNumber:l.startLineNumber,endLineNumber:c,type:void 0,isCollapsed:!0,source:1}),r.setSelection({startLineNumber:l.startLineNumber,startColumn:1,endLineNumber:l.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((c,u)=>c.startLineNumber-u.startLineNumber);const l=zu.sanitizeAndMerge(n.regions,o,(s=r.getModel())===null||s===void 0?void 0:s.getLineCount());n.updatePost(zu.fromFoldRanges(l))}}}}class hIt extends bl{constructor(){super({id:"editor.removeManualFoldingRanges",label:L("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2137),weight:100}})}invoke(e,n,r){const s=r.getSelections();if(s){const o=[];for(const a of s){const{startLineNumber:l,endLineNumber:c}=a;o.push(c>=l?{startLineNumber:l,endLineNumber:c}:{endLineNumber:c,startLineNumber:l})}n.removeManualRanges(o),e.triggerFoldingModelChanged()}}}_i(i_.ID,i_,0);rt(YEt);rt(ZEt);rt(QEt);rt(eIt);rt(oIt);rt(aIt);rt(tIt);rt(nIt);rt(iIt);rt(rIt);rt(sIt);rt(JEt);rt(lIt);rt(cIt);rt(uIt);rt(dIt);rt(hIt);for(let i=1;i<=7;i++)clt(new Tx({id:Tx.ID(i),label:L("foldLevelAction.label","Fold Level {0}",i),alias:`Fold Level ${i}`,precondition:Za,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2048|21+i),weight:100}}));si.registerCommand("_executeFoldingRangeProvider",function(i,...e){return XEt(this,void 0,void 0,function*(){const[n]=e;if(!(n instanceof Jt))throw uh();const r=i.get(Et),s=i.get(Fr).getModel(n);if(!s)throw uh();const o=i.get(ei);if(!o.getValue("editor.folding",{resource:n}))return[];const a=i.get(dr),l=o.getValue("editor.foldingStrategy",{resource:n}),c={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:n})},update:(p,g)=>{}},u=new yle(s,a,c);let d=u;if(l!=="indentation"){const p=i_.getFoldingRangeProviders(r,s);p.length&&(d=new Cle(s,p,()=>{},c,u))}const h=yield d.compute(Hn.None),f=[];try{if(h)for(let p=0;p<h.length;p++){const g=h.getType(p);f.push({start:h.getStartLineNumber(p),end:h.getEndLineNumber(p),kind:g?Wl.fromValue(g):void 0})}return f}finally{d.dispose()}})});class fIt extends kt{constructor(){super({id:"editor.action.fontZoomIn",label:L("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,n){eh.setZoomLevel(eh.getZoomLevel()+1)}}class pIt extends kt{constructor(){super({id:"editor.action.fontZoomOut",label:L("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,n){eh.setZoomLevel(eh.getZoomLevel()-1)}}class gIt extends kt{constructor(){super({id:"editor.action.fontZoomReset",label:L("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,n){eh.setZoomLevel(0)}}rt(fIt);rt(pIt);rt(gIt);var TMe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mj=function(i,e){return function(n,r){e(n,r,i)}},Sle=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let fO=class{constructor(e,n,r){this._editor=e,this._languageFeaturesService=n,this._workerService=r,this._disposables=new Xe,this._sessionDisposables=new Xe,this._disposables.add(n.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(s=>{s.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[n]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!n||!n.autoFormatTriggerCharacters)return;const r=new q9;for(const s of n.autoFormatTriggerCharacters)r.add(s.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(s=>{const o=s.charCodeAt(s.length-1);r.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const n=this._editor.getModel(),r=this._editor.getPosition(),s=new Ns,o=this._editor.onDidChangeModelContent(a=>{if(a.isFlush){s.cancel(),o.dispose();return}for(let l=0,c=a.changes.length;l<c;l++)if(a.changes[l].range.endLineNumber<=r.lineNumber){s.cancel(),o.dispose();return}});pAe(this._workerService,this._languageFeaturesService,n,r,e,n.getFormattingOptions(),s.token).then(a=>{s.token.isCancellationRequested||Ka(a)&&(tI.execute(this._editor,a,!0),Uae(a))}).finally(()=>{o.dispose()})}};fO.ID="editor.contrib.autoFormat";fO=TMe([mj(1,Et),mj(2,Wf)],fO);let pO=class{constructor(e,n,r){this.editor=e,this._languageFeaturesService=n,this._instantiationService=r,this._callOnDispose=new Xe,this._callOnModel=new Xe,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(n.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(55)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(fAe,this.editor,e,2,_v.None,Hn.None).catch(Ln))}};pO.ID="editor.contrib.formatOnPaste";pO=TMe([mj(1,Et),mj(2,hn)],pO);class mIt extends kt{constructor(){super({id:"editor.action.formatDocument",label:L("formatDocument.label","Format Document"),alias:"Format Document",precondition:ze.and(oe.notInCompositeEditor,oe.writable,oe.hasDocumentFormattingProvider),kbOpts:{kbExpr:oe.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,n){return Sle(this,void 0,void 0,function*(){if(n.hasModel()){const r=e.get(hn);yield e.get(Z1).showWhile(r.invokeFunction(yxt,n,1,_v.None,Hn.None),250)}})}}class _It extends kt{constructor(){super({id:"editor.action.formatSelection",label:L("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:ze.and(oe.writable,oe.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2084),weight:100},contextMenuOpts:{when:oe.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,n){return Sle(this,void 0,void 0,function*(){if(!n.hasModel())return;const r=e.get(hn),s=n.getModel(),o=n.getSelections().map(l=>l.isEmpty()?new J(l.startLineNumber,1,l.startLineNumber,s.getLineMaxColumn(l.startLineNumber)):l);yield e.get(Z1).showWhile(r.invokeFunction(fAe,n,o,1,_v.None,Hn.None),250)})}}_i(fO.ID,fO,2);_i(pO.ID,pO,2);rt(mIt);rt(_It);si.registerCommand("editor.action.format",i=>Sle(void 0,void 0,void 0,function*(){const e=i.get(Si).getFocusedCodeEditor();if(!e||!e.hasModel())return;const n=i.get(us);e.getSelection().isEmpty()?yield n.executeCommand("editor.action.formatDocument"):yield n.executeCommand("editor.action.formatSelection")}));var vIt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},kK=function(i,e){return function(n,r){e(n,r,i)}},bIt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class x2{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,n){let r;typeof e=="string"?r=`${n.id}/${e}`:(r=`${n.id}/${e.name}`,n.children.get(r)!==void 0&&(r=`${n.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=r;for(let o=0;n.children.get(s)!==void 0;o++)s=`${r}_${o}`;return s}static empty(e){return e.children.size===0}}class mne extends x2{constructor(e,n,r){super(),this.id=e,this.parent=n,this.symbol=r,this.children=new Map}}class RMe extends x2{constructor(e,n,r,s){super(),this.id=e,this.parent=n,this.label=r,this.order=s,this.children=new Map}}class M0 extends x2{static create(e,n,r){const s=new Ns(r),o=new M0(n.uri),a=e.ordered(n),l=a.map((u,d)=>{var h;const f=x2.findId(`provider_${d}`,o),p=new RMe(f,o,(h=u.displayName)!==null&&h!==void 0?h:"Unknown Outline Provider",d);return Promise.resolve(u.provideDocumentSymbols(n,s.token)).then(g=>{for(const m of g||[])M0._makeOutlineElement(m,p);return p},g=>(Us(g),p)).then(g=>{x2.empty(g)?g.remove():o._groups.set(f,g)})}),c=e.onDidChange(()=>{const u=e.ordered(n);ys(u,a)||s.cancel()});return Promise.all(l).then(()=>s.token.isCancellationRequested&&!r.isCancellationRequested?M0.create(e,n,r):o._compact()).finally(()=>{s.dispose(),c.dispose(),s.dispose()})}static _makeOutlineElement(e,n){const r=x2.findId(e,n),s=new mne(r,n,e);if(e.children)for(const o of e.children)M0._makeOutlineElement(o,s);n.children.set(s.id,s)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[n,r]of this._groups)r.children.size===0?this._groups.delete(n):e+=1;if(e!==1)this.children=this._groups;else{const n=Vn.first(this._groups.values());for(const[,r]of n.children)r.parent=this,this.children.set(r.id,r)}return this}getTopLevelSymbols(){const e=[];for(const n of this.children.values())n instanceof mne?e.push(n.symbol):e.push(...Vn.map(n.children.values(),r=>r.symbol));return e.sort((n,r)=>J.compareRangesUsingStarts(n.range,r.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),n=[];return M0._flattenDocumentSymbols(n,e,""),n.sort((r,s)=>ve.compare(J.getStartPosition(r.range),J.getStartPosition(s.range))||ve.compare(J.getEndPosition(s.range),J.getEndPosition(r.range)))}static _flattenDocumentSymbols(e,n,r){for(const s of n)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||r,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&M0._flattenDocumentSymbols(e,s.children,s.name)}}const Fz=qn("IOutlineModelService");let _ne=class{constructor(e,n,r){this._languageFeaturesService=e,this._disposables=new Xe,this._cache=new G1(10,.7),this._debounceInformation=n.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(r.onModelRemoved(s=>{this._cache.delete(s.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,n){return bIt(this,void 0,void 0,function*(){const r=this._languageFeaturesService.documentSymbolProvider,s=r.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!ys(o.provider,s)){const l=new Ns;o={versionId:e.getVersionId(),provider:s,promiseCnt:0,source:l,promise:M0.create(r,e,l.token),model:void 0},this._cache.set(e.id,o);const c=Date.now();o.promise.then(u=>{o.model=u,this._debounceInformation.update(e,Date.now()-c)}).catch(u=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const a=n.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return yield o.promise}finally{a.dispose()}})}};_ne=vIt([kK(0,Et),kK(1,xh),kK(2,Fr)],_ne);oi(Fz,_ne,1);var yIt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};si.registerCommand("_executeDocumentSymbolProvider",function(i,...e){return yIt(this,void 0,void 0,function*(){const[n]=e;Ui(Jt.isUri(n));const r=i.get(Fz),o=yield i.get(Ec).createModelReference(n);try{return(yield r.getOrCreate(o.object.textEditorModel,Hn.None)).getTopLevelSymbols()}finally{o.dispose()}})});class $o extends Le{constructor(e,n){super(),this.contextKeyService=e,this.model=n,this.inlineCompletionVisible=$o.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=$o.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=$o.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=$o.suppressSuggestions.bindTo(this.contextKeyService),this._register(ur(r=>{const s=this.model.read(r),o=s==null?void 0:s.state.read(r),a=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.ghostText)!==void 0&&!(o!=null&&o.ghostText.isEmpty());this.inlineCompletionVisible.set(a),o!=null&&o.ghostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(ur(r=>{const s=this.model.read(r);let o=!1,a=!0;const l=s==null?void 0:s.ghostText.read(r);if(s!=null&&s.selectedSuggestItem&&l&&l.parts.length>0){const{column:c,lines:u}=l.parts[0],d=u[0],h=s.textModel.getLineIndentColumn(l.lineNumber);if(c<=h){let p=ml(d);p===-1&&(p=d.length-1),o=p>0;const g=s.textModel.getOptions().tabSize;a=ho.visibleColumnFromColumn(d,p+1,g)<g}}this.inlineCompletionSuggestsIndentation.set(o),this.inlineCompletionSuggestsIndentationLessThanTabSize.set(a)}))}}$o.inlineSuggestionVisible=new yt("inlineSuggestionVisible",!1,L("inlineSuggestionVisible","Whether an inline suggestion is visible"));$o.inlineSuggestionHasIndentation=new yt("inlineSuggestionHasIndentation",!1,L("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace"));$o.inlineSuggestionHasIndentationLessThanTabSize=new yt("inlineSuggestionHasIndentationLessThanTabSize",!0,L("inlineSuggestionHasIndentationLessThanTabSize","Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab"));$o.suppressSuggestions=new yt("inlineSuggestionSuppressSuggestions",void 0,L("suppressSuggestions","Whether suggestions should be suppressed for the current suggestion"));function wIt(i,e){const n=new CIt(i),r=e.map(s=>{const o=J.lift(s.range);return{startOffset:n.getOffset(o.getStartPosition()),endOffset:n.getOffset(o.getEndPosition()),text:s.text}});r.sort((s,o)=>o.startOffset-s.startOffset);for(const s of r)i=i.substring(0,s.startOffset)+s.text+i.substring(s.endOffset);return i}class CIt{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let n=0;n<e.length;n++)e.charAt(n)===`
`&&this.lineStartOffsetByLineIdx.push(n+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}const SIt=[];function xIt(){return SIt}class kIt{constructor(e,n){if(this.startColumn=e,this.endColumnExclusive=n,e>n)throw new Vs(`startColumn ${e} cannot be after endColumnExclusive ${n}`)}toRange(e){return new J(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function LIt(i,e){const n=new Xe,r=i.createDecorationsCollection();return n.add(Pae({debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);r.set(o)})),n.add({dispose:()=>{r.clear()}}),n}function vne(i,e){return new ve(i.lineNumber+e.lineNumber-1,e.lineNumber===1?i.column+e.column-1:e.column)}function bne(i){let e=1,n=1;for(const r of i)r===`
`?(e++,n=1):n++;return new ve(e,n)}class _j{constructor(e,n){this.lineNumber=e,this.parts=n}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((n,r)=>n.equals(e.parts[r]))}renderForScreenReader(e){if(this.parts.length===0)return"";const n=this.parts[this.parts.length-1],r=e.substr(0,n.column-1);return wIt(r,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join(`
`)}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,n)=>e+n.lines.length-1,0)}}class yne{constructor(e,n,r){this.column=e,this.lines=n,this.preview=r}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((n,r)=>n===e.lines[r])}}class wne{constructor(e,n,r,s=0){this.lineNumber=e,this.columnRange=n,this.newLines=r,this.additionalReservedLineCount=s,this.parts=[new yne(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join(`
`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((n,r)=>n===e.newLines[r])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function K0e(i,e){return i===e?!0:!i||!e?!1:i instanceof _j&&e instanceof _j||i instanceof wne&&e instanceof wne?i.equals(e):!1}var DIt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},EIt=function(i,e){return function(n,r){e(n,r,i)}};const G0e="ghost-text";let Cne=class extends Le{constructor(e,n,r){super(),this.editor=e,this.model=n,this.languageService=r,this.isDisposed=vr(this,!1),this.currentTextModel=oa(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=ni(this,s=>{if(this.isDisposed.read(s))return;const o=this.currentTextModel.read(s);if(o!==this.model.targetTextModel.read(s))return;const a=this.model.ghostText.read(s);if(!a)return;const l=a instanceof wne?a.columnRange:void 0,c=[],u=[];function d(m,_){if(u.length>0){const b=u[u.length-1];_&&b.decorations.push(new ru(b.content.length+1,b.content.length+1+m[0].length,_,0)),b.content+=m[0],m=m.slice(1)}for(const b of m)u.push({content:b,decorations:_?[new ru(1,b.length+1,_,0)]:[]})}const h=o.getLineContent(a.lineNumber);let f,p=0;for(const m of a.parts){let _=m.lines;f===void 0?(c.push({column:m.column,text:_[0],preview:m.preview}),_=_.slice(1)):d([h.substring(p,m.column-1)],void 0),_.length>0&&(d(_,G0e),f===void 0&&m.column<=h.length&&(f=m.column)),p=m.column-1}f!==void 0&&d([h.substring(p)],void 0);const g=f!==void 0?new kIt(f,h.length+1):void 0;return{replacedRange:l,inlineTexts:c,additionalLines:u,hiddenRange:g,lineNumber:a.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:o}}),this.decorations=ni(this,s=>{const o=this.uiState.read(s);if(!o)return[];const a=[];o.replacedRange&&a.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&a.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const l of o.inlineTexts)a.push({range:J.fromPositions(new ve(o.lineNumber,l.column)),options:{description:G0e,after:{content:l.text,inlineClassName:l.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Mp.Left},showIfCollapsed:!0}});return a}),this.additionalLinesWidget=this._register(new IIt(this.editor,this.languageService.languageIdCodec,ni(s=>{const o=this.uiState.read(s);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(gn(()=>{this.isDisposed.set(!0,void 0)})),this._register(LIt(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};Cne=DIt([EIt(2,Ar)],Cne);class IIt extends Le{get viewZoneId(){return this._viewZoneId}constructor(e,n,r){super(),this.editor=e,this.languageIdCodec=n,this.lines=r,this._viewZoneId=void 0,this.editorOptionsChanged=Ku("editorOptionChanged",_t.filter(this.editor.onDidChangeConfiguration,s=>s.hasChanged(33)||s.hasChanged(116)||s.hasChanged(98)||s.hasChanged(93)||s.hasChanged(51)||s.hasChanged(50)||s.hasChanged(66))),this._register(ur(s=>{const o=this.lines.read(s);this.editorOptionsChanged.read(s),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,n,r){const s=this.editor.getModel();if(!s)return;const{tabSize:o}=s.getOptions();this.editor.changeViewZones(a=>{this._viewZoneId&&(a.removeZone(this._viewZoneId),this._viewZoneId=void 0);const l=Math.max(n.length,r);if(l>0){const c=document.createElement("div");TIt(c,o,n,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=a.addZone({afterLineNumber:e,heightInLines:l,domNode:c,afterColumnAffinity:1})}})}}function TIt(i,e,n,r,s){const o=r.get(33),a=r.get(116),l="none",c=r.get(93),u=r.get(51),d=r.get(50),h=r.get(66),f=new jI(1e4);f.appendString('<div class="suggest-preview-text">');for(let m=0,_=n.length;m<_;m++){const b=n[m],y=b.content;f.appendString('<div class="view-line'),f.appendString('" style="top:'),f.appendString(String(m*h)),f.appendString('px;width:1000000px;">');const x=k5(y),k=TE(y),D=ko.createEmpty(y,s);T5(new X1(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,y,!1,x,k,0,D,b.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,a,l,c,u!==Uu.OFF,null),f),f.appendString("</div>")}f.appendString("</div>"),Ta(i,d);const p=f.build(),g=X0e?X0e.createHTML(p):p;i.innerHTML=g}const X0e=$v("editorGhostText",{createHTML:i=>i});function RIt(i,e){const n=new YIe,r=new QIe(n,u=>e.getLanguageConfiguration(u)),s=new ZIe(new AIt([i]),r),o=BJ(s,[],void 0,!0);let a="";const l=i.getLineContent();function c(u,d){if(u.kind===2)if(c(u.openingBracket,d),d=Jr(d,u.openingBracket.length),u.child&&(c(u.child,d),d=Jr(d,u.child.length)),u.closingBracket)c(u.closingBracket,d),d=Jr(d,u.closingBracket.length);else{const f=r.getSingleLanguageBracketTokens(u.openingBracket.languageId).findClosingTokenText(u.openingBracket.bracketIds);a+=f}else if(u.kind!==3){if(u.kind===0||u.kind===1)a+=l.substring(d,Jr(d,u.length));else if(u.kind===4)for(const h of u.children)c(h,d),d=Jr(d,h.length)}}return c(o,$l),a}class AIt{constructor(e){this.lines=e,this.tokenization={getLineTokens:n=>this.lines[n-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class tf{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let n=0,r=this.value.charCodeAt(e),s;if(s=tf._table[r],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(tf.isDigitCharacter(r)){s=8;do n+=1,r=this.value.charCodeAt(e+n);while(tf.isDigitCharacter(r));return this.pos+=n,{type:s,pos:e,len:n}}if(tf.isVariableCharacter(r)){s=9;do r=this.value.charCodeAt(e+ ++n);while(tf.isVariableCharacter(r)||tf.isDigitCharacter(r));return this.pos+=n,{type:s,pos:e,len:n}}s=10;do n+=1,r=this.value.charCodeAt(e+n);while(!isNaN(r)&&typeof tf._table[r]>"u"&&!tf.isDigitCharacter(r)&&!tf.isVariableCharacter(r));return this.pos+=n,{type:s,pos:e,len:n}}}tf._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class ZI{constructor(){this._children=[]}appendChild(e){return e instanceof Fl&&this._children[this._children.length-1]instanceof Fl?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,n){const{parent:r}=e,s=r.children.indexOf(e),o=r.children.slice(0);o.splice(s,1,...n),r._children=o,function a(l,c){for(const u of l)u.parent=c,a(u.children,u)}(n,r)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof a4)return e;e=e.parent}}toString(){return this.children.reduce((e,n)=>e+n.toString(),"")}len(){return 0}}class Fl extends ZI{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Fl(this.value)}}class AMe extends ZI{}class Qd extends AMe{static compareByIndex(e,n){return e.index===n.index?0:e.isFinalTabstop?1:n.isFinalTabstop||e.index<n.index?-1:e.index>n.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof QI?this._children[0]:void 0}clone(){const e=new Qd(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(n=>n.clone()),e}}class QI extends ZI{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Fl&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new QI;return this.options.forEach(e.appendChild,e),e}}let NIt=class NMe extends ZI{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const n=this;let r=!1,s=e.replace(this.regexp,function(){return r=!0,n._replace(Array.prototype.slice.call(arguments,0,-2))});return!r&&this._children.some(o=>o instanceof yp&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let n="";for(const r of this._children)if(r instanceof yp){let s=e[r.index]||"";s=r.resolve(s),n+=s}else n+=r.toString();return n}toString(){return""}clone(){const e=new NMe;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(n=>n.clone()),e}};class yp extends ZI{constructor(e,n,r,s){super(),this.index=e,this.shorthandName=n,this.ifValue=r,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const n=e.match(/[a-z0-9]+/gi);return n?n.map(r=>r.charAt(0).toUpperCase()+r.substr(1)).join(""):e}_toCamelCase(e){const n=e.match(/[a-z0-9]+/gi);return n?n.map((r,s)=>s===0?r.charAt(0).toLowerCase()+r.substr(1):r.charAt(0).toUpperCase()+r.substr(1)).join(""):e}clone(){return new yp(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class gO extends AMe{constructor(e){super(),this.name=e}resolve(e){let n=e.resolve(this);return this.transform&&(n=this.transform.resolve(n||"")),n!==void 0?(this._children=[new Fl(n)],!0):!1}clone(){const e=new gO(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(n=>n.clone()),e}}function Y0e(i,e){const n=[...i];for(;n.length>0;){const r=n.shift();if(!e(r))break;n.unshift(...r.children)}}class a4 extends ZI{get placeholderInfo(){if(!this._placeholders){const e=[];let n;this.walk(function(r){return r instanceof Qd&&(e.push(r),n=!n||n.index<r.index?r:n),!0}),this._placeholders={all:e,last:n}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let n=0,r=!1;return this.walk(s=>s===e?(r=!0,!1):(n+=s.len(),!0)),r?n:-1}fullLen(e){let n=0;return Y0e([e],r=>(n+=r.len(),!0)),n}enclosingPlaceholders(e){const n=[];let{parent:r}=e;for(;r;)r instanceof Qd&&n.push(r),r=r.parent;return n}resolveVariables(e){return this.walk(n=>(n instanceof gO&&n.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,n){return this._placeholders=void 0,super.replace(e,n)}clone(){const e=new a4;return this._children=this.children.map(n=>n.clone()),e}walk(e){Y0e(this.children,e)}}class dI{constructor(){this._scanner=new tf,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,n,r){const s=new a4;return this.parseFragment(e,s),this.ensureFinalTabstop(s,r??!1,n??!1),s}parseFragment(e,n){const r=n.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(n););const s=new Map,o=[];n.walk(c=>(c instanceof Qd&&(c.isFinalTabstop?s.set(0,void 0):!s.has(c.index)&&c.children.length>0?s.set(c.index,c.children):o.push(c)),!0));const a=(c,u)=>{const d=s.get(c.index);if(!d)return;const h=new Qd(c.index);h.transform=c.transform;for(const f of d){const p=f.clone();h.appendChild(p),p instanceof Qd&&s.has(p.index)&&!u.has(p.index)&&(u.add(p.index),a(p,u),u.delete(p.index))}n.replace(c,[h])},l=new Set;for(const c of o)a(c,l);return n.children.slice(r)}ensureFinalTabstop(e,n,r){(n||r&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Qd(0)))}_accept(e,n){if(e===void 0||this._token.type===e){const r=n?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),r}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const n=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const s=this._scanner.next();if(s.type!==0&&s.type!==4&&s.type!==5)return!1}this._token=this._scanner.next()}const r=this._scanner.value.substring(n.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),r}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let n;return(n=this._accept(5,!0))?(n=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||n,e.appendChild(new Fl(n)),!0):!1}_parseTabstopOrVariableName(e){let n;const r=this._token;return this._accept(0)&&(n=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(n)?new Qd(Number(n)):new gO(n)),!0):this._backTo(r)}_parseComplexPlaceholder(e){let n;const r=this._token;if(!(this._accept(0)&&this._accept(3)&&(n=this._accept(8,!0))))return this._backTo(r);const o=new Qd(Number(n));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Fl("${"+n+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const a=new QI;for(;;){if(this._parseChoiceElement(a)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(a),this._accept(4)))return e.appendChild(o),!0}return this._backTo(r),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(r),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(r)}_parseChoiceElement(e){const n=this._token,r=[];for(;!(this._token.type===2||this._token.type===7);){let s;if((s=this._accept(5,!0))?s=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(n),!1;r.push(s)}return r.length===0?(this._backTo(n),!1):(e.appendChild(new Fl(r.join(""))),!0)}_parseComplexVariable(e){let n;const r=this._token;if(!(this._accept(0)&&this._accept(3)&&(n=this._accept(9,!0))))return this._backTo(r);const o=new gO(n);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Fl("${"+n+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(r),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(r)}_parseTransform(e){const n=new NIt;let r="",s="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,r+=o;continue}if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,n.appendChild(new Fl(o));continue}if(!(this._parseFormatString(n)||this._parseAnything(n)))return!1}for(;!this._accept(4);){if(this._token.type!==14){s+=this._accept(void 0,!0);continue}return!1}try{n.regexp=new RegExp(r,s)}catch{return!1}return e.transform=n,!0}_parseFormatString(e){const n=this._token;if(!this._accept(0))return!1;let r=!1;this._accept(3)&&(r=!0);const s=this._accept(8,!0);if(s)if(r){if(this._accept(4))return e.appendChild(new yp(Number(s))),!0;if(!this._accept(1))return this._backTo(n),!1}else return e.appendChild(new yp(Number(s))),!0;else return this._backTo(n),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(n),!1):(e.appendChild(new yp(Number(s),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new yp(Number(s),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new yp(Number(s),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const a=this._until(4);if(a)return e.appendChild(new yp(Number(s),void 0,o,a)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new yp(Number(s),void 0,void 0,o)),!0}return this._backTo(n),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Fl(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var LK=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function MIt(i,e,n,r,s=Hn.None,o){return LK(this,void 0,void 0,function*(){const a=FIt(e,n),l=i.all(n),c=new roe;for(const b of l)b.groupId&&c.add(b.groupId,b);function u(b){if(!b.yieldsToGroupIds)return[];const y=[];for(const x of b.yieldsToGroupIds||[]){const k=c.get(x);for(const D of k)y.push(D)}return y}const d=new Map,h=new Set;function f(b,y){if(y=[...y,b],h.has(b))return y;h.add(b);try{const x=u(b);for(const k of x){const D=f(k,y);if(D)return D}}finally{h.delete(b)}}function p(b){const y=d.get(b);if(y)return y;const x=f(b,[]);x&&Us(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${x.map(D=>D.toString?D.toString():""+D).join(" -> ")}`));const k=new f$;return d.set(b,k.p),LK(this,void 0,void 0,function*(){if(!x){const D=u(b);for(const R of D){const E=yield p(R);if(E&&E.items.length>0)return}}try{return yield b.provideInlineCompletions(n,e,r,s)}catch(D){Us(D);return}}).then(D=>k.complete(D),D=>k.error(D)),k.p}const g=yield Promise.all(l.map(b=>LK(this,void 0,void 0,function*(){return{provider:b,completions:yield p(b)}}))),m=new Map,_=[];for(const b of g){const y=b.completions;if(!y)continue;const x=new OIt(y,b.provider);_.push(x);for(const k of y.items){const D=vj.from(k,x,a,n,o);m.set(D.hash(),D)}}return new PIt(Array.from(m.values()),new Set(m.keys()),_)})}class PIt{constructor(e,n,r){this.completions=e,this.hashs=n,this.providerResults=r}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class OIt{constructor(e,n){this.inlineCompletions=e,this.provider=n,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class vj{static from(e,n,r,s,o){let a,l,c=e.range?J.lift(e.range):r;if(typeof e.insertText=="string"){if(a=e.insertText,o&&e.completeBracketPairs){a=Z0e(a,c.getStartPosition(),s,o);const u=a.length-e.insertText.length;u!==0&&(c=new J(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+u))}l=void 0}else if("snippet"in e.insertText){const u=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=Z0e(e.insertText.snippet,c.getStartPosition(),s,o);const h=e.insertText.snippet.length-u;h!==0&&(c=new J(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+h))}const d=new dI().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof Fl?(a=d.children[0].value,l=void 0):(a=d.toString(),l={snippet:e.insertText.snippet,range:c})}else l$(e.insertText);return new vj(a,e.command,c,a,l,e.additionalTextEdits||xIt(),e,n)}constructor(e,n,r,s,o,a,l,c){this.filterText=e,this.command=n,this.range=r,this.insertText=s,this.snippetInfo=o,this.additionalTextEdits=a,this.sourceInlineCompletion=l,this.source=c,e=e.replace(/\r\n|\r/g,`
`),s=e.replace(/\r\n|\r/g,`
`)}withRange(e){return new vj(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function FIt(i,e){const n=e.getWordAtPosition(i),r=e.getLineMaxColumn(i.lineNumber);return n?new J(i.lineNumber,n.startColumn,i.lineNumber,r):J.fromPositions(i,i.with(void 0,r))}function Z0e(i,e,n,r){const o=n.getLineContent(e.lineNumber).substring(0,e.column-1)+i,a=n.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),i),l=a==null?void 0:a.sliceAndInflate(e.column-1,o.length,0);return l?RIt(l,r):i}class hI{constructor(e,n){this.range=e,this.text=n}removeCommonPrefix(e,n){const r=n?this.range.intersectRanges(n):this.range;if(!r)return this;const s=e.getValueInRange(r,1),o=ax(s,this.text),a=vne(this.range.getStartPosition(),bne(s.substring(0,o))),l=this.text.substring(o),c=J.fromPositions(a,this.range.getEndPosition());return new hI(c,l)}augments(e){return this.text.startsWith(e.text)&&BIt(this.range,e.range)}computeGhostText(e,n,r,s=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const a=e.getLineContent(o.range.startLineNumber),l=ar(a).length;if(o.range.startColumn-1<=l){const g=ar(o.text).length,m=a.substring(o.range.startColumn-1,l),[_,b]=[o.range.getStartPosition(),o.range.getEndPosition()],y=_.column+m.length<=b.column?_.delta(0,m.length):b,x=J.fromPositions(y,b),k=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(g);o=new hI(x,k)}const u=e.getValueInRange(o.range),d=jIt(u,o.text);if(!d)return;const h=o.range.startLineNumber,f=new Array;if(n==="prefix"){const g=d.filter(m=>m.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==u.length)return}const p=o.text.length-s;for(const g of d){const m=o.range.startColumn+g.originalStart+g.originalLength;if(n==="subwordSmart"&&r&&r.lineNumber===o.range.startLineNumber&&m<r.column||g.originalLength>0)return;if(g.modifiedLength===0)continue;const _=g.modifiedStart+g.modifiedLength,b=Math.max(g.modifiedStart,Math.min(_,p)),y=o.text.substring(g.modifiedStart,b),x=o.text.substring(b,Math.max(g.modifiedStart,_));if(y.length>0){const k=Km(y);f.push(new yne(m,k,!1))}if(x.length>0){const k=Km(x);f.push(new yne(m,k,!0))}}return new _j(h,f)}}function BIt(i,e){return e.getStartPosition().equals(i.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(i.getEndPosition())}let $g;function jIt(i,e){if(($g==null?void 0:$g.originalValue)===i&&($g==null?void 0:$g.newValue)===e)return $g==null?void 0:$g.changes;{let n=J0e(i,e,!0);if(n){const r=Q0e(n);if(r>0){const s=J0e(i,e,!1);s&&Q0e(s)<r&&(n=s)}}return $g={originalValue:i,newValue:e,changes:n},n}}function Q0e(i){let e=0;for(const n of i)e+=n.originalLength;return e}function J0e(i,e,n){if(i.length>5e3||e.length>5e3)return;function r(u){let d=0;for(let h=0,f=u.length;h<f;h++){const p=u.charCodeAt(h);p>d&&(d=p)}return d}const s=Math.max(r(i),r(e));function o(u){if(u<0)throw new Error("unexpected");return s+u+1}function a(u){let d=0,h=0;const f=new Int32Array(u.length);for(let p=0,g=u.length;p<g;p++)if(n&&u[p]==="("){const m=h*100+d;f[p]=o(2*m),d++}else if(n&&u[p]===")"){d=Math.max(d-1,0);const m=h*100+d;f[p]=o(2*m+1),d===0&&h++}else f[p]=u.charCodeAt(p);return f}const l=a(i),c=a(e);return new cm({getElements:()=>l},{getElements:()=>c}).ComputeDiff(!1).changes}var WIt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},eve=function(i,e){return function(n,r){e(n,r,i)}},$It=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let Sne=class extends Le{constructor(e,n,r,s,o){super(),this.textModel=e,this.versionId=n,this._debounceValue=r,this.languageFeaturesService=s,this.languageConfigurationService=o,this._updateOperation=this._register(new ha),this.inlineCompletions=q7("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=q7("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,n,r){var s,o;const a=new VIt(e,n,this.textModel.getVersionId()),l=n.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((s=this._updateOperation.value)===null||s===void 0)&&s.request.satisfies(a))return this._updateOperation.value.promise;if(!((o=l.get())===null||o===void 0)&&o.request.satisfies(a))return Promise.resolve(!0);const c=!!this._updateOperation.value;this._updateOperation.clear();const u=new Ns,d=$It(this,void 0,void 0,function*(){if((c||n.triggerKind===pv.Automatic)&&(yield zIt(this._debounceValue.get(this.textModel))),u.token.isCancellationRequested||this.textModel.getVersionId()!==a.versionId)return!1;const p=new Date,g=yield MIt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,n,u.token,this.languageConfigurationService);if(u.token.isCancellationRequested||this.textModel.getVersionId()!==a.versionId)return!1;const m=new Date;this._debounceValue.update(this.textModel,m.getTime()-p.getTime());const _=new qIt(g,a,this.textModel,this.versionId);if(r){const b=r.toInlineCompletion(void 0);r.canBeReused(this.textModel,e)&&!g.has(b)&&_.prepend(r.inlineCompletion,b.range,!0)}return this._updateOperation.clear(),Pr(b=>{l.set(_,b)}),!0}),h=new UIt(a,u,d);return this._updateOperation.value=h,d}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var n;!((n=this._updateOperation.value)===null||n===void 0)&&n.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};Sne=WIt([eve(3,Et),eve(4,dr)],Sne);function zIt(i,e){return new Promise(n=>{setTimeout(()=>{n()},i)})}class VIt{constructor(e,n,r){this.position=e,this.context=n,this.versionId=r}satisfies(e){return this.position.equals(e.position)&&HIt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(n,r)=>n.equals(r))&&(e.context.triggerKind===pv.Automatic||this.context.triggerKind===pv.Explicit)&&this.versionId===e.versionId}}function HIt(i,e,n){return!i||!e?i===e:n(i,e)}class UIt{constructor(e,n,r){this.request=e,this.cancellationTokenSource=n,this.promise=r}dispose(){this.cancellationTokenSource.cancel()}}class qIt{get inlineCompletions(){return this._inlineCompletions}constructor(e,n,r,s){this.inlineCompletionProviderResult=e,this.request=n,this.textModel=r,this.versionId=s,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=ni(this,a=>{this.versionId.read(a);let l=!1;for(const c of this._inlineCompletions)l=l||c._updateRange(this.textModel);return l&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const o=r.deltaDecorations([],e.completions.map(a=>({range:a.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((a,l)=>new tve(a,o[l],this._rangeVersionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,n,r){r&&e.source.addRef();const s=this.textModel.deltaDecorations([],[{range:n,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new tve(e,s,this._rangeVersionId,n)),this._prependedInlineCompletionItems.push(e)}}class tve{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,n,r,s){this.inlineCompletion=e,this.decorationId=n,this.rangeVersion=r,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=s??e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new hI(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,n,r){const s=this._toFilterTextReplacement(r).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(r).getStartPosition())||n.lineNumber!==s.range.startLineNumber)return!1;const o=e.getValueInRange(s.range,1).toLowerCase(),a=s.text.toLowerCase(),l=Math.max(0,n.column-s.range.startColumn);let c=a.substring(0,l),u=a.substring(l),d=o.substring(0,l),h=o.substring(l);const f=e.getLineIndentColumn(s.range.startLineNumber);return s.range.startColumn<=f&&(d=d.trimStart(),d.length===0&&(h=h.trimStart()),c=c.trimStart(),c.length===0&&(u=u.trimStart())),c.startsWith(d)&&!!jTe(h,u)}canBeReused(e,n){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(n)&&this.isVisible(e,n,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new hI(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return nve(this._getUpdatedRange(e)).isBefore(nve(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const n=e.getDecorationRange(this.decorationId);return n?this._updatedRange.equalsRange(n)?!1:(this._updatedRange=n,!0):(this._isValid=!1,!0)}}function nve(i){return i.startLineNumber===i.endLineNumber?new ve(1,1+i.endColumn-i.startColumn):new ve(1+i.endLineNumber-i.startLineNumber,i.endColumn)}var xM=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const Tn={Visible:mle,HasFocusedSuggestion:new yt("suggestWidgetHasFocusedSuggestion",!1,L("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new yt("suggestWidgetDetailsVisible",!1,L("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new yt("suggestWidgetMultipleSuggestions",!1,L("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new yt("suggestionMakesTextEdit",!0,L("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new yt("acceptSuggestionOnEnter",!0,L("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new yt("suggestionHasInsertAndReplaceRange",!1,L("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new yt("suggestionInsertMode",void 0,{type:"string",description:L("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new yt("suggestionCanResolve",!1,L("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Qy=new se("suggestWidgetStatusBar");class KIt{constructor(e,n,r,s){var o;this.position=e,this.completion=n,this.container=r,this.provider=s,this.isInvalid=!1,this.score=Hp.Default,this.distance=0,this.textLabel=typeof n.label=="string"?n.label:(o=n.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=n.sortText&&n.sortText.toLowerCase(),this.filterTextLow=n.filterText&&n.filterText.toLowerCase(),this.extensionId=n.extensionId,J.isIRange(n.range)?(this.editStart=new ve(n.range.startLineNumber,n.range.startColumn),this.editInsertEnd=new ve(n.range.endLineNumber,n.range.endColumn),this.editReplaceEnd=new ve(n.range.endLineNumber,n.range.endColumn),this.isInvalid=this.isInvalid||J.spansMultipleLines(n.range)||n.range.startLineNumber!==e.lineNumber):(this.editStart=new ve(n.range.insert.startLineNumber,n.range.insert.startColumn),this.editInsertEnd=new ve(n.range.insert.endLineNumber,n.range.insert.endColumn),this.editReplaceEnd=new ve(n.range.replace.endLineNumber,n.range.replace.endColumn),this.isInvalid=this.isInvalid||J.spansMultipleLines(n.range.insert)||J.spansMultipleLines(n.range.replace)||n.range.insert.startLineNumber!==e.lineNumber||n.range.replace.startLineNumber!==e.lineNumber||n.range.insert.startColumn!==n.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}resolve(e){return xM(this,void 0,void 0,function*(){if(!this._resolveCache){const n=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),r=new Xa(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(s=>{Object.assign(this.completion,s),this._resolveDuration=r.elapsed()},s=>{sg(s)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{n.dispose()})}return this._resolveCache})}}class mO{constructor(e=2,n=new Set,r=new Set,s=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=n,this.providerFilter=r,this.providerItemsToReuse=s,this.showDeprecated=o}}mO.default=new mO;let GIt;function XIt(){return GIt}class YIt{constructor(e,n,r,s){this.items=e,this.needsClipboard=n,this.durations=r,this.disposable=s}}function xle(i,e,n,r=mO.default,s={triggerKind:0},o=Hn.None){return xM(this,void 0,void 0,function*(){const a=new Xa;n=n.clone();const l=e.getWordAtPosition(n),c=l?new J(n.lineNumber,l.startColumn,n.lineNumber,l.endColumn):J.fromPositions(n),u={replace:c,insert:c.setEndPosition(n.lineNumber,n.column)},d=[],h=new Xe,f=[];let p=!1;const g=(_,b,y)=>{var x,k,D;let R=!1;if(!b)return R;for(const E of b.suggestions)if(!r.kindFilter.has(E.kind)){if(!r.showDeprecated&&(!((x=E==null?void 0:E.tags)===null||x===void 0)&&x.includes(1)))continue;E.range||(E.range=u),E.sortText||(E.sortText=typeof E.label=="string"?E.label:E.label.label),!p&&E.insertTextRules&&E.insertTextRules&4&&(p=dI.guessNeedsClipboard(E.insertText)),d.push(new KIt(n,E,b,_)),R=!0}return Ase(b)&&h.add(b),f.push({providerName:(k=_._debugDisplayName)!==null&&k!==void 0?k:"unknown_provider",elapsedProvider:(D=b.duration)!==null&&D!==void 0?D:-1,elapsedOverall:y.elapsed()}),R},m=xM(this,void 0,void 0,function*(){});for(const _ of i.orderedGroups(e)){let b=!1;if(yield Promise.all(_.map(y=>xM(this,void 0,void 0,function*(){if(r.providerItemsToReuse.has(y)){const x=r.providerItemsToReuse.get(y);x.forEach(k=>d.push(k)),b=b||x.length>0;return}if(!(r.providerFilter.size>0&&!r.providerFilter.has(y)))try{const x=new Xa,k=yield y.provideCompletionItems(e,n,s,o);b=g(y,k,x)||b}catch(x){Us(x)}}))),b||o.isCancellationRequested)break}return yield m,o.isCancellationRequested?(h.dispose(),Promise.reject(new U1)):new YIt(d.sort(JIt(r.snippetSortOrder)),p,{entries:f,elapsed:a.elapsed()},h)})}function kle(i,e){if(i.sortTextLow&&e.sortTextLow){if(i.sortTextLow<e.sortTextLow)return-1;if(i.sortTextLow>e.sortTextLow)return 1}return i.textLabel<e.textLabel?-1:i.textLabel>e.textLabel?1:i.completion.kind-e.completion.kind}function ZIt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return kle(i,e)}function QIt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return kle(i,e)}const Bz=new Map;Bz.set(0,ZIt);Bz.set(2,QIt);Bz.set(1,kle);function JIt(i){return Bz.get(i)}si.registerCommand("_executeCompletionItemProvider",(i,...e)=>xM(void 0,void 0,void 0,function*(){const[n,r,s,o]=e;Ui(Jt.isUri(n)),Ui(ve.isIPosition(r)),Ui(typeof s=="string"||!s),Ui(typeof o=="number"||!o);const{completionProvider:a}=i.get(Et),l=yield i.get(Ec).createModelReference(n);try{const c={incomplete:!1,suggestions:[]},u=[],d=l.object.textEditorModel.validatePosition(r),h=yield xle(a,l.object.textEditorModel,d,void 0,{triggerCharacter:s??void 0,triggerKind:s?1:0});for(const f of h.items)u.length<(o??0)&&u.push(f.resolve(Hn.None)),c.incomplete=c.incomplete||f.container.incomplete,c.suggestions.push(f.completion);try{return yield Promise.all(u),c}finally{setTimeout(()=>h.disposable.dispose(),100)}}finally{l.dispose()}}));function eTt(i,e){var n;(n=i.getContribution("editor.contrib.suggestController"))===null||n===void 0||n.triggerSuggest(new Set().add(e),void 0,!0)}class k2{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,n){switch(n){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}function ive(i,e=Aa){return Kgt(i,e)?i.charAt(0).toUpperCase()+i.slice(1):i}var tTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},nTt=function(i,e){return function(n,r){e(n,r,i)}};class rve{constructor(e){this._delegates=e}resolve(e){for(const n of this._delegates){const r=n.resolve(e);if(r!==void 0)return r}}}class sve{constructor(e,n,r,s){this._model=e,this._selection=n,this._selectionIdx=r,this._overtypingCapturer=s}resolve(e){const{name:n}=e;if(n==="SELECTION"||n==="TM_SELECTED_TEXT"){let r=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!r&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(r=o.value,s=o.multiline)}if(r&&s&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),a=ar(o,0,this._selection.startColumn-1);let l=a;e.snippet.walk(u=>u===e?!1:(u instanceof Fl&&(l=ar(Km(u.value).pop())),!0));const c=ax(l,a);r=r.replace(/(\r\n|\r|\n)(.*)/g,(u,d,h)=>`${d}${l.substr(c)}${h}`)}return r}else{if(n==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(n==="TM_CURRENT_WORD"){const r=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return r&&r.word||void 0}else{if(n==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(n==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(n==="CURSOR_INDEX")return String(this._selectionIdx);if(n==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class ove{constructor(e,n){this._labelService=e,this._model=n}resolve(e){const{name:n}=e;if(n==="TM_FILENAME")return jy(this._model.uri.fsPath);if(n==="TM_FILENAME_BASE"){const r=jy(this._model.uri.fsPath),s=r.lastIndexOf(".");return s<=0?r:r.slice(0,s)}else{if(n==="TM_DIRECTORY")return W2e(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(M$(this._model.uri));if(n==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(n==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class ave{constructor(e,n,r,s){this._readClipboardText=e,this._selectionIdx=n,this._selectionCount=r,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const n=this._readClipboardText();if(n){if(this._spread){const r=n.split(/\r\n|\n|\r/).filter(s=>!K2e(s));if(r.length===this._selectionCount)return r[this._selectionIdx]}return n}}}let bj=class{constructor(e,n,r){this._model=e,this._selection=n,this._languageConfigurationService=r}resolve(e){const{name:n}=e,r=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=this._languageConfigurationService.getLanguageConfiguration(r).comments;if(s){if(n==="LINE_COMMENT")return s.lineCommentToken||void 0;if(n==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(n==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}};bj=tTt([nTt(2,dr)],bj);class Pp{constructor(){this._date=new Date}resolve(e){const{name:n}=e;if(n==="CURRENT_YEAR")return String(this._date.getFullYear());if(n==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(n==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(n==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(n==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(n==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(n==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(n==="CURRENT_DAY_NAME")return Pp.dayNames[this._date.getDay()];if(n==="CURRENT_DAY_NAME_SHORT")return Pp.dayNamesShort[this._date.getDay()];if(n==="CURRENT_MONTH_NAME")return Pp.monthNames[this._date.getMonth()];if(n==="CURRENT_MONTH_NAME_SHORT")return Pp.monthNamesShort[this._date.getMonth()];if(n==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(n==="CURRENT_TIMEZONE_OFFSET"){const r=this._date.getTimezoneOffset(),s=r>0?"-":"+",o=Math.trunc(Math.abs(r/60)),a=o<10?"0"+o:o,l=Math.abs(r)-o*60,c=l<10?"0"+l:l;return s+a+":"+c}}}Pp.dayNames=[L("Sunday","Sunday"),L("Monday","Monday"),L("Tuesday","Tuesday"),L("Wednesday","Wednesday"),L("Thursday","Thursday"),L("Friday","Friday"),L("Saturday","Saturday")];Pp.dayNamesShort=[L("SundayShort","Sun"),L("MondayShort","Mon"),L("TuesdayShort","Tue"),L("WednesdayShort","Wed"),L("ThursdayShort","Thu"),L("FridayShort","Fri"),L("SaturdayShort","Sat")];Pp.monthNames=[L("January","January"),L("February","February"),L("March","March"),L("April","April"),L("May","May"),L("June","June"),L("July","July"),L("August","August"),L("September","September"),L("October","October"),L("November","November"),L("December","December")];Pp.monthNamesShort=[L("JanuaryShort","Jan"),L("FebruaryShort","Feb"),L("MarchShort","Mar"),L("AprilShort","Apr"),L("MayShort","May"),L("JuneShort","Jun"),L("JulyShort","Jul"),L("AugustShort","Aug"),L("SeptemberShort","Sep"),L("OctoberShort","Oct"),L("NovemberShort","Nov"),L("DecemberShort","Dec")];class lve{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const n=avt(this._workspaceService.getWorkspace());if(!svt(n)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(n);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(n)}}_resolveWorkspaceName(e){if(oee(e))return jy(e.uri.path);let n=jy(e.configPath.path);return n.endsWith(aee)&&(n=n.substr(0,n.length-aee.length-1)),n}_resoveWorkspacePath(e){if(oee(e))return ive(e.uri.fsPath);const n=jy(e.configPath.path);let r=e.configPath.fsPath;return r.endsWith(n)&&(r=r.substr(0,r.length-n.length-1)),r?ive(r):"/"}}class cve{resolve(e){const{name:n}=e;if(n==="RANDOM")return Math.random().toString().slice(-6);if(n==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(n==="UUID")return Iz()}}var iTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},rTt=function(i,e){return function(n,r){e(n,r,i)}},dp;class Hd{constructor(e,n,r){this._editor=e,this._snippet=n,this._snippetLineLeadingWhitespace=r,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Nfe(n.placeholders,Qd.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(n=>{for(const r of this._snippet.placeholders){const s=this._snippet.offset(r),o=this._snippet.fullLen(r),a=J.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+o)),l=r.isFinalTabstop?Hd._decor.inactiveFinal:Hd._decor.inactive,c=n.addDecoration(a,l);this._placeholderDecorations.set(r,c)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const s=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const a=this._placeholderDecorations.get(o),l=this._editor.getModel().getDecorationRange(a),c=this._editor.getModel().getValueInRange(l),u=o.transform.resolve(c).split(/\r\n|\r|\n/);for(let d=1;d<u.length;d++)u[d]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+u[d]);s.push(Vr.replace(l,u.join(this._editor.getModel().getEOL())))}s.length>0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let n=!1;e===!0&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,n=!0):e===!1&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,n=!0);const r=this._editor.getModel().changeDecorations(s=>{const o=new Set,a=[];for(const l of this._placeholderGroups[this._placeholderGroupsIdx]){const c=this._placeholderDecorations.get(l),u=this._editor.getModel().getDecorationRange(c);a.push(new Ft(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn)),n=n&&this._hasPlaceholderBeenCollapsed(l),s.changeDecorationOptions(c,l.isFinalTabstop?Hd._decor.activeFinal:Hd._decor.active),o.add(l);for(const d of this._snippet.enclosingPlaceholders(l)){const h=this._placeholderDecorations.get(d);s.changeDecorationOptions(h,d.isFinalTabstop?Hd._decor.activeFinal:Hd._decor.active),o.add(d)}}for(const[l,c]of this._placeholderDecorations)o.has(l)||s.changeDecorationOptions(c,l.isFinalTabstop?Hd._decor.inactiveFinal:Hd._decor.inactive);return a});return n?this.move(e):r??[]}_hasPlaceholderBeenCollapsed(e){let n=e;for(;n;){if(n instanceof Qd){const r=this._placeholderDecorations.get(n);if(this._editor.getModel().getDecorationRange(r).isEmpty()&&n.toString().length>0)return!0}n=n.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const n of this._placeholderGroups){let r;for(const s of n){if(s.isFinalTabstop)break;r||(r=[],e.set(s.index,r));const o=this._placeholderDecorations.get(s),a=this._editor.getModel().getDecorationRange(o);if(!a){e.delete(s.index);break}r.push(a)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const n=this._placeholderDecorations.get(e);if(!n)return;const r=this._editor.getModel().getDecorationRange(n);if(r)return{range:r,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(n=>(e=n instanceof QI,!e)),e}merge(e){const n=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(r=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const a=o._snippet.placeholderInfo.last.index;for(const c of o._snippet.placeholderInfo.all)c.isFinalTabstop?c.index=s.index+(a+1)/this._nestingLevel:c.index=s.index+c.index/this._nestingLevel;this._snippet.replace(s,o._snippet.children);const l=this._placeholderDecorations.get(s);r.removeDecoration(l),this._placeholderDecorations.delete(s);for(const c of o._snippet.placeholders){const u=o._snippet.offset(c),d=o._snippet.fullLen(c),h=J.fromPositions(n.getPositionAt(o._offset+u),n.getPositionAt(o._offset+u+d)),f=r.addDecoration(h,Hd._decor.inactive);this._placeholderDecorations.set(c,f)}}this._placeholderGroups=Nfe(this._snippet.placeholders,Qd.compareByIndex)})}}Hd._decor={active:kn.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:kn.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:kn.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:kn.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const uve={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let yj=dp=class{static adjustWhitespace(e,n,r,s,o){const a=e.getLineContent(n.lineNumber),l=ar(a,0,n.column-1);let c;return s.walk(u=>{if(!(u instanceof Fl)||u.parent instanceof QI||o&&!o.has(u))return!0;const d=u.value.split(/\r\n|\r|\n/);if(r){const f=s.offset(u);if(f===0)d[0]=e.normalizeIndentation(d[0]);else{c=c??s.toString();const p=c.charCodeAt(f-1);(p===10||p===13)&&(d[0]=e.normalizeIndentation(l+d[0]))}for(let p=1;p<d.length;p++)d[p]=e.normalizeIndentation(l+d[p])}const h=d.join(e.getEOL());return h!==u.value&&(u.parent.replace(u,[new Fl(h)]),c=void 0),!0}),l}static adjustSelection(e,n,r,s){if(r!==0||s!==0){const{positionLineNumber:o,positionColumn:a}=n,l=a-r,c=a+s,u=e.validateRange({startLineNumber:o,startColumn:l,endLineNumber:o,endColumn:c});n=Ft.createWithDirection(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn,n.getDirection())}return n}static createEditsAndSnippetsFromSelections(e,n,r,s,o,a,l,c,u){const d=[],h=[];if(!e.hasModel())return{edits:d,snippets:h};const f=e.getModel(),p=e.invokeWithinContext(k=>k.get(px)),g=e.invokeWithinContext(k=>new ove(k.get(KE),f)),m=()=>l,_=f.getValueInRange(dp.adjustSelection(f,e.getSelection(),r,0)),b=f.getValueInRange(dp.adjustSelection(f,e.getSelection(),0,s)),y=f.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),x=e.getSelections().map((k,D)=>({selection:k,idx:D})).sort((k,D)=>J.compareRangesUsingStarts(k.selection,D.selection));for(const{selection:k,idx:D}of x){let R=dp.adjustSelection(f,k,r,0),E=dp.adjustSelection(f,k,0,s);_!==f.getValueInRange(R)&&(R=k),b!==f.getValueInRange(E)&&(E=k);const A=k.setStartPosition(R.startLineNumber,R.startColumn).setEndPosition(E.endLineNumber,E.endColumn),M=new dI().parse(n,!0,o),N=A.getStartPosition(),P=dp.adjustWhitespace(f,N,a||D>0&&y!==f.getLineFirstNonWhitespaceColumn(k.positionLineNumber),M);M.resolveVariables(new rve([g,new ave(m,D,x.length,e.getOption(78)==="spread"),new sve(f,k,D,c),new bj(f,k,u),new Pp,new lve(p),new cve])),d[D]=Vr.replace(A,M.toString()),d[D].identifier={major:D,minor:0},d[D]._isTracked=!0,h[D]=new Hd(e,M,P)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,n,r,s,o,a,l){if(!e.hasModel()||n.length===0)return{edits:[],snippets:[]};const c=[],u=e.getModel(),d=new dI,h=new a4,f=new rve([e.invokeWithinContext(g=>new ove(g.get(KE),u)),new ave(()=>o,0,e.getSelections().length,e.getOption(78)==="spread"),new sve(u,e.getSelection(),0,a),new bj(u,e.getSelection(),l),new Pp,new lve(e.invokeWithinContext(g=>g.get(px))),new cve]);n=n.sort((g,m)=>J.compareRangesUsingStarts(g.range,m.range));let p=0;for(let g=0;g<n.length;g++){const{range:m,template:_}=n[g];if(g>0){const D=n[g-1].range,R=J.fromPositions(D.getEndPosition(),m.getStartPosition()),E=new Fl(u.getValueInRange(R));h.appendChild(E),p+=E.value.length}const b=d.parseFragment(_,h);dp.adjustWhitespace(u,m.getStartPosition(),!0,h,new Set(b)),h.resolveVariables(f);const y=h.toString(),x=y.slice(p);p=y.length;const k=Vr.replace(m,x);k.identifier={major:g,minor:0},k._isTracked=!0,c.push(k)}return d.ensureFinalTabstop(h,r,!0),{edits:c,snippets:[new Hd(e,h,"")]}}constructor(e,n,r=uve,s){this._editor=e,this._template=n,this._options=r,this._languageConfigurationService=s,this._templateMerges=[],this._snippets=[]}dispose(){Mi(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:n}=typeof this._template=="string"?dp.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):dp.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=n,this._editor.executeEdits("snippet",e,r=>{const s=r.filter(o=>!!o.identifier);for(let o=0;o<n.length;o++)n[o].initialize(s[o].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):s.map(o=>Ft.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,n=uve){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:r,snippets:s}=dp.createEditsAndSnippetsFromSelections(this._editor,e,n.overwriteBefore,n.overwriteAfter,!0,n.adjustWhitespace,n.clipboardText,n.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",r,o=>{const a=o.filter(c=>!!c.identifier);for(let c=0;c<s.length;c++)s[c].initialize(a[c].textChange);const l=s[0].isTrivialSnippet;if(!l){for(const c of this._snippets)c.merge(s);console.assert(s.length===0)}return this._snippets[0].hasPlaceholder&&!l?this._move(void 0):a.map(c=>Ft.fromPositions(c.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const n=[];for(const r of this._snippets){const s=r.move(e);n.push(...s)}return n}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;const n=new Map;for(const r of this._snippets){const s=r.computePossibleSelections();if(n.size===0)for(const[o,a]of s){a.sort(J.compareRangesUsingStarts);for(const l of e)if(a[0].containsRange(l)){n.set(o,[]);break}}if(n.size===0)return!1;n.forEach((o,a)=>{o.push(...s.get(a))})}e.sort(J.compareRangesUsingStarts);for(const[r,s]of n){if(s.length!==e.length){n.delete(r);continue}s.sort(J.compareRangesUsingStarts);for(let o=0;o<s.length;o++)if(!s[o].containsRange(e[o])){n.delete(r);continue}}return n.size>0}};yj=dp=iTt([rTt(3,dr)],yj);var sTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},V6=function(i,e){return function(n,r){e(n,r,i)}},HD;const dve={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let fa=HD=class{static get(e){return e.getContribution(HD.ID)}constructor(e,n,r,s,o){this._editor=e,this._logService=n,this._languageFeaturesService=r,this._languageConfigurationService=o,this._snippetListener=new Xe,this._modelVersionId=-1,this._inSnippet=HD.InSnippetMode.bindTo(s),this._hasNextTabstop=HD.HasNextTabstop.bindTo(s),this._hasPrevTabstop=HD.HasPrevTabstop.bindTo(s)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,n){try{this._doInsert(e,typeof n>"u"?dve:Object.assign(Object.assign({},dve),n))}catch(r){this.cancel(),this._logService.error(r),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,n){var r;if(this._editor.hasModel()){if(this._snippetListener.clear(),n.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Ui(typeof e=="string"),this._session.merge(e,n)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new yj(this._editor,e,n,this._languageConfigurationService),this._session.insert()),n.undoStopAfter&&this._editor.getModel().pushStackElement(),!((r=this._session)===null||r===void 0)&&r.hasChoice){const s={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(d,h)=>{if(!this._session||d!==this._editor.getModel()||!ve.equals(this._editor.getPosition(),h))return;const{activeChoice:f}=this._session;if(!f||f.choice.options.length===0)return;const p=d.getValueInRange(f.range),g=!!f.choice.options.find(_=>_.value===p),m=[];for(let _=0;_<f.choice.options.length;_++){const b=f.choice.options[_];m.push({kind:13,label:b.value,insertText:b.value,sortText:"a".repeat(_+1),range:f.range,filterText:g?`${p}_${b.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:L("next","Go to next placeholder...")}})}return{suggestions:m}}},o=this._editor.getModel();let a,l=!1;const c=()=>{a==null||a.dispose(),l=!1},u=()=>{l||(a=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},s),this._snippetListener.add(a),l=!0)};this._choiceCompletions={provider:s,enable:u,disable:c}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(s=>s.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:n}=this._session;if(!n||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==n.choice&&(this._currentChoice=n.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{eTt(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var n;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(n=this._session)===null||n===void 0||n.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};fa.ID="snippetController2";fa.InSnippetMode=new yt("inSnippetMode",!1,L("inSnippetMode","Whether the editor in current in snippet mode"));fa.HasNextTabstop=new yt("hasNextTabstop",!1,L("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));fa.HasPrevTabstop=new yt("hasPrevTabstop",!1,L("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));fa=HD=sTt([V6(1,vd),V6(2,Et),V6(3,mn),V6(4,dr)],fa);_i(fa.ID,fa,4);const jz=Ho.bindToContribution(fa.get);ct(new jz({id:"jumpToNextSnippetPlaceholder",precondition:ze.and(fa.InSnippetMode,fa.HasNextTabstop),handler:i=>i.next(),kbOpts:{weight:130,kbExpr:oe.editorTextFocus,primary:2}}));ct(new jz({id:"jumpToPrevSnippetPlaceholder",precondition:ze.and(fa.InSnippetMode,fa.HasPrevTabstop),handler:i=>i.prev(),kbOpts:{weight:130,kbExpr:oe.editorTextFocus,primary:1026}}));ct(new jz({id:"leaveSnippet",precondition:fa.InSnippetMode,handler:i=>i.cancel(!0),kbOpts:{weight:130,kbExpr:oe.editorTextFocus,primary:9,secondary:[1033]}}));ct(new jz({id:"acceptSnippet",precondition:fa.InSnippetMode,handler:i=>i.finish()}));var oTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},DK=function(i,e){return function(n,r){e(n,r,i)}},r0=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},ju;(function(i){i[i.Undo=0]="Undo",i[i.Redo=1]="Redo",i[i.AcceptWord=2]="AcceptWord",i[i.Other=3]="Other"})(ju||(ju={}));let xne=class extends Le{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,n,r,s,o,a,l,c,u,d,h,f){super(),this.textModel=e,this.selectedSuggestItem=n,this.cursorPosition=r,this.textModelVersionId=s,this._debounceValue=o,this._suggestPreviewEnabled=a,this._suggestPreviewMode=l,this._inlineSuggestMode=c,this._enabled=u,this._instantiationService=d,this._commandService=h,this._languageConfigurationService=f,this._source=this._register(this._instantiationService.createInstance(Sne,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=vr(this,!1),this._forceUpdate=GRe("forceUpdate"),this._selectedInlineCompletionId=vr(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([ju.Redo,ju.Undo,ju.AcceptWord]),this._fetchInlineCompletions=qwt({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:pv.Automatic}),handleChange:(g,m)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?m.preserveCurrentCompletion=!0:g.didChange(this._forceUpdate)&&(m.inlineCompletionTriggerKind=g.change),!0)},(g,m)=>{if(this._forceUpdate.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this.textModelVersionId.read(g);const b=this.selectedInlineCompletion.get(),y=m.preserveCurrentCompletion||b!=null&&b.forwardStable?b:void 0,x=this._source.suggestWidgetInlineCompletions.get(),k=this.selectedSuggestItem.read(g);if(x&&!k){const E=this._source.inlineCompletions.get();Pr(A=>{E&&x.request.versionId>E.request.versionId&&this._source.inlineCompletions.set(x.clone(),A),this._source.clearSuggestWidgetInlineCompletions(A)})}const D=this.cursorPosition.read(g),R={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:k==null?void 0:k.toSelectedSuggestionInfo()};return this._source.fetch(D,R,y)}),this._filteredInlineCompletionItems=ni(this,g=>{const m=this._source.inlineCompletions.read(g);if(!m)return[];const _=this.cursorPosition.read(g);return m.inlineCompletions.filter(y=>y.isVisible(this.textModel,_,g))}),this.selectedInlineCompletionIndex=ni(this,g=>{const m=this._selectedInlineCompletionId.read(g),_=this._filteredInlineCompletionItems.read(g),b=this._selectedInlineCompletionId===void 0?-1:_.findIndex(y=>y.semanticId===m);return b===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):b}),this.selectedInlineCompletion=ni(this,g=>{const m=this._filteredInlineCompletionItems.read(g),_=this.selectedInlineCompletionIndex.read(g);return m[_]}),this.lastTriggerKind=this._source.inlineCompletions.map(g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=ni(this,g=>{if(this.lastTriggerKind.read(g)===pv.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=L_e({owner:this,equalityComparer:(g,m)=>!g||!m?g===m:K0e(g.ghostText,m.ghostText)&&g.inlineCompletion===m.inlineCompletion&&g.suggestItem===m.suggestItem},g=>{var m;const _=this.textModel,b=this.selectedSuggestItem.read(g);if(b){const y=b.toSingleTextEdit().removeCommonPrefix(_),x=this._computeAugmentedCompletion(y,g);if(!this._suggestPreviewEnabled.read(g)&&!x)return;const D=(m=x==null?void 0:x.edit)!==null&&m!==void 0?m:y,R=x?x.edit.text.length-y.text.length:0,E=this._suggestPreviewMode.read(g),A=this.cursorPosition.read(g),M=D.computeGhostText(_,E,A,R);return{ghostText:M??new _j(D.range.endLineNumber,[]),inlineCompletion:x==null?void 0:x.completion,suggestItem:b}}else{if(!this._isActive.read(g))return;const y=this.selectedInlineCompletion.read(g);if(!y)return;const x=y.toSingleTextEdit(g),k=this._inlineSuggestMode.read(g),D=this.cursorPosition.read(g),R=x.computeGhostText(_,k,D);return R?{ghostText:R,inlineCompletion:y,suggestItem:void 0}:void 0}}),this.ghostText=L_e({owner:this,equalityComparer:K0e},g=>{const m=this.state.read(g);if(m)return m.ghostText}),this._register(rO(this._fetchInlineCompletions));let p;this._register(ur(g=>{var m,_;const b=this.state.read(g),y=b==null?void 0:b.inlineCompletion;if((y==null?void 0:y.semanticId)!==(p==null?void 0:p.semanticId)&&(p=y,y)){const x=y.inlineCompletion,k=x.source;(_=(m=k.provider).handleItemDidShow)===null||_===void 0||_.call(m,k.inlineCompletions,x.sourceInlineCompletion,x.insertText)}}))}trigger(e){return r0(this,void 0,void 0,function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()})}triggerExplicitly(e){return r0(this,void 0,void 0,function*(){ute(e,n=>{this._isActive.set(!0,n),this._forceUpdate.trigger(n,pv.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){ute(e,n=>{this._isActive.set(!1,n),this._source.clear(n)})}_computeAugmentedCompletion(e,n){const r=this.textModel,s=this._source.suggestWidgetInlineCompletions.read(n),o=s?s.inlineCompletions:[this.selectedInlineCompletion.read(n)].filter(tP);return jct(o,l=>{let c=l.toSingleTextEdit(n);return c=c.removeCommonPrefix(r,J.fromPositions(c.range.getStartPosition(),e.range.getEndPosition())),c.augments(e)?{edit:c,completion:l}:void 0})}_deltaSelectedInlineCompletionIndex(e){return r0(this,void 0,void 0,function*(){yield this.triggerExplicitly();const n=this._filteredInlineCompletionItems.get()||[];if(n.length>0){const r=(this.selectedInlineCompletionIndex.get()+e+n.length)%n.length;this._selectedInlineCompletionId.set(n[r].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)})}next(){return r0(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(1)})}previous(){return r0(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(-1)})}accept(e){var n;return r0(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vs;const r=this.state.get();if(!r||r.ghostText.isEmpty()||!r.inlineCompletion)return;const s=r.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),s.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Vr.replaceMove(s.range,""),...s.additionalTextEdits]),e.setPosition(s.snippetInfo.range.getStartPosition()),(n=fa.get(e))===null||n===void 0||n.insert(s.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Vr.replaceMove(s.range,s.insertText),...s.additionalTextEdits]),s.command&&s.source.addRef(),Pr(o=>{this._source.clear(o),this._isActive.set(!1,o)}),s.command&&(yield this._commandService.executeCommand(s.command.id,...s.command.arguments||[]).then(void 0,Us),s.source.removeRef())})}acceptNextWord(e){return r0(this,void 0,void 0,function*(){yield this._acceptNext(e,(n,r)=>{const s=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column),o=this._languageConfigurationService.getLanguageConfiguration(s),a=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),l=r.match(a);let c=0;l&&l.index!==void 0?l.index===0?c=l[0].length:c=l.index:c=r.length;const d=/\s+/g.exec(r);return d&&d.index!==void 0&&d.index+d[0].length<c&&(c=d.index+d[0].length),c})})}acceptNextLine(e){return r0(this,void 0,void 0,function*(){yield this._acceptNext(e,(n,r)=>{const s=r.match(/\n/);return s&&s.index!==void 0?s.index+1:r.length})})}_acceptNext(e,n){return r0(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vs;const r=this.state.get();if(!r||r.ghostText.isEmpty()||!r.inlineCompletion)return;const s=r.ghostText,o=r.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){yield this.accept(e);return}const a=s.parts[0],l=new ve(s.lineNumber,a.column),c=a.lines.join(`
`),u=n(l,c);if(u===c.length&&s.parts.length===1){this.accept(e);return}const d=c.substring(0,u);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Vr.replace(J.fromPositions(l),d)]);const h=bne(d);e.setPosition(vne(l,h))}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const h=J.fromPositions(o.range.getStartPosition(),vne(l,bne(d))),f=e.getModel().getValueInRange(h,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,f.length)}})}handleSuggestAccepted(e){var n,r;const s=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentedCompletion(s,void 0);if(!o)return;const a=o.completion.inlineCompletion;(r=(n=a.source.provider).handlePartialAccept)===null||r===void 0||r.call(n,a.source.inlineCompletions,a.sourceInlineCompletion,s.text.length)}};xne=oTt([DK(9,hn),DK(10,us),DK(11,dr)],xne);var aTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},hve=function(i,e){return function(n,r){e(n,r,i)}},kN;class Lle{constructor(e){this.name=e}select(e,n,r){if(r.length===0)return 0;const s=r[0].score[0];for(let o=0;o<r.length;o++){const{score:a,completion:l}=r[o];if(a[0]!==s)break;if(l.preselect)return o}return 0}}class MMe extends Lle{constructor(){super("first")}memorize(e,n,r){}toJSON(){}fromJSON(){}}class lTt extends Lle{constructor(){super("recentlyUsed"),this._cache=new G1(300,.66),this._seq=0}memorize(e,n,r){const s=`${e.getLanguageId()}/${r.textLabel}`;this._cache.set(s,{touch:this._seq++,type:r.completion.kind,insertText:r.completion.insertText})}select(e,n,r){if(r.length===0)return 0;const s=e.getLineContent(n.lineNumber).substr(n.column-10,n.column-1);if(/\s$/.test(s))return super.select(e,n,r);const o=r[0].score[0];let a=-1,l=-1,c=-1;for(let u=0;u<r.length&&r[u].score[0]===o;u++){const d=`${e.getLanguageId()}/${r[u].textLabel}`,h=this._cache.peek(d);if(h&&h.touch>c&&h.type===r[u].completion.kind&&h.insertText===r[u].completion.insertText&&(c=h.touch,l=u),r[u].completion.preselect&&a===-1)return a=u}return l!==-1?l:a!==-1?a:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const n=0;for(const[r,s]of e)s.touch=n,s.type=typeof s.type=="number"?s.type:sP.fromString(s.type),this._cache.set(r,s);this._seq=this._cache.size}}class cTt extends Lle{constructor(){super("recentlyUsedByPrefix"),this._trie=eE.forStrings(),this._seq=0}memorize(e,n,r){const{word:s}=e.getWordUntilPosition(n),o=`${e.getLanguageId()}/${s}`;this._trie.set(o,{type:r.completion.kind,insertText:r.completion.insertText,touch:this._seq++})}select(e,n,r){const{word:s}=e.getWordUntilPosition(n);if(!s)return super.select(e,n,r);const o=`${e.getLanguageId()}/${s}`;let a=this._trie.get(o);if(a||(a=this._trie.findSubstr(o)),a)for(let l=0;l<r.length;l++){const{kind:c,insertText:u}=r[l].completion;if(c===a.type&&u===a.insertText)return l}return super.select(e,n,r)}toJSON(){const e=[];return this._trie.forEach((n,r)=>e.push([r,n])),e.sort((n,r)=>-(n[1].touch-r[1].touch)).forEach((n,r)=>n[1].touch=r),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[n,r]of e)r.type=typeof r.type=="number"?r.type:sP.fromString(r.type),this._trie.set(n,r)}}}let _O=kN=class{constructor(e,n){this._storageService=e,this._configService=n,this._disposables=new Xe,this._persistSoon=new Ji(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(r=>{r.reason===E7.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,n,r){this._withStrategy(e,n).memorize(e,n,r),this._persistSoon.schedule()}select(e,n,r){return this._withStrategy(e,n).select(e,n,r)}_withStrategy(e,n){var r;const s=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(n.lineNumber,n.column),resource:e.uri});if(((r=this._strategy)===null||r===void 0?void 0:r.name)!==s){this._saveState();const o=kN._strategyCtors.get(s)||MMe;this._strategy=new o;try{const l=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,c=this._storageService.get(`${kN._storagePrefix}/${s}`,l);c&&this._strategy.fromJSON(JSON.parse(c))}catch{}}return this._strategy}_saveState(){if(this._strategy){const n=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,r=JSON.stringify(this._strategy);this._storageService.store(`${kN._storagePrefix}/${this._strategy.name}`,r,n,1)}}};_O._strategyCtors=new Map([["recentlyUsedByPrefix",cTt],["recentlyUsed",lTt],["first",MMe]]);_O._storagePrefix="suggest/memories";_O=kN=aTt([hve(0,jf),hve(1,ei)],_O);const Wz=qn("ISuggestMemories");oi(Wz,_O,1);var uTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},dTt=function(i,e){return function(n,r){e(n,r,i)}},kne;let vO=kne=class{constructor(e,n){this._editor=e,this._enabled=!1,this._ckAtEnd=kne.AtEnd.bindTo(n),this._configListener=this._editor.onDidChangeConfiguration(r=>r.hasChanged(122)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(122)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const n=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const r=this._editor.getModel(),s=this._editor.getSelection(),o=r.getWordAtPosition(s.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===s.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(n),n()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};vO.AtEnd=new yt("atEndOfWord",!1);vO=kne=uTt([dTt(1,mn)],vO);var hTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},fTt=function(i,e){return function(n,r){e(n,r,i)}},LN;let Rx=LN=class{constructor(e,n){this._editor=e,this._index=0,this._ckOtherSuggestions=LN.OtherSuggestions.bindTo(n)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:n},r){if(e.items.length===0){this.reset();return}if(LN._moveIndex(!0,e,n)===n){this.reset();return}this._acceptNext=r,this._model=e,this._index=n,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,n,r){let s=r;for(let o=n.items.length;o>0&&(s=(s+n.items.length+(e?1:-1))%n.items.length,!(s===r||!n.items[s].completion.additionalTextEdits));o--);return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=LN._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};Rx.OtherSuggestions=new yt("hasOtherSuggestions",!1);Rx=LN=hTt([fTt(1,mn)],Rx);class pTt{constructor(e,n,r,s){this._disposables=new Xe,this._disposables.add(r.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(r.onDidCancel(o=>{this.reset()})),this._disposables.add(n.onDidShow(()=>this._onItem(n.getFocusedItem()))),this._disposables.add(n.onDidFocus(this._onItem,this)),this._disposables.add(n.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!n.isFrozen()&&r.state!==0){const a=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(a)&&e.getOption(0)&&s(this._active.item)}}))}_onItem(e){if(!e||!Ka(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const n=new q9;for(const r of e.item.completion.commitCharacters)r.length>0&&n.add(r.charCodeAt(0));this._active={acceptCharacters:n,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var gTt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class Wu{provideSelectionRanges(e,n){return gTt(this,void 0,void 0,function*(){const r=[];for(const s of n){const o=[];r.push(o);const a=new Map;yield new Promise(l=>Wu._bracketsRightYield(l,0,e,s,a)),yield new Promise(l=>Wu._bracketsLeftYield(l,0,e,s,a,o))}return r})}static _bracketsRightYield(e,n,r,s,o){const a=new Map,l=Date.now();for(;;){if(n>=Wu._maxRounds){e();break}if(!s){e();break}const c=r.bracketPairs.findNextBracket(s);if(!c){e();break}if(Date.now()-l>Wu._maxDuration){setTimeout(()=>Wu._bracketsRightYield(e,n+1,r,s,o));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText,h=a.has(d)?a.get(d):0;a.set(d,h+1)}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText;let h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){let f=o.get(d);f||(f=new jl,o.set(d,f)),f.push(c.range)}}s=c.range.getEndPosition()}}static _bracketsLeftYield(e,n,r,s,o,a){const l=new Map,c=Date.now();for(;;){if(n>=Wu._maxRounds&&o.size===0){e();break}if(!s){e();break}const u=r.bracketPairs.findPrevBracket(s);if(!u){e();break}if(Date.now()-c>Wu._maxDuration){setTimeout(()=>Wu._bracketsLeftYield(e,n+1,r,s,o,a));break}if(u.bracketInfo.isOpeningBracket){const h=u.bracketInfo.bracketText;let f=l.has(h)?l.get(h):0;if(f-=1,l.set(h,Math.max(0,f)),f<0){const p=o.get(h);if(p){const g=p.shift();p.size===0&&o.delete(h);const m=J.fromPositions(u.range.getEndPosition(),g.getStartPosition()),_=J.fromPositions(u.range.getStartPosition(),g.getEndPosition());a.push({range:m}),a.push({range:_}),Wu._addBracketLeading(r,_,a)}}}else{const h=u.bracketInfo.getOpeningBrackets()[0].bracketText,f=l.has(h)?l.get(h):0;l.set(h,f+1)}s=u.range.getStartPosition()}}static _addBracketLeading(e,n,r){if(n.startLineNumber===n.endLineNumber)return;const s=n.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(s);o!==0&&o!==n.startColumn&&(r.push({range:J.fromPositions(new ve(s,o),n.getEndPosition())}),r.push({range:J.fromPositions(new ve(s,1),n.getEndPosition())}));const a=s-1;if(a>0){const l=e.getLineFirstNonWhitespaceColumn(a);l===n.startColumn&&l!==e.getLineLastNonWhitespaceColumn(a)&&(r.push({range:J.fromPositions(new ve(a,l),n.getEndPosition())}),r.push({range:J.fromPositions(new ve(a,1),n.getEndPosition())}))}}}Wu._maxDuration=30;Wu._maxRounds=2;var mTt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class Lp{static create(e,n){return mTt(this,void 0,void 0,function*(){if(!n.getOption(117).localityBonus||!n.hasModel())return Lp.None;const r=n.getModel(),s=n.getPosition();if(!e.canComputeWordRanges(r.uri))return Lp.None;const[o]=yield new Wu().provideSelectionRanges(r,[s]);if(o.length===0)return Lp.None;const a=yield e.computeWordRanges(r.uri,o[0].range);if(!a)return Lp.None;const l=r.getWordUntilPosition(s);return delete a[l.word],new class extends Lp{distance(c,u){if(!s.equals(n.getPosition()))return 0;if(u.kind===17)return 2<<20;const d=typeof u.label=="string"?u.label:u.label.label,h=a[d];if(p2e(h))return 2<<20;const f=JM(h,J.fromPositions(c),J.compareRangesUsingStarts),p=f>=0?h[f]:h[Math.max(0,~f-1)];let g=o.length;for(const m of o){if(!J.containsRange(m.range,p))break;g-=1}return g}}})}}Lp.None=new class extends Lp{distance(){return 0}};let fve=class{constructor(e,n){this.leadingLineContent=e,this.characterCountDelta=n}};class uy{constructor(e,n,r,s,o,a,l=V$.default,c=void 0){this.clipboardText=c,this._snippetCompareFn=uy._compareCompletionItems,this._items=e,this._column=n,this._wordDistance=s,this._options=o,this._refilterKind=1,this._lineContext=r,this._fuzzyScoreOptions=l,a==="top"?this._snippetCompareFn=uy._compareCompletionItemsSnippetsUp:a==="bottom"&&(this._snippetCompareFn=uy._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}getItemsByProvider(){return this._ensureCachedState(),this._itemsByProvider}getIncompleteProvider(){this._ensureCachedState();const e=new Set;for(const[n,r]of this.getItemsByProvider())r.length>0&&r[0].container.incomplete&&e.add(n);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:n,characterCountDelta:r}=this._lineContext;let s="",o="";const a=this._refilterKind===1?this._items:this._filteredItems,l=[],c=!this._options.filterGraceful||a.length>2e3?gx:Pvt;for(let u=0;u<a.length;u++){const d=a[u];if(d.isInvalid)continue;const h=this._itemsByProvider.get(d.provider);h?h.push(d):this._itemsByProvider.set(d.provider,[d]);const f=d.position.column-d.editStart.column,p=f+r-(d.position.column-this._column);if(s.length!==p&&(s=p===0?"":n.slice(-p),o=s.toLowerCase()),d.word=s,p===0)d.score=Hp.Default;else{let g=0;for(;g<f;){const m=s.charCodeAt(g);if(m===32||m===9)g+=1;else break}if(g>=p)d.score=Hp.Default;else if(typeof d.completion.filterText=="string"){const m=c(s,o,g,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;JQ(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=Rvt(s,o,g,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=c(s,o,g,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;d.score=m}}d.idx=u,d.distance=this._wordDistance.distance(d.position,d.completion),l.push(d),e.push(d.textLabel.length)}this._filteredItems=l.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?iQ(e.length-.85,e,(u,d)=>u-d):0}}static _compareCompletionItems(e,n){return e.score[0]>n.score[0]?-1:e.score[0]<n.score[0]?1:e.distance<n.distance?-1:e.distance>n.distance?1:e.idx<n.idx?-1:e.idx>n.idx?1:0}static _compareCompletionItemsSnippetsDown(e,n){if(e.completion.kind!==n.completion.kind){if(e.completion.kind===27)return 1;if(n.completion.kind===27)return-1}return uy._compareCompletionItems(e,n)}static _compareCompletionItemsSnippetsUp(e,n){if(e.completion.kind!==n.completion.kind){if(e.completion.kind===27)return-1;if(n.completion.kind===27)return 1}return uy._compareCompletionItems(e,n)}}var _Tt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},jb=function(i,e){return function(n,r){e(n,r,i)}},vTt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},Lne;class aC{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const n=e.getModel(),r=e.getPosition();n.tokenization.tokenizeIfCheap(r.lineNumber);const s=n.getWordAtPosition(r);return!(!s||s.endColumn!==r.column&&s.startColumn+1!==r.column||!isNaN(Number(s.word)))}constructor(e,n,r){this.leadingLineContent=e.getLineContent(n.lineNumber).substr(0,n.column-1),this.leadingWord=e.getWordUntilPosition(n),this.lineNumber=n.lineNumber,this.column=n.column,this.triggerOptions=r}}function bTt(i,e,n){if(!e.getContextKeyValue($o.inlineSuggestionVisible.key))return!0;const r=e.getContextKeyValue($o.suppressSuggestions.key);return r!==void 0?!r:!i.getOption(62).suppressSuggestions}function yTt(i,e,n){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const r=e.getContextKeyValue($o.suppressSuggestions.key);return r!==void 0?!r:!i.getOption(62).suppressSuggestions}let Dne=Lne=class{constructor(e,n,r,s,o,a,l,c,u){this._editor=e,this._editorWorkerService=n,this._clipboardService=r,this._telemetryService=s,this._logService=o,this._contextKeyService=a,this._configurationService=l,this._languageFeaturesService=c,this._envService=u,this._toDispose=new Xe,this._triggerCharacterListener=new Xe,this._triggerQuickSuggest=new Mf,this._triggerState=void 0,this._completionDisposables=new Xe,this._onDidCancel=new _e,this._onDidTrigger=new _e,this._onDidSuggest=new _e,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Ft(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(h=>{d||this._onCursorChange(h)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){Mi(this._triggerCharacterListener),Mi([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const r of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const s of r.triggerCharacters||[]){let o=e.get(s);o||(o=new Set,o.add(XIt()),e.set(s,o)),o.add(r)}const n=r=>{var s;if(!yTt(this._editor,this._contextKeyService,this._configurationService)||aC.shouldAutoTrigger(this._editor))return;if(!r){const l=this._editor.getPosition();r=this._editor.getModel().getLineContent(l.lineNumber).substr(0,l.column-1)}let o="";lx(r.charCodeAt(r.length-1))?xo(r.charCodeAt(r.length-2))&&(o=r.substr(r.length-2)):o=r.charAt(r.length-1);const a=e.get(o);if(a){const l=new Map;if(this._completionModel)for(const[c,u]of this._completionModel.getItemsByProvider())a.has(c)||l.set(c,u);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(s=this._completionModel)===null||s===void 0?void 0:s.clipboardText,completionOptions:{providerFilter:a,providerItemsToReuse:l}})}};this._triggerCharacterListener.add(this._editor.onDidType(n)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>n()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var n;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(n=this._requestToken)===null||n===void 0||n.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const n=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(n.containsRange(this._currentSelection)||n.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;k2.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&(!((e=fa.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!aC.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const n=this._editor.getModel(),r=this._editor.getPosition(),s=this._editor.getOption(88);if(!k2.isAllOff(s)){if(!k2.isAllOn(s)){n.tokenization.tokenizeIfCheap(r.lineNumber);const o=n.tokenization.getLineTokens(r.lineNumber),a=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(r.column-1-1,0)));if(k2.valueFor(s,a)!=="on")return}bTt(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(n)&&this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){Ui(this._editor.hasModel()),Ui(this._triggerState!==void 0);const e=this._editor.getModel(),n=this._editor.getPosition(),r=new aC(e,n,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(r)}trigger(e){var n,r,s,o,a,l;if(!this._editor.hasModel())return;const c=this._editor.getModel(),u=new aC(c,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(n=e.shy)!==null&&n!==void 0?n:!1,position:this._editor.getPosition()}),this._context=u;let d={triggerKind:(r=e.triggerKind)!==null&&r!==void 0?r:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Ns;const h=this._editor.getOption(111);let f=1;switch(h){case"top":f=0;break;case"bottom":f=2;break}const{itemKind:p,showDeprecated:g}=Lne._createSuggestFilter(this._editor),m=new mO(f,(o=(s=e.completionOptions)===null||s===void 0?void 0:s.kindFilter)!==null&&o!==void 0?o:p,(a=e.completionOptions)===null||a===void 0?void 0:a.providerFilter,(l=e.completionOptions)===null||l===void 0?void 0:l.providerItemsToReuse,g),_=Lp.create(this._editorWorkerService,this._editor),b=xle(this._languageFeaturesService.completionProvider,c,this._editor.getPosition(),m,d,this._requestToken.token);Promise.all([b,_]).then(([y,x])=>vTt(this,void 0,void 0,function*(){var k;if((k=this._requestToken)===null||k===void 0||k.dispose(),!this._editor.hasModel())return;let D=e==null?void 0:e.clipboardText;if(!D&&y.needsClipboard&&(D=yield this._clipboardService.readText()),this._triggerState===void 0)return;const R=this._editor.getModel(),E=new aC(R,this._editor.getPosition(),e),A=Object.assign(Object.assign({},V$.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new uy(y.items,this._context.column,{leadingLineContent:E.leadingLineContent,characterCountDelta:E.column-this._context.column},x,this._editor.getOption(117),this._editor.getOption(111),A,D),this._completionDisposables.add(y.disposable),this._onNewContext(E),this._reportDurationsTelemetry(y.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const M of y.items)M.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${M.provider._debugDisplayName}`,M.completion)})).catch(Ln)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static _createSuggestFilter(e){const n=new Set;e.getOption(111)==="none"&&n.add(27);const s=e.getOption(117);return s.showMethods||n.add(0),s.showFunctions||n.add(1),s.showConstructors||n.add(2),s.showFields||n.add(3),s.showVariables||n.add(4),s.showClasses||n.add(5),s.showStructs||n.add(6),s.showInterfaces||n.add(7),s.showModules||n.add(8),s.showProperties||n.add(9),s.showEvents||n.add(10),s.showOperators||n.add(11),s.showUnits||n.add(12),s.showValues||n.add(13),s.showConstants||n.add(14),s.showEnums||n.add(15),s.showEnumMembers||n.add(16),s.showKeywords||n.add(17),s.showWords||n.add(18),s.showColors||n.add(19),s.showFiles||n.add(20),s.showReferences||n.add(21),s.showColors||n.add(22),s.showFolders||n.add(23),s.showTypeParameters||n.add(24),s.showSnippets||n.add(27),s.showUsers||n.add(25),s.showIssues||n.add(26),{itemKind:n,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(ar(e.leadingLineContent)!==ar(this._context.leadingLineContent)){this.cancel();return}if(e.column<this._context.column){e.leadingWord.word?this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0}):this.cancel();return}if(this._completionModel){if(e.leadingWord.word.length!==0&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){if(aC.shouldAutoTrigger(this._editor)&&this._context){const r=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:r}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const n=new Map,r=new Set;for(const[s,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?r.add(s):n.set(s,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:r,providerItemsToReuse:n}})}else{const n=this._completionModel.lineContext;let r=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const s=aC.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(s&&this._context.leadingWord.endColumn<e.leadingWord.startColumn){this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0});return}if(this._context.triggerOptions.auto){this.cancel();return}else if(this._completionModel.lineContext=n,r=this._completionModel.items.length>0,r&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:r})}}}}};Dne=Lne=_Tt([jb(1,Wf),jb(2,qv),jb(3,_d),jb(4,vd),jb(5,mn),jb(6,ei),jb(7,Et),jb(8,Goe)],Dne);class $z{constructor(e,n){this._disposables=new Xe,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const r=e.getSelections(),s=r.length;let o=!1;for(let l=0;l<s;l++)if(!r[l].isEmpty()){o=!0;break}if(!o){this._lastOvertyped.length!==0&&(this._lastOvertyped.length=0);return}this._lastOvertyped=[];const a=e.getModel();for(let l=0;l<s;l++){const c=r[l];if(a.getValueLengthInRange(c)>$z._maxSelectionLength)return;this._lastOvertyped[l]={value:a.getValueInRange(c),multiline:c.startLineNumber!==c.endLineNumber}}})),this._disposables.add(n.onDidTrigger(r=>{this._locked=!0})),this._disposables.add(n.onDidCancel(r=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}$z._maxSelectionLength=51200;var wTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},EK=function(i,e){return function(n,r){e(n,r,i)}};class Dle extends mx{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=L({},"{0} ({1})",this._action.label,Dle.symbolPrintEnter(e)))}static symbolPrintEnter(e){var n;return(n=e.getLabel())===null||n===void 0?void 0:n.replace(/\benter\b/gi,"⏎")}}let Ene=class{constructor(e,n,r,s,o){this._menuId=n,this._menuService=s,this._contextKeyService=o,this._menuDisposables=new Xe,this.element=He(e,tt(".suggest-status-bar"));const a=l=>l instanceof If?r.createInstance(Dle,l,void 0):void 0;this._leftActions=new wh(this.element,{actionViewItemProvider:a}),this._rightActions=new wh(this.element,{actionViewItemProvider:a}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),n=()=>{const r=[],s=[];for(const[o,a]of e.getActions())o==="left"?r.push(...a):s.push(...a);this._leftActions.clear(),this._leftActions.push(r),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>n())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};Ene=wTt([EK(2,hn),EK(3,c_),EK(4,mn)],Ene);var CTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},STt=function(i,e){return function(n,r){e(n,r,i)}};function Ele(i){return!!i&&!!(i.completion.documentation||i.completion.detail&&i.completion.detail!==i.completion.label)}let Ine=class{constructor(e,n){this._editor=e,this._onDidClose=new _e,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new _e,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Xe,this._renderDisposeable=new Xe,this._borderWidth=1,this._size=new bi(330,0),this.domNode=tt(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=n.createInstance(Rv,{editor:e}),this._body=tt(".body"),this._scrollbar=new P5(this._body,{alwaysConsumeMouseWheel:!0}),He(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=He(this._body,tt(".header")),this._close=He(this._header,tt("span"+en.asCSSSelector(lt.close))),this._close.title=L("details.close","Close"),this._type=He(this._header,tt("p.type")),this._docs=He(this._body,tt("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),n=e.get(50),r=n.getMassagedFontFamily(),s=e.get(118)||n.fontSize,o=e.get(119)||n.lineHeight,a=n.fontWeight,l=`${s}px`,c=`${o}px`;this.domNode.style.fontSize=l,this.domNode.style.lineHeight=`${o/s}`,this.domNode.style.fontWeight=a,this.domNode.style.fontFeatureSettings=n.fontFeatureSettings,this._type.style.fontFamily=r,this._close.style.height=c,this._close.style.width=c}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,n=this._borderWidth,r=n*2;return{lineHeight:e,borderWidth:n,borderHeight:r,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=L("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,n){var r,s;this._renderDisposeable.clear();let{detail:o,documentation:a}=e.completion;if(n){let l="";l+=`score: ${e.score[0]}
`,l+=`prefix: ${(r=e.word)!==null&&r!==void 0?r:"(no prefix)"}
`,l+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
`,l+=`distance: ${e.distance} (localityBonus-setting)
`,l+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
`,l+=`commit_chars: ${(s=e.completion.commitCharacters)===null||s===void 0?void 0:s.join("")}
`,a=new Ea().appendCodeblock("empty",l),o=`Provider: ${e.provider._debugDisplayName}`}if(!n&&!Ele(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const l=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=l,this._type.title=l,Jc(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(l))}else la(this._type),this._type.title="",Pl(this._type),this.domNode.classList.add("no-type");if(la(this._docs),typeof a=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=a;else if(a){this._docs.classList.add("markdown-docs"),la(this._docs);const l=this._markdownRenderer.render(a);this._docs.appendChild(l.element),this._renderDisposeable.add(l),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=l=>{l.preventDefault(),l.stopPropagation()},this._close.onclick=l=>{l.preventDefault(),l.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,n){const r=new bi(e,n);bi.equals(r,this._size)||(this._size=r,Gat(this.domNode,e,n)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};Ine=CTt([STt(1,hn)],Ine);class xTt{constructor(e,n){this.widget=e,this._editor=n,this._disposables=new Xe,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new ole,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let r,s,o=0,a=0;this._disposables.add(this._resizable.onDidWillResize(()=>{r=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(l=>{if(r&&s){this.widget.layout(l.dimension.width,l.dimension.height);let c=!1;l.west&&(a=s.width-l.dimension.width,c=!0),l.north&&(o=s.height-l.dimension.height,c=!0),c&&this._applyTopLeft({top:r.top+o,left:r.left+a})}l.done&&(r=void 0,s=void 0,o=0,a=0,this._userSize=l.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var l;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(l=this._userSize)!==null&&l!==void 0?l:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,n){var r;const s=e.getBoundingClientRect();this._anchorBox=s,this._preferAlignAtTop=n,this._placeAtAnchor(this._anchorBox,(r=this._userSize)!==null&&r!==void 0?r:this.widget.size,n)}_placeAtAnchor(e,n,r){var s;const o=FI(this.getDomNode().ownerDocument.body),a=this.widget.getLayoutInfo(),l=new bi(220,2*a.lineHeight),c=e.top,u=function(){const x=o.width-(e.left+e.width+a.borderWidth+a.horizontalPadding),k=-a.borderWidth+e.left+e.width,D=new bi(x,o.height-e.top-a.borderHeight-a.verticalPadding),R=D.with(void 0,e.top+e.height-a.borderHeight-a.verticalPadding);return{top:c,left:k,fit:x-n.width,maxSizeTop:D,maxSizeBottom:R,minSize:l.with(Math.min(x,l.width))}}(),d=function(){const x=e.left-a.borderWidth-a.horizontalPadding,k=Math.max(a.horizontalPadding,e.left-n.width-a.borderWidth),D=new bi(x,o.height-e.top-a.borderHeight-a.verticalPadding),R=D.with(void 0,e.top+e.height-a.borderHeight-a.verticalPadding);return{top:c,left:k,fit:x-n.width,maxSizeTop:D,maxSizeBottom:R,minSize:l.with(Math.min(x,l.width))}}(),h=function(){const x=e.left,k=-a.borderWidth+e.top+e.height,D=new bi(e.width-a.borderHeight,o.height-e.top-e.height-a.verticalPadding);return{top:k,left:x,fit:D.height-n.height,maxSizeBottom:D,maxSizeTop:D,minSize:l.with(D.width)}}(),f=[u,d,h],p=(s=f.find(x=>x.fit>=0))!==null&&s!==void 0?s:f.sort((x,k)=>k.fit-x.fit)[0],g=e.top+e.height-a.borderHeight;let m,_=n.height;const b=Math.max(p.maxSizeTop.height,p.maxSizeBottom.height);_>b&&(_=b);let y;r?_<=p.maxSizeTop.height?(m=!0,y=p.maxSizeTop):(m=!1,y=p.maxSizeBottom):_<=p.maxSizeBottom.height?(m=!1,y=p.maxSizeBottom):(m=!0,y=p.maxSizeTop),this._applyTopLeft({left:p.left,top:m?p.top:g-_}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!m,p===u,m,p!==u),this._resizable.minSize=p.minSize,this._resizable.maxSize=y,this._resizable.layout(_,Math.min(y.width,n.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var sv;(function(i){i[i.FILE=0]="FILE",i[i.FOLDER=1]="FOLDER",i[i.ROOT_FOLDER=2]="ROOT_FOLDER"})(sv||(sv={}));const kTt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function H6(i,e,n,r){const s=r===sv.ROOT_FOLDER?["rootfolder-icon"]:r===sv.FOLDER?["folder-icon"]:["file-icon"];if(n){let o;if(n.scheme===Pn.data)o=w1.parseMetaData(n).get(w1.META_DATA_LABEL);else{const a=n.path.match(kTt);a?(o=U6(a[2].toLowerCase()),a[1]&&s.push(`${U6(a[1].toLowerCase())}-name-dir-icon`)):o=U6(n.authority.toLowerCase())}if(r===sv.FOLDER)s.push(`${o}-name-folder-icon`);else{if(o){if(s.push(`${o}-name-file-icon`),s.push("name-file-icon"),o.length<=255){const l=o.split(".");for(let c=1;c<l.length;c++)s.push(`${l.slice(c).join(".")}-ext-file-icon`)}s.push("ext-file-icon")}const a=LTt(i,e,n);a&&s.push(`${U6(a)}-lang-file-icon`)}}return s}function LTt(i,e,n){if(!n)return null;let r=null;if(n.scheme===Pn.data){const o=w1.parseMetaData(n).get(w1.META_DATA_MIME);o&&(r=e.getLanguageIdByMimeType(o))}else{const s=i.getModel(n);s&&(r=s.getLanguageId())}return r&&r!==ad?r:e.guessLanguageIdByFilepathOrFirstLine(n)}function U6(i){return i.replace(/[\11\12\14\15\40]/g,"/")}var DTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},IK=function(i,e){return function(n,r){e(n,r,i)}},Wb;function PMe(i){return`suggest-aria-id:${i}`}const ETt=ws("suggest-more-info",lt.chevronRight,L("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),ITt=new(Wb=class{extract(e,n){if(e.textLabel.match(Wb._regexStrict))return n[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(Wb._regexStrict))return n[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const r=Wb._regexRelaxed.exec(e.completion.documentation);if(r&&(r.index===0||r.index+r[0].length===e.completion.documentation.length))return n[0]=r[0],!0}return!1}},Wb._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,Wb._regexStrict=new RegExp(`^${Wb._regexRelaxed.source}$`,"i"),Wb);let Tne=class{constructor(e,n,r,s){this._editor=e,this._modelService=n,this._languageService=r,this._themeService=s,this._onDidToggleDetails=new _e,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const n=new Xe,r=e;r.classList.add("show-file-icons");const s=He(e,tt(".icon")),o=He(s,tt("span.colorspan")),a=He(e,tt(".contents")),l=He(a,tt(".main")),c=He(l,tt(".icon-label.codicon")),u=He(l,tt("span.left")),d=He(l,tt("span.right")),h=new z7(u,{supportHighlights:!0,supportIcons:!0});n.add(h);const f=He(u,tt("span.signature-label")),p=He(u,tt("span.qualifier-label")),g=He(d,tt("span.details-label")),m=He(d,tt("span.readMore"+en.asCSSSelector(ETt)));m.title=L("readMore","Read More");const _=()=>{const b=this._editor.getOptions(),y=b.get(50),x=y.getMassagedFontFamily(),k=y.fontFeatureSettings,D=b.get(118)||y.fontSize,R=b.get(119)||y.lineHeight,E=y.fontWeight,A=y.letterSpacing,M=`${D}px`,N=`${R}px`,P=`${A}px`;r.style.fontSize=M,r.style.fontWeight=E,r.style.letterSpacing=P,l.style.fontFamily=x,l.style.fontFeatureSettings=k,l.style.lineHeight=N,s.style.height=N,s.style.width=N,m.style.height=N,m.style.width=N};return _(),n.add(this._editor.onDidChangeConfiguration(b=>{(b.hasChanged(50)||b.hasChanged(118)||b.hasChanged(119))&&_()})),{root:r,left:u,right:d,icon:s,colorspan:o,iconLabel:h,iconContainer:c,parametersLabel:f,qualifierLabel:p,detailsLabel:g,readMore:m,disposables:n}}renderElement(e,n,r){const{completion:s}=e;r.root.id=PMe(n),r.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:z5(e.score)},a=[];if(s.kind===19&&ITt.extract(e,a))r.icon.className="icon customcolor",r.iconContainer.className="icon hide",r.colorspan.style.backgroundColor=a[0];else if(s.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){r.icon.className="icon hide",r.iconContainer.className="icon hide";const l=H6(this._modelService,this._languageService,Jt.from({scheme:"fake",path:e.textLabel}),sv.FILE),c=H6(this._modelService,this._languageService,Jt.from({scheme:"fake",path:s.detail}),sv.FILE);o.extraClasses=l.length>c.length?l:c}else s.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(r.icon.className="icon hide",r.iconContainer.className="icon hide",o.extraClasses=[H6(this._modelService,this._languageService,Jt.from({scheme:"fake",path:e.textLabel}),sv.FOLDER),H6(this._modelService,this._languageService,Jt.from({scheme:"fake",path:s.detail}),sv.FOLDER)].flat()):(r.icon.className="icon hide",r.iconContainer.className="",r.iconContainer.classList.add("suggest-icon",...en.asClassNameArray(sP.toIcon(s.kind))));s.tags&&s.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),r.iconLabel.setLabel(e.textLabel,void 0,o),typeof s.label=="string"?(r.parametersLabel.textContent="",r.detailsLabel.textContent=TK(s.detail||""),r.root.classList.add("string-label")):(r.parametersLabel.textContent=TK(s.label.detail||""),r.detailsLabel.textContent=TK(s.label.description||""),r.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?Jc(r.detailsLabel):Pl(r.detailsLabel),Ele(e)?(r.right.classList.add("can-expand-details"),Jc(r.readMore),r.readMore.onmousedown=l=>{l.stopPropagation(),l.preventDefault()},r.readMore.onclick=l=>{l.stopPropagation(),l.preventDefault(),this._onDidToggleDetails.fire()}):(r.right.classList.remove("can-expand-details"),Pl(r.readMore),r.readMore.onmousedown=null,r.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};Tne=DTt([IK(1,Fr),IK(2,Ar),IK(3,Do)],Tne);function TK(i){return i.replace(/\r\n|\r|\n/g,"")}var TTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},q6=function(i,e){return function(n,r){e(n,r,i)}},RTt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},UD;ce("editorSuggestWidget.background",{dark:cs,light:cs,hcDark:cs,hcLight:cs},L("editorSuggestWidgetBackground","Background color of the suggest widget."));ce("editorSuggestWidget.border",{dark:Sm,light:Sm,hcDark:Sm,hcLight:Sm},L("editorSuggestWidgetBorder","Border color of the suggest widget."));const K6=ce("editorSuggestWidget.foreground",{dark:_f,light:_f,hcDark:_f,hcLight:_f},L("editorSuggestWidgetForeground","Foreground color of the suggest widget."));ce("editorSuggestWidget.selectedForeground",{dark:_S,light:_S,hcDark:_S,hcLight:_S},L("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));ce("editorSuggestWidget.selectedIconForeground",{dark:l2,light:l2,hcDark:l2,hcLight:l2},L("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const ATt=ce("editorSuggestWidget.selectedBackground",{dark:vS,light:vS,hcDark:vS,hcLight:vS},L("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));ce("editorSuggestWidget.highlightForeground",{dark:vf,light:vf,hcDark:vf,hcLight:vf},L("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));ce("editorSuggestWidget.focusHighlightForeground",{dark:H3,light:H3,hcDark:H3,hcLight:H3},L("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));ce("editorSuggestWidgetStatus.foreground",{dark:Ht(K6,.5),light:Ht(K6,.5),hcDark:Ht(K6,.5),hcLight:Ht(K6,.5)},L("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class NTt{constructor(e,n){this._service=e,this._key=`suggestWidget.size/${n.getEditorType()}/${n instanceof D1}`}restore(){var e;const n=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const r=JSON.parse(n);if(bi.is(r))return bi.lift(r)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let bO=UD=class{constructor(e,n,r,s,o){this.editor=e,this._storageService=n,this._state=0,this._isAuto=!1,this._pendingLayout=new ha,this._pendingShowDetails=new ha,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Mf,this._disposables=new Xe,this._onDidSelect=new sx,this._onDidFocus=new sx,this._onDidHide=new _e,this._onDidShow=new _e,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new _e,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new ole,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new MTt(this,e),this._persistedSize=new NTt(n,e);class a{constructor(p,g,m=!1,_=!1){this.persistedSize=p,this.currentSize=g,this.persistHeight=m,this.persistWidth=_}}let l;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),l=new a(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(f=>{var p,g,m,_;if(this._resize(f.dimension.width,f.dimension.height),l&&(l.persistHeight=l.persistHeight||!!f.north||!!f.south,l.persistWidth=l.persistWidth||!!f.east||!!f.west),!!f.done){if(l){const{itemHeight:b,defaultSize:y}=this.getLayoutInfo(),x=Math.round(b/2);let{width:k,height:D}=this.element.size;(!l.persistHeight||Math.abs(l.currentSize.height-D)<=x)&&(D=(g=(p=l.persistedSize)===null||p===void 0?void 0:p.height)!==null&&g!==void 0?g:y.height),(!l.persistWidth||Math.abs(l.currentSize.width-k)<=x)&&(k=(_=(m=l.persistedSize)===null||m===void 0?void 0:m.width)!==null&&_!==void 0?_:y.width),this._persistedSize.store(new bi(k,D))}this._contentWidget.unlockPreference(),l=void 0}})),this._messageElement=He(this.element.domNode,tt(".message")),this._listElement=He(this.element.domNode,tt(".tree"));const c=this._disposables.add(o.createInstance(Ine,this.editor));c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new xTt(c,this.editor);const u=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);u();const d=o.createInstance(Tne,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Bf("SuggestWidget",this._listElement,{getHeight:f=>this.getLayoutInfo().itemHeight,getTemplateId:f=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>L("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:f=>{let p=f.textLabel;if(typeof f.completion.label!="string"){const{detail:b,description:y}=f.completion.label;b&&y?p=L("label.full","{0} {1}, {2}",p,b,y):b?p=L("label.detail","{0} {1}",p,b):y&&(p=L("label.desc","{0}, {1}",p,y))}if(!f.isResolved||!this._isDetailsVisible())return p;const{documentation:g,detail:m}=f.completion,_=ox("{0}{1}",m||"",g?typeof g=="string"?g:g.value:"");return L("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",p,_)}}}),this._list.style(HI({listInactiveFocusBackground:ATt,listInactiveFocusOutline:Dr})),this._status=o.createInstance(Ene,this.element.domNode,Qy);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);h(),this._disposables.add(s.onDidColorThemeChange(f=>this._onThemeChange(f))),this._onThemeChange(s.getColorTheme()),this._disposables.add(this._list.onMouseDown(f=>this._onListMouseDownOrTap(f))),this._disposables.add(this._list.onTap(f=>this._onListMouseDownOrTap(f))),this._disposables.add(this._list.onDidChangeSelection(f=>this._onListSelection(f))),this._disposables.add(this._list.onDidChangeFocus(f=>this._onListFocus(f))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(f=>{f.hasChanged(117)&&(h(),u())})),this._ctxSuggestWidgetVisible=Tn.Visible.bindTo(r),this._ctxSuggestWidgetDetailsVisible=Tn.DetailsVisible.bindTo(r),this._ctxSuggestWidgetMultipleSuggestions=Tn.MultipleSuggestions.bindTo(r),this._ctxSuggestWidgetHasFocusedSuggestion=Tn.HasFocusedSuggestion.bindTo(r),this._disposables.add(As(this._details.widget.domNode,"keydown",f=>{this._onDetailsKeydown.fire(f)})),this._disposables.add(this.editor.onMouseDown(f=>this._onEditorMouseDown(f)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,n){const r=this._completionModel;r&&(this._onDidSelect.fire({item:e,index:n,model:r}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=Vp(e.type)?2:1}_onListFocus(e){var n;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const r=e.elements[0],s=e.indexes[0];r!==this._focusedItem&&((n=this._currentSuggestionDetails)===null||n===void 0||n.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=r,this._list.reveal(s),this._currentSuggestionDetails=go(o=>RTt(this,void 0,void 0,function*(){const a=g1(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),l=o.onCancellationRequested(()=>a.dispose());try{return yield r.resolve(o)}finally{a.dispose(),l.dispose()}})),this._currentSuggestionDetails.then(()=>{s>=this._list.length||r!==this._list.element(s)||(this._ignoreFocusEvents=!0,this._list.splice(s,1,[r]),this._list.setFocus([s]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:PMe(s)}))}).catch(Ln)),this._onDidFocus.fire({item:r,index:s,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Pl(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=UD.LOADING_MESSAGE,Pl(this._listElement,this._status.element),Jc(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,v1(UD.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=UD.NO_SUGGESTIONS_MESSAGE,Pl(this._listElement,this._status.element),Jc(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,v1(UD.NO_SUGGESTIONS_MESSAGE);break;case 3:Pl(this._messageElement),Jc(this._listElement,this._status.element),this._show();break;case 4:Pl(this._messageElement),Jc(this._listElement,this._status.element),this._show();break;case 5:Pl(this._messageElement),Jc(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,n){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=g1(()=>this._setState(1),n)))}showSuggestions(e,n,r,s,o){var a,l;if(this._contentWidget.setPosition(this.editor.getPosition()),(a=this._loadingTimeout)===null||a===void 0||a.dispose(),(l=this._currentSuggestionDetails)===null||l===void 0||l.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),r&&this._state!==2&&this._state!==0){this._setState(4);return}const c=this._completionModel.items.length,u=c===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(c>1),u){this._setState(s?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(r?4:3),this._list.reveal(n,0),this._list.setFocus(o?[]:[n])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=W9(()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(Ele(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=W9(()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const n=this._persistedSize.restore(),r=Math.ceil(this.getLayoutInfo().itemHeight*4.3);n&&n.height<r&&this._persistedSize.store(n.with(void 0,r))}isFrozen(){return this._state===4}_afterRender(e){if(e===null){this._isDetailsVisible()&&this._details.hide();return}this._state===2||this._state===1||(this._isDetailsVisible()&&this._details.show(),this._positionDetails())}_layout(e){var n,r,s;if(!this.editor.hasModel()||!this.editor.getDomNode())return;const o=FI(this.element.domNode.ownerDocument.body),a=this.getLayoutInfo();e||(e=a.defaultSize);let l=e.height,c=e.width;if(this._status.element.style.height=`${a.itemHeight}px`,this._state===2||this._state===1)l=a.itemHeight+a.borderHeight,c=a.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new bi(c,l),this._contentWidget.setPreference(2);else{const u=o.width-a.borderHeight-2*a.horizontalPadding;c>u&&(c=u);const d=this._completionModel?this._completionModel.stats.pLabelLen*a.typicalHalfwidthCharacterWidth:c,h=a.statusBarHeight+this._list.contentHeight+a.borderHeight,f=a.itemHeight+a.statusBarHeight,p=no(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),m=p.top+g.top+g.height,_=Math.min(o.height-m-a.verticalPadding,h),b=p.top+g.top-a.verticalPadding,y=Math.min(b,h);let x=Math.min(Math.max(y,_)+a.borderHeight,h);l===((n=this._cappedHeight)===null||n===void 0?void 0:n.capped)&&(l=this._cappedHeight.wanted),l<f&&(l=f),l>x&&(l=x),l>_||this._forceRenderingAbove&&b>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),x=y):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),x=_),this.element.preferredSize=new bi(d,a.defaultSize.height),this.element.maxSize=new bi(u,x),this.element.minSize=new bi(220,f),this._cappedHeight=l===h?{wanted:(s=(r=this._cappedHeight)===null||r===void 0?void 0:r.wanted)!==null&&s!==void 0?s:e.height,capped:l}:void 0}this._resize(c,l)}_resize(e,n){const{width:r,height:s}=this.element.maxSize;e=Math.min(r,e),n=Math.min(s,n);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(n-o,e),this._listElement.style.height=`${n-o}px`,this.element.layout(n,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),n=Kc(this.editor.getOption(119)||e.lineHeight,8,1e3),r=!this.editor.getOption(117).showStatusBar||this._state===2||this._state===1?0:n,s=this._details.widget.borderWidth,o=2*s;return{itemHeight:n,statusBarHeight:r,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new bi(430,r+12*n+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};bO.LOADING_MESSAGE=L("suggestWidget.loading","Loading...");bO.NO_SUGGESTIONS_MESSAGE=L("suggestWidget.noSuggestions","No suggestions.");bO=UD=TTt([q6(1,jf),q6(2,mn),q6(3,Do),q6(4,hn)],bO);class MTt{constructor(e,n){this._widget=e,this._editor=n,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:n}=this._widget.element.size,{borderWidth:r,horizontalPadding:s}=this._widget.getLayoutInfo();return new bi(n+2*r+s,e+2*r)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var PTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},dD=function(i,e){return function(n,r){e(n,r,i)}},Rne;class OTt{constructor(e,n){if(this._model=e,this._position=n,e.getLineMaxColumn(n.lineNumber)!==n.column){const s=e.getOffsetAt(n),o=e.getPositionAt(s+1);this._marker=e.deltaDecorations([],[{range:J.fromPositions(n,o),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const n=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(n.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let yf=Rne=class{static get(e){return e.getContribution(Rne.ID)}constructor(e,n,r,s,o,a,l){this._memoryService=n,this._commandService=r,this._contextKeyService=s,this._instantiationService=o,this._logService=a,this._telemetryService=l,this._lineSuffix=new ha,this._toDispose=new Xe,this._selectors=new FTt(h=>h.priority),this._onWillInsertSuggestItem=new _e,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(Dne,this.editor),this._selectors.register({priority:0,select:(h,f,p)=>this._memoryService.select(h,f,p)});const c=Tn.InsertMode.bindTo(s);c.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>c.set(e.getOption(117).insertMode))),this.widget=this._toDispose.add(new a8(()=>{const h=this._instantiationService.createInstance(bO,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(_=>this._insertSuggestion(_,0),this));const f=new pTt(this.editor,h,this.model,_=>this._insertSuggestion(_,2));this._toDispose.add(f);const p=Tn.MakesTextEdit.bindTo(this._contextKeyService),g=Tn.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Tn.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(gn(()=>{p.reset(),g.reset(),m.reset()})),this._toDispose.add(h.onDidFocus(({item:_})=>{const b=this.editor.getPosition(),y=_.editStart.column,x=b.column;let k=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!_.completion.additionalTextEdits&&!(_.completion.insertTextRules&4)&&x-y===_.completion.insertText.length&&(k=this.editor.getModel().getValueInRange({startLineNumber:b.lineNumber,startColumn:y,endLineNumber:b.lineNumber,endColumn:x})!==_.completion.insertText),p.set(k),g.set(!ve.equals(_.editInsertEnd,_.editReplaceEnd)),m.set(!!_.provider.resolveCompletionItem||!!_.completion.documentation||_.completion.detail!==_.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(_=>{if(_.toKeyCodeChord().equals(new Iv(!0,!1,!1,!1,33))||ri&&_.toKeyCodeChord().equals(new Iv(!1,!1,!1,!0,33))){_.stopPropagation();return}_.toKeyCodeChord().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new a8(()=>this._toDispose.add(new $z(this.editor,this.model)))),this._alternatives=this._toDispose.add(new a8(()=>this._toDispose.add(new Rx(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(vO,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new OTt(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(h.triggerOptions.shy)return;let f=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(f=g.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),f!==-1)break;f===-1&&(f=0);let p=!1;if(h.triggerOptions.auto){const g=this.editor.getOption(117);g.selectionMode==="never"||g.selectionMode==="always"?p=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?p=h.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(p=h.triggerOptions.triggerKind===1&&!h.triggerOptions.refilter)}this.widget.value.showSuggestions(h.completionModel,f,h.isFrozen,h.triggerOptions.auto,p)})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const u=Tn.AcceptSuggestionsOnEnter.bindTo(s),d=()=>{const h=this.editor.getOption(1);u.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,n){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const r=fa.get(this.editor);if(!r)return;this._onWillInsertSuggestItem.fire({item:e.item});const s=this.editor.getModel(),o=s.getAlternativeVersionId(),{item:a}=e,l=[],c=new Ns;n&1||this.editor.pushUndoStop();const u=this.getOverwriteInfo(a,!!(n&8));this._memoryService.memorize(s,this.editor.getPosition(),a);const d=a.isResolved;let h=-1,f=-1;if(Array.isArray(a.completion.additionalTextEdits)){this.model.cancel();const g=Qp.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",a.completion.additionalTextEdits.map(m=>Vr.replaceMove(J.lift(m.range),m.text))),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const g=new Xa;let m;const _=s.onDidChangeContent(k=>{if(k.isFlush){c.cancel(),_.dispose();return}for(const D of k.changes){const R=J.getEndPosition(D.range);(!m||ve.isBefore(R,m))&&(m=R)}}),b=n;n|=2;let y=!1;const x=this.editor.onWillType(()=>{x.dispose(),y=!0,b&2||this.editor.pushUndoStop()});l.push(a.resolve(c.token).then(()=>{if(!a.completion.additionalTextEdits||c.token.isCancellationRequested)return;if(m&&a.completion.additionalTextEdits.some(D=>ve.isBefore(m,J.getStartPosition(D.range))))return!1;y&&this.editor.pushUndoStop();const k=Qp.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",a.completion.additionalTextEdits.map(D=>Vr.replaceMove(J.lift(D.range),D.text))),k.restoreRelativeVerticalPositionOfCursor(this.editor),(y||!(b&2))&&this.editor.pushUndoStop(),!0}).then(k=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),k),f=k===!0?1:k===!1?0:-2}).finally(()=>{_.dispose(),x.dispose()}))}let{insertText:p}=a.completion;if(a.completion.insertTextRules&4||(p=dI.escape(p)),this.model.cancel(),r.insert(p,{overwriteBefore:u.overwriteBefore,overwriteAfter:u.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(a.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),n&2||this.editor.pushUndoStop(),a.completion.command)if(a.completion.command.id===l4.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Xa;l.push(this._commandService.executeCommand(a.completion.command.id,...a.completion.command.arguments?[...a.completion.command.arguments]:[]).catch(m=>{a.completion.extensionId?Us(m):Ln(m)}).finally(()=>{h=g.elapsed()}))}n&4&&this._alternatives.value.set(e,g=>{for(c.cancel();s.canUndo();){o!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(g,3|(n&8?8:0));break}}),this._alertCompletionItem(a),Promise.all(l).finally(()=>{this._reportSuggestionAcceptedTelemetry(a,s,d,h,f),this.model.clear(),c.dispose()})}_reportSuggestionAcceptedTelemetry(e,n,r,s,o){var a,l,c;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(l=(a=e.extensionId)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"unknown",providerId:(c=e.provider._debugDisplayName)!==null&&c!==void 0?c:"unknown",kind:e.completion.kind,basenameHash:KEe(yh(n.uri)).toString(16),languageId:n.getLanguageId(),fileExtension:Ygt(n.uri),resolveInfo:e.provider.resolveCompletionItem?r?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:s,additionalEditsAsync:o})}getOverwriteInfo(e,n){Ui(this.editor.hasModel());let r=this.editor.getOption(117).insertMode==="replace";n&&(r=!r);const s=e.position.column-e.editStart.column,o=(r?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,a=this.editor.getPosition().column-e.position.column,l=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+a,overwriteAfter:o+l}}_alertCompletionItem(e){if(Ka(e.completion.additionalTextEdits)){const n=L("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Ua(n)}}triggerSuggest(e,n,r){this.editor.hasModel()&&(this.model.trigger({auto:n??!1,completionOptions:{providerFilter:e,kindFilter:r?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const n=this.editor.getPosition(),r=()=>{n.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const a=this.editor.getPosition(),l=o.editStart.column,c=a.column;return c-l!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:a.lineNumber,startColumn:l,endLineNumber:a.lineNumber,endColumn:c})!==o.completion.insertText};_t.once(this.model.onDidTrigger)(o=>{const a=[];_t.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{Mi(a),r()},void 0,a),this.model.onDidSuggest(({completionModel:l})=>{if(Mi(a),l.items.length===0){r();return}const c=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),l.items),u=l.items[c];if(!s(u)){r();return}this.editor.pushUndoStop(),this._insertSuggestion({index:c,item:u,model:l},7)},void 0,a)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(n,0),this.editor.focus()}acceptSelectedSuggestion(e,n){const r=this.widget.value.getFocusedItem();let s=0;e&&(s|=4),n&&(s|=8),this._insertSuggestion(r,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};yf.ID="editor.contrib.suggestController";yf=Rne=PTt([dD(1,Wz),dD(2,us),dD(3,mn),dD(4,hn),dD(5,vd),dD(6,_d)],yf);class FTt{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((n,r)=>this.prioritySelector(r)-this.prioritySelector(n)),{dispose:()=>{const n=this._items.indexOf(e);n>=0&&this._items.splice(n,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class l4 extends kt{constructor(){super({id:l4.id,label:L("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:ze.and(oe.writable,oe.hasCompletionItemProvider,Tn.Visible.toNegated()),kbOpts:{kbExpr:oe.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,n,r){const s=yf.get(n);if(!s)return;let o;r&&typeof r=="object"&&r.auto===!0&&(o=!0),s.triggerSuggest(void 0,o,void 0)}}l4.id="editor.action.triggerSuggest";_i(yf.ID,yf,2);rt(l4);const pd=190,Xl=Ho.bindToContribution(yf.get);ct(new Xl({id:"acceptSelectedSuggestion",precondition:ze.and(Tn.Visible,Tn.HasFocusedSuggestion),handler(i){i.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:ze.and(Tn.Visible,oe.textInputFocus),weight:pd},{primary:3,kbExpr:ze.and(Tn.Visible,oe.textInputFocus,Tn.AcceptSuggestionsOnEnter,Tn.MakesTextEdit),weight:pd}],menuOpts:[{menuId:Qy,title:L("accept.insert","Insert"),group:"left",order:1,when:Tn.HasInsertAndReplaceRange.toNegated()},{menuId:Qy,title:L("accept.insert","Insert"),group:"left",order:1,when:ze.and(Tn.HasInsertAndReplaceRange,Tn.InsertMode.isEqualTo("insert"))},{menuId:Qy,title:L("accept.replace","Replace"),group:"left",order:1,when:ze.and(Tn.HasInsertAndReplaceRange,Tn.InsertMode.isEqualTo("replace"))}]}));ct(new Xl({id:"acceptAlternativeSelectedSuggestion",precondition:ze.and(Tn.Visible,oe.textInputFocus,Tn.HasFocusedSuggestion),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:1027,secondary:[1026]},handler(i){i.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Qy,group:"left",order:2,when:ze.and(Tn.HasInsertAndReplaceRange,Tn.InsertMode.isEqualTo("insert")),title:L("accept.replace","Replace")},{menuId:Qy,group:"left",order:2,when:ze.and(Tn.HasInsertAndReplaceRange,Tn.InsertMode.isEqualTo("replace")),title:L("accept.insert","Insert")}]}));si.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");ct(new Xl({id:"hideSuggestWidget",precondition:Tn.Visible,handler:i=>i.cancelSuggestWidget(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:9,secondary:[1033]}}));ct(new Xl({id:"selectNextSuggestion",precondition:ze.and(Tn.Visible,ze.or(Tn.MultipleSuggestions,Tn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextSuggestion(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));ct(new Xl({id:"selectNextPageSuggestion",precondition:ze.and(Tn.Visible,ze.or(Tn.MultipleSuggestions,Tn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextPageSuggestion(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:12,secondary:[2060]}}));ct(new Xl({id:"selectLastSuggestion",precondition:ze.and(Tn.Visible,ze.or(Tn.MultipleSuggestions,Tn.HasFocusedSuggestion.negate())),handler:i=>i.selectLastSuggestion()}));ct(new Xl({id:"selectPrevSuggestion",precondition:ze.and(Tn.Visible,ze.or(Tn.MultipleSuggestions,Tn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevSuggestion(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));ct(new Xl({id:"selectPrevPageSuggestion",precondition:ze.and(Tn.Visible,ze.or(Tn.MultipleSuggestions,Tn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevPageSuggestion(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:11,secondary:[2059]}}));ct(new Xl({id:"selectFirstSuggestion",precondition:ze.and(Tn.Visible,ze.or(Tn.MultipleSuggestions,Tn.HasFocusedSuggestion.negate())),handler:i=>i.selectFirstSuggestion()}));ct(new Xl({id:"focusSuggestion",precondition:ze.and(Tn.Visible,Tn.HasFocusedSuggestion.negate()),handler:i=>i.focusSuggestion(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));ct(new Xl({id:"focusAndAcceptSuggestion",precondition:ze.and(Tn.Visible,Tn.HasFocusedSuggestion.negate()),handler:i=>{i.focusSuggestion(),i.acceptSelectedSuggestion(!0,!1)}}));ct(new Xl({id:"toggleSuggestionDetails",precondition:ze.and(Tn.Visible,Tn.HasFocusedSuggestion),handler:i=>i.toggleSuggestionDetails(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Qy,group:"right",order:1,when:ze.and(Tn.DetailsVisible,Tn.CanResolve),title:L("detail.more","show less")},{menuId:Qy,group:"right",order:1,when:ze.and(Tn.DetailsVisible.toNegated(),Tn.CanResolve),title:L("detail.less","show more")}]}));ct(new Xl({id:"toggleExplainMode",precondition:Tn.Visible,handler:i=>i.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));ct(new Xl({id:"toggleSuggestionFocus",precondition:Tn.Visible,handler:i=>i.toggleSuggestionFocus(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:2570,mac:{primary:778}}}));ct(new Xl({id:"insertBestCompletion",precondition:ze.and(oe.textInputFocus,ze.equals("config.editor.tabCompletion","on"),vO.AtEnd,Tn.Visible.toNegated(),Rx.OtherSuggestions.toNegated(),fa.InSnippetMode.toNegated()),handler:(i,e)=>{i.triggerSuggestAndAcceptBest(Bl(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:pd,primary:2}}));ct(new Xl({id:"insertNextSuggestion",precondition:ze.and(oe.textInputFocus,ze.equals("config.editor.tabCompletion","on"),Rx.OtherSuggestions,Tn.Visible.toNegated(),fa.InSnippetMode.toNegated()),handler:i=>i.acceptNextSuggestion(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:2}}));ct(new Xl({id:"insertPrevSuggestion",precondition:ze.and(oe.textInputFocus,ze.equals("config.editor.tabCompletion","on"),Rx.OtherSuggestions,Tn.Visible.toNegated(),fa.InSnippetMode.toNegated()),handler:i=>i.acceptPrevSuggestion(),kbOpts:{weight:pd,kbExpr:oe.textInputFocus,primary:1026}}));rt(class extends kt{constructor(){super({id:"editor.action.resetSuggestSize",label:L("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(i,e){var n;(n=yf.get(e))===null||n===void 0||n.resetWidgetSize()}});class BTt extends Le{get selectedItem(){return this._selectedItem}constructor(e,n,r,s){super(),this.editor=e,this.suggestControllerPreselector=n,this.checkModelVersion=r,this.onWillAccept=s,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=vr(this,void 0),this._register(e.onKeyDown(a=>{a.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(a=>{a.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=yf.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(c,u,d)=>{var h;Pr(b=>this.checkModelVersion(b));const f=this.editor.getModel();if(!f)return-1;const p=(h=this.suggestControllerPreselector())===null||h===void 0?void 0:h.removeCommonPrefix(f);if(!p)return-1;const g=ve.lift(u),m=d.map((b,y)=>{const k=kM.fromSuggestion(o,f,g,b,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(f),D=p.augments(k);return{index:y,valid:D,prefixLength:k.text.length,suggestItem:b}}).filter(b=>b&&b.valid&&b.prefixLength>0),_=YEe(m,ch(b=>b.prefixLength,fv));return _?_.index:-1}}));let a=!1;const l=()=>{a||(a=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(_t.once(o.model.onDidTrigger)(c=>{l()})),this._register(o.onWillInsertSuggestItem(c=>{const u=this.editor.getPosition(),d=this.editor.getModel();if(!u||!d)return;const h=kM.fromSuggestion(o,d,u,c.item,this.isShiftKeyPressed);this.onWillAccept(h)}))}this.update(this._isActive)}update(e){const n=this.getSuggestItemInfo();(this._isActive!==e||!jTt(this._currentSuggestItemInfo,n))&&(this._isActive=e,this._currentSuggestItemInfo=n,Pr(r=>{this.checkModelVersion(r),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,r)}))}getSuggestItemInfo(){const e=yf.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const n=e.widget.value.getFocusedItem(),r=this.editor.getPosition(),s=this.editor.getModel();if(!(!n||!r||!s))return kM.fromSuggestion(e,s,r,n.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=yf.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=yf.get(this.editor);e==null||e.forceRenderingAbove()}}class kM{static fromSuggestion(e,n,r,s,o){let{insertText:a}=s.completion,l=!1;if(s.completion.insertTextRules&4){const u=new dI().parse(a);u.children.length<100&&yj.adjustWhitespace(n,r,!0,u),a=u.toString(),l=!0}const c=e.getOverwriteInfo(s,o);return new kM(J.fromPositions(r.delta(0,-c.overwriteBefore),r.delta(0,Math.max(c.overwriteAfter,0))),a,s.completion.kind,l)}constructor(e,n,r,s){this.range=e,this.insertText=n,this.completionItemKind=r,this.isSnippetText=s}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new U2e(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new hI(this.range,this.insertText)}}function jTt(i,e){return i===e?!0:!i||!e?!1:i.equals(e)}var WTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},$b=function(i,e){return function(n,r){e(n,r,i)}},Ane;let gd=Ane=class extends Le{static get(e){return e.getContribution(Ane.ID)}constructor(e,n,r,s,o,a,l,c,u){super(),this.editor=e,this.instantiationService=n,this.contextKeyService=r,this.configurationService=s,this.commandService=o,this.debounceService=a,this.languageFeaturesService=l,this.audioCueService=c,this._keybindingService=u,this.model=q7("inlineCompletionModel",void 0),this.textModelVersionId=vr(this,-1),this.cursorPosition=vr(this,new ve(1,1)),this.suggestWidgetAdaptor=this._register(new BTt(this.editor,()=>{var f,p;return(p=(f=this.model.get())===null||f===void 0?void 0:f.selectedInlineCompletion.get())===null||p===void 0?void 0:p.toSingleTextEdit(void 0)},f=>this.updateObservables(f,ju.Other),f=>{Pr(p=>{var g;this.updateObservables(p,ju.Other),(g=this.model.get())===null||g===void 0||g.handleSuggestAccepted(f)})})),this._enabled=oa(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(Cne,this.editor,{ghostText:this.model.map((f,p)=>f==null?void 0:f.ghostText.read(p)),minReservedLineCount:K7(0),targetTextModel:this.model.map(f=>f==null?void 0:f.textModel)})),this._debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(new $o(this.contextKeyService,this.model)),this._register(_t.runAndSubscribe(e.onDidChangeModel,()=>Pr(f=>{this.model.set(void 0,f),this.updateObservables(f,ju.Other);const p=e.getModel();if(p){const g=n.createInstance(xne,p,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,oa(e.onDidChangeConfiguration,()=>e.getOption(117).preview),oa(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),oa(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(g,f)}})));const d=f=>{var p;return f.isUndoing?ju.Undo:f.isRedoing?ju.Redo:!((p=this.model.get())===null||p===void 0)&&p.isAcceptingPartially?ju.AcceptWord:ju.Other};this._register(e.onDidChangeModelContent(f=>Pr(p=>this.updateObservables(p,d(f))))),this._register(e.onDidChangeCursorPosition(f=>Pr(p=>{var g;this.updateObservables(p,ju.Other),(f.reason===3||f.source==="api")&&((g=this.model.get())===null||g===void 0||g.stop(p))}))),this._register(e.onDidType(()=>Pr(f=>{var p;this.updateObservables(f,ju.Other),this._enabled.get()&&((p=this.model.get())===null||p===void 0||p.trigger(f))}))),this._register(this.commandService.onDidExecuteCommand(f=>{new Set([G2.Tab.id,G2.DeleteLeft.id,G2.DeleteRight.id,KNe,"acceptSelectedSuggestion"]).has(f.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Pr(g=>{var m;(m=this.model.get())===null||m===void 0||m.trigger(g)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||R1.dropDownVisible||Pr(f=>{var p;(p=this.model.get())===null||p===void 0||p.stop(f)})})),this._register(ur(f=>{var p;const g=(p=this.model.read(f))===null||p===void 0?void 0:p.state.read(f);g!=null&&g.suggestItem?g.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(gn(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let h;this._register(ur(f=>{const p=this.model.read(f),g=p==null?void 0:p.state.read(f);if(!p||!g||!g.inlineCompletion){h=void 0;return}if(g.inlineCompletion.semanticId!==h){h=g.inlineCompletion.semanticId;const m=p.textModel.getLineContent(g.ghostText.lineNumber);this.audioCueService.playAudioCue(fi.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(g.ghostText.renderForScreenReader(m))})}})),this._register(new Jte(this.editor,this.model,this.instantiationService)),this._register(this.configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}provideScreenReaderUpdate(e){const n=this.contextKeyService.getContextKeyValue("accessibleViewIsShown"),r=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let s;!n&&r&&this.editor.getOption(147)&&(s=L("showAccessibleViewHint","Inspect this in the accessible view ({0})",r.getAriaLabel())),Ua(s?e+", "+s:e)}updateObservables(e,n){var r,s;const o=this.editor.getModel();this.textModelVersionId.set((r=o==null?void 0:o.getVersionId())!==null&&r!==void 0?r:-1,e,n),this.cursorPosition.set((s=this.editor.getPosition())!==null&&s!==void 0?s:new ve(1,1),e)}shouldShowHoverAt(e){var n;const r=(n=this.model.get())===null||n===void 0?void 0:n.ghostText.get();return r?r.parts.some(s=>e.containsPosition(new ve(r.lineNumber,s.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};gd.ID="editor.contrib.inlineCompletionsController";gd=Ane=WTt([$b(1,hn),$b(2,mn),$b(3,ei),$b(4,us),$b(5,xh),$b(6,Et),$b(7,X5),$b(8,sr)],gd);var J1=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class zz extends kt{constructor(){super({id:zz.ID,label:L("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:ze.and(oe.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,n){var r;return J1(this,void 0,void 0,function*(){const s=gd.get(n);(r=s==null?void 0:s.model.get())===null||r===void 0||r.next()})}}zz.ID=XNe;class Vz extends kt{constructor(){super({id:Vz.ID,label:L("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:ze.and(oe.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,n){var r;return J1(this,void 0,void 0,function*(){const s=gd.get(n);(r=s==null?void 0:s.model.get())===null||r===void 0||r.previous()})}}Vz.ID=GNe;class $Tt extends kt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:L("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:oe.writable})}run(e,n){var r;return J1(this,void 0,void 0,function*(){const s=gd.get(n);(r=s==null?void 0:s.model.get())===null||r===void 0||r.triggerExplicitly()})}}class zTt extends kt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:L("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:ze.and(oe.writable,$o.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:ze.and(oe.writable,$o.inlineSuggestionVisible)},menuOpts:[{menuId:se.InlineSuggestionToolbar,title:L("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,n){var r;return J1(this,void 0,void 0,function*(){const s=gd.get(n);yield(r=s==null?void 0:s.model.get())===null||r===void 0?void 0:r.acceptNextWord(s.editor)})}}class VTt extends kt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:L("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:ze.and(oe.writable,$o.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:se.InlineSuggestionToolbar,title:L("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,n){var r;return J1(this,void 0,void 0,function*(){const s=gd.get(n);yield(r=s==null?void 0:s.model.get())===null||r===void 0?void 0:r.acceptNextLine(s.editor)})}}class HTt extends kt{constructor(){super({id:KNe,label:L("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:$o.inlineSuggestionVisible,menuOpts:[{menuId:se.InlineSuggestionToolbar,title:L("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:ze.and($o.inlineSuggestionVisible,oe.tabMovesFocus.toNegated(),$o.inlineSuggestionHasIndentationLessThanTabSize,Tn.Visible.toNegated(),oe.hoverFocused.toNegated())}})}run(e,n){var r;return J1(this,void 0,void 0,function*(){const s=gd.get(n);s&&((r=s.model.get())===null||r===void 0||r.accept(s.editor),s.editor.focus())})}}class Hz extends kt{constructor(){super({id:Hz.ID,label:L("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:$o.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,n){return J1(this,void 0,void 0,function*(){const r=gd.get(n);Pr(s=>{var o;(o=r==null?void 0:r.model.get())===null||o===void 0||o.stop(s)})})}}Hz.ID="editor.action.inlineSuggest.hide";class Uz extends md{constructor(){super({id:Uz.ID,title:L("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:se.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:ze.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,n){return J1(this,void 0,void 0,function*(){const r=e.get(ei),o=r.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";r.updateValue("editor.inlineSuggest.showToolbar",o)})}}Uz.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var UTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},dA=function(i,e){return function(n,r){e(n,r,i)}};class qTt{constructor(e,n,r){this.owner=e,this.range=n,this.controller=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Nne=class{constructor(e,n,r,s,o,a){this._editor=e,this._languageService=n,this._openerService=r,this.accessibilityService=s,this._instantiationService=o,this._telemetryService=a,this.hoverOrdinal=4}suggestHoverAnchor(e){const n=gd.get(this._editor);if(!n)return null;const r=e.target;if(r.type===8){const s=r.detail;if(n.shouldShowHoverAtViewZone(s.viewZoneId))return new A8(1e3,this,J.fromPositions(this._editor.getModel().validatePosition(s.positionBefore||s.position)),e.event.posx,e.event.posy,!1)}return r.type===7&&n.shouldShowHoverAt(r.range)?new A8(1e3,this,r.range,e.event.posx,e.event.posy,!1):r.type===6&&r.detail.mightBeForeignElement&&n.shouldShowHoverAt(r.range)?new A8(1e3,this,r.range,e.event.posx,e.event.posy,!1):null}computeSync(e,n){if(this._editor.getOption(62).showToolbar==="always")return[];const r=gd.get(this._editor);return r&&r.shouldShowHoverAt(e.range)?[new qTt(this,e.range,r)]:[]}renderHoverParts(e,n){const r=new Xe,s=n[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,s,r);const o=s.controller.model.get(),a=this._instantiationService.createInstance(R1,this._editor,!1,K7(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]}));return e.fragment.appendChild(a.getDomNode()),o.triggerExplicitly(),r.add(a),r}renderScreenReaderText(e,n,r){const s=tt,o=s("div.hover-row.markdown-hover"),a=He(o,s("div.hover-contents",{"aria-live":"assertive"})),l=r.add(new Rv({editor:this._editor},this._languageService,this._openerService)),c=u=>{r.add(l.onDidRenderAsync(()=>{a.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=L("inlineSuggestionFollows","Suggestion:"),h=r.add(l.render(new Ea().appendText(d).appendCodeblock("text",u)));a.replaceChildren(h.element)};r.add(ur(u=>{var d;const h=(d=n.controller.model.read(u))===null||d===void 0?void 0:d.ghostText.read(u);if(h){const f=this._editor.getModel().getLineContent(h.lineNumber);c(h.renderForScreenReader(f))}else ca(a)})),e.fragment.appendChild(o)}};Nne=UTt([dA(1,Ar),dA(2,fu),dA(3,zv),dA(4,hn),dA(5,_d)],Nne);_i(gd.ID,gd,3);rt($Tt);rt(zz);rt(Vz);rt(zTt);rt(VTt);rt(HTt);rt(Hz);Ir(Uz);uk.register(Nne);function Uc(i,e){let n=0;for(let r=0;r<i.length;r++)i.charAt(r)===" "?n+=e:n++;return n}function LM(i,e,n){i=i<0?0:i;let r="";if(!n){const s=Math.floor(i/e);i=i%e;for(let o=0;o<s;o++)r+=" "}for(let s=0;s<i;s++)r+=" ";return r}var KTt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},GTt=function(i,e){return function(n,r){e(n,r,i)}};function OMe(i,e,n,r,s){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(i.getLanguageId()).indentationRules;if(!o)return[];for(r=Math.min(r,i.getLineCount());n<=r&&o.unIndentedLinePattern;){const _=i.getLineContent(n);if(!o.unIndentedLinePattern.test(_))break;n++}if(n>r-1)return[];const{tabSize:a,indentSize:l,insertSpaces:c}=i.getOptions(),u=(_,b)=>(b=b||1,nh.shiftIndent(_,_.length+b,a,l,c)),d=(_,b)=>(b=b||1,nh.unshiftIndent(_,_.length+b,a,l,c)),h=[];let f;const p=i.getLineContent(n);let g=p;f=ar(p);let m=f;o.increaseIndentPattern&&o.increaseIndentPattern.test(g)?(m=u(m),f=u(f)):o.indentNextLinePattern&&o.indentNextLinePattern.test(g)&&(m=u(m)),n++;for(let _=n;_<=r;_++){const b=i.getLineContent(_),y=ar(b),x=m+b.substring(y.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(x)&&(m=d(m),f=d(f)),y!==m&&h.push(Vr.replaceMove(new Ft(_,1,_,y.length+1),Loe(m,l,c))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(b))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(x)?(f=u(f),m=f):o.indentNextLinePattern&&o.indentNextLinePattern.test(x)?m=u(m):m=f)}return h}class qz extends kt{constructor(){super({id:qz.ID,label:L("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:oe.writable})}run(e,n){const r=n.getModel();if(!r)return;const s=r.getOptions(),o=n.getSelection();if(!o)return;const a=new QTt(o,s.tabSize);n.pushUndoStop(),n.executeCommands(this.id,[a]),n.pushUndoStop(),r.updateOptions({insertSpaces:!0})}}qz.ID="editor.action.indentationToSpaces";class Kz extends kt{constructor(){super({id:Kz.ID,label:L("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:oe.writable})}run(e,n){const r=n.getModel();if(!r)return;const s=r.getOptions(),o=n.getSelection();if(!o)return;const a=new JTt(o,s.tabSize);n.pushUndoStop(),n.executeCommands(this.id,[a]),n.pushUndoStop(),r.updateOptions({insertSpaces:!1})}}Kz.ID="editor.action.indentationToTabs";class Ile extends kt{constructor(e,n,r){super(r),this.insertSpaces=e,this.displaySizeOnly=n}run(e,n){const r=e.get(lg),s=e.get(Fr),o=n.getModel();if(!o)return;const a=s.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),l=o.getOptions(),c=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===a.tabSize&&d===l.tabSize?L("configuredTabSize","Configured Tab Size"):d===a.tabSize?L("defaultTabSize","Default Tab Size"):d===l.tabSize?L("currentTabSize","Current Tab Size"):void 0})),u=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{r.pick(c,{placeHolder:L({},"Select Tab Size for Current File"),activeItem:c[u]}).then(d=>{if(d&&o&&!o.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?o.updateOptions({tabSize:h}):o.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}class Gz extends Ile{constructor(){super(!1,!1,{id:Gz.ID,label:L("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}Gz.ID="editor.action.indentUsingTabs";class Xz extends Ile{constructor(){super(!0,!1,{id:Xz.ID,label:L("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}Xz.ID="editor.action.indentUsingSpaces";class Yz extends Ile{constructor(){super(!0,!0,{id:Yz.ID,label:L("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}Yz.ID="editor.action.changeTabDisplaySize";class Zz extends kt{constructor(){super({id:Zz.ID,label:L("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,n){const r=e.get(Fr),s=n.getModel();if(!s)return;const o=r.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(o.insertSpaces,o.tabSize)}}Zz.ID="editor.action.detectIndentation";class XTt extends kt{constructor(){super({id:"editor.action.reindentlines",label:L("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:oe.writable})}run(e,n){const r=e.get(dr),s=n.getModel();if(!s)return;const o=OMe(s,r,1,s.getLineCount());o.length>0&&(n.pushUndoStop(),n.executeEdits(this.id,o),n.pushUndoStop())}}class YTt extends kt{constructor(){super({id:"editor.action.reindentselectedlines",label:L("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:oe.writable})}run(e,n){const r=e.get(dr),s=n.getModel();if(!s)return;const o=n.getSelections();if(o===null)return;const a=[];for(const l of o){let c=l.startLineNumber,u=l.endLineNumber;if(c!==u&&l.endColumn===1&&u--,c===1){if(c===u)continue}else c--;const d=OMe(s,r,c,u);a.push(...d)}a.length>0&&(n.pushUndoStop(),n.executeEdits(this.id,a),n.pushUndoStop())}}class ZTt{constructor(e,n){this._initialSelection=n,this._edits=[],this._selectionId=null;for(const r of e)r.range&&typeof r.text=="string"&&this._edits.push(r)}getEditOperations(e,n){for(const s of this._edits)n.addEditOperation(J.lift(s.range),s.text);let r=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(r=!0,this._selectionId=n.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(r=!0,this._selectionId=n.trackSelection(this._initialSelection,!1))),r||(this._selectionId=n.trackSelection(this._initialSelection))}computeCursorState(e,n){return n.getTrackedSelection(this._selectionId)}}let yO=class{constructor(e,n){this.editor=e,this._languageConfigurationService=n,this.callOnDispose=new Xe,this.callOnModel=new Xe,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(12)<4||this.editor.getOption(55))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const n=this.editor.getSelections();if(n===null||n.length>1)return;const r=this.editor.getModel();if(!r||!r.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(12),{tabSize:o,indentSize:a,insertSpaces:l}=r.getOptions(),c=[],u={shiftIndent:p=>nh.shiftIndent(p,p.length+1,o,a,l),unshiftIndent:p=>nh.unshiftIndent(p,p.length+1,o,a,l)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(r,d)){d++;continue}break}if(d>e.endLineNumber)return;let h=r.getLineContent(d);if(!/\S/.test(h.substring(0,e.startColumn-1))){const p=rM(s,r,r.getLanguageId(),d,u,this._languageConfigurationService);if(p!==null){const g=ar(h),m=Uc(p,o),_=Uc(g,o);if(m!==_){const b=LM(m,o,l);c.push({range:new J(d,1,d,g.length+1),text:b}),h=b+h.substr(g.length)}else{const b=BIe(r,d,this._languageConfigurationService);if(b===0||b===8)return}}}const f=d;for(;d<e.endLineNumber;){if(!/\S/.test(r.getLineContent(d+1))){d++;continue}break}if(d!==e.endLineNumber){const g=rM(s,{tokenization:{getLineTokens:m=>r.tokenization.getLineTokens(m),getLanguageId:()=>r.getLanguageId(),getLanguageIdAtPosition:(m,_)=>r.getLanguageIdAtPosition(m,_)},getLineContent:m=>m===f?h:r.getLineContent(m)},r.getLanguageId(),d+1,u,this._languageConfigurationService);if(g!==null){const m=Uc(g,o),_=Uc(ar(r.getLineContent(d+1)),o);if(m!==_){const b=m-_;for(let y=d+1;y<=e.endLineNumber;y++){const x=r.getLineContent(y),k=ar(x),R=Uc(k,o)+b,E=LM(R,o,l);E!==k&&c.push({range:new J(y,1,y,k.length+1),text:E})}}}}if(c.length>0){this.editor.pushUndoStop();const p=new ZTt(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",p),this.editor.pushUndoStop()}}shouldIgnoreLine(e,n){e.tokenization.forceTokenization(n);const r=e.getLineFirstNonWhitespaceColumn(n);if(r===0)return!0;const s=e.tokenization.getLineTokens(n);if(s.getCount()>0){const o=s.findTokenIndexAtOffset(r);if(o>=0&&s.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};yO.ID="editor.contrib.autoIndentOnPaste";yO=KTt([GTt(1,dr)],yO);function FMe(i,e,n,r){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let s="";for(let a=0;a<n;a++)s+=" ";const o=new RegExp(s,"gi");for(let a=1,l=i.getLineCount();a<=l;a++){let c=i.getLineFirstNonWhitespaceColumn(a);if(c===0&&(c=i.getLineMaxColumn(a)),c===1)continue;const u=new J(a,1,a,c),d=i.getValueInRange(u),h=r?d.replace(/\t/ig,s):d.replace(o," ");e.addEditOperation(u,h)}}class QTt{constructor(e,n){this.selection=e,this.tabSize=n,this.selectionId=null}getEditOperations(e,n){this.selectionId=n.trackSelection(this.selection),FMe(e,n,this.tabSize,!0)}computeCursorState(e,n){return n.getTrackedSelection(this.selectionId)}}class JTt{constructor(e,n){this.selection=e,this.tabSize=n,this.selectionId=null}getEditOperations(e,n){this.selectionId=n.trackSelection(this.selection),FMe(e,n,this.tabSize,!1)}computeCursorState(e,n){return n.getTrackedSelection(this.selectionId)}}_i(yO.ID,yO,2);rt(qz);rt(Kz);rt(Gz);rt(Xz);rt(Yz);rt(Zz);rt(XTt);rt(YTt);var wj=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class BMe{constructor(e,n){this.range=e,this.direction=n}}class Tle{constructor(e,n,r){this.hint=e,this.anchor=n,this.provider=r,this._isResolved=!1}with(e){const n=new Tle(this.hint,e.anchor,this.provider);return n._isResolved=this._isResolved,n._currentResolve=this._currentResolve,n}resolve(e){return wj(this,void 0,void 0,function*(){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return yield this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var n,r;return wj(this,void 0,void 0,function*(){try{const s=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(n=s==null?void 0:s.tooltip)!==null&&n!==void 0?n:this.hint.tooltip,this.hint.label=(r=s==null?void 0:s.label)!==null&&r!==void 0?r:this.hint.label,this._isResolved=!0}catch(s){Us(s),this._isResolved=!1}})}}class wO{static create(e,n,r,s){return wj(this,void 0,void 0,function*(){const o=[],a=e.ordered(n).reverse().map(l=>r.map(c=>wj(this,void 0,void 0,function*(){try{const u=yield l.provideInlayHints(n,c,s);u!=null&&u.hints.length&&o.push([u,l])}catch(u){Us(u)}})));if(yield Promise.all(a.flat()),s.isCancellationRequested||n.isDisposed())throw new U1;return new wO(r,o,n)})}constructor(e,n,r){this._disposables=new Xe,this.ranges=e,this.provider=new Set;const s=[];for(const[o,a]of n){this._disposables.add(o),this.provider.add(a);for(const l of o.hints){const c=r.validatePosition(l.position);let u="before";const d=wO._getRangeAtPosition(r,c);let h;d.getStartPosition().isBefore(c)?(h=J.fromPositions(d.getStartPosition(),c),u="after"):(h=J.fromPositions(c,d.getEndPosition()),u="before"),s.push(new Tle(l,new BMe(h,u),a))}}this.items=s.sort((o,a)=>ve.compare(o.hint.position,a.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,n){const r=n.lineNumber,s=e.getWordAtPosition(n);if(s)return new J(r,s.startColumn,r,s.endColumn);e.tokenization.tokenizeIfCheap(r);const o=e.tokenization.getLineTokens(r),a=n.column-1,l=o.findTokenIndexAtOffset(a);let c=o.getStartOffset(l),u=o.getEndOffset(l);return u-c===1&&(c===a&&l>1?(c=o.getStartOffset(l-1),u=o.getEndOffset(l-1)):u===a&&l<o.getCount()-1&&(c=o.getStartOffset(l+1),u=o.getEndOffset(l+1))),new J(r,c+1,r,u+1)}}function eRt(i){return Jt.from({scheme:Pn.command,path:i.id,query:i.arguments&&encodeURIComponent(JSON.stringify(i.arguments))}).toString()}var DM=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function tRt(i,e,n,r){var s;return DM(this,void 0,void 0,function*(){const o=i.get(Ec),a=i.get(Ff),l=i.get(us),c=i.get(hn),u=i.get(Ps);if(yield r.item.resolve(Hn.None),!r.part.location)return;const d=r.part.location,h=[],f=new Set(sa.getMenuItems(se.EditorContext).map(g=>i2(g)?g.command.id:Iz()));for(const g of hl.all())f.has(g.desc.id)&&h.push(new Vl(g.desc.id,If.label(g.desc,{renderShortTitle:!0}),void 0,!0,()=>DM(this,void 0,void 0,function*(){const m=yield o.createModelReference(d.uri);try{const _=new sI(m.object.textEditorModel,J.getStartPosition(d.range)),b=r.item.anchor.range;yield c.invokeFunction(g.runEditorCommand.bind(g),e,_,b)}finally{m.dispose()}})));if(r.part.command){const{command:g}=r.part;h.push(new Vo),h.push(new Vl(g.id,g.title,void 0,!0,()=>DM(this,void 0,void 0,function*(){var m;try{yield l.executeCommand(g.id,...(m=g.arguments)!==null&&m!==void 0?m:[])}catch(_){u.notify({severity:F$.Error,source:r.item.provider.displayName,message:_})}})))}const p=e.getOption(126);a.showContextMenu({domForShadowRoot:p&&(s=e.getDomNode())!==null&&s!==void 0?s:void 0,getAnchor:()=>{const g=no(n);return{x:g.left,y:g.top+g.height+8}},getActions:()=>h,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function jMe(i,e,n,r){return DM(this,void 0,void 0,function*(){const o=yield i.get(Ec).createModelReference(r.uri);yield n.invokeWithinContext(a=>DM(this,void 0,void 0,function*(){const l=e.hasSideBySideModifier,c=a.get(mn),u=xc.inPeekEditor.getValue(c),d=!l&&n.getOption(87)&&!u;return new o4({openToSide:l,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(a,new sI(o.object.textEditorModel,J.getStartPosition(r.range)),J.lift(r.range))})),o.dispose()})}var nRt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},hD=function(i,e){return function(n,r){e(n,r,i)}},qD=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},O8;class Cj{constructor(){this._entries=new G1(50)}get(e){const n=Cj._key(e);return this._entries.get(n)}set(e,n){const r=Cj._key(e);this._entries.set(r,n)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const WMe=qn("IInlayHintsCache");oi(WMe,Cj,1);class Mne{constructor(e,n){this.item=e,this.index=n}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class iRt{constructor(e,n){this.part=e,this.hasTriggerModifier=n}}let Ax=O8=class{static get(e){var n;return(n=e.getContribution(O8.ID))!==null&&n!==void 0?n:void 0}constructor(e,n,r,s,o,a,l){this._editor=e,this._languageFeaturesService=n,this._inlayHintsCache=s,this._commandService=o,this._notificationService=a,this._instaService=l,this._disposables=new Xe,this._sessionDisposables=new Xe,this._decorationsMetadata=new Map,this._ruleFactory=new A5(this._editor),this._activeRenderMode=0,this._debounceInfo=r.for(n.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(n.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(c=>{c.hasChanged(139)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if(e.enabled==="off")return;const n=this._editor.getModel();if(!n||!this._languageFeaturesService.inlayHintsProvider.has(n))return;const r=this._inlayHintsCache.get(n);r&&this._updateHintsDecorators([n.getFullModelRange()],r),this._sessionDisposables.add(gn(()=>{n.isDisposed()||this._cacheHintsForFastRestore(n)}));let s;const o=new Set,a=new Ji(()=>qD(this,void 0,void 0,function*(){const l=Date.now();s==null||s.dispose(!0),s=new Ns;const c=n.onWillDispose(()=>s==null?void 0:s.cancel());try{const u=s.token,d=yield wO.create(this._languageFeaturesService.inlayHintsProvider,n,this._getHintsRanges(),u);if(a.delay=this._debounceInfo.update(n,Date.now()-l),u.isCancellationRequested){d.dispose();return}for(const h of d.provider)typeof h.onDidChangeInlayHints=="function"&&!o.has(h)&&(o.add(h),this._sessionDisposables.add(h.onDidChangeInlayHints(()=>{a.isScheduled()||a.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(n)}catch(u){Ln(u)}finally{s.dispose(),c.dispose()}}),this._debounceInfo.get(n));if(this._sessionDisposables.add(a),this._sessionDisposables.add(gn(()=>s==null?void 0:s.dispose(!0))),a.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(l=>{(l.scrollTopChanged||!a.isScheduled())&&a.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(l=>{const c=Math.max(a.delay,1250);a.schedule(c)})),e.enabled==="on")this._activeRenderMode=0;else{let l,c;e.enabled==="onUnlessPressed"?(l=0,c=1):(l=1,c=0),this._activeRenderMode=l,this._sessionDisposables.add(Y0.getInstance().event(u=>{if(!this._editor.hasModel())return;const d=u.altKey&&u.ctrlKey&&!(u.shiftKey||u.metaKey)?c:l;if(d!==this._activeRenderMode){this._activeRenderMode=d;const h=this._editor.getModel(),f=this._copyInlayHintsWithCurrentAnchor(h);this._updateHintsDecorators([h.getFullModelRange()],f),a.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>a.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Xe,n=e.add(new yz(this._editor)),r=new Xe;return e.add(r),e.add(n.onMouseMoveOrRelevantKeyDown(s=>{const[o]=s,a=this._getInlayHintLabelPart(o),l=this._editor.getModel();if(!a||!l){r.clear();return}const c=new Ns;r.add(gn(()=>c.dispose(!0))),a.item.resolve(c.token),this._activeInlayHintPart=a.part.command||a.part.location?new iRt(a,o.hasTriggerModifier):void 0;const u=l.validatePosition(a.item.hint.position).lineNumber,d=new J(u,1,u,l.getLineMaxColumn(u)),h=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],h),r.add(gn(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],h)}))})),e.add(n.onCancel(()=>r.clear())),e.add(n.onExecute(s=>qD(this,void 0,void 0,function*(){const o=this._getInlayHintLabelPart(s);if(o){const a=o.part;a.location?this._instaService.invokeFunction(jMe,s,this._editor,a.location):fQ.is(a.command)&&(yield this._invokeCommand(a.command,o.item))}}))),e}_getInlineHintsForRange(e){const n=new Set;for(const r of this._decorationsMetadata.values())e.containsRange(r.item.anchor.range)&&n.add(r.item);return Array.from(n)}_installDblClickGesture(e){return this._editor.onMouseUp(n=>qD(this,void 0,void 0,function*(){if(n.event.detail!==2)return;const r=this._getInlayHintLabelPart(n);if(r&&(n.event.preventDefault(),yield r.item.resolve(Hn.None),Ka(r.item.hint.textEdits))){const s=r.item.hint.textEdits.map(o=>Vr.replace(J.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",s),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>qD(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const n=this._getInlayHintLabelPart(e);n&&(yield this._instaService.invokeFunction(tRt,this._editor,e.event.target,n))}))}_getInlayHintLabelPart(e){var n;if(e.target.type!==6)return;const r=(n=e.target.detail.injectedText)===null||n===void 0?void 0:n.options;if(r instanceof S1&&(r==null?void 0:r.attachedData)instanceof Mne)return r.attachedData}_invokeCommand(e,n){var r;return qD(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(r=e.arguments)!==null&&r!==void 0?r:[])}catch(s){this._notificationService.notify({severity:F$.Error,source:n.provider.displayName,message:s})}})}_cacheHintsForFastRestore(e){const n=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,n)}_copyInlayHintsWithCurrentAnchor(e){const n=new Map;for(const[r,s]of this._decorationsMetadata){if(n.has(s.item))continue;const o=e.getDecorationRange(r);if(o){const a=new BMe(o,s.item.anchor.direction),l=s.item.with({anchor:a});n.set(s.item,l)}}return Array.from(n.values())}_getHintsRanges(){const n=this._editor.getModel(),r=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const o of r.sort(J.compareRangesUsingStarts)){const a=n.validateRange(new J(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));s.length===0||!J.areIntersectingOrTouching(s[s.length-1],a)?s.push(a):s[s.length-1]=J.plusRange(s[s.length-1],a)}return s}_updateHintsDecorators(e,n){var r,s;const o=[],a=(m,_,b,y,x)=>{const k={content:b,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:_.className,cursorStops:y,attachedData:x};o.push({item:m,classNameRef:_,decoration:{range:m.anchor.range,options:{description:"InlayHint",showIfCollapsed:m.anchor.range.isEmpty(),collapseOnReplaceEdit:!m.anchor.range.isEmpty(),stickiness:0,[m.anchor.direction]:this._activeRenderMode===0?k:void 0}}})},l=(m,_)=>{const b=this._ruleFactory.createClassNameRef({width:`${c/3|0}px`,display:"inline-block"});a(m,b,"",_?Mp.Right:Mp.None)},{fontSize:c,fontFamily:u,padding:d,isUniform:h}=this._getLayoutInfo(),f="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(f,u);for(const m of n){m.hint.paddingLeft&&l(m,!1);const _=typeof m.hint.label=="string"?[{label:m.hint.label}]:m.hint.label;for(let b=0;b<_.length;b++){const y=_[b],x=b===0,k=b===_.length-1,D={fontSize:`${c}px`,fontFamily:`var(${f}), ${su.fontFamily}`,verticalAlign:h?"baseline":"middle",unicodeBidi:"isolate"};Ka(m.hint.textEdits)&&(D.cursor="default"),this._fillInColors(D,m.hint),(y.command||y.location)&&((r=this._activeInlayHintPart)===null||r===void 0?void 0:r.part.item)===m&&this._activeInlayHintPart.part.index===b&&(D.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(D.color=Qr(Udt),D.cursor="pointer")),d&&(x&&k?(D.padding=`1px ${Math.max(1,c/4)|0}px`,D.borderRadius=`${c/4|0}px`):x?(D.padding=`1px 0 1px ${Math.max(1,c/4)|0}px`,D.borderRadius=`${c/4|0}px 0 0 ${c/4|0}px`):k?(D.padding=`1px ${Math.max(1,c/4)|0}px 1px 0`,D.borderRadius=`0 ${c/4|0}px ${c/4|0}px 0`):D.padding="1px 0 1px 0"),a(m,this._ruleFactory.createClassNameRef(D),rRt(y.label),k&&!m.hint.paddingRight?Mp.Right:Mp.None,new Mne(m,b))}if(m.hint.paddingRight&&l(m,!0),o.length>O8._MAX_DECORATORS)break}const p=[];for(const m of e)for(const{id:_}of(s=this._editor.getDecorationsInRange(m))!==null&&s!==void 0?s:[]){const b=this._decorationsMetadata.get(_);b&&(p.push(_),b.classNameRef.dispose(),this._decorationsMetadata.delete(_))}const g=Qp.capture(this._editor);this._editor.changeDecorations(m=>{const _=m.deltaDecorations(p,o.map(b=>b.decoration));for(let b=0;b<_.length;b++){const y=o[b];this._decorationsMetadata.set(_[b],y)}}),g.restore(this._editor)}_fillInColors(e,n){n.kind===P9.Parameter?(e.backgroundColor=Qr(Xdt),e.color=Qr(Gdt)):n.kind===P9.Type?(e.backgroundColor=Qr(Kdt),e.color=Qr(qdt)):(e.backgroundColor=Qr(tv),e.color=Qr(ev))}_getLayoutInfo(){const e=this._editor.getOption(139),n=e.padding,r=this._editor.getOption(52),s=this._editor.getOption(49);let o=e.fontSize;(!o||o<5||o>r)&&(o=r);const a=e.fontFamily||s;return{fontSize:o,fontFamily:a,padding:n,isUniform:!n&&a===s&&o===r}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};Ax.ID="editor.contrib.InlayHints";Ax._MAX_DECORATORS=1500;Ax=O8=nRt([hD(1,Et),hD(2,xh),hD(3,WMe),hD(4,us),hD(5,Ps),hD(6,hn)],Ax);function rRt(i){return i.replace(/[ \t]/g," ")}si.registerCommand("_executeInlayHintProvider",(i,...e)=>qD(void 0,void 0,void 0,function*(){const[n,r]=e;Ui(Jt.isUri(n)),Ui(J.isIRange(r));const{inlayHintsProvider:s}=i.get(Et),o=yield i.get(Ec).createModelReference(n);try{const a=yield wO.create(s,o.object.textEditorModel,[J.lift(r)],Hn.None),l=a.items.map(c=>c.hint);return setTimeout(()=>a.dispose(),0),l}finally{o.dispose()}}));var sRt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},hA=function(i,e){return function(n,r){e(n,r,i)}},pve=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},oRt=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],n;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=i[o]&&function(a){return new Promise(function(l,c){a=i[o](a),s(l,c,a.done,a.value)})}}function s(o,a,l,c){Promise.resolve(c).then(function(u){o({value:u,done:l})},a)}};class gve extends A8{constructor(e,n,r,s){super(10,n,e.item.anchor.range,r,s,!0),this.part=e}}let Pne=class extends lj{constructor(e,n,r,s,o,a){super(e,n,r,s,a),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var n;if(!Ax.get(this._editor)||e.target.type!==6)return null;const s=(n=e.target.detail.injectedText)===null||n===void 0?void 0:n.options;return s instanceof S1&&s.attachedData instanceof Mne?new gve(s.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,n,r){return e instanceof gve?new zs(s=>pve(this,void 0,void 0,function*(){var o,a,l,c;const{part:u}=e;if(yield u.item.resolve(r),r.isCancellationRequested)return;let d;typeof u.item.hint.tooltip=="string"?d=new Ea().appendText(u.item.hint.tooltip):u.item.hint.tooltip&&(d=u.item.hint.tooltip),d&&s.emitOne(new Tp(this,e.range,[d],!1,0)),Ka(u.item.hint.textEdits)&&s.emitOne(new Tp(this,e.range,[new Ea().appendText(L("hint.dbl","Double-click to insert"))],!1,10001));let h;if(typeof u.part.tooltip=="string"?h=new Ea().appendText(u.part.tooltip):u.part.tooltip&&(h=u.part.tooltip),h&&s.emitOne(new Tp(this,e.range,[h],!1,1)),u.part.location||u.part.command){let _;const y=this._editor.getOption(77)==="altKey"?ri?L("links.navigate.kb.meta.mac","cmd + click"):L("links.navigate.kb.meta","ctrl + click"):ri?L("links.navigate.kb.alt.mac","option + click"):L("links.navigate.kb.alt","alt + click");u.part.location&&u.part.command?_=new Ea().appendText(L("hint.defAndCommand","Go to Definition ({0}), right click for more",y)):u.part.location?_=new Ea().appendText(L("hint.def","Go to Definition ({0})",y)):u.part.command&&(_=new Ea(`[${L("hint.cmd","Execute Command")}](${eRt(u.part.command)} "${u.part.command.title}") (${y})`,{isTrusted:!0})),_&&s.emitOne(new Tp(this,e.range,[_],!1,1e4))}const f=yield this._resolveInlayHintLabelPartHover(u,r);try{for(var p=!0,g=oRt(f),m;m=yield g.next(),o=m.done,!o;p=!0){c=m.value,p=!1;const _=c;s.emitOne(_)}}catch(_){a={error:_}}finally{try{!p&&!o&&(l=g.return)&&(yield l.call(g))}finally{if(a)throw a.error}}})):zs.EMPTY}_resolveInlayHintLabelPartHover(e,n){return pve(this,void 0,void 0,function*(){if(!e.part.location)return zs.EMPTY;const{uri:r,range:s}=e.part.location,o=yield this._resolverService.createModelReference(r);try{const a=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(a)?lle(this._languageFeaturesService.hoverProvider,a,new ve(s.startLineNumber,s.startColumn),n).filter(l=>!YE(l.hover.contents)).map(l=>new Tp(this,e.item.anchor.range,l.hover.contents,!1,2+l.ordinal)):zs.EMPTY}finally{o.dispose()}})}};Pne=sRt([hA(1,Ar),hA(2,fu),hA(3,ei),hA(4,Ec),hA(5,Et)],Pne);_i(Ax.ID,Ax,1);uk.register(Pne);class aRt{constructor(e,n,r){this._editRange=e,this._originalSelection=n,this._text=r}getEditOperations(e,n){n.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,n){const s=n.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new Ft(s.endLineNumber,Math.min(this._originalSelection.positionColumn,s.endColumn),s.endLineNumber,Math.min(this._originalSelection.positionColumn,s.endColumn)):new Ft(s.endLineNumber,s.endColumn-this._text.length,s.endLineNumber,s.endColumn)}}var lRt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cRt=function(i,e){return function(n,r){e(n,r,i)}},F8;let N1=F8=class{static get(e){return e.getContribution(F8.ID)}constructor(e,n){this.editor=e,this.editorWorkerService=n,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,n){var r;(r=this.currentRequest)===null||r===void 0||r.cancel();const s=this.editor.getSelection(),o=this.editor.getModel();if(!o||!s)return;let a=s;if(a.startLineNumber!==a.endLineNumber)return;const l=new cAe(this.editor,5),c=o.uri;return this.editorWorkerService.canNavigateValueSet(c)?(this.currentRequest=go(u=>this.editorWorkerService.navigateValueSet(c,a,n)),this.currentRequest.then(u=>{var d;if(!u||!u.range||!u.value||!l.validate(this.editor))return;const h=J.lift(u.range);let f=u.range;const p=u.value.length-(a.endColumn-a.startColumn);f={startLineNumber:f.startLineNumber,startColumn:f.startColumn,endLineNumber:f.endLineNumber,endColumn:f.startColumn+u.value.length},p>1&&(a=new Ft(a.startLineNumber,a.startColumn,a.endLineNumber,a.endColumn+p-1));const g=new aRt(h,a,u.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:f,options:F8.DECORATION}]),(d=this.decorationRemover)===null||d===void 0||d.cancel(),this.decorationRemover=p1(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Ln)}).catch(Ln)):Promise.resolve(void 0)}};N1.ID="editor.contrib.inPlaceReplaceController";N1.DECORATION=kn.register({description:"in-place-replace",className:"valueSetReplacement"});N1=F8=lRt([cRt(1,Wf)],N1);class uRt extends kt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:L("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:3159,weight:100}})}run(e,n){const r=N1.get(n);return r?r.run(this.id,!1):Promise.resolve(void 0)}}class dRt extends kt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:L("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:3161,weight:100}})}run(e,n){const r=N1.get(n);return r?r.run(this.id,!0):Promise.resolve(void 0)}}_i(N1.ID,N1,4);rt(uRt);rt(dRt);class hRt extends kt{constructor(){super({id:"expandLineSelection",label:L("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:oe.textInputFocus,primary:2090}})}run(e,n,r){if(r=r||{},!n.hasModel())return;const s=n._getViewModel();s.model.pushStackElement(),s.setCursorStates(r.source,3,Zo.expandLineSelection(s,s.getCursorStates())),s.revealPrimaryCursor(r.source,!0)}}rt(hRt);class fRt{constructor(e,n){this._selection=e,this._cursors=n,this._selectionId=null}getEditOperations(e,n){const r=pRt(e,this._cursors);for(let s=0,o=r.length;s<o;s++){const a=r[s];n.addEditOperation(a.range,a.text)}this._selectionId=n.trackSelection(this._selection)}computeCursorState(e,n){return n.getTrackedSelection(this._selectionId)}}function pRt(i,e){e.sort((a,l)=>a.lineNumber===l.lineNumber?a.column-l.column:a.lineNumber-l.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const n=[];let r=0,s=0;const o=e.length;for(let a=1,l=i.getLineCount();a<=l;a++){const c=i.getLineContent(a),u=c.length+1;let d=0;if(s<o&&e[s].lineNumber===a&&(d=e[s].column,s++,d===u)||c.length===0)continue;const h=$p(c);let f=0;if(h===-1)f=1;else if(h!==c.length-1)f=h+2;else continue;f=Math.max(d,f),n[r++]=Vr.delete(new J(a,f,a,u))}return n}class $Me{constructor(e,n,r){this._selection=e,this._isCopyingDown=n,this._noop=r||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,n){let r=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,r.startLineNumber<r.endLineNumber&&r.endColumn===1&&(this._endLineNumberDelta=1,r=r.setEndPosition(r.endLineNumber-1,e.getLineMaxColumn(r.endLineNumber-1)));const s=[];for(let a=r.startLineNumber;a<=r.endLineNumber;a++)s.push(e.getLineContent(a));const o=s.join(`
`);o===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?n.addEditOperation(new J(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber+1,1),r.endLineNumber===e.getLineCount()?"":`
`):this._isCopyingDown?n.addEditOperation(new J(r.startLineNumber,1,r.startLineNumber,1),o+`
`):n.addEditOperation(new J(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),`
`+o),this._selectionId=n.trackSelection(r),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,n){let r=n.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let s=r.startLineNumber,o=r.startColumn,a=r.endLineNumber,l=r.endColumn;this._startLineNumberDelta!==0&&(s=s+this._startLineNumberDelta,o=1),this._endLineNumberDelta!==0&&(a=a+this._endLineNumberDelta,l=1),r=Ft.createWithDirection(s,o,a,l,this._selectionDirection)}return r}}var gRt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mRt=function(i,e){return function(n,r){e(n,r,i)}};let One=class{constructor(e,n,r,s){this._languageConfigurationService=s,this._selection=e,this._isMovingDown=n,this._autoIndent=r,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,n){const r=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===r){this._selectionId=n.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=n.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let s=this._selection;s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(this._moveEndPositionDown=!0,s=s.setEndPosition(s.endLineNumber-1,e.getLineMaxColumn(s.endLineNumber-1)));const{tabSize:o,indentSize:a,insertSpaces:l}=e.getOptions(),c=this.buildIndentConverter(o,a,l),u={tokenization:{getLineTokens:d=>e.tokenization.getLineTokens(d),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(d,h)=>e.getLanguageIdAtPosition(d,h)},getLineContent:null};if(s.startLineNumber===s.endLineNumber&&e.getLineMaxColumn(s.startLineNumber)===1){const d=s.startLineNumber,h=this._isMovingDown?d+1:d-1;e.getLineMaxColumn(h)===1?n.addEditOperation(new J(1,1,1,1),null):(n.addEditOperation(new J(d,1,d,1),e.getLineContent(h)),n.addEditOperation(new J(h,1,h,e.getLineMaxColumn(h)),null)),s=new Ft(h,1,h,1)}else{let d,h;if(this._isMovingDown){d=s.endLineNumber+1,h=e.getLineContent(d),n.addEditOperation(new J(d-1,e.getLineMaxColumn(d-1),d,e.getLineMaxColumn(d)),null);let f=h;if(this.shouldAutoIndent(e,s)){const p=this.matchEnterRule(e,c,o,d,s.startLineNumber-1);if(p!==null){const m=ar(e.getLineContent(d)),_=p+Uc(m,o);f=LM(_,o,l)+this.trimStart(h)}else{u.getLineContent=_=>_===s.startLineNumber?e.getLineContent(d):e.getLineContent(_);const m=rM(this._autoIndent,u,e.getLanguageIdAtPosition(d,1),s.startLineNumber,c,this._languageConfigurationService);if(m!==null){const _=ar(e.getLineContent(d)),b=Uc(m,o),y=Uc(_,o);b!==y&&(f=LM(b,o,l)+this.trimStart(h))}}n.addEditOperation(new J(s.startLineNumber,1,s.startLineNumber,1),f+`
`);const g=this.matchEnterRuleMovingDown(e,c,o,s.startLineNumber,d,f);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,n,s,o,l,g);else{u.getLineContent=_=>_===s.startLineNumber?f:_>=s.startLineNumber+1&&_<=s.endLineNumber+1?e.getLineContent(_-1):e.getLineContent(_);const m=rM(this._autoIndent,u,e.getLanguageIdAtPosition(d,1),s.startLineNumber+1,c,this._languageConfigurationService);if(m!==null){const _=ar(e.getLineContent(s.startLineNumber)),b=Uc(m,o),y=Uc(_,o);if(b!==y){const x=b-y;this.getIndentEditsOfMovingBlock(e,n,s,o,l,x)}}}}else n.addEditOperation(new J(s.startLineNumber,1,s.startLineNumber,1),f+`
`)}else if(d=s.startLineNumber-1,h=e.getLineContent(d),n.addEditOperation(new J(d,1,d+1,1),null),n.addEditOperation(new J(s.endLineNumber,e.getLineMaxColumn(s.endLineNumber),s.endLineNumber,e.getLineMaxColumn(s.endLineNumber)),`
`+h),this.shouldAutoIndent(e,s)){u.getLineContent=p=>p===d?e.getLineContent(s.startLineNumber):e.getLineContent(p);const f=this.matchEnterRule(e,c,o,s.startLineNumber,s.startLineNumber-2);if(f!==null)f!==0&&this.getIndentEditsOfMovingBlock(e,n,s,o,l,f);else{const p=rM(this._autoIndent,u,e.getLanguageIdAtPosition(s.startLineNumber,1),d,c,this._languageConfigurationService);if(p!==null){const g=ar(e.getLineContent(s.startLineNumber)),m=Uc(p,o),_=Uc(g,o);if(m!==_){const b=m-_;this.getIndentEditsOfMovingBlock(e,n,s,o,l,b)}}}}}this._selectionId=n.trackSelection(s)}buildIndentConverter(e,n,r){return{shiftIndent:s=>nh.shiftIndent(s,s.length+1,e,n,r),unshiftIndent:s=>nh.unshiftIndent(s,s.length+1,e,n,r)}}parseEnterResult(e,n,r,s,o){if(o){let a=o.indentation;o.indentAction===Hs.None||o.indentAction===Hs.Indent?a=o.indentation+o.appendText:o.indentAction===Hs.IndentOutdent?a=o.indentation:o.indentAction===Hs.Outdent&&(a=n.unshiftIndent(o.indentation)+o.appendText);const l=e.getLineContent(s);if(this.trimStart(l).indexOf(this.trimStart(a))>=0){const c=ar(e.getLineContent(s));let u=ar(a);const d=BIe(e,s,this._languageConfigurationService);d!==null&&d&2&&(u=n.unshiftIndent(u));const h=Uc(u,r),f=Uc(c,r);return h-f}}return null}matchEnterRuleMovingDown(e,n,r,s,o,a){if($p(a)>=0){const l=e.getLineMaxColumn(o),c=K2(this._autoIndent,e,new J(o,l,o,l),this._languageConfigurationService);return this.parseEnterResult(e,n,r,s,c)}else{let l=s-1;for(;l>=1;){const d=e.getLineContent(l);if($p(d)>=0)break;l--}if(l<1||s>e.getLineCount())return null;const c=e.getLineMaxColumn(l),u=K2(this._autoIndent,e,new J(l,c,l,c),this._languageConfigurationService);return this.parseEnterResult(e,n,r,s,u)}}matchEnterRule(e,n,r,s,o,a){let l=o;for(;l>=1;){let d;if(l===o&&a!==void 0?d=a:d=e.getLineContent(l),$p(d)>=0)break;l--}if(l<1||s>e.getLineCount())return null;const c=e.getLineMaxColumn(l),u=K2(this._autoIndent,e,new J(l,c,l,c),this._languageConfigurationService);return this.parseEnterResult(e,n,r,s,u)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,n){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(n.startLineNumber))return!1;const r=e.getLanguageIdAtPosition(n.startLineNumber,1),s=e.getLanguageIdAtPosition(n.endLineNumber,1);return!(r!==s||this._languageConfigurationService.getLanguageConfiguration(r).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,n,r,s,o,a){for(let l=r.startLineNumber;l<=r.endLineNumber;l++){const c=e.getLineContent(l),u=ar(c),h=Uc(u,s)+a,f=LM(h,s,o);f!==u&&(n.addEditOperation(new J(l,1,l,u.length+1),f),l===r.endLineNumber&&r.endColumn<=u.length+1&&f===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,n){let r=n.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(r=r.setEndPosition(r.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&r.startLineNumber<r.endLineNumber&&(r=r.setEndPosition(r.endLineNumber,2)),r}};One=gRt([mRt(3,dr)],One);class Jy{static getCollator(){return Jy._COLLATOR||(Jy._COLLATOR=new Intl.Collator),Jy._COLLATOR}constructor(e,n){this.selection=e,this.descending=n,this.selectionId=null}getEditOperations(e,n){const r=_Rt(e,this.selection,this.descending);r&&n.addEditOperation(r.range,r.text),this.selectionId=n.trackSelection(this.selection)}computeCursorState(e,n){return n.getTrackedSelection(this.selectionId)}static canRun(e,n,r){if(e===null)return!1;const s=zMe(e,n,r);if(!s)return!1;for(let o=0,a=s.before.length;o<a;o++)if(s.before[o]!==s.after[o])return!0;return!1}}Jy._COLLATOR=null;function zMe(i,e,n){const r=e.startLineNumber;let s=e.endLineNumber;if(e.endColumn===1&&s--,r>=s)return null;const o=[];for(let l=r;l<=s;l++)o.push(i.getLineContent(l));let a=o.slice(0);return a.sort(Jy.getCollator().compare),n===!0&&(a=a.reverse()),{startLineNumber:r,endLineNumber:s,before:o,after:a}}function _Rt(i,e,n){const r=zMe(i,e,n);return r?Vr.replace(new J(r.startLineNumber,1,r.endLineNumber,i.getLineMaxColumn(r.endLineNumber)),r.after.join(`
`)):null}class VMe extends kt{constructor(e,n){super(n),this.down=e}run(e,n){if(!n.hasModel())return;const r=n.getSelections().map((a,l)=>({selection:a,index:l,ignore:!1}));r.sort((a,l)=>J.compareRangesUsingStarts(a.selection,l.selection));let s=r[0];for(let a=1;a<r.length;a++){const l=r[a];s.selection.endLineNumber===l.selection.startLineNumber&&(s.index<l.index?l.ignore=!0:(s.ignore=!0,s=l))}const o=[];for(const a of r)o.push(new $Me(a.selection,this.down,a.ignore));n.pushUndoStop(),n.executeCommands(this.id,o),n.pushUndoStop()}}class vRt extends VMe{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:L("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"2_line",title:L({},"&&Copy Line Up"),order:1}})}}class bRt extends VMe{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:L("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"2_line",title:L({},"Co&&py Line Down"),order:2}})}}class yRt extends kt{constructor(){super({id:"editor.action.duplicateSelection",label:L("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:oe.writable,menuOpts:{menuId:se.MenubarSelectionMenu,group:"2_line",title:L({},"&&Duplicate Selection"),order:5}})}run(e,n,r){if(!n.hasModel())return;const s=[],o=n.getSelections(),a=n.getModel();for(const l of o)if(l.isEmpty())s.push(new $Me(l,!0));else{const c=new Ft(l.endLineNumber,l.endColumn,l.endLineNumber,l.endColumn);s.push(new mpt(c,a.getValueInRange(l)))}n.pushUndoStop(),n.executeCommands(this.id,s),n.pushUndoStop()}}class HMe extends kt{constructor(e,n){super(n),this.down=e}run(e,n){const r=e.get(dr),s=[],o=n.getSelections()||[],a=n.getOption(12);for(const l of o)s.push(new One(l,this.down,a,r));n.pushUndoStop(),n.executeCommands(this.id,s),n.pushUndoStop()}}class wRt extends HMe{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:L("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"2_line",title:L({},"Mo&&ve Line Up"),order:3}})}}class CRt extends HMe{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:L("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"2_line",title:L({},"Move &&Line Down"),order:4}})}}class UMe extends kt{constructor(e,n){super(n),this.descending=e}run(e,n){const r=n.getSelections()||[];for(const o of r)if(!Jy.canRun(n.getModel(),o,this.descending))return;const s=[];for(let o=0,a=r.length;o<a;o++)s[o]=new Jy(r[o],this.descending);n.pushUndoStop(),n.executeCommands(this.id,s),n.pushUndoStop()}}class SRt extends UMe{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:L("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:oe.writable})}}class xRt extends UMe{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:L("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:oe.writable})}}class kRt extends kt{constructor(){super({id:"editor.action.removeDuplicateLines",label:L("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:oe.writable})}run(e,n){if(!n.hasModel())return;const r=n.getModel();if(r.getLineCount()===1&&r.getLineMaxColumn(1)===1)return;const s=[],o=[];let a=0;for(const l of n.getSelections()){const c=new Set,u=[];for(let p=l.startLineNumber;p<=l.endLineNumber;p++){const g=r.getLineContent(p);c.has(g)||(u.push(g),c.add(g))}const d=new Ft(l.startLineNumber,1,l.endLineNumber,r.getLineMaxColumn(l.endLineNumber)),h=l.startLineNumber-a,f=new Ft(h,1,h+u.length-1,u[u.length-1].length);s.push(Vr.replace(d,u.join(`
`))),o.push(f),a+=l.endLineNumber-l.startLineNumber+1-u.length}n.pushUndoStop(),n.executeEdits(this.id,s,o),n.pushUndoStop()}}class Qz extends kt{constructor(){super({id:Qz.ID,label:L("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:ro(2089,2102),weight:100}})}run(e,n,r){let s=[];r.reason==="auto-save"&&(s=(n.getSelections()||[]).map(l=>new ve(l.positionLineNumber,l.positionColumn)));const o=n.getSelection();if(o===null)return;const a=new fRt(o,s);n.pushUndoStop(),n.executeCommands(this.id,[a]),n.pushUndoStop()}}Qz.ID="editor.action.trimTrailingWhitespace";class LRt extends kt{constructor(){super({id:"editor.action.deleteLines",label:L("lines.delete","Delete Line"),alias:"Delete Line",precondition:oe.writable,kbOpts:{kbExpr:oe.textInputFocus,primary:3113,weight:100}})}run(e,n){if(!n.hasModel())return;const r=this._getLinesToRemove(n),s=n.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let o=0;const a=[],l=[];for(let c=0,u=r.length;c<u;c++){const d=r[c];let h=d.startLineNumber,f=d.endLineNumber,p=1,g=s.getLineMaxColumn(f);f<s.getLineCount()?(f+=1,g=1):h>1&&(h-=1,p=s.getLineMaxColumn(h)),a.push(Vr.replace(new Ft(h,p,f,g),"")),l.push(new Ft(h-o,d.positionColumn,h-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}n.pushUndoStop(),n.executeEdits(this.id,a,l),n.pushUndoStop()}_getLinesToRemove(e){const n=e.getSelections().map(o=>{let a=o.endLineNumber;return o.startLineNumber<o.endLineNumber&&o.endColumn===1&&(a-=1),{startLineNumber:o.startLineNumber,selectionStartColumn:o.selectionStartColumn,endLineNumber:a,positionColumn:o.positionColumn}});n.sort((o,a)=>o.startLineNumber===a.startLineNumber?o.endLineNumber-a.endLineNumber:o.startLineNumber-a.startLineNumber);const r=[];let s=n[0];for(let o=1;o<n.length;o++)s.endLineNumber+1>=n[o].startLineNumber?s.endLineNumber=n[o].endLineNumber:(r.push(s),s=n[o]);return r.push(s),r}}class DRt extends kt{constructor(){super({id:"editor.action.indentLines",label:L("lines.indent","Indent Line"),alias:"Indent Line",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:2142,weight:100}})}run(e,n){const r=n._getViewModel();r&&(n.pushUndoStop(),n.executeCommands(this.id,zr.indent(r.cursorConfig,n.getModel(),n.getSelections())),n.pushUndoStop())}}class ERt extends kt{constructor(){super({id:"editor.action.outdentLines",label:L("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:2140,weight:100}})}run(e,n){G2.Outdent.runEditorCommand(e,n,null)}}class IRt extends kt{constructor(){super({id:"editor.action.insertLineBefore",label:L("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:3075,weight:100}})}run(e,n){const r=n._getViewModel();r&&(n.pushUndoStop(),n.executeCommands(this.id,zr.lineInsertBefore(r.cursorConfig,n.getModel(),n.getSelections())))}}class TRt extends kt{constructor(){super({id:"editor.action.insertLineAfter",label:L("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:2051,weight:100}})}run(e,n){const r=n._getViewModel();r&&(n.pushUndoStop(),n.executeCommands(this.id,zr.lineInsertAfter(r.cursorConfig,n.getModel(),n.getSelections())))}}class qMe extends kt{run(e,n){if(!n.hasModel())return;const r=n.getSelection(),s=this._getRangesToDelete(n),o=[];for(let c=0,u=s.length-1;c<u;c++){const d=s[c],h=s[c+1];J.intersectRanges(d,h)===null?o.push(d):s[c+1]=J.plusRange(d,h)}o.push(s[s.length-1]);const a=this._getEndCursorState(r,o),l=o.map(c=>Vr.replace(c,""));n.pushUndoStop(),n.executeEdits(this.id,l,a),n.pushUndoStop()}}class RRt extends qMe{constructor(){super({id:"deleteAllLeft",label:L("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:oe.writable,kbOpts:{kbExpr:oe.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,n){let r=null;const s=[];let o=0;return n.forEach(a=>{let l;if(a.endColumn===1&&o>0){const c=a.startLineNumber-o;l=new Ft(c,a.startColumn,c,a.startColumn)}else l=new Ft(a.startLineNumber,a.startColumn,a.startLineNumber,a.startColumn);o+=a.endLineNumber-a.startLineNumber,a.intersectRanges(e)?r=l:s.push(l)}),r&&s.unshift(r),s}_getRangesToDelete(e){const n=e.getSelections();if(n===null)return[];let r=n;const s=e.getModel();return s===null?[]:(r.sort(J.compareRangesUsingStarts),r=r.map(o=>{if(o.isEmpty())if(o.startColumn===1){const a=Math.max(1,o.startLineNumber-1),l=o.startLineNumber===1?1:s.getLineLength(a)+1;return new J(a,l,o.startLineNumber,1)}else return new J(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new J(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),r)}}class ARt extends qMe{constructor(){super({id:"deleteAllRight",label:L("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:oe.writable,kbOpts:{kbExpr:oe.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,n){let r=null;const s=[];for(let o=0,a=n.length,l=0;o<a;o++){const c=n[o],u=new Ft(c.startLineNumber-l,c.startColumn,c.startLineNumber-l,c.startColumn);c.intersectRanges(e)?r=u:s.push(u)}return r&&s.unshift(r),s}_getRangesToDelete(e){const n=e.getModel();if(n===null)return[];const r=e.getSelections();if(r===null)return[];const s=r.map(o=>{if(o.isEmpty()){const a=n.getLineMaxColumn(o.startLineNumber);return o.startColumn===a?new J(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new J(o.startLineNumber,o.startColumn,o.startLineNumber,a)}return o});return s.sort(J.compareRangesUsingStarts),s}}class NRt extends kt{constructor(){super({id:"editor.action.joinLines",label:L("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:oe.writable,kbOpts:{kbExpr:oe.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,n){const r=n.getSelections();if(r===null)return;let s=n.getSelection();if(s===null)return;r.sort(J.compareRangesUsingStarts);const o=[],a=r.reduce((f,p)=>f.isEmpty()?f.endLineNumber===p.startLineNumber?(s.equalsSelection(f)&&(s=p),p):p.startLineNumber>f.endLineNumber+1?(o.push(f),p):new Ft(f.startLineNumber,f.startColumn,p.endLineNumber,p.endColumn):p.startLineNumber>f.endLineNumber?(o.push(f),p):new Ft(f.startLineNumber,f.startColumn,p.endLineNumber,p.endColumn));o.push(a);const l=n.getModel();if(l===null)return;const c=[],u=[];let d=s,h=0;for(let f=0,p=o.length;f<p;f++){const g=o[f],m=g.startLineNumber,_=1;let b=0,y,x;const k=l.getLineLength(g.endLineNumber)-g.endColumn;if(g.isEmpty()||g.startLineNumber===g.endLineNumber){const E=g.getStartPosition();E.lineNumber<l.getLineCount()?(y=m+1,x=l.getLineMaxColumn(y)):(y=E.lineNumber,x=l.getLineMaxColumn(E.lineNumber))}else y=g.endLineNumber,x=l.getLineMaxColumn(y);let D=l.getLineContent(m);for(let E=m+1;E<=y;E++){const A=l.getLineContent(E),M=l.getLineFirstNonWhitespaceColumn(E);if(M>=1){let N=!0;D===""&&(N=!1),N&&(D.charAt(D.length-1)===" "||D.charAt(D.length-1)===" ")&&(N=!1,D=D.replace(/[\s\uFEFF\xA0]+$/g," "));const P=A.substr(M-1);D+=(N?" ":"")+P,N?b=P.length+1:b=P.length}else b=0}const R=new J(m,_,y,x);if(!R.isEmpty()){let E;g.isEmpty()?(c.push(Vr.replace(R,D)),E=new Ft(R.startLineNumber-h,D.length-b+1,m-h,D.length-b+1)):g.startLineNumber===g.endLineNumber?(c.push(Vr.replace(R,D)),E=new Ft(g.startLineNumber-h,g.startColumn,g.endLineNumber-h,g.endColumn)):(c.push(Vr.replace(R,D)),E=new Ft(g.startLineNumber-h,g.startColumn,g.startLineNumber-h,D.length-k)),J.intersectRanges(R,s)!==null?d=E:u.push(E)}h+=R.endLineNumber-R.startLineNumber}u.unshift(d),n.pushUndoStop(),n.executeEdits(this.id,c,u),n.pushUndoStop()}}class MRt extends kt{constructor(){super({id:"editor.action.transpose",label:L("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:oe.writable})}run(e,n){const r=n.getSelections();if(r===null)return;const s=n.getModel();if(s===null)return;const o=[];for(let a=0,l=r.length;a<l;a++){const c=r[a];if(!c.isEmpty())continue;const u=c.getStartPosition(),d=s.getLineMaxColumn(u.lineNumber);if(u.column>=d){if(u.lineNumber===s.getLineCount())continue;const h=new J(u.lineNumber,Math.max(1,u.column-1),u.lineNumber+1,1),f=s.getValueInRange(h).split("").reverse().join("");o.push(new Sa(new Ft(u.lineNumber,Math.max(1,u.column-1),u.lineNumber+1,1),f))}else{const h=new J(u.lineNumber,Math.max(1,u.column-1),u.lineNumber,u.column+1),f=s.getValueInRange(h).split("").reverse().join("");o.push(new Doe(h,f,new Ft(u.lineNumber,u.column+1,u.lineNumber,u.column+1)))}}n.pushUndoStop(),n.executeCommands(this.id,o),n.pushUndoStop()}}class JI extends kt{run(e,n){const r=n.getSelections();if(r===null)return;const s=n.getModel();if(s===null)return;const o=n.getOption(129),a=[];for(const l of r)if(l.isEmpty()){const c=l.getStartPosition(),u=n.getConfiguredWordAtPosition(c);if(!u)continue;const d=new J(c.lineNumber,u.startColumn,c.lineNumber,u.endColumn),h=s.getValueInRange(d);a.push(Vr.replace(d,this._modifyText(h,o)))}else{const c=s.getValueInRange(l);a.push(Vr.replace(l,this._modifyText(c,o)))}n.pushUndoStop(),n.executeEdits(this.id,a),n.pushUndoStop()}}class PRt extends JI{constructor(){super({id:"editor.action.transformToUppercase",label:L("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:oe.writable})}_modifyText(e,n){return e.toLocaleUpperCase()}}class ORt extends JI{constructor(){super({id:"editor.action.transformToLowercase",label:L("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:oe.writable})}_modifyText(e,n){return e.toLocaleLowerCase()}}class dk{constructor(e,n){this._pattern=e,this._flags=n,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class CO extends JI{constructor(){super({id:"editor.action.transformToTitlecase",label:L("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:oe.writable})}_modifyText(e,n){const r=CO.titleBoundary.get();return r?e.toLocaleLowerCase().replace(r,s=>s.toLocaleUpperCase()):e}}CO.titleBoundary=new dk("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class e1 extends JI{constructor(){super({id:"editor.action.transformToSnakecase",label:L("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:oe.writable})}_modifyText(e,n){const r=e1.caseBoundary.get(),s=e1.singleLetters.get();return!r||!s?e:e.replace(r,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}}e1.caseBoundary=new dk("(\\p{Ll})(\\p{Lu})","gmu");e1.singleLetters=new dk("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class SO extends JI{constructor(){super({id:"editor.action.transformToCamelcase",label:L("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:oe.writable})}_modifyText(e,n){const r=SO.wordBoundary.get();if(!r)return e;const s=e.split(r);return s.shift()+s.map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}}SO.wordBoundary=new dk("[_\\s-]","gm");class Cv extends JI{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(n=>n.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:L("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:oe.writable})}_modifyText(e,n){const r=Cv.caseBoundary.get(),s=Cv.singleLetters.get(),o=Cv.underscoreBoundary.get();return!r||!s||!o?e:e.replace(o,"$1-$3").replace(r,"$1-$2").replace(s,"$1-$2").toLocaleLowerCase()}}Cv.caseBoundary=new dk("(\\p{Ll})(\\p{Lu})","gmu");Cv.singleLetters=new dk("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");Cv.underscoreBoundary=new dk("(\\S)(_)(\\S)","gm");rt(vRt);rt(bRt);rt(yRt);rt(wRt);rt(CRt);rt(SRt);rt(xRt);rt(kRt);rt(Qz);rt(LRt);rt(DRt);rt(ERt);rt(IRt);rt(TRt);rt(RRt);rt(ARt);rt(NRt);rt(MRt);rt(PRt);rt(ORt);e1.caseBoundary.isSupported()&&e1.singleLetters.isSupported()&&rt(e1);SO.wordBoundary.isSupported()&&rt(SO);CO.titleBoundary.isSupported()&&rt(CO);Cv.isSupported()&&rt(Cv);var FRt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},G6=function(i,e){return function(n,r){e(n,r,i)}},Fne=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},B8;const KMe=new yt("LinkedEditingInputVisible",!1),BRt="linked-editing-decoration";let M1=B8=class extends Le{static get(e){return e.getContribution(B8.ID)}constructor(e,n,r,s,o){super(),this.languageConfigurationService=s,this._syncRangesToken=0,this._localToDispose=this._register(new Xe),this._editor=e,this._providers=r.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=KMe.bindTo(n),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Xe),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(69)||a.hasChanged(92))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const n=this._editor.getModel(),r=n!==null&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(n);if(r===this._enabled&&!e||(this._enabled=r,this.clearRanges(),this._localToDispose.clear(),!r||n===null))return;this._localToDispose.add(_t.runAndSubscribe(n.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition()}));const s=new Rf(this._debounceInformation.get(n)),o=()=>{var c;this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),(c=this._debounceDuration)!==null&&c!==void 0?c:this._debounceInformation.get(n))},a=new Rf(0),l=c=>{this._rangeSyncTriggerPromise=a.trigger(()=>this._syncRanges(c))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(c=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const u=this._currentDecorations.getRange(0);if(u&&c.changes.every(d=>u.intersectRanges(d.range))){l(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{s.dispose(),a.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const n=this._editor.getModel(),r=this._currentDecorations.getRange(0);if(!r||r.startLineNumber!==r.endLineNumber)return this.clearRanges();const s=n.getValueInRange(r);if(this._currentWordPattern){const a=s.match(this._currentWordPattern);if((a?a[0].length:0)!==s.length)return this.clearRanges()}const o=[];for(let a=1,l=this._currentDecorations.length;a<l;a++){const c=this._currentDecorations.getRange(a);if(c)if(c.startLineNumber!==c.endLineNumber)o.push({range:c,text:s});else{let u=n.getValueInRange(c),d=s,h=c.startColumn,f=c.endColumn;const p=ax(u,d);h+=p,u=u.substr(p),d=d.substr(p);const g=F9(u,d);f-=g,u=u.substr(0,u.length-g),d=d.substr(0,d.length-g),(h!==f||d.length!==0)&&o.push({range:new J(c.startLineNumber,h,c.endLineNumber,f),text:d})}}if(o.length!==0)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const a=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(a)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations.clear(),this._currentRequest&&(this._currentRequest.cancel(),this._currentRequest=null,this._currentRequestPosition=null)}updateRanges(e=!1){return Fne(this,void 0,void 0,function*(){if(!this._editor.hasModel()){this.clearRanges();return}const n=this._editor.getPosition();if(!this._enabled&&!e||this._editor.getSelections().length>1){this.clearRanges();return}const r=this._editor.getModel(),s=r.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(n.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const a=this._currentDecorations.getRange(0);if(a&&a.containsPosition(n))return}}this.clearRanges(),this._currentRequestPosition=n,this._currentRequestModelVersion=s;const o=go(a=>Fne(this,void 0,void 0,function*(){try{const l=new Xa(!1),c=yield GMe(this._providers,r,n,a);if(this._debounceInformation.update(r,l.elapsed()),o!==this._currentRequest||(this._currentRequest=null,s!==r.getVersionId()))return;let u=[];c!=null&&c.ranges&&(u=c.ranges),this._currentWordPattern=(c==null?void 0:c.wordPattern)||this._languageWordPattern;let d=!1;for(let f=0,p=u.length;f<p;f++)if(J.containsPosition(u[f],n)){if(d=!0,f!==0){const g=u[f];u.splice(f,1),u.unshift(g)}break}if(!d){this.clearRanges();return}const h=u.map(f=>({range:f,options:B8.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(h),this._syncRangesToken++}catch(l){sg(l)||Ln(l),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};M1.ID="editor.contrib.linkedEditing";M1.DECORATION=kn.register({description:"linked-editing",stickiness:0,className:BRt});M1=B8=FRt([G6(1,mn),G6(2,Et),G6(3,dr),G6(4,xh)],M1);class jRt extends kt{constructor(){super({id:"editor.action.linkedEditing",label:L("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:ze.and(oe.writable,oe.hasRenameProvider),kbOpts:{kbExpr:oe.editorTextFocus,primary:3132,weight:100}})}runCommand(e,n){const r=e.get(Si),[s,o]=Array.isArray(n)&&n||[void 0,void 0];return Jt.isUri(s)&&ve.isIPosition(o)?r.openCodeEditor({resource:s},r.getActiveCodeEditor()).then(a=>{a&&(a.setPosition(o),a.invokeWithinContext(l=>(this.reportTelemetry(l,a),this.run(l,a))))},Ln):super.runCommand(e,n)}run(e,n){const r=M1.get(n);return r?Promise.resolve(r.updateRanges(!0)):Promise.resolve()}}const WRt=Ho.bindToContribution(M1.get);ct(new WRt({id:"cancelLinkedEditingInput",precondition:KMe,handler:i=>i.clearRanges(),kbOpts:{kbExpr:oe.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function GMe(i,e,n,r){const s=i.ordered(e);return NEe(s.map(o=>()=>Fne(this,void 0,void 0,function*(){try{return yield o.provideLinkedEditingRanges(e,n,r)}catch(a){Us(a);return}})),o=>!!o&&Ka(o==null?void 0:o.ranges))}ce("editor.linkedEditingBackground",{dark:Te.fromHex("#f00").transparent(.3),light:Te.fromHex("#f00").transparent(.3),hcDark:Te.fromHex("#f00").transparent(.3),hcLight:Te.white},L("editorLinkedEditingBackground","Background color when the editor auto renames on type."));d_("_executeLinkedEditingProvider",(i,e,n)=>{const{linkedEditingRangeProvider:r}=i.get(Et);return GMe(r,e,n,Hn.None)});_i(M1.ID,M1,1);rt(jRt);var XMe=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let $Rt=class{constructor(e,n){this._link=e,this._provider=n}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}resolve(e){return XMe(this,void 0,void 0,function*(){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(n=>(this._link=n||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))})}};class Sj{constructor(e){this._disposables=new Xe;let n=[];for(const[r,s]of e){const o=r.links.map(a=>new $Rt(a,s));n=Sj._union(n,o),Ase(r)&&this._disposables.add(r)}this.links=n}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,n){const r=[];let s,o,a,l;for(s=0,a=0,o=e.length,l=n.length;s<o&&a<l;){const c=e[s],u=n[a];if(J.areIntersectingOrTouching(c.range,u.range)){s++;continue}J.compareRangesUsingStarts(c.range,u.range)<0?(r.push(c),s++):(r.push(u),a++)}for(;s<o;s++)r.push(e[s]);for(;a<l;a++)r.push(n[a]);return r}}function YMe(i,e,n){const r=[],s=i.ordered(e).reverse().map((o,a)=>Promise.resolve(o.provideLinks(e,n)).then(l=>{l&&(r[a]=[l,o])},Us));return Promise.all(s).then(()=>{const o=new Sj(Hm(r));return n.isCancellationRequested?(o.dispose(),new Sj([])):o})}si.registerCommand("_executeLinkProvider",(i,...e)=>XMe(void 0,void 0,void 0,function*(){let[n,r]=e;Ui(n instanceof Jt),typeof r!="number"&&(r=0);const{linkProvider:s}=i.get(Et),o=i.get(Fr).getModel(n);if(!o)return[];const a=yield YMe(s,o,Hn.None);if(!a)return[];for(let c=0;c<Math.min(r,a.links.length);c++)yield a.links[c].resolve(Hn.None);const l=a.links.slice(0);return a.dispose(),l}));var zRt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},X6=function(i,e){return function(n,r){e(n,r,i)}},VRt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},Bne;let fI=Bne=class extends Le{static get(e){return e.getContribution(Bne.ID)}constructor(e,n,r,s,o){super(),this.editor=e,this.openerService=n,this.notificationService=r,this.languageFeaturesService=s,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new Ji(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const a=this._register(new yz(e));this._register(a.onMouseMoveOrRelevantKeyDown(([l,c])=>{this._onEditorMouseMove(l,c)})),this._register(a.onExecute(l=>{this.onEditorMouseUp(l)})),this._register(a.onCancel(l=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(l=>{l.hasChanged(70)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(l=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(l=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(l=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(l=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}computeLinksNow(){return VRt(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=go(n=>YMe(this.providers,e,n));try{const n=new Xa(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,n.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(n){Ln(n)}finally{this.computePromise=null}}})}updateDecorations(e){const n=this.editor.getOption(77)==="altKey",r=[],s=Object.keys(this.currentOccurrences);for(const a of s){const l=this.currentOccurrences[a];r.push(l.decorationId)}const o=[];if(e)for(const a of e)o.push(aE.decoration(a,n));this.editor.changeDecorations(a=>{const l=a.deltaDecorations(r,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let c=0,u=l.length;c<u;c++){const d=new aE(e[c],l[c]);this.currentOccurrences[d.decorationId]=d}})}_onEditorMouseMove(e,n){const r=this.editor.getOption(77)==="altKey";if(this.isEnabled(e,n)){this.cleanUpActiveLinkDecoration();const s=this.getLinkOccurrence(e.target.position);s&&this.editor.changeDecorations(o=>{s.activate(o,r),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(77)==="altKey";if(this.activeLinkDecorationId){const n=this.currentOccurrences[this.activeLinkDecorationId];n&&this.editor.changeDecorations(r=>{n.deactivate(r,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const n=this.getLinkOccurrence(e.target.position);n&&this.openLinkOccurrence(n,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,n,r=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(Hn.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const a=this.editor.getModel().uri;if(a.scheme===Pn.file&&o.startsWith(`${Pn.file}:`)){const l=Jt.parse(o);if(l.scheme===Pn.file){const c=Hg(l);let u=null;c.startsWith("/./")?u=`.${c.substr(1)}`:c.startsWith("//./")&&(u=`.${c.substr(2)}`),u&&(o=Zgt(a,u))}}}return this.openerService.open(o,{openToSide:n,fromUserGesture:r,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const a=o instanceof Error?o.message:o;a==="invalid"?this.notificationService.warn(L("invalid.url","Failed to open this link because it is not well-formed: {0}",s.url.toString())):a==="missing"?this.notificationService.warn(L("missing.url","Failed to open this link because its target is missing.")):Ln(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const n=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const r of n){const s=this.currentOccurrences[r.id];if(s)return s}return null}isEnabled(e,n){return!!(e.target.type===6&&(e.hasTriggerModifier||n&&n.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};fI.ID="editor.linkDetector";fI=Bne=zRt([X6(1,fu),X6(2,Ps),X6(3,Et),X6(4,xh)],fI);const mve={general:kn.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:kn.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class aE{static decoration(e,n){return{range:e.range,options:aE._getOptions(e,n,!1)}}static _getOptions(e,n,r){const s=Object.assign({},r?mve.active:mve.general);return s.hoverMessage=HRt(e,n),s}constructor(e,n){this.link=e,this.decorationId=n}activate(e,n){e.changeDecorationOptions(this.decorationId,aE._getOptions(this.link,n,!0))}deactivate(e,n){e.changeDecorationOptions(this.decorationId,aE._getOptions(this.link,n,!1))}}function HRt(i,e){const n=i.url&&/^command:/i.test(i.url.toString()),r=i.tooltip?i.tooltip:n?L("links.navigate.executeCmd","Execute command"):L("links.navigate.follow","Follow link"),s=e?ri?L("links.navigate.kb.meta.mac","cmd + click"):L("links.navigate.kb.meta","ctrl + click"):ri?L("links.navigate.kb.alt.mac","option + click"):L("links.navigate.kb.alt","alt + click");if(i.url){let o="";if(/^command:/i.test(i.url.toString())){const l=i.url.toString().match(/^command:([^?#]+)/);if(l){const c=l[1];o=L("tooltip.explanation","Execute command {0}",c)}}return new Ea("",!0).appendLink(i.url.toString(!0).replace(/ /g,"%20"),r,o).appendMarkdown(` (${s})`)}else return new Ea().appendText(`${r} (${s})`)}class URt extends kt{constructor(){super({id:"editor.action.openLink",label:L("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,n){const r=fI.get(n);if(!r||!n.hasModel())return;const s=n.getSelections();for(const o of s){const a=r.getLinkOccurrence(o.getEndPosition());a&&r.openLinkOccurrence(a,!1)}}}_i(fI.ID,fI,1);rt(URt);class jne extends Le{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(n=>{const r=this._editor.getOption(116);r>=0&&n.target.type===6&&n.target.position.column>=r&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}jne.ID="editor.contrib.longLinesHelper";_i(jne.ID,jne,2);const Y6=ce("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},L("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);ce("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},L("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);ce("editor.wordHighlightTextBackground",{light:Y6,dark:Y6,hcDark:Y6,hcLight:Y6},L("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const Z6=ce("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Dr,hcLight:Dr},L("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));ce("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Dr,hcLight:Dr},L("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));ce("editor.wordHighlightTextBorder",{light:Z6,dark:Z6,hcDark:Z6,hcLight:Z6},L("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const qRt=ce("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},L("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),KRt=ce("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},L("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),GRt=ce("editorOverviewRuler.wordHighlightTextForeground",{dark:pN,light:pN,hcDark:pN,hcLight:pN},L("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),XRt=kn.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:Qr(KRt),position:hd.Center},minimap:{color:Qr(k$),position:ou.Inline}}),YRt=kn.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:Qr(GRt),position:hd.Center},minimap:{color:Qr(k$),position:ou.Inline}}),ZRt=kn.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:Qr(pN),position:hd.Center},minimap:{color:Qr(k$),position:ou.Inline}}),QRt=kn.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),JRt=kn.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:Qr(qRt),position:hd.Center},minimap:{color:Qr(k$),position:ou.Inline}});function eAt(i){return i===oP.Write?XRt:i===oP.Text?YRt:JRt}function tAt(i){return i?QRt:ZRt}Of((i,e)=>{const n=i.getColor(_oe);n&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${n.transparent(.5)}; }`)});var nAt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},iAt=function(i,e){return function(n,r){e(n,r,i)}},Wne;function ew(i,e){const n=e.filter(r=>!i.find(s=>s.equals(r)));if(n.length>=1){const r=n.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=n.length===1?L("cursorAdded","Cursor added: {0}",r):L("cursorsAdded","Cursors added: {0}",r);v1(s)}}class rAt extends kt{constructor(){super({id:"editor.action.insertCursorAbove",label:L("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"3_multi",title:L({},"&&Add Cursor Above"),order:2}})}run(e,n,r){if(!n.hasModel())return;let s=!0;r&&r.logicalLine===!1&&(s=!1);const o=n._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const a=o.getCursorStates();o.setCursorStates(r.source,3,Zo.addCursorUp(o,a,s)),o.revealTopMostCursor(r.source),ew(a,o.getCursorStates())}}class sAt extends kt{constructor(){super({id:"editor.action.insertCursorBelow",label:L("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"3_multi",title:L({},"A&&dd Cursor Below"),order:3}})}run(e,n,r){if(!n.hasModel())return;let s=!0;r&&r.logicalLine===!1&&(s=!1);const o=n._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const a=o.getCursorStates();o.setCursorStates(r.source,3,Zo.addCursorDown(o,a,s)),o.revealBottomMostCursor(r.source),ew(a,o.getCursorStates())}}class oAt extends kt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:L("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"3_multi",title:L({},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,n,r){if(!e.isEmpty()){for(let s=e.startLineNumber;s<e.endLineNumber;s++){const o=n.getLineMaxColumn(s);r.push(new Ft(s,o,s,o))}e.endColumn>1&&r.push(new Ft(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,n){if(!n.hasModel())return;const r=n.getModel(),s=n.getSelections(),o=n._getViewModel(),a=o.getCursorStates(),l=[];s.forEach(c=>this.getCursorsForSelection(c,r,l)),l.length>0&&n.setSelections(l),ew(a,o.getCursorStates())}}class aAt extends kt{constructor(){super({id:"editor.action.addCursorsToBottom",label:L("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,n){if(!n.hasModel())return;const r=n.getSelections(),s=n.getModel().getLineCount(),o=[];for(let c=r[0].startLineNumber;c<=s;c++)o.push(new Ft(c,r[0].startColumn,c,r[0].endColumn));const a=n._getViewModel(),l=a.getCursorStates();o.length>0&&n.setSelections(o),ew(l,a.getCursorStates())}}class lAt extends kt{constructor(){super({id:"editor.action.addCursorsToTop",label:L("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,n){if(!n.hasModel())return;const r=n.getSelections(),s=[];for(let l=r[0].startLineNumber;l>=1;l--)s.push(new Ft(l,r[0].startColumn,l,r[0].endColumn));const o=n._getViewModel(),a=o.getCursorStates();s.length>0&&n.setSelections(s),ew(a,o.getCursorStates())}}class Q6{constructor(e,n,r){this.selections=e,this.revealRange=n,this.revealScrollType=r}}class xO{static create(e,n){if(!e.hasModel())return null;const r=n.getState();if(!e.hasTextFocus()&&r.isRevealed&&r.searchString.length>0)return new xO(e,n,!1,r.searchString,r.wholeWord,r.matchCase,null);let s=!1,o,a;const l=e.getSelections();l.length===1&&l[0].isEmpty()?(s=!0,o=!0,a=!0):(o=r.wholeWord,a=r.matchCase);const c=e.getSelection();let u,d=null;if(c.isEmpty()){const h=e.getConfiguredWordAtPosition(c.getStartPosition());if(!h)return null;u=h.word,d=new Ft(c.startLineNumber,h.startColumn,c.startLineNumber,h.endColumn)}else u=e.getModel().getValueInRange(c).replace(/\r\n/g,`
`);return new xO(e,n,s,u,o,a,d)}constructor(e,n,r,s,o,a,l){this._editor=e,this.findController=n,this.isDisconnectedFromFindController=r,this.searchText=s,this.wholeWord=o,this.matchCase=a,this.currentMatch=l}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const n=this._editor.getSelections();return new Q6(n.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const n=this._editor.getSelections();return new Q6(n.slice(0,n.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),n=e[e.length-1],r=this._editor.getModel().findNextMatch(this.searchText,n.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return r?new Ft(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const n=this._editor.getSelections();return new Q6(n.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const n=this._editor.getSelections();return new Q6(n.slice(0,n.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),n=e[e.length-1],r=this._editor.getModel().findPreviousMatch(this.searchText,n.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return r?new Ft(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const n=this._editor.getModel();return e?n.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824):n.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class Nx extends Le{static get(e){return e.getContribution(Nx.ID)}constructor(e){super(),this._sessionDispose=this._register(new Xe),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const n=xO.create(this._editor,e);if(!n)return;this._session=n;const r={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(r.wholeWordOverride=1,r.matchCaseOverride=1,r.isRegexOverride=2),e.getState().change(r,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,n){if(!n.isEmpty())return n;const r=this._editor.getConfiguredWordAtPosition(n.getStartPosition());return r?new Ft(n.startLineNumber,r.startColumn,n.startLineNumber,r.endColumn):n}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const n=this._editor.getSelections();if(n.length>1){const s=e.getState().matchCase;if(!ZMe(this._editor.getModel(),n,s)){const a=this._editor.getModel(),l=[];for(let c=0,u=n.length;c<u;c++)l[c]=this._expandEmptyToWord(a,n[c]);this._editor.setSelections(l);return}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let n=null;const r=e.getState();if(r.isRevealed&&r.searchString.length>0&&r.isRegex){const s=this._editor.getModel();r.searchScope?n=s.findMatches(r.searchString,r.searchScope,r.isRegex,r.matchCase,r.wholeWord?this._editor.getOption(129):null,!1,1073741824):n=s.findMatches(r.searchString,!0,r.isRegex,r.matchCase,r.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;n=this._session.selectAll(r.searchScope)}if(n.length>0){const s=this._editor.getSelection();for(let o=0,a=n.length;o<a;o++){const l=n[o];if(l.range.intersectRanges(s)){n[o]=n[0],n[0]=l;break}}this._setSelections(n.map(o=>new Ft(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}Nx.ID="editor.contrib.multiCursorController";class eT extends kt{run(e,n){const r=Nx.get(n);if(!r)return;const s=n._getViewModel();if(s){const o=s.getCursorStates(),a=Ul.get(n);if(a)this._run(r,a);else{const l=e.get(hn).createInstance(Ul,n);this._run(r,l),l.dispose()}ew(o,s.getCursorStates())}}}class cAt extends eT{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:L("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:2082,weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"3_multi",title:L({},"Add &&Next Occurrence"),order:5}})}_run(e,n){e.addSelectionToNextFindMatch(n)}}class uAt extends eT{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:L("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:se.MenubarSelectionMenu,group:"3_multi",title:L({},"Add P&&revious Occurrence"),order:6}})}_run(e,n){e.addSelectionToPreviousFindMatch(n)}}class dAt extends eT{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:L("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:ro(2089,2082),weight:100}})}_run(e,n){e.moveSelectionToNextFindMatch(n)}}class hAt extends eT{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:L("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,n){e.moveSelectionToPreviousFindMatch(n)}}class fAt extends eT{constructor(){super({id:"editor.action.selectHighlights",label:L("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:3114,weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"3_multi",title:L({},"Select All &&Occurrences"),order:7}})}_run(e,n){e.selectAll(n)}}class pAt extends eT{constructor(){super({id:"editor.action.changeAll",label:L("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:ze.and(oe.writable,oe.editorTextFocus),kbOpts:{kbExpr:oe.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,n){e.selectAll(n)}}class gAt{constructor(e,n,r,s,o){this._model=e,this._searchText=n,this._matchCase=r,this._wordSeparators=s,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(J.compareRangesUsingStarts)),this._cachedFindMatches}}let kO=Wne=class extends Le{constructor(e,n){super(),this._languageFeaturesService=n,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Ji(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const r=Ul.get(e);r&&this._register(r.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(Wne._createState(this.state,this._isEnabled,this.editor))}static _createState(e,n,r){if(!n||!r.hasModel())return null;const s=r.getSelection();if(s.startLineNumber!==s.endLineNumber)return null;const o=Nx.get(r);if(!o)return null;const a=Ul.get(r);if(!a)return null;let l=o.getSession(a);if(!l){const d=r.getSelections();if(d.length>1){const f=a.getState().matchCase;if(!ZMe(r.getModel(),d,f))return null}l=xO.create(r,a)}if(!l||l.currentMatch||/^[ \t]+$/.test(l.searchText)||l.searchText.length>200)return null;const c=a.getState(),u=c.matchCase;if(c.isRevealed){let d=c.searchString;u||(d=d.toLowerCase());let h=l.searchText;if(u||(h=h.toLowerCase()),d===h&&l.matchCase===c.matchCase&&l.wholeWord===c.wholeWord&&!c.isRegex)return null}return new gAt(r.getModel(),l.searchText,l.matchCase,l.wholeWord?r.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const n=this.editor.getModel();if(n.isTooLargeForTokenization())return;const r=this.state.findMatches(),s=this.editor.getSelections();s.sort(J.compareRangesUsingStarts);const o=[];for(let c=0,u=0,d=r.length,h=s.length;c<d;){const f=r[c];if(u>=h)o.push(f),c++;else{const p=J.compareRangesUsingStarts(f,s[u]);p<0?((s[u].isEmpty()||!J.areIntersecting(f,s[u]))&&o.push(f),c++):(p>0||c++,u++)}}const a=this._languageFeaturesService.documentHighlightProvider.has(n)&&this.editor.getOption(80),l=o.map(c=>({range:c,options:tAt(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}};kO.ID="editor.contrib.selectionHighlighter";kO=Wne=nAt([iAt(1,Et)],kO);function ZMe(i,e,n){const r=_ve(i,e[0],!n);for(let s=1,o=e.length;s<o;s++){const a=e[s];if(a.isEmpty())return!1;const l=_ve(i,a,!n);if(r!==l)return!1}return!0}function _ve(i,e,n){const r=i.getValueInRange(e);return n?r.toLowerCase():r}class mAt extends kt{constructor(){super({id:"editor.action.focusNextCursor",label:L("mutlicursor.focusNextCursor","Focus Next Cursor"),description:{description:L("mutlicursor.focusNextCursor.description","Focuses the next cursor"),args:[]},alias:"Focus Next Cursor",precondition:void 0})}run(e,n,r){if(!n.hasModel())return;const s=n._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const o=Array.from(s.getCursorStates()),a=o.shift();a&&(o.push(a),s.setCursorStates(r.source,3,o),s.revealPrimaryCursor(r.source,!0),ew(o,s.getCursorStates()))}}class _At extends kt{constructor(){super({id:"editor.action.focusPreviousCursor",label:L("mutlicursor.focusPreviousCursor","Focus Previous Cursor"),description:{description:L("mutlicursor.focusPreviousCursor.description","Focuses the previous cursor"),args:[]},alias:"Focus Previous Cursor",precondition:void 0})}run(e,n,r){if(!n.hasModel())return;const s=n._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const o=Array.from(s.getCursorStates()),a=o.pop();a&&(o.unshift(a),s.setCursorStates(r.source,3,o),s.revealPrimaryCursor(r.source,!0),ew(o,s.getCursorStates()))}}_i(Nx.ID,Nx,4);_i(kO.ID,kO,1);rt(rAt);rt(sAt);rt(oAt);rt(cAt);rt(uAt);rt(dAt);rt(hAt);rt(fAt);rt(pAt);rt(aAt);rt(lAt);rt(mAt);rt(_At);var QMe=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const Mx={Visible:new yt("parameterHintsVisible",!1),MultipleSignatures:new yt("parameterHintsMultipleSignatures",!1)};function JMe(i,e,n,r,s){return QMe(this,void 0,void 0,function*(){const o=i.ordered(e);for(const a of o)try{const l=yield a.provideSignatureHelp(e,n,s,r);if(l)return l}catch(l){Us(l)}})}si.registerCommand("_executeSignatureHelpProvider",(i,...e)=>QMe(void 0,void 0,void 0,function*(){const[n,r,s]=e;Ui(Jt.isUri(n)),Ui(ve.isIPosition(r)),Ui(typeof s=="string"||!s);const o=i.get(Et),a=yield i.get(Ec).createModelReference(n);try{const l=yield JMe(o.signatureHelpProvider,a.object.textEditorModel,ve.lift(r),{triggerKind:Am.Invoke,isRetrigger:!1,triggerCharacter:s},Hn.None);return l?(setTimeout(()=>l.dispose(),0),l.value):void 0}finally{a.dispose()}}));var vAt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},iy;(function(i){i.Default={type:0};class e{constructor(s,o){this.request=s,this.previouslyActiveHints=o,this.type=2}}i.Pending=e;class n{constructor(s){this.hints=s,this.type=1}}i.Active=n})(iy||(iy={}));class Jz extends Le{constructor(e,n,r=Jz.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new _e),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=iy.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new ha),this.triggerChars=new q9,this.retriggerChars=new q9,this.triggerId=0,this.editor=e,this.providers=n,this.throttledDelayer=new Rf(r),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(s=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(s=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(s=>this.onCursorChange(s))),this._register(this.editor.onDidChangeModelContent(s=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(s=>this.onDidType(s))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=iy.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,n){const r=this.editor.getModel();if(!r||!this.providers.has(r))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),n).catch(Ln)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,n=this.state.hints.activeSignature,r=n%e===e-1,s=this.editor.getOption(85).cycle;if((e<2||r)&&!s){this.cancel();return}this.updateActiveSignature(r&&s?0:n+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,n=this.state.hints.activeSignature,r=n===0,s=this.editor.getOption(85).cycle;if((e<2||r)&&!s){this.cancel();return}this.updateActiveSignature(r&&s?e-1:n-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new iy.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return vAt(this,void 0,void 0,function*(){const n=this.state.type===1||this.state.type===2,r=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce(bAt);this._pendingTriggers=[];const o={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:n,activeSignatureHelp:r};if(!this.editor.hasModel())return!1;const a=this.editor.getModel(),l=this.editor.getPosition();this.state=new iy.Pending(go(c=>JMe(this.providers,a,l,o,c)),r);try{const c=yield this.state.request;return e!==this.triggerId?(c==null||c.dispose(),!1):!c||!c.value.signatures||c.value.signatures.length===0?(c==null||c.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new iy.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=iy.Default),Ln(c),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const n of this.providers.ordered(e)){for(const r of n.signatureHelpTriggerCharacters||[])if(r.length){const s=r.charCodeAt(0);this.triggerChars.add(s),this.retriggerChars.add(s)}for(const r of n.signatureHelpRetriggerCharacters||[])r.length&&this.retriggerChars.add(r.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const n=e.length-1,r=e.charCodeAt(n);(this.triggerChars.has(r)||this.isTriggered&&this.retriggerChars.has(r))&&this.trigger({triggerKind:Am.TriggerCharacter,triggerCharacter:e.charAt(n)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Am.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Am.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}Jz.DEFAULT_DELAY=120;function bAt(i,e){switch(e.triggerKind){case Am.Invoke:return e;case Am.ContentChange:return i;case Am.TriggerCharacter:default:return e}}var yAt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},RK=function(i,e){return function(n,r){e(n,r,i)}},$ne;const Pu=tt,wAt=ws("parameter-hints-next",lt.chevronDown,L("parameterHintsNextIcon","Icon for show next parameter hint.")),CAt=ws("parameter-hints-previous",lt.chevronUp,L("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let xj=$ne=class extends Le{constructor(e,n,r,s,o){super(),this.editor=e,this.model=n,this.renderDisposeables=this._register(new Xe),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Rv({editor:e},o,s)),this.keyVisible=Mx.Visible.bindTo(r),this.keyMultipleSignatures=Mx.MultipleSignatures.bindTo(r)}createParameterHintDOMNodes(){const e=Pu(".editor-widget.parameter-hints-widget"),n=He(e,Pu(".phwrapper"));n.tabIndex=-1;const r=He(n,Pu(".controls")),s=He(r,Pu(".button"+en.asCSSSelector(CAt))),o=He(r,Pu(".overloads")),a=He(r,Pu(".button"+en.asCSSSelector(wAt)));this._register(Be(s,"click",f=>{Nn.stop(f),this.previous()})),this._register(Be(a,"click",f=>{Nn.stop(f),this.next()}));const l=Pu(".body"),c=new P5(l,{alwaysConsumeMouseWheel:!0});this._register(c),n.appendChild(c.getDomNode());const u=He(l,Pu(".signature")),d=He(l,Pu(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:u,overloads:o,docs:d,scrollbar:c},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(f=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const f=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${f.fontSize}px`,this.domNodes.element.style.lineHeight=`${f.lineHeight/f.fontSize}`};h(),this._register(_t.chain(this.editor.onDidChangeConfiguration.bind(this.editor),f=>f.filter(p=>p.hasChanged(50)))(h)),this._register(this.editor.onDidLayoutChange(f=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var n;if(this.renderDisposeables.clear(),!this.domNodes)return;const r=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",r),this.keyMultipleSignatures.set(r),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const s=e.signatures[e.activeSignature];if(!s)return;const o=He(this.domNodes.signature,Pu(".code")),a=this.editor.getOption(50);o.style.fontSize=`${a.fontSize}px`,o.style.fontFamily=a.fontFamily;const l=s.parameters.length>0,c=(n=s.activeParameter)!==null&&n!==void 0?n:e.activeParameter;if(l)this.renderParameters(o,s,c);else{const h=He(o,Pu("span"));h.textContent=s.label}const u=s.parameters[c];if(u!=null&&u.documentation){const h=Pu("span.documentation");if(typeof u.documentation=="string")h.textContent=u.documentation;else{const f=this.renderMarkdownDocs(u.documentation);h.appendChild(f.element)}He(this.domNodes.docs,Pu("p",{},h))}if(s.documentation!==void 0)if(typeof s.documentation=="string")He(this.domNodes.docs,Pu("p",{},s.documentation));else{const h=this.renderMarkdownDocs(s.documentation);He(this.domNodes.docs,h.element)}const d=this.hasDocs(s,u);if(this.domNodes.signature.classList.toggle("has-docs",d),this.domNodes.docs.classList.toggle("empty",!d),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,u){let h="";const f=s.parameters[c];Array.isArray(f.label)?h=s.label.substring(f.label[0],f.label[1]):h=f.label,f.documentation&&(h+=typeof f.documentation=="string"?`, ${f.documentation}`:`, ${f.documentation.value}`),s.documentation&&(h+=typeof s.documentation=="string"?`, ${s.documentation}`:`, ${s.documentation.value}`),this.announcedLabel!==h&&(Ua(L("hint","{0}, hint",h)),this.announcedLabel=h)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const n=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var r;(r=this.domNodes)===null||r===void 0||r.scrollbar.scanDomNode()}}));return n.element.classList.add("markdown-docs"),n}hasDocs(e,n){return!!(n&&typeof n.documentation=="string"&&fS(n.documentation).length>0||n&&typeof n.documentation=="object"&&fS(n.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&fS(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&fS(e.documentation.value).length>0)}renderParameters(e,n,r){const[s,o]=this.getParameterLabelOffsets(n,r),a=document.createElement("span");a.textContent=n.label.substring(0,s);const l=document.createElement("span");l.textContent=n.label.substring(s,o),l.className="parameter active";const c=document.createElement("span");c.textContent=n.label.substring(o),He(e,a,l,c)}getParameterLabelOffsets(e,n){const r=e.parameters[n];if(r){if(Array.isArray(r.label))return r.label;if(r.label.length){const s=new RegExp(`(\\W|^)${dd(r.label)}(?=\\W|$)`,"g");s.test(e.label);const o=s.lastIndex-r.label.length;return o>=0?[o,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return $ne.ID}updateMaxHeight(){if(!this.domNodes)return;const n=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=n;const r=this.domNodes.element.getElementsByClassName("phwrapper");r.length&&(r[0].style.maxHeight=n)}};xj.ID="editor.widget.parameterHintsWidget";xj=$ne=yAt([RK(2,mn),RK(3,fu),RK(4,Ar)],xj);ce("editorHoverWidget.highlightForeground",{dark:vf,light:vf,hcDark:vf,hcLight:vf},L("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var SAt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},vve=function(i,e){return function(n,r){e(n,r,i)}},zne;let Px=zne=class extends Le{static get(e){return e.getContribution(zne.ID)}constructor(e,n,r){super(),this.editor=e,this.model=this._register(new Jz(e,r.signatureHelpProvider)),this._register(this.model.onChangedHints(s=>{var o;s?(this.widget.value.show(),this.widget.value.render(s)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new K1(()=>this._register(n.createInstance(xj,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};Px.ID="editor.controller.parameterHints";Px=zne=SAt([vve(1,hn),vve(2,Et)],Px);class xAt extends kt{constructor(){super({id:"editor.action.triggerParameterHints",label:L("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:oe.hasSignatureHelpProvider,kbOpts:{kbExpr:oe.editorTextFocus,primary:3082,weight:100}})}run(e,n){const r=Px.get(n);r==null||r.trigger({triggerKind:Am.Invoke})}}_i(Px.ID,Px,2);rt(xAt);const Rle=175,Ale=Ho.bindToContribution(Px.get);ct(new Ale({id:"closeParameterHints",precondition:Mx.Visible,handler:i=>i.cancel(),kbOpts:{weight:Rle,kbExpr:oe.focus,primary:9,secondary:[1033]}}));ct(new Ale({id:"showPrevParameterHint",precondition:ze.and(Mx.Visible,Mx.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:Rle,kbExpr:oe.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));ct(new Ale({id:"showNextParameterHint",precondition:ze.and(Mx.Visible,Mx.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:Rle,kbExpr:oe.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var kAt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},AK=function(i,e){return function(n,r){e(n,r,i)}};const eV=new yt("renameInputVisible",!1,L("renameInputVisible","Whether the rename input widget is visible"));let Vne=class{constructor(e,n,r,s,o){this._editor=e,this._acceptKeybindings=n,this._themeService=r,this._keybindingService=s,this._disposables=new Xe,this.allowEditorOverflow=!0,this._visibleContextKey=eV.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&this._updateFont()})),this._disposables.add(r.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",L("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var n,r,s,o;if(!this._input||!this._domNode)return;const a=e.getColor(bm),l=e.getColor(poe);this._domNode.style.backgroundColor=String((n=e.getColor(cs))!==null&&n!==void 0?n:""),this._domNode.style.boxShadow=a?` 0 0 8px 2px ${a}`:"",this._domNode.style.border=l?`1px solid ${l}`:"",this._domNode.style.color=String((r=e.getColor(dIe))!==null&&r!==void 0?r:""),this._input.style.backgroundColor=String((s=e.getColor(uIe))!==null&&s!==void 0?s:"");const c=e.getColor(hIe);this._input.style.borderWidth=c?"1px":"0px",this._input.style.borderStyle=c?"solid":"none",this._input.style.borderColor=(o=c==null?void 0:c.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,n;const[r,s]=this._acceptKeybindings;return this._label.innerText=L({},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(r))===null||e===void 0?void 0:e.getLabel(),(n=this._keybindingService.lookupKeybinding(s))===null||n===void 0?void 0:n.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var n;(n=this._currentAcceptInput)===null||n===void 0||n.call(this,e)}cancelInput(e){var n;(n=this._currentCancelInput)===null||n===void 0||n.call(this,e)}getInput(e,n,r,s,o,a){this._domNode.classList.toggle("preview",o),this._position=new ve(e.startLineNumber,e.startColumn),this._input.value=n,this._input.setAttribute("selectionStart",r.toString()),this._input.setAttribute("selectionEnd",s.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const l=new Xe;return new Promise(c=>{this._currentCancelInput=u=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,c(u),!0),this._currentAcceptInput=u=>{if(this._input.value.trim().length===0||this._input.value===n){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,c({newName:this._input.value,wantsPreview:o&&u})},l.add(a.onCancellationRequested(()=>this.cancelInput(!0))),l.add(this._editor.onDidBlurEditorWidget(()=>{var u;return this.cancelInput(!(!((u=this._domNode)===null||u===void 0)&&u.ownerDocument.hasFocus()))})),this._show()}).finally(()=>{l.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};Vne=kAt([AK(2,Do),AK(3,sr),AK(4,mn)],Vne);var LAt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},lC=function(i,e){return function(n,r){e(n,r,i)}},VS=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},Hne;class Nle{constructor(e,n,r){this.model=e,this.position=n,this._providerRenameIdx=0,this._providers=r.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return VS(this,void 0,void 0,function*(){const n=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const s=this._providers[this._providerRenameIdx];if(!s.resolveRenameLocation)break;const o=yield s.resolveRenameLocation(this.model,this.position,e);if(o){if(o.rejectReason){n.push(o.rejectReason);continue}return o}}const r=this.model.getWordAtPosition(this.position);return r?{range:new J(this.position.lineNumber,r.startColumn,this.position.lineNumber,r.endColumn),text:r.word,rejectReason:n.length>0?n.join(`
`):void 0}:{range:J.fromPositions(this.position),text:"",rejectReason:n.length>0?n.join(`
`):void 0}})}provideRenameEdits(e,n){return VS(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],n)})}_provideRenameEdits(e,n,r,s){return VS(this,void 0,void 0,function*(){const o=this._providers[n];if(!o)return{edits:[],rejectReason:r.join(`
`)};const a=yield o.provideRenameEdits(this.model,this.position,e,s);if(a){if(a.rejectReason)return this._provideRenameEdits(e,n+1,r.concat(a.rejectReason),s)}else return this._provideRenameEdits(e,n+1,r.concat(L("no result","No result.")),s);return a})}}function DAt(i,e,n,r){return VS(this,void 0,void 0,function*(){const s=new Nle(e,n,i),o=yield s.resolveRenameLocation(Hn.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(r,Hn.None)})}let Ox=Hne=class{static get(e){return e.getContribution(Hne.ID)}constructor(e,n,r,s,o,a,l,c){this.editor=e,this._instaService=n,this._notificationService=r,this._bulkEditService=s,this._progressService=o,this._logService=a,this._configService=l,this._languageFeaturesService=c,this._disposableStore=new Xe,this._cts=new Ns,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(Vne,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,n;return VS(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new Ns,!this.editor.hasModel())return;const r=this.editor.getPosition(),s=new Nle(this.editor.getModel(),r,this._languageFeaturesService.renameProvider);if(!s.hasProvider())return;const o=new x1(this.editor,5,void 0,this._cts.token);let a;try{const g=s.resolveRenameLocation(o.token);this._progressService.showWhile(g,250),a=yield g}catch(g){(e=au.get(this.editor))===null||e===void 0||e.showMessage(g||L("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),r);return}finally{o.dispose()}if(!a)return;if(a.rejectReason){(n=au.get(this.editor))===null||n===void 0||n.showMessage(a.rejectReason,r);return}if(o.token.isCancellationRequested)return;const l=new x1(this.editor,5,a.range,this._cts.token),c=this.editor.getSelection();let u=0,d=a.text.length;!J.isEmpty(c)&&!J.spansMultipleLines(c)&&J.containsRange(a.range,c)&&(u=Math.max(0,c.startColumn-a.range.startColumn),d=Math.min(a.range.endColumn,c.endColumn)-a.range.startColumn);const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),f=yield this._renameInputField.getInput(a.range,a.text,u,d,h,l.token);if(typeof f=="boolean"){f&&this.editor.focus(),l.dispose();return}this.editor.focus();const p=h$(s.provideRenameEdits(f.newName,l.token),l.token).then(g=>VS(this,void 0,void 0,function*(){if(!(!g||!this.editor.hasModel())){if(g.rejectReason){this._notificationService.info(g.rejectReason);return}this.editor.setSelection(J.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(g,{editor:this.editor,showPreview:f.wantsPreview,label:L("label","Renaming '{0}' to '{1}'",a==null?void 0:a.text,f.newName),code:"undoredo.rename",quotableLabel:L("quotableLabel","Renaming {0} to {1}",a==null?void 0:a.text,f.newName),respectAutoSaveConfig:!0}).then(m=>{m.ariaSummary&&Ua(L("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",a.text,f.newName,m.ariaSummary))}).catch(m=>{this._notificationService.error(L("rename.failedApply","Rename failed to apply edits")),this._logService.error(m)})}}),g=>{this._notificationService.error(L("rename.failed","Rename failed to compute edits")),this._logService.error(g)}).finally(()=>{l.dispose()});return this._progressService.showWhile(p,250),p})}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};Ox.ID="editor.contrib.renameController";Ox=Hne=LAt([lC(1,hn),lC(2,Ps),lC(3,$5),lC(4,Z1),lC(5,vd),lC(6,ooe),lC(7,Et)],Ox);class EAt extends kt{constructor(){super({id:"editor.action.rename",label:L("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ze.and(oe.writable,oe.hasRenameProvider),kbOpts:{kbExpr:oe.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,n){const r=e.get(Si),[s,o]=Array.isArray(n)&&n||[void 0,void 0];return Jt.isUri(s)&&ve.isIPosition(o)?r.openCodeEditor({resource:s},r.getActiveCodeEditor()).then(a=>{a&&(a.setPosition(o),a.invokeWithinContext(l=>(this.reportTelemetry(l,a),this.run(l,a))))},Ln):super.runCommand(e,n)}run(e,n){const r=Ox.get(n);return r?r.run():Promise.resolve()}}_i(Ox.ID,Ox,4);rt(EAt);const Mle=Ho.bindToContribution(Ox.get);ct(new Mle({id:"acceptRenameInput",precondition:eV,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:ze.and(oe.focus,ze.not("isComposing")),primary:3}}));ct(new Mle({id:"acceptRenameInputWithPreview",precondition:ze.and(eV,ze.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:ze.and(oe.focus,ze.not("isComposing")),primary:1027}}));ct(new Mle({id:"cancelRenameInput",precondition:eV,handler:i=>i.cancelRenameInput(),kbOpts:{weight:199,kbExpr:oe.focus,primary:9,secondary:[1033]}}));d_("_executeDocumentRenameProvider",function(i,e,n,...r){const[s]=r;Ui(typeof s=="string");const{renameProvider:o}=i.get(Et);return DAt(o,e,n,s)});d_("_executePrepareRename",function(i,e,n){return VS(this,void 0,void 0,function*(){const{renameProvider:r}=i.get(Et),o=yield new Nle(e,n,r).resolveRenameLocation(Hn.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o})});Kr.as(ag.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:L("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function IAt(i){for(let e=0,n=i.length;e<n;e+=4){const r=i[e+0],s=i[e+1],o=i[e+2],a=i[e+3];i[e+0]=a,i[e+1]=o,i[e+2]=s,i[e+3]=r}}function TAt(i){const e=new Uint8Array(i.buffer,i.byteOffset,i.length*4);return x2e()||IAt(e),m$.wrap(e)}function ePe(i){const e=new Uint32Array(RAt(i));let n=0;if(e[n++]=i.id,i.type==="full")e[n++]=1,e[n++]=i.data.length,e.set(i.data,n),n+=i.data.length;else{e[n++]=2,e[n++]=i.deltas.length;for(const r of i.deltas)e[n++]=r.start,e[n++]=r.deleteCount,r.data?(e[n++]=r.data.length,e.set(r.data,n),n+=r.data.length):e[n++]=0}return TAt(e)}function RAt(i){let e=0;if(e+=2,i.type==="full")e+=1+i.data.length;else{e+=1,e+=3*i.deltas.length;for(const n of i.deltas)n.data&&(e+=n.data.length)}return e}var P1=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};function tV(i){return i&&!!i.data}function tPe(i){return i&&Array.isArray(i.edits)}class AAt{constructor(e,n,r){this.provider=e,this.tokens=n,this.error=r}}function nPe(i,e){return i.has(e)}function NAt(i,e){const n=i.orderedGroups(e);return n.length>0?n[0]:[]}function iPe(i,e,n,r,s){return P1(this,void 0,void 0,function*(){const o=NAt(i,e),a=yield Promise.all(o.map(l=>P1(this,void 0,void 0,function*(){let c,u=null;try{c=yield l.provideDocumentSemanticTokens(e,l===n?r:null,s)}catch(d){u=d,c=null}return(!c||!tV(c)&&!tPe(c))&&(c=null),new AAt(l,c,u)})));for(const l of a){if(l.error)throw l.error;if(l.tokens)return l}return a.length>0?a[0]:null})}function MAt(i,e){const n=i.orderedGroups(e);return n.length>0?n[0]:null}class PAt{constructor(e,n){this.provider=e,this.tokens=n}}function OAt(i,e){return i.has(e)}function rPe(i,e){const n=i.orderedGroups(e);return n.length>0?n[0]:[]}function Ple(i,e,n,r){return P1(this,void 0,void 0,function*(){const s=rPe(i,e),o=yield Promise.all(s.map(a=>P1(this,void 0,void 0,function*(){let l;try{l=yield a.provideDocumentRangeSemanticTokens(e,n,r)}catch(c){Us(c),l=null}return(!l||!tV(l))&&(l=null),new PAt(a,l)})));for(const a of o)if(a.tokens)return a;return o.length>0?o[0]:null})}si.registerCommand("_provideDocumentSemanticTokensLegend",(i,...e)=>P1(void 0,void 0,void 0,function*(){const[n]=e;Ui(n instanceof Jt);const r=i.get(Fr).getModel(n);if(!r)return;const{documentSemanticTokensProvider:s}=i.get(Et),o=MAt(s,r);return o?o[0].getLegend():i.get(us).executeCommand("_provideDocumentRangeSemanticTokensLegend",n)}));si.registerCommand("_provideDocumentSemanticTokens",(i,...e)=>P1(void 0,void 0,void 0,function*(){const[n]=e;Ui(n instanceof Jt);const r=i.get(Fr).getModel(n);if(!r)return;const{documentSemanticTokensProvider:s}=i.get(Et);if(!nPe(s,r))return i.get(us).executeCommand("_provideDocumentRangeSemanticTokens",n,r.getFullModelRange());const o=yield iPe(s,r,null,null,Hn.None);if(!o)return;const{provider:a,tokens:l}=o;if(!l||!tV(l))return;const c=ePe({id:0,type:"full",data:l.data});return l.resultId&&a.releaseDocumentSemanticTokens(l.resultId),c}));si.registerCommand("_provideDocumentRangeSemanticTokensLegend",(i,...e)=>P1(void 0,void 0,void 0,function*(){const[n,r]=e;Ui(n instanceof Jt);const s=i.get(Fr).getModel(n);if(!s)return;const{documentRangeSemanticTokensProvider:o}=i.get(Et),a=rPe(o,s);if(a.length===0)return;if(a.length===1)return a[0].getLegend();if(!r||!J.isIRange(r))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),a[0].getLegend();const l=yield Ple(o,s,J.lift(r),Hn.None);if(l)return l.provider.getLegend()}));si.registerCommand("_provideDocumentRangeSemanticTokens",(i,...e)=>P1(void 0,void 0,void 0,function*(){const[n,r]=e;Ui(n instanceof Jt),Ui(J.isIRange(r));const s=i.get(Fr).getModel(n);if(!s)return;const{documentRangeSemanticTokensProvider:o}=i.get(Et),a=yield Ple(o,s,J.lift(r),Hn.None);if(!(!a||!a.tokens))return ePe({id:0,type:"full",data:a.tokens.data})}));const Ole="editor.semanticHighlighting";function Une(i,e,n){var r;const s=(r=n.getValue(Ole,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))===null||r===void 0?void 0:r.enabled;return typeof s=="boolean"?s:e.getColorTheme().semanticHighlighting}var sPe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},sm=function(i,e){return function(n,r){e(n,r,i)}},Jb;let qne=class extends Le{constructor(e,n,r,s,o,a){super(),this._watchers=Object.create(null);const l=d=>{this._watchers[d.uri.toString()]=new LO(d,e,r,o,a)},c=(d,h)=>{h.dispose(),delete this._watchers[d.uri.toString()]},u=()=>{for(const d of n.getModels()){const h=this._watchers[d.uri.toString()];Une(d,r,s)?h||l(d):h&&c(d,h)}};this._register(n.onModelAdded(d=>{Une(d,r,s)&&l(d)})),this._register(n.onModelRemoved(d=>{const h=this._watchers[d.uri.toString()];h&&c(d,h)})),this._register(s.onDidChangeConfiguration(d=>{d.affectsConfiguration(Ole)&&u()})),this._register(r.onDidColorThemeChange(u))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};qne=sPe([sm(0,B$),sm(1,Fr),sm(2,Do),sm(3,ei),sm(4,xh),sm(5,Et)],qne);let LO=Jb=class extends Le{constructor(e,n,r,s,o){super(),this._semanticTokensStylingService=n,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentSemanticTokens",{min:Jb.REQUEST_MIN_DELAY,max:Jb.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Ji(()=>this._fetchDocumentSemanticTokensNow(),Jb.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const a=()=>{Mi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const l of this._provider.all(e))typeof l.onDidChange=="function"&&this._documentProvidersChangeListeners.push(l.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};a(),this._register(this._provider.onDidChange(()=>{a(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(r.onDidColorThemeChange(l=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),Mi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!nPe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Ns,n=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,r=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=iPe(this._provider,this._model,n,r,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],a=this._model.onDidChangeContent(c=>{o.push(c)}),l=new Xa(!1);s.then(c=>{if(this._debounceInformation.update(this._model,l.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),!c)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:u,tokens:d}=c,h=this._semanticTokensStylingService.getStyling(u);this._setDocumentSemanticTokens(u,d||null,h,o)}},c=>{c&&(sg(c)||typeof c.message=="string"&&c.message.indexOf("busy")!==-1)||Ln(c),this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,n,r,s,o){o=Math.min(o,r.length-s,e.length-n);for(let a=0;a<o;a++)r[s+a]=e[n+a]}_setDocumentSemanticTokens(e,n,r,s){const o=this._currentDocumentResponse,a=()=>{(s.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&n&&e.releaseDocumentSemanticTokens(n.resultId);return}if(!e||!r){this._model.tokenization.setSemanticTokens(null,!1);return}if(!n){this._model.tokenization.setSemanticTokens(null,!0),a();return}if(tPe(n)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(n.edits.length===0)n={resultId:n.resultId,data:o.data};else{let l=0;for(const f of n.edits)l+=(f.data?f.data.length:0)-f.deleteCount;const c=o.data,u=new Uint32Array(c.length+l);let d=c.length,h=u.length;for(let f=n.edits.length-1;f>=0;f--){const p=n.edits[f];if(p.start>c.length){r.warnInvalidEditStart(o.resultId,n.resultId,f,p.start,c.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=d-(p.start+p.deleteCount);g>0&&(Jb._copy(c,d-g,u,h-g,g),h-=g),p.data&&(Jb._copy(p.data,0,u,h-p.data.length,p.data.length),h-=p.data.length),d=p.start}d>0&&Jb._copy(c,0,u,0,d),n={resultId:n.resultId,data:u}}}if(tV(n)){this._currentDocumentResponse=new FAt(e,n.resultId,n.data);const l=LTe(n,r,this._model.getLanguageId());if(s.length>0)for(const c of s)for(const u of l)for(const d of c.changes)u.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(l,!0)}else this._model.tokenization.setSemanticTokens(null,!0);a()}};LO.REQUEST_MIN_DELAY=300;LO.REQUEST_MAX_DELAY=2e3;LO=Jb=sPe([sm(1,B$),sm(2,Do),sm(3,xh),sm(4,Et)],LO);class FAt{constructor(e,n,r){this.provider=e,this.resultId=n,this.data=r}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}sz(qne);var BAt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},fA=function(i,e){return function(n,r){e(n,r,i)}};let DO=class extends Le{constructor(e,n,r,s,o,a){super(),this._semanticTokensStylingService=n,this._themeService=r,this._configurationService=s,this._editor=e,this._provider=a.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Ji(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const l=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{l()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),l()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),l()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),l()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(Ole)&&(this._cancelAll(),l())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),l()})),l()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let n=0,r=this._outstandingRequests.length;n<r;n++)if(this._outstandingRequests[n]===e){this._outstandingRequests.splice(n,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!Une(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!OAt(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const n=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(n.map(r=>this._requestRange(e,r)))}_requestRange(e,n){const r=e.getVersionId(),s=go(a=>Promise.resolve(Ple(this._provider,e,n,a))),o=new Xa(!1);return s.then(a=>{if(this._debounceInformation.update(e,o.elapsed()),!a||!a.tokens||e.isDisposed()||e.getVersionId()!==r)return;const{provider:l,tokens:c}=a,u=this._semanticTokensStylingService.getStyling(l);e.tokenization.setPartialSemanticTokens(n,LTe(c,u,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}};DO.ID="editor.contrib.viewportSemanticTokens";DO=BAt([fA(1,B$),fA(2,Do),fA(3,ei),fA(4,xh),fA(5,Et)],DO);_i(DO.ID,DO,1);class jAt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,n){const r=[];for(const s of n){const o=[];r.push(o),this.selectSubwords&&this._addInWordRanges(o,e,s),this._addWordRanges(o,e,s),this._addWhitespaceLine(o,e,s),o.push({range:e.getFullModelRange()})}return r}_addInWordRanges(e,n,r){const s=n.getWordAtPosition(r);if(!s)return;const{word:o,startColumn:a}=s,l=r.column-a;let c=l,u=l,d=0;for(;c>=0;c--){const h=o.charCodeAt(c);if(c!==l&&(h===95||h===45))break;if(gy(h)&&nm(d))break;d=h}for(c+=1;u<o.length;u++){const h=o.charCodeAt(u);if(nm(h)&&gy(d))break;if(h===95||h===45)break;d=h}c<u&&e.push({range:new J(r.lineNumber,a+c,r.lineNumber,a+u)})}_addWordRanges(e,n,r){const s=n.getWordAtPosition(r);s&&e.push({range:new J(r.lineNumber,s.startColumn,r.lineNumber,s.endColumn)})}_addWhitespaceLine(e,n,r){n.getLineLength(r.lineNumber)>0&&n.getLineFirstNonWhitespaceColumn(r.lineNumber)===0&&n.getLineLastNonWhitespaceColumn(r.lineNumber)===0&&e.push({range:new J(r.lineNumber,1,r.lineNumber,n.getLineMaxColumn(r.lineNumber))})}}var WAt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},$At=function(i,e){return function(n,r){e(n,r,i)}},nV=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},Kne;class Fle{constructor(e,n){this.index=e,this.ranges=n}mov(e){const n=this.index+(e?1:-1);if(n<0||n>=this.ranges.length)return this;const r=new Fle(n,this.ranges);return r.ranges[n].equalsRange(this.ranges[this.index])?r.mov(e):r}}let pI=Kne=class{static get(e){return e.getContribution(Kne.ID)}constructor(e,n){this._editor=e,this._languageFeaturesService=n,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return nV(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const n=this._editor.getSelections(),r=this._editor.getModel();if(this._state||(yield aPe(this._languageFeaturesService.selectionRangeProvider,r,n.map(o=>o.getPosition()),this._editor.getOption(112),Hn.None).then(o=>{var a;if(!(!Ka(o)||o.length!==n.length)&&!(!this._editor.hasModel()||!ys(this._editor.getSelections(),n,(l,c)=>l.equalsSelection(c)))){for(let l=0;l<o.length;l++)o[l]=o[l].filter(c=>c.containsPosition(n[l].getStartPosition())&&c.containsPosition(n[l].getEndPosition())),o[l].unshift(n[l]);this._state=o.map(l=>new Fle(0,l)),(a=this._selectionListener)===null||a===void 0||a.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var l;this._ignoreSelection||((l=this._selectionListener)===null||l===void 0||l.dispose(),this._state=void 0)})}})),!this._state)return;this._state=this._state.map(o=>o.mov(e));const s=this._state.map(o=>Ft.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}})}};pI.ID="editor.contrib.smartSelectController";pI=Kne=WAt([$At(1,Et)],pI);class oPe extends kt{constructor(e,n){super(n),this._forward=e}run(e,n){return nV(this,void 0,void 0,function*(){const r=pI.get(n);r&&(yield r.run(this._forward))})}}class zAt extends oPe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:L("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"1_basic",title:L({},"&&Expand Selection"),order:2}})}}si.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class VAt extends oPe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:L("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:se.MenubarSelectionMenu,group:"1_basic",title:L({},"&&Shrink Selection"),order:3}})}}_i(pI.ID,pI,4);rt(zAt);rt(VAt);function aPe(i,e,n,r,s){return nV(this,void 0,void 0,function*(){const o=i.all(e).concat(new jAt(r.selectSubwords));o.length===1&&o.unshift(new Wu);const a=[],l=[];for(const c of o)a.push(Promise.resolve(c.provideSelectionRanges(e,n,s)).then(u=>{if(Ka(u)&&u.length===n.length)for(let d=0;d<n.length;d++){l[d]||(l[d]=[]);for(const h of u[d])J.isIRange(h.range)&&J.containsPosition(h.range,n[d])&&l[d].push(J.lift(h.range))}},Us));return yield Promise.all(a),l.map(c=>{if(c.length===0)return[];c.sort((f,p)=>ve.isBefore(f.getStartPosition(),p.getStartPosition())?1:ve.isBefore(p.getStartPosition(),f.getStartPosition())||ve.isBefore(f.getEndPosition(),p.getEndPosition())?-1:ve.isBefore(p.getEndPosition(),f.getEndPosition())?1:0);const u=[];let d;for(const f of c)(!d||J.containsRange(f,d)&&!J.equalsRange(f,d))&&(u.push(f),d=f);if(!r.selectLeadingAndTrailingWhitespace)return u;const h=[u[0]];for(let f=1;f<u.length;f++){const p=u[f-1],g=u[f];if(g.startLineNumber!==p.startLineNumber||g.endLineNumber!==p.endLineNumber){const m=new J(p.startLineNumber,e.getLineFirstNonWhitespaceColumn(p.startLineNumber),p.endLineNumber,e.getLineLastNonWhitespaceColumn(p.endLineNumber));m.containsRange(p)&&!m.equalsRange(p)&&g.containsRange(m)&&!g.equalsRange(m)&&h.push(m);const _=new J(p.startLineNumber,1,p.endLineNumber,e.getLineMaxColumn(p.endLineNumber));_.containsRange(p)&&!_.equalsRange(m)&&g.containsRange(_)&&!g.equalsRange(_)&&h.push(_)}h.push(g)}return h})})}si.registerCommand("_executeSelectionRangeProvider",function(i,...e){return nV(this,void 0,void 0,function*(){const[n,r]=e;Ui(Jt.isUri(n));const s=i.get(Et).selectionRangeProvider,o=yield i.get(Ec).createModelReference(n);try{return aPe(s,o.object.textEditorModel,r,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},Hn.None)}finally{o.dispose()}})});const HAt=Object.freeze({View:{value:L("view","View"),original:"View"},Help:{value:L("help","Help"),original:"Help"},Test:{value:L("test","Test"),original:"Test"},File:{value:L("file","File"),original:"File"},Preferences:{value:L("preferences","Preferences"),original:"Preferences"},Developer:{value:L({},"Developer"),original:"Developer"}});var UAt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class bve{constructor(e,n,r,s=null){this.startLineNumbers=e,this.endLineNumbers=n,this.lastLineRelativePosition=r,this.showEndForLine=s}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&ys(this.startLineNumbers,e.startLineNumbers)&&ys(this.endLineNumbers,e.endLineNumbers)}}const yve=$v("stickyScrollViewLayer",{createHTML:i=>i}),NK="data-sticky-line-index",wve="data-sticky-is-line",qAt="data-sticky-is-line-number",Cve="data-sticky-is-folding-icon";class KAt extends Le{constructor(e){super(),this._editor=e,this._foldingIconStore=new Xe,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(66),this._stickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof D1),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const n=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(114)&&n(),r.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(r=>{r.scrollLeftChanged&&n(),r.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{n(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),n(),this._register(this._editor.onDidLayoutChange(r=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find(n=>n.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,n,r=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&r===1/0)return;this._previousState=e;const s=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const a=[...e.startLineNumbers];e.showEndForLine!==null&&(a[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=a}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(s,n,r)}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),n=e.contentLeft;this._lineNumbersDomNode.style.width=`${n}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),la(this._lineNumbersDomNode),la(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const n of this._stickyLines){const r=n.foldingIcon;r&&r.setVisible(e?!0:r.isCollapsed)}}_renderRootNode(e,n,r=1/0){return UAt(this,void 0,void 0,function*(){const s=this._editor.getLayoutInfo();for(const[a,l]of this._lineNumbers.entries()){const c=e[a],u=l>=r||(c==null?void 0:c.lineNumber)!==l?this._renderChildNode(a,l,n,s):this._updateTopAndZIndexOfStickyLine(c);u&&(this._linesDomNode.appendChild(u.lineDomNode),this._lineNumbersDomNode.appendChild(u.lineNumberDomNode),this._stickyLines.push(u))}n&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(o===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)})}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(Be(this._lineNumbersDomNode,ht.MOUSE_ENTER,n=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(Be(this._lineNumbersDomNode,ht.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,n,r,s){const o=this._editor._getViewModel();if(!o)return;const a=o.coordinatesConverter.convertModelPositionToViewPosition(new ve(n,1)).lineNumber,l=o.getViewLineRenderingData(a),c=this._editor.getOption(67);let u;try{u=ru.filter(l.inlineDecorations,a,l.minColumn,l.maxColumn)}catch{u=[]}const d=new X1(!0,!0,l.content,l.continuesWithWrappedLine,l.isBasicASCII,l.containsRTL,0,l.tokens,u,l.tabSize,l.startVisibleColumn,1,1,1,500,"none",!0,!0,null),h=new jI(2e3),f=T5(d,h);let p;yve?p=yve.createHTML(h.build()):p=h.build();const g=document.createElement("span");g.setAttribute(NK,String(e)),g.setAttribute(wve,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${n}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=p;const m=document.createElement("span");m.setAttribute(NK,String(e)),m.setAttribute(qAt,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const _=s.contentLeft;m.style.width=`${_}px`;const b=document.createElement("span");c.renderType===1||c.renderType===3&&n%10===0?b.innerText=n.toString():c.renderType===2&&(b.innerText=Math.abs(n-this._editor.getPosition().lineNumber).toString()),b.className="sticky-line-number-inner",b.style.lineHeight=`${this._lineHeight}px`,b.style.width=`${s.lineNumbersWidth}px`,b.style.paddingLeft=`${s.lineNumbersLeft}px`,m.appendChild(b);const y=this._renderFoldingIconForLine(r,n);y&&m.appendChild(y.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(b),m.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const x=new GAt(e,n,g,m,y,f.characterMapping);return this._updateTopAndZIndexOfStickyLine(x)}_updateTopAndZIndexOfStickyLine(e){var n;const r=e.index,s=e.lineDomNode,o=e.lineNumberDomNode,a=r===this._lineNumbers.length-1,l="0",c="1";s.style.zIndex=a?l:c,o.style.zIndex=a?l:c;const u=`${r*this._lineHeight+this._lastLineRelativePosition+(!((n=e.foldingIcon)===null||n===void 0)&&n.isCollapsed?1:0)}px`,d=`${r*this._lineHeight}px`;return s.style.top=a?u:d,o.style.top=a?u:d,e}_renderFoldingIconForLine(e,n){const r=this._editor.getOption(109);if(!e||r==="never")return;const s=e.regions,o=s.findRange(n),a=s.getStartLineNumber(o);if(!(n===a))return;const c=s.isCollapsed(o),u=new XAt(c,a,s.getEndLineNumber(o),this._lineHeight);return u.setVisible(this._isOnGlyphMargin?!0:c||r==="always"),u.domNode.setAttribute(Cve,""),u}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._stickyLines.length&&this._stickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const n=this._getRenderedStickyLineFromChildDomNode(e);if(!n)return null;const r=woe(n.characterMapping,e,0);return new ve(n.lineNumber,r)}getLineNumberFromChildDomNode(e){var n,r;return(r=(n=this._getRenderedStickyLineFromChildDomNode(e))===null||n===void 0?void 0:n.lineNumber)!==null&&r!==void 0?r:null}_getRenderedStickyLineFromChildDomNode(e){const n=this.getLineIndexFromChildDomNode(e);return n===null||n<0||n>=this._stickyLines.length?null:this._stickyLines[n]}getLineIndexFromChildDomNode(e){const n=this._getAttributeValue(e,NK);return n?parseInt(n,10):null}isInStickyLine(e){return this._getAttributeValue(e,wve)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Cve)!==void 0}_getAttributeValue(e,n){for(;e&&e!==this._rootDomNode;){const r=e.getAttribute(n);if(r!==null)return r;e=e.parentElement}}}class GAt{constructor(e,n,r,s,o,a){this.index=e,this.lineNumber=n,this.lineDomNode=r,this.lineNumberDomNode=s,this.foldingIcon=o,this.characterMapping=a}}class XAt{constructor(e,n,r,s){this.isCollapsed=e,this.foldingStartLine=n,this.foldingEndLine=r,this.dimension=s,this.domNode=document.createElement("div"),this.domNode.style.width=`${s}px`,this.domNode.style.height=`${s}px`,this.domNode.className=en.asClassName(e?Oz:Pz)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class EM{constructor(e,n){this.startLineNumber=e,this.endLineNumber=n}}class kj{constructor(e,n,r){this.range=e,this.children=n,this.parent=r}}class lPe{constructor(e,n,r,s){this.uri=e,this.version=n,this.element=r,this.outlineProviderId=s}}var iV=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},EO=function(i,e){return function(n,r){e(n,r,i)}},Sve=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},IM;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(IM||(IM={}));var Ey;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(Ey||(Ey={}));let Gne=class extends Le{constructor(e,n,r,s){super(),this._editor=e,this._languageConfigurationService=n,this._languageFeaturesService=r,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Rf(300)),this._updateOperation=this._register(new Xe);const o=new Xne(r),a=new Zne(this._editor,r),l=new Yne(this._editor,n);switch(s){case IM.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(a),this._modelProviders.push(l);break;case IM.FOLDING_PROVIDER_MODEL:this._modelProviders.push(a),this._modelProviders.push(l);break;case IM.INDENTATION_MODEL:this._modelProviders.push(l);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,n,r){return Sve(this,void 0,void 0,function*(){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),yield this._updateScheduler.trigger(()=>Sve(this,void 0,void 0,function*(){for(const s of this._modelProviders){const{statusPromise:o,modelPromise:a}=s.computeStickyModel(e,n,r);this._modelPromise=a;const l=yield o;if(this._modelPromise!==a)return null;switch(l){case Ey.CANCELED:return this._updateOperation.clear(),null;case Ey.VALID:return s.stickyModel}}return null})).catch(s=>(Ln(s),null))})}};Gne=iV([EO(1,dr),EO(2,Et)],Gne);class cPe{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Ey.INVALID}computeStickyModel(e,n,r){if(r.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const s=go(o=>this.createModelFromProvider(e,n,o));return{statusPromise:s.then(o=>this.isModelValid(o)?r.isCancellationRequested?Ey.CANCELED:(this._stickyModel=this.createStickyModel(e,n,r,o),Ey.VALID):this._invalid()).then(void 0,o=>(Ln(o),Ey.CANCELED)),modelPromise:s}}isModelValid(e){return!0}isProviderValid(e){return!0}}let Xne=class extends cPe{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,n,r){return M0.create(this._languageFeaturesService.documentSymbolProvider,e,r)}createStickyModel(e,n,r,s){var o;const{stickyOutlineElement:a,providerID:l}=this._stickyModelFromOutlineModel(s,(o=this._stickyModel)===null||o===void 0?void 0:o.outlineProviderId);return new lPe(e.uri,n,a,l)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,n){let r;if(Vn.first(e.children.values())instanceof RMe){const l=Vn.find(e.children.values(),c=>c.id===n);if(l)r=l.children;else{let c="",u=-1,d;for(const[h,f]of e.children.entries()){const p=this._findSumOfRangesOfGroup(f);p>u&&(d=f,u=p,c=f.id)}n=c,r=d.children}}else r=e.children;const s=[],o=Array.from(r.values()).sort((l,c)=>{const u=new EM(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber),d=new EM(c.symbol.range.startLineNumber,c.symbol.range.endLineNumber);return this._comparator(u,d)});for(const l of o)s.push(this._stickyModelFromOutlineElement(l,l.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new kj(void 0,s,void 0),providerID:n}}_stickyModelFromOutlineElement(e,n){const r=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==n)r.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const a of o.children.values())r.push(this._stickyModelFromOutlineElement(a,o.symbol.selectionRange.startLineNumber));r.sort((o,a)=>this._comparator(o.range,a.range));const s=new EM(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new kj(s,r,void 0)}_comparator(e,n){return e.startLineNumber!==n.startLineNumber?e.startLineNumber-n.startLineNumber:n.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let n=0;for(const r of e.children.values())n+=this._findSumOfRangesOfGroup(r);return e instanceof mne?n+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:n}};Xne=iV([EO(0,Et)],Xne);class uPe extends cPe{constructor(e){super(),this._foldingLimitReporter=new EMe(e)}createStickyModel(e,n,r,s){const o=this._fromFoldingRegions(s);return new lPe(e.uri,n,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const n=e.length,r=[],s=new kj(void 0,[],void 0);for(let o=0;o<n;o++){const a=e.getParentIndex(o);let l;a!==-1?l=r[a]:l=s;const c=new kj(new EM(e.getStartLineNumber(o),e.getEndLineNumber(o)+1),[],l);l.children.push(c),r.push(c)}return s}}let Yne=class extends uPe{constructor(e,n){super(e),this._languageConfigurationService=n}createModelFromProvider(e,n,r){return new yle(e,this._languageConfigurationService,this._foldingLimitReporter).compute(r)}};Yne=iV([EO(1,dr)],Yne);let Zne=class extends uPe{constructor(e,n){super(e),this._languageFeaturesService=n}isProviderValid(e){return i_.getFoldingRangeProviders(this._languageFeaturesService,e).length>0}createModelFromProvider(e,n,r){const s=i_.getFoldingRangeProviders(this._languageFeaturesService,e);return new Cle(e,s,()=>this.createModelFromProvider(e,n,r),this._foldingLimitReporter,void 0).compute(r)}};Zne=iV([EO(1,Et)],Zne);var YAt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},xve=function(i,e){return function(n,r){e(n,r,i)}},kve=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class ZAt{constructor(e,n,r){this.startLineNumber=e,this.endLineNumber=n,this.nestingDepth=r}}let Qne=class extends Le{constructor(e,n,r){super(),this._languageFeaturesService=n,this._languageConfigurationService=r,this._onDidChangeStickyScroll=this._register(new _e),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Xe),this._updateSoon=this._register(new Ji(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new Gne(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}update(){var e;return kve(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Ns,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return kve(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const n=this._editor.getModel(),r=n.getVersionId(),s=yield this._stickyModelProvider.update(n,r,e);e.isCancellationRequested||(this._model=s)})}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,n,r,s,o){if(n.children.length===0)return;let a=o;const l=[];for(let d=0;d<n.children.length;d++){const h=n.children[d];h.range&&l.push(h.range.startLineNumber)}const c=this.updateIndex(JM(l,e.startLineNumber,(d,h)=>d-h)),u=this.updateIndex(JM(l,e.startLineNumber+s,(d,h)=>d-h));for(let d=c;d<=u;d++){const h=n.children[d];if(!h)return;if(h.range){const f=h.range.startLineNumber,p=h.range.endLineNumber;e.startLineNumber<=p+1&&f-1<=e.endLineNumber&&f!==a&&(a=f,r.push(new ZAt(f,p-1,s+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,r,s+1,f))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,r,s,o)}}getCandidateStickyLinesIntersecting(e){var n,r;if(!(!((n=this._model)===null||n===void 0)&&n.element))return[];let s=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,s,0,-1);const o=(r=this._editor._getViewModel())===null||r===void 0?void 0:r.getHiddenAreas();if(o)for(const a of o)s=s.filter(l=>!(l.startLineNumber>=a.startLineNumber&&l.endLineNumber<=a.endLineNumber+1));return s}};Qne=YAt([xve(1,Et),xve(2,dr)],Qne);var QAt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},fD=function(i,e){return function(n,r){e(n,r,i)}},MK=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},Jne;let r_=Jne=class extends Le{constructor(e,n,r,s,o,a,l){super(),this._editor=e,this._contextMenuService=n,this._languageFeaturesService=r,this._instaService=s,this._contextKeyService=l,this._sessionStore=new Xe,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new KAt(this._editor),this._stickyLineCandidateProvider=new Qne(this._editor,r,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new bve([],[],0),this._readConfiguration();const c=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{(d.hasChanged(114)||d.hasChanged(72)||d.hasChanged(66)||d.hasChanged(109))&&this._readConfiguration()})),this._register(Be(c,ht.CONTEXT_MENU,d=>MK(this,void 0,void 0,function*(){this._onContextMenu(d)}))),this._stickyScrollFocusedContextKey=oe.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=oe.stickyScrollVisible.bindTo(this._contextKeyService);const u=this._register(Gm(c));this._register(u.onDidBlur(d=>{this._positionRevealed===!1&&c.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(u.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(Be(c,ht.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(Jne.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Xe,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,n){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,n(),this._editor.setSelection(J.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Xe),n=this._register(new yz(this._editor,{extractLineNumberFromMouseEvent:o=>{const a=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return a?a.lineNumber:0}})),r=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const a=o.target.element;if(!a||a.innerText!==a.innerHTML)return null;const l=this._stickyScrollWidget.getEditorPositionFromNode(a);return l?{range:new J(l.lineNumber,l.column,l.lineNumber,l.column+a.innerText.length),textElement:a}:null},s=this._stickyScrollWidget.getDomNode();this._register(As(s,ht.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const u=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(u===null)return;const d=new ve(this._endLineNumbers[u],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const u=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(u);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let c=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!c){const u=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(u===null)return;c=new ve(u,1)}this._revealPosition(c)})),this._register(As(s,ht.MOUSE_MOVE,o=>{if(o.shiftKey){const a=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(a===null||this._showEndForLine!==null&&this._showEndForLine===a)return;this._showEndForLine=a,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(Be(s,ht.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(n.onMouseMoveOrRelevantKeyDown(([o,a])=>{const l=r(o);if(!l||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:c,textElement:u}=l;if(!c.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=c,e.clear();else if(u.style.textDecoration==="underline")return;const d=new Ns;e.add(gn(()=>d.dispose(!0)));let h;Lz(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ve(c.startLineNumber,c.startColumn+1),d.token).then(f=>{if(!d.token.isCancellationRequested)if(f.length!==0){this._candidateDefinitionsLength=f.length;const p=u;h!==p?(e.clear(),h=p,h.style.textDecoration="underline",e.add(gn(()=>{h.style.textDecoration="none"}))):h||(h=p,h.style.textDecoration="underline",e.add(gn(()=>{h.style.textDecoration="none"})))}else e.clear()})})),this._register(n.onCancel(()=>{e.clear()})),this._register(n.onExecute(o=>MK(this,void 0,void 0,function*(){if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const a=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);a&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:a.lineNumber,column:1})),this._instaService.invokeFunction(jMe,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const n=new rh(e);this._contextMenuService.showContextMenu({menuId:se.StickyScrollContext,getAnchor:()=>n})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const n=this._stickyScrollWidget.getStickyLineForLine(e),r=n==null?void 0:n.foldingIcon;if(!r)return;SMe(this._foldingModel,Number.MAX_VALUE,[e]),r.isCollapsed=!r.isCollapsed;const s=(r.isCollapsed?this._editor.getTopForLineNumber(r.foldingEndLine):this._editor.getTopForLineNumber(r.foldingStartLine))-this._editor.getOption(66)*n.index+1;this._editor.setScrollTop(s),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(r=>{r.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(r=>this._onTokensChange(r))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll()}))}_needsUpdate(e){const n=this._stickyScrollWidget.getCurrentLines();for(const r of n)for(const s of e.ranges)if(r>=s.fromLineNumber&&r<=s.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const n=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(n*.25)}_renderStickyScroll(e=1/0){var n,r;return MK(this,void 0,void 0,function*(){const s=this._editor.getModel();if(!s||s.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===s.getVersionId())if(this._foldingModel=(r=yield(n=i_.get(this._editor))===null||n===void 0?void 0:n.getFoldingModel())!==null&&r!==void 0?r:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const a=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(a)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}})}findScrollWidgetState(){const e=this._editor.getOption(66),n=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),r=this._editor.getScrollTop();let s=0;const o=[],a=[],l=this._editor.getVisibleRanges();if(l.length!==0){const c=new EM(l[0].startLineNumber,l[l.length-1].endLineNumber),u=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(c);for(const d of u){const h=d.startLineNumber,f=d.endLineNumber,p=d.nestingDepth;if(f-h>0){const g=(p-1)*e,m=p*e,_=this._editor.getBottomForLineNumber(h)-r,b=this._editor.getTopForLineNumber(f)-r,y=this._editor.getBottomForLineNumber(f)-r;if(g>b&&g<=y){o.push(h),a.push(f+1),s=y-m;break}else m>_&&m<=y&&(o.push(h),a.push(f+1));if(o.length===n)break}}}return this._endLineNumbers=a,new bve(o,a,s,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};r_.ID="store.contrib.stickyScrollController";r_=Jne=QAt([fD(1,Ff),fD(2,Et),fD(3,hn),fD(4,dr),fD(5,xh),fD(6,mn)],r_);var JAt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};class eNt extends md{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:L("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:L({},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:HAt.View,toggled:{condition:ze.equals("config.editor.stickyScroll.enabled",!0),title:L("stickyScroll","Sticky Scroll"),mnemonicTitle:L({},"&&Sticky Scroll")},menu:[{id:se.CommandPalette},{id:se.MenubarAppearanceMenu,group:"4_editor",order:3},{id:se.StickyScrollContext}]})}run(e){return JAt(this,void 0,void 0,function*(){const n=e.get(ei),r=!n.getValue("editor.stickyScroll.enabled");return n.updateValue("editor.stickyScroll.enabled",r)})}}const rV=100;class tNt extends og{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:L("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:L({},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:ze.and(ze.has("config.editor.stickyScroll.enabled"),oe.stickyScrollVisible),menu:[{id:se.CommandPalette}]})}runEditorCommand(e,n){var r;(r=r_.get(n))===null||r===void 0||r.focus()}}class nNt extends og{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:L("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:oe.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:rV,primary:18}})}runEditorCommand(e,n){var r;(r=r_.get(n))===null||r===void 0||r.focusNext()}}class iNt extends og{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:L("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:oe.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:rV,primary:16}})}runEditorCommand(e,n){var r;(r=r_.get(n))===null||r===void 0||r.focusPrevious()}}class rNt extends og{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:L("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:oe.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:rV,primary:3}})}runEditorCommand(e,n){var r;(r=r_.get(n))===null||r===void 0||r.goToFocused()}}class sNt extends og{constructor(){super({id:"editor.action.selectEditor",title:{value:L("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:oe.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:rV,primary:9}})}runEditorCommand(e,n){var r;(r=r_.get(n))===null||r===void 0||r.selectEditor()}}_i(r_.ID,r_,1);Ir(eNt);Ir(tNt);Ir(iNt);Ir(nNt);Ir(rNt);Ir(sNt);var Ble=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},HS=function(i,e){return function(n,r){e(n,r,i)}},oNt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},jC;class aNt{constructor(e,n,r,s,o,a){this.range=e,this.insertText=n,this.filterText=r,this.additionalTextEdits=s,this.command=o,this.completion=a}}let eie=class extends Fst{constructor(e,n,r,s,o,a){super(o.disposable),this.model=e,this.line=n,this.word=r,this.completionModel=s,this._suggestMemoryService=a}canBeReused(e,n,r){return this.model===e&&this.line===n&&this.word.word.length>0&&this.word.startColumn===r.startColumn&&this.word.endColumn<r.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){var e;const n=[],{items:r}=this.completionModel,s=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},r),o=Vn.slice(r,s),a=Vn.slice(r,0,s);let l=5;for(const c of Vn.concat(o,a)){if(c.score===Hp.Default)continue;const u=new J(c.editStart.lineNumber,c.editStart.column,c.editInsertEnd.lineNumber,c.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),d=c.completion.insertTextRules&&c.completion.insertTextRules&4?{snippet:c.completion.insertText}:c.completion.insertText;n.push(new aNt(u,d,(e=c.filterTextLow)!==null&&e!==void 0?e:c.labelLow,c.completion.additionalTextEdits,c.completion.command,c)),l-->=0&&c.resolve(Hn.None)}return n}};eie=Ble([HS(5,Wz)],eie);let tie=class{constructor(e,n,r,s){this._getEditorOption=e,this._languageFeatureService=n,this._clipboardService=r,this._suggestMemoryService=s}provideInlineCompletions(e,n,r,s){var o;return oNt(this,void 0,void 0,function*(){if(r.selectedSuggestionInfo)return;const a=this._getEditorOption(88,e);if(k2.isAllOff(a))return;e.tokenization.tokenizeIfCheap(n.lineNumber);const l=e.tokenization.getLineTokens(n.lineNumber),c=l.getStandardTokenType(l.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(k2.valueFor(a,c)!=="inline")return;let u=e.getWordAtPosition(n),d;if(u!=null&&u.word||(d=this._getTriggerCharacterInfo(e,n)),!(u!=null&&u.word)&&!d||(u||(u=e.getWordUntilPosition(n)),u.endColumn!==n.column))return;let h;const f=e.getValueInRange(new J(n.lineNumber,1,n.lineNumber,n.column));if(!d&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,n.lineNumber,u))){const p=new fve(f,n.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=p,this._lastResult.acquire(),h=this._lastResult}else{const p=yield xle(this._languageFeatureService.completionProvider,e,n,new mO(void 0,void 0,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},s);let g;p.needsClipboard&&(g=yield this._clipboardService.readText());const m=new uy(p.items,n.column,new fve(f,0),Lp.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},g);h=new eie(e,n.lineNumber,u,m,p,this._suggestMemoryService)}return this._lastResult=h,h})}handleItemDidShow(e,n){n.completion.resolve(Hn.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,n){var r;const s=e.getValueInRange(J.fromPositions({lineNumber:n.lineNumber,column:n.column-1},n)),o=new Set;for(const a of this._languageFeatureService.completionProvider.all(e))!((r=a.triggerCharacters)===null||r===void 0)&&r.includes(s)&&o.add(a);if(o.size!==0)return{providers:o,ch:s}}};tie=Ble([HS(1,Et),HS(2,qv),HS(3,Wz)],tie);let Lj=jC=class{constructor(e,n,r,s){if(++jC._counter===1){const o=s.createInstance(tie,(a,l)=>{var c;return((c=r.listCodeEditors().find(d=>d.getModel()===l))!==null&&c!==void 0?c:e).getOption(a)});jC._disposable=n.inlineCompletionsProvider.register("*",o)}}dispose(){var e;--jC._counter===0&&((e=jC._disposable)===null||e===void 0||e.dispose(),jC._disposable=void 0)}};Lj._counter=0;Lj=jC=Ble([HS(1,Et),HS(2,Si),HS(3,hn)],Lj);_i("suggest.inlineCompletionsProvider",Lj,0);class lNt extends kt{constructor(){super({id:"editor.action.forceRetokenize",label:L("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,n){if(!n.hasModel())return;const r=n.getModel();r.tokenization.resetTokenization();const s=new Xa;r.tokenization.forceTokenization(r.getLineCount()),s.stop(),console.log(`tokenization took ${s.elapsed()}`)}}rt(lNt);class sV extends md{constructor(){super({id:sV.ID,title:{value:L({},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const n=!BE.getTabFocusMode();BE.setTabFocusMode(n),Ua(n?L("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):L("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}sV.ID="editor.action.toggleTabFocusMode";Ir(sV);var cNt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},uNt=function(i,e){return function(n,r){e(n,r,i)}};let nie=class extends Le{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,n,r={},s){var o;super(),this._link=n,this._enabled=!0,this.el=He(e,tt("a.monaco-link",{tabIndex:(o=n.tabIndex)!==null&&o!==void 0?o:0,href:n.href,title:n.title},n.label)),this.el.setAttribute("role","button");const a=this._register(new Xn(this.el,"click")),l=this._register(new Xn(this.el,"keypress")),c=_t.chain(l.event,h=>h.map(f=>new yr(f)).filter(f=>f.keyCode===3)),u=this._register(new Xn(this.el,lr.Tap)).event;this._register(or.addTarget(this.el));const d=_t.any(a.event,c,u);this._register(d(h=>{this.enabled&&(Nn.stop(h,!0),r!=null&&r.opener?r.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};nie=cNt([uNt(3,fu)],nie);var dPe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},hPe=function(i,e){return function(n,r){e(n,r,i)}};const dNt=26;let iie=class extends Le{constructor(e,n){super(),this._editor=e,this.instantiationService=n,this.banner=this._register(this.instantiationService.createInstance(rie))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var n;this.hide(),(n=e.onClose)===null||n===void 0||n.call(e)}})),this._editor.setBanner(this.banner.element,dNt)}};iie=dPe([hPe(1,hn)],iie);let rie=class extends Le{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Rv,{}),this.element=tt("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const n=tt("span");return n.innerText=e,n}return this.markdownRenderer.render(e).element}clear(){la(this.element)}show(e){la(this.element);const n=this.getAriaLabel(e);n&&this.element.setAttribute("aria-label",n);const r=He(this.element,tt("div.icon-container"));r.setAttribute("aria-hidden","true"),e.icon&&r.appendChild(tt(`div${en.asCSSSelector(e.icon)}`));const s=He(this.element,tt("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=He(this.element,tt("div.message-actions-container")),e.actions)for(const a of e.actions)this._register(this.instantiationService.createInstance(nie,this.messageActionsContainer,Object.assign(Object.assign({},a),{tabIndex:-1}),{}));const o=He(this.element,tt("div.action-container"));this.actionBar=this._register(new wh(o)),this.actionBar.push(this._register(new Vl("banner.close","Close Banner",en.asClassName(FRe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};rie=dPe([hPe(0,hn)],rie);var jle=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},lE=function(i,e){return function(n,r){e(n,r,i)}},$a=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const hNt=ws("extensions-warning-message",lt.warning,L("warningIcon","Icon shown with a warning message in the extensions editor."));let gI=class extends Le{constructor(e,n,r,s){super(),this._editor=e,this._editorWorkerService=n,this._workspaceTrustService=r,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const a=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let l;if(o.nonBasicAsciiCharacterCount>=a)l={message:L("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new nT};else if(o.ambiguousCharacterCount>=a)l={message:L("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new tw};else if(o.invisibleCharacterCount>=a)l={message:L("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new tT};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:l.message,icon:hNt,actions:[{label:l.command.shortLabel,href:`command:${l.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(s.createInstance(iie,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(r.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(124)&&(this._options=e.getOption(124),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=fNt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(r=>r===!1))return;const n={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(r=>r.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(r=>r==="_os"?new Intl.NumberFormat().resolvedOptions().locale:r==="_vscode"?jrt:r)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new sie(this._editor,n,this._updateState,this._editorWorkerService):this._highlighter=new pNt(this._editor,n,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};gI.ID="editor.contrib.unicodeHighlighter";gI=jle([lE(1,Wf),lE(2,PTe),lE(3,hn)],gI);function fNt(i,e){return{nonBasicASCII:e.nonBasicASCII===Bu?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Bu?!i:e.includeComments,includeStrings:e.includeStrings===Bu?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let sie=class extends Le{constructor(e,n,r,s){super(),this._editor=e,this._options=n,this._updateState=r,this._editorWorkerService=s,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ji(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(n=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(n);const r=[];if(!n.hasMore)for(const s of n.ranges)r.push({range:s,options:Dj.instance.getDecorationFromOptions(this._options)});this._decorations.set(r)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const n=this._editor.getModel();if(!zoe(n,e))return null;const r=n.getValueInRange(e.range);return{reason:fPe(r,this._options),inComment:Voe(n,e),inString:Hoe(n,e)}}};sie=jle([lE(3,Wf)],sie);class pNt extends Le{constructor(e,n,r){super(),this._editor=e,this._options=n,this._updateState=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ji(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),n=[],r={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const s of e){const o=noe.computeUnicodeHighlights(this._model,this._options,s);for(const a of o.ranges)r.ranges.push(a);r.ambiguousCharacterCount+=r.ambiguousCharacterCount,r.invisibleCharacterCount+=r.invisibleCharacterCount,r.nonBasicAsciiCharacterCount+=r.nonBasicAsciiCharacterCount,r.hasMore=r.hasMore||o.hasMore}if(!r.hasMore)for(const s of r.ranges)n.push({range:s,options:Dj.instance.getDecorationFromOptions(this._options)});this._updateState(r),this._decorations.set(n)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const n=this._editor.getModel(),r=n.getValueInRange(e.range);return zoe(n,e)?{reason:fPe(r,this._options),inComment:Voe(n,e),inString:Hoe(n,e)}:null}}let oie=class{constructor(e,n,r){this._editor=e,this._languageService=n,this._openerService=r,this.hoverOrdinal=5}computeSync(e,n){if(!this._editor.hasModel()||e.type!==1)return[];const r=this._editor.getModel(),s=this._editor.getContribution(gI.ID);if(!s)return[];const o=[],a=new Set;let l=300;for(const c of n){const u=s.getDecorationInfo(c);if(!u)continue;const h=r.getValueInRange(c.range).codePointAt(0),f=PK(h);let p;switch(u.reason.kind){case 0:{k5(u.reason.confusableWith)?p=L("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",f,PK(u.reason.confusableWith.codePointAt(0))):p=L("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",f,PK(u.reason.confusableWith.codePointAt(0)));break}case 1:p=L("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",f);break;case 2:p=L("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",f);break}if(a.has(p))continue;a.add(p);const g={codePoint:h,reason:u.reason,inComment:u.inComment,inString:u.inString},m=L("unicodeHighlight.adjustSettings","Adjust settings"),_=`command:${c4.ID}?${encodeURIComponent(JSON.stringify(g))}`,b=new Ea("",!0).appendMarkdown(p).appendText(" ").appendLink(_,m);o.push(new Tp(this,c.range,[b],!1,l++))}return o}renderHoverParts(e,n){return zNe(e,n,this._editor,this._languageService,this._openerService)}};oie=jle([lE(1,Ar),lE(2,fu)],oie);function aie(i){return`U+${i.toString(16).padStart(4,"0")}`}function PK(i){let e=`\`${aie(i)}\``;return Nm.isInvisibleCharacter(i)||(e+=` "${`${gNt(i)}`}"`),e}function gNt(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function fPe(i,e){return noe.computeUnicodeHighlightReason(i,e)}class Dj{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,n){const r=`${e}${n}`;let s=this.map.get(r);return s||(s=kn.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:n}),this.map.set(r,s)),s}}Dj.instance=new Dj;class mNt extends kt{constructor(){super({id:tw.ID,label:L("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=L("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,n,r){return $a(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(ei);s&&this.runAction(s)})}runAction(e){return $a(this,void 0,void 0,function*(){yield e.updateValue(fc.includeComments,!1,2)})}}class _Nt extends kt{constructor(){super({id:tw.ID,label:L("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=L("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,n,r){return $a(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(ei);s&&this.runAction(s)})}runAction(e){return $a(this,void 0,void 0,function*(){yield e.updateValue(fc.includeStrings,!1,2)})}}class tw extends kt{constructor(){super({id:tw.ID,label:L("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=L("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,n,r){return $a(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(ei);s&&this.runAction(s)})}runAction(e){return $a(this,void 0,void 0,function*(){yield e.updateValue(fc.ambiguousCharacters,!1,2)})}}tw.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class tT extends kt{constructor(){super({id:tT.ID,label:L("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=L("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,n,r){return $a(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(ei);s&&this.runAction(s)})}runAction(e){return $a(this,void 0,void 0,function*(){yield e.updateValue(fc.invisibleCharacters,!1,2)})}}tT.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class nT extends kt{constructor(){super({id:nT.ID,label:L("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=L("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,n,r){return $a(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(ei);s&&this.runAction(s)})}runAction(e){return $a(this,void 0,void 0,function*(){yield e.updateValue(fc.nonBasicASCII,!1,2)})}}nT.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class c4 extends kt{constructor(){super({id:c4.ID,label:L("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,n,r){return $a(this,void 0,void 0,function*(){const{codePoint:s,reason:o,inString:a,inComment:l}=r,c=String.fromCodePoint(s),u=e.get(lg),d=e.get(ei);function h(g){return Nm.isInvisibleCharacter(g)?L("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",aie(g)):L("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${aie(g)} "${c}"`)}const f=[];if(o.kind===0)for(const g of o.notAmbiguousInLocales)f.push({label:L("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:()=>$a(this,void 0,void 0,function*(){bNt(d,[g])})});if(f.push({label:h(s),run:()=>vNt(d,[s])}),l){const g=new mNt;f.push({label:g.label,run:()=>$a(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(a){const g=new _Nt;f.push({label:g.label,run:()=>$a(this,void 0,void 0,function*(){return g.runAction(d)})})}if(o.kind===0){const g=new tw;f.push({label:g.label,run:()=>$a(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(o.kind===1){const g=new tT;f.push({label:g.label,run:()=>$a(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(o.kind===2){const g=new nT;f.push({label:g.label,run:()=>$a(this,void 0,void 0,function*(){return g.runAction(d)})})}else yNt(o);const p=yield u.pick(f,{title:L("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});p&&(yield p.run())})}}c4.ID="editor.action.unicodeHighlight.showExcludeOptions";function vNt(i,e){return $a(this,void 0,void 0,function*(){const n=i.getValue(fc.allowedCharacters);let r;typeof n=="object"&&n?r=n:r={};for(const s of e)r[String.fromCodePoint(s)]=!0;yield i.updateValue(fc.allowedCharacters,r,2)})}function bNt(i,e){var n;return $a(this,void 0,void 0,function*(){const r=(n=i.inspect(fc.allowedLocales).user)===null||n===void 0?void 0:n.value;let s;typeof r=="object"&&r?s=Object.assign({},r):s={};for(const o of e)s[o]=!0;yield i.updateValue(fc.allowedLocales,s,2)})}function yNt(i){throw new Error(`Unexpected value: ${i}`)}rt(tw);rt(tT);rt(nT);rt(c4);_i(gI.ID,gI,1);uk.register(oie);var wNt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Lve=function(i,e){return function(n,r){e(n,r,i)}},CNt=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};const pPe="ignoreUnusualLineTerminators";function SNt(i,e,n){i.setModelProperty(e.uri,pPe,n)}function xNt(i,e){return i.getModelProperty(e.uri,pPe)}let IO=class extends Le{constructor(e,n,r){super(),this._editor=e,this._dialogService=n,this._codeEditorService=r,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return CNt(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||xNt(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let r;try{this._isPresentingDialog=!0,r=yield this._dialogService.confirm({title:L("unusualLineTerminators.title","Unusual Line Terminators"),message:L("unusualLineTerminators.message","Detected unusual line terminators"),detail:L("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",yh(e.uri)),primaryButton:L({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:L("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!r.confirmed){SNt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};IO.ID="editor.contrib.unusualLineTerminatorsDetector";IO=wNt([Lve(1,W5),Lve(2,Si)],IO);_i(IO.ID,IO,1);var kNt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Dve=function(i,e){return function(n,r){e(n,r,i)}},lie;const oV=new yt("hasWordHighlights",!1);function gPe(i,e,n,r){const s=i.ordered(e);return NEe(s.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,n,r)).then(void 0,Us)),Ka)}class mPe{constructor(e,n,r){this._model=e,this._selection=n,this._wordSeparators=r,this._wordRange=this._getCurrentWordRange(e,n),this._result=null}get result(){return this._result||(this._result=go(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,n){const r=e.getWordAtPosition(n.getPosition());return r?new J(n.startLineNumber,r.startColumn,n.startLineNumber,r.endColumn):null}isValid(e,n,r){const s=n.startLineNumber,o=n.startColumn,a=n.endColumn,l=this._getCurrentWordRange(e,n);let c=!!(this._wordRange&&this._wordRange.equalsRange(l));for(let u=0,d=r.length;!c&&u<d;u++){const h=r.getRange(u);h&&h.startLineNumber===s&&h.startColumn<=o&&h.endColumn>=a&&(c=!0)}return c}cancel(){this.result.cancel()}}class LNt extends mPe{constructor(e,n,r,s){super(e,n,r),this._providers=s}_compute(e,n,r,s){return gPe(this._providers,e,n.getPosition(),s).then(o=>o||[])}}class DNt extends mPe{constructor(e,n,r){super(e,n,r),this._selectionIsEmpty=n.isEmpty()}_compute(e,n,r,s){return p1(250,s).then(()=>{if(!n.isEmpty())return[];const o=e.getWordAtPosition(n.getPosition());return!o||o.word.length>1e3?[]:e.findMatches(o.word,!0,!1,!0,r,!1).map(l=>({range:l.range,kind:oP.Text}))})}isValid(e,n,r){const s=n.isEmpty();return this._selectionIsEmpty!==s?!1:super.isValid(e,n,r)}}function ENt(i,e,n,r){return i.has(e)?new LNt(e,n,r,i):new DNt(e,n,r)}d_("_executeDocumentHighlights",(i,e,n)=>{const r=i.get(Et);return gPe(r.documentHighlightProvider,e,n,Hn.None)});class INt{constructor(e,n,r,s){this.toUnhook=new Xe,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=n,this.linkedHighlighters=r,this._hasWordHighlights=oV.bindTo(s),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(o)})),this.toUnhook.add(e.onDidChangeModelContent(o=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{const a=this.editor.getOption(80);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(J.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),r=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[r];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const a=this.editor.getModel().getLineContent(s.startLineNumber);Ua(`${a}, ${r+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),r=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[r];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const a=this.editor.getModel().getLineContent(s.startLineNumber);Ua(`${a}, ${r+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(!this.occurrencesHighlight){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),n=e.startLineNumber,r=e.startColumn;return this.model.getWordAtPosition({lineNumber:n,column:r})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const n=e.startColumn,r=e.endColumn,s=this._getWord();if(!s||s.startColumn>n||s.endColumn<r){this._stopAll();return}const o=this.workerRequest&&this.workerRequest.isValid(this.model,e,this.decorations);if(this.lastCursorPositionChangeTime=new Date().getTime(),o)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();const a=++this.workerRequestTokenId;this.workerRequestCompleted=!1,this.workerRequest=ENt(this.providers,this.model,this.editor.getSelection(),this.editor.getOption(129)),this.workerRequest.result.then(l=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=l||[],this._beginRenderDecorations())},Ln)}}_beginRenderDecorations(){const e=new Date().getTime(),n=this.lastCursorPositionChangeTime+250;e>=n?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},n-e)}renderDecorations(){this.renderDecorationsTimer=-1;const e=[];for(const n of this.workerRequestValue)n.range&&e.push({range:n.range,options:eAt(n.kind)});this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations());for(const n of this.linkedHighlighters())(n==null?void 0:n.editor.getModel())===this.editor.getModel()&&(n._stopAll(),n.decorations.set(e),n._hasWordHighlights.set(n.hasDecorations()))}dispose(){this._stopAll(),this.toUnhook.dispose()}}let Fx=lie=class extends Le{static get(e){return e.getContribution(lie.ID)}constructor(e,n,r){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new INt(e,r.documentHighlightProvider,()=>Vn.map(this.linkedContributions,o=>o.wordHighlighter),n))};this._register(e.onDidChangeModel(o=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),s()})),s()}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};Fx.ID="editor.contrib.wordHighlighter";Fx=lie=kNt([Dve(1,mn),Dve(2,Et)],Fx);class _Pe extends kt{constructor(e,n){super(n),this._isNext=e}run(e,n){const r=Fx.get(n);r&&(this._isNext?r.moveNext():r.moveBack())}}class TNt extends _Pe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:L("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:oV,kbOpts:{kbExpr:oe.editorTextFocus,primary:65,weight:100}})}}class RNt extends _Pe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:L("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:oV,kbOpts:{kbExpr:oe.editorTextFocus,primary:1089,weight:100}})}}class ANt extends kt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:L("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:oV.toNegated(),kbOpts:{kbExpr:oe.editorTextFocus,primary:0,weight:100}})}run(e,n,r){const s=Fx.get(n);s&&s.restoreViewState(!0)}}_i(Fx.ID,Fx,0);rt(TNt);rt(RNt);rt(ANt);class aV extends Ho{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,n,r){if(!n.hasModel())return;const s=vh(n.getOption(129)),o=n.getModel(),l=n.getSelections().map(c=>{const u=new ve(c.positionLineNumber,c.positionColumn),d=this._move(s,o,u,this._wordNavigationType);return this._moveTo(c,d,this._inSelectionMode)});if(o.pushStackElement(),n._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>hi.fromModelSelection(c))),l.length===1){const c=new ve(l[0].positionLineNumber,l[0].positionColumn);n.revealPosition(c,0)}}_moveTo(e,n,r){return r?new Ft(e.selectionStartLineNumber,e.selectionStartColumn,n.lineNumber,n.column):new Ft(n.lineNumber,n.column,n.lineNumber,n.column)}}class nw extends aV{_move(e,n,r,s){return wi.moveWordLeft(e,n,r,s)}}class iw extends aV{_move(e,n,r,s){return wi.moveWordRight(e,n,r,s)}}class NNt extends nw{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class MNt extends nw{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class PNt extends nw{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ze.and(oe.textInputFocus,(e=ze.and(R5,X$))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class ONt extends nw{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class FNt extends nw{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class BNt extends nw{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ze.and(oe.textInputFocus,(e=ze.and(R5,X$))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class jNt extends nw{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,n,r,s){return super._move(vh(rg.wordSeparators.defaultValue),n,r,s)}}class WNt extends nw{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,n,r,s){return super._move(vh(rg.wordSeparators.defaultValue),n,r,s)}}class $Nt extends iw{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class zNt extends iw{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ze.and(oe.textInputFocus,(e=ze.and(R5,X$))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class VNt extends iw{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class HNt extends iw{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class UNt extends iw{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ze.and(oe.textInputFocus,(e=ze.and(R5,X$))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class qNt extends iw{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class KNt extends iw{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,n,r,s){return super._move(vh(rg.wordSeparators.defaultValue),n,r,s)}}class GNt extends iw{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,n,r,s){return super._move(vh(rg.wordSeparators.defaultValue),n,r,s)}}class lV extends Ho{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,n,r){const s=e.get(dr);if(!n.hasModel())return;const o=vh(n.getOption(129)),a=n.getModel(),l=n.getSelections(),c=n.getOption(6),u=n.getOption(11),d=s.getLanguageConfiguration(a.getLanguageId()).getAutoClosingPairs(),h=n._getViewModel(),f=l.map(p=>{const g=this._delete({wordSeparators:o,model:a,selection:p,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:n.getOption(9),autoClosingBrackets:c,autoClosingQuotes:u,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Sa(g,"")});n.pushUndoStop(),n.executeCommands(this.id,f),n.pushUndoStop()}}class Wle extends lV{_delete(e,n){const r=wi.deleteWordLeft(e,n);return r||new J(1,1,1,1)}}class $le extends lV{_delete(e,n){const r=wi.deleteWordRight(e,n);if(r)return r;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new J(s,o,s,o)}}class XNt extends Wle{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:oe.writable})}}class YNt extends Wle{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:oe.writable})}}class ZNt extends Wle{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:oe.writable,kbOpts:{kbExpr:oe.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class QNt extends $le{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:oe.writable})}}class JNt extends $le{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:oe.writable})}}class eMt extends $le{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:oe.writable,kbOpts:{kbExpr:oe.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class tMt extends kt{constructor(){super({id:"deleteInsideWord",precondition:oe.writable,label:L("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,n,r){if(!n.hasModel())return;const s=vh(n.getOption(129)),o=n.getModel(),l=n.getSelections().map(c=>{const u=wi.deleteInsideWord(s,o,c);return new Sa(u,"")});n.pushUndoStop(),n.executeCommands(this.id,l),n.pushUndoStop()}}ct(new NNt);ct(new MNt);ct(new PNt);ct(new ONt);ct(new FNt);ct(new BNt);ct(new $Nt);ct(new zNt);ct(new VNt);ct(new HNt);ct(new UNt);ct(new qNt);ct(new jNt);ct(new WNt);ct(new KNt);ct(new GNt);ct(new XNt);ct(new YNt);ct(new ZNt);ct(new QNt);ct(new JNt);ct(new eMt);rt(tMt);class nMt extends lV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:oe.writable,kbOpts:{kbExpr:oe.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,n){const r=I$.deleteWordPartLeft(e);return r||new J(1,1,1,1)}}class iMt extends lV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:oe.writable,kbOpts:{kbExpr:oe.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,n){const r=I$.deleteWordPartRight(e);if(r)return r;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new J(s,o,s,o)}}class vPe extends aV{_move(e,n,r,s){return I$.moveWordPartLeft(e,n,r)}}class rMt extends vPe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}si.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class sMt extends vPe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}si.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class bPe extends aV{_move(e,n,r,s){return I$.moveWordPartRight(e,n,r)}}class oMt extends bPe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class aMt extends bPe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}ct(new nMt);ct(new iMt);ct(new rMt);ct(new sMt);ct(new oMt);ct(new aMt);class cie extends Le{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=au.get(this.editor);if(e&&this.editor.hasModel()){let n=this.editor.getOptions().get(91);n||(this.editor.isSimpleWidget?n=new Ea(L("editor.simple.readonly","Cannot edit in read-only input")):n=new Ea(L("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(n,this.editor.getPosition())}}}cie.ID="editor.contrib.readOnlyMessageController";_i(cie.ID,cie,2);class uie extends Le{constructor(e){super(),this.editor=e,this.widget=null,Kp&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new cV(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}uie.ID="editor.contrib.iPadShowKeyboard";class cV extends Le{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(Be(this._domNode,"touchstart",n=>{this.editor.focus()})),this._register(Be(this._domNode,"focus",n=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return cV.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}cV.ID="editor.contrib.ShowKeyboardWidget";_i(uie.ID,uie,3);var lMt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Eve=function(i,e){return function(n,r){e(n,r,i)}},die;let mI=die=class extends Le{static get(e){return e.getContribution(die.ID)}constructor(e,n,r){super(),this._editor=e,this._languageService=r,this._widget=null,this._register(this._editor.onDidChangeModel(s=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(s=>this.stop())),this._register(Zr.onDidChange(s=>this.stop())),this._register(this._editor.onKeyUp(s=>s.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new uV(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};mI.ID="editor.contrib.inspectTokens";mI=die=lMt([Eve(1,bd),Eve(2,Ar)],mI);class cMt extends kt{constructor(){super({id:"editor.action.inspectTokens",label:lee.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,n){const r=mI.get(n);r==null||r.launch()}}function uMt(i){let e="";for(let n=0,r=i.length;n<r;n++){const s=i.charCodeAt(n);switch(s){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(s)}}return e}function dMt(i,e){const n=Zr.get(e);if(n)return n;const r=i.encodeLanguageId(e);return{getInitialState:()=>FE,tokenize:(s,o,a)=>loe(e,a),tokenizeEncoded:(s,o,a)=>C$(r,a)}}class uV extends Le{constructor(e,n){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=n,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=dMt(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(r=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return uV._ID}_compute(e){const n=this._getTokensAtLine(e.lineNumber);let r=0;for(let c=n.tokens1.length-1;c>=0;c--){const u=n.tokens1[c];if(e.column-1>=u.offset){r=c;break}}let s=0;for(let c=n.tokens2.length>>>1;c>=0;c--)if(e.column-1>=n.tokens2[c<<1]){s=c;break}const o=this._model.getLineContent(e.lineNumber);let a="";if(r<n.tokens1.length){const c=n.tokens1[r].offset,u=r+1<n.tokens1.length?n.tokens1[r+1].offset:o.length;a=o.substring(c,u)}ca(this._domNode,tt("h2.tm-token",void 0,uMt(a),tt("span.tm-token-length",void 0,`${a.length} ${a.length===1?"char":"chars"}`))),He(this._domNode,tt("hr.tokens-inspect-separator",{style:"clear:both"}));const l=(s<<1)+1<n.tokens2.length?this._decodeMetadata(n.tokens2[(s<<1)+1]):null;He(this._domNode,tt("table.tm-metadata-table",void 0,tt("tbody",void 0,tt("tr",void 0,tt("td.tm-metadata-key",void 0,"language"),tt("td.tm-metadata-value",void 0,`${l?l.languageId:"-?-"}`)),tt("tr",void 0,tt("td.tm-metadata-key",void 0,"token type"),tt("td.tm-metadata-value",void 0,`${l?this._tokenTypeToString(l.tokenType):"-?-"}`)),tt("tr",void 0,tt("td.tm-metadata-key",void 0,"font style"),tt("td.tm-metadata-value",void 0,`${l?this._fontStyleToString(l.fontStyle):"-?-"}`)),tt("tr",void 0,tt("td.tm-metadata-key",void 0,"foreground"),tt("td.tm-metadata-value",void 0,`${l?Te.Format.CSS.formatHex(l.foreground):"-?-"}`)),tt("tr",void 0,tt("td.tm-metadata-key",void 0,"background"),tt("td.tm-metadata-value",void 0,`${l?Te.Format.CSS.formatHex(l.background):"-?-"}`))))),He(this._domNode,tt("hr.tokens-inspect-separator")),r<n.tokens1.length&&He(this._domNode,tt("span.tm-token-type",void 0,n.tokens1[r].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const n=Zr.getColorMap(),r=Da.getLanguageId(e),s=Da.getTokenType(e),o=Da.getFontStyle(e),a=Da.getForeground(e),l=Da.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(r),tokenType:s,fontStyle:o,foreground:n[a],background:n[l]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let n="";return e&1&&(n+="italic "),e&2&&(n+="bold "),e&4&&(n+="underline "),e&8&&(n+="strikethrough "),n.length===0&&(n="---"),n}_getTokensAtLine(e){const n=this._getStateBeforeLine(e),r=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,n),s=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,n);return{startState:n,tokens1:r.tokens,tokens2:s.tokens,endState:r.endState}}_getStateBeforeLine(e){let n=this._tokenizationSupport.getInitialState();for(let r=1;r<e;r++)n=this._tokenizationSupport.tokenize(this._model.getLineContent(r),!0,n).endState;return n}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}}uV._ID="editor.contrib.inspectTokensWidget";_i(mI.ID,mI,4);rt(cMt);var hMt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Ive=function(i,e){return function(n,r){e(n,r,i)}},DN;let Ej=DN=class{constructor(e,n){this.quickInputService=e,this.keybindingService=n,this.registry=Kr.as(ik.Quickaccess)}provide(e){const n=new Xe;return n.add(e.onDidAccept(()=>{const[r]=e.selectedItems;r&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),n.add(e.onDidChangeValue(r=>{const s=this.registry.getQuickAccessProvider(r.substr(DN.PREFIX.length));s&&s.prefix&&s.prefix!==DN.PREFIX&&this.quickInputService.quickAccess.show(s.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(r=>r.prefix!==DN.PREFIX),n}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((n,r)=>n.prefix.localeCompare(r.prefix)).flatMap(n=>this.createPicks(n))}createPicks(e){return e.helpEntries.map(n=>{const r=n.prefix||e.prefix,s=r||"…";return{prefix:r,label:s,keybinding:n.commandId?this.keybindingService.lookupKeybinding(n.commandId):void 0,ariaLabel:L("helpPickAriaLabel","{0}, {1}",s,n.description),description:n.description}})}};Ej.PREFIX="?";Ej=DN=hMt([Ive(0,lg),Ive(1,sr)],Ej);Kr.as(ik.Quickaccess).registerQuickAccessProvider({ctor:Ej,prefix:"",helpEntries:[{description:cee.helpQuickAccessActionLabel}]});class yPe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,n){var r;const s=new Xe;e.canAcceptInBackground=!!(!((r=this.options)===null||r===void 0)&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=s.add(new ha);return o.value=this.doProvide(e,n),s.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,n)})),s}doProvide(e,n){var r;const s=new Xe,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const a={editor:o},l=dAe(o);if(l){let c=(r=o.saveViewState())!==null&&r!==void 0?r:void 0;s.add(l.onDidChangeCursorPosition(()=>{var u;c=(u=o.saveViewState())!==null&&u!==void 0?u:void 0})),a.restoreViewState=()=>{c&&o===this.activeTextEditorControl&&o.restoreViewState(c)},s.add(u1(n.onCancellationRequested)(()=>{var u;return(u=a.restoreViewState)===null||u===void 0?void 0:u.call(a)}))}s.add(gn(()=>this.clearDecorations(o))),s.add(this.provideWithTextEditor(a,e,n))}else s.add(this.provideWithoutTextEditor(e,n));return s}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},n){e.setSelection(n.range),e.revealRangeInCenter(n.range,0),n.preserveFocus||e.focus();const r=e.getModel();r&&"getLineContent"in r&&v1(`${r.getLineContent(n.range.startLineNumber)}`)}getModel(e){var n;return uAe(e)?(n=e.getModel())===null||n===void 0?void 0:n.modified:e.getModel()}addDecorations(e,n){e.changeDecorations(r=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:n,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:n,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Qr(TIe),position:hd.Full}}}],[a,l]=r.deltaDecorations(s,o);this.rangeHighlightDecorationId={rangeHighlightId:a,overviewRulerDecorationId:l}})}clearDecorations(e){const n=this.rangeHighlightDecorationId;n&&(e.changeDecorations(r=>{r.deltaDecorations([n.overviewRulerDecorationId,n.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class dV extends yPe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const n=L("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:n}],e.ariaLabel=n,Le.None}provideWithTextEditor(e,n,r){const s=e.editor,o=new Xe;o.add(n.onDidAccept(c=>{const[u]=n.selectedItems;if(u){if(!this.isValidLineNumber(s,u.lineNumber))return;this.gotoLocation(e,{range:this.toRange(u.lineNumber,u.column),keyMods:n.keyMods,preserveFocus:c.inBackground}),c.inBackground||n.hide()}}));const a=()=>{const c=this.parsePosition(s,n.value.trim().substr(dV.PREFIX.length)),u=this.getPickLabel(s,c.lineNumber,c.column);if(n.items=[{lineNumber:c.lineNumber,column:c.column,label:u}],n.ariaLabel=u,!this.isValidLineNumber(s,c.lineNumber)){this.clearDecorations(s);return}const d=this.toRange(c.lineNumber,c.column);s.revealRangeInCenter(d,0),this.addDecorations(s,d)};a(),o.add(n.onDidChangeValue(()=>a()));const l=dAe(s);return l&&l.getOptions().get(67).renderType===2&&(l.updateOptions({lineNumbers:"on"}),o.add(gn(()=>l.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,n=1){return{startLineNumber:e,startColumn:n,endLineNumber:e,endColumn:n}}parsePosition(e,n){const r=n.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),s=this.lineCount(e)+1;return{lineNumber:r[0]>0?r[0]:s+r[0],column:r[1]}}getPickLabel(e,n,r){if(this.isValidLineNumber(e,n))return this.isValidColumn(e,n,r)?L("gotoLineColumnLabel","Go to line {0} and character {1}.",n,r):L("gotoLineLabel","Go to line {0}.",n);const s=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?L("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",s.lineNumber,s.column,o):L("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",s.lineNumber,s.column)}isValidLineNumber(e,n){return!n||typeof n!="number"?!1:n>0&&n<=this.lineCount(e)}isValidColumn(e,n,r){if(!r||typeof r!="number")return!1;const s=this.getModel(e);if(!s)return!1;const o={lineNumber:n,column:r};return s.validatePosition(o).equals(o)}lineCount(e){var n,r;return(r=(n=this.getModel(e))===null||n===void 0?void 0:n.getLineCount())!==null&&r!==void 0?r:0}}dV.PREFIX=":";var fMt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},pMt=function(i,e){return function(n,r){e(n,r,i)}};let TO=class extends dV{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=_t.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};TO=fMt([pMt(0,Si)],TO);let zle=class wPe extends kt{constructor(){super({id:wPe.ID,label:C7.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(lg).quickAccess.show(TO.PREFIX)}};zle.ID="editor.action.gotoLine";rt(zle);Kr.as(ik.Quickaccess).registerQuickAccessProvider({ctor:TO,prefix:TO.PREFIX,helpEntries:[{description:C7.gotoLineActionLabel,commandId:zle.ID}]});const CPe=[void 0,[]];function OK(i,e,n=0,r=0){const s=e;return s.values&&s.values.length>1?gMt(i,s.values,n,r):SPe(i,e,n,r)}function gMt(i,e,n,r){let s=0;const o=[];for(const a of e){const[l,c]=SPe(i,a,n,r);if(typeof l!="number")return CPe;s+=l,o.push(...c)}return[s,mMt(o)]}function SPe(i,e,n,r){const s=gx(e.original,e.originalLowercase,n,i,i.toLowerCase(),r,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],z5(s)]:CPe}function mMt(i){const e=i.sort((s,o)=>s.start-o.start),n=[];let r;for(const s of e)!r||!_Mt(r,s)?(r=s,n.push(s)):(r.start=Math.min(r.start,s.start),r.end=Math.max(r.end,s.end));return n}function _Mt(i,e){return!(i.end<e.start||e.end<i.start)}function Tve(i){return i.startsWith('"')&&i.endsWith('"')}const xPe=" ";function hie(i){typeof i!="string"&&(i="");const e=i.toLowerCase(),{pathNormalized:n,normalized:r,normalizedLowercase:s}=Rve(i),o=n.indexOf(Wp)>=0,a=Tve(i);let l;const c=i.split(xPe);if(c.length>1)for(const u of c){const d=Tve(u),{pathNormalized:h,normalized:f,normalizedLowercase:p}=Rve(u);f&&(l||(l=[]),l.push({original:u,originalLowercase:u.toLowerCase(),pathNormalized:h,normalized:f,normalizedLowercase:p,expectContiguousMatch:d}))}return{original:i,originalLowercase:e,pathNormalized:n,normalized:r,normalizedLowercase:s,values:l,containsPathSeparator:o,expectContiguousMatch:a}}function Rve(i){let e;Aa?e=i.replace(/\//g,Wp):e=i.replace(/\\/g,Wp);const n=Sot(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:n,normalizedLowercase:n.toLowerCase()}}function Ave(i){return Array.isArray(i)?hie(i.map(e=>e.original).join(xPe)):hie(i.original)}var vMt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Nve=function(i,e){return function(n,r){e(n,r,i)}},pA=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},cE;let Pm=cE=class extends yPe{constructor(e,n,r=Object.create(null)){super(r),this._languageFeaturesService=e,this._outlineModelService=n,this.options=r,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,L("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),Le.None}provideWithTextEditor(e,n,r){const s=e.editor,o=this.getModel(s);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,n,r):this.doProvideWithoutEditorSymbols(e,o,n,r):Le.None}doProvideWithoutEditorSymbols(e,n,r,s){const o=new Xe;return this.provideLabelPick(r,L("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),pA(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(n,o))||s.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,n,r,s))}),o}provideLabelPick(e,n){e.items=[{label:n,index:0,kind:14}],e.ariaLabel=n}waitForLanguageSymbolRegistry(e,n){return pA(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const r=new f$,s=n.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(s.dispose(),r.complete(!0))}));return n.add(gn(()=>r.complete(!1))),r.p})}doProvideWithEditorSymbols(e,n,r,s){var o;const a=e.editor,l=new Xe;l.add(r.onDidAccept(h=>{const[f]=r.selectedItems;f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:r.keyMods,preserveFocus:h.inBackground}),h.inBackground||r.hide())})),l.add(r.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:r.keyMods,forceSideBySide:!0}),r.hide())}));const c=this.getDocumentSymbols(n,s);let u;const d=h=>pA(this,void 0,void 0,function*(){u==null||u.dispose(!0),r.busy=!1,u=new Ns(s),r.busy=!0;try{const f=hie(r.value.substr(cE.PREFIX.length).trim()),p=yield this.doGetSymbolPicks(c,f,void 0,u.token);if(s.isCancellationRequested)return;if(p.length>0){if(r.items=p,h&&f.original.length===0){const g=G9(p,m=>!!(m.type!=="separator"&&m.range&&J.containsPosition(m.range.decoration,h)));g&&(r.activeItems=[g])}}else f.original.length>0?this.provideLabelPick(r,L("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(r,L("noSymbolResults","No editor symbols"))}finally{s.isCancellationRequested||(r.busy=!1)}});return l.add(r.onDidChangeValue(()=>d(void 0))),d((o=a.getSelection())===null||o===void 0?void 0:o.getPosition()),l.add(r.onDidChangeActive(()=>{const[h]=r.activeItems;h&&h.range&&(a.revealRangeInCenter(h.range.selection,0),this.addDecorations(a,h.range.decoration))})),l}doGetSymbolPicks(e,n,r,s){var o,a;return pA(this,void 0,void 0,function*(){const l=yield e;if(s.isCancellationRequested)return[];const c=n.original.indexOf(cE.SCOPE_PREFIX)===0,u=c?1:0;let d,h;n.values&&n.values.length>1?(d=Ave(n.values[0]),h=Ave(n.values.slice(1))):d=n;let f;const p=(a=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||a===void 0?void 0:a.call(o);p&&(f=[{iconClass:p==="right"?en.asClassName(lt.splitHorizontal):en.asClassName(lt.splitVertical),tooltip:p==="right"?L("openToSide","Open to the Side"):L("openToBottom","Open to the Bottom")}]);const g=[];for(let b=0;b<l.length;b++){const y=l[b],x=wot(y.name),k=`$(${M9.toIcon(y.kind).id}) ${x}`,D=k.length-x.length;let R=y.containerName;r!=null&&r.extraContainerLabel&&(R?R=`${r.extraContainerLabel} • ${R}`:R=r.extraContainerLabel);let E,A,M,N;if(n.original.length>u){let O=!1;if(d!==n&&([E,A]=OK(k,Object.assign(Object.assign({},n),{values:void 0}),u,D),typeof E=="number"&&(O=!0)),typeof E!="number"&&([E,A]=OK(k,d,u,D),typeof E!="number"))continue;if(!O&&h){if(R&&h.original.length>0&&([M,N]=OK(R,h)),typeof M!="number")continue;typeof E=="number"&&(E+=M)}}const P=y.tags&&y.tags.indexOf(1)>=0;g.push({index:b,kind:y.kind,score:E,label:k,ariaLabel:_ot(y.name,y.kind),description:R,highlights:P?void 0:{label:A,description:N},range:{selection:J.collapseToStart(y.selectionRange),decoration:y.range},strikethrough:P,buttons:f})}const m=g.sort((b,y)=>c?this.compareByKindAndScore(b,y):this.compareByScore(b,y));let _=[];if(c){let k=function(){y&&typeof b=="number"&&x>0&&(y.label=ox(BK[b]||FK,x))},b,y,x=0;for(const D of m)b!==D.kind?(k(),b=D.kind,x=1,y={type:"separator"},_.push(y)):x++,_.push(D);k()}else m.length>0&&(_=[{label:L("symbols","symbols ({0})",g.length),type:"separator"},...m]);return _})}compareByScore(e,n){if(typeof e.score!="number"&&typeof n.score=="number")return 1;if(typeof e.score=="number"&&typeof n.score!="number")return-1;if(typeof e.score=="number"&&typeof n.score=="number"){if(e.score>n.score)return-1;if(e.score<n.score)return 1}return e.index<n.index?-1:e.index>n.index?1:0}compareByKindAndScore(e,n){const r=BK[e.kind]||FK,s=BK[n.kind]||FK,o=r.localeCompare(s);return o===0?this.compareByScore(e,n):o}getDocumentSymbols(e,n){return pA(this,void 0,void 0,function*(){const r=yield this._outlineModelService.getOrCreate(e,n);return n.isCancellationRequested?[]:r.asListOfDocumentSymbols()})}};Pm.PREFIX="@";Pm.SCOPE_PREFIX=":";Pm.PREFIX_BY_CATEGORY=`${cE.PREFIX}${cE.SCOPE_PREFIX}`;Pm=cE=vMt([Nve(0,Et),Nve(1,Fz)],Pm);const FK=L("property","properties ({0})"),BK={5:L("method","methods ({0})"),11:L("function","functions ({0})"),8:L("_constructor","constructors ({0})"),12:L("variable","variables ({0})"),4:L("class","classes ({0})"),22:L("struct","structs ({0})"),23:L("event","events ({0})"),24:L("operator","operators ({0})"),10:L("interface","interfaces ({0})"),2:L("namespace","namespaces ({0})"),3:L("package","packages ({0})"),25:L("typeParameter","type parameters ({0})"),1:L("modules","modules ({0})"),6:L("property","properties ({0})"),9:L("enum","enumerations ({0})"),21:L("enumMember","enumeration members ({0})"),14:L("string","strings ({0})"),0:L("file","files ({0})"),17:L("array","arrays ({0})"),15:L("number","numbers ({0})"),16:L("boolean","booleans ({0})"),18:L("object","objects ({0})"),19:L("key","keys ({0})"),7:L("field","fields ({0})"),13:L("constant","constants ({0})")};var bMt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},jK=function(i,e){return function(n,r){e(n,r,i)}};let fie=class extends Pm{constructor(e,n,r){super(n,r),this.editorService=e,this.onDidActiveTextEditorControlChange=_t.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};fie=bMt([jK(0,Si),jK(1,Et),jK(2,Fz)],fie);class u4 extends kt{constructor(){super({id:u4.ID,label:WP.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:oe.hasDocumentSymbolProvider,kbOpts:{kbExpr:oe.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(lg).quickAccess.show(Pm.PREFIX,{itemActivation:_p.NONE})}}u4.ID="editor.action.quickOutline";rt(u4);Kr.as(ik.Quickaccess).registerQuickAccessProvider({ctor:fie,prefix:Pm.PREFIX,helpEntries:[{description:WP.quickOutlineActionLabel,prefix:Pm.PREFIX,commandId:u4.ID},{description:WP.quickOutlineByCategoryActionLabel,prefix:Pm.PREFIX_BY_CATEGORY}]});function WK(i,e){return e&&(i.stack||i.stacktrace)?L("stackTrace.format","{0}: {1}",Pve(i),Mve(i.stack)||Mve(i.stacktrace)):Pve(i)}function Mve(i){return Array.isArray(i)?i.join(`
`):i}function Pve(i){return i.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof i.code=="string"&&typeof i.errno=="number"&&typeof i.syscall=="string"?L("nodeExceptionMessage","A system error occurred ({0})",i.message):i.message||L("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function kPe(i=null,e=!1){if(!i)return L("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(i)){const n=Hm(i),r=kPe(n[0],e);return n.length>1?L("error.moreErrors","{0} ({1} errors in total)",r,n.length):r}if(zl(i))return i;if(i.detail){const n=i.detail;if(n.error)return WK(n.error,e);if(n.exception)return WK(n.exception,e)}return i.stack?WK(i,e):i.message?i.message:L("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function yMt(i){var e;const n=new Map;for(const r of i)n.set(r,((e=n.get(r))!==null&&e!==void 0?e:0)+1);return n}class TM{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,n){const r=this.computeEmbedding(e),s=new Map,o=[];for(const[a,l]of this.documents){if(n.isCancellationRequested)return[];for(const c of l.chunks){const u=this.computeSimilarityScore(c,r,s);u>0&&o.push({key:a,score:u})}}return o}static termFrequencies(e){return yMt(TM.splitTerms(e))}static*splitTerms(e){const n=r=>r.toLowerCase();for(const[r]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield n(r);const s=r.split(new RegExp("(?<=[a-z])(?=[A-Z])","g"));if(s.length>1)for(const o of s)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield n(o))}}updateDocuments(e){var n;for(const{key:r}of e)this.deleteDocument(r);for(const r of e){const s=[];for(const o of r.textChunks){const a=TM.termFrequencies(o);for(const l of a.keys())this.chunkOccurrences.set(l,((n=this.chunkOccurrences.get(l))!==null&&n!==void 0?n:0)+1);s.push({text:o,tf:a})}this.chunkCount+=s.length,this.documents.set(r.key,{chunks:s})}return this}deleteDocument(e){const n=this.documents.get(e);if(n){this.documents.delete(e),this.chunkCount-=n.chunks.length;for(const r of n.chunks)for(const s of r.tf.keys()){const o=this.chunkOccurrences.get(s);if(typeof o=="number"){const a=o-1;a<=0?this.chunkOccurrences.delete(s):this.chunkOccurrences.set(s,a)}}}}computeSimilarityScore(e,n,r){let s=0;for(const[o,a]of Object.entries(n)){const l=e.tf.get(o);if(!l)continue;let c=r.get(o);typeof c!="number"&&(c=this.computeIdf(o),r.set(o,c));const u=l*c;s+=u*a}return s}computeEmbedding(e){const n=TM.termFrequencies(e);return this.computeTfidf(n)}computeIdf(e){var n;const r=(n=this.chunkOccurrences.get(e))!==null&&n!==void 0?n:0;return r>0?Math.log((this.chunkCount+1)/r):0}computeTfidf(e){const n=Object.create(null);for(const[r,s]of e){const o=this.computeIdf(r);o>0&&(n[r]=s*o)}return n}}function wMt(i){var e,n;const r=i.slice(0);r.sort((o,a)=>a.score-o.score);const s=(n=(e=r[0])===null||e===void 0?void 0:e.score)!==null&&n!==void 0?n:0;if(s>0)for(const o of r)o.score/=s;return r}var gA=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},L2;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(L2||(L2={}));function $K(i){const e=i;return Array.isArray(e.items)}function Ove(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class CMt extends Le{constructor(e,n){super(),this.prefix=e,this.options=n}provide(e,n,r){var s;const o=new Xe;e.canAcceptInBackground=!!(!((s=this.options)===null||s===void 0)&&s.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let a;const l=o.add(new ha),c=()=>gA(this,void 0,void 0,function*(){const u=l.value=new Xe;a==null||a.dispose(!0),e.busy=!1,a=new Ns(n);const d=a.token,h=e.value.substr(this.prefix.length).trim(),f=this._getPicks(h,u,d,r),p=(m,_)=>{var b;let y,x;if($K(m)?(y=m.items,x=m.active):y=m,y.length===0){if(_)return!1;(h.length>0||e.hideInput)&&(!((b=this.options)===null||b===void 0)&&b.noResultsPick)&&(nP(this.options.noResultsPick)?y=[this.options.noResultsPick(h)]:y=[this.options.noResultsPick])}return e.items=y,x&&(e.activeItems=[x]),!0},g=m=>gA(this,void 0,void 0,function*(){let _=!1,b=!1;yield Promise.all([gA(this,void 0,void 0,function*(){typeof m.mergeDelay=="number"&&(yield p1(m.mergeDelay),d.isCancellationRequested)||b||(_=p(m.picks,!0))}),gA(this,void 0,void 0,function*(){e.busy=!0;try{const y=yield m.additionalPicks;if(d.isCancellationRequested)return;let x,k;$K(m.picks)?(x=m.picks.items,k=m.picks.active):x=m.picks;let D,R;if($K(y)?(D=y.items,R=y.active):D=y,D.length>0||!_){let E;if(!k&&!R){const A=e.activeItems[0];A&&x.indexOf(A)!==-1&&(E=A)}p({items:[...x,...D],active:k||R||E})}}finally{d.isCancellationRequested||(e.busy=!1),b=!0}})])});if(f!==null)if(Ove(f))yield g(f);else if(!(f instanceof Promise))p(f);else{e.busy=!0;try{const m=yield f;if(d.isCancellationRequested)return;Ove(m)?yield g(m):p(m)}finally{d.isCancellationRequested||(e.busy=!1)}}});return o.add(e.onDidChangeValue(()=>c())),c(),o.add(e.onDidAccept(u=>{const[d]=e.selectedItems;typeof(d==null?void 0:d.accept)=="function"&&(u.inBackground||e.hide(),d.accept(e.keyMods,u))})),o.add(e.onDidTriggerItemButton(({button:u,item:d})=>gA(this,void 0,void 0,function*(){var h,f;if(typeof d.trigger=="function"){const p=(f=(h=d.buttons)===null||h===void 0?void 0:h.indexOf(u))!==null&&f!==void 0?f:-1;if(p>=0){const g=d.trigger(p,e.keyMods),m=typeof g=="number"?g:yield g;if(n.isCancellationRequested)return;switch(m){case L2.NO_ACTION:break;case L2.CLOSE_PICKER:e.hide();break;case L2.REFRESH_PICKER:c();break;case L2.REMOVE_ITEM:{const _=e.items.indexOf(d);if(_!==-1){const b=e.items.slice(),y=b.splice(_,1),x=e.activeItems.filter(D=>D!==y[0]),k=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=b,x&&(e.activeItems=x),e.keepScrollPosition=k}break}}}}}))),o}}var LPe=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},eS=function(i,e){return function(n,r){e(n,r,i)}},zK=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})},WC,Co;let Bx=WC=class extends CMt{constructor(e,n,r,s,o,a){super(WC.PREFIX,e),this.instantiationService=n,this.keybindingService=r,this.commandService=s,this.telemetryService=o,this.dialogService=a,this.commandsHistory=this._register(this.instantiationService.createInstance(jx)),this.options=e}_getPicks(e,n,r,s){var o,a,l,c;return zK(this,void 0,void 0,function*(){const u=yield this.getCommandPicks(r);if(r.isCancellationRequested)return[];const d=u1(()=>{const b=new TM;b.updateDocuments(u.map(x=>({key:x.commandId,textChunks:[x.label+(x.commandAlias?` ${x.commandAlias}`:"")]})));const y=b.calculateScores(e,r);return wMt(y).filter(x=>x.score>WC.TFIDF_THRESHOLD).slice(0,WC.TFIDF_MAX_RESULTS)}),h=[];for(const b of u){const y=(o=WC.WORD_FILTER(e,b.label))!==null&&o!==void 0?o:void 0,x=b.commandAlias&&(a=WC.WORD_FILTER(e,b.commandAlias))!==null&&a!==void 0?a:void 0;if(y||x)b.highlights={label:y,detail:this.options.showAlias?x:void 0},h.push(b);else if(e===b.commandId)h.push(b);else if(e.length>=3){const k=d();if(r.isCancellationRequested)return[];const D=k.find(R=>R.key===b.commandId);D&&(b.tfIdfScore=D.score,h.push(b))}}const f=new Map;for(const b of h){const y=f.get(b.label);y?(b.description=b.commandId,y.description=y.commandId):f.set(b.label,b)}h.sort((b,y)=>{if(b.tfIdfScore&&y.tfIdfScore)return b.tfIdfScore===y.tfIdfScore?b.label.localeCompare(y.label):y.tfIdfScore-b.tfIdfScore;if(b.tfIdfScore)return 1;if(y.tfIdfScore)return-1;const x=this.commandsHistory.peek(b.commandId),k=this.commandsHistory.peek(y.commandId);if(x&&k)return x>k?-1:1;if(x)return-1;if(k)return 1;if(this.options.suggestedCommandIds){const D=this.options.suggestedCommandIds.has(b.commandId),R=this.options.suggestedCommandIds.has(y.commandId);if(D&&R)return 0;if(D)return-1;if(R)return 1}return b.label.localeCompare(y.label)});const p=[];let g=!1,m=!0,_=!!this.options.suggestedCommandIds;for(let b=0;b<h.length;b++){const y=h[b];b===0&&this.commandsHistory.peek(y.commandId)&&(p.push({type:"separator",label:L("recentlyUsed","recently used")}),g=!0),m&&y.tfIdfScore!==void 0&&(p.push({type:"separator",label:L("suggested","similar commands")}),m=!1),_&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&(!((l=this.options.suggestedCommandIds)===null||l===void 0)&&l.has(y.commandId))&&(p.push({type:"separator",label:L("commonlyUsed","commonly used")}),g=!0,_=!1),g&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&!(!((c=this.options.suggestedCommandIds)===null||c===void 0)&&c.has(y.commandId))&&(p.push({type:"separator",label:L("morecCommands","other commands")}),g=!1),p.push(this.toCommandPick(y,s))}return this.hasAdditionalCommandPicks(e,r)?{picks:p,additionalPicks:zK(this,void 0,void 0,function*(){var b;const y=yield this.getAdditionalCommandPicks(u,h,e,r);if(r.isCancellationRequested)return[];const x=y.map(k=>this.toCommandPick(k,s));return m&&((b=x[0])===null||b===void 0?void 0:b.type)!=="separator"&&x.unshift({type:"separator",label:L("suggested","similar commands")}),x})}:p})}toCommandPick(e,n){if(e.type==="separator")return e;const r=this.keybindingService.lookupKeybinding(e.commandId),s=r?L("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,r.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:s,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:r,accept:()=>zK(this,void 0,void 0,function*(){var o,a;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(o=n==null?void 0:n.from)!==null&&o!==void 0?o:"quick open"});try{!((a=e.args)===null||a===void 0)&&a.length?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(l){sg(l)||this.dialogService.error(L("canNotRun","Command '{0}' resulted in an error",e.label),kPe(l))}})})}};Bx.PREFIX=">";Bx.TFIDF_THRESHOLD=.5;Bx.TFIDF_MAX_RESULTS=5;Bx.WORD_FILTER=eae(HP,Dvt,BTe);Bx=WC=LPe([eS(1,hn),eS(2,sr),eS(3,us),eS(4,_d),eS(5,W5)],Bx);let jx=Co=class extends Le{constructor(e,n){super(),this.storageService=e,this.configurationService=n,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Co.getConfiguredCommandHistoryLength(this.configurationService),Co.cache&&Co.cache.limit!==this.configuredCommandsHistoryLength&&(Co.cache.limit=this.configuredCommandsHistoryLength,Co.saveState(this.storageService)))}load(){const e=this.storageService.get(Co.PREF_KEY_CACHE,0);let n;if(e)try{n=JSON.parse(e)}catch{}const r=Co.cache=new G1(this.configuredCommandsHistoryLength,1);if(n){let s;n.usesLRU?s=n.entries:s=n.entries.sort((o,a)=>o.value-a.value),s.forEach(o=>r.set(o.key,o.value))}Co.counter=this.storageService.getNumber(Co.PREF_KEY_COUNTER,0,Co.counter)}push(e){Co.cache&&(Co.cache.set(e,Co.counter++),Co.saveState(this.storageService))}peek(e){var n;return(n=Co.cache)===null||n===void 0?void 0:n.peek(e)}static saveState(e){if(!Co.cache)return;const n={usesLRU:!0,entries:[]};Co.cache.forEach((r,s)=>n.entries.push({key:s,value:r})),e.store(Co.PREF_KEY_CACHE,JSON.stringify(n),0,0),e.store(Co.PREF_KEY_COUNTER,Co.counter,0,0)}static getConfiguredCommandHistoryLength(e){var n,r;const o=(r=(n=e.getValue().workbench)===null||n===void 0?void 0:n.commandPalette)===null||r===void 0?void 0:r.history;return typeof o=="number"?o:Co.DEFAULT_COMMANDS_HISTORY_LENGTH}};jx.DEFAULT_COMMANDS_HISTORY_LENGTH=50;jx.PREF_KEY_CACHE="commandPalette.mru.cache";jx.PREF_KEY_COUNTER="commandPalette.mru.counter";jx.counter=1;jx=Co=LPe([eS(0,jf),eS(1,ei)],jx);class SMt extends Bx{constructor(e,n,r,s,o,a){super(e,n,r,s,o,a)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const n=[];for(const r of e.getSupportedActions())n.push({commandId:r.id,commandAlias:r.alias,label:oae(r.label)||r.id});return n}}var xMt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},pD=function(i,e){return function(n,r){e(n,r,i)}},Fve=function(i,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((r=r.apply(i,e||[])).next())})};let RO=class extends SMt{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,n,r,s,o,a){super({showAlias:!1},e,r,s,o,a),this.codeEditorService=n}getCommandPicks(){return Fve(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return Fve(this,void 0,void 0,function*(){return[]})}};RO=xMt([pD(0,hn),pD(1,Si),pD(2,sr),pD(3,us),pD(4,_d),pD(5,W5)],RO);class d4 extends kt{constructor(){super({id:d4.ID,label:S7.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(lg).quickAccess.show(RO.PREFIX)}}d4.ID="editor.action.quickCommand";rt(d4);Kr.as(ik.Quickaccess).registerQuickAccessProvider({ctor:RO,prefix:RO.PREFIX,helpEntries:[{description:S7.quickCommandHelp,commandId:d4.ID}]});var kMt=function(i,e,n,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,n,r);else for(var l=i.length-1;l>=0;l--)(a=i[l])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},gD=function(i,e){return function(n,r){e(n,r,i)}};let pie=class extends I1{constructor(e,n,r,s,o,a,l){super(!0,e,n,r,s,o,a,l)}};pie=kMt([gD(1,mn),gD(2,Si),gD(3,Ps),gD(4,hn),gD(5,jf),gD(6,ei)],pie);_i(I1.ID,pie,4);class LMt extends kt{constructor(){super({id:"editor.action.toggleHighContrast",label:uee.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,n){const r=e.get(bd),s=r.getColorTheme();Vp(s.type)?(r.setTheme(this._originalThemeName||($E(s.type)?rE:U0)),this._originalThemeName=null):(r.setTheme($E(s.type)?jS:WS),this._originalThemeName=s.themeName)}}rt(LMt);const DMt=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:gAe,Emitter:mAe,KeyCode:_Ae,KeyMod:vAe,MarkerSeverity:SAe,MarkerTag:xAe,Position:bAe,Range:yAe,Selection:wAe,SelectionDirection:CAe,Token:LAe,Uri:kAe,editor:DAe,languages:EAe},Symbol.toStringTag,{value:"Module"}));function EMt(i){return new Worker("/dashboard/assets/editor.worker-CDU2Z2yo.js",{name:i==null?void 0:i.name})}function IMt(i){return new Worker("/dashboard/assets/json.worker-v3Gy2e2h.js",{name:i==null?void 0:i.name})}window.MonacoEnvironment={getWorker(i,e){return e==="json"?new IMt:new EMt}};xse.config({monaco:DMt});const h4=({beforeMount:i,customHeight:e,...n})=>{const r=$.useRef(null),s=$.useRef(null),o=$i(),{height:a}=kse(),[l,c]=$.useState(e||0);function u(d){r.current=d,d.languages.register({id:"custom-language"}),d.languages.setMonarchTokensProvider("custom-language",Gnt),d.editor.defineTheme("custom-language-theme",R3(o,"custom-language-theme")),d.editor.defineTheme("qdrant-theme",R3(o,"qdrant-theme")),d.languages.setLanguageConfiguration("custom-language",Xnt),typeof i=="function"&&i(d)}return $.useEffect(()=>{var d,h;(d=r.current)==null||d.editor.defineTheme("custom-language-theme",R3(o,"custom-language-theme")),(h=r.current)==null||h.editor.defineTheme("qdrant-theme",R3(o,"qdrant-theme"))},[o]),$.useEffect(()=>{var d;e||c(a-((d=s.current)==null?void 0:d.offsetTop))},[a,s]),C.jsx("div",{className:o.palette.mode,ref:s,children:C.jsx(d2e,{theme:n.theme??"custom-language-theme",height:l,beforeMount:u,...n})})};h4.propTypes={height:Z.string,beforeMount:Z.func,customHeight:Z.oneOfType([Z.number,Z.string]),...d2e.propTypes};const DPe=({onChange:i,code:e,onChangeResult:n,setRequestCount:r})=>{const s=$.useRef(null),o=$.useRef(null),a=$.useRef(null),l=$.useRef(null),{client:c}=Ur();let u=null,d=null,h=null;const f=m=>{var _,b;i("code",m),cit(m),(b=o.current)==null||b.editor.setModelMarkers((_=s.current)==null?void 0:_.getModel(),"owner",tQ)};$.useEffect(()=>()=>{var m,_;(m=a.current)==null||m.dispose(),(_=l.current)==null||_.dispose()},[]);function p(m,_){s.current=m;let b=[];u=m.addCommand(0,async(y,...x)=>{r(R=>R+1);const k=x[0],D=await nQ(k);n("code",ls.stringify(D)),r(R=>R-1)},""),d=m.addCommand(0,async(y,...x)=>{const k=x[0],D=i2e(k.blockText);if(D.reqBody&&Object.keys(D.reqBody).length>0){const R=ls.stringify(D.reqBody,null,2);m.executeEdits("beautify",[{forceMoveMarkers:!0,range:new _.Range(k.blockStartLine+1,0,k.blockEndLine,m.getModel().getLineMaxColumn(k.blockEndLine)),text:R}])}},""),h=m.addCommand(0,async(y,...x)=>{const k=x[0];window.open(k,"_blank")}),a.current=_.languages.registerCodeLensProvider("custom-language",Znt(u,d,h)),m.onDidChangeCursorPosition(()=>{const y=m.getValue(),x=Sse(y),k=Qnt(x,m.getPosition().lineNumber);if(_.editor.selectedCodeBlock=k,k){const D=k.blockStartLine,R=k.blockEndLine;b=m.deltaDecorations([b[0]],[{range:new _.Range(D,0,R,3),options:{className:"blockSelector",glyphMarginClassName:"blockSelectorStrip",isWholeLine:!0}}]),m.addCommand(_.KeyMod.CtrlCmd+_.KeyCode.Enter,async()=>{r(M=>M+1);const E=k.blockText,A=await nQ(E);n("code",ls.stringify(A)),r(M=>M-1)})}else b=m.deltaDecorations([b[0]],[]),m.addCommand(_.KeyMod.CtrlCmd+_.KeyCode.Enter,()=>{})})}function g(m){ait(m,c).then(_=>{l.current=m.languages.registerCompletionItemProvider("custom-language",_)})}return C.jsx(C.Fragment,{children:C.jsx(h4,{language:"custom-language",value:e,theme:"custom-language-theme",defaultValue:"//input",onChange:f,onMount:p,beforeMount:g,formatOnPaste:!0,autoIndent:!0,formatOnType:!0,options:Ynt})})};DPe.propTypes={onChange:Z.func.isRequired,onChangeResult:Z.func.isRequired,code:Z.string.isRequired,setRequestCount:Z.func.isRequired};const EPe=i=>$.useMemo(()=>({formattedCode:XJe(i,ls)}),[i]),IPe=({code:i})=>{const{formattedCode:r}=EPe(i);return C.jsx(h4,{language:"json",theme:"custom-language-theme",value:r,options:{scrollBeyondLastLine:!1,fontSize:14,wordWrap:"on",minimap:{enabled:!1},automaticLayout:!0,readOnly:!0,mouseWheelZoom:!0,folding:!1,lineHeight:21,padding:{top:16,bottom:16}}})};IPe.propTypes={code:Z.string.isRequired};const TPe=Hr(C.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),hV=Hr(C.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),TMt=Hr(C.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"})),RPe=Hr(C.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),RMt=Hr(C.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),AMt=Hr(C.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"})),NMt=Hr(C.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),MMt=Hr(C.jsx("path",{d:"M10 8.64 15.27 12 10 15.36zM8 5v14l11-7z"})),PMt=Hr(C.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),OMt=Hr(C.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"})),fV="16px",FMt=ye(Bv)`
min-width: 650px;
border-spacing: 0 ${fV};
border-collapse: separate;
`;ye(Bv)`
min-width: 350px;
border-spacing: 0 ${fV};
border-collapse: separate;
`;ye(OW)(({theme:i})=>`
border-spacing: 0 ${fV};
border-collapse: separate;
& th {
background-color: ${Pt(i.palette.primary.main,.05)};
border-bottom: 0;
&:first-of-type {
border-top-left-radius: ${i.shape.borderRadius}px;
border-bottom-left-radius: ${i.shape.borderRadius}px;
}
&:last-of-type {
border-top-right-radius: ${i.shape.borderRadius}px;
border-bottom-right-radius: ${i.shape.borderRadius}px;
}
}
`);const BMt=ye(PW)(({theme:i})=>{const e=i.palette.mode==="dark"?0:i.palette.divider+" solid 1px";return`
border-spacing: 0 ${fV};
border-collapse: separate;
& tr {
background-image: ${i.palette.mode==="dark"?"linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))":"none"};
}
& td {
border-bottom: none;
border-top: ${e};
border-bottom: ${e};
&:first-of-type {
border-top-left-radius: ${i.shape.borderRadius}px;
border-bottom-left-radius: ${i.shape.borderRadius}px;
border-left: ${e};
}
&:last-of-type {
border-top-right-radius: ${i.shape.borderRadius}px;
border-bottom-right-radius: ${i.shape.borderRadius}px;
border-right: ${e};
}
}
`});ye(ki)`
font-weight: bold;
`;function APe(i){var e,n,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i))for(e=0;e<i.length;e++)i[e]&&(n=APe(i[e]))&&(r&&(r+=" "),r+=n);else for(e in i)i[e]&&(r&&(r+=" "),r+=e);return r}function hk(){for(var i,e,n=0,r="";n<arguments.length;)(i=arguments[n++])&&(e=APe(i))&&(r&&(r+=" "),r+=e);return r}let jMt={data:""},WMt=i=>typeof window=="object"?((i?i.querySelector("#_goober"):window._goober)||Object.assign((i||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:i||jMt,$Mt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,zMt=/\/\*[^]*?\*\/| +/g,Bve=/\n+/g,tS=(i,e)=>{let n="",r="",s="";for(let o in i){let a=i[o];o[0]=="@"?o[1]=="i"?n=o+" "+a+";":r+=o[1]=="f"?tS(a,o):o+"{"+tS(a,o[1]=="k"?"":e)+"}":typeof a=="object"?r+=tS(a,e?e.replace(/([^,])+/g,l=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):o):a!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=tS.p?tS.p(o,a):o+":"+a+";")}return n+(e&&s?e+"{"+s+"}":s)+r},s0={},NPe=i=>{if(typeof i=="object"){let e="";for(let n in i)e+=n+NPe(i[n]);return e}return i},VMt=(i,e,n,r,s)=>{let o=NPe(i),a=s0[o]||(s0[o]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(o));if(!s0[a]){let c=o!==i?i:(u=>{let d,h,f=[{}];for(;d=$Mt.exec(u.replace(zMt,""));)d[4]?f.shift():d[3]?(h=d[3].replace(Bve," ").trim(),f.unshift(f[0][h]=f[0][h]||{})):f[0][d[1]]=d[2].replace(Bve," ").trim();return f[0]})(i);s0[a]=tS(s?{["@keyframes "+a]:c}:c,n?"":"."+a)}let l=n&&s0.g?s0.g:null;return n&&(s0.g=s0[a]),((c,u,d,h)=>{h?u.data=u.data.replace(h,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(s0[a],e,r,l),a},HMt=(i,e,n)=>i.reduce((r,s,o)=>{let a=e[o];if(a&&a.call){let l=a(n),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;a=c?"."+c:l&&typeof l=="object"?l.props?"":tS(l,""):l===!1?"":l}return r+s+(a??"")},"");function Vle(i){let e=this||{},n=i.call?i(e.p):i;return VMt(n.unshift?n.raw?HMt(n,[].slice.call(arguments,1),e.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(e.p):s),{}):n,WMt(e.target),e.g,e.o,e.k)}Vle.bind({g:1});Vle.bind({k:1});function UMt(i,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function MPe(i,e,n){return e&&UMt(i.prototype,e),i}function ms(){return ms=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},ms.apply(this,arguments)}function PPe(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}function f4(i,e){if(i==null)return{};var n={},r=Object.keys(i),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(n[s]=i[s]);return n}function jve(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var Wve=function(){return""},OPe=nn.createContext({enqueueSnackbar:Wve,closeSnackbar:Wve}),$C={downXs:"@media (max-width:599.95px)",upSm:"@media (min-width:600px)"},$ve=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Hle=function(e){return""+$ve(e.vertical)+$ve(e.horizontal)},J6=function(e){return!!e||e===0},eB="unmounted",mD="exited",_D="entering",mA="entered",zve="exiting",Ule=function(i){PPe(e,i);function e(r){var s;s=i.call(this,r)||this;var o=r.appear,a;return s.appearStatus=null,r.in?o?(a=mD,s.appearStatus=_D):a=mA:r.unmountOnExit||r.mountOnEnter?a=eB:a=mD,s.state={status:a},s.nextCallback=null,s}e.getDerivedStateFromProps=function(s,o){var a=s.in;return a&&o.status===eB?{status:mD}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(s){var o=null;if(s!==this.props){var a=this.state.status;this.props.in?a!==_D&&a!==mA&&(o=_D):(a===_D||a===mA)&&(o=zve)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var s=this.props.timeout,o=s,a=s;return s!=null&&typeof s!="number"&&typeof s!="string"&&(a=s.exit,o=s.enter),{exit:a,enter:o}},n.updateStatus=function(s,o){s===void 0&&(s=!1),o!==null?(this.cancelNextCallback(),o===_D?this.performEnter(s):this.performExit()):this.props.unmountOnExit&&this.state.status===mD&&this.setState({status:eB})},n.performEnter=function(s){var o=this,a=this.props.enter,l=s,c=this.getTimeouts();if(!s&&!a){this.safeSetState({status:mA},function(){o.props.onEntered&&o.props.onEntered(o.node,l)});return}this.props.onEnter&&this.props.onEnter(this.node,l),this.safeSetState({status:_D},function(){o.props.onEntering&&o.props.onEntering(o.node,l),o.onTransitionEnd(c.enter,function(){o.safeSetState({status:mA},function(){o.props.onEntered&&o.props.onEntered(o.node,l)})})})},n.performExit=function(){var s=this,o=this.props.exit,a=this.getTimeouts();if(!o){this.safeSetState({status:mD},function(){s.props.onExited&&s.props.onExited(s.node)});return}this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:zve},function(){s.props.onExiting&&s.props.onExiting(s.node),s.onTransitionEnd(a.exit,function(){s.safeSetState({status:mD},function(){s.props.onExited&&s.props.onExited(s.node)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},n.setNextCallback=function(s){var o=this,a=!0;return this.nextCallback=function(){a&&(a=!1,o.nextCallback=null,s())},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(s,o){this.setNextCallback(o);var a=s==null&&!this.props.addEndListener;if(!this.node||a){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),s!=null&&setTimeout(this.nextCallback,s)},n.render=function(){var s=this.state.status;if(s===eB)return null;var o=this.props,a=o.children,l=f4(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return a(s,l)},MPe(e,[{key:"node",get:function(){var s,o=(s=this.props.nodeRef)===null||s===void 0?void 0:s.current;if(!o)throw new Error("notistack - Custom snackbar is not refForwarding");return o}}]),e}(nn.Component);function vD(){}Ule.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:vD,onEntering:vD,onEntered:vD,onExit:vD,onExiting:vD,onExited:vD};function Vve(i,e){typeof i=="function"?i(e):i&&(i.current=e)}function gie(i,e){return $.useMemo(function(){return i==null&&e==null?null:function(n){Vve(i,n),Vve(e,n)}},[i,e])}function Ij(i){var e=i.timeout,n=i.style,r=n===void 0?{}:n,s=i.mode;return{duration:typeof e=="object"?e[s]||0:e,easing:r.transitionTimingFunction,delay:r.transitionDelay}}var mie={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},FPe=function(e){e.scrollTop=e.scrollTop},Hve=function(e){return Math.round(e)+"ms"};function D2(i,e){i===void 0&&(i=["all"]);var n=e||{},r=n.duration,s=r===void 0?300:r,o=n.easing,a=o===void 0?mie.easeInOut:o,l=n.delay,c=l===void 0?0:l,u=Array.isArray(i)?i:[i];return u.map(function(d){var h=typeof s=="string"?s:Hve(s),f=typeof c=="string"?c:Hve(c);return d+" "+h+" "+a+" "+f}).join(",")}function qMt(i){return i&&i.ownerDocument||document}function BPe(i){var e=qMt(i);return e.defaultView||window}function KMt(i,e){e===void 0&&(e=166);var n;function r(){for(var s=this,o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];var c=function(){i.apply(s,a)};clearTimeout(n),n=setTimeout(c,e)}return r.clear=function(){clearTimeout(n)},r}function GMt(i,e){var n=e.getBoundingClientRect(),r=BPe(e),s;if(e.fakeTransform)s=e.fakeTransform;else{var o=r.getComputedStyle(e);s=o.getPropertyValue("-webkit-transform")||o.getPropertyValue("transform")}var a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){var c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}switch(i){case"left":return"translateX("+(r.innerWidth+a-n.left)+"px)";case"right":return"translateX(-"+(n.left+n.width-a)+"px)";case"up":return"translateY("+(r.innerHeight+l-n.top)+"px)";default:return"translateY(-"+(n.top+n.height-l)+"px)"}}function tB(i,e){if(e){var n=GMt(i,e);n&&(e.style.webkitTransform=n,e.style.transform=n)}}var jPe=$.forwardRef(function(i,e){var n=i.children,r=i.direction,s=r===void 0?"down":r,o=i.in,a=i.style,l=i.timeout,c=l===void 0?0:l,u=i.onEnter,d=i.onEntered,h=i.onExit,f=i.onExited,p=f4(i,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),g=$.useRef(null),m=gie(n.ref,g),_=gie(m,e),b=function(E,A){tB(s,E),FPe(E),u&&u(E,A)},y=function(E){var A=(a==null?void 0:a.transitionTimingFunction)||mie.easeOut,M=Ij({timeout:c,mode:"enter",style:ms({},a,{transitionTimingFunction:A})});E.style.webkitTransition=D2("-webkit-transform",M),E.style.transition=D2("transform",M),E.style.webkitTransform="none",E.style.transform="none"},x=function(E){var A=(a==null?void 0:a.transitionTimingFunction)||mie.sharp,M=Ij({timeout:c,mode:"exit",style:ms({},a,{transitionTimingFunction:A})});E.style.webkitTransition=D2("-webkit-transform",M),E.style.transition=D2("transform",M),tB(s,E),h&&h(E)},k=function(E){E.style.webkitTransition="",E.style.transition="",f&&f(E)},D=$.useCallback(function(){g.current&&tB(s,g.current)},[s]);return $.useEffect(function(){if(!(o||s==="down"||s==="right")){var R=KMt(function(){g.current&&tB(s,g.current)}),E=BPe(g.current);return E.addEventListener("resize",R),function(){R.clear(),E.removeEventListener("resize",R)}}},[s,o]),$.useEffect(function(){o||D()},[o,D]),$.createElement(Ule,Object.assign({appear:!0,nodeRef:g,onEnter:b,onEntered:d,onEntering:y,onExit:x,onExited:k,in:o,timeout:c},p),function(R,E){return $.cloneElement(n,ms({ref:_,style:ms({visibility:R==="exited"&&!o?"hidden":void 0},a,{},n.props.style)},E))})});jPe.displayName="Slide";var pV=function(e){return nn.createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},e))},XMt=function(){return nn.createElement(pV,null,nn.createElement("path",{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},YMt=function(){return nn.createElement(pV,null,nn.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},ZMt=function(){return nn.createElement(pV,null,nn.createElement("path",{d:`M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},QMt=function(){return nn.createElement(pV,null,nn.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
0 22,12A10,10 0 0,0 12,2Z`}))},JMt={default:void 0,success:nn.createElement(XMt,null),warning:nn.createElement(YMt,null),error:nn.createElement(ZMt,null),info:nn.createElement(QMt,null)},US={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:JMt,anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:jPe,transitionDuration:{enter:225,exit:195}},ePt=function(e,n){var r=function(o){return typeof o=="number"||o===null};return r(e)?e:r(n)?n:US.autoHideDuration},tPt=function(e,n){var r=function(o,a){return a.some(function(l){return typeof o===l})};return r(e,["string","number"])?e:r(e,["object"])?ms({},US.transitionDuration,{},r(n,["object"])&&n,{},e):r(n,["string","number"])?n:r(n,["object"])?ms({},US.transitionDuration,{},n):US.transitionDuration},nPt=function(e,n){return function(r,s){return s===void 0&&(s=!1),s?ms({},US[r],{},n[r],{},e[r]):r==="autoHideDuration"?ePt(e.autoHideDuration,n.autoHideDuration):r==="transitionDuration"?tPt(e.transitionDuration,n.transitionDuration):e[r]||n[r]||US[r]}};function p4(i){return Object.entries(i).reduce(function(e,n){var r,s=n[0],o=n[1];return ms({},e,(r={},r[s]=Vle(o),r))},{})}var _I={SnackbarContainer:"notistack-SnackbarContainer",Snackbar:"notistack-Snackbar",CollapseWrapper:"notistack-CollapseWrapper",MuiContent:"notistack-MuiContent",MuiContentVariant:function(e){return"notistack-MuiContent-"+e}},Uve=p4({root:{height:0},entered:{height:"auto"}}),VK="0px",HK=175,WPe=$.forwardRef(function(i,e){var n=i.children,r=i.in,s=i.onExited,o=$.useRef(null),a=$.useRef(null),l=gie(e,a),c=function(){return o.current?o.current.clientHeight:0},u=function(m){m.style.height=VK},d=function(m){var _=c(),b=Ij({timeout:HK,mode:"enter"}),y=b.duration,x=b.easing;m.style.transitionDuration=typeof y=="string"?y:y+"ms",m.style.height=_+"px",m.style.transitionTimingFunction=x||""},h=function(m){m.style.height="auto"},f=function(m){m.style.height=c()+"px"},p=function(m){FPe(m);var _=Ij({timeout:HK,mode:"exit"}),b=_.duration,y=_.easing;m.style.transitionDuration=typeof b=="string"?b:b+"ms",m.style.height=VK,m.style.transitionTimingFunction=y||""};return $.createElement(Ule,{in:r,unmountOnExit:!0,onEnter:u,onEntered:h,onEntering:d,onExit:f,onExited:s,onExiting:p,nodeRef:a,timeout:HK},function(g,m){return $.createElement("div",Object.assign({ref:l,className:hk(Uve.root,g==="entered"&&Uve.entered),style:ms({pointerEvents:"all",overflow:"hidden",minHeight:VK,transition:D2("height")},g==="entered"&&{overflow:"visible"},{},g==="exited"&&!r&&{visibility:"hidden"})},m),$.createElement("div",{ref:o,className:_I.CollapseWrapper,style:{display:"flex",width:"100%"}},n))})});WPe.displayName="Collapse";var qve={right:"left",left:"right",bottom:"up",top:"down"},iPt=function(e){return e.horizontal!=="center"?qve[e.horizontal]:qve[e.vertical]},rPt=function(e){return"anchorOrigin"+Hle(e)},sPt=function(e){e===void 0&&(e={});var n={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(e).filter(function(r){return!n[r]}).reduce(function(r,s){var o;return ms({},r,(o={},o[s]=e[s],o))},{})},oPt=function(){};function RM(i,e){return i.reduce(function(n,r){return r==null?n:function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];var c=[].concat(a);e&&c.indexOf(e)===-1&&c.push(e),n.apply(this,c),r.apply(this,c)}},oPt)}var aPt=typeof window<"u"?$.useLayoutEffect:$.useEffect;function Kve(i){var e=$.useRef(i);return aPt(function(){e.current=i}),$.useCallback(function(){return e.current.apply(void 0,arguments)},[])}var $Pe=$.forwardRef(function(i,e){var n=i.children,r=i.className,s=i.autoHideDuration,o=i.disableWindowBlurListener,a=o===void 0?!1:o,l=i.onClose,c=i.id,u=i.open,d=i.SnackbarProps,h=d===void 0?{}:d,f=$.useRef(),p=Kve(function(){l&&l.apply(void 0,arguments)}),g=Kve(function(x){!l||x==null||(f.current&&clearTimeout(f.current),f.current=setTimeout(function(){p(null,"timeout",c)},x))});$.useEffect(function(){return u&&g(s),function(){f.current&&clearTimeout(f.current)}},[u,s,g]);var m=function(){f.current&&clearTimeout(f.current)},_=$.useCallback(function(){s!=null&&g(s*.5)},[s,g]),b=function(k){h.onMouseEnter&&h.onMouseEnter(k),m()},y=function(k){h.onMouseLeave&&h.onMouseLeave(k),_()};return $.useEffect(function(){if(!a&&u)return window.addEventListener("focus",_),window.addEventListener("blur",m),function(){window.removeEventListener("focus",_),window.removeEventListener("blur",m)}},[a,_,u]),$.createElement("div",Object.assign({ref:e},h,{className:hk(_I.Snackbar,r),onMouseEnter:b,onMouseLeave:y}),n)});$Pe.displayName="Snackbar";var UK,lPt=p4({root:(UK={display:"flex",flexWrap:"wrap",flexGrow:1},UK[$C.upSm]={flexGrow:"initial",minWidth:"288px"},UK)}),zPe=$.forwardRef(function(i,e){var n=i.className,r=f4(i,["className"]);return nn.createElement("div",Object.assign({ref:e,className:hk(lPt.root,n)},r))});zPe.displayName="SnackbarContent";var _A=p4({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:8*2.5+"px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),Gve="notistack-snackbar",VPe=$.forwardRef(function(i,e){var n=i.id,r=i.message,s=i.action,o=i.iconVariant,a=i.variant,l=i.hideIconVariant,c=i.style,u=i.className,d=o[a],h=s;return typeof h=="function"&&(h=h(n)),nn.createElement(zPe,{ref:e,role:"alert","aria-describedby":Gve,style:c,className:hk(_I.MuiContent,_I.MuiContentVariant(a),_A.root,_A[a],u,!l&&d&&_A.lessPadding)},nn.createElement("div",{id:Gve,className:_A.message},l?null:d,r),h&&nn.createElement("div",{className:_A.action},h))});VPe.displayName="MaterialDesignContent";var cPt=$.memo(VPe),uPt=p4({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),dPt=function(e){var n=$.useRef(),r=$.useState(!0),s=r[0],o=r[1],a=RM([e.snack.onClose,e.onClose]),l=function(){e.snack.requestClose&&a(null,"instructed",e.snack.id)},c=$.useCallback(function(){n.current=setTimeout(function(){o(function(M){return!M})},125)},[]);$.useEffect(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var u=e.snack,d=e.classes,h=e.Component,f=h===void 0?cPt:h,p=$.useMemo(function(){return sPt(d)},[d]),g=u.open,m=u.SnackbarProps,_=u.TransitionComponent,b=u.TransitionProps,y=u.transitionDuration,x=u.disableWindowBlurListener,k=u.content,D=f4(u,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),R=ms({direction:iPt(D.anchorOrigin),timeout:y},b),E=k;typeof E=="function"&&(E=E(D.id,D.message));var A=["onEnter","onEntered","onExit","onExited"].reduce(function(M,N){var P;return ms({},M,(P={},P[N]=RM([e.snack[N],e[N]],D.id),P))},{});return nn.createElement(WPe,{in:s,onExited:A.onExited},nn.createElement($Pe,{open:g,id:D.id,disableWindowBlurListener:x,autoHideDuration:D.autoHideDuration,className:hk(uPt.wrappedRoot,p.root,p[rPt(D.anchorOrigin)]),SnackbarProps:m,onClose:a},nn.createElement(_,Object.assign({},R,{appear:!0,in:g,onExit:A.onExit,onExited:c,onEnter:A.onEnter,onEntered:RM([A.onEntered,l],D.id)}),E||nn.createElement(f,Object.assign({},D)))))},vA,qK,nB,iB,KK,o0={view:{default:20},snackbar:{default:6,dense:2}},Xve="."+_I.CollapseWrapper,GK=16,rB=p4({root:(vA={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:D2(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},vA[Xve]={padding:o0.snackbar.default+"px 0px",transition:"padding 300ms ease 0ms"},vA.maxWidth="calc(100% - "+o0.view.default*2+"px)",vA[$C.downXs]={width:"100%",maxWidth:"calc(100% - "+GK*2+"px)"},vA),rootDense:(qK={},qK[Xve]={padding:o0.snackbar.dense+"px 0px"},qK),top:{top:o0.view.default-o0.snackbar.default+"px",flexDirection:"column"},bottom:{bottom:o0.view.default-o0.snackbar.default+"px",flexDirection:"column-reverse"},left:(nB={left:o0.view.default+"px"},nB[$C.upSm]={alignItems:"flex-start"},nB[$C.downXs]={left:GK+"px"},nB),right:(iB={right:o0.view.default+"px"},iB[$C.upSm]={alignItems:"flex-end"},iB[$C.downXs]={right:GK+"px"},iB),center:(KK={left:"50%",transform:"translateX(-50%)"},KK[$C.upSm]={alignItems:"center"},KK)}),hPt=function(e){var n=e.classes,r=n===void 0?{}:n,s=e.anchorOrigin,o=e.dense,a=e.children,l=hk(_I.SnackbarContainer,rB[s.vertical],rB[s.horizontal],rB.root,r.containerRoot,r["containerAnchorOrigin"+Hle(s)],o&&rB.rootDense);return nn.createElement("div",{className:l},a)},fPt=$.memo(hPt),Yve=function(e){var n=typeof e=="string"||$.isValidElement(e);return!n},rf,Xd,pPt=function(i){PPe(e,i);function e(r){var s;return s=i.call(this,r)||this,s.enqueueSnackbar=function(o,a){if(a===void 0&&(a={}),o==null)throw new Error("enqueueSnackbar called with invalid argument");var l=Yve(o)?o:a,c=Yve(o)?o.message:o,u=l.key,d=l.preventDuplicate,h=f4(l,["key","preventDuplicate"]),f=J6(u),p=f?u:new Date().getTime()+Math.random(),g=nPt(h,s.props),m=ms({id:p},h,{message:c,open:!0,entered:!1,requestClose:!1,persist:g("persist"),action:g("action"),content:g("content"),variant:g("variant"),anchorOrigin:g("anchorOrigin"),disableWindowBlurListener:g("disableWindowBlurListener"),autoHideDuration:g("autoHideDuration"),hideIconVariant:g("hideIconVariant"),TransitionComponent:g("TransitionComponent"),transitionDuration:g("transitionDuration"),TransitionProps:g("TransitionProps",!0),iconVariant:g("iconVariant",!0),style:g("style",!0),SnackbarProps:g("SnackbarProps",!0),className:hk(s.props.className,h.className)});return m.persist&&(m.autoHideDuration=void 0),s.setState(function(_){if(d===void 0&&s.props.preventDuplicate||d){var b=function(D){return f?D.id===p:D.message===c},y=_.queue.findIndex(b)>-1,x=_.snacks.findIndex(b)>-1;if(y||x)return _}return s.handleDisplaySnack(ms({},_,{queue:[].concat(_.queue,[m])}))}),p},s.handleDisplaySnack=function(o){var a=o.snacks;return a.length>=s.maxSnack?s.handleDismissOldest(o):s.processQueue(o)},s.processQueue=function(o){var a=o.queue,l=o.snacks;return a.length>0?ms({},o,{snacks:[].concat(l,[a[0]]),queue:a.slice(1,a.length)}):o},s.handleDismissOldest=function(o){if(o.snacks.some(function(d){return!d.open||d.requestClose}))return o;var a=!1,l=!1,c=o.snacks.reduce(function(d,h){return d+(h.open&&h.persist?1:0)},0);c===s.maxSnack&&(l=!0);var u=o.snacks.map(function(d){return!a&&(!d.persist||l)?(a=!0,d.entered?(d.onClose&&d.onClose(null,"maxsnack",d.id),s.props.onClose&&s.props.onClose(null,"maxsnack",d.id),ms({},d,{open:!1})):ms({},d,{requestClose:!0})):ms({},d)});return ms({},o,{snacks:u})},s.handleEnteredSnack=function(o,a,l){if(!J6(l))throw new Error("handleEnteredSnack Cannot be called with undefined key");s.setState(function(c){var u=c.snacks;return{snacks:u.map(function(d){return d.id===l?ms({},d,{entered:!0}):ms({},d)})}})},s.handleCloseSnack=function(o,a,l){s.props.onClose&&s.props.onClose(o,a,l);var c=l===void 0;s.setState(function(u){var d=u.snacks,h=u.queue;return{snacks:d.map(function(f){return!c&&f.id!==l?ms({},f):f.entered?ms({},f,{open:!1}):ms({},f,{requestClose:!0})}),queue:h.filter(function(f){return f.id!==l})}})},s.closeSnackbar=function(o){var a=s.state.snacks.find(function(l){return l.id===o});J6(o)&&a&&a.onClose&&a.onClose(null,"instructed",o),s.handleCloseSnack(null,"instructed",o)},s.handleExitedSnack=function(o,a){if(!J6(a))throw new Error("handleExitedSnack Cannot be called with undefined key");s.setState(function(l){var c=s.processQueue(ms({},l,{snacks:l.snacks.filter(function(u){return u.id!==a})}));return c.queue.length===0?c:s.handleDismissOldest(c)})},rf=s.enqueueSnackbar,Xd=s.closeSnackbar,s.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:s.enqueueSnackbar.bind(jve(s)),closeSnackbar:s.closeSnackbar.bind(jve(s))}},s}var n=e.prototype;return n.render=function(){var s=this,o=this.state.contextValue,a=this.props,l=a.domRoot,c=a.children,u=a.dense,d=u===void 0?!1:u,h=a.Components,f=h===void 0?{}:h,p=a.classes,g=this.state.snacks.reduce(function(_,b){var y,x=Hle(b.anchorOrigin),k=_[x]||[];return ms({},_,(y={},y[x]=[].concat(k,[b]),y))},{}),m=Object.keys(g).map(function(_){var b=g[_],y=b[0];return nn.createElement(fPt,{key:_,dense:d,anchorOrigin:y.anchorOrigin,classes:p},b.map(function(x){return nn.createElement(dPt,{key:x.id,snack:x,classes:p,Component:f[x.variant],onClose:s.handleCloseSnack,onEnter:s.props.onEnter,onExit:s.props.onExit,onExited:RM([s.handleExitedSnack,s.props.onExited],x.id),onEntered:RM([s.handleEnteredSnack,s.props.onEntered],x.id)})}))});return nn.createElement(OPe.Provider,{value:o},c,l?Wre.createPortal(m,l):m)},MPe(e,[{key:"maxSnack",get:function(){return this.props.maxSnack||US.maxSnack}}]),e}($.Component),pu=function(){return $.useContext(OPe)};const as=(i,e,n=null)=>({variant:i,autoHideDuration:n,preventDuplicate:!0,action:r=>C.jsx(Ci,{variant:"outlined",color:"inherit",onClick:()=>{e(r)},children:"Dismiss"})});var EN={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/var gPt=EN.exports,Zve;function mPt(){return Zve||(Zve=1,function(i,e){(function(){var n,r="4.17.21",s=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,f=2,p=4,g=1,m=2,_=1,b=2,y=4,x=8,k=16,D=32,R=64,E=128,A=256,M=512,N=30,P="...",O=800,B=16,j=1,z=2,H=3,Y=1/0,X=9007199254740991,Q=17976931348623157e292,ie=NaN,K=4294967295,ee=K-1,le=K>>>1,ke=[["ary",E],["bind",_],["bindKey",b],["curry",x],["curryRight",k],["flip",M],["partial",D],["partialRight",R],["rearg",A]],xe="[object Arguments]",me="[object Array]",Ee="[object AsyncFunction]",je="[object Boolean]",qe="[object Date]",Ze="[object DOMException]",We="[object Error]",ut="[object Function]",st="[object GeneratorFunction]",mt="[object Map]",Rt="[object Number]",Vt="[object Null]",Ot="[object Object]",vt="[object Promise]",wn="[object Proxy]",Ce="[object RegExp]",ge="[object Set]",pe="[object String]",ne="[object Symbol]",ae="[object Undefined]",ue="[object WeakMap]",de="[object WeakSet]",Se="[object ArrayBuffer]",Ie="[object DataView]",nt="[object Float32Array]",Oe="[object Float64Array]",Ve="[object Int8Array]",gt="[object Int16Array]",$t="[object Int32Array]",Mt="[object Uint8Array]",Bt="[object Uint8ClampedArray]",jn="[object Uint16Array]",Dt="[object Uint32Array]",Fn=/\b__p \+= '';/g,tn=/\b(__p \+=) '' \+/g,pi=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Pi=/&(?:amp|lt|gt|quot|#39);/g,ti=/[&<>"']/g,mi=RegExp(Pi.source),ds=RegExp(ti.source),Nr=/<%-([\s\S]+?)%>/g,Br=/<%([\s\S]+?)%>/g,Mn=/<%=([\s\S]+?)%>/g,hr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,sn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kn=/[\\^$.*+?()[\]{}|]/g,ai=RegExp(Kn.source),Ki=/^\s+/,so=/\s/,_o=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Cs=/\{\n\/\* \[wrapped with (.+)\] \*/,_u=/,? & /,yl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qs=/[()=,{}\[\]\/\s]/,Ks=/\\(\\)?/g,ma=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yn=/\w*$/,Pe=/^[-+]0x[0-9a-f]+$/i,De=/^0b[01]+$/i,Ne=/^\[object .+?Constructor\]$/,At=/^0o[0-7]+$/i,En=/^(?:0|[1-9]\d*)$/,bn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yn=/($^)/,fr=/['\n\r\u2028\u2029\\]/g,Ei="\\ud800-\\udfff",dg="\\u0300-\\u036f",Xv="\\ufe20-\\ufe2f",lw="\\u20d0-\\u20ff",Dh=dg+Xv+lw,m_="\\u2700-\\u27bf",Yi="a-z\\xdf-\\xf6\\xf8-\\xff",Ic="\\xac\\xb1\\xd7\\xf7",Uo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",__="\\u2000-\\u206f",Cd=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$4="A-Z\\xc0-\\xd6\\xd8-\\xde",z4="\\ufe0e\\ufe0f",V4=Ic+Uo+__+Cd,Yv="['’]",_k="["+Ei+"]",Zv="["+V4+"]",v_="["+Dh+"]",H4="\\d+",ZV="["+m_+"]",vk="["+Yi+"]",uT="[^"+Ei+V4+H4+m_+Yi+$4+"]",cw="\\ud83c[\\udffb-\\udfff]",uw="(?:"+v_+"|"+cw+")",U4="[^"+Ei+"]",dw="(?:\\ud83c[\\udde6-\\uddff]){2}",Tr="[\\ud800-\\udbff][\\udc00-\\udfff]",b_="["+$4+"]",dT="\\u200d",bk="(?:"+vk+"|"+uT+")",q4="(?:"+b_+"|"+uT+")",hT="(?:"+Yv+"(?:d|ll|m|re|s|t|ve))?",fT="(?:"+Yv+"(?:D|LL|M|RE|S|T|VE))?",yk=uw+"?",hw="["+z4+"]?",hg="(?:"+dT+"(?:"+[U4,dw,Tr].join("|")+")"+hw+yk+")*",fg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qv=hw+yk+hg,fw="(?:"+[ZV,dw,Tr].join("|")+")"+Qv,gg="(?:"+[U4+v_+"?",v_,dw,Tr,_k].join("|")+")",QV=RegExp(Yv,"g"),K4=RegExp(v_,"g"),y_=RegExp(cw+"(?="+cw+")|"+gg+Qv,"g"),JV=RegExp([b_+"?"+vk+"+"+hT+"(?="+[Zv,b_,"$"].join("|")+")",q4+"+"+fT+"(?="+[Zv,b_+bk,"$"].join("|")+")",b_+"?"+bk+"+"+hT,b_+"+"+fT,pg,fg,H4,fw].join("|"),"g"),G4=RegExp("["+dT+Ei+Dh+z4+"]"),wk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,X4=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eH=-1,jr={};jr[nt]=jr[Oe]=jr[Ve]=jr[gt]=jr[$t]=jr[Mt]=jr[Bt]=jr[jn]=jr[Dt]=!0,jr[xe]=jr[me]=jr[Se]=jr[je]=jr[Ie]=jr[qe]=jr[We]=jr[ut]=jr[mt]=jr[Rt]=jr[Ot]=jr[Ce]=jr[ge]=jr[pe]=jr[ue]=!1;var Mr={};Mr[xe]=Mr[me]=Mr[Se]=Mr[Ie]=Mr[je]=Mr[qe]=Mr[nt]=Mr[Oe]=Mr[Ve]=Mr[gt]=Mr[$t]=Mr[mt]=Mr[Rt]=Mr[Ot]=Mr[Ce]=Mr[ge]=Mr[pe]=Mr[ne]=Mr[Mt]=Mr[Bt]=Mr[jn]=Mr[Dt]=!0,Mr[We]=Mr[ut]=Mr[ue]=!1;var Jv={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ck={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tH={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},nH={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pT=parseFloat,Sk=parseInt,xk=typeof hy=="object"&&hy&&hy.Object===Object&&hy,Y4=typeof self=="object"&&self&&self.Object===Object&&self,Fs=xk||Y4||Function("return this")(),pw=e&&!e.nodeType&&e,Eh=pw&&!0&&i&&!i.nodeType&&i,gT=Eh&&Eh.exports===pw,eb=gT&&xk.process,wl=function(){try{var Fe=Eh&&Eh.require&&Eh.require("util").types;return Fe||eb&&eb.binding&&eb.binding("util")}catch{}}(),mT=wl&&wl.isArrayBuffer,Zl=wl&&wl.isDate,w_=wl&&wl.isMap,kk=wl&&wl.isRegExp,tb=wl&&wl.isSet,Z4=wl&&wl.isTypedArray;function Cl(Fe,ft,Qe){switch(Qe.length){case 0:return Fe.call(ft);case 1:return Fe.call(ft,Qe[0]);case 2:return Fe.call(ft,Qe[0],Qe[1]);case 3:return Fe.call(ft,Qe[0],Qe[1],Qe[2])}return Fe.apply(ft,Qe)}function _T(Fe,ft,Qe,fn){for(var vi=-1,Cr=Fe==null?0:Fe.length;++vi<Cr;){var Eo=Fe[vi];ft(fn,Eo,Qe(Eo),Fe)}return fn}function Qa(Fe,ft){for(var Qe=-1,fn=Fe==null?0:Fe.length;++Qe<fn&&ft(Fe[Qe],Qe,Fe)!==!1;);return Fe}function Lk(Fe,ft){for(var Qe=Fe==null?0:Fe.length;Qe--&&ft(Fe[Qe],Qe,Fe)!==!1;);return Fe}function vT(Fe,ft){for(var Qe=-1,fn=Fe==null?0:Fe.length;++Qe<fn;)if(!ft(Fe[Qe],Qe,Fe))return!1;return!0}function mg(Fe,ft){for(var Qe=-1,fn=Fe==null?0:Fe.length,vi=0,Cr=[];++Qe<fn;){var Eo=Fe[Qe];ft(Eo,Qe,Fe)&&(Cr[vi++]=Eo)}return Cr}function Dk(Fe,ft){var Qe=Fe==null?0:Fe.length;return!!Qe&&nb(Fe,ft,0)>-1}function bT(Fe,ft,Qe){for(var fn=-1,vi=Fe==null?0:Fe.length;++fn<vi;)if(Qe(ft,Fe[fn]))return!0;return!1}function hs(Fe,ft){for(var Qe=-1,fn=Fe==null?0:Fe.length,vi=Array(fn);++Qe<fn;)vi[Qe]=ft(Fe[Qe],Qe,Fe);return vi}function _g(Fe,ft){for(var Qe=-1,fn=ft.length,vi=Fe.length;++Qe<fn;)Fe[vi+Qe]=ft[Qe];return Fe}function yT(Fe,ft,Qe,fn){var vi=-1,Cr=Fe==null?0:Fe.length;for(fn&&Cr&&(Qe=Fe[++vi]);++vi<Cr;)Qe=ft(Qe,Fe[vi],vi,Fe);return Qe}function iH(Fe,ft,Qe,fn){var vi=Fe==null?0:Fe.length;for(fn&&vi&&(Qe=Fe[--vi]);vi--;)Qe=ft(Qe,Fe[vi],vi,Fe);return Qe}function wT(Fe,ft){for(var Qe=-1,fn=Fe==null?0:Fe.length;++Qe<fn;)if(ft(Fe[Qe],Qe,Fe))return!0;return!1}var rH=ST("length");function Q4(Fe){return Fe.split("")}function sH(Fe){return Fe.match(yl)||[]}function J4(Fe,ft,Qe){var fn;return Qe(Fe,function(vi,Cr,Eo){if(ft(vi,Cr,Eo))return fn=Cr,!1}),fn}function Ek(Fe,ft,Qe,fn){for(var vi=Fe.length,Cr=Qe+(fn?1:-1);fn?Cr--:++Cr<vi;)if(ft(Fe[Cr],Cr,Fe))return Cr;return-1}function nb(Fe,ft,Qe){return ft===ft?Rk(Fe,ft,Qe):Ek(Fe,eF,Qe)}function CT(Fe,ft,Qe,fn){for(var vi=Qe-1,Cr=Fe.length;++vi<Cr;)if(fn(Fe[vi],ft))return vi;return-1}function eF(Fe){return Fe!==Fe}function tF(Fe,ft){var Qe=Fe==null?0:Fe.length;return Qe?xT(Fe,ft)/Qe:ie}function ST(Fe){return function(ft){return ft==null?n:ft[Fe]}}function Ik(Fe){return function(ft){return Fe==null?n:Fe[ft]}}function nF(Fe,ft,Qe,fn,vi){return vi(Fe,function(Cr,Eo,Gr){Qe=fn?(fn=!1,Cr):ft(Qe,Cr,Eo,Gr)}),Qe}function oH(Fe,ft){var Qe=Fe.length;for(Fe.sort(ft);Qe--;)Fe[Qe]=Fe[Qe].value;return Fe}function xT(Fe,ft){for(var Qe,fn=-1,vi=Fe.length;++fn<vi;){var Cr=ft(Fe[fn]);Cr!==n&&(Qe=Qe===n?Cr:Qe+Cr)}return Qe}function kT(Fe,ft){for(var Qe=-1,fn=Array(Fe);++Qe<Fe;)fn[Qe]=ft(Qe);return fn}function aH(Fe,ft){return hs(ft,function(Qe){return[Qe,Fe[Qe]]})}function iF(Fe){return Fe&&Fe.slice(0,Ak(Fe)+1).replace(Ki,"")}function Tc(Fe){return function(ft){return Fe(ft)}}function gw(Fe,ft){return hs(ft,function(Qe){return Fe[Qe]})}function zf(Fe,ft){return Fe.has(ft)}function rF(Fe,ft){for(var Qe=-1,fn=Fe.length;++Qe<fn&&nb(ft,Fe[Qe],0)>-1;);return Qe}function LT(Fe,ft){for(var Qe=Fe.length;Qe--&&nb(ft,Fe[Qe],0)>-1;);return Qe}function sF(Fe,ft){for(var Qe=Fe.length,fn=0;Qe--;)Fe[Qe]===ft&&++fn;return fn}var oF=Ik(Jv),aF=Ik(Ck);function lF(Fe){return"\\"+nH[Fe]}function ib(Fe,ft){return Fe==null?n:Fe[ft]}function rb(Fe){return G4.test(Fe)}function lH(Fe){return wk.test(Fe)}function cH(Fe){for(var ft,Qe=[];!(ft=Fe.next()).done;)Qe.push(ft.value);return Qe}function Tk(Fe){var ft=-1,Qe=Array(Fe.size);return Fe.forEach(function(fn,vi){Qe[++ft]=[vi,fn]}),Qe}function DT(Fe,ft){return function(Qe){return Fe(ft(Qe))}}function vu(Fe,ft){for(var Qe=-1,fn=Fe.length,vi=0,Cr=[];++Qe<fn;){var Eo=Fe[Qe];(Eo===ft||Eo===d)&&(Fe[Qe]=d,Cr[vi++]=Qe)}return Cr}function vg(Fe){var ft=-1,Qe=Array(Fe.size);return Fe.forEach(function(fn){Qe[++ft]=fn}),Qe}function uH(Fe){var ft=-1,Qe=Array(Fe.size);return Fe.forEach(function(fn){Qe[++ft]=[fn,fn]}),Qe}function Rk(Fe,ft,Qe){for(var fn=Qe-1,vi=Fe.length;++fn<vi;)if(Fe[fn]===ft)return fn;return-1}function dH(Fe,ft,Qe){for(var fn=Qe+1;fn--;)if(Fe[fn]===ft)return fn;return fn}function C_(Fe){return rb(Fe)?uF(Fe):rH(Fe)}function Rc(Fe){return rb(Fe)?dF(Fe):Q4(Fe)}function Ak(Fe){for(var ft=Fe.length;ft--&&so.test(Fe.charAt(ft)););return ft}var cF=Ik(tH);function uF(Fe){for(var ft=y_.lastIndex=0;y_.test(Fe);)++ft;return ft}function dF(Fe){return Fe.match(y_)||[]}function hH(Fe){return Fe.match(JV)||[]}var fH=function Fe(ft){ft=ft==null?Fs:sb.defaults(Fs.Object(),ft,sb.pick(Fs,X4));var Qe=ft.Array,fn=ft.Date,vi=ft.Error,Cr=ft.Function,Eo=ft.Math,Gr=ft.Object,mw=ft.RegExp,pH=ft.String,bu=ft.TypeError,Vf=Qe.prototype,ET=Cr.prototype,Ih=Gr.prototype,ob=ft["__core-js_shared__"],_w=ET.toString,Sr=Ih.hasOwnProperty,ab=0,Nk=function(){var S=/[^.]+$/.exec(ob&&ob.keys&&ob.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),vw=Ih.toString,Mk=_w.call(Gr),hF=Fs._,fF=mw("^"+_w.call(Sr).replace(Kn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bw=gT?ft.Buffer:n,Hf=ft.Symbol,yw=ft.Uint8Array,IT=bw?bw.allocUnsafe:n,Sd=DT(Gr.getPrototypeOf,Gr),Pk=Gr.create,Ok=Ih.propertyIsEnumerable,Fk=Vf.splice,pF=Hf?Hf.isConcatSpreadable:n,Uf=Hf?Hf.iterator:n,S_=Hf?Hf.toStringTag:n,ww=function(){try{var S=Ig(Gr,"defineProperty");return S({},"",{}),S}catch{}}(),gF=ft.clearTimeout!==Fs.clearTimeout&&ft.clearTimeout,Ss=fn&&fn.now!==Fs.Date.now&&fn.now,TT=ft.setTimeout!==Fs.setTimeout&&ft.setTimeout,x_=Eo.ceil,bg=Eo.floor,Bk=Gr.getOwnPropertySymbols,RT=bw?bw.isBuffer:n,lb=ft.isFinite,jk=Vf.join,cb=DT(Gr.keys,Gr),Io=Eo.max,Ja=Eo.min,gH=fn.now,mF=ft.parseInt,Cw=Eo.random,Wk=Vf.reverse,Sw=Ig(ft,"DataView"),k_=Ig(ft,"Map"),xw=Ig(ft,"Promise"),yg=Ig(ft,"Set"),kw=Ig(ft,"WeakMap"),ub=Ig(Gr,"create"),$k=kw&&new kw,db={},AT=Tg(Sw),wg=Tg(k_),_F=Tg(xw),hb=Tg(yg),Th=Tg(kw),Cg=Hf?Hf.prototype:n,Ac=Cg?Cg.valueOf:n,zk=Cg?Cg.toString:n;function he(S){if(Ro(S)&&!Ti(S)&&!(S instanceof Ii)){if(S instanceof el)return S;if(Sr.call(S,"__wrapped__"))return UF(S)}return new el(S)}var fb=function(){function S(){}return function(I){if(!yo(I))return{};if(Pk)return Pk(I);S.prototype=I;var W=new S;return S.prototype=n,W}}();function Rh(){}function el(S,I){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!I,this.__index__=0,this.__values__=n}he.templateSettings={escape:Nr,evaluate:Br,interpolate:Mn,variable:"",imports:{_:he}},he.prototype=Rh.prototype,he.prototype.constructor=he,el.prototype=fb(Rh.prototype),el.prototype.constructor=el;function Ii(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=K,this.__views__=[]}function Vk(){var S=new Ii(this.__wrapped__);return S.__actions__=xl(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=xl(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=xl(this.__views__),S}function NT(){if(this.__filtered__){var S=new Ii(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function pb(){var S=this.__wrapped__.value(),I=this.__dir__,W=Ti(S),q=I<0,te=W?S.length:0,fe=aR(0,te,this.__views__),we=fe.start,Ae=fe.end,$e=Ae-we,Ct=q?Ae:we-1,St=this.__iteratees__,Tt=St.length,dn=0,Rn=Ja($e,this.__takeCount__);if(!W||!q&&te==$e&&Rn==$e)return Cb(S,this.__actions__);var ui=[];e:for(;$e--&&dn<Rn;){Ct+=I;for(var zi=-1,di=S[Ct];++zi<Tt;){var tr=St[zi],gr=tr.iteratee,Nd=tr.type,Fc=gr(di);if(Nd==z)di=Fc;else if(!Fc){if(Nd==j)continue e;break e}}ui[dn++]=di}return ui}Ii.prototype=fb(Rh.prototype),Ii.prototype.constructor=Ii;function Ql(S){var I=-1,W=S==null?0:S.length;for(this.clear();++I<W;){var q=S[I];this.set(q[0],q[1])}}function xs(){this.__data__=ub?ub(null):{},this.size=0}function fs(S){var I=this.has(S)&&delete this.__data__[S];return this.size-=I?1:0,I}function Sg(S){var I=this.__data__;if(ub){var W=I[S];return W===c?n:W}return Sr.call(I,S)?I[S]:n}function tl(S){var I=this.__data__;return ub?I[S]!==n:Sr.call(I,S)}function Jl(S,I){var W=this.__data__;return this.size+=this.has(S)?0:1,W[S]=ub&&I===n?c:I,this}Ql.prototype.clear=xs,Ql.prototype.delete=fs,Ql.prototype.get=Sg,Ql.prototype.has=tl,Ql.prototype.set=Jl;function Sl(S){var I=-1,W=S==null?0:S.length;for(this.clear();++I<W;){var q=S[I];this.set(q[0],q[1])}}function gb(){this.__data__=[],this.size=0}function ec(S){var I=this.__data__,W=il(I,S);if(W<0)return!1;var q=I.length-1;return W==q?I.pop():Fk.call(I,W,1),--this.size,!0}function Hk(S){var I=this.__data__,W=il(I,S);return W<0?n:I[W][1]}function vF(S){return il(this.__data__,S)>-1}function bF(S,I){var W=this.__data__,q=il(W,S);return q<0?(++this.size,W.push([S,I])):W[q][1]=I,this}Sl.prototype.clear=gb,Sl.prototype.delete=ec,Sl.prototype.get=Hk,Sl.prototype.has=vF,Sl.prototype.set=bF;function yu(S){var I=-1,W=S==null?0:S.length;for(this.clear();++I<W;){var q=S[I];this.set(q[0],q[1])}}function yF(){this.size=0,this.__data__={hash:new Ql,map:new(k_||Sl),string:new Ql}}function qf(S){var I=$w(this,S).delete(S);return this.size-=I?1:0,I}function Uk(S){return $w(this,S).get(S)}function MT(S){return $w(this,S).has(S)}function wF(S,I){var W=$w(this,S),q=W.size;return W.set(S,I),this.size+=W.size==q?0:1,this}yu.prototype.clear=yF,yu.prototype.delete=qf,yu.prototype.get=Uk,yu.prototype.has=MT,yu.prototype.set=wF;function L_(S){var I=-1,W=S==null?0:S.length;for(this.__data__=new yu;++I<W;)this.add(S[I])}function xg(S){return this.__data__.set(S,c),this}function mb(S){return this.__data__.has(S)}L_.prototype.add=L_.prototype.push=xg,L_.prototype.has=mb;function nl(S){var I=this.__data__=new Sl(S);this.size=I.size}function qk(){this.__data__=new Sl,this.size=0}function Kk(S){var I=this.__data__,W=I.delete(S);return this.size=I.size,W}function wu(S){return this.__data__.get(S)}function Cu(S){return this.__data__.has(S)}function D_(S,I){var W=this.__data__;if(W instanceof Sl){var q=W.__data__;if(!k_||q.length<s-1)return q.push([S,I]),this.size=++W.size,this;W=this.__data__=new yu(q)}return W.set(S,I),this.size=W.size,this}nl.prototype.clear=qk,nl.prototype.delete=Kk,nl.prototype.get=wu,nl.prototype.has=Cu,nl.prototype.set=D_;function Ah(S,I){var W=Ti(S),q=!W&&Jw(S),te=!W&&!q&&Ab(S),fe=!W&&!q&&!te&&OL(S),we=W||q||te||fe,Ae=we?kT(S.length,pH):[],$e=Ae.length;for(var Ct in S)(I||Sr.call(S,Ct))&&!(we&&(Ct=="length"||te&&(Ct=="offset"||Ct=="parent")||fe&&(Ct=="buffer"||Ct=="byteLength"||Ct=="byteOffset")||js(Ct,$e)))&&Ae.push(Ct);return Ae}function Nh(S){var I=S.length;return I?S[yb(0,I-1)]:n}function E_(S,I){return bL(xl(S),Kf(I,0,S.length))}function CF(S){return bL(xl(S))}function Lw(S,I,W){(W!==n&&!ip(S[I],W)||W===n&&!(I in S))&&Mh(S,I,W)}function I_(S,I,W){var q=S[I];(!(Sr.call(S,I)&&ip(q,W))||W===n&&!(I in S))&&Mh(S,I,W)}function il(S,I){for(var W=S.length;W--;)if(ip(S[W][0],I))return W;return-1}function Nc(S,I,W,q){return Oh(S,function(te,fe,we){I(q,te,W(te),we)}),q}function ks(S,I){return S&&kd(I,ol(I),S)}function xd(S,I){return S&&kd(I,Ru(I),S)}function Mh(S,I,W){I=="__proto__"&&ww?ww(S,I,{configurable:!0,enumerable:!0,value:W,writable:!0}):S[I]=W}function Gk(S,I){for(var W=-1,q=I.length,te=Qe(q),fe=S==null;++W<q;)te[W]=fe?n:jH(S,I[W]);return te}function Kf(S,I,W){return S===S&&(W!==n&&(S=S<=W?S:W),I!==n&&(S=S>=I?S:I)),S}function tc(S,I,W,q,te,fe){var we,Ae=I&h,$e=I&f,Ct=I&p;if(W&&(we=te?W(S,q,te,fe):W(S)),we!==n)return we;if(!yo(S))return S;var St=Ti(S);if(St){if(we=Vw(S),!Ae)return xl(S,we)}else{var Tt=Pa(S),dn=Tt==ut||Tt==st;if(Ab(S))return XT(S,Ae);if(Tt==Ot||Tt==xe||dn&&!te){if(we=$e||dn?{}:Oa(S),!Ae)return $e?_H(S,xd(we,S)):aL(S,ks(we,S))}else{if(!Mr[Tt])return te?S:{};we=vH(S,Tt,Ae)}}fe||(fe=new nl);var Rn=fe.get(S);if(Rn)return Rn;fe.set(S,we),mue(S)?S.forEach(function(di){we.add(tc(di,I,W,di,S,fe))}):pue(S)&&S.forEach(function(di,tr){we.set(tr,tc(di,I,W,tr,S,fe))});var ui=Ct?$e?Ww:jw:$e?Ru:ol,zi=St?n:ui(S);return Qa(zi||S,function(di,tr){zi&&(tr=di,di=S[tr]),I_(we,tr,tc(di,I,W,tr,S,fe))}),we}function SF(S){var I=ol(S);return function(W){return Dw(W,S,I)}}function Dw(S,I,W){var q=W.length;if(S==null)return!q;for(S=Gr(S);q--;){var te=W[q],fe=I[te],we=S[te];if(we===n&&!(te in S)||!fe(we))return!1}return!0}function PT(S,I,W){if(typeof S!="function")throw new bu(a);return Ib(function(){S.apply(n,W)},I)}function Ph(S,I,W,q){var te=-1,fe=Dk,we=!0,Ae=S.length,$e=[],Ct=I.length;if(!Ae)return $e;W&&(I=hs(I,Tc(W))),q?(fe=bT,we=!1):I.length>=s&&(fe=zf,we=!1,I=new L_(I));e:for(;++te<Ae;){var St=S[te],Tt=W==null?St:W(St);if(St=q||St!==0?St:0,we&&Tt===Tt){for(var dn=Ct;dn--;)if(I[dn]===Tt)continue e;$e.push(St)}else fe(I,Tt,q)||$e.push(St)}return $e}var Oh=Du(Mc),xF=Du(kg,!0);function Ew(S,I){var W=!0;return Oh(S,function(q,te,fe){return W=!!I(q,te,fe),W}),W}function T_(S,I,W){for(var q=-1,te=S.length;++q<te;){var fe=S[q],we=I(fe);if(we!=null&&(Ae===n?we===we&&!Ad(we):W(we,Ae)))var Ae=we,$e=fe}return $e}function kF(S,I,W,q){var te=S.length;for(W=Fi(W),W<0&&(W=-W>te?0:te+W),q=q===n||q>te?te:Fi(q),q<0&&(q+=te),q=W>q?0:vue(q);W<q;)S[W++]=I;return S}function OT(S,I){var W=[];return Oh(S,function(q,te,fe){I(q,te,fe)&&W.push(q)}),W}function oo(S,I,W,q,te){var fe=-1,we=S.length;for(W||(W=mL),te||(te=[]);++fe<we;){var Ae=S[fe];I>0&&W(Ae)?I>1?oo(Ae,I-1,W,q,te):_g(te,Ae):q||(te[te.length]=Ae)}return te}var Xk=cL(),Iw=cL(!0);function Mc(S,I){return S&&Xk(S,I,ol)}function kg(S,I){return S&&Iw(S,I,ol)}function _b(S,I){return mg(I,function(W){return V_(S[W])})}function Gf(S,I){I=jh(I,S);for(var W=0,q=I.length;S!=null&&W<q;)S=S[Id(I[W++])];return W&&W==q?S:n}function Yk(S,I,W){var q=I(S);return Ti(S)?q:_g(q,W(S))}function Na(S){return S==null?S===n?ae:Vt:S_&&S_ in Gr(S)?gL(S):cR(S)}function Lg(S,I){return S>I}function Su(S,I){return S!=null&&Sr.call(S,I)}function R_(S,I){return S!=null&&I in Gr(S)}function FT(S,I,W){return S>=Ja(I,W)&&S<Io(I,W)}function Zk(S,I,W){for(var q=W?bT:Dk,te=S[0].length,fe=S.length,we=fe,Ae=Qe(fe),$e=1/0,Ct=[];we--;){var St=S[we];we&&I&&(St=hs(St,Tc(I))),$e=Ja(St.length,$e),Ae[we]=!W&&(I||te>=120&&St.length>=120)?new L_(we&&St):n}St=S[0];var Tt=-1,dn=Ae[0];e:for(;++Tt<te&&Ct.length<$e;){var Rn=St[Tt],ui=I?I(Rn):Rn;if(Rn=W||Rn!==0?Rn:0,!(dn?zf(dn,ui):q(Ct,ui,W))){for(we=fe;--we;){var zi=Ae[we];if(!(zi?zf(zi,ui):q(S[we],ui,W)))continue e}dn&&dn.push(ui),Ct.push(Rn)}}return Ct}function Xf(S,I,W,q){return Mc(S,function(te,fe,we){I(q,W(te),fe,we)}),q}function xu(S,I,W){I=jh(I,S),S=_a(S,I);var q=S==null?S:S[Id(Dl(I))];return q==null?n:Cl(q,S,W)}function Qk(S){return Ro(S)&&Na(S)==xe}function LF(S){return Ro(S)&&Na(S)==Se}function Yf(S){return Ro(S)&&Na(S)==qe}function ku(S,I,W,q,te){return S===I?!0:S==null||I==null||!Ro(S)&&!Ro(I)?S!==S&&I!==I:Jk(S,I,W,q,ku,te)}function Jk(S,I,W,q,te,fe){var we=Ti(S),Ae=Ti(I),$e=we?me:Pa(S),Ct=Ae?me:Pa(I);$e=$e==xe?Ot:$e,Ct=Ct==xe?Ot:Ct;var St=$e==Ot,Tt=Ct==Ot,dn=$e==Ct;if(dn&&Ab(S)){if(!Ab(I))return!1;we=!0,St=!1}if(dn&&!St)return fe||(fe=new nl),we||OL(S)?sR(S,I,W,q,te,fe):oR(S,I,$e,W,q,te,fe);if(!(W&g)){var Rn=St&&Sr.call(S,"__wrapped__"),ui=Tt&&Sr.call(I,"__wrapped__");if(Rn||ui){var zi=Rn?S.value():S,di=ui?I.value():I;return fe||(fe=new nl),te(zi,di,W,q,fe)}}return dn?(fe||(fe=new nl),FF(S,I,W,q,te,fe)):!1}function DF(S){return Ro(S)&&Pa(S)==mt}function vb(S,I,W,q){var te=W.length,fe=te,we=!q;if(S==null)return!fe;for(S=Gr(S);te--;){var Ae=W[te];if(we&&Ae[2]?Ae[1]!==S[Ae[0]]:!(Ae[0]in S))return!1}for(;++te<fe;){Ae=W[te];var $e=Ae[0],Ct=S[$e],St=Ae[1];if(we&&Ae[2]){if(Ct===n&&!($e in S))return!1}else{var Tt=new nl;if(q)var dn=q(Ct,St,$e,S,I,Tt);if(!(dn===n?ku(St,Ct,g|m,q,Tt):dn))return!1}}return!0}function BT(S){if(!yo(S)||WF(S))return!1;var I=V_(S)?fF:Ne;return I.test(Tg(S))}function Tw(S){return Ro(S)&&Na(S)==Ce}function Fh(S){return Ro(S)&&Pa(S)==ge}function Rw(S){return Ro(S)&&s3(S.length)&&!!jr[Na(S)]}function bb(S){return typeof S=="function"?S:S==null?Au:typeof S=="object"?Ti(S)?Bs(S[0],S[1]):eL(S):Iue(S)}function Zf(S){if(!tp(S))return cb(S);var I=[];for(var W in Gr(S))Sr.call(S,W)&&W!="constructor"&&I.push(W);return I}function jT(S){if(!yo(S))return VF(S);var I=tp(S),W=[];for(var q in S)q=="constructor"&&(I||!Sr.call(S,q))||W.push(q);return W}function Dg(S,I){return S<I}function WT(S,I){var W=-1,q=Tu(S)?Qe(S.length):[];return Oh(S,function(te,fe,we){q[++W]=I(te,fe,we)}),q}function eL(S){var I=zw(S);return I.length==1&&I[0][2]?_L(I[0][0],I[0][1]):function(W){return W===S||vb(W,S,I)}}function Bs(S,I){return _n(S)&&Uw(I)?_L(Id(S),I):function(W){var q=jH(W,S);return q===n&&q===I?WH(W,S):ku(I,q,g|m)}}function A_(S,I,W,q,te){S!==I&&Xk(I,function(fe,we){if(te||(te=new nl),yo(fe))$T(S,I,we,W,A_,q,te);else{var Ae=q?q(zh(S,we),fe,we+"",S,I,te):n;Ae===n&&(Ae=fe),Lw(S,we,Ae)}},Ru)}function $T(S,I,W,q,te,fe,we){var Ae=zh(S,W),$e=zh(I,W),Ct=we.get($e);if(Ct){Lw(S,W,Ct);return}var St=fe?fe(Ae,$e,W+"",S,I,we):n,Tt=St===n;if(Tt){var dn=Ti($e),Rn=!dn&&Ab($e),ui=!dn&&!Rn&&OL($e);St=$e,dn||Rn||ui?Ti(Ae)?St=Ae:Go(Ae)?St=xl(Ae):Rn?(Tt=!1,St=XT($e,!0)):ui?(Tt=!1,St=AF($e,!0)):St=[]:DR($e)||Jw($e)?(St=Ae,Jw(Ae)?St=bue(Ae):(!yo(Ae)||V_(Ae))&&(St=Oa($e))):Tt=!1}Tt&&(we.set($e,St),te(St,$e,q,fe,we),we.delete($e)),Lw(S,W,St)}function tL(S,I){var W=S.length;if(W)return I+=I<0?W:0,js(I,W)?S[I]:n}function Aw(S,I,W){I.length?I=hs(I,function(fe){return Ti(fe)?function(we){return Gf(we,fe.length===1?fe[0]:fe)}:fe}):I=[Au];var q=-1;I=hs(I,Tc(Zn()));var te=WT(S,function(fe,we,Ae){var $e=hs(I,function(Ct){return Ct(fe)});return{criteria:$e,index:++q,value:fe}});return oH(te,function(fe,we){return mH(fe,we,W)})}function zT(S,I){return Eg(S,I,function(W,q){return WH(S,q)})}function Eg(S,I,W){for(var q=-1,te=I.length,fe={};++q<te;){var we=I[q],Ae=Gf(S,we);W(Ae,we)&&M_(fe,jh(we,S),Ae)}return fe}function Gs(S){return function(I){return Gf(I,S)}}function vo(S,I,W,q){var te=q?CT:nb,fe=-1,we=I.length,Ae=S;for(S===I&&(I=xl(I)),W&&(Ae=hs(S,Tc(W)));++fe<we;)for(var $e=0,Ct=I[fe],St=W?W(Ct):Ct;($e=te(Ae,St,$e,q))>-1;)Ae!==S&&Fk.call(Ae,$e,1),Fk.call(S,$e,1);return S}function qo(S,I){for(var W=S?I.length:0,q=W-1;W--;){var te=I[W];if(W==q||te!==fe){var fe=te;js(te)?Fk.call(S,te,1):rL(S,te)}}return S}function yb(S,I){return S+bg(Cw()*(I-S+1))}function Nw(S,I,W,q){for(var te=-1,fe=Io(x_((I-S)/(W||1)),0),we=Qe(fe);fe--;)we[q?fe:++te]=S,S+=W;return we}function N_(S,I){var W="";if(!S||I<1||I>X)return W;do I%2&&(W+=S),I=bg(I/2),I&&(S+=S);while(I);return W}function Oi(S,I){return Pc(vL(S,I,Au),S+"")}function rl(S){return Nh(FL(S))}function VT(S,I){var W=FL(S);return bL(W,Kf(I,0,W.length))}function M_(S,I,W,q){if(!yo(S))return S;I=jh(I,S);for(var te=-1,fe=I.length,we=fe-1,Ae=S;Ae!=null&&++te<fe;){var $e=Id(I[te]),Ct=W;if($e==="__proto__"||$e==="constructor"||$e==="prototype")return S;if(te!=we){var St=Ae[$e];Ct=q?q(St,$e,Ae):n,Ct===n&&(Ct=yo(St)?St:js(I[te+1])?[]:{})}I_(Ae,$e,Ct),Ae=Ae[$e]}return S}var nL=$k?function(S,I){return $k.set(S,I),S}:Au,Bh=ww?function(S,I){return ww(S,"toString",{configurable:!0,enumerable:!1,value:zH(I),writable:!0})}:Au;function Lu(S){return bL(FL(S))}function sl(S,I,W){var q=-1,te=S.length;I<0&&(I=-I>te?0:te+I),W=W>te?te:W,W<0&&(W+=te),te=I>W?0:W-I>>>0,I>>>=0;for(var fe=Qe(te);++q<te;)fe[q]=S[q+I];return fe}function HT(S,I){var W;return Oh(S,function(q,te,fe){return W=I(q,te,fe),!W}),!!W}function wb(S,I,W){var q=0,te=S==null?q:S.length;if(typeof I=="number"&&I===I&&te<=le){for(;q<te;){var fe=q+te>>>1,we=S[fe];we!==null&&!Ad(we)&&(W?we<=I:we<I)?q=fe+1:te=fe}return te}return iL(S,I,Au,W)}function iL(S,I,W,q){var te=0,fe=S==null?0:S.length;if(fe===0)return 0;I=W(I);for(var we=I!==I,Ae=I===null,$e=Ad(I),Ct=I===n;te<fe;){var St=bg((te+fe)/2),Tt=W(S[St]),dn=Tt!==n,Rn=Tt===null,ui=Tt===Tt,zi=Ad(Tt);if(we)var di=q||ui;else Ct?di=ui&&(q||dn):Ae?di=ui&&dn&&(q||!Rn):$e?di=ui&&dn&&!Rn&&(q||!zi):Rn||zi?di=!1:di=q?Tt<=I:Tt<I;di?te=St+1:fe=St}return Ja(fe,ee)}function UT(S,I){for(var W=-1,q=S.length,te=0,fe=[];++W<q;){var we=S[W],Ae=I?I(we):we;if(!W||!ip(Ae,$e)){var $e=Ae;fe[te++]=we===0?0:we}}return fe}function qT(S){return typeof S=="number"?S:Ad(S)?ie:+S}function nc(S){if(typeof S=="string")return S;if(Ti(S))return hs(S,nc)+"";if(Ad(S))return zk?zk.call(S):"";var I=S+"";return I=="0"&&1/S==-Y?"-0":I}function Qf(S,I,W){var q=-1,te=Dk,fe=S.length,we=!0,Ae=[],$e=Ae;if(W)we=!1,te=bT;else if(fe>=s){var Ct=I?null:OF(S);if(Ct)return vg(Ct);we=!1,te=zf,$e=new L_}else $e=I?[]:Ae;e:for(;++q<fe;){var St=S[q],Tt=I?I(St):St;if(St=W||St!==0?St:0,we&&Tt===Tt){for(var dn=$e.length;dn--;)if($e[dn]===Tt)continue e;I&&$e.push(Tt),Ae.push(St)}else te($e,Tt,W)||($e!==Ae&&$e.push(Tt),Ae.push(St))}return Ae}function rL(S,I){return I=jh(I,S),S=_a(S,I),S==null||delete S[Id(Dl(I))]}function KT(S,I,W,q){return M_(S,I,W(Gf(S,I)),q)}function Mw(S,I,W,q){for(var te=S.length,fe=q?te:-1;(q?fe--:++fe<te)&&I(S[fe],fe,S););return W?sl(S,q?0:fe,q?fe+1:te):sl(S,q?fe+1:0,q?te:fe)}function Cb(S,I){var W=S;return W instanceof Ii&&(W=W.value()),yT(I,function(q,te){return te.func.apply(te.thisArg,_g([q],te.args))},W)}function sL(S,I,W){var q=S.length;if(q<2)return q?Qf(S[0]):[];for(var te=-1,fe=Qe(q);++te<q;)for(var we=S[te],Ae=-1;++Ae<q;)Ae!=te&&(fe[te]=Ph(fe[te]||we,S[Ae],I,W));return Qf(oo(fe,1),I,W)}function Pw(S,I,W){for(var q=-1,te=S.length,fe=I.length,we={};++q<te;){var Ae=q<fe?I[q]:n;W(we,S[q],Ae)}return we}function Sb(S){return Go(S)?S:[]}function oL(S){return typeof S=="function"?S:Au}function jh(S,I){return Ti(S)?S:_n(S,I)?[S]:hR(Xr(S))}var EF=Oi;function Jf(S,I,W){var q=S.length;return W=W===n?q:W,!I&&W>=q?S:sl(S,I,W)}var GT=gF||function(S){return Fs.clearTimeout(S)};function XT(S,I){if(I)return S.slice();var W=S.length,q=IT?IT(W):new S.constructor(W);return S.copy(q),q}function Ow(S){var I=new S.constructor(S.byteLength);return new yw(I).set(new yw(S)),I}function IF(S,I){var W=I?Ow(S.buffer):S.buffer;return new S.constructor(W,S.byteOffset,S.byteLength)}function TF(S){var I=new S.constructor(S.source,yn.exec(S));return I.lastIndex=S.lastIndex,I}function RF(S){return Ac?Gr(Ac.call(S)):{}}function AF(S,I){var W=I?Ow(S.buffer):S.buffer;return new S.constructor(W,S.byteOffset,S.length)}function YT(S,I){if(S!==I){var W=S!==n,q=S===null,te=S===S,fe=Ad(S),we=I!==n,Ae=I===null,$e=I===I,Ct=Ad(I);if(!Ae&&!Ct&&!fe&&S>I||fe&&we&&$e&&!Ae&&!Ct||q&&we&&$e||!W&&$e||!te)return 1;if(!q&&!fe&&!Ct&&S<I||Ct&&W&&te&&!q&&!fe||Ae&&W&&te||!we&&te||!$e)return-1}return 0}function mH(S,I,W){for(var q=-1,te=S.criteria,fe=I.criteria,we=te.length,Ae=W.length;++q<we;){var $e=YT(te[q],fe[q]);if($e){if(q>=Ae)return $e;var Ct=W[q];return $e*(Ct=="desc"?-1:1)}}return S.index-I.index}function NF(S,I,W,q){for(var te=-1,fe=S.length,we=W.length,Ae=-1,$e=I.length,Ct=Io(fe-we,0),St=Qe($e+Ct),Tt=!q;++Ae<$e;)St[Ae]=I[Ae];for(;++te<we;)(Tt||te<fe)&&(St[W[te]]=S[te]);for(;Ct--;)St[Ae++]=S[te++];return St}function ZT(S,I,W,q){for(var te=-1,fe=S.length,we=-1,Ae=W.length,$e=-1,Ct=I.length,St=Io(fe-Ae,0),Tt=Qe(St+Ct),dn=!q;++te<St;)Tt[te]=S[te];for(var Rn=te;++$e<Ct;)Tt[Rn+$e]=I[$e];for(;++we<Ae;)(dn||te<fe)&&(Tt[Rn+W[we]]=S[te++]);return Tt}function xl(S,I){var W=-1,q=S.length;for(I||(I=Qe(q));++W<q;)I[W]=S[W];return I}function kd(S,I,W,q){var te=!W;W||(W={});for(var fe=-1,we=I.length;++fe<we;){var Ae=I[fe],$e=q?q(W[Ae],S[Ae],Ae,W,S):n;$e===n&&($e=S[Ae]),te?Mh(W,Ae,$e):I_(W,Ae,$e)}return W}function aL(S,I){return kd(S,Ld(S),I)}function _H(S,I){return kd(S,BF(S),I)}function lL(S,I){return function(W,q){var te=Ti(W)?_T:Nc,fe=I?I():{};return te(W,S,Zn(q,2),fe)}}function xb(S){return Oi(function(I,W){var q=-1,te=W.length,fe=te>1?W[te-1]:n,we=te>2?W[2]:n;for(fe=S.length>3&&typeof fe=="function"?(te--,fe):n,we&&Ll(W[0],W[1],we)&&(fe=te<3?n:fe,te=1),I=Gr(I);++q<te;){var Ae=W[q];Ae&&S(I,Ae,q,fe)}return I})}function Du(S,I){return function(W,q){if(W==null)return W;if(!Tu(W))return S(W,q);for(var te=W.length,fe=I?te:-1,we=Gr(W);(I?fe--:++fe<te)&&q(we[fe],fe,we)!==!1;);return W}}function cL(S){return function(I,W,q){for(var te=-1,fe=Gr(I),we=q(I),Ae=we.length;Ae--;){var $e=we[S?Ae:++te];if(W(fe[$e],$e,fe)===!1)break}return I}}function uL(S,I,W){var q=I&_,te=kb(S);function fe(){var we=this&&this!==Fs&&this instanceof fe?te:S;return we.apply(q?W:this,arguments)}return fe}function QT(S){return function(I){I=Xr(I);var W=rb(I)?Rc(I):n,q=W?W[0]:I.charAt(0),te=W?Jf(W,1).join(""):I.slice(1);return q[S]()+te}}function P_(S){return function(I){return yT(Due(Lue(I).replace(QV,"")),S,"")}}function kb(S){return function(){var I=arguments;switch(I.length){case 0:return new S;case 1:return new S(I[0]);case 2:return new S(I[0],I[1]);case 3:return new S(I[0],I[1],I[2]);case 4:return new S(I[0],I[1],I[2],I[3]);case 5:return new S(I[0],I[1],I[2],I[3],I[4]);case 6:return new S(I[0],I[1],I[2],I[3],I[4],I[5]);case 7:return new S(I[0],I[1],I[2],I[3],I[4],I[5],I[6])}var W=fb(S.prototype),q=S.apply(W,I);return yo(q)?q:W}}function JT(S,I,W){var q=kb(S);function te(){for(var fe=arguments.length,we=Qe(fe),Ae=fe,$e=ep(te);Ae--;)we[Ae]=arguments[Ae];var Ct=fe<3&&we[0]!==$e&&we[fe-1]!==$e?[]:vu(we,$e);if(fe-=Ct.length,fe<W)return kl(S,I,Lb,te.placeholder,n,we,Ct,n,n,W-fe);var St=this&&this!==Fs&&this instanceof te?q:S;return Cl(St,this,we)}return te}function O_(S){return function(I,W,q){var te=Gr(I);if(!Tu(I)){var fe=Zn(W,3);I=ol(I),W=function(Ae){return fe(te[Ae],Ae,te)}}var we=S(I,W,q);return we>-1?te[fe?I[we]:we]:n}}function dL(S){return $h(function(I){var W=I.length,q=W,te=el.prototype.thru;for(S&&I.reverse();q--;){var fe=I[q];if(typeof fe!="function")throw new bu(a);if(te&&!we&&Db(fe)=="wrapper")var we=new el([],!0)}for(q=we?q:W;++q<W;){fe=I[q];var Ae=Db(fe),$e=Ae=="wrapper"?pL(fe):n;$e&&Hw($e[0])&&$e[1]==(E|x|D|A)&&!$e[4].length&&$e[9]==1?we=we[Db($e[0])].apply(we,$e[3]):we=fe.length==1&&Hw(fe)?we[Ae]():we.thru(fe)}return function(){var Ct=arguments,St=Ct[0];if(we&&Ct.length==1&&Ti(St))return we.plant(St).value();for(var Tt=0,dn=W?I[Tt].apply(this,Ct):St;++Tt<W;)dn=I[Tt].call(this,dn);return dn}})}function Lb(S,I,W,q,te,fe,we,Ae,$e,Ct){var St=I&E,Tt=I&_,dn=I&b,Rn=I&(x|k),ui=I&M,zi=dn?n:kb(S);function di(){for(var tr=arguments.length,gr=Qe(tr),Nd=tr;Nd--;)gr[Nd]=arguments[Nd];if(Rn)var Fc=ep(di),Md=sF(gr,Fc);if(q&&(gr=NF(gr,q,te,Rn)),fe&&(gr=ZT(gr,fe,we,Rn)),tr-=Md,Rn&&tr<Ct){var Xo=vu(gr,Fc);return kl(S,I,Lb,di.placeholder,W,gr,Xo,Ae,$e,Ct-tr)}var rp=Tt?W:this,U_=dn?rp[S]:S;return tr=gr.length,Ae?gr=Dd(gr,Ae):ui&&tr>1&&gr.reverse(),St&&$e<tr&&(gr.length=$e),this&&this!==Fs&&this instanceof di&&(U_=zi||kb(U_)),U_.apply(rp,gr)}return di}function MF(S,I){return function(W,q){return Xf(W,S,I(q),{})}}function Fw(S,I){return function(W,q){var te;if(W===n&&q===n)return I;if(W!==n&&(te=W),q!==n){if(te===n)return q;typeof W=="string"||typeof q=="string"?(W=nc(W),q=nc(q)):(W=qT(W),q=qT(q)),te=S(W,q)}return te}}function hL(S){return $h(function(I){return I=hs(I,Tc(Zn())),Oi(function(W){var q=this;return S(I,function(te){return Cl(te,q,W)})})})}function Bw(S,I){I=I===n?" ":nc(I);var W=I.length;if(W<2)return W?N_(I,S):I;var q=N_(I,x_(S/C_(I)));return rb(I)?Jf(Rc(q),0,S).join(""):q.slice(0,S)}function PF(S,I,W,q){var te=I&_,fe=kb(S);function we(){for(var Ae=-1,$e=arguments.length,Ct=-1,St=q.length,Tt=Qe(St+$e),dn=this&&this!==Fs&&this instanceof we?fe:S;++Ct<St;)Tt[Ct]=q[Ct];for(;$e--;)Tt[Ct++]=arguments[++Ae];return Cl(dn,te?W:this,Tt)}return we}function eR(S){return function(I,W,q){return q&&typeof q!="number"&&Ll(I,W,q)&&(W=q=n),I=H_(I),W===n?(W=I,I=0):W=H_(W),q=q===n?I<W?1:-1:H_(q),Nw(I,W,q,S)}}function fL(S){return function(I,W){return typeof I=="string"&&typeof W=="string"||(I=Vh(I),W=Vh(W)),S(I,W)}}function kl(S,I,W,q,te,fe,we,Ae,$e,Ct){var St=I&x,Tt=St?we:n,dn=St?n:we,Rn=St?fe:n,ui=St?n:fe;I|=St?D:R,I&=~(St?R:D),I&y||(I&=-4);var zi=[S,I,te,Rn,Tt,ui,dn,Ae,$e,Ct],di=W.apply(n,zi);return Hw(S)&&uR(di,zi),di.placeholder=q,dR(di,S,I)}function Ma(S){var I=Eo[S];return function(W,q){if(W=Vh(W),q=q==null?0:Ja(Fi(q),292),q&&lb(W)){var te=(Xr(W)+"e").split("e"),fe=I(te[0]+"e"+(+te[1]+q));return te=(Xr(fe)+"e").split("e"),+(te[0]+"e"+(+te[1]-q))}return I(W)}}var OF=yg&&1/vg(new yg([,-0]))[1]==Y?function(S){return new yg(S)}:UH;function tR(S){return function(I){var W=Pa(I);return W==mt?Tk(I):W==ge?uH(I):aH(I,S(I))}}function Wh(S,I,W,q,te,fe,we,Ae){var $e=I&b;if(!$e&&typeof S!="function")throw new bu(a);var Ct=q?q.length:0;if(Ct||(I&=-97,q=te=n),we=we===n?we:Io(Fi(we),0),Ae=Ae===n?Ae:Fi(Ae),Ct-=te?te.length:0,I&R){var St=q,Tt=te;q=te=n}var dn=$e?n:pL(S),Rn=[S,I,W,q,te,St,Tt,fe,we,Ae];if(dn&&zF(Rn,dn),S=Rn[0],I=Rn[1],W=Rn[2],q=Rn[3],te=Rn[4],Ae=Rn[9]=Rn[9]===n?$e?0:S.length:Io(Rn[9]-Ct,0),!Ae&&I&(x|k)&&(I&=-25),!I||I==_)var ui=uL(S,I,W);else I==x||I==k?ui=JT(S,I,Ae):(I==D||I==(_|D))&&!te.length?ui=PF(S,I,W,q):ui=Lb.apply(n,Rn);var zi=dn?nL:uR;return dR(zi(ui,Rn),S,I)}function nR(S,I,W,q){return S===n||ip(S,Ih[W])&&!Sr.call(q,W)?I:S}function iR(S,I,W,q,te,fe){return yo(S)&&yo(I)&&(fe.set(I,S),A_(S,I,n,iR,fe),fe.delete(I)),S}function rR(S){return DR(S)?n:S}function sR(S,I,W,q,te,fe){var we=W&g,Ae=S.length,$e=I.length;if(Ae!=$e&&!(we&&$e>Ae))return!1;var Ct=fe.get(S),St=fe.get(I);if(Ct&&St)return Ct==I&&St==S;var Tt=-1,dn=!0,Rn=W&m?new L_:n;for(fe.set(S,I),fe.set(I,S);++Tt<Ae;){var ui=S[Tt],zi=I[Tt];if(q)var di=we?q(zi,ui,Tt,I,S,fe):q(ui,zi,Tt,S,I,fe);if(di!==n){if(di)continue;dn=!1;break}if(Rn){if(!wT(I,function(tr,gr){if(!zf(Rn,gr)&&(ui===tr||te(ui,tr,W,q,fe)))return Rn.push(gr)})){dn=!1;break}}else if(!(ui===zi||te(ui,zi,W,q,fe))){dn=!1;break}}return fe.delete(S),fe.delete(I),dn}function oR(S,I,W,q,te,fe,we){switch(W){case Ie:if(S.byteLength!=I.byteLength||S.byteOffset!=I.byteOffset)return!1;S=S.buffer,I=I.buffer;case Se:return!(S.byteLength!=I.byteLength||!fe(new yw(S),new yw(I)));case je:case qe:case Rt:return ip(+S,+I);case We:return S.name==I.name&&S.message==I.message;case Ce:case pe:return S==I+"";case mt:var Ae=Tk;case ge:var $e=q&g;if(Ae||(Ae=vg),S.size!=I.size&&!$e)return!1;var Ct=we.get(S);if(Ct)return Ct==I;q|=m,we.set(S,I);var St=sR(Ae(S),Ae(I),q,te,fe,we);return we.delete(S),St;case ne:if(Ac)return Ac.call(S)==Ac.call(I)}return!1}function FF(S,I,W,q,te,fe){var we=W&g,Ae=jw(S),$e=Ae.length,Ct=jw(I),St=Ct.length;if($e!=St&&!we)return!1;for(var Tt=$e;Tt--;){var dn=Ae[Tt];if(!(we?dn in I:Sr.call(I,dn)))return!1}var Rn=fe.get(S),ui=fe.get(I);if(Rn&&ui)return Rn==I&&ui==S;var zi=!0;fe.set(S,I),fe.set(I,S);for(var di=we;++Tt<$e;){dn=Ae[Tt];var tr=S[dn],gr=I[dn];if(q)var Nd=we?q(gr,tr,dn,I,S,fe):q(tr,gr,dn,S,I,fe);if(!(Nd===n?tr===gr||te(tr,gr,W,q,fe):Nd)){zi=!1;break}di||(di=dn=="constructor")}if(zi&&!di){var Fc=S.constructor,Md=I.constructor;Fc!=Md&&"constructor"in S&&"constructor"in I&&!(typeof Fc=="function"&&Fc instanceof Fc&&typeof Md=="function"&&Md instanceof Md)&&(zi=!1)}return fe.delete(S),fe.delete(I),zi}function $h(S){return Pc(vL(S,n,wL),S+"")}function jw(S){return Yk(S,ol,Ld)}function Ww(S){return Yk(S,Ru,BF)}var pL=$k?function(S){return $k.get(S)}:UH;function Db(S){for(var I=S.name+"",W=db[I],q=Sr.call(db,I)?W.length:0;q--;){var te=W[q],fe=te.func;if(fe==null||fe==S)return te.name}return I}function ep(S){var I=Sr.call(he,"placeholder")?he:S;return I.placeholder}function Zn(){var S=he.iteratee||VH;return S=S===VH?bb:S,arguments.length?S(arguments[0],arguments[1]):S}function $w(S,I){var W=S.__data__;return Eb(I)?W[typeof I=="string"?"string":"hash"]:W.map}function zw(S){for(var I=ol(S),W=I.length;W--;){var q=I[W],te=S[q];I[W]=[q,te,Uw(te)]}return I}function Ig(S,I){var W=ib(S,I);return BT(W)?W:n}function gL(S){var I=Sr.call(S,S_),W=S[S_];try{S[S_]=n;var q=!0}catch{}var te=vw.call(S);return q&&(I?S[S_]=W:delete S[S_]),te}var Ld=Bk?function(S){return S==null?[]:(S=Gr(S),mg(Bk(S),function(I){return Ok.call(S,I)}))}:qH,BF=Bk?function(S){for(var I=[];S;)_g(I,Ld(S)),S=Sd(S);return I}:qH,Pa=Na;(Sw&&Pa(new Sw(new ArrayBuffer(1)))!=Ie||k_&&Pa(new k_)!=mt||xw&&Pa(xw.resolve())!=vt||yg&&Pa(new yg)!=ge||kw&&Pa(new kw)!=ue)&&(Pa=function(S){var I=Na(S),W=I==Ot?S.constructor:n,q=W?Tg(W):"";if(q)switch(q){case AT:return Ie;case wg:return mt;case _F:return vt;case hb:return ge;case Th:return ue}return I});function aR(S,I,W){for(var q=-1,te=W.length;++q<te;){var fe=W[q],we=fe.size;switch(fe.type){case"drop":S+=we;break;case"dropRight":I-=we;break;case"take":I=Ja(I,S+we);break;case"takeRight":S=Io(S,I-we);break}}return{start:S,end:I}}function jF(S){var I=S.match(Cs);return I?I[1].split(_u):[]}function lR(S,I,W){I=jh(I,S);for(var q=-1,te=I.length,fe=!1;++q<te;){var we=Id(I[q]);if(!(fe=S!=null&&W(S,we)))break;S=S[we]}return fe||++q!=te?fe:(te=S==null?0:S.length,!!te&&s3(te)&&js(we,te)&&(Ti(S)||Jw(S)))}function Vw(S){var I=S.length,W=new S.constructor(I);return I&&typeof S[0]=="string"&&Sr.call(S,"index")&&(W.index=S.index,W.input=S.input),W}function Oa(S){return typeof S.constructor=="function"&&!tp(S)?fb(Sd(S)):{}}function vH(S,I,W){var q=S.constructor;switch(I){case Se:return Ow(S);case je:case qe:return new q(+S);case Ie:return IF(S,W);case nt:case Oe:case Ve:case gt:case $t:case Mt:case Bt:case jn:case Dt:return AF(S,W);case mt:return new q;case Rt:case pe:return new q(S);case Ce:return TF(S);case ge:return new q;case ne:return RF(S)}}function bH(S,I){var W=I.length;if(!W)return S;var q=W-1;return I[q]=(W>1?"& ":"")+I[q],I=I.join(W>2?", ":" "),S.replace(_o,`{
/* [wrapped with `+I+`] */
`)}function mL(S){return Ti(S)||Jw(S)||!!(pF&&S&&S[pF])}function js(S,I){var W=typeof S;return I=I??X,!!I&&(W=="number"||W!="symbol"&&En.test(S))&&S>-1&&S%1==0&&S<I}function Ll(S,I,W){if(!yo(W))return!1;var q=typeof I;return(q=="number"?Tu(W)&&js(I,W.length):q=="string"&&I in W)?ip(W[I],S):!1}function _n(S,I){if(Ti(S))return!1;var W=typeof S;return W=="number"||W=="symbol"||W=="boolean"||S==null||Ad(S)?!0:rn.test(S)||!hr.test(S)||I!=null&&S in Gr(I)}function Eb(S){var I=typeof S;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?S!=="__proto__":S===null}function Hw(S){var I=Db(S),W=he[I];if(typeof W!="function"||!(I in Ii.prototype))return!1;if(S===W)return!0;var q=pL(W);return!!q&&S===q[0]}function WF(S){return!!Nk&&Nk in S}var yH=ob?V_:KH;function tp(S){var I=S&&S.constructor,W=typeof I=="function"&&I.prototype||Ih;return S===W}function Uw(S){return S===S&&!yo(S)}function _L(S,I){return function(W){return W==null?!1:W[S]===I&&(I!==n||S in Gr(W))}}function $F(S){var I=Ge(S,function(q){return W.size===u&&W.clear(),q}),W=I.cache;return I}function zF(S,I){var W=S[1],q=I[1],te=W|q,fe=te<(_|b|E),we=q==E&&W==x||q==E&&W==A&&S[7].length<=I[8]||q==(E|A)&&I[7].length<=I[8]&&W==x;if(!(fe||we))return S;q&_&&(S[2]=I[2],te|=W&_?0:y);var Ae=I[3];if(Ae){var $e=S[3];S[3]=$e?NF($e,Ae,I[4]):Ae,S[4]=$e?vu(S[3],d):I[4]}return Ae=I[5],Ae&&($e=S[5],S[5]=$e?ZT($e,Ae,I[6]):Ae,S[6]=$e?vu(S[5],d):I[6]),Ae=I[7],Ae&&(S[7]=Ae),q&E&&(S[8]=S[8]==null?I[8]:Ja(S[8],I[8])),S[9]==null&&(S[9]=I[9]),S[0]=I[0],S[1]=te,S}function VF(S){var I=[];if(S!=null)for(var W in Gr(S))I.push(W);return I}function cR(S){return vw.call(S)}function vL(S,I,W){return I=Io(I===n?S.length-1:I,0),function(){for(var q=arguments,te=-1,fe=Io(q.length-I,0),we=Qe(fe);++te<fe;)we[te]=q[I+te];te=-1;for(var Ae=Qe(I+1);++te<I;)Ae[te]=q[te];return Ae[I]=W(we),Cl(S,this,Ae)}}function _a(S,I){return I.length<2?S:Gf(S,sl(I,0,-1))}function Dd(S,I){for(var W=S.length,q=Ja(I.length,W),te=xl(S);q--;){var fe=I[q];S[q]=js(fe,W)?te[fe]:n}return S}function zh(S,I){if(!(I==="constructor"&&typeof S[I]=="function")&&I!="__proto__")return S[I]}var uR=Ed(nL),Ib=TT||function(S,I){return Fs.setTimeout(S,I)},Pc=Ed(Bh);function dR(S,I,W){var q=I+"";return Pc(S,bH(q,HF(jF(q),W)))}function Ed(S){var I=0,W=0;return function(){var q=gH(),te=B-(q-W);if(W=q,te>0){if(++I>=O)return arguments[0]}else I=0;return S.apply(n,arguments)}}function bL(S,I){var W=-1,q=S.length,te=q-1;for(I=I===n?q:I;++W<I;){var fe=yb(W,te),we=S[fe];S[fe]=S[W],S[W]=we}return S.length=I,S}var hR=$F(function(S){var I=[];return S.charCodeAt(0)===46&&I.push(""),S.replace(sn,function(W,q,te,fe){I.push(te?fe.replace(Ks,"$1"):q||W)}),I});function Id(S){if(typeof S=="string"||Ad(S))return S;var I=S+"";return I=="0"&&1/S==-Y?"-0":I}function Tg(S){if(S!=null){try{return _w.call(S)}catch{}try{return S+""}catch{}}return""}function HF(S,I){return Qa(ke,function(W){var q="_."+W[0];I&W[1]&&!Dk(S,q)&&S.push(q)}),S.sort()}function UF(S){if(S instanceof Ii)return S.clone();var I=new el(S.__wrapped__,S.__chain__);return I.__actions__=xl(S.__actions__),I.__index__=S.__index__,I.__values__=S.__values__,I}function yL(S,I,W){(W?Ll(S,I,W):I===n)?I=1:I=Io(Fi(I),0);var q=S==null?0:S.length;if(!q||I<1)return[];for(var te=0,fe=0,we=Qe(x_(q/I));te<q;)we[fe++]=sl(S,te,te+=I);return we}function fR(S){for(var I=-1,W=S==null?0:S.length,q=0,te=[];++I<W;){var fe=S[I];fe&&(te[q++]=fe)}return te}function Eu(){var S=arguments.length;if(!S)return[];for(var I=Qe(S-1),W=arguments[0],q=S;q--;)I[q-1]=arguments[q];return _g(Ti(W)?xl(W):[W],oo(I,1))}var pr=Oi(function(S,I){return Go(S)?Ph(S,oo(I,1,Go,!0)):[]}),va=Oi(function(S,I){var W=Dl(I);return Go(W)&&(W=n),Go(S)?Ph(S,oo(I,1,Go,!0),Zn(W,2)):[]}),To=Oi(function(S,I){var W=Dl(I);return Go(W)&&(W=n),Go(S)?Ph(S,oo(I,1,Go,!0),n,W):[]});function Fa(S,I,W){var q=S==null?0:S.length;return q?(I=W||I===n?1:Fi(I),sl(S,I<0?0:I,q)):[]}function Oc(S,I,W){var q=S==null?0:S.length;return q?(I=W||I===n?1:Fi(I),I=q-I,sl(S,0,I<0?0:I)):[]}function Tb(S,I){return S&&S.length?Mw(S,Zn(I,3),!0,!0):[]}function Ko(S,I){return S&&S.length?Mw(S,Zn(I,3),!0):[]}function qw(S,I,W,q){var te=S==null?0:S.length;return te?(W&&typeof W!="number"&&Ll(S,I,W)&&(W=0,q=te),kF(S,I,W,q)):[]}function Rg(S,I,W){var q=S==null?0:S.length;if(!q)return-1;var te=W==null?0:Fi(W);return te<0&&(te=Io(q+te,0)),Ek(S,Zn(I,3),te)}function Kw(S,I,W){var q=S==null?0:S.length;if(!q)return-1;var te=q-1;return W!==n&&(te=Fi(W),te=W<0?Io(q+te,0):Ja(te,q-1)),Ek(S,Zn(I,3),te,!0)}function wL(S){var I=S==null?0:S.length;return I?oo(S,1):[]}function Gw(S){var I=S==null?0:S.length;return I?oo(S,Y):[]}function ic(S,I){var W=S==null?0:S.length;return W?(I=I===n?1:Fi(I),oo(S,I)):[]}function pR(S){for(var I=-1,W=S==null?0:S.length,q={};++I<W;){var te=S[I];q[te[0]]=te[1]}return q}function F_(S){return S&&S.length?S[0]:n}function np(S,I,W){var q=S==null?0:S.length;if(!q)return-1;var te=W==null?0:Fi(W);return te<0&&(te=Io(q+te,0)),nb(S,I,te)}function CL(S){var I=S==null?0:S.length;return I?sl(S,0,-1):[]}var gR=Oi(function(S){var I=hs(S,Sb);return I.length&&I[0]===S[0]?Zk(I):[]}),Ag=Oi(function(S){var I=Dl(S),W=hs(S,Sb);return I===Dl(W)?I=n:W.pop(),W.length&&W[0]===S[0]?Zk(W,Zn(I,2)):[]}),SL=Oi(function(S){var I=Dl(S),W=hs(S,Sb);return I=typeof I=="function"?I:n,I&&W.pop(),W.length&&W[0]===S[0]?Zk(W,n,I):[]});function Ng(S,I){return S==null?"":jk.call(S,I)}function Dl(S){var I=S==null?0:S.length;return I?S[I-1]:n}function Xw(S,I,W){var q=S==null?0:S.length;if(!q)return-1;var te=q;return W!==n&&(te=Fi(W),te=te<0?Io(q+te,0):Ja(te,q-1)),I===I?dH(S,I,te):Ek(S,eF,te,!0)}function mR(S,I){return S&&S.length?tL(S,Fi(I)):n}var xL=Oi(Yw);function Yw(S,I){return S&&S.length&&I&&I.length?vo(S,I):S}function El(S,I,W){return S&&S.length&&I&&I.length?vo(S,I,Zn(W,2)):S}function Mg(S,I,W){return S&&S.length&&I&&I.length?vo(S,I,n,W):S}var Td=$h(function(S,I){var W=S==null?0:S.length,q=Gk(S,I);return qo(S,hs(I,function(te){return js(te,W)?+te:te}).sort(YT)),q});function rc(S,I){var W=[];if(!(S&&S.length))return W;var q=-1,te=[],fe=S.length;for(I=Zn(I,3);++q<fe;){var we=S[q];I(we,q,S)&&(W.push(we),te.push(q))}return qo(S,te),W}function kL(S){return S==null?S:Wk.call(S)}function _R(S,I,W){var q=S==null?0:S.length;return q?(W&&typeof W!="number"&&Ll(S,I,W)?(I=0,W=q):(I=I==null?0:Fi(I),W=W===n?q:Fi(W)),sl(S,I,W)):[]}function vR(S,I){return wb(S,I)}function wH(S,I,W){return iL(S,I,Zn(W,2))}function Pg(S,I){var W=S==null?0:S.length;if(W){var q=wb(S,I);if(q<W&&ip(S[q],I))return q}return-1}function qF(S,I){return wb(S,I,!0)}function bR(S,I,W){return iL(S,I,Zn(W,2),!0)}function B_(S,I){var W=S==null?0:S.length;if(W){var q=wb(S,I,!0)-1;if(ip(S[q],I))return q}return-1}function yR(S){return S&&S.length?UT(S):[]}function j_(S,I){return S&&S.length?UT(S,Zn(I,2)):[]}function KF(S){var I=S==null?0:S.length;return I?sl(S,1,I):[]}function GF(S,I,W){return S&&S.length?(I=W||I===n?1:Fi(I),sl(S,0,I<0?0:I)):[]}function wR(S,I,W){var q=S==null?0:S.length;return q?(I=W||I===n?1:Fi(I),I=q-I,sl(S,I<0?0:I,q)):[]}function LL(S,I){return S&&S.length?Mw(S,Zn(I,3),!1,!0):[]}function CH(S,I){return S&&S.length?Mw(S,Zn(I,3)):[]}var SH=Oi(function(S){return Qf(oo(S,1,Go,!0))}),XF=Oi(function(S){var I=Dl(S);return Go(I)&&(I=n),Qf(oo(S,1,Go,!0),Zn(I,2))}),YF=Oi(function(S){var I=Dl(S);return I=typeof I=="function"?I:n,Qf(oo(S,1,Go,!0),n,I)});function W_(S){return S&&S.length?Qf(S):[]}function xH(S,I){return S&&S.length?Qf(S,Zn(I,2)):[]}function Rb(S,I){return I=typeof I=="function"?I:n,S&&S.length?Qf(S,n,I):[]}function DL(S){if(!(S&&S.length))return[];var I=0;return S=mg(S,function(W){if(Go(W))return I=Io(W.length,I),!0}),kT(I,function(W){return hs(S,ST(W))})}function Xs(S,I){if(!(S&&S.length))return[];var W=DL(S);return I==null?W:hs(W,function(q){return Cl(I,n,q)})}var kH=Oi(function(S,I){return Go(S)?Ph(S,I):[]}),ZF=Oi(function(S){return sL(mg(S,Go))}),LH=Oi(function(S){var I=Dl(S);return Go(I)&&(I=n),sL(mg(S,Go),Zn(I,2))}),DH=Oi(function(S){var I=Dl(S);return I=typeof I=="function"?I:n,sL(mg(S,Go),n,I)}),QF=Oi(DL);function JF(S,I){return Pw(S||[],I||[],I_)}function EH(S,I){return Pw(S||[],I||[],M_)}var Iu=Oi(function(S){var I=S.length,W=I>1?S[I-1]:n;return W=typeof W=="function"?(S.pop(),W):n,Xs(S,W)});function EL(S){var I=he(S);return I.__chain__=!0,I}function IH(S,I){return I(S),S}function Rd(S,I){return I(S)}var IL=$h(function(S){var I=S.length,W=I?S[0]:0,q=this.__wrapped__,te=function(fe){return Gk(fe,S)};return I>1||this.__actions__.length||!(q instanceof Ii)||!js(W)?this.thru(te):(q=q.slice(W,+W+(I?1:0)),q.__actions__.push({func:Rd,args:[te],thisArg:n}),new el(q,this.__chain__).thru(function(fe){return I&&!fe.length&&fe.push(n),fe}))});function $_(){return EL(this)}function TL(){return new el(this.value(),this.__chain__)}function CR(){this.__values__===n&&(this.__values__=_ue(this.value()));var S=this.__index__>=this.__values__.length,I=S?n:this.__values__[this.__index__++];return{done:S,value:I}}function SR(){return this}function TH(S){for(var I,W=this;W instanceof Rh;){var q=UF(W);q.__index__=0,q.__values__=n,I?te.__wrapped__=q:I=q;var te=q;W=W.__wrapped__}return te.__wrapped__=S,I}function xR(){var S=this.__wrapped__;if(S instanceof Ii){var I=S;return this.__actions__.length&&(I=new Ii(this)),I=I.reverse(),I.__actions__.push({func:Rd,args:[kL],thisArg:n}),new el(I,this.__chain__)}return this.thru(kL)}function RH(){return Cb(this.__wrapped__,this.__actions__)}var e3=lL(function(S,I,W){Sr.call(S,W)?++S[W]:Mh(S,W,1)});function t3(S,I,W){var q=Ti(S)?vT:Ew;return W&&Ll(S,I,W)&&(I=n),q(S,Zn(I,3))}function RL(S,I){var W=Ti(S)?mg:OT;return W(S,Zn(I,3))}var AL=O_(Rg),n3=O_(Kw);function kR(S,I){return oo(z_(S,I),1)}function AH(S,I){return oo(z_(S,I),Y)}function i3(S,I,W){return W=W===n?1:Fi(W),oo(z_(S,I),W)}function NL(S,I){var W=Ti(S)?Qa:Oh;return W(S,Zn(I,3))}function Zw(S,I){var W=Ti(S)?Lk:xF;return W(S,Zn(I,3))}var LR=lL(function(S,I,W){Sr.call(S,W)?S[W].push(I):Mh(S,W,[I])});function ML(S,I,W,q){S=Tu(S)?S:FL(S),W=W&&!q?Fi(W):0;var te=S.length;return W<0&&(W=Io(te+W,0)),o3(S)?W<=te&&S.indexOf(I,W)>-1:!!te&&nb(S,I,W)>-1}var r3=Oi(function(S,I,W){var q=-1,te=typeof I=="function",fe=Tu(S)?Qe(S.length):[];return Oh(S,function(we){fe[++q]=te?Cl(I,we,W):xu(we,I,W)}),fe}),NH=lL(function(S,I,W){Mh(S,W,I)});function z_(S,I){var W=Ti(S)?hs:WT;return W(S,Zn(I,3))}function MH(S,I,W,q){return S==null?[]:(Ti(I)||(I=I==null?[]:[I]),W=q?n:W,Ti(W)||(W=W==null?[]:[W]),Aw(S,I,W))}var Qw=lL(function(S,I,W){S[W?0:1].push(I)},function(){return[[],[]]});function PH(S,I,W){var q=Ti(S)?yT:nF,te=arguments.length<3;return q(S,Zn(I,4),W,te,Oh)}function PL(S,I,W){var q=Ti(S)?iH:nF,te=arguments.length<3;return q(S,Zn(I,4),W,te,xF)}function v(S,I){var W=Ti(S)?mg:OT;return W(S,Wt(Zn(I,3)))}function w(S){var I=Ti(S)?Nh:rl;return I(S)}function T(S,I,W){(W?Ll(S,I,W):I===n)?I=1:I=Fi(I);var q=Ti(S)?E_:VT;return q(S,I)}function F(S){var I=Ti(S)?CF:Lu;return I(S)}function V(S){if(S==null)return 0;if(Tu(S))return o3(S)?C_(S):S.length;var I=Pa(S);return I==mt||I==ge?S.size:Zf(S).length}function U(S,I,W){var q=Ti(S)?wT:HT;return W&&Ll(S,I,W)&&(I=n),q(S,Zn(I,3))}var re=Oi(function(S,I){if(S==null)return[];var W=I.length;return W>1&&Ll(S,I[0],I[1])?I=[]:W>2&&Ll(I[0],I[1],I[2])&&(I=[I[0]]),Aw(S,oo(I,1),[])}),be=Ss||function(){return Fs.Date.now()};function Re(S,I){if(typeof I!="function")throw new bu(a);return S=Fi(S),function(){if(--S<1)return I.apply(this,arguments)}}function et(S,I,W){return I=W?n:I,I=S&&I==null?S.length:I,Wh(S,E,n,n,n,n,I)}function It(S,I){var W;if(typeof I!="function")throw new bu(a);return S=Fi(S),function(){return--S>0&&(W=I.apply(this,arguments)),S<=1&&(I=n),W}}var Nt=Oi(function(S,I,W){var q=_;if(W.length){var te=vu(W,ep(Nt));q|=D}return Wh(S,q,I,W,te)}),Lt=Oi(function(S,I,W){var q=_|b;if(W.length){var te=vu(W,ep(Lt));q|=D}return Wh(I,q,S,W,te)});function pn(S,I,W){I=W?n:I;var q=Wh(S,x,n,n,n,n,n,I);return q.placeholder=pn.placeholder,q}function Cn(S,I,W){I=W?n:I;var q=Wh(S,k,n,n,n,n,n,I);return q.placeholder=Cn.placeholder,q}function Dn(S,I,W){var q,te,fe,we,Ae,$e,Ct=0,St=!1,Tt=!1,dn=!0;if(typeof S!="function")throw new bu(a);I=Vh(I)||0,yo(W)&&(St=!!W.leading,Tt="maxWait"in W,fe=Tt?Io(Vh(W.maxWait)||0,I):fe,dn="trailing"in W?!!W.trailing:dn);function Rn(Xo){var rp=q,U_=te;return q=te=n,Ct=Xo,we=S.apply(U_,rp),we}function ui(Xo){return Ct=Xo,Ae=Ib(tr,I),St?Rn(Xo):we}function zi(Xo){var rp=Xo-$e,U_=Xo-Ct,Tue=I-rp;return Tt?Ja(Tue,fe-U_):Tue}function di(Xo){var rp=Xo-$e,U_=Xo-Ct;return $e===n||rp>=I||rp<0||Tt&&U_>=fe}function tr(){var Xo=be();if(di(Xo))return gr(Xo);Ae=Ib(tr,zi(Xo))}function gr(Xo){return Ae=n,dn&&q?Rn(Xo):(q=te=n,we)}function Nd(){Ae!==n&&GT(Ae),Ct=0,q=$e=te=Ae=n}function Fc(){return Ae===n?we:gr(be())}function Md(){var Xo=be(),rp=di(Xo);if(q=arguments,te=this,$e=Xo,rp){if(Ae===n)return ui($e);if(Tt)return GT(Ae),Ae=Ib(tr,I),Rn($e)}return Ae===n&&(Ae=Ib(tr,I)),we}return Md.cancel=Nd,Md.flush=Fc,Md}var bo=Oi(function(S,I){return PT(S,1,I)}),Ke=Oi(function(S,I,W){return PT(S,Vh(I)||0,W)});function Me(S){return Wh(S,M)}function Ge(S,I){if(typeof S!="function"||I!=null&&typeof I!="function")throw new bu(a);var W=function(){var q=arguments,te=I?I.apply(this,q):q[0],fe=W.cache;if(fe.has(te))return fe.get(te);var we=S.apply(this,q);return W.cache=fe.set(te,we)||fe,we};return W.cache=new(Ge.Cache||yu),W}Ge.Cache=yu;function Wt(S){if(typeof S!="function")throw new bu(a);return function(){var I=arguments;switch(I.length){case 0:return!S.call(this);case 1:return!S.call(this,I[0]);case 2:return!S.call(this,I[0],I[1]);case 3:return!S.call(this,I[0],I[1],I[2])}return!S.apply(this,I)}}function In(S){return It(2,S)}var Gn=EF(function(S,I){I=I.length==1&&Ti(I[0])?hs(I[0],Tc(Zn())):hs(oo(I,1),Tc(Zn()));var W=I.length;return Oi(function(q){for(var te=-1,fe=Ja(q.length,W);++te<fe;)q[te]=I[te].call(this,q[te]);return Cl(S,this,q)})}),zn=Oi(function(S,I){var W=vu(I,ep(zn));return Wh(S,D,n,I,W)}),ci=Oi(function(S,I){var W=vu(I,ep(ci));return Wh(S,R,n,I,W)}),ba=$h(function(S,I){return Wh(S,A,n,n,n,I)});function xr(S,I){if(typeof S!="function")throw new bu(a);return I=I===n?I:Fi(I),Oi(S,I)}function Og(S,I){if(typeof S!="function")throw new bu(a);return I=I==null?0:Io(Fi(I),0),Oi(function(W){var q=W[I],te=Jf(W,0,I);return q&&_g(te,q),Cl(S,this,te)})}function OH(S,I,W){var q=!0,te=!0;if(typeof S!="function")throw new bu(a);return yo(W)&&(q="leading"in W?!!W.leading:q,te="trailing"in W?!!W.trailing:te),Dn(S,I,{leading:q,maxWait:I,trailing:te})}function T6e(S){return et(S,1)}function R6e(S,I){return zn(oL(I),S)}function A6e(){if(!arguments.length)return[];var S=arguments[0];return Ti(S)?S:[S]}function N6e(S){return tc(S,p)}function M6e(S,I){return I=typeof I=="function"?I:n,tc(S,p,I)}function P6e(S){return tc(S,h|p)}function O6e(S,I){return I=typeof I=="function"?I:n,tc(S,h|p,I)}function F6e(S,I){return I==null||Dw(S,I,ol(I))}function ip(S,I){return S===I||S!==S&&I!==I}var B6e=fL(Lg),j6e=fL(function(S,I){return S>=I}),Jw=Qk(function(){return arguments}())?Qk:function(S){return Ro(S)&&Sr.call(S,"callee")&&!Ok.call(S,"callee")},Ti=Qe.isArray,W6e=mT?Tc(mT):LF;function Tu(S){return S!=null&&s3(S.length)&&!V_(S)}function Go(S){return Ro(S)&&Tu(S)}function $6e(S){return S===!0||S===!1||Ro(S)&&Na(S)==je}var Ab=RT||KH,z6e=Zl?Tc(Zl):Yf;function V6e(S){return Ro(S)&&S.nodeType===1&&!DR(S)}function H6e(S){if(S==null)return!0;if(Tu(S)&&(Ti(S)||typeof S=="string"||typeof S.splice=="function"||Ab(S)||OL(S)||Jw(S)))return!S.length;var I=Pa(S);if(I==mt||I==ge)return!S.size;if(tp(S))return!Zf(S).length;for(var W in S)if(Sr.call(S,W))return!1;return!0}function U6e(S,I){return ku(S,I)}function q6e(S,I,W){W=typeof W=="function"?W:n;var q=W?W(S,I):n;return q===n?ku(S,I,n,W):!!q}function FH(S){if(!Ro(S))return!1;var I=Na(S);return I==We||I==Ze||typeof S.message=="string"&&typeof S.name=="string"&&!DR(S)}function K6e(S){return typeof S=="number"&&lb(S)}function V_(S){if(!yo(S))return!1;var I=Na(S);return I==ut||I==st||I==Ee||I==wn}function fue(S){return typeof S=="number"&&S==Fi(S)}function s3(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=X}function yo(S){var I=typeof S;return S!=null&&(I=="object"||I=="function")}function Ro(S){return S!=null&&typeof S=="object"}var pue=w_?Tc(w_):DF;function G6e(S,I){return S===I||vb(S,I,zw(I))}function X6e(S,I,W){return W=typeof W=="function"?W:n,vb(S,I,zw(I),W)}function Y6e(S){return gue(S)&&S!=+S}function Z6e(S){if(yH(S))throw new vi(o);return BT(S)}function Q6e(S){return S===null}function J6e(S){return S==null}function gue(S){return typeof S=="number"||Ro(S)&&Na(S)==Rt}function DR(S){if(!Ro(S)||Na(S)!=Ot)return!1;var I=Sd(S);if(I===null)return!0;var W=Sr.call(I,"constructor")&&I.constructor;return typeof W=="function"&&W instanceof W&&_w.call(W)==Mk}var BH=kk?Tc(kk):Tw;function eBe(S){return fue(S)&&S>=-X&&S<=X}var mue=tb?Tc(tb):Fh;function o3(S){return typeof S=="string"||!Ti(S)&&Ro(S)&&Na(S)==pe}function Ad(S){return typeof S=="symbol"||Ro(S)&&Na(S)==ne}var OL=Z4?Tc(Z4):Rw;function tBe(S){return S===n}function nBe(S){return Ro(S)&&Pa(S)==ue}function iBe(S){return Ro(S)&&Na(S)==de}var rBe=fL(Dg),sBe=fL(function(S,I){return S<=I});function _ue(S){if(!S)return[];if(Tu(S))return o3(S)?Rc(S):xl(S);if(Uf&&S[Uf])return cH(S[Uf]());var I=Pa(S),W=I==mt?Tk:I==ge?vg:FL;return W(S)}function H_(S){if(!S)return S===0?S:0;if(S=Vh(S),S===Y||S===-Y){var I=S<0?-1:1;return I*Q}return S===S?S:0}function Fi(S){var I=H_(S),W=I%1;return I===I?W?I-W:I:0}function vue(S){return S?Kf(Fi(S),0,K):0}function Vh(S){if(typeof S=="number")return S;if(Ad(S))return ie;if(yo(S)){var I=typeof S.valueOf=="function"?S.valueOf():S;S=yo(I)?I+"":I}if(typeof S!="string")return S===0?S:+S;S=iF(S);var W=De.test(S);return W||At.test(S)?Sk(S.slice(2),W?2:8):Pe.test(S)?ie:+S}function bue(S){return kd(S,Ru(S))}function oBe(S){return S?Kf(Fi(S),-X,X):S===0?S:0}function Xr(S){return S==null?"":nc(S)}var aBe=xb(function(S,I){if(tp(I)||Tu(I)){kd(I,ol(I),S);return}for(var W in I)Sr.call(I,W)&&I_(S,W,I[W])}),yue=xb(function(S,I){kd(I,Ru(I),S)}),a3=xb(function(S,I,W,q){kd(I,Ru(I),S,q)}),lBe=xb(function(S,I,W,q){kd(I,ol(I),S,q)}),cBe=$h(Gk);function uBe(S,I){var W=fb(S);return I==null?W:ks(W,I)}var dBe=Oi(function(S,I){S=Gr(S);var W=-1,q=I.length,te=q>2?I[2]:n;for(te&&Ll(I[0],I[1],te)&&(q=1);++W<q;)for(var fe=I[W],we=Ru(fe),Ae=-1,$e=we.length;++Ae<$e;){var Ct=we[Ae],St=S[Ct];(St===n||ip(St,Ih[Ct])&&!Sr.call(S,Ct))&&(S[Ct]=fe[Ct])}return S}),hBe=Oi(function(S){return S.push(n,iR),Cl(wue,n,S)});function fBe(S,I){return J4(S,Zn(I,3),Mc)}function pBe(S,I){return J4(S,Zn(I,3),kg)}function gBe(S,I){return S==null?S:Xk(S,Zn(I,3),Ru)}function mBe(S,I){return S==null?S:Iw(S,Zn(I,3),Ru)}function _Be(S,I){return S&&Mc(S,Zn(I,3))}function vBe(S,I){return S&&kg(S,Zn(I,3))}function bBe(S){return S==null?[]:_b(S,ol(S))}function yBe(S){return S==null?[]:_b(S,Ru(S))}function jH(S,I,W){var q=S==null?n:Gf(S,I);return q===n?W:q}function wBe(S,I){return S!=null&&lR(S,I,Su)}function WH(S,I){return S!=null&&lR(S,I,R_)}var CBe=MF(function(S,I,W){I!=null&&typeof I.toString!="function"&&(I=vw.call(I)),S[I]=W},zH(Au)),SBe=MF(function(S,I,W){I!=null&&typeof I.toString!="function"&&(I=vw.call(I)),Sr.call(S,I)?S[I].push(W):S[I]=[W]},Zn),xBe=Oi(xu);function ol(S){return Tu(S)?Ah(S):Zf(S)}function Ru(S){return Tu(S)?Ah(S,!0):jT(S)}function kBe(S,I){var W={};return I=Zn(I,3),Mc(S,function(q,te,fe){Mh(W,I(q,te,fe),q)}),W}function LBe(S,I){var W={};return I=Zn(I,3),Mc(S,function(q,te,fe){Mh(W,te,I(q,te,fe))}),W}var DBe=xb(function(S,I,W){A_(S,I,W)}),wue=xb(function(S,I,W,q){A_(S,I,W,q)}),EBe=$h(function(S,I){var W={};if(S==null)return W;var q=!1;I=hs(I,function(fe){return fe=jh(fe,S),q||(q=fe.length>1),fe}),kd(S,Ww(S),W),q&&(W=tc(W,h|f|p,rR));for(var te=I.length;te--;)rL(W,I[te]);return W});function IBe(S,I){return Cue(S,Wt(Zn(I)))}var TBe=$h(function(S,I){return S==null?{}:zT(S,I)});function Cue(S,I){if(S==null)return{};var W=hs(Ww(S),function(q){return[q]});return I=Zn(I),Eg(S,W,function(q,te){return I(q,te[0])})}function RBe(S,I,W){I=jh(I,S);var q=-1,te=I.length;for(te||(te=1,S=n);++q<te;){var fe=S==null?n:S[Id(I[q])];fe===n&&(q=te,fe=W),S=V_(fe)?fe.call(S):fe}return S}function ABe(S,I,W){return S==null?S:M_(S,I,W)}function NBe(S,I,W,q){return q=typeof q=="function"?q:n,S==null?S:M_(S,I,W,q)}var Sue=tR(ol),xue=tR(Ru);function MBe(S,I,W){var q=Ti(S),te=q||Ab(S)||OL(S);if(I=Zn(I,4),W==null){var fe=S&&S.constructor;te?W=q?new fe:[]:yo(S)?W=V_(fe)?fb(Sd(S)):{}:W={}}return(te?Qa:Mc)(S,function(we,Ae,$e){return I(W,we,Ae,$e)}),W}function PBe(S,I){return S==null?!0:rL(S,I)}function OBe(S,I,W){return S==null?S:KT(S,I,oL(W))}function FBe(S,I,W,q){return q=typeof q=="function"?q:n,S==null?S:KT(S,I,oL(W),q)}function FL(S){return S==null?[]:gw(S,ol(S))}function BBe(S){return S==null?[]:gw(S,Ru(S))}function jBe(S,I,W){return W===n&&(W=I,I=n),W!==n&&(W=Vh(W),W=W===W?W:0),I!==n&&(I=Vh(I),I=I===I?I:0),Kf(Vh(S),I,W)}function WBe(S,I,W){return I=H_(I),W===n?(W=I,I=0):W=H_(W),S=Vh(S),FT(S,I,W)}function $Be(S,I,W){if(W&&typeof W!="boolean"&&Ll(S,I,W)&&(I=W=n),W===n&&(typeof I=="boolean"?(W=I,I=n):typeof S=="boolean"&&(W=S,S=n)),S===n&&I===n?(S=0,I=1):(S=H_(S),I===n?(I=S,S=0):I=H_(I)),S>I){var q=S;S=I,I=q}if(W||S%1||I%1){var te=Cw();return Ja(S+te*(I-S+pT("1e-"+((te+"").length-1))),I)}return yb(S,I)}var zBe=P_(function(S,I,W){return I=I.toLowerCase(),S+(W?kue(I):I)});function kue(S){return $H(Xr(S).toLowerCase())}function Lue(S){return S=Xr(S),S&&S.replace(bn,oF).replace(K4,"")}function VBe(S,I,W){S=Xr(S),I=nc(I);var q=S.length;W=W===n?q:Kf(Fi(W),0,q);var te=W;return W-=I.length,W>=0&&S.slice(W,te)==I}function HBe(S){return S=Xr(S),S&&ds.test(S)?S.replace(ti,aF):S}function UBe(S){return S=Xr(S),S&&ai.test(S)?S.replace(Kn,"\\$&"):S}var qBe=P_(function(S,I,W){return S+(W?"-":"")+I.toLowerCase()}),KBe=P_(function(S,I,W){return S+(W?" ":"")+I.toLowerCase()}),GBe=QT("toLowerCase");function XBe(S,I,W){S=Xr(S),I=Fi(I);var q=I?C_(S):0;if(!I||q>=I)return S;var te=(I-q)/2;return Bw(bg(te),W)+S+Bw(x_(te),W)}function YBe(S,I,W){S=Xr(S),I=Fi(I);var q=I?C_(S):0;return I&&q<I?S+Bw(I-q,W):S}function ZBe(S,I,W){S=Xr(S),I=Fi(I);var q=I?C_(S):0;return I&&q<I?Bw(I-q,W)+S:S}function QBe(S,I,W){return W||I==null?I=0:I&&(I=+I),mF(Xr(S).replace(Ki,""),I||0)}function JBe(S,I,W){return(W?Ll(S,I,W):I===n)?I=1:I=Fi(I),N_(Xr(S),I)}function e8e(){var S=arguments,I=Xr(S[0]);return S.length<3?I:I.replace(S[1],S[2])}var t8e=P_(function(S,I,W){return S+(W?"_":"")+I.toLowerCase()});function n8e(S,I,W){return W&&typeof W!="number"&&Ll(S,I,W)&&(I=W=n),W=W===n?K:W>>>0,W?(S=Xr(S),S&&(typeof I=="string"||I!=null&&!BH(I))&&(I=nc(I),!I&&rb(S))?Jf(Rc(S),0,W):S.split(I,W)):[]}var i8e=P_(function(S,I,W){return S+(W?" ":"")+$H(I)});function r8e(S,I,W){return S=Xr(S),W=W==null?0:Kf(Fi(W),0,S.length),I=nc(I),S.slice(W,W+I.length)==I}function s8e(S,I,W){var q=he.templateSettings;W&&Ll(S,I,W)&&(I=n),S=Xr(S),I=a3({},I,q,nR);var te=a3({},I.imports,q.imports,nR),fe=ol(te),we=gw(te,fe),Ae,$e,Ct=0,St=I.interpolate||Yn,Tt="__p += '",dn=mw((I.escape||Yn).source+"|"+St.source+"|"+(St===Mn?ma:Yn).source+"|"+(I.evaluate||Yn).source+"|$","g"),Rn="//# sourceURL="+(Sr.call(I,"sourceURL")?(I.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eH+"]")+`
`;S.replace(dn,function(di,tr,gr,Nd,Fc,Md){return gr||(gr=Nd),Tt+=S.slice(Ct,Md).replace(fr,lF),tr&&(Ae=!0,Tt+=`' +
__e(`+tr+`) +
'`),Fc&&($e=!0,Tt+=`';
`+Fc+`;
__p += '`),gr&&(Tt+=`' +
((__t = (`+gr+`)) == null ? '' : __t) +
'`),Ct=Md+di.length,di}),Tt+=`';
`;var ui=Sr.call(I,"variable")&&I.variable;if(!ui)Tt=`with (obj) {
`+Tt+`
}
`;else if(qs.test(ui))throw new vi(l);Tt=($e?Tt.replace(Fn,""):Tt).replace(tn,"$1").replace(pi,"$1;"),Tt="function("+(ui||"obj")+`) {
`+(ui?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Ae?", __e = _.escape":"")+($e?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Tt+`return __p
}`;var zi=Eue(function(){return Cr(fe,Rn+"return "+Tt).apply(n,we)});if(zi.source=Tt,FH(zi))throw zi;return zi}function o8e(S){return Xr(S).toLowerCase()}function a8e(S){return Xr(S).toUpperCase()}function l8e(S,I,W){if(S=Xr(S),S&&(W||I===n))return iF(S);if(!S||!(I=nc(I)))return S;var q=Rc(S),te=Rc(I),fe=rF(q,te),we=LT(q,te)+1;return Jf(q,fe,we).join("")}function c8e(S,I,W){if(S=Xr(S),S&&(W||I===n))return S.slice(0,Ak(S)+1);if(!S||!(I=nc(I)))return S;var q=Rc(S),te=LT(q,Rc(I))+1;return Jf(q,0,te).join("")}function u8e(S,I,W){if(S=Xr(S),S&&(W||I===n))return S.replace(Ki,"");if(!S||!(I=nc(I)))return S;var q=Rc(S),te=rF(q,Rc(I));return Jf(q,te).join("")}function d8e(S,I){var W=N,q=P;if(yo(I)){var te="separator"in I?I.separator:te;W="length"in I?Fi(I.length):W,q="omission"in I?nc(I.omission):q}S=Xr(S);var fe=S.length;if(rb(S)){var we=Rc(S);fe=we.length}if(W>=fe)return S;var Ae=W-C_(q);if(Ae<1)return q;var $e=we?Jf(we,0,Ae).join(""):S.slice(0,Ae);if(te===n)return $e+q;if(we&&(Ae+=$e.length-Ae),BH(te)){if(S.slice(Ae).search(te)){var Ct,St=$e;for(te.global||(te=mw(te.source,Xr(yn.exec(te))+"g")),te.lastIndex=0;Ct=te.exec(St);)var Tt=Ct.index;$e=$e.slice(0,Tt===n?Ae:Tt)}}else if(S.indexOf(nc(te),Ae)!=Ae){var dn=$e.lastIndexOf(te);dn>-1&&($e=$e.slice(0,dn))}return $e+q}function h8e(S){return S=Xr(S),S&&mi.test(S)?S.replace(Pi,cF):S}var f8e=P_(function(S,I,W){return S+(W?" ":"")+I.toUpperCase()}),$H=QT("toUpperCase");function Due(S,I,W){return S=Xr(S),I=W?n:I,I===n?lH(S)?hH(S):sH(S):S.match(I)||[]}var Eue=Oi(function(S,I){try{return Cl(S,n,I)}catch(W){return FH(W)?W:new vi(W)}}),p8e=$h(function(S,I){return Qa(I,function(W){W=Id(W),Mh(S,W,Nt(S[W],S))}),S});function g8e(S){var I=S==null?0:S.length,W=Zn();return S=I?hs(S,function(q){if(typeof q[1]!="function")throw new bu(a);return[W(q[0]),q[1]]}):[],Oi(function(q){for(var te=-1;++te<I;){var fe=S[te];if(Cl(fe[0],this,q))return Cl(fe[1],this,q)}})}function m8e(S){return SF(tc(S,h))}function zH(S){return function(){return S}}function _8e(S,I){return S==null||S!==S?I:S}var v8e=dL(),b8e=dL(!0);function Au(S){return S}function VH(S){return bb(typeof S=="function"?S:tc(S,h))}function y8e(S){return eL(tc(S,h))}function w8e(S,I){return Bs(S,tc(I,h))}var C8e=Oi(function(S,I){return function(W){return xu(W,S,I)}}),S8e=Oi(function(S,I){return function(W){return xu(S,W,I)}});function HH(S,I,W){var q=ol(I),te=_b(I,q);W==null&&!(yo(I)&&(te.length||!q.length))&&(W=I,I=S,S=this,te=_b(I,ol(I)));var fe=!(yo(W)&&"chain"in W)||!!W.chain,we=V_(S);return Qa(te,function(Ae){var $e=I[Ae];S[Ae]=$e,we&&(S.prototype[Ae]=function(){var Ct=this.__chain__;if(fe||Ct){var St=S(this.__wrapped__),Tt=St.__actions__=xl(this.__actions__);return Tt.push({func:$e,args:arguments,thisArg:S}),St.__chain__=Ct,St}return $e.apply(S,_g([this.value()],arguments))})}),S}function x8e(){return Fs._===this&&(Fs._=hF),this}function UH(){}function k8e(S){return S=Fi(S),Oi(function(I){return tL(I,S)})}var L8e=hL(hs),D8e=hL(vT),E8e=hL(wT);function Iue(S){return _n(S)?ST(Id(S)):Gs(S)}function I8e(S){return function(I){return S==null?n:Gf(S,I)}}var T8e=eR(),R8e=eR(!0);function qH(){return[]}function KH(){return!1}function A8e(){return{}}function N8e(){return""}function M8e(){return!0}function P8e(S,I){if(S=Fi(S),S<1||S>X)return[];var W=K,q=Ja(S,K);I=Zn(I),S-=K;for(var te=kT(q,I);++W<S;)I(W);return te}function O8e(S){return Ti(S)?hs(S,Id):Ad(S)?[S]:xl(hR(Xr(S)))}function F8e(S){var I=++ab;return Xr(S)+I}var B8e=Fw(function(S,I){return S+I},0),j8e=Ma("ceil"),W8e=Fw(function(S,I){return S/I},1),$8e=Ma("floor");function z8e(S){return S&&S.length?T_(S,Au,Lg):n}function V8e(S,I){return S&&S.length?T_(S,Zn(I,2),Lg):n}function H8e(S){return tF(S,Au)}function U8e(S,I){return tF(S,Zn(I,2))}function q8e(S){return S&&S.length?T_(S,Au,Dg):n}function K8e(S,I){return S&&S.length?T_(S,Zn(I,2),Dg):n}var G8e=Fw(function(S,I){return S*I},1),X8e=Ma("round"),Y8e=Fw(function(S,I){return S-I},0);function Z8e(S){return S&&S.length?xT(S,Au):0}function Q8e(S,I){return S&&S.length?xT(S,Zn(I,2)):0}return he.after=Re,he.ary=et,he.assign=aBe,he.assignIn=yue,he.assignInWith=a3,he.assignWith=lBe,he.at=cBe,he.before=It,he.bind=Nt,he.bindAll=p8e,he.bindKey=Lt,he.castArray=A6e,he.chain=EL,he.chunk=yL,he.compact=fR,he.concat=Eu,he.cond=g8e,he.conforms=m8e,he.constant=zH,he.countBy=e3,he.create=uBe,he.curry=pn,he.curryRight=Cn,he.debounce=Dn,he.defaults=dBe,he.defaultsDeep=hBe,he.defer=bo,he.delay=Ke,he.difference=pr,he.differenceBy=va,he.differenceWith=To,he.drop=Fa,he.dropRight=Oc,he.dropRightWhile=Tb,he.dropWhile=Ko,he.fill=qw,he.filter=RL,he.flatMap=kR,he.flatMapDeep=AH,he.flatMapDepth=i3,he.flatten=wL,he.flattenDeep=Gw,he.flattenDepth=ic,he.flip=Me,he.flow=v8e,he.flowRight=b8e,he.fromPairs=pR,he.functions=bBe,he.functionsIn=yBe,he.groupBy=LR,he.initial=CL,he.intersection=gR,he.intersectionBy=Ag,he.intersectionWith=SL,he.invert=CBe,he.invertBy=SBe,he.invokeMap=r3,he.iteratee=VH,he.keyBy=NH,he.keys=ol,he.keysIn=Ru,he.map=z_,he.mapKeys=kBe,he.mapValues=LBe,he.matches=y8e,he.matchesProperty=w8e,he.memoize=Ge,he.merge=DBe,he.mergeWith=wue,he.method=C8e,he.methodOf=S8e,he.mixin=HH,he.negate=Wt,he.nthArg=k8e,he.omit=EBe,he.omitBy=IBe,he.once=In,he.orderBy=MH,he.over=L8e,he.overArgs=Gn,he.overEvery=D8e,he.overSome=E8e,he.partial=zn,he.partialRight=ci,he.partition=Qw,he.pick=TBe,he.pickBy=Cue,he.property=Iue,he.propertyOf=I8e,he.pull=xL,he.pullAll=Yw,he.pullAllBy=El,he.pullAllWith=Mg,he.pullAt=Td,he.range=T8e,he.rangeRight=R8e,he.rearg=ba,he.reject=v,he.remove=rc,he.rest=xr,he.reverse=kL,he.sampleSize=T,he.set=ABe,he.setWith=NBe,he.shuffle=F,he.slice=_R,he.sortBy=re,he.sortedUniq=yR,he.sortedUniqBy=j_,he.split=n8e,he.spread=Og,he.tail=KF,he.take=GF,he.takeRight=wR,he.takeRightWhile=LL,he.takeWhile=CH,he.tap=IH,he.throttle=OH,he.thru=Rd,he.toArray=_ue,he.toPairs=Sue,he.toPairsIn=xue,he.toPath=O8e,he.toPlainObject=bue,he.transform=MBe,he.unary=T6e,he.union=SH,he.unionBy=XF,he.unionWith=YF,he.uniq=W_,he.uniqBy=xH,he.uniqWith=Rb,he.unset=PBe,he.unzip=DL,he.unzipWith=Xs,he.update=OBe,he.updateWith=FBe,he.values=FL,he.valuesIn=BBe,he.without=kH,he.words=Due,he.wrap=R6e,he.xor=ZF,he.xorBy=LH,he.xorWith=DH,he.zip=QF,he.zipObject=JF,he.zipObjectDeep=EH,he.zipWith=Iu,he.entries=Sue,he.entriesIn=xue,he.extend=yue,he.extendWith=a3,HH(he,he),he.add=B8e,he.attempt=Eue,he.camelCase=zBe,he.capitalize=kue,he.ceil=j8e,he.clamp=jBe,he.clone=N6e,he.cloneDeep=P6e,he.cloneDeepWith=O6e,he.cloneWith=M6e,he.conformsTo=F6e,he.deburr=Lue,he.defaultTo=_8e,he.divide=W8e,he.endsWith=VBe,he.eq=ip,he.escape=HBe,he.escapeRegExp=UBe,he.every=t3,he.find=AL,he.findIndex=Rg,he.findKey=fBe,he.findLast=n3,he.findLastIndex=Kw,he.findLastKey=pBe,he.floor=$8e,he.forEach=NL,he.forEachRight=Zw,he.forIn=gBe,he.forInRight=mBe,he.forOwn=_Be,he.forOwnRight=vBe,he.get=jH,he.gt=B6e,he.gte=j6e,he.has=wBe,he.hasIn=WH,he.head=F_,he.identity=Au,he.includes=ML,he.indexOf=np,he.inRange=WBe,he.invoke=xBe,he.isArguments=Jw,he.isArray=Ti,he.isArrayBuffer=W6e,he.isArrayLike=Tu,he.isArrayLikeObject=Go,he.isBoolean=$6e,he.isBuffer=Ab,he.isDate=z6e,he.isElement=V6e,he.isEmpty=H6e,he.isEqual=U6e,he.isEqualWith=q6e,he.isError=FH,he.isFinite=K6e,he.isFunction=V_,he.isInteger=fue,he.isLength=s3,he.isMap=pue,he.isMatch=G6e,he.isMatchWith=X6e,he.isNaN=Y6e,he.isNative=Z6e,he.isNil=J6e,he.isNull=Q6e,he.isNumber=gue,he.isObject=yo,he.isObjectLike=Ro,he.isPlainObject=DR,he.isRegExp=BH,he.isSafeInteger=eBe,he.isSet=mue,he.isString=o3,he.isSymbol=Ad,he.isTypedArray=OL,he.isUndefined=tBe,he.isWeakMap=nBe,he.isWeakSet=iBe,he.join=Ng,he.kebabCase=qBe,he.last=Dl,he.lastIndexOf=Xw,he.lowerCase=KBe,he.lowerFirst=GBe,he.lt=rBe,he.lte=sBe,he.max=z8e,he.maxBy=V8e,he.mean=H8e,he.meanBy=U8e,he.min=q8e,he.minBy=K8e,he.stubArray=qH,he.stubFalse=KH,he.stubObject=A8e,he.stubString=N8e,he.stubTrue=M8e,he.multiply=G8e,he.nth=mR,he.noConflict=x8e,he.noop=UH,he.now=be,he.pad=XBe,he.padEnd=YBe,he.padStart=ZBe,he.parseInt=QBe,he.random=$Be,he.reduce=PH,he.reduceRight=PL,he.repeat=JBe,he.replace=e8e,he.result=RBe,he.round=X8e,he.runInContext=Fe,he.sample=w,he.size=V,he.snakeCase=t8e,he.some=U,he.sortedIndex=vR,he.sortedIndexBy=wH,he.sortedIndexOf=Pg,he.sortedLastIndex=qF,he.sortedLastIndexBy=bR,he.sortedLastIndexOf=B_,he.startCase=i8e,he.startsWith=r8e,he.subtract=Y8e,he.sum=Z8e,he.sumBy=Q8e,he.template=s8e,he.times=P8e,he.toFinite=H_,he.toInteger=Fi,he.toLength=vue,he.toLower=o8e,he.toNumber=Vh,he.toSafeInteger=oBe,he.toString=Xr,he.toUpper=a8e,he.trim=l8e,he.trimEnd=c8e,he.trimStart=u8e,he.truncate=d8e,he.unescape=h8e,he.uniqueId=F8e,he.upperCase=f8e,he.upperFirst=$H,he.each=NL,he.eachRight=Zw,he.first=F_,HH(he,function(){var S={};return Mc(he,function(I,W){Sr.call(he.prototype,W)||(S[W]=I)}),S}(),{chain:!1}),he.VERSION=r,Qa(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){he[S].placeholder=he}),Qa(["drop","take"],function(S,I){Ii.prototype[S]=function(W){W=W===n?1:Io(Fi(W),0);var q=this.__filtered__&&!I?new Ii(this):this.clone();return q.__filtered__?q.__takeCount__=Ja(W,q.__takeCount__):q.__views__.push({size:Ja(W,K),type:S+(q.__dir__<0?"Right":"")}),q},Ii.prototype[S+"Right"]=function(W){return this.reverse()[S](W).reverse()}}),Qa(["filter","map","takeWhile"],function(S,I){var W=I+1,q=W==j||W==H;Ii.prototype[S]=function(te){var fe=this.clone();return fe.__iteratees__.push({iteratee:Zn(te,3),type:W}),fe.__filtered__=fe.__filtered__||q,fe}}),Qa(["head","last"],function(S,I){var W="take"+(I?"Right":"");Ii.prototype[S]=function(){return this[W](1).value()[0]}}),Qa(["initial","tail"],function(S,I){var W="drop"+(I?"":"Right");Ii.prototype[S]=function(){return this.__filtered__?new Ii(this):this[W](1)}}),Ii.prototype.compact=function(){return this.filter(Au)},Ii.prototype.find=function(S){return this.filter(S).head()},Ii.prototype.findLast=function(S){return this.reverse().find(S)},Ii.prototype.invokeMap=Oi(function(S,I){return typeof S=="function"?new Ii(this):this.map(function(W){return xu(W,S,I)})}),Ii.prototype.reject=function(S){return this.filter(Wt(Zn(S)))},Ii.prototype.slice=function(S,I){S=Fi(S);var W=this;return W.__filtered__&&(S>0||I<0)?new Ii(W):(S<0?W=W.takeRight(-S):S&&(W=W.drop(S)),I!==n&&(I=Fi(I),W=I<0?W.dropRight(-I):W.take(I-S)),W)},Ii.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},Ii.prototype.toArray=function(){return this.take(K)},Mc(Ii.prototype,function(S,I){var W=/^(?:filter|find|map|reject)|While$/.test(I),q=/^(?:head|last)$/.test(I),te=he[q?"take"+(I=="last"?"Right":""):I],fe=q||/^find/.test(I);te&&(he.prototype[I]=function(){var we=this.__wrapped__,Ae=q?[1]:arguments,$e=we instanceof Ii,Ct=Ae[0],St=$e||Ti(we),Tt=function(tr){var gr=te.apply(he,_g([tr],Ae));return q&&dn?gr[0]:gr};St&&W&&typeof Ct=="function"&&Ct.length!=1&&($e=St=!1);var dn=this.__chain__,Rn=!!this.__actions__.length,ui=fe&&!dn,zi=$e&&!Rn;if(!fe&&St){we=zi?we:new Ii(this);var di=S.apply(we,Ae);return di.__actions__.push({func:Rd,args:[Tt],thisArg:n}),new el(di,dn)}return ui&&zi?S.apply(this,Ae):(di=this.thru(Tt),ui?q?di.value()[0]:di.value():di)})}),Qa(["pop","push","shift","sort","splice","unshift"],function(S){var I=Vf[S],W=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",q=/^(?:pop|shift)$/.test(S);he.prototype[S]=function(){var te=arguments;if(q&&!this.__chain__){var fe=this.value();return I.apply(Ti(fe)?fe:[],te)}return this[W](function(we){return I.apply(Ti(we)?we:[],te)})}}),Mc(Ii.prototype,function(S,I){var W=he[I];if(W){var q=W.name+"";Sr.call(db,q)||(db[q]=[]),db[q].push({name:I,func:W})}}),db[Lb(n,b).name]=[{name:"wrapper",func:n}],Ii.prototype.clone=Vk,Ii.prototype.reverse=NT,Ii.prototype.value=pb,he.prototype.at=IL,he.prototype.chain=$_,he.prototype.commit=TL,he.prototype.next=CR,he.prototype.plant=TH,he.prototype.reverse=xR,he.prototype.toJSON=he.prototype.valueOf=he.prototype.value=RH,he.prototype.first=he.prototype.head,Uf&&(he.prototype[Uf]=SR),he},sb=fH();Eh?((Eh.exports=sb)._=sb,pw._=sb):Fs._=sb}).call(gPt)}(EN,EN.exports)),EN.exports}var gV=mPt();const HPe=ql(gV),qle=$.forwardRef((i,e)=>{const{method:n,command:r,description:s,tags:o,onClick:a,tabIndex:l,isActive:c}=i,u=$i(),h=(m=>{switch(m){case"GET":return"success";case"POST":return"info";case"PUT":return"warning";case"PATCH":return"secondary";case"DELETE":return"error";default:return"default"}})(n),f=u.palette[h].main,p={background:Pt(u.palette[h].light,.05),borderColor:`${f} !important`},g=o.map(m=>C.jsxs(nn.Fragment,{children:[C.jsxs(Je,{component:"span",variant:"caption",color:h,sx:{display:"inline-block",color:f,border:`1px solid ${f}`,px:.5,borderRadius:"5px",ml:.5,my:.5},children:["#",m]}),C.jsx("br",{})]},m));return C.jsxs(ng,{sx:{boxShadow:c?`0 0 0 2px ${u.palette.primary.dark}`:"none",borderRadius:"5px"},ref:e,onClick:a,tabIndex:l,children:[C.jsx(ki,{sx:p,width:"50px",children:C.jsx(ua,{title:"Insert command into the console window",disableFocusListener:!0,children:C.jsx(Ga,{onClick:a,className:"insert-button",children:C.jsx(hV,{})})})}),C.jsx(ki,{sx:{...p,pl:0},children:C.jsxs(Ye,{sx:{display:"flex",alignItems:"center"},children:[C.jsx(JS,{color:h,label:n,size:"small"}),C.jsxs(Ye,{children:[C.jsx(Je,{component:"code",ml:2,children:r}),C.jsx("br",{}),C.jsx(Je,{variant:"caption",ml:2,color:u.palette.mode==="light"?u.palette.grey[700]:u.palette.grey[400],children:s})]})]})}),C.jsx(ki,{sx:p,align:"right",children:g})]})});qle.displayName="CommandsTableRow";qle.propTypes={method:Z.string.isRequired,command:Z.string.isRequired,description:Z.string.isRequired,tags:Z.arrayOf(Z.string.isRequired).isRequired,onClick:Z.func.isRequired,isActive:Z.bool.isRequired,tabIndex:Z.number.isRequired};const UPe=({commands:i,handleInsertCommand:e})=>{const[n,r]=nn.useState(null),s=$.useRef([]),{enqueueSnackbar:o,closeSnackbar:a}=pu(),l=as("success",a,1e3);$.useEffect(()=>{r(null),s.current=s.current.slice(0,i.length)},[i,i.length]);const c=f=>{const p=`${f.method} ${f.command.substring(1)}${f.hasRequestBody?`
{
${f.requiredBodyParameters?f.requiredBodyParameters.map(g=>`"${g}": `).join(`,
`):""}
}`:""}`;e(p),o("Command inserted",l)},u=f=>{if(f.key==="ArrowDown"){if(n===null){r(0),s.current[0].focus();return}const p=(n+1)%i.length;r(p),s.current[p].focus()}else if(f.key==="ArrowUp"){if(n===null){r(i.length-1),s.current[i.length-1].focus();return}const p=(n-1+i.length)%i.length;r(p),s.current[p].focus()}else f.key==="Enter"&&n!==null&&c(i[n])},d=gV.debounce(u,30);$.useEffect(()=>(window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}),[n]);const h=i.map((f,p)=>C.jsx(qle,{tabIndex:0,ref:g=>s.current[p]=g,method:f.method,command:f.command,description:f.description,tags:f.tags,isActive:n===p,onClick:g=>{(g.target.classList.contains("insert-button")||g.target.closest(".insert-button"))&&c(f)}},f.method+"_"+f.command));return C.jsx(FMt,{"data-testid":"commands-table",children:C.jsx(BMt,{children:h})})};UPe.propTypes={commands:Z.arrayOf(Z.shape({method:Z.string.isRequired,command:Z.string.isRequired,description:Z.string.isRequired,tags:Z.arrayOf(Z.string.isRequired).isRequired})).isRequired,handleInsertCommand:Z.func.isRequired};const qPe=({commands:i,setCommands:e})=>{const n=nn.useRef(null),r=s=>{const o=s.target.value;if(o==="")e(i);else{const a=o.split(" "),l=i.reduce((c,u)=>{const d=[u.method,u.command,u.description],h=a.reduce((f,p)=>{var _;const g=HPe.escapeRegExp(p),m=new RegExp(`\\b(${g})`,"gmi");return f+((_=d.join(" ").match(m))==null?void 0:_.length)},0);return h>0&&c.push({...u,matches:h}),c},[]).sort((c,u)=>u.matches-c.matches);e(l)}};return nn.useEffect(()=>{n.current.focus()},[]),C.jsx(Ep,{id:"command-search",label:"Search command",variant:"outlined",fullWidth:!0,placeholder:"GET collections",inputRef:n,InputProps:{startAdornment:C.jsx(TW,{position:"start",children:C.jsx(PMt,{})})},onChange:r})};qPe.propTypes={commands:Z.array.isRequired,setCommands:Z.func.isRequired};const _Pt=function(i,e){const n=Object.keys(e)[0];return"$ref"in e[n].schema?e[n].schema.$ref.slice(2).split("/").reduce((a,l)=>a[l],i).required:e[n].schema.required},KPe=({open:i,toggleDrawer:e,handleInsertCommand:n})=>{const[r,s]=$.useState([]),[o,a]=$.useState([]),l=FW("(max-width: 992px)"),{enqueueSnackbar:c,closeSnackbar:u}=pu(),d=as("error",u,6e3);return $.useEffect(()=>{fetch("/dashboard/./openapi.json").then(h=>h.json()).then(h=>{const f=Object.keys(h.paths).map(p=>Object.keys(h.paths[p]).map(g=>{const m=p.replace(/{/g,"<").replace(/}/g,">"),_=h.paths[p][g].summary,b=h.paths[p][g].tags,y=!!h.paths[p][g].requestBody;let x=null;return y&&(x=_Pt(h,h.paths[p][g].requestBody.content)),{method:g.toUpperCase(),command:m,description:_,hasRequestBody:y,tags:b,requiredBodyParameters:x}})).flat();s(f),a(f)}).catch(h=>{c("Error fetching commands",d),console.error(h)})},[]),C.jsx(pLe,{anchor:"right",open:i,onClose:e,sx:{"& .MuiDrawer-paper":{minWidth:l?"100vw":"680px",width:l?"100vw":"55vw",padding:"1rem"},"& .MuiBackdrop-root.MuiModal-backdrop":{opacity:"0 !important"}},children:C.jsxs("div",{children:[C.jsxs(Ye,{sx:{display:"flex",alignItems:"center",mb:2,mr:2},children:[C.jsx(Je,{variant:"h5",children:"Commands"}),C.jsx(Ye,{sx:{flexGrow:1}}),C.jsx(Ga,{onClick:e,children:C.jsx(RPe,{})})]}),C.jsx(Je,{variant:"body1",mb:4,children:"This is a list of commands that can be used in the editor."}),C.jsx(qPe,{commands:r,setCommands:a}),C.jsx(UPe,{commands:o,handleInsertCommand:n})]})})};KPe.propTypes={open:Z.bool.isRequired,toggleDrawer:Z.func.isRequired,handleInsertCommand:Z.func.isRequired};const vPt=`// List all collections
GET collections
// Get collection info
GET collections/collection_name
// List points in a collection, using filter
POST collections/collection_name/points/scroll
{
"limit": 10,
"filter": {
"must": [
{
"key": "city",
"match": {
"any": [
"San Francisco",
"New York",
"Berlin"
]
}
}
]
}
}
`,bPt="{}";function yPt(){const i=$i(),[e,n]=$.useState(localStorage.getItem("qwuiConsoleCode")??vPt),[r,s]=$.useState(bPt),[o,a]=nn.useState(0),[l,c]=$.useState(!1),u=(h,f)=>{switch(h){case"code":{localStorage.setItem("qwuiConsoleCode",f),n(f);break}default:console.warn("case not handled!",h,f)}},d=(h,f)=>{switch(h){case"code":{s(f);break}default:console.warn("case not handled!",h,f)}};return C.jsx(C.Fragment,{children:C.jsx(Ye,{component:"main",children:C.jsxs(ln,{container:!0,children:[C.jsxs(ln,{size:12,children:[C.jsx(Ye,{sx:{width:"100%",height:"4px"},children:C.jsx(AW,{sx:o?{}:{display:"none"}})}),C.jsxs(UW,{direction:"horizontal",children:[C.jsx(ix,{children:C.jsx(DPe,{code:e,onChange:u,onChangeResult:d,setRequestCount:a})}),C.jsx(qW,{style:{width:"10px",background:Pt(i.palette.primary.main,.05)},children:C.jsx(Ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"⋮"})}),C.jsx(ix,{children:C.jsx(IPe,{code:r})})]})]}),C.jsx(ua,{title:"Commands",placement:"left",arrow:!0,children:C.jsx(Mqe,{sx:{position:"absolute",bottom:"40px",right:"49px",boxShadow:3,backgroundColor:ey[500],"&:hover":{backgroundColor:ey[700]}},color:"info","aria-label":"add",onClick:()=>c(!0),children:C.jsx(RMt,{})})}),C.jsx(KPe,{open:l,toggleDrawer:()=>{c(!l)},handleInsertCommand:h=>{const f=`${h}
${e}`;u("code",f)}})]})})})}function GPe({value:i,setValue:e,actions:n}){const r=$i();return C.jsxs(Ye,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[C.jsx(TI,{fullWidth:!0,value:i,onChange:s=>e(s.target.value),placeholder:"Search Collection",startAdornment:C.jsx(TW,{position:"start",children:C.jsx(Ott,{size:20,color:r.palette.text.primary})}),sx:{borderRadius:"8px","& .MuiOutlinedInput-input":{padding:"0.5rem",fontSize:"1rem",fontWeight:400,height:"1.5rem",lineHeight:"1.5rem",color:r.palette.text.primary,"&::placeholder":{color:r.palette.text.disabled,opacity:1}},"& .MuiOutlinedInput-notchedOutline":{borderColor:Pt(r.palette.divider,.23)}}}),(n==null?void 0:n.length)&&n.map((s,o)=>C.jsx(nn.Fragment,{children:s},o))]})}GPe.propTypes={value:Z.string,setValue:Z.func,actions:Z.arrayOf(Z.element)};const g4=({message:i="Something went wrong",callback:e})=>{const{enqueueSnackbar:n,closeSnackbar:r}=pu(),s=as("error",r,6e3);return $.useEffect(()=>{n(i,s),typeof e=="function"&&e()},[n,s,i]),null};g4.propTypes={message:Z.string,callback:Z.func};const iT=({children:i,maxWidth:e="lg"})=>C.jsx(aLe,{maxWidth:e,component:"main",sx:{display:"flex",justifyContent:"center",p:5,margin:"auto"},children:i});iT.propTypes={children:Z.oneOfType([Z.arrayOf(Z.oneOfType([Z.node])),Z.node]),maxWidth:Z.string};function sB(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var wPt=0;function XPe(i){return"__private_"+wPt+++"_"+i}function CPt(i,e,n){const r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((o,a,l)=>{o!==""&&r.push(o),a<l.length-1&&r.push(n)})),r}/**
* Takes a string with placeholder variables like `%{smart_count} file selected`
* and replaces it with values from options `{smart_count: 5}`
*
* @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
* taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
*
* @param phrase that needs interpolation, with placeholders
* @param options with values that will be used to replace placeholders
*/function Qve(i,e){const n=/\$/g,r="$$$$";let s=[i];if(e==null)return s;for(const o of Object.keys(e))if(o!=="_"){let a=e[o];typeof a=="string"&&(a=n[Symbol.replace](a,r)),s=CPt(s,new RegExp(`%\\{${o}\\}`,"g"),a)}return s}const SPt=i=>{throw new Error(`missing string: ${i}`)};var bA=XPe("onMissingKey"),yA=XPe("apply");class YPe{constructor(e,n){let{onMissingKey:r=SPt}=n===void 0?{}:n;Object.defineProperty(this,yA,{value:xPt}),Object.defineProperty(this,bA,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(sB(this,yA)[yA],this):sB(this,yA)[yA](e),sB(this,bA)[bA]=r}translate(e,n){return this.translateArray(e,n).join("")}translateArray(e,n){let r=this.locale.strings[e];if(r==null&&(sB(this,bA)[bA](e),r=e),typeof r=="object"){if(n&&typeof n.smart_count<"u"){const o=this.locale.pluralize(n.smart_count);return Qve(r[o],n)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return Qve(r,n)}}function xPt(i){if(!(i!=null&&i.strings))return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var XK,Jve;function kPt(){return Jve||(Jve=1,XK=function(){var e={},n=e._fns={};e.emit=function(a,l,c,u,d,h,f){var p=r(a);p.length&&s(a,p,[l,c,u,d,h,f])},e.on=function(a,l){n[a]||(n[a]=[]),n[a].push(l)},e.once=function(a,l){function c(){l.apply(this,arguments),e.off(a,c)}this.on(a,c)},e.off=function(a,l){var c=[];if(a&&l){var u=this._fns[a],d=0,h=u?u.length:0;for(d;d<h;d++)u[d]!==l&&c.push(u[d])}c.length?this._fns[a]=c:delete this._fns[a]};function r(o){var a=n[o]?n[o]:[],l=o.indexOf(":"),c=l===-1?[o]:[o.substring(0,l),o.substring(l+1)],u=Object.keys(n),d=0,h=u.length;for(d;d<h;d++){var f=u[d];if(f==="*"&&(a=a.concat(n[f])),c.length===2&&c[0]===f){a=a.concat(n[f]);break}}return a}function s(o,a,l){var c=0,u=a.length;for(c;c<u&&a[c];c++)a[c].event=o,a[c].apply(a[c],l)}return e}),XK}var LPt=kPt();const DPt=ql(LPt);let EPt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",IPt=(i=21)=>{let e="",n=i|0;for(;n--;)e+=EPt[Math.random()*64|0];return e};var YK,ebe;function m4(){if(ebe)return YK;ebe=1;function i(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return YK=i,YK}var ZK,tbe;function ZPe(){if(tbe)return ZK;tbe=1;var i=typeof hy=="object"&&hy&&hy.Object===Object&&hy;return ZK=i,ZK}var QK,nbe;function f_(){if(nbe)return QK;nbe=1;var i=ZPe(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=i||e||Function("return this")();return QK=n,QK}var JK,ibe;function TPt(){if(ibe)return JK;ibe=1;var i=f_(),e=function(){return i.Date.now()};return JK=e,JK}var eG,rbe;function RPt(){if(rbe)return eG;rbe=1;var i=/\s/;function e(n){for(var r=n.length;r--&&i.test(n.charAt(r)););return r}return eG=e,eG}var tG,sbe;function APt(){if(sbe)return tG;sbe=1;var i=RPt(),e=/^\s+/;function n(r){return r&&r.slice(0,i(r)+1).replace(e,"")}return tG=n,tG}var nG,obe;function mV(){if(obe)return nG;obe=1;var i=f_(),e=i.Symbol;return nG=e,nG}var iG,abe;function NPt(){if(abe)return iG;abe=1;var i=mV(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,s=i?i.toStringTag:void 0;function o(a){var l=n.call(a,s),c=a[s];try{a[s]=void 0;var u=!0}catch{}var d=r.call(a);return u&&(l?a[s]=c:delete a[s]),d}return iG=o,iG}var rG,lbe;function MPt(){if(lbe)return rG;lbe=1;var i=Object.prototype,e=i.toString;function n(r){return e.call(r)}return rG=n,rG}var sG,cbe;function _4(){if(cbe)return sG;cbe=1;var i=mV(),e=NPt(),n=MPt(),r="[object Null]",s="[object Undefined]",o=i?i.toStringTag:void 0;function a(l){return l==null?l===void 0?s:r:o&&o in Object(l)?e(l):n(l)}return sG=a,sG}var oG,ube;function v4(){if(ube)return oG;ube=1;function i(e){return e!=null&&typeof e=="object"}return oG=i,oG}var aG,dbe;function _V(){if(dbe)return aG;dbe=1;var i=_4(),e=v4(),n="[object Symbol]";function r(s){return typeof s=="symbol"||e(s)&&i(s)==n}return aG=r,aG}var lG,hbe;function PPt(){if(hbe)return lG;hbe=1;var i=APt(),e=m4(),n=_V(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(n(u))return r;if(e(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=e(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=i(u);var h=o.test(u);return h||a.test(u)?l(u.slice(2),h?2:8):s.test(u)?r:+u}return lG=c,lG}var cG,fbe;function OPt(){if(fbe)return cG;fbe=1;var i=m4(),e=TPt(),n=PPt(),r="Expected a function",s=Math.max,o=Math.min;function a(l,c,u){var d,h,f,p,g,m,_=0,b=!1,y=!1,x=!0;if(typeof l!="function")throw new TypeError(r);c=n(c)||0,i(u)&&(b=!!u.leading,y="maxWait"in u,f=y?s(n(u.maxWait)||0,c):f,x="trailing"in u?!!u.trailing:x);function k(B){var j=d,z=h;return d=h=void 0,_=B,p=l.apply(z,j),p}function D(B){return _=B,g=setTimeout(A,c),b?k(B):p}function R(B){var j=B-m,z=B-_,H=c-j;return y?o(H,f-z):H}function E(B){var j=B-m,z=B-_;return m===void 0||j>=c||j<0||y&&z>=f}function A(){var B=e();if(E(B))return M(B);g=setTimeout(A,R(B))}function M(B){return g=void 0,x&&d?k(B):(d=h=void 0,p)}function N(){g!==void 0&&clearTimeout(g),_=0,d=m=h=g=void 0}function P(){return g===void 0?p:M(e())}function O(){var B=e(),j=E(B);if(d=arguments,h=this,m=B,j){if(g===void 0)return D(m);if(y)return clearTimeout(g),g=setTimeout(A,c),k(m)}return g===void 0&&(g=setTimeout(A,c)),p}return O.cancel=N,O.flush=P,O}return cG=a,cG}var uG,pbe;function FPt(){if(pbe)return uG;pbe=1;var i=OPt(),e=m4(),n="Expected a function";function r(s,o,a){var l=!0,c=!0;if(typeof s!="function")throw new TypeError(n);return e(a)&&(l="leading"in a?!!a.leading:l,c="trailing"in a?!!a.trailing:c),i(s,o,{leading:l,maxWait:o,trailing:c})}return uG=r,uG}var BPt=FPt();const jPt=ql(BPt);function j8(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var WPt=0;function QPe(i){return"__private_"+WPt+++"_"+i}const $Pt={version:"4.2.0"};var nS=QPe("callbacks"),dG=QPe("publish");class JPe{constructor(){Object.defineProperty(this,dG,{value:zPt}),this.state={},Object.defineProperty(this,nS,{writable:!0,value:new Set})}getState(){return this.state}setState(e){const n={...this.state},r={...this.state,...e};this.state=r,j8(this,dG)[dG](n,r,e)}subscribe(e){return j8(this,nS)[nS].add(e),()=>{j8(this,nS)[nS].delete(e)}}}function zPt(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++)e[n]=arguments[n];j8(this,nS)[nS].forEach(r=>{r(...e)})}JPe.VERSION=$Pt.version;function eOe(i){const e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}const gbe={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function tOe(i){var e;if(i.type)return i.type;const n=i.name?(e=eOe(i.name).extension)==null?void 0:e.toLowerCase():null;return n&&n in gbe?gbe[n]:"application/octet-stream"}function VPt(i){return i.charCodeAt(0).toString(32)}function mbe(i){let e="";return i.replace(/[^A-Z0-9]/gi,n=>(e+=`-${VPt(n)}`,"/"))+e}function HPt(i,e){let n=e||"uppy";return typeof i.name=="string"&&(n+=`-${mbe(i.name.toLowerCase())}`),i.type!==void 0&&(n+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(n+=`-${mbe(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(n+=`-${i.data.size}`),i.data.lastModified!==void 0&&(n+=`-${i.data.lastModified}`),n}function UPt(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function qPt(i,e){if(UPt(i))return i.id;const n=tOe(i);return HPt({...i,type:n},e)}function KPt(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;const e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;const r=e[1].split(".",2),s=parseInt(r[0],10),o=parseInt(r[1],10);return s<15||s===15&&o<15063||s>18||s===18&&o>=18218}function GPt(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function hG(i){return i<10?`0${i}`:i.toString()}function W8(){const i=new Date,e=hG(i.getHours()),n=hG(i.getMinutes()),r=hG(i.getSeconds());return`${e}:${n}:${r}`}const XPt={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++)e[n]=arguments[n];return console.error(`[Uppy] [${W8()}]`,...e)}},YPt={debug:function(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++)e[n]=arguments[n];return console.debug(`[Uppy] [${W8()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++)e[n]=arguments[n];return console.warn(`[Uppy] [${W8()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++)e[n]=arguments[n];return console.error(`[Uppy] [${W8()}]`,...e)}};var fG,_be;function ZPt(){return _be||(_be=1,fG=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const n=e<0;let r=Math.abs(e);if(n&&(r=-r),r===0)return"0 B";const s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.min(Math.floor(Math.log(r)/Math.log(1024)),s.length-1),a=Number(r/1024**o),l=s[o];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${l}`}),fG}var QPt=ZPt();const E2=ql(QPt);var pG,vbe;function JPt(){if(vbe)return pG;vbe=1;function i(e,n){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=n,this.parts=e.split(n)}return i.prototype.match=function(e){var n=!0,r=this.parts,s,o=r.length,a;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)n=!1;else{for(a=(e||"").split(this.separator),s=0;n&&s<o;s++)r[s]!=="*"&&(s<a.length?n=r[s]===a[s]:n=!1);n=n&&a}else if(typeof e.splice=="function")for(n=[],s=e.length;s--;)this.match(e[s])&&(n[n.length]=e[s]);else if(typeof e=="object"){n={};for(var l in e)this.match(l)&&(n[l]=e[l])}return n},pG=function(e,n,r){var s=new i(e,r||/[\/\.]/);return typeof n<"u"?s.match(n):s},pG}var gG,bbe;function eOt(){if(bbe)return gG;bbe=1;var i=JPt(),e=/[\/\+\.]/;return gG=function(n,r){function s(o){var a=i(o,n,e);return a&&a.length>=2}return r?s(r.split(";")[0]):s},gG}var tOt=eOt();const nOt=ql(tOt),iOt={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class wp extends Error{constructor(e,n){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=n==null?void 0:n.isUserFacing)!=null?r:!0,n!=null&&n.file&&(this.file=n.file)}}class rOt{constructor(e,n){this.getI18n=n,this.getOpts=()=>{var r;const s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,n){const{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(a=>!a.isGhost).length+n.length>s)throw new wp(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){const o=[...e,...n].reduce((a,l)=>{var c;return a+((c=l.size)!=null?c:0)},0);if(o>r)throw new wp(this.getI18n()("aggregateExceedsSize",{sizeAllowed:E2(r),size:E2(o)}))}}validateSingleFile(e){const{maxFileSize:n,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(l=>l.includes("/")?e.type?nOt(e.type.replace(/;.*?$/,""),l):!1:l[0]==="."&&e.extension?e.extension.toLowerCase()===l.slice(1).toLowerCase():!1)){const l=s.join(", ");throw new wp(this.getI18n()("youCanOnlyUploadFileTypes",{types:l}),{file:e})}if(n&&e.size!=null&&e.size>n){var o;throw new wp(this.getI18n()("exceedsSize",{size:E2(n),file:(o=e.name)!=null?o:this.getI18n()("unnamed")}),{file:e})}if(r&&e.size!=null&&e.size<r)throw new wp(this.getI18n()("inferiorSize",{size:E2(r)}),{file:e})}validate(e,n){n.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,n)}validateMinNumberOfFiles(e){const{minNumberOfFiles:n}=this.getOpts().restrictions;if(n&&Object.keys(e).length<n)throw new wp(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:n}))}getMissingRequiredMetaFields(e){var n;const r=new wp(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(n=e.name)!=null?n:this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,o=[];for(const a of s)(!Object.hasOwn(e.meta,a)||e.meta[a]==="")&&o.push(a);return{missingFields:o,error:r}}}const sOt={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function on(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var oOt=0;function Os(i){return"__private_"+oOt+++"_"+i}const aOt={version:"4.4.7"},oB={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var Il=Os("plugins"),Rl=Os("restricter"),wA=Os("storeUnsubscribe"),a0=Os("emitter"),iS=Os("preProcessors"),rS=Os("uploaders"),q0=Os("postProcessors"),Yd=Os("informAndEmit"),AO=Os("checkRequiredMetaFieldsOnFile"),mG=Os("checkRequiredMetaFields"),CA=Os("assertNewUploadAllowed"),_ie=Os("transformFile"),SA=Os("startIfAutoProceed"),xA=Os("checkAndUpdateFileState"),AM=Os("getFilesToRetry"),kA=Os("doRetryAll"),vie=Os("handleUploadProgress"),LA=Os("updateTotalProgress"),K0=Os("updateTotalProgressThrottled"),bie=Os("calculateTotalProgress"),_G=Os("addListeners"),Dp=Os("updateOnlineStatus"),DA=Os("requestClientById"),E0=Os("createUpload"),vG=Os("getUpload"),xS=Os("removeUpload"),I0=Os("runUpload");class vV{constructor(e){Object.defineProperty(this,I0,{value:SOt}),Object.defineProperty(this,xS,{value:COt}),Object.defineProperty(this,vG,{value:wOt}),Object.defineProperty(this,E0,{value:yOt}),Object.defineProperty(this,_G,{value:bOt}),Object.defineProperty(this,bie,{value:vOt}),Object.defineProperty(this,LA,{value:_Ot}),Object.defineProperty(this,kA,{value:mOt}),Object.defineProperty(this,AM,{value:gOt}),Object.defineProperty(this,xA,{value:pOt}),Object.defineProperty(this,SA,{value:fOt}),Object.defineProperty(this,_ie,{value:hOt}),Object.defineProperty(this,CA,{value:dOt}),Object.defineProperty(this,mG,{value:uOt}),Object.defineProperty(this,AO,{value:cOt}),Object.defineProperty(this,Yd,{value:lOt}),Object.defineProperty(this,Il,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Rl,{writable:!0,value:void 0}),Object.defineProperty(this,wA,{writable:!0,value:void 0}),Object.defineProperty(this,a0,{writable:!0,value:DPt()}),Object.defineProperty(this,iS,{writable:!0,value:new Set}),Object.defineProperty(this,rS,{writable:!0,value:new Set}),Object.defineProperty(this,q0,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,vie,{writable:!0,value:(s,o)=>{const a=s?this.getFile(s.id):void 0;if(s==null||!a){this.log(`Not setting progress for a file that has been removed: ${s==null?void 0:s.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}const l={bytesTotal:o.bytesTotal,percentage:o.bytesTotal!=null&&Number.isFinite(o.bytesTotal)&&o.bytesTotal>0?Math.round(o.bytesUploaded/o.bytesTotal*100):void 0};a.progress.uploadStarted!=null?this.setFileState(s.id,{progress:{...a.progress,...l,bytesUploaded:o.bytesUploaded}}):this.setFileState(s.id,{progress:{...a.progress,...l}}),on(this,K0)[K0]()}}),Object.defineProperty(this,K0,{writable:!0,value:jPt(()=>on(this,LA)[LA](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,Dp,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,DA,{writable:!0,value:new Map}),this.defaultLocale=sOt;const n={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:iOt,meta:{},onBeforeFileAdded:(s,o)=>!Object.hasOwn(o,s.id),onBeforeUpload:s=>s,store:new JPe,logger:XPt,infoTimeout:5e3},r={...n,...e};this.opts={...r,restrictions:{...n.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=YPt),this.log(`Using Core v${vV.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...oB,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:KPt(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),on(this,Rl)[Rl]=new rOt(()=>this.opts,()=>this.i18n),on(this,wA)[wA]=this.store.subscribe((s,o,a)=>{this.emit("state-update",s,o,a),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),on(this,_G)[_G]()}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];on(this,a0)[a0].emit(e,...r)}on(e,n){return on(this,a0)[a0].on(e,n),this}once(e,n){return on(this,a0)[a0].once(e,n),this}off(e,n){return on(this,a0)[a0].off(e,n),this}updateAll(e){this.iteratePlugins(n=>{n.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const n=this.getState().files;this.setState({files:{...n,...Object.fromEntries(Object.entries(e).map(r=>{let[s,o]=r;return[s,{...n[s],...o}]}))}})}setFileState(e,n){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:n})}i18nInit(){const e=r=>this.log(`Missing i18n string: ${r}`,"error"),n=new YPe([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=n.translate.bind(n),this.i18nArray=n.translateArray.bind(n),this.locale=n.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e==null?void 0:e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(n=>{n.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},n={...this.getState().files},r=Object.create(null);Object.keys(n).forEach(s=>{r[s]={...n[s],progress:{...n[s].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:r,...oB})}clear(){const{capabilities:e,currentUploads:n}=this.getState();if(Object.keys(n).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...oB,files:{}})}addPreProcessor(e){on(this,iS)[iS].add(e)}removePreProcessor(e){return on(this,iS)[iS].delete(e)}addPostProcessor(e){on(this,q0)[q0].add(e)}removePostProcessor(e){return on(this,q0)[q0].delete(e)}addUploader(e){on(this,rS)[rS].add(e)}removeUploader(e){return on(this,rS)[rS].delete(e)}setMeta(e){const n={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:n,files:r})}setFileMeta(e,n){const r={...this.getState().files};if(!r[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const s={...r[e].meta,...n};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(n=>this.getFile(n))}getObjectOfFilesPerState(){const{files:e,totalProgress:n,error:r}=this.getState(),s=Object.values(e),o=[],a=[],l=[],c=[],u=[],d=[],h=[],f=[],p=[];for(const g of s){const{progress:m}=g;!m.uploadComplete&&m.uploadStarted&&(o.push(g),g.isPaused||f.push(g)),m.uploadStarted||a.push(g),(m.uploadStarted||m.preprocess||m.postprocess)&&l.push(g),m.uploadStarted&&c.push(g),g.isPaused&&u.push(g),m.uploadComplete&&d.push(g),g.error&&h.push(g),(m.preprocess||m.postprocess)&&p.push(g)}return{newFiles:a,startedFiles:l,uploadStartedFiles:c,pausedFiles:u,completeFiles:d,erroredFiles:h,inProgressFiles:o,inProgressNotPausedFiles:f,processingFiles:p,isUploadStarted:c.length>0,isAllComplete:n===100&&d.length===s.length&&p.length===0,isAllErrored:!!r&&h.length===s.length,isAllPaused:o.length!==0&&u.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:s.some(g=>g.isGhost)}}validateRestrictions(e,n){n===void 0&&(n=this.getFiles());try{on(this,Rl)[Rl].validate(n,[e])}catch(r){return r}return null}validateSingleFile(e){try{on(this,Rl)[Rl].validateSingleFile(e)}catch(n){return n.message}return null}validateAggregateRestrictions(e){const n=this.getFiles();try{on(this,Rl)[Rl].validateAggregateRestrictions(n,e)}catch(r){return r.message}return null}checkIfFileAlreadyExists(e){const{files:n}=this.getState();return!!(n[e]&&!n[e].isGhost)}addFile(e){on(this,CA)[CA](e);const{nextFilesState:n,validFilesToAdd:r,errors:s}=on(this,xA)[xA]([e]),o=s.filter(l=>l.isRestriction);if(on(this,Yd)[Yd](o),s.length>0)throw s[0];this.setState({files:n});const[a]=r;return this.emit("file-added",a),this.emit("files-added",r),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),on(this,SA)[SA](),a.id}addFiles(e){on(this,CA)[CA]();const{nextFilesState:n,validFilesToAdd:r,errors:s}=on(this,xA)[xA](e),o=s.filter(l=>l.isRestriction);on(this,Yd)[Yd](o);const a=s.filter(l=>!l.isRestriction);if(a.length>0){let l=`Multiple errors occurred while adding files:
`;if(a.forEach(c=>{l+=`
* ${c.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:l},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,l);{const c=new Error(l);throw c.errors=a,c}}this.setState({files:n}),r.forEach(l=>{this.emit("file-added",l)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(l=>{this.log(`Added file: ${l.name}
id: ${l.id}
type: ${l.type}`)}),r.length>0&&on(this,SA)[SA]()}removeFiles(e){const{files:n,currentUploads:r}=this.getState(),s={...n},o={...r},a=Object.create(null);e.forEach(d=>{n[d]&&(a[d]=n[d],delete s[d])});function l(d){return a[d]===void 0}Object.keys(o).forEach(d=>{const h=r[d].fileIDs.filter(l);if(h.length===0){delete o[d];return}const{capabilities:f}=this.getState();if(h.length!==r[d].fileIDs.length&&!f.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[d]={...r[d],fileIDs:h}});const c={currentUploads:o,files:s};Object.keys(s).length===0&&(c.allowNewUpload=!0,c.error=null,c.recoveredState=null),this.setState(c),on(this,K0)[K0]();const u=Object.keys(a);u.forEach(d=>{this.emit("file-removed",a[d])}),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const n=this.getFile(e),s=!(n.isPaused||!1);return this.setFileState(e,{isPaused:s}),this.emit("upload-pause",n,s),s}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{const s={...e[r],isPaused:!0};e[r]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{const s={...e[r],isPaused:!1,error:null};e[r]=s}),this.setState({files:e}),this.emit("resume-all")}async retryAll(){const e=await on(this,kA)[kA]();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),n=Object.keys(e);n.length&&this.removeFiles(n),this.setState(oB)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const n=on(this,E0)[E0]([e],{forceAllowNewUpload:!0});return on(this,I0)[I0](n)}logout(){this.iteratePlugins(e=>{var n;(n=e.provider)==null||n.logout==null||n.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return on(this,LA)[LA]()}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e){if(typeof e!="function"){const c=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(c)}for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];const o=new e(this,...r),a=o.id;if(!a)throw new Error("Your plugin must have an id");if(!o.type)throw new Error("Your plugin must have a type");const l=this.getPlugin(a);if(l){const c=`Already found a plugin named '${l.id}'. Tried to use: '${a}'.
Uppy plugins must have unique \`id\` options.`;throw new Error(c)}return e.VERSION&&this.log(`Using ${a} v${e.VERSION}`),o.type in on(this,Il)[Il]?on(this,Il)[Il][o.type].push(o):on(this,Il)[Il][o.type]=[o],o.install(),this.emit("plugin-added",o),this}getPlugin(e){for(const n of Object.values(on(this,Il)[Il])){const r=n.find(s=>s.id===e);if(r!=null)return r}}[Symbol.for("uppy test: getPlugins")](e){return on(this,Il)[Il][e]}iteratePlugins(e){Object.values(on(this,Il)[Il]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const n=on(this,Il)[Il][e.type],r=n.findIndex(a=>a.id===e.id);r!==-1&&n.splice(r,1);const o={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(o)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),on(this,wA)[wA](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",on(this,Dp)[Dp]),window.removeEventListener("offline",on(this,Dp)[Dp]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n,r){n===void 0&&(n="info"),r===void 0&&(r=3e3);const s=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:s?e.message:e,details:s?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,n){const{logger:r}=this.opts;switch(n){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e);break}}registerRequestClient(e,n){on(this,DA)[DA].set(e,n)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const n=on(this,DA)[DA].get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?on(this,I0)[I0](e):(on(this,xS)[xS](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return on(this,E0)[E0](...arguments)}addResultData(e,n){if(!on(this,vG)[vG](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:r}=this.getState(),s={...r[e],result:{...r[e].result,...n}};this.setState({currentUploads:{...r,[e]:s}})}async upload(){var e;(e=on(this,Il)[Il].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:n}=this.getState();if(on(this,AM)[AM]().length>0){const o=await on(this,kA)[kA]();if(!(this.getFiles().filter(l=>l.progress.uploadStarted==null).length>0))return this.emit("complete",o),o;({files:n}=this.getState())}const s=this.opts.onBeforeUpload(n);return s===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(s&&typeof s=="object"&&(n=s,this.setState({files:n})),Promise.resolve().then(()=>on(this,Rl)[Rl].validateMinNumberOfFiles(n)).catch(o=>{throw on(this,Yd)[Yd]([o]),o}).then(()=>{if(!on(this,mG)[mG](n))throw new wp(this.i18n("missingRequiredMetaField"))}).catch(o=>{throw o}).then(async()=>{const{currentUploads:o}=this.getState(),a=Object.values(o).flatMap(d=>d.fileIDs),l=[];Object.keys(n).forEach(d=>{const h=this.getFile(d);!h.progress.uploadStarted&&a.indexOf(d)===-1&&l.push(h.id)});const c=on(this,E0)[E0](l),u=await on(this,I0)[I0](c);return this.emit("complete",u),u}).catch(o=>{throw this.emit("error",o),this.log(o,"error"),o}))}}function lOt(i){for(const o of i)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");const e=i.filter(o=>o.isUserFacing),n=4,r=e.slice(0,n),s=e.slice(n);r.forEach(o=>{let{message:a,details:l=""}=o;this.info({message:a,details:l},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}function cOt(i){const{missingFields:e,error:n}=on(this,Rl)[Rl].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(n.message),this.emit("restriction-failed",i,n),!1):(e.length===0&&i.missingRequiredMetaFields&&this.setFileState(i.id,{missingRequiredMetaFields:[]}),!0)}function uOt(i){let e=!0;for(const n of Object.values(i))on(this,AO)[AO](n)||(e=!1);return e}function dOt(i){const{allowNewUpload:e}=this.getState();if(e===!1){const n=new wp(this.i18n("noMoreFilesAllowed"),{file:i});throw on(this,Yd)[Yd]([n]),n}}function hOt(i){const e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,n=tOe(e),r=GPt(n,e),s=eOe(r).extension,o=qPt(e,this.getID()),a=e.meta||{};a.name=r,a.type=n;const l=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:o,name:r,extension:s||"",meta:{...this.getState().meta,...a},type:n,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function fOt(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function pOt(i){const{files:e}=this.getState(),n={...e},r=[],s=[];for(const l of i)try{var o;let c=on(this,_ie)[_ie](l);const u=(o=e[c.id])==null?void 0:o.isGhost;u&&(c={...e[c.id],isGhost:!1,data:l.data},this.log(`Replaced the blob in the restored ghost file: ${c.name}, ${c.id}`));const d=this.opts.onBeforeFileAdded(c,n);if(!d&&this.checkIfFileAlreadyExists(c.id)){var a;throw new wp(this.i18n("noDuplicates",{fileName:(a=c.name)!=null?a:this.i18n("unnamed")}),{file:l})}if(d===!1&&!u)throw new wp("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:l});typeof d=="object"&&d!==null&&(c=d),on(this,Rl)[Rl].validateSingleFile(c),n[c.id]=c,r.push(c)}catch(c){s.push(c)}try{on(this,Rl)[Rl].validateAggregateRestrictions(Object.values(e),r)}catch(l){return s.push(l),{nextFilesState:e,validFilesToAdd:[],errors:s}}return{nextFilesState:n,validFilesToAdd:r,errors:s}}function gOt(){const{files:i}=this.getState();return Object.keys(i).filter(e=>i[e].error)}async function mOt(){const i=on(this,AM)[AM](),e={...this.getState().files};if(i.forEach(r=>{e[r]={...e[r],isPaused:!1,error:null}}),this.setState({files:e,error:null}),this.emit("retry-all",this.getFilesByIds(i)),i.length===0)return{successful:[],failed:[]};const n=on(this,E0)[E0](i,{forceAllowNewUpload:!0});return on(this,I0)[I0](n)}function _Ot(){var i,e;const n=on(this,bie)[bie]();let r=null;n!=null&&(r=Math.round(n*100),r>100?r=100:r<0&&(r=0)),this.emit("progress",(i=r)!=null?i:0),this.setState({totalProgress:(e=r)!=null?e:0})}function vOt(){const e=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(e.length===0)return 0;if(e.every(l=>l.progress.uploadComplete))return 1;const n=l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,r=e.filter(n),s=e.filter(l=>!n(l));if(r.every(l=>l.progress.uploadComplete)&&s.length>0&&!s.every(l=>l.progress.uploadComplete))return null;const o=r.reduce((l,c)=>{var u;return l+((u=c.progress.bytesTotal)!=null?u:0)},0),a=r.reduce((l,c)=>l+(c.progress.bytesUploaded||0),0);return o===0?0:a/o}function bOt(){const i=(r,s,o)=>{let a=r.message||"Unknown error";r.details&&(a+=` ${r.details}`),this.setState({error:a}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:a,response:o})};this.on("error",i),this.on("upload-error",(r,s,o)=>{if(i(s,r,o),typeof s=="object"&&s.message){var a;this.log(s.message,"error");const l=new Error(this.i18n("failedToUpload",{file:(a=r==null?void 0:r.name)!=null?a:""}));l.isUserFacing=!0,l.details=s.message,s.details&&(l.details+=` ${s.details}`),on(this,Yd)[Yd]([l])}else on(this,Yd)[Yd]([s])});let e=null;this.on("upload-stalled",(r,s)=>{const{message:o}=r,a=s.map(l=>l.meta.name).join(", ");e||(this.info({message:o,details:a},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${o} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const n=r=>{const s=r.filter(a=>{const l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`),l}),o=Object.fromEntries(s.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(o)};this.on("upload-start",n),this.on("upload-progress",on(this,vie)[vie]),this.on("upload-success",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const o=this.getFile(r.id).progress;this.setFileState(r.id,{progress:{...o,postprocess:on(this,q0)[q0].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:o.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:s.bytesUploaded||o.bytesTotal}),on(this,K0)[K0]()}),this.on("preprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:s}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:s}})}),this.on("postprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.postprocess,this.setState({files:s})}),this.on("restored",()=>{on(this,K0)[K0]()}),this.on("dashboard:file-edit-complete",r=>{r&&on(this,AO)[AO](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",on(this,Dp)[Dp]),window.addEventListener("offline",on(this,Dp)[Dp]),setTimeout(on(this,Dp)[Dp],3e3))}function yOt(i,e){e===void 0&&(e={});const{forceAllowNewUpload:n=!1}=e,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!n)throw new Error("Cannot create a new upload: already uploading.");const o=IPt();return this.emit("upload",o,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[o]:{fileIDs:i,step:0,result:{}}}}),o}function wOt(i){const{currentUploads:e}=this.getState();return e[i]}function COt(i){const e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function SOt(i){const e=()=>{const{currentUploads:o}=this.getState();return o[i]};let n=e();const r=[...on(this,iS)[iS],...on(this,rS)[rS],...on(this,q0)[q0]];try{for(let o=n.step||0;o<r.length&&n;o++){const a=r[o];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...n,step:o}}});const{fileIDs:l}=n;await a(l,i),n=e()}}catch(o){throw on(this,xS)[xS](i),o}if(n){n.fileIDs.forEach(c=>{const u=this.getFile(c);u&&u.progress.postprocess&&this.emit("postprocess-complete",u)});const o=n.fileIDs.map(c=>this.getFile(c)),a=o.filter(c=>!c.error),l=o.filter(c=>c.error);this.addResultData(i,{successful:a,failed:l,uploadID:i}),n=e()}let s;return n&&(s=n.result,on(this,xS)[xS](i)),s==null&&(this.log(`Not setting result for an upload that has been removed: ${i}`),s={successful:[],failed:[],uploadID:i}),s}vV.VERSION=aOt.version;var b4,Xi,nOe,iOe,sS,ybe,rOe,sOe,oOe,Kle,yie,wie,NO={},aOe=[],xOt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y4=Array.isArray;function Dm(i,e){for(var n in e)i[n]=e[n];return i}function Gle(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function Sn(i,e,n){var r,s,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?s=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?b4.call(arguments,2):n),typeof i=="function"&&i.defaultProps!=null)for(o in i.defaultProps)a[o]===void 0&&(a[o]=i.defaultProps[o]);return NM(i,a,r,s,null)}function NM(i,e,n,r,s){var o={type:i,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++nOe,__i:-1,__u:0};return s==null&&Xi.vnode!=null&&Xi.vnode(o),o}function vI(i){return i.children}function Sv(i,e){this.props=i,this.context=e}function bI(i,e){if(e==null)return i.__?bI(i.__,i.__i+1):null;for(var n;e<i.__k.length;e++)if((n=i.__k[e])!=null&&n.__e!=null)return n.__e;return typeof i.type=="function"?bI(i):null}function lOe(i){var e,n;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((n=i.__k[e])!=null&&n.__e!=null){i.__e=i.__c.base=n.__e;break}return lOe(i)}}function wbe(i){(!i.__d&&(i.__d=!0)&&sS.push(i)&&!Tj.__r++||ybe!=Xi.debounceRendering)&&((ybe=Xi.debounceRendering)||rOe)(Tj)}function Tj(){for(var i,e,n,r,s,o,a,l=1;sS.length;)sS.length>l&&sS.sort(sOe),i=sS.shift(),l=sS.length,i.__d&&(n=void 0,s=(r=(e=i).__v).__e,o=[],a=[],e.__P&&((n=Dm({},r)).__v=r.__v+1,Xi.vnode&&Xi.vnode(n),Xle(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[s]:null,o,s??bI(r),!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,dOe(o,n,a),n.__e!=s&&lOe(n)));Tj.__r=0}function cOe(i,e,n,r,s,o,a,l,c,u,d){var h,f,p,g,m,_,b=r&&r.__k||aOe,y=e.length;for(c=kOt(n,e,b,c,y),h=0;h<y;h++)(p=n.__k[h])!=null&&(f=p.__i==-1?NO:b[p.__i]||NO,p.__i=h,_=Xle(i,p,f,s,o,a,l,c,u,d),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&Yle(f.ref,null,p),d.push(p.ref,p.__c||g,p)),m==null&&g!=null&&(m=g),4&p.__u||f.__k===p.__k?c=uOe(p,c,i):typeof p.type=="function"&&_!==void 0?c=_:g&&(c=g.nextSibling),p.__u&=-7);return n.__e=m,c}function kOt(i,e,n,r,s){var o,a,l,c,u,d=n.length,h=d,f=0;for(i.__k=new Array(s),o=0;o<s;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(c=o+f,(a=i.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?NM(null,a,null,null,null):y4(a)?NM(vI,{children:a},null,null,null):a.constructor==null&&a.__b>0?NM(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=i,a.__b=i.__b+1,l=null,(u=a.__i=LOt(a,n,c,h))!=-1&&(h--,(l=n[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(s>d?f--:s<d&&f++),typeof a.type!="function"&&(a.__u|=4)):u!=c&&(u==c-1?f--:u==c+1?f++:(u>c?f--:f++,a.__u|=4))):i.__k[o]=null;if(h)for(o=0;o<d;o++)(l=n[o])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=bI(l)),fOe(l,l));return r}function uOe(i,e,n){var r,s;if(typeof i.type=="function"){for(r=i.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=i,e=uOe(r[s],e,n));return e}i.__e!=e&&(e&&i.type&&!n.contains(e)&&(e=bI(i)),n.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Rj(i,e){return e=e||[],i==null||typeof i=="boolean"||(y4(i)?i.some(function(n){Rj(n,e)}):e.push(i)),e}function LOt(i,e,n,r){var s,o,a=i.key,l=i.type,c=e[n];if(c===null&&i.key==null||c&&a==c.key&&l==c.type&&(2&c.__u)==0)return n;if(r>(c!=null&&(2&c.__u)==0?1:0))for(s=n-1,o=n+1;s>=0||o<e.length;){if(s>=0){if((c=e[s])&&(2&c.__u)==0&&a==c.key&&l==c.type)return s;s--}if(o<e.length){if((c=e[o])&&(2&c.__u)==0&&a==c.key&&l==c.type)return o;o++}}return-1}function Cbe(i,e,n){e[0]=="-"?i.setProperty(e,n??""):i[e]=n==null?"":typeof n!="number"||xOt.test(e)?n:n+"px"}function aB(i,e,n,r,s){var o,a;e:if(e=="style")if(typeof n=="string")i.style.cssText=n;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)n&&e in n||Cbe(i.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||Cbe(i.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(oOe,"$1")),a=e.toLowerCase(),e=a in i||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),i.l||(i.l={}),i.l[e+o]=n,n?r?n.u=r.u:(n.u=Kle,i.addEventListener(e,o?wie:yie,o)):i.removeEventListener(e,o?wie:yie,o);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&n==1?"":n))}}function Sbe(i){return function(e){if(this.l){var n=this.l[e.type+i];if(e.t==null)e.t=Kle++;else if(e.t<n.u)return;return n(Xi.event?Xi.event(e):e)}}}function Xle(i,e,n,r,s,o,a,l,c,u){var d,h,f,p,g,m,_,b,y,x,k,D,R,E,A,M,N,P=e.type;if(e.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),o=[l=e.__e=n.__e]),(d=Xi.__b)&&d(e);e:if(typeof P=="function")try{if(b=e.props,y="prototype"in P&&P.prototype.render,x=(d=P.contextType)&&r[d.__c],k=d?x?x.props.value:d.__:r,n.__c?_=(h=e.__c=n.__c).__=h.__E:(y?e.__c=h=new P(b,k):(e.__c=h=new Sv(b,k),h.constructor=P,h.render=EOt),x&&x.sub(h),h.props=b,h.state||(h.state={}),h.context=k,h.__n=r,f=h.__d=!0,h.__h=[],h._sb=[]),y&&h.__s==null&&(h.__s=h.state),y&&P.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Dm({},h.__s)),Dm(h.__s,P.getDerivedStateFromProps(b,h.__s))),p=h.props,g=h.state,h.__v=e,f)y&&P.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),y&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(y&&P.getDerivedStateFromProps==null&&b!==p&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,k),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,k)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(h.props=b,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(O){O&&(O.__=e)}),D=0;D<h._sb.length;D++)h.__h.push(h._sb[D]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,k),y&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(p,g,m)})}if(h.context=k,h.props=b,h.__P=i,h.__e=!1,R=Xi.__r,E=0,y){for(h.state=h.__s,h.__d=!1,R&&R(e),d=h.render(h.props,h.state,h.context),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[]}else do h.__d=!1,R&&R(e),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++E<25);h.state=h.__s,h.getChildContext!=null&&(r=Dm(Dm({},r),h.getChildContext())),y&&!f&&h.getSnapshotBeforeUpdate!=null&&(m=h.getSnapshotBeforeUpdate(p,g)),M=d,d!=null&&d.type===vI&&d.key==null&&(M=hOe(d.props.children)),l=cOe(i,y4(M)?M:[M],e,n,r,s,o,a,l,c,u),h.base=e.__e,e.__u&=-161,h.__h.length&&a.push(h),_&&(h.__E=h.__=null)}catch(O){if(e.__v=null,c||o!=null)if(O.then){for(e.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,e.__e=l}else for(N=o.length;N--;)Gle(o[N]);else e.__e=n.__e,e.__k=n.__k;Xi.__e(O,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=DOt(n.__e,e,n,r,s,o,a,c,u);return(d=Xi.diffed)&&d(e),128&e.__u?void 0:l}function dOe(i,e,n){for(var r=0;r<n.length;r++)Yle(n[r],n[++r],n[++r]);Xi.__c&&Xi.__c(e,i),i.some(function(s){try{i=s.__h,s.__h=[],i.some(function(o){o.call(s)})}catch(o){Xi.__e(o,s.__v)}})}function hOe(i){return typeof i!="object"||i==null||i.__b&&i.__b>0?i:y4(i)?i.map(hOe):Dm({},i)}function DOt(i,e,n,r,s,o,a,l,c){var u,d,h,f,p,g,m,_=n.props,b=e.props,y=e.type;if(y=="svg"?s="http://www.w3.org/2000/svg":y=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((p=o[u])&&"setAttribute"in p==!!y&&(y?p.localName==y:p.nodeType==3)){i=p,o[u]=null;break}}if(i==null){if(y==null)return document.createTextNode(b);i=document.createElementNS(s,y,b.is&&b),l&&(Xi.__m&&Xi.__m(e,o),l=!1),o=null}if(y==null)_===b||l&&i.data==b||(i.data=b);else{if(o=o&&b4.call(i.childNodes),_=n.props||NO,!l&&o!=null)for(_={},u=0;u<i.attributes.length;u++)_[(p=i.attributes[u]).name]=p.value;for(u in _)if(p=_[u],u!="children"){if(u=="dangerouslySetInnerHTML")h=p;else if(!(u in b)){if(u=="value"&&"defaultValue"in b||u=="checked"&&"defaultChecked"in b)continue;aB(i,u,null,p,s)}}for(u in b)p=b[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?d=p:u=="value"?g=p:u=="checked"?m=p:l&&typeof p!="function"||_[u]===p||aB(i,u,p,_[u],s);if(d)l||h&&(d.__html==h.__html||d.__html==i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(h&&(i.innerHTML=""),cOe(e.type=="template"?i.content:i,y4(f)?f:[f],e,n,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":s,o,a,o?o[0]:n.__k&&bI(n,0),l,c),o!=null)for(u=o.length;u--;)Gle(o[u]);l||(u="value",y=="progress"&&g==null?i.removeAttribute("value"):g!=null&&(g!==i[u]||y=="progress"&&!g||y=="option"&&g!=_[u])&&aB(i,u,g,_[u],s),u="checked",m!=null&&m!=i[u]&&aB(i,u,m,_[u],s))}return i}function Yle(i,e,n){try{if(typeof i=="function"){var r=typeof i.__u=="function";r&&i.__u(),r&&e==null||(i.__u=i(e))}else i.current=e}catch(s){Xi.__e(s,n)}}function fOe(i,e,n){var r,s;if(Xi.unmount&&Xi.unmount(i),(r=i.ref)&&(r.current&&r.current!=i.__e||Yle(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){Xi.__e(o,e)}r.base=r.__P=null}if(r=i.__k)for(s=0;s<r.length;s++)r[s]&&fOe(r[s],e,n||typeof i.type!="function");n||Gle(i.__e),i.__c=i.__=i.__e=void 0}function EOt(i,e,n){return this.constructor(i,n)}function pOe(i,e,n){var r,s,o,a;e==document&&(e=document.documentElement),Xi.__&&Xi.__(i,e),s=(r=!1)?null:e.__k,o=[],a=[],Xle(e,i=e.__k=Sn(vI,null,[i]),s||NO,NO,e.namespaceURI,s?null:e.firstChild?b4.call(e.childNodes):null,o,s?s.__e:e.firstChild,r,a),dOe(o,i,a)}function gOe(i,e,n){var r,s,o,a,l=Dm({},i.props);for(o in i.type&&i.type.defaultProps&&(a=i.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?s=e[o]:l[o]=e[o]===void 0&&a!=null?a[o]:e[o];return arguments.length>2&&(l.children=arguments.length>3?b4.call(arguments,2):n),NM(i.type,l,r||i.key,s||i.ref,null)}b4=aOe.slice,Xi={__e:function(i,e,n,r){for(var s,o,a;e=e.__;)if((s=e.__c)&&!s.__)try{if((o=s.constructor)&&o.getDerivedStateFromError!=null&&(s.setState(o.getDerivedStateFromError(i)),a=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(i,r||{}),a=s.__d),a)return s.__E=s}catch(l){i=l}throw i}},nOe=0,iOe=function(i){return i!=null&&i.constructor==null},Sv.prototype.setState=function(i,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Dm({},this.state),typeof i=="function"&&(i=i(Dm({},n),this.props)),i&&Dm(n,i),i!=null&&this.__v&&(e&&this._sb.push(e),wbe(this))},Sv.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),wbe(this))},Sv.prototype.render=vI,sS=[],rOe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,sOe=function(i,e){return i.__v.__b-e.__v.__b},Tj.__r=0,oOe=/(PointerCapture)$|Capture$/i,Kle=0,yie=Sbe(!1),wie=Sbe(!0);var om,bG,xbe,mOe=[],Al=Xi,kbe=Al.__b,Lbe=Al.__r,Dbe=Al.diffed,Ebe=Al.__c,Ibe=Al.unmount,Tbe=Al.__;function IOt(){for(var i;i=mOe.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach($8),i.__H.__h.forEach(Cie),i.__H.__h=[]}catch(e){i.__H.__h=[],Al.__e(e,i.__v)}}Al.__b=function(i){om=null,kbe&&kbe(i)},Al.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Tbe&&Tbe(i,e)},Al.__r=function(i){Lbe&&Lbe(i);var e=(om=i.__c).__H;e&&(bG===om?(e.__h=[],om.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach($8),e.__h.forEach(Cie),e.__h=[])),bG=om},Al.diffed=function(i){Dbe&&Dbe(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(mOe.push(e)!==1&&xbe===Al.requestAnimationFrame||((xbe=Al.requestAnimationFrame)||TOt)(IOt)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),bG=om=null},Al.__c=function(i,e){e.some(function(n){try{n.__h.forEach($8),n.__h=n.__h.filter(function(r){return!r.__||Cie(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],Al.__e(r,n.__v)}}),Ebe&&Ebe(i,e)},Al.unmount=function(i){Ibe&&Ibe(i);var e,n=i.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{$8(r)}catch(s){e=s}}),n.__H=void 0,e&&Al.__e(e,n.__v))};var Rbe=typeof requestAnimationFrame=="function";function TOt(i){var e,n=function(){clearTimeout(r),Rbe&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(n,35);Rbe&&(e=requestAnimationFrame(n))}function $8(i){var e=om,n=i.__c;typeof n=="function"&&(i.__c=void 0,n()),om=e}function Cie(i){var e=om;i.__c=i.__(),om=e}function ROt(i,e){for(var n in e)i[n]=e[n];return i}function Abe(i,e){for(var n in i)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&i[r]!==e[r])return!0;return!1}function Nbe(i,e){this.props=i,this.context=e}(Nbe.prototype=new Sv).isPureReactComponent=!0,Nbe.prototype.shouldComponentUpdate=function(i,e){return Abe(this.props,i)||Abe(this.state,e)};var Mbe=Xi.__b;Xi.__b=function(i){i.type&&i.type.__f&&i.ref&&(i.props.ref=i.ref,i.ref=null),Mbe&&Mbe(i)};var AOt=Xi.__e;Xi.__e=function(i,e,n,r){if(i.then){for(var s,o=e;o=o.__;)if((s=o.__c)&&s.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),s.__c(i,e)}AOt(i,e,n,r)};var Pbe=Xi.unmount;function _Oe(i,e,n){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),i.__c.__H=null),(i=ROt({},i)).__c!=null&&(i.__c.__P===n&&(i.__c.__P=e),i.__c.__e=!0,i.__c=null),i.__k=i.__k&&i.__k.map(function(r){return _Oe(r,e,n)})),i}function vOe(i,e,n){return i&&n&&(i.__v=null,i.__k=i.__k&&i.__k.map(function(r){return vOe(r,e,n)}),i.__c&&i.__c.__P===e&&(i.__e&&n.appendChild(i.__e),i.__c.__e=!0,i.__c.__P=n)),i}function yG(){this.__u=0,this.o=null,this.__b=null}function bOe(i){var e=i.__.__c;return e&&e.__a&&e.__a(i)}function lB(){this.i=null,this.l=null}Xi.unmount=function(i){var e=i.__c;e&&e.__R&&e.__R(),e&&32&i.__u&&(i.type=null),Pbe&&Pbe(i)},(yG.prototype=new Sv).__c=function(i,e){var n=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var s=bOe(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,s?s(l):l())};n.__R=a;var l=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=vOe(c,c.__c.__P,c.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),i.then(a,a)},yG.prototype.componentWillUnmount=function(){this.o=[]},yG.prototype.render=function(i,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=_Oe(this.__b,n,r.__O=r.__P)}this.__b=null}var s=e.__a&&Sn(vI,null,i.fallback);return s&&(s.__u&=-33),[Sn(vI,null,e.__a?null:i.children),s]};var Obe=function(i,e,n){if(++n[1]===n[0]&&i.l.delete(e),i.props.revealOrder&&(i.props.revealOrder[0]!=="t"||!i.l.size))for(n=i.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;i.i=n=n[2]}};(lB.prototype=new Sv).__a=function(i){var e=this,n=bOe(e.__v),r=e.l.get(i);return r[0]++,function(s){var o=function(){e.props.revealOrder?(r.push(s),Obe(e,i,r)):s()};n?n(o):o()}},lB.prototype.render=function(i){this.i=null,this.l=new Map;var e=Rj(i.children);i.revealOrder&&i.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return i.children},lB.prototype.componentDidUpdate=lB.prototype.componentDidMount=function(){var i=this;this.l.forEach(function(e,n){Obe(i,n,e)})};var NOt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,MOt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,POt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,OOt=/[A-Z0-9]/g,FOt=typeof document<"u",BOt=function(i){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(i)};function Fbe(i,e,n){return e.__k==null&&(e.textContent=""),pOe(i,e),typeof n=="function"&&n(),i?i.__c:null}Sv.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(i){Object.defineProperty(Sv.prototype,i,{configurable:!0,get:function(){return this["UNSAFE_"+i]},set:function(e){Object.defineProperty(this,i,{configurable:!0,writable:!0,value:e})}})});var Bbe=Xi.event;function jOt(){}function WOt(){return this.cancelBubble}function $Ot(){return this.defaultPrevented}Xi.event=function(i){return Bbe&&(i=Bbe(i)),i.persist=jOt,i.isPropagationStopped=WOt,i.isDefaultPrevented=$Ot,i.nativeEvent=i};var zOt={enumerable:!1,configurable:!0,get:function(){return this.class}},jbe=Xi.vnode;Xi.vnode=function(i){typeof i.type=="string"&&function(e){var n=e.props,r=e.type,s={},o=r.indexOf("-")===-1;for(var a in n){var l=n[a];if(!(a==="value"&&"defaultValue"in n&&l==null||FOt&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var c=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?a="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||BOt(n.type)?c==="onfocus"?a="onfocusin":c==="onblur"?a="onfocusout":POt.test(a)&&(a=c):c=a="oninput":o&&MOt.test(a)?a=a.replace(OOt,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&s[a=c]&&(a="oninputCapture"),s[a]=l}}r=="select"&&s.multiple&&Array.isArray(s.value)&&(s.value=Rj(n.children).forEach(function(u){u.props.selected=s.value.indexOf(u.props.value)!=-1})),r=="select"&&s.defaultValue!=null&&(s.value=Rj(n.children).forEach(function(u){u.props.selected=s.multiple?s.defaultValue.indexOf(u.props.value)!=-1:s.defaultValue==u.props.value})),n.class&&!n.className?(s.class=n.class,Object.defineProperty(s,"className",zOt)):(n.className&&!n.class||n.class&&n.className)&&(s.class=s.className=n.className),e.props=s}(i),i.$$typeof=NOt,jbe&&jbe(i)};var Wbe=Xi.__r;Xi.__r=function(i){Wbe&&Wbe(i),i.__c};var $be=Xi.diffed;Xi.diffed=function(i){$be&&$be(i);var e=i.props,n=i.__e;n!=null&&i.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value)};function VOt(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function HOt(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):VOt(i)?i:null}function yOe(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}class wOe{constructor(e,n){this.uppy=e,this.opts=n??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return(e==null?void 0:e[this.id])||{}}setPluginState(e){const{plugins:n}=this.uppy.getState();this.uppy.setState({plugins:{...n,[this.id]:{...n[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new YPe([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}function zbe(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var UOt=0;function qOt(i){return"__private_"+UOt+++"_"+i}function KOt(i){let e=null,n;return function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=s,e||(e=Promise.resolve().then(()=>(e=null,i(...n)))),e}}var EA=qOt("updateUI");class MO extends wOe{constructor(){super(...arguments),Object.defineProperty(this,EA,{writable:!0,value:void 0})}getTargetPlugin(e){let n;if(typeof(e==null?void 0:e.addTarget)=="function")n=e,n instanceof MO||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:n,UIPlugin:MO}}));else if(typeof e=="function"){const r=e;this.uppy.iteratePlugins(s=>{s instanceof r&&(n=s)})}return n}mount(e,n){const r=n.id,s=HOt(e);if(s){this.isTargetDOMEl=!0;const l=document.createElement("div");return l.classList.add("uppy-Root"),zbe(this,EA)[EA]=KOt(c=>{this.uppy.getPlugin(this.id)&&(Fbe(this.render(c,l),l),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),Fbe(this.render(this.uppy.getState(),l),l),this.el=l,s.appendChild(l),l.dir=this.opts.direction||yOe(l)||"ltr",this.onMount(),this.el}const o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${r} to ${o.id}`),this.parent=o,this.el=o.addTarget(n),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let a=`Invalid target option given to ${r}.`;throw typeof e=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(a)}render(e,n){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var n,r;(n=(r=zbe(this,EA))[EA])==null||n.call(r,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}}function l0(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var GOt=0;function COe(i){return"__private_"+GOt+++"_"+i}var Wc=COe("uppy"),IA=COe("events");class XOt{constructor(e){Object.defineProperty(this,Wc,{writable:!0,value:void 0}),Object.defineProperty(this,IA,{writable:!0,value:[]}),l0(this,Wc)[Wc]=e}on(e,n){return l0(this,IA)[IA].push([e,n]),l0(this,Wc)[Wc].on(e,n)}remove(){for(const[e,n]of l0(this,IA)[IA].splice(0))l0(this,Wc)[Wc].off(e,n)}onFilePause(e,n){this.on("upload-pause",(r,s)=>{e===(r==null?void 0:r.id)&&n(s)})}onFileRemove(e,n){this.on("file-removed",r=>{e===r.id&&n(r.id)})}onPause(e,n){this.on("upload-pause",(r,s)=>{e===(r==null?void 0:r.id)&&n(s)})}onRetry(e,n){this.on("upload-retry",r=>{e===(r==null?void 0:r.id)&&n()})}onRetryAll(e,n){this.on("retry-all",()=>{l0(this,Wc)[Wc].getFile(e)&&n()})}onPauseAll(e,n){this.on("pause-all",()=>{l0(this,Wc)[Wc].getFile(e)&&n()})}onCancelAll(e,n){var r=this;this.on("cancel-all",function(){l0(r,Wc)[Wc].getFile(e)&&n(...arguments)})}onResumeAll(e,n){this.on("resume-all",()=>{l0(this,Wc)[Wc].getFile(e)&&n()})}}function gi(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var YOt=0;function yd(i){return"__private_"+YOt+++"_"+i}function ZOt(i){return new Error("Cancelled",{cause:i})}function Vbe(i){if(i!=null){var e;const n=()=>this.abort(i.reason);i.addEventListener("abort",n,{once:!0});const r=()=>{i.removeEventListener("abort",n)};(e=this.then)==null||e.call(this,r,r)}return this}var Ud=yd("activeRequests"),Zc=yd("queuedHandlers"),Wd=yd("paused"),cC=yd("pauseTimer"),$c=yd("downLimit"),uC=yd("upperLimit"),c0=yd("rateLimitingTimer"),MM=yd("call"),G0=yd("queueNext"),Sie=yd("next"),wG=yd("queue"),xie=yd("dequeue"),CG=yd("resume"),dC=yd("increaseLimit");class QOt{constructor(e){Object.defineProperty(this,xie,{value:i5t}),Object.defineProperty(this,wG,{value:n5t}),Object.defineProperty(this,Sie,{value:t5t}),Object.defineProperty(this,G0,{value:e5t}),Object.defineProperty(this,MM,{value:JOt}),Object.defineProperty(this,Ud,{writable:!0,value:0}),Object.defineProperty(this,Zc,{writable:!0,value:[]}),Object.defineProperty(this,Wd,{writable:!0,value:!1}),Object.defineProperty(this,cC,{writable:!0,value:void 0}),Object.defineProperty(this,$c,{writable:!0,value:1}),Object.defineProperty(this,uC,{writable:!0,value:void 0}),Object.defineProperty(this,c0,{writable:!0,value:void 0}),Object.defineProperty(this,CG,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,dC,{writable:!0,value:()=>{if(gi(this,Wd)[Wd]){gi(this,c0)[c0]=setTimeout(gi(this,dC)[dC],0);return}gi(this,$c)[$c]=this.limit,this.limit=Math.ceil((gi(this,uC)[uC]+gi(this,$c)[$c])/2);for(let n=gi(this,$c)[$c];n<=this.limit;n++)gi(this,G0)[G0]();gi(this,uC)[uC]-gi(this,$c)[$c]>3?gi(this,c0)[c0]=setTimeout(gi(this,dC)[dC],2e3):gi(this,$c)[$c]=Math.floor(gi(this,$c)[$c]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,n){return!gi(this,Wd)[Wd]&&gi(this,Ud)[Ud]<this.limit?gi(this,MM)[MM](e):gi(this,wG)[wG](e,n)}wrapSyncFunction(e,n){var r=this;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];const l=r.run(()=>(e(...o),queueMicrotask(()=>l.done()),()=>{}),n);return{abortOn:Vbe,abort(){l.abort()}}}}wrapPromiseFunction(e,n){var r=this;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];let l;const c=new Promise((u,d)=>{l=r.run(()=>{let h,f;try{f=Promise.resolve(e(...o))}catch(p){f=Promise.reject(p)}return f.then(p=>{h?d(h):(l.done(),u(p))},p=>{h?d(h):(l.done(),d(p))}),p=>{h=ZOt(p)}},n)});return c.abort=u=>{l.abort(u)},c.abortOn=Vbe,c}}resume(){gi(this,Wd)[Wd]=!1,clearTimeout(gi(this,cC)[cC]);for(let e=0;e<this.limit;e++)gi(this,G0)[G0]()}pause(e){e===void 0&&(e=null),gi(this,Wd)[Wd]=!0,clearTimeout(gi(this,cC)[cC]),e!=null&&(gi(this,cC)[cC]=setTimeout(gi(this,CG)[CG],e))}rateLimit(e){clearTimeout(gi(this,c0)[c0]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(gi(this,uC)[uC]=this.limit-1,this.limit=gi(this,$c)[$c],gi(this,c0)[c0]=setTimeout(gi(this,dC)[dC],e))}get isPaused(){return gi(this,Wd)[Wd]}}function JOt(i){gi(this,Ud)[Ud]+=1;let e=!1,n;try{n=i()}catch(r){throw gi(this,Ud)[Ud]-=1,r}return{abort:r=>{e||(e=!0,gi(this,Ud)[Ud]-=1,n==null||n(r),gi(this,G0)[G0]())},done:()=>{e||(e=!0,gi(this,Ud)[Ud]-=1,gi(this,G0)[G0]())}}}function e5t(){queueMicrotask(()=>gi(this,Sie)[Sie]())}function t5t(){if(gi(this,Wd)[Wd]||gi(this,Ud)[Ud]>=this.limit||gi(this,Zc)[Zc].length===0)return;const i=gi(this,Zc)[Zc].shift();if(i==null)throw new Error("Invariant violation: next is null");const e=gi(this,MM)[MM](i.fn);i.abort=e.abort,i.done=e.done}function n5t(i,e){const n={fn:i,priority:(e==null?void 0:e.priority)||0,abort:()=>{gi(this,xie)[xie](n)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=gi(this,Zc)[Zc].findIndex(s=>n.priority>s.priority);return r===-1?gi(this,Zc)[Zc].push(n):gi(this,Zc)[Zc].splice(r,0,n),n}function i5t(i){const e=gi(this,Zc)[Zc].indexOf(i);e!==-1&&gi(this,Zc)[Zc].splice(e,1)}const SG=Symbol("__queue");class kie extends Error{constructor(e,n){n===void 0&&(n=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=n}}function r5t(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}function qh(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var s5t=0;function bV(i){return"__private_"+s5t+++"_"+i}var u0=bV("aliveTimer"),hC=bV("isDone"),TA=bV("onTimedOut"),fC=bV("timeout");class o5t{constructor(e,n){Object.defineProperty(this,u0,{writable:!0,value:void 0}),Object.defineProperty(this,hC,{writable:!0,value:!1}),Object.defineProperty(this,TA,{writable:!0,value:void 0}),Object.defineProperty(this,fC,{writable:!0,value:void 0}),qh(this,fC)[fC]=e,qh(this,TA)[TA]=()=>n(e)}progress(){qh(this,hC)[hC]||qh(this,fC)[fC]>0&&(clearTimeout(qh(this,u0)[u0]),qh(this,u0)[u0]=setTimeout(qh(this,TA)[TA],qh(this,fC)[fC]))}done(){qh(this,hC)[hC]||(clearTimeout(qh(this,u0)[u0]),qh(this,u0)[u0]=void 0,qh(this,hC)[hC]=!0)}}const cB=()=>{};function a5t(i,e){e===void 0&&(e={});const{body:n=null,headers:r={},method:s="GET",onBeforeRequest:o=cB,onUploadProgress:a=cB,shouldRetry:l=()=>!0,onAfterResponse:c=cB,onTimeout:u=cB,responseType:d,retries:h=3,signal:f=null,timeout:p=3e4,withCredentials:g=!1}=e,m=y=>.3*2**(y-1)*1e3,_=new o5t(p,u);function b(y){return y===void 0&&(y=0),new Promise(async(x,k)=>{const D=new XMLHttpRequest,R=E=>{l(D)&&y<h?setTimeout(()=>{b(y+1).then(x,k)},m(y)):(_.done(),k(E))};D.open(s,i,!0),D.withCredentials=g,d&&(D.responseType=d),f==null||f.addEventListener("abort",()=>{D.abort(),k(new DOMException("Aborted","AbortError"))}),D.onload=async()=>{try{await c(D,y)}catch(E){E.request=D,R(E);return}D.status>=200&&D.status<300?(_.done(),x(D)):l(D)&&y<h?setTimeout(()=>{b(y+1).then(x,k)},m(y)):(_.done(),k(new kie(D.statusText,D)))},D.onerror=()=>R(new kie(D.statusText,D)),D.upload.onprogress=E=>{_.progress(),a(E)},r&&Object.keys(r).forEach(E=>{D.setRequestHeader(E,r[E])}),await o(D,y),D.send(n)})}return b()}function l5t(i){const e=n=>"error"in n&&!!n.error;return i.filter(n=>!e(n))}function c5t(i){return i.filter(e=>{var n;return!((n=e.progress)!=null&&n.uploadStarted)||!e.isRestored})}function SOe(i,e){return i===!0?Object.keys(e):Array.isArray(i)?i:[]}const u5t={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function X0(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var d5t=0;function rT(i){return"__private_"+d5t+++"_"+i}const h5t={version:"4.3.3"};function f5t(i,e){let n=e;return n||(n=new Error("Upload error")),typeof n=="string"&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),r5t(i)?(n=new kie(n,i),n):(n.request=i,n)}function Hbe(i){return i.data.slice(0,i.data.size,i.meta.type)}const p5t={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};var qS=rT("getFetcher"),Lie=rT("uploadLocalFile"),xG=rT("uploadBundle"),Die=rT("getCompanionClientArgs"),kG=rT("uploadFiles"),RA=rT("handleUpload");class xOe extends wOe{constructor(e,n){if(super(e,{...p5t,fieldName:n.bundle?"files[]":"file",...n}),Object.defineProperty(this,kG,{value:v5t}),Object.defineProperty(this,Die,{value:_5t}),Object.defineProperty(this,xG,{value:m5t}),Object.defineProperty(this,Lie,{value:g5t}),Object.defineProperty(this,qS,{writable:!0,value:void 0}),Object.defineProperty(this,RA,{writable:!0,value:async r=>{if(r.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[SG]&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const s=this.uppy.getFilesByIds(r),o=l5t(s),a=c5t(o);if(this.uppy.emit("upload-start",a),this.opts.bundle){if(o.some(c=>c.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await X0(this,xG)[xG](o)}else await X0(this,kG)[kG](o)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=u5t,this.i18nInit(),SG in this.opts?this.requests=this.opts[SG]:this.requests=new QOt(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if((n==null?void 0:n.allowedMetaFields)===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),X0(this,qS)[qS]=r=>async(s,o)=>{try{var a,l,c;const h=await a5t(s,{...o,onBeforeRequest:(g,m)=>{var _,b;return(_=(b=this.opts).onBeforeRequest)==null?void 0:_.call(b,g,m,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:g=>{const m=Math.ceil(g/1e3),_=new Error(this.i18n("uploadStalled",{seconds:m}));this.uppy.emit("upload-stalled",_,r)},onUploadProgress:g=>{if(g.lengthComputable)for(const{id:_}of r){var m;const b=this.uppy.getFile(_);this.uppy.emit("upload-progress",b,{uploadStarted:(m=b.progress.uploadStarted)!=null?m:0,bytesUploaded:g.loaded/g.total*b.size,bytesTotal:b.size})}}});let f=await((a=(l=this.opts).getResponseData)==null?void 0:a.call(l,h));if(h.responseType==="json"){var u;(u=f)!=null||(f=h.response)}else try{var d;(d=f)!=null||(f=JSON.parse(h.responseText))}catch(g){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:g})}const p=typeof((c=f)==null?void 0:c.url)=="string"?f.url:void 0;for(const{id:g}of r)this.uppy.emit("upload-success",this.uppy.getFile(g),{status:h.status,body:f,uploadURL:p});return h}catch(h){if(h.name==="AbortError")return;const f=h.request;for(const p of r)this.uppy.emit("upload-error",this.uppy.getFile(p.id),f5t(f,h),f);throw h}}}getOptions(e){const n=this.uppy.getState().xhrUpload,{headers:r}=this.opts,s={...this.opts,...n||{},...e.xhrUpload||{},headers:{}};return typeof r=="function"?s.headers=r(e):Object.assign(s.headers,this.opts.headers),n&&Object.assign(s.headers,n.headers),e.xhrUpload&&Object.assign(s.headers,e.xhrUpload.headers),s}addMetadata(e,n,r){SOe(r.allowedMetaFields,n).forEach(o=>{const a=n[o];Array.isArray(a)?a.forEach(l=>e.append(o,l)):e.append(o,a)})}createFormDataUpload(e,n){const r=new FormData;this.addMetadata(r,e.meta,n);const s=Hbe(e);return e.name?r.append(n.fieldName,s,e.meta.name):r.append(n.fieldName,s),r}createBundledUpload(e,n){const r=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(r,s,n),e.forEach(o=>{const a=this.getOptions(o),l=Hbe(o);o.name?r.append(a.fieldName,l,o.name):r.append(a.fieldName,l)}),r}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(X0(this,RA)[RA])}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(X0(this,RA)[RA])}}async function g5t(i){const e=new XOt(this.uppy),n=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{const s=this.getOptions(i),o=X0(this,qS)[qS]([i]),a=s.formData?this.createFormDataUpload(i,s):i.data;return o(s.endpoint,{...s,body:a,signal:n.signal})});e.onFileRemove(i.id,()=>n.abort()),e.onCancelAll(i.id,()=>{n.abort()});try{await r().abortOn(n.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{e.remove()}}async function m5t(i){const e=new AbortController,n=this.requests.wrapPromiseFunction(async()=>{var s;const o=(s=this.uppy.getState().xhrUpload)!=null?s:{},a=X0(this,qS)[qS](i),l=this.createBundledUpload(i,{...this.opts,...o});return a(this.opts.endpoint,{...this.opts,body:l,signal:e.signal})});function r(){e.abort()}this.uppy.once("cancel-all",r);try{await n().abortOn(e.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{this.uppy.off("cancel-all",r)}}function _5t(i){var e;const n=this.getOptions(i),r=SOe(n.allowedMetaFields,i.meta);return{...(e=i.remote)==null?void 0:e.body,protocol:"multipart",endpoint:n.endpoint,size:i.data.size,fieldname:n.fieldName,metadata:Object.fromEntries(r.map(s=>[s,i.meta[s]])),httpMethod:n.method,useFormData:n.formData,headers:n.headers}}async function v5t(i){await Promise.allSettled(i.map(e=>{if(e.isRemote){const n=()=>this.requests,r=new AbortController,s=a=>{a.id===e.id&&r.abort()};this.uppy.on("file-removed",s);const o=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,X0(this,Die)[Die](e),{signal:r.signal,getQueue:n});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),o}return X0(this,Lie)[Lie](e)}))}xOe.VERSION=h5t.version;const kOe=Array.from;function b5t(){const i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}function LOe(i,e,n,r){let{onSuccess:s}=r;i.readEntries(o=>{const a=[...e,...o];o.length?queueMicrotask(()=>{LOe(i,a,n,{onSuccess:s})}):s(a)},o=>{n(o),s(e)})}function DOe(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((n,r)=>i.file(n,r))},async*values(){const n=i.createReader();yield*await new Promise(s=>{LOe(n,[],e,{onSuccess:o=>s(o.map(a=>DOe(a,e)))})})},isSameEntry:void 0}}function EOe(i,e,n){try{return n===void 0&&(n=void 0),async function*(){const r=()=>`${e}/${i.name}`;if(i.kind==="file"){const s=await i.getFile();s!=null?(s.relativePath=e?r():null,yield s):n!=null&&(yield n)}else if(i.kind==="directory")for await(const s of i.values())yield*EOe(s,e?r():i.name);else n!=null&&(yield n)}()}catch(r){return Promise.reject(r)}}async function*y5t(i,e){const n=await Promise.all(Array.from(i.items,async r=>{let s;return s??(s=DOe(typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry(),e)),{fileSystemHandle:s,lastResortFile:r.getAsFile()}}));for(const{lastResortFile:r,fileSystemHandle:s}of n)if(s!=null)try{yield*EOe(s,"",r)}catch(o){r!=null?yield r:e(o)}else r!=null&&(yield r)}function w5t(i){const e=kOe(i.files);return Promise.resolve(e)}async function C5t(i,e){var n;const r=(n=e==null?void 0:e.logDropError)!=null?n:Function.prototype;try{const s=[];for await(const o of y5t(i,r))s.push(o);return s}catch{return w5t(i)}}const S5t={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}},x5t={version:"4.1.3"},k5t={inputName:"files[]",width:"100%",height:"100%"};let IOe=class TOe extends MO{constructor(e,n){super(e,{...k5t,...n}),this.isDragDropSupported=b5t(),this.addFiles=r=>{const s=r.map(o=>({source:this.id,name:o.name,type:o.type,data:o,meta:{relativePath:o.relativePath||null}}));try{this.uppy.addFiles(s)}catch(o){this.uppy.log(o)}},this.onInputChange=r=>{const s=kOe(r.currentTarget.files||[]);s.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(s)),r.currentTarget.value=""},this.handleDragOver=r=>{var s,o;r.preventDefault(),r.stopPropagation();const{types:a}=r.dataTransfer,l=a.some(u=>u==="Files"),{allowNewUpload:c}=this.uppy.getState();if(!l||!c){r.dataTransfer.dropEffect="none";return}r.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(s=(o=this.opts).onDragOver)==null||s.call(o,r)},this.handleDragLeave=r=>{var s,o;r.preventDefault(),r.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(s=(o=this.opts).onDragLeave)==null||s.call(o,r)},this.handleDrop=async r=>{var s,o;r.preventDefault(),r.stopPropagation(),this.setPluginState({isDraggingOver:!1});const a=c=>{this.uppy.log(c,"error")},l=await C5t(r.dataTransfer,{logDropError:a});l.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(l)),(s=(o=this.opts).onDrop)==null||s.call(o,r)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=S5t,this.i18nInit()}renderHiddenFileInput(){var e;const{restrictions:n}=this.uppy.opts;return Sn("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:r=>{this.fileInputRef=r},name:this.opts.inputName,multiple:n.maxNumberOfFiles!==1,accept:(e=n.allowedFileTypes)==null?void 0:e.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return Sn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},Sn("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return Sn("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:Sn("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return Sn("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){const e=`uppy-u-reset
uppy-DragDrop-container
${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
`,n={width:this.opts.width,height:this.opts.height};return Sn("button",{type:"button",className:e,style:n,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),Sn("div",{className:"uppy-DragDrop-inner"},TOe.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){const{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};IOe.VERSION=x5t.version;const L5t=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],D5t=/^(aria-|data-)/,Zle=i=>Object.fromEntries(Object.entries(i).filter(e=>{let[n]=e;return D5t.test(n)||L5t.includes(n)}));function ROe(i,e){const n=Zle(i);return Object.keys(i).some(r=>!Object.hasOwn(n,r)&&i[r]!==e[r])}class E5t extends $.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(ROe(this.props,e)){const{uppy:n,...r}={...this.props,target:this.container};this.plugin.setOptions(r)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e,locale:n,inputName:r,width:s,height:o,note:a,id:l}=this.props,c={id:l||"DragDrop",locale:n,inputName:r,width:s,height:o,note:a,target:this.container};e.use(IOe,c),this.plugin=e.getPlugin(c.id)}uninstallPlugin(e){e===void 0&&(e=this.props);const{uppy:n}=e;n.removePlugin(this.plugin)}render(){return $.createElement("div",{className:"uppy-Container",ref:e=>{this.container=e},...Zle(this.props)})}}const I5t=ye(E5t)(({theme:i})=>({"& .uppy-DragDrop-container":{padding:"1.5rem 1rem",width:"100%",backgroundColor:"transparent",border:`2px dashed ${i.palette.divider}`,borderRadius:"8px","& .uppy-DragDrop-inner":{display:"flex",flexDirection:"column",alignItems:"center",padding:0,"&:before":{content:'""',display:"block",width:"1.5rem",height:"1.5rem",mask:`url(
data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWZpbGUtdXAtaWNvbiBsdWNpZGUtZmlsZS11cCI+PHBhdGggZD0iTTE1IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY3WiIvPjxwYXRoIGQ9Ik0xNCAydjRhMiAyIDAgMCAwIDIgMmg0Ii8+PHBhdGggZD0iTTEyIDEydjYiLz48cGF0aCBkPSJtMTUgMTUtMy0zLTMgMyIvPjwvc3ZnPg==
)`,maskSize:"contain",maskPosition:"center",maskRepeat:"no-repeat",backgroundColor:i.palette.primary.main,margin:"0.5rem"},"& .uppy-DragDrop-arrow":{display:"none"}},"& .uppy-DragDrop-label":{fontSize:"1rem",fontWeight:500,color:i.palette.text.primary,lineHeight:1.5,textAlign:"center","& .uppy-DragDrop-browse":{color:i.palette.primary.main,textDecoration:"underline",fontWeight:400}}}})),T5t=i=>C.jsxs(Ye,{sx:{position:"relative"},children:[C.jsx(I5t,{locale:{strings:{dropHereOr:"%{browse} or drop here",browse:"Browse"}},height:"120px",...i}),C.jsx(Ye,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,pointerEvents:"none",marginTop:"-1rem"}})]});function Ube(i,e,n,r){return i===e?i:r===0?e:i+(e-i)*2**(-r/n)}const Xg={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var LG={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/var qbe;function AOe(){return qbe||(qbe=1,function(i){(function(){var e={}.hasOwnProperty;function n(){for(var o="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(o=s(o,r(l)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var l in o)e.call(o,l)&&o[l]&&(a=s(a,l));return a}function s(o,a){return a?o?o+" "+a:o+a:o}i.exports?(n.default=n,i.exports=n):window.classNames=n})()}(LG)),LG.exports}var R5t=AOe();const Aj=ql(R5t);function DG(i){const e=[];let n="indeterminate",r;for(const{progress:o}of Object.values(i)){const{preprocess:a,postprocess:l}=o;r==null&&(a||l)&&({mode:n,message:r}=a||l),(a==null?void 0:a.mode)==="determinate"&&e.push(a.value),(l==null?void 0:l.mode)==="determinate"&&e.push(l.value)}const s=e.reduce((o,a)=>o+a/e.length,0);return{mode:n,message:r,value:s}}function A5t(i){const e=Math.floor(i/3600)%24,n=Math.floor(i/60)%60,r=Math.floor(i%60);return{hours:e,minutes:n,seconds:r}}function N5t(i){const e=A5t(i),n=e.hours===0?"":`${e.hours}h`,r=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,s=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${n}${r}${s}`}const M5t="·",Kbe=()=>` ${M5t} `;function P5t(i){const{newFiles:e,isUploadStarted:n,recoveredState:r,i18n:s,uploadState:o,isSomeGhost:a,startUpload:l}=i,c=Aj("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===Xg.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),u=e&&n&&!r?s("uploadXNewFiles",{smart_count:e}):s("uploadXFiles",{smart_count:e});return Sn("button",{type:"button",className:c,"aria-label":s("uploadXFiles",{smart_count:e}),onClick:l,disabled:a,"data-uppy-super-focusable":!0},u)}function O5t(i){const{i18n:e,uppy:n}=i;return Sn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>n.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},Sn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},Sn("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e("retry"))}function F5t(i){const{i18n:e,uppy:n}=i;return Sn("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>n.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},Sn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},Sn("g",{fill:"none",fillRule:"evenodd"},Sn("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Sn("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function B5t(i){const{isAllPaused:e,i18n:n,isAllComplete:r,resumableUploads:s,uppy:o}=i,a=n(e?"resume":"pause");function l(){if(!r){if(!s){o.cancelAll();return}if(e){o.resumeAll();return}o.pauseAll()}}return Sn("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:l,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},Sn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},Sn("g",{fill:"none",fillRule:"evenodd"},Sn("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Sn("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function j5t(i){const{i18n:e,doneButtonHandler:n}=i;return Sn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:n,"data-uppy-super-focusable":!0},e("done"))}function NOe(){return Sn("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},Sn("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function W5t(i){const{progress:e}=i,{value:n,mode:r,message:s}=e;return Sn("div",{className:"uppy-StatusBar-content"},Sn(NOe,null),r==="determinate"?`${Math.round(n*100)}% · `:"",s)}function $5t(i){const{numUploads:e,complete:n,totalUploadedSize:r,totalSize:s,totalETA:o,i18n:a}=i,l=e>1,c=E2(r);return Sn("div",{className:"uppy-StatusBar-statusSecondary"},l&&a("filesUploadedOfTotal",{complete:n,smart_count:e}),Sn("span",{className:"uppy-StatusBar-additionalInfo"},l&&Kbe(),s!=null?a("dataUploadedOfTotal",{complete:c,total:E2(s)}):a("dataUploadedOfUnknown",{complete:c}),Kbe(),o!=null&&a("xTimeLeft",{time:N5t(o)})))}function MOe(i){const{i18n:e,complete:n,numUploads:r}=i;return Sn("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:n,smart_count:r}))}function z5t(i){const{i18n:e,newFiles:n,startUpload:r}=i,s=Aj("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return Sn("div",{className:"uppy-StatusBar-statusSecondary"},Sn("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:n})),Sn("button",{type:"button",className:s,"aria-label":e("uploadXFiles",{smart_count:n}),onClick:r},e("upload")))}function V5t(i){const{i18n:e,supportsUploadProgress:n,totalProgress:r,showProgressDetails:s,isUploadStarted:o,isAllComplete:a,isAllPaused:l,newFiles:c,numUploads:u,complete:d,totalUploadedSize:h,totalSize:f,totalETA:p,startUpload:g}=i,m=c&&o;if(!o||a)return null;const _=e(l?"paused":"uploading");function b(){return!l&&!m&&s?n?Sn($5t,{numUploads:u,complete:d,totalUploadedSize:h,totalSize:f,totalETA:p,i18n:e}):Sn(MOe,{i18n:e,complete:d,numUploads:u}):null}return Sn("div",{className:"uppy-StatusBar-content","aria-label":_,title:_},l?null:Sn(NOe,null),Sn("div",{className:"uppy-StatusBar-status"},Sn("div",{className:"uppy-StatusBar-statusPrimary"},n&&r!==0?`${_}: ${r}%`:_),b(),m?Sn(z5t,{i18n:e,newFiles:c,startUpload:g}):null))}function H5t(i){const{i18n:e}=i;return Sn("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},Sn("div",{className:"uppy-StatusBar-status"},Sn("div",{className:"uppy-StatusBar-statusPrimary"},Sn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},Sn("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function U5t(i){const{error:e,i18n:n,complete:r,numUploads:s}=i;function o(){const a=`${n("uploadFailed")}
${e}`;alert(a)}return Sn("div",{className:"uppy-StatusBar-content",title:n("uploadFailed")},Sn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},Sn("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),Sn("div",{className:"uppy-StatusBar-status"},Sn("div",{className:"uppy-StatusBar-statusPrimary"},n("uploadFailed"),Sn("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":n("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:o,type:"button"},"?")),Sn(MOe,{i18n:n,complete:r,numUploads:s})))}const{STATE_ERROR:Gbe,STATE_WAITING:q5t,STATE_PREPROCESSING:EG,STATE_UPLOADING:uB,STATE_POSTPROCESSING:IG,STATE_COMPLETE:dB}=Xg;function K5t(i){let{newFiles:e,allowNewUpload:n,isUploadInProgress:r,isAllPaused:s,resumableUploads:o,error:a,hideUploadButton:l=void 0,hidePauseResumeButton:c=!1,hideCancelButton:u=!1,hideRetryButton:d=!1,recoveredState:h,uploadState:f,totalProgress:p,files:g,supportsUploadProgress:m,hideAfterFinish:_=!1,isSomeGhost:b,doneButtonHandler:y=void 0,isUploadStarted:x,i18n:k,startUpload:D,uppy:R,isAllComplete:E,showProgressDetails:A=void 0,numUploads:M,complete:N,totalSize:P,totalETA:O,totalUploadedSize:B}=i;function j(){switch(f){case IG:case EG:{const qe=DG(g);return qe.mode==="determinate"?qe.value*100:p}case Gbe:return null;case uB:return m?p:null;default:return p}}function z(){switch(f){case IG:case EG:{const{mode:qe}=DG(g);return qe==="indeterminate"}case uB:return!m;default:return!1}}const H=j(),Y=H??100,X=!a&&e&&(!r&&!s||h)&&n&&!l,Q=!u&&f!==q5t&&f!==dB,ie=o&&!c&&f===uB,K=a&&!E&&!d,ee=y&&f===dB,le=Aj("uppy-StatusBar-progress",{"is-indeterminate":z()}),ke=Aj("uppy-StatusBar",`is-${f}`,{"has-ghosts":b}),xe=(()=>{switch(f){case EG:case IG:return Sn(W5t,{progress:DG(g)});case dB:return Sn(H5t,{i18n:k});case Gbe:return Sn(U5t,{error:a,i18n:k,numUploads:M,complete:N});case uB:return Sn(V5t,{i18n:k,supportsUploadProgress:m,totalProgress:p,showProgressDetails:A,isUploadStarted:x,isAllComplete:E,isAllPaused:s,newFiles:e,numUploads:M,complete:N,totalUploadedSize:B,totalSize:P,totalETA:O,startUpload:D});default:return null}})();return!(X||K||ie||Q||ee)&&!xe||f===dB&&_?null:Sn("div",{className:ke},Sn("div",{className:le,style:{width:`${Y}%`},role:"progressbar","aria-label":`${Y}%`,"aria-valuetext":`${Y}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":H}),xe,Sn("div",{className:"uppy-StatusBar-actions"},X?Sn(P5t,{newFiles:e,isUploadStarted:x,recoveredState:h,i18n:k,isSomeGhost:b,startUpload:D,uploadState:f}):null,K?Sn(O5t,{i18n:k,uppy:R}):null,ie?Sn(B5t,{isAllPaused:s,i18n:k,isAllComplete:E,resumableUploads:o,uppy:R}):null,Q?Sn(F5t,{i18n:k,uppy:R}):null,ee?Sn(j5t,{i18n:k,doneButtonHandler:y}):null))}const G5t={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function So(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var X5t=0;function sT(i){return"__private_"+X5t+++"_"+i}const Y5t={version:"4.1.3"},Z5t=2e3,Q5t=2e3;function J5t(i,e,n,r){if(i)return Xg.STATE_ERROR;if(e)return Xg.STATE_COMPLETE;if(n)return Xg.STATE_WAITING;let s=Xg.STATE_WAITING;const o=Object.keys(r);for(let a=0;a<o.length;a++){const{progress:l}=r[o[a]];if(l.uploadStarted&&!l.uploadComplete)return Xg.STATE_UPLOADING;l.preprocess&&(s=Xg.STATE_PREPROCESSING),l.postprocess&&s!==Xg.STATE_PREPROCESSING&&(s=Xg.STATE_POSTPROCESSING)}return s}const e4t={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};var sf=sT("lastUpdateTime"),Cp=sT("previousUploadedBytes"),P0=sT("previousSpeed"),zd=sT("previousETA"),TG=sT("computeSmoothETA"),AA=sT("onUploadStart");let POe=class extends MO{constructor(e,n){super(e,{...e4t,...n}),Object.defineProperty(this,TG,{value:t4t}),Object.defineProperty(this,sf,{writable:!0,value:void 0}),Object.defineProperty(this,Cp,{writable:!0,value:void 0}),Object.defineProperty(this,P0,{writable:!0,value:void 0}),Object.defineProperty(this,zd,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,AA,{writable:!0,value:()=>{const{recoveredState:r}=this.uppy.getState();if(So(this,P0)[P0]=null,So(this,zd)[zd]=null,r){So(this,Cp)[Cp]=Object.values(r.files).reduce((s,o)=>{let{progress:a}=o;return s+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}So(this,sf)[sf]=performance.now(),So(this,Cp)[Cp]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=G5t,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:n,files:r,allowNewUpload:s,totalProgress:o,error:a,recoveredState:l}=e,{newFiles:c,startedFiles:u,completeFiles:d,isUploadStarted:h,isAllComplete:f,isAllPaused:p,isUploadInProgress:g,isSomeGhost:m}=this.uppy.getObjectOfFilesPerState(),_=l?Object.values(r):c,b=!!n.resumableUploads,y=n.uploadProgress!==!1;let x=null,k=0;u.every(R=>R.progress.bytesTotal!=null&&R.progress.bytesTotal!==0)?(x=0,u.forEach(R=>{x+=R.progress.bytesTotal||0,k+=R.progress.bytesUploaded||0})):u.forEach(R=>{k+=R.progress.bytesUploaded||0});const D=So(this,TG)[TG]({uploaded:k,total:x});return K5t({error:a,uploadState:J5t(a,f,l,e.files||{}),allowNewUpload:s,totalProgress:o,totalSize:x,totalUploadedSize:k,isAllComplete:!1,isAllPaused:p,isUploadStarted:h,isUploadInProgress:g,isSomeGhost:m,recoveredState:l,complete:d.length,newFiles:_.length,numUploads:u.length,totalETA:D,files:r,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:b,supportsUploadProgress:y,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){const e=this.el;yOe(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",So(this,AA)[AA]),So(this,sf)[sf]=performance.now(),So(this,Cp)[Cp]=this.uppy.getFiles().reduce((n,r)=>n+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",So(this,AA)[AA])}};function t4t(i){var e,n;if(i.total==null||i.total===0)return null;const r=i.total-i.uploaded;if(r<=0)return null;(n=(e=So(this,sf))[sf])!=null||(e[sf]=performance.now());const s=performance.now()-So(this,sf)[sf];if(s===0){var o;return Math.round(((o=So(this,zd)[zd])!=null?o:0)/100)/10}const a=i.uploaded-So(this,Cp)[Cp];if(So(this,Cp)[Cp]=i.uploaded,a<=0){var l;return Math.round(((l=So(this,zd)[zd])!=null?l:0)/100)/10}const c=a/s,u=So(this,P0)[P0]==null?c:Ube(c,So(this,P0)[P0],Z5t,s);So(this,P0)[P0]=u;const d=r/u,h=Math.max(So(this,zd)[zd]-s,0),f=So(this,zd)[zd]==null?d:Ube(d,h,Q5t,s);return So(this,zd)[zd]=f,So(this,sf)[sf]=performance.now(),Math.round(f/100)/10}POe.VERSION=Y5t.version;class n4t extends $.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(ROe(this.props,e)){const{uppy:n,...r}={...this.props,target:this.container};this.plugin.setOptions(r)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e,hideUploadButton:n,hideRetryButton:r,hidePauseResumeButton:s,hideCancelButton:o,showProgressDetails:a,hideAfterFinish:l,doneButtonHandler:c,id:u}=this.props,d={id:u||"StatusBar",hideUploadButton:n,hideRetryButton:r,hidePauseResumeButton:s,hideCancelButton:o,showProgressDetails:a,hideAfterFinish:l,doneButtonHandler:c,target:this.container};e.use(POe,d),this.plugin=e.getPlugin(d.id)}uninstallPlugin(e){e===void 0&&(e=this.props);const{uppy:n}=e;n.removePlugin(this.plugin)}render(){return $.createElement("div",{className:"uppy-Container",ref:e=>{this.container=e},...Zle(this.props)})}}const i4t=ye(n4t)(({theme:i})=>({"& .uppy-StatusBar":{backgroundColor:i.palette.background.paper}})),Xbe=ye(({className:i,...e})=>{const n={...e};return delete n.active,delete n.completed,delete n.error,C.jsx("div",{className:i,...n})})(({theme:i,active:e,completed:n,error:r})=>{let s=i.palette.grey[400];return r?s=i.palette.error.main:(e||n)&&(s=i.palette.primary.main),{width:12,height:12,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:s,color:i.palette.common.white,fontSize:"8px",transition:"all 0.2s ease-in-out",...n&&{"&::before":{content:'"✓"',fontSize:"8px"}}}}),OOe=({onSubmit:i,onComplete:e,sx:n})=>{const{client:r}=Ur(),{enqueueSnackbar:s,closeSnackbar:o}=pu(),[a,l]=$.useState(0),[c,u]=$.useState(""),[d,h]=$.useState(!1),[f,p]=$.useState(""),g=$.useRef(null);function m(E){const M=["<",">",":",'"',"/","\\","|","?","*","\0",""].find(N=>E.includes(N));return M!==void 0?`Collection name cannot contain "${M}" char`:null}const _=255,b=()=>{const E=r.getApiKey();return E?{"api-key":E}:{}},y=new vV({restrictions:{maxNumberOfFiles:1,allowedFileTypes:["application/x-tar",".snapshot"]},autoProceed:!0});y.use(xOe,{id:"XHRUpload",endpoint:r.getSnapshotUploadUrl(c).href,headers:b(),formData:!0,fieldName:"snapshot"}),y.on("upload-error",(E,A,M)=>{var P,O;const N=((O=(P=M==null?void 0:M.body)==null?void 0:P.status)==null?void 0:O.error)||A.message||"Unknown error";s(`Upload failed: ${N}`,{variant:"error",autoHideDuration:null,action:B=>C.jsx(Ci,{variant:"outlined",color:"inherit",onClick:()=>{o(B)},children:"Dismiss"}),anchorOrigin:{vertical:"bottom",horizontal:"center"}})}),y.on("upload-success",()=>{R()}),y.on("complete",E=>{i(),E.failed.length===0&&e()}),$.useEffect(()=>(a===0&&g.current.focus(),()=>{y.cancelAll()}),[y,a]);const x=E=>{const A=E.target.value,M=m(A),N=M!==null,P=(A==null?void 0:A.length)<1,O=(A==null?void 0:A.length)>_;u(A),h(P||O||N),p(P?"Collection name is too short":O?"Collection name is too long":M)},k=()=>{l(E=>E+1)},D=()=>{l(E=>E-1),y.cancelAll()},R=()=>{l(3)};return C.jsxs(Ye,{sx:{...n},children:[C.jsxs(nYe,{activeStep:a,orientation:"vertical",sx:{"& .MuiStepConnector-root, & .MuiStepContent-root":{marginLeft:"0.3125rem"},"& .MuiCollapse-wrapperInner":{paddingTop:"0.5rem"},"& .MuiStepLabel-root":{fontSize:"1rem",fontWeight:400,"& .MuiStepLabel-iconContainer":{paddingRight:"1rem"}}},children:[C.jsxs(khe,{children:[C.jsx(WZ,{slots:{stepIcon:Xbe},children:"Step 1 - Enter a collection name"}),C.jsxs(Dhe,{children:[C.jsx(Je,{mb:2,sx:{fontSize:"0.875rem",fontWeight:500},children:"Can be new or existing"}),C.jsx(Ye,{sx:{mb:2},children:C.jsx(Ep,{error:d,id:"collection-name",placeholder:"Collection Name",value:c,helperText:d?f:"",onChange:x,fullWidth:!0,inputRef:g,onKeyDown:E=>{if(E.key==="Enter"){if(E.preventDefault(),d)return;if(!c){h(!0);return}k()}}})}),C.jsx(Ye,{sx:{mb:2},children:C.jsx(Ci,{variant:"contained",onClick:k,sx:{mt:1,mr:1},disabled:!c||d,children:"Continue"})})]})]},"Step 1 - enter a collection name"),C.jsxs(khe,{children:[C.jsx(WZ,{slots:{stepIcon:Xbe},children:"Step 2 - Upload a snapshot file"}),C.jsxs(Dhe,{children:[C.jsxs(Ye,{sx:{mb:2},children:[C.jsx(T5t,{uppy:y}),C.jsx(i4t,{uppy:y})]}),C.jsx(Ye,{mb:2,children:C.jsx(Ci,{variant:"contained",onClick:D,sx:{mt:1,mr:1},children:"Back"})})]})]},"Step 2 - upload a snapshot file")]}),a===3&&C.jsx(du,{square:!0,elevation:0,sx:{p:3},children:C.jsx(Je,{children:"All steps completed - you're finished 🎉"})})]})};OOe.propTypes={onSubmit:Z.func.isRequired,onComplete:Z.func.isRequired,sx:Z.object};const FOe=({onComplete:i,sx:e})=>{const n=$i(),r=FW(n.breakpoints.down("sm")),[s,o]=nn.useState(!1),{isRestricted:a}=Ur(),l=()=>{a||o(!0)},c=()=>{setTimeout(()=>{o(!1)},1e3)};return C.jsxs(Ye,{sx:{...e},children:[C.jsx(ua,{title:a?"Access Denied: You do not have permission to upload snapshot. Please contact your administrator.":"Upload snapshot",placement:"left",children:C.jsx("span",{children:C.jsx(Ci,{variant:"outlined",onClick:l,startIcon:C.jsx(OMt,{fontSize:"small"}),disabled:a,children:"Upload snapshot"})})}),C.jsxs(Vm,{fullScreen:r,fullWidth:!0,maxWidth:"sm",open:s,onClose:()=>o(!1),"aria-labelledby":"Snapshot upload dialog","aria-describedby":"Snapshot upload dialog",children:[C.jsx(tx,{children:"Upload a Snapshot"}),C.jsx(a1,{children:C.jsx(OOe,{onSubmit:c,onComplete:i})})]})]})};FOe.propTypes={onComplete:Z.func,sx:Z.object};const z8=(i,e={})=>{var a,l;const{fallbackMessage:n="Something went wrong.",withApiKey:r=null}=e,{apiKey:s}=r||{};let o;try{const c=i.getActualType();if((c.status===401||c.status===403)&&r)return s?"Your API key is invalid. Please, set a new one.":null;o=((l=(a=c.data)==null?void 0:a.status)==null?void 0:l.error)||i.message||n}catch{o=(i==null?void 0:i.message)||n}return o},w4=ye(LYe)(({theme:i})=>({borderRadius:"0.5rem",border:`1px solid ${Pt(i.palette.divider,.12)}`})),C4=ye(OW)(({theme:i})=>({backgroundColor:i.palette.background.default,borderBottom:`1px solid ${Pt(i.palette.divider,.12)}`})),Yc=ye(ki)(({theme:i})=>({padding:"0.5rem 1rem",fontSize:"0.75rem",fontWeight:400,lineHeight:1.5,color:i.palette.text.secondary,textTransform:"uppercase",letterSpacing:"0.5px"})),S4=ye(PW)(({theme:i})=>({backgroundColor:i.palette.background.paperElevation1})),fk=ye(ng)(({theme:i})=>({padding:"1rem",borderBottom:`1px solid ${Pt(i.palette.divider,.12)}`,"&:last-child":{borderBottom:"none"},"& .MuiTableCell-root":{padding:"1rem",borderBottom:"none",fontSize:"1rem",fontWeight:400,lineHeight:1.5,color:i.palette.text.primary}})),Ybe=ye(lh)({textDecoration:"none",color:"inherit","&:hover":{textDecoration:"underline",textDecorationThickness:"1px",textUnderlineOffset:"2px"}}),x4=({open:i,onClose:e,title:n,content:r,warning:s,actionName:o,actionHandler:a})=>{const l=()=>{a(),e()};return C.jsxs(Vm,{open:i,fullWidth:!0,children:[C.jsx(Ye,{sx:{display:"flex",p:3},children:C.jsxs("div",{children:[C.jsx(Je,{variant:"h5",children:n}),r&&C.jsx(Je,{sx:{mt:2},variant:"body1",children:r})]})}),s&&C.jsx(Ye,{sx:{px:3,mb:2},children:C.jsx(l_,{severity:"error",children:C.jsxs(Je,{color:"error.main.dark",component:"span",children:[C.jsx("b",{children:"Warning:"})," ",s]})})}),C.jsxs(Ye,{sx:{display:"flex",justifyContent:"flex-end",px:3,py:3},children:[C.jsx(Ci,{size:"medium",sx:{mr:2},variant:"outlined",color:"inherit",onClick:e,children:"Cancel"}),C.jsx(Ci,{size:"medium",sx:s?{backgroundColor:"error.main",color:"error.contrastText","&:hover":{backgroundColor:"error.dark"}}:{},variant:"contained",onClick:l,"data-testid":`confirm-${o.toLowerCase()}-button`,children:o})]})]})};x4.propTypes={open:Z.bool.isRequired,onClose:Z.func.isRequired,title:Z.string.isRequired,content:Z.string,warning:Z.string,actionName:Z.string.isRequired,actionHandler:Z.func.isRequired};function BOe({open:i,setOpen:e,collectionName:n,getCollectionsCall:r}){const[s,o]=$.useState(!1),[a,l]=$.useState(""),{client:c}=Ur();async function u(){try{await c.deleteCollection(n),r(),e(!1),o(!1)}catch(h){l(`Deletion Unsuccessful, error: ${h.message}`),o(!0),e(!1)}}const d=()=>{e(!1)};return C.jsxs(C.Fragment,{children:[s&&C.jsx(g4,{message:a}),C.jsx(x4,{open:i,onClose:d,title:"Do you want to delete "+n+"?",warning:"Deleting a collection cannot be undone. Make sure you have backed up all important data before proceeding.",actionName:"Delete",actionHandler:u,"aria-label":"Delete Collection Confirmation Dialog"})]})}BOe.propTypes={collectionName:Z.string.isRequired,setOpen:Z.func.isRequired,open:Z.bool.isRequired,getCollectionsCall:Z.func.isRequired};function jOe({children:i,...e}){const[n,r]=nn.useState(null),s=!!n,o=l=>{r(l.currentTarget)},a=()=>{r(null)};return C.jsxs("div",{...e,children:[C.jsx(Ga,{id:"basic-button","aria-controls":s?"actions-menu":void 0,"aria-haspopup":"true","aria-expanded":s?"true":void 0,onClick:o,children:C.jsx(NMt,{})}),C.jsx(wLe,{id:"basic-menu",anchorEl:n,open:s,onClose:a,slotProps:{list:{"aria-labelledby":"basic-button",sx:{width:"220px"}}},transformOrigin:{vertical:"top",horizontal:"center"},children:i})]})}jOe.propTypes={children:Z.oneOfType([Z.arrayOf(Z.oneOfType([Z.node])),Z.node])};const r4t=$.memo(jOe),s4t=ye(Ye)(({status:i,theme:e})=>{const r=(s=>{switch(s==null?void 0:s.toLowerCase()){case"green":return{backgroundColor:Pt(e.palette.success.main,.08),dotColor:e.palette.success.main,textColor:e.palette.success.main};case"yellow":return{backgroundColor:Pt(e.palette.warning.main,.08),dotColor:e.palette.warning.main,textColor:e.palette.warning.main};case"grey":return{backgroundColor:Pt(e.palette.text.secondary,.08),dotColor:e.palette.text.secondary,textColor:e.palette.text.secondary};case"red":return{backgroundColor:Pt(e.palette.error.main,.08),dotColor:e.palette.error.main,textColor:e.palette.error.main};default:return{backgroundColor:Pt(e.palette.success.main,.08),dotColor:e.palette.success.main,textColor:e.palette.success.main}}})(i);return{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 6px",borderRadius:"52px",backgroundColor:r.backgroundColor,maxWidth:"170px","& .status-dot":{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r.dotColor,flexShrink:0},"& .status-text":{fontSize:"12px",fontWeight:500,lineHeight:1.5,color:r.textColor,textTransform:"uppercase"}}}),WOe=({status:i,collectionName:e})=>C.jsxs(s4t,{status:i,component:lh,to:`/collections/${e}#info`,sx:{textDecoration:"none"},children:[C.jsx("div",{className:"status-dot"}),C.jsx(Je,{className:"status-text",children:i})]});WOe.propTypes={status:Z.string.isRequired,collectionName:Z.string.isRequired};const pC=ye(({title:i,...e})=>C.jsx(ua,{title:i,children:C.jsx(JS,{...e})}))(({theme:i})=>({height:"1.5rem",borderRadius:"0.5rem",fontSize:"0.8125rem",lineHeight:"1.125rem",color:i.palette.text.secondary,backgroundColor:"transparent",border:`1px solid ${i.palette.divider}`,"& .MuiChip-label":{padding:"0.1875rem 0.375rem"}})),hB=ye(Ye)({display:"flex",gap:"0.1rem",justifyContent:"center",alignItems:"center",flexWrap:"wrap"}),Qle=({collectionConfigParams:i,collectionName:e,sx:n={}})=>{const r=z1(),s=()=>{e&&r(`/collections/${e}#info`)},o=(c,u)=>{const d=[C.jsx(pC,{label:c||"Default",title:"Vector Name"},"name"),C.jsx(pC,{label:u.size,title:"Size"},"size"),C.jsx(pC,{label:u.distance,title:"Distance"},"distance")];return u.model&&d.push(C.jsx(pC,{label:u.model,title:"Model"},"model")),d},a=c=>[C.jsx(pC,{label:c,title:"Vector Name"},"name"),C.jsx(pC,{label:"Sparse",title:"Type"},"type")],l=[];if(i.vectors.size&&l.push(C.jsx(hB,{children:o("Default",i.vectors)},"default-vector")),i.vectors.size||Object.keys(i.vectors).forEach(c=>{l.push(C.jsx(hB,{children:o(c,i.vectors[c])},c))}),i.sparse_vectors&&Object.keys(i.sparse_vectors).forEach(c=>{l.push(C.jsx(hB,{children:a(c)},`sparse-${c}`))}),l.length>3){const c=l.slice(0,3),u=C.jsx(hB,{children:C.jsx(pC,{label:C.jsx(Ye,{sx:{width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center"},children:C.jsx(ntt,{size:18})}),title:"See all in Info section",component:XM,onClick:s,sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}}})},"ellipsis");return C.jsxs(Ye,{sx:{display:"flex",flexDirection:"column",gap:.75,...n},children:[c,u]})}return C.jsx(Ye,{sx:{...n},children:l})};Qle.propTypes={collectionConfigParams:Z.object.isRequired,collectionName:Z.string,sx:Z.object};const $Oe=({collection:i,getCollectionsCall:e})=>{const[n,r]=$.useState(!1),s=$i();return C.jsxs(fk,{children:[C.jsxs(ki,{children:[C.jsx(Je,{component:Ybe,to:`/collections/${i.name}`,children:i.name}),C.jsx(Je,{component:"p",variant:"caption",color:"text.secondary",children:i.aliases&&i.aliases.length>0&&`Aliases: ${i.aliases.join(", ")}`})]}),C.jsx(ki,{children:C.jsx(WOe,{status:i.status,collectionName:i.name})}),C.jsx(ki,{align:"center",children:C.jsx(Je,{component:Ybe,to:`/collections/${i.name}`,children:i.points_count})}),C.jsx(ki,{align:"center",children:C.jsx(Je,{children:i.segments_count})}),C.jsx(ki,{align:"center",children:C.jsx(Je,{children:i.config.params.shard_number})}),C.jsx(ki,{align:"center",children:C.jsx(Qle,{collectionConfigParams:i.config.params,collectionName:i.name})}),C.jsxs(ki,{align:"right",children:[C.jsxs(r4t,{children:[C.jsx(hf,{component:lh,to:`/collections/${i.name}#snapshots`,children:"Take Snapshot"}),C.jsx(hf,{component:lh,to:`/collections/${i.name}/visualize`,children:"Visualize"}),C.jsx(hf,{component:lh,to:`/collections/${i.name}/graph`,children:"Graph"}),C.jsx(hf,{onClick:()=>r(!0),sx:{color:s.palette.error.main},children:"Delete"})]}),C.jsx(BOe,{open:n,setOpen:r,collectionName:i.name,getCollectionsCall:e})]})]})};$Oe.propTypes={collection:Z.object.isRequired,getCollectionsCall:Z.func.isRequired};const zOe=({collections:i,getCollectionsCall:e})=>C.jsx(w4,{children:C.jsxs(Bv,{"aria-label":"simple table",children:[C.jsx(C4,{children:C.jsxs(ng,{children:[C.jsx(Yc,{width:"25%",children:"Name"}),C.jsx(Yc,{width:"12%",children:"Status"}),C.jsx(Yc,{align:"center",children:"Points (Approx)"}),C.jsx(Yc,{align:"center",children:"Segments"}),C.jsx(Yc,{align:"center",children:"Shards"}),C.jsx(Yc,{width:"20%",align:"center",children:"Vectors Config"}),C.jsx(Yc,{width:"7%",align:"right",children:"Actions"})]})}),C.jsx(S4,{children:i.length>0&&i.map(n=>C.jsx($Oe,{collection:n,getCollectionsCall:e},n.name))})]})});zOe.propTypes={collections:Z.array.isRequired,getCollectionsCall:Z.func.isRequired};const VOe={"dense-vector-configuration":{elements:[{type:"number-with-suggestions",title:"Choose dimensions",name:"dimensions",required:!0,suggestions:[{label:"CLIP",value:512},{label:"openai-ai/text-embedding-3-small",value:1536},{label:"openai-ai/text-embedding-3-large",value:3072}]},{type:"dropdown",name:"metric",options:["Cosine","Euclid","Dot","Manhattan"],default:"Cosine",title:"Choose metric"}]},"sparse-vector-configuration":{elements:[{type:"checkbox",title:"Use IDF?",name:"use_idf",default:!1,required:!1,description:"This checkbox enables Inverse Document Frequency (IDF) weighting. <br> Enabled it if you use BM25 or other models that require IDF.",link:"https://qdrant.tech/documentation/concepts/indexing/#idf-modifier",linkText:"Learn more",size:12}]}},o4t={"collection-name-step":{title:"Name your collection",useCard:!0,elements:[{type:"string-input",name:"collection_name",placeholder:"Example: my-collection",description:"Collection name must be unique and can contain only letters, numbers, hyphens and underscores",required:!0,size:12,setFocus:!0}],button:{type:"button",title:"Continue","on-click":{"continue-step":"use-case-step"}}},"use-case-step":{title:"What's your use case?",cards:[{title:"Global search",icon:{path:"M22 12C22 17.5228 17.5228 22 12 22M22 12C22 6.47715 17.5228 2 12 2M22 12H2M12 22C6.47715 22 2 17.5228 2 12M12 22C9.43223 19.3038 8 15.7233 8 12C8 8.27674 9.43223 4.69615 12 2M12 22C14.5678 19.3038 16 15.7233 16 12C16 8.27674 14.5678 4.69615 12 2M2 12C2 6.47715 6.47715 2 12 2"},size:6,"short-description":"Search across the whole collection",description:"Search across whole collection of data with optional filters. For example: <ul><li>e-commerce search,</li><li>website search,</li></ul>",name:"global-search","on-select":{"continue-step":"templates-selection-step"}},{title:"Multitenancy",icon:{path:"M12 18.9996L8.03 21.3796C7.71894 21.5665 7.36289 21.6652 7 21.6652C6.63711 21.6652 6.28106 21.5665 5.97 21.3796L2.97 19.5796C2.67476 19.4022 2.43033 19.1516 2.26039 18.852C2.09045 18.5524 2.00075 18.214 2 17.8696V14.6296C2.00075 14.2852 2.09045 13.9468 2.26039 13.6472C2.43033 13.3476 2.67476 13.097 2.97 12.9196L7 10.4996M12 18.9996V13.4996M12 18.9996L15.97 21.3796C16.2811 21.5665 16.6371 21.6652 17 21.6652C17.3629 21.6652 17.7189 21.5665 18.03 21.3796L21.03 19.5796C21.3252 19.4022 21.5697 19.1516 21.7396 18.852C21.9096 18.5524 21.9992 18.214 22 17.8696V14.6296C21.9992 14.2852 21.9096 13.9468 21.7396 13.6472C21.5697 13.3476 21.3252 13.097 21.03 12.9196L17 10.4996M12 13.4996L7 10.4996M12 13.4996L7 16.4996M12 13.4996L17 10.4996M12 13.4996L17 16.4996M12 13.4996V7.9996M7 10.4996V6.1296C7.00075 5.78518 7.09045 5.44678 7.26039 5.14719C7.43033 4.84761 7.67476 4.59698 7.97 4.4196L10.97 2.6196C11.2811 2.43272 11.6371 2.33398 12 2.33398C12.3629 2.33398 12.7189 2.43272 13.03 2.6196L16.03 4.4196C16.3252 4.59698 16.5697 4.84761 16.7396 5.14719C16.9096 5.44678 16.9992 5.78518 17 6.1296V10.4996M7 16.4996L2.26 13.6496M7 16.4996V21.6696M17 16.4996L21.74 13.6496M17 16.4996V21.6696M12 7.9996L7.26 5.1496M12 7.9996L16.74 5.1496"},size:6,"short-description":"Many tenants, isolated data",description:"Search across multiple isolated tenants. For example: <ul><li>per-user documents,</li><li>chat history search,</li><li>organization-based isolation</li></ul>",name:"multitenancy","on-select":{"continue-step":"tenant-field-selection-step"}}]},"tenant-field-selection-step":{title:"Tenant field",description:"Which payload field should be used as a tenant id?","long-description":"This field should be used to filter data based on tenant id. For example: user_id, organization_id, etc. Payload field should be of a `keyword` type.",useCard:!0,elements:[{size:12,type:"string-input",title:"Tenant field name",name:"tenant_id",placeholder:"Example: user-id",required:!0,setFocus:!0},{size:12,type:"description",description:"This payload field should be used to separate tenants within collection. <br> A specuil payload index of type `keyword` will be created for this field. <br> All requests to the collection should include this field as a filter.",name:"tenant_id_description",link:"https://qdrant.tech/documentation/guides/multiple-partitions/",linkText:"Multitenancy Documentation"}],button:{type:"button",title:"Continue","on-click":{"continue-step":"templates-selection-step"}}},"templates-selection-step":{title:"What to use for search?",description:"There are some common configurations used for search, maybe you want to use one of them?",cards:[{title:"Simple Single embedding",description:"Simplest configuration, only one vector field per document.",name:"simple-single-embedding","on-select":{"continue-step":"simple-dense-embedding-step"},size:4},{title:"Simple Hybrid Search",description:"Dense + Sparse vectors searched simultaneously. Search covers both semantic and keyword-based search.",name:"simple-hybrid-search","on-select":{"continue-step":"simple-hybrid-embedding-step"},size:4},{title:"Custom",description:"You can define your own configuration.",name:"custom","on-select":{"continue-step":"custom-collection-dense-step"},size:4}]},"simple-dense-embedding-step":{title:"Vector configuration",description:"Configuration for dense embedding",elements:[{type:"group",name:"vector_config_group",required:!0,elements:[{type:"dense-vector-configuration",name:"vector_config",required:!0}]}],button:{type:"button",title:"Continue","on-click":{"continue-step":"index-field-selection-step"}}},"simple-hybrid-embedding-step":{title:"Vector configuration",description:"Configuration for dense and sparse embeddings",elements:[{type:"group",name:"vector_config_group",required:!0,elements:[{type:"string-input",title:"Dense vector name",name:"dense_vector_name",variant:"outlined",placeholder:"Example: abstract-dense-vector",description:"Name of the dense vector field",link:"https://qdrant.tech/documentation/concepts/vectors/#named-vectors",size:12,required:!0,setFocus:!0},{type:"dense-vector-configuration",name:"dense_vector_config",required:!0}]},{type:"group",name:"sparse_vector_config_group",required:!0,elements:[{type:"string-input",title:"Sparse vector name",name:"sparse_vector_name",variant:"outlined",placeholder:"Example: title-sparse-vector",description:"Name of the sparse vector field",link:"https://qdrant.tech/documentation/concepts/vectors/#named-vectors",size:12,required:!0},{type:"sparse-vector-configuration",name:"sparse_vector_config",required:!0}]}],button:{type:"button",title:"Continue","on-click":{"continue-step":"index-field-selection-step"}}},"custom-collection-dense-step":{title:"Custom collection - Dense vectors",description:"Configure dense vectors for your collection",elements:[{type:"repeatable",name:"custom_dense_vectors",maxRepetitions:3,elements:[{type:"string-input",title:"Vector name",name:"vector_name",variant:"outlined",placeholder:"Example: dense-vector",description:"This name will be used as a name of vector",size:12,required:!0,setFocus:!0},{type:"dense-vector-configuration",name:"vector_config",required:!0},{type:"details",name:"advanced_config",title:"Advanced configuration",elements:[{type:"checkbox",title:"Multivector",name:"multivector",default:!1,size:6},{type:"description",description:"Create multiple sub-vectors per point. <br> Enabled it if you use Late Interraction models like ColBERT, ColPali, e.t.c.",name:"multivector_description",link:"https://qdrant.tech/documentation/concepts/vectors/#multivectors",linkText:"Learn more",size:6},{type:"enum-slider",title:"Storage Tier",name:"storage_tier",options:["storage","balanced","performance"],defaultValue:"balanced",size:6},{type:"description",description:"Storage tier defines how the vector is stored. <br> Storage tier is optimized high data volume and low frequency of requests, performance tier is optimized for low latency",name:"storage_tier_description",size:6},{type:"enum-slider",title:"Precision Tier",name:"precision_tier",options:["low","medium","high"],defaultValue:"high",size:6},{type:"description",description:"Precision tier defines how vectors are compressed. <br> Low precision tier applies quantization, high precision tier doesn't compress vectors",name:"precision_tier_description",size:6}]}]}],button:{type:"button",title:"Continue","on-click":{"continue-step":"custom-collection-sparse-step"}}},"custom-collection-sparse-step":{title:"Custom collection - Sparse vectors",description:"Configure sparse vectors for your collection",elements:[{type:"repeatable",name:"custom_sparse_vectors",maxRepetitions:3,elements:[{type:"string-input",title:"Vector name",name:"vector_name",placeholder:"Example: sparse-vector",size:12,required:!0,setFocus:!0},{type:"sparse-vector-configuration",name:"vector_config",required:!1}]}],button:{type:"button",title:"Continue","on-click":{"continue-step":"index-field-selection-step"}}},"index-field-selection-step":{title:"Payload indexes",description:"We need to create indexes, if we want to do filtered search.",finish:!0,elements:[{type:"repeatable",name:"payload_fields",maxRepetitions:10,elements:[{type:"string-input",title:"Field name",name:"field_name",placeholder:"Example: document-id",size:12,required:!0,setFocus:!0},{type:"button-group-with-inputs",title:"Field type",name:"field_config",required:!0,size:12,enums:[{name:"keyword",fields:[{type:"description",description:'Keyword field index, suitable for exact match of string values. <br><br> Example: <code>color: "red"</code> <br><br> Docs:',linkText:"Learn more",link:"https://qdrant.tech/documentation/concepts/payload/#keyword",size:12}]},{name:"integer",fields:[{type:"description",description:"Integer field index, suitable for exact match and range filters on integer numbers. <br><br> Example: <code>age: 25</code> <br><br> Docs:",linkText:"Learn more",link:"https://qdrant.tech/documentation/concepts/payload/#integer",size:12},{title:"Allow match filters",name:"lookup",type:"checkbox",default:!0,size:3},{type:"description",description:"This checkbox enables indexing of the integer field for exact match filters. <br> If enabled, index will consume additional memory.",link:"https://qdrant.tech/documentation/concepts/indexing/#parameterized-index",linkText:"Learn more",name:"lookup_description",size:9},{title:"Allow range filters",name:"range",type:"checkbox",default:!0,size:3},{type:"description",description:"This checkbox enables indexing of the integer field for exact match filters. <br> If enabled, index will consume additional memory.",link:"https://qdrant.tech/documentation/concepts/indexing/#parameterized-index",linkText:"Learn more",name:"range_description",size:9}]},{name:"float",fields:[{type:"description",description:"Float field index, suitable for range filters on floating point and integer numbers. <br><br> Example: <code>price: 99.5</code> <br><br> Docs:",linkText:"Learn more",link:"https://qdrant.tech/documentation/concepts/payload/#float",size:12}]},{name:"uuid",fields:[{type:"description",description:'UUID field index, suitable for exact match of UUID values. Similar to keyword field, optimized for UUID values. <br><br> Example: <code>doc_id: "123e4567-e89b-12d3-a456-426614174000"</code> <br><br> Docs:',linkText:"Learn more",link:"https://qdrant.tech/documentation/concepts/payload/#uuid",size:12}]},{name:"datetime",fields:[{type:"description",description:'Datetime field index, suitable for range filters on datetime values. <br><br> Example: <code>created_at: "2023-02-08T10:49:00Z"</code> <br><br> Docs:',linkText:"Learn more",link:"https://qdrant.tech/documentation/concepts/payload/#datetime",size:12}]},{name:"text",fields:[{type:"description",description:'Text field index, suitable for full-text filtering on string values. <br><br> Example: <code>title: "The Last Question"</code> <br><br> Docs:',linkText:"Learn more",link:"https://qdrant.tech/documentation/concepts/filtering/#full-text-match",size:12},{title:"Tokenizer",name:"tokenizer",type:"dropdown",options:["prefix","whitespace","word","multilingual"],description:"Defines how the text is tokenized",link:"https://qdrant.tech/documentation/concepts/indexing/#full-text-index",linkText:"Learn more",default:"whitespace",size:12},{title:"Lowercase",name:"lowercase",type:"checkbox",default:!0,description:"Converts all characters to lowercase",link:"https://qdrant.tech/documentation/concepts/indexing/#full-text-index",linkText:"Learn more",size:6},{title:"Phrase matching",name:"phrase_matching",type:"checkbox",default:!0,description:"Allows phrase matching at the cost of extra index structure",link:"https://qdrant.tech/documentation/concepts/filtering/#phrase-matching",linkText:"Learn more",size:6},{title:"Min token length",name:"min_token_len",type:"number",min:1},{title:"Max token length",name:"max_token_len",type:"number",min:1}]},{name:"geo",fields:[{type:"description",description:'Geo field index, suitable for geospatial filtering on latitude and longitude values. <br><br> Example: <code>location: { "lon": 52.5200, "lat": 13.4050 }</code> <br><br> Docs:',linkText:"Learn more",link:"https://qdrant.tech/documentation/concepts/payload/#geo",size:12}]},{name:"bool",fields:[{type:"description",description:"Boolean field index, suitable for exact match of boolean values. <br><br> Example: <code>is_active: true</code> <br><br> Docs:",linkText:"Learn more",link:"https://qdrant.tech/documentation/concepts/payload/#bool",size:12}]}]}]}]}},a4t=ye("div",{name:"MuiCreateCollectionForm",slot:"root"})(({theme:i})=>({position:"relative",padding:"1rem",paddingTop:"2rem",minHeight:"100%",flex:1,color:i.palette.text.primary,backgroundColor:i.palette.background.default})),HOe=ye(i=>C.jsx(Je,{variant:"h6",component:"h2",...i}),{name:"MuiCreateCollectionForm",slot:"title"})(()=>({lineHeight:"1.4",fontWeight:600,letterSpacing:"-0.5px"})),UOe=ye(i=>C.jsx(Je,{variant:"subtitle2",component:"h3",...i}),{name:"MuiCreateCollectionForm",slot:"subtitle"})(({theme:i})=>({color:i.palette.text.secondary,lineHeight:"1.5",mt:"4px"})),qOe=ye(i=>C.jsx(Fv,{elevation:0,...i}),{name:"MuiCreateCollectionForm",slot:"selectCard"})(({theme:i})=>({width:"100%",p:3,boxShadow:"none",boxSizing:"border-box",borderRadius:"0.5rem",transition:"all 0.1s ease-in-out","& svg":{stroke:i.palette.text.primary,fill:"none",strokeWidth:"1.5"},"& ul":{paddingLeft:"0",marginBottom:"0",listStyleType:"none","& li":{paddingLeft:"1.75rem",position:"relative","&:not(:last-child)":{marginBottom:"0.625rem"},"&:before":{content:'""',position:"absolute",left:"0",top:"0.125rem",width:"1.25rem",height:"1.3125rem",display:"inline-block",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='21' viewBox='0 0 20 21' fill='none'%3E%3Cpath d='M16.6668 5.5L7.50016 14.6667L3.3335 10.5' stroke='${encodeURIComponent(i.palette.text.secondary)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"left center"}}},"&.active":{boxShadow:`0 0 0 2px ${i.palette.primary.main}`,background:Pt(i.palette.primary.main,.08),"& svg":{stroke:i.palette.primary.main,fill:"none"}},"&:hover:not(.active)":{boxShadow:`0 0 0 2px ${i.palette.primary.main}`,background:Pt(i.palette.primary.main,.08)}})),Jle=ye(Fv,{name:"MuiCreateCollectionForm",slot:"card"})(()=>({padding:"1.5rem"})),yI=ye(i=>C.jsx(Ci,{...i}),{name:"MuiCreateCollectionForm",slot:"button"})(({size:i})=>{const e={};return i==="small"&&(e["&.MuiButton-outlined"]={padding:"0.25rem 0.625rem",fontSize:"0.8125rem"}),e}),k4=ye(gLe,{name:"MuiCreateCollectionForm",slot:"formControl"})(()=>({display:"flex",flexDirection:"column",width:"100%"})),yV=ye(EW,{name:"MuiCreateCollectionForm",slot:"input"})(({theme:i})=>({display:"flex","&[variant='outlined']":{border:"1px solid rgba(0, 0, 0, 0.23)",borderColor:i.palette.mode==="dark"?"rgba(255, 255, 255, 0.23)":"rgba(0, 0, 0, 0.23)",padding:"0.5rem 0.75rem",borderRadius:"0.5rem",lineHeight:1.5},"& input":{padding:"0",lineHeight:1.5},"&.Mui-focused":{borderColor:i.palette.primary.main},"&.Mui-error":{borderColor:i.palette.error.main},"&:hover":{borderColor:i.palette.text.primary},"&.Mui-disabled":{color:i.palette.text.disabled},"label + &":{marginTop:i.spacing(3)},"& .MuiSelect-select":{padding:0,lineHeight:1.5}})),l4t=ye(DUe,{name:"MuiCreateCollectionForm",slot:"checkbox"})(({theme:i})=>({color:i.palette.text.primary,"&.MuiCheckbox-colorPrimary":{color:i.palette.text.secondary,"&.Mui-checked":{color:i.palette.primary.main},"& ~ span":{color:i.palette.text.primary,fontSize:"0.875rem"}}})),L4=ye(RW,{name:"MuiCreateCollectionForm",slot:"label"})(({theme:i})=>({fontSize:"1.25rem",fontWeight:500,color:i.palette.text.primary,lineHeight:"21px",overflow:"unset","&.Mui-focused":{color:i.palette.text.primary}}));ye(eLe,{name:"MuiCreateCollectionForm",slot:"autoComplete"})(()=>({"&.MuiAutocomplete-hasClearIcon .MuiAutocomplete-inputRoot":{paddingRight:0},"& .MuiAutocomplete-endAdornment":{right:"0.625rem"}}));const c4t=ye(du,{name:"MuiCreateCollectionForm",slot:"description"})(({theme:i})=>({display:"flex",alignItems:"center",backgroundColor:"transparent","&.MuiPaper-root":{"& .MuiTypography-root":{color:i.palette.text.secondary,fontSize:"0.75rem",fontWeight:400,lineHeight:"150%",border:0},border:0,boxShadow:"none"},a:{display:"inline-flex",textDecoration:"none",whiteSpace:"nowrap",color:i.palette.primary.main,textDecorationThickness:"0.0625rem !important",textUnderlineOffset:"0.125rem !important","&:hover":{textDecorationThickness:"0.0625rem !important",textUnderlineOffset:"0.125rem !important",textDecoration:"underline",color:i.palette.primary.dark}},"& svg":{alignSelf:"flex-start",marginLeft:"0.25rem"}})),u4t=ye(k$e,{name:"MuiCreateCollectionForm",slot:"accordion"})(({theme:i})=>({boxShadow:"none",border:0,background:"transparent","& .MuiAccordionSummary-root":{width:"auto",color:i.palette.text.primary,fontSize:"0.875rem",fontWeight:500,lineHeight:"150%",padding:0,"&:hover":{textDecoration:"underline",textDecorationThickness:"0.0625rem !important",textUnderlineOffset:"0.125rem !important"},"& svg":{marginLeft:"0.25rem",marginRight:"0.25rem",stroke:i.palette.text.primary}},"& .MuiAccordionDetails-root":{padding:"1rem 0"}})),d4t=ye(wXe,{name:"MuiCreateCollectionForm",slot:"slider"})(({theme:i})=>{const e={"& .MuiSlider-markLabel":{"&:nth-of-type(4)":{transform:"none",left:0},"&:nth-last-of-type(2)":{left:"auto !important",transform:"none",right:"-0.1875rem"}}};return e["&.MuiSlider-root"]={color:i.palette.primary.main,"& .MuiSlider-valueLabel":{color:i.palette.text.secondary,backgroundColor:i.palette.primary.main},"& .MuiSlider-mark":{backgroundColor:"transparent"},"& .MuiSlider-markLabel":{...e["& .MuiSlider-markLabel"],color:i.palette.text.secondary}},e}),h4t=ye(Ye,{name:"MuiCreateCollectionForm",slot:"sidebarStickyInner"})(({theme:i})=>({position:"sticky",top:"2rem",[i.breakpoints.down("md")]:{position:"static"}})),f4t=ye(i=>C.jsx(du,{...i,children:C.jsx(h4t,{children:i.children})}),{name:"MuiCreateCollectionForm",slot:"sidebar"})(({theme:i})=>({borderRadius:0,position:"absolute",bottom:0,right:0,top:0,width:"clamp(12.5rem, 25vw, 18.75rem)",minWidth:"12.5rem",padding:"2rem 1.5rem",flexShrink:0,background:i.palette.background.default,color:i.palette.text.primary,zIndex:2,[i.breakpoints.down("md")]:{position:"fixed",width:"100vw",top:"auto",padding:"1.5rem 1.5rem 2rem",boxShadow:"0 0 10px 0 rgba(0,0,0,0.2)"}})),KOe=({card:i,isActive:e,onClick:n})=>{const r=i.icon&&Hr(C.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:i.icon.path}));return C.jsx(ln,{size:{xs:12,md:i.size||3},display:"flex",children:C.jsx(qOe,{elevation:1,className:e?"active":"",onClick:n,tabIndex:0,onKeyDown:s=>{s.key==="Enter"&&n(s)},children:C.jsx(ex,{sx:{display:"flex"},children:C.jsxs(Ye,{sx:{flex:1},children:[C.jsxs(Ye,{sx:{display:"flex",alignItems:"center",gap:1,mb:"0.625rem"},children:[i.icon&&C.jsx(r,{sx:{width:"1.5rem",height:"1.5rem"}}),C.jsx(Je,{variant:"subtitle1",children:i.title})]}),C.jsx(Je,{variant:"body2",sx:{color:"text.secondary"},children:C.jsx("span",{dangerouslySetInnerHTML:{__html:i.description}})})]})})})})};KOe.propTypes={card:Z.shape({title:Z.string.isRequired,description:Z.string.isRequired,"short-description":Z.string,name:Z.string.isRequired,"on-select":Z.shape({"continue-step":Z.string.isRequired}).isRequired,icon:Z.shape({path:Z.string.isRequired}),size:Z.number}),isActive:Z.bool.isRequired,onClick:Z.func.isRequired};const Eie=({stepName:i,config:e,stepData:n,onApply:r})=>{const{title:s,description:o,cards:a,gap:l}=e,[c,u]=$.useState(n),d=$.useCallback(f=>{u(f.name),r(i,f.name,f["on-select"]["continue-step"])},[r,i]),h=$.useMemo(()=>a==null?void 0:a.map(f=>C.jsx(p4t,{isActive:f.name===c,card:f,onClick:()=>d(f)},f.title)),[a,c,d]);return C.jsxs(ln,{container:!0,spacing:3,children:[C.jsxs(ln,{size:12,children:[C.jsx(HOe,{variant:"h6",children:s}),o&&C.jsx(UOe,{children:o})]}),C.jsx(ln,{container:!0,spacing:l||2,alignItems:"stretch",children:h})]})},p4t=$.memo(KOe);Eie.propTypes={stepName:Z.string.isRequired,config:Z.shape({title:Z.string.isRequired,description:Z.string,cards:Z.arrayOf(Z.shape({title:Z.string.isRequired,description:Z.string.isRequired,"short-description":Z.string,name:Z.string.isRequired,"on-select":Z.shape({"continue-step":Z.string.isRequired}).isRequired,icon:Z.shape({path:Z.string.isRequired}),size:Z.number})),gap:Z.number}).isRequired,stepData:Z.string,onApply:Z.func.isRequired};const ece=(i,e)=>{if(Array.isArray(i))return i.every(n=>ece(n,!0));if(i!==null&&typeof i=="object"){let n=i.completed===!0;return!e||n}else return!e||i!==void 0&&i!==""},pk=function({config:i,stepData:e,onChange:n,isLast:r=!1}){let s=!0;(e==null?void 0:e.parentCompleted)===!1&&(s=!1);let o=i.elements&&i.elements.length;const a=C.jsx(C.Fragment,{children:i.elements.map((l,c)=>{const u={...VOe[l.type]||{},...l};let d=e&&e[l.name];d===void 0&&(d=l.default);const h=u.required===!0;let f=ece(d,h);s=s&&f;let p=function(m){let _={...e,[l.name]:m};n(_)};const g=o5e[l.type];return g?C.jsx($.Fragment,{children:C.jsx(g,{config:u,stepData:d,onChange:p,isLast:c===o-1&&r})},c):(console.log("Skipping element",l.type),null)})});return $.useEffect(()=>{const l=e&&e.completed===!0;s!==l&&n({...e,completed:s})},[e,s,n]),a};pk.propTypes={config:Z.shape({name:Z.string.isRequired,elements:Z.arrayOf(Z.shape({type:Z.string.isRequired,name:Z.string}))}).isRequired,stepData:Z.object,onChange:Z.func.isRequired,isLast:Z.bool};const g4t=pk,m4t=pk,GOe=({config:i,stepData:e,onChange:n})=>{const r=e||"";return C.jsx(eLe,{freeSolo:!0,options:i.suggestions,getOptionLabel:s=>s.value.toString(),inputValue:r+"",onInputChange:(s,o)=>{let a=parseInt(o);isNaN(a)&&(a=""),n(a)},renderOption:(s,o)=>{const{key:a,...l}=s;return C.jsxs(hf,{...l,children:[C.jsxs(Je,{variant:"body1",fontWeight:"bold",children:[o.value," "]}),"- ",o.label]},a)},renderInput:s=>C.jsxs(k4,{variant:"standard",children:[C.jsx(L4,{shrink:!0,htmlFor:i.name,children:i.title}),C.jsx(yV,{...s.InputProps,inputProps:s.inputProps,variant:"outlined",id:i.name,placeholder:i.placeholder||"",value:r||i.default||""})]})})};GOe.propTypes={config:Z.shape({title:Z.string.isRequired,name:Z.string.isRequired,default:Z.number,suggestions:Z.arrayOf(Z.shape({label:Z.string.isRequired,value:Z.number.isRequired})).isRequired,placeholder:Z.string}).isRequired,stepData:Z.oneOfType([Z.number,Z.string]),onChange:Z.func.isRequired};const XOe=function({config:i,stepData:e,onChange:n}){let r={};i.enums.forEach(h=>{r[h.name]=h});let s=e&&e[i.name+"_enum"];const l={elements:(r[s]||{}).fields||[],name:i.name+"_config"},c=(i==null?void 0:i.size)||12;let u=!1;return e&&e[i.name+"_enum"]&&(u=!0),C.jsxs(C.Fragment,{children:[C.jsxs(ln,{size:c,children:[C.jsx(L4,{shrink:!0,sx:{mt:1,mb:1},children:i.title}),C.jsx(Ye,{sx:{display:"flex",flexWrap:"wrap",gap:1,mb:2},children:i.enums.map(h=>{let f=function(p){let g={...e,[i.name+"_enum"]:p};n(g)};return C.jsx(Ye,{children:C.jsx(qOe,{sx:{px:2,py:1},onClick:()=>f(h.name),className:s===h.name?"active":"",variant:"contained",tabIndex:0,onKeyDown:p=>{p.key==="Enter"&&f(h.name)},children:h.name})},h.name)})})]}),C.jsx(ln,{size:12,children:C.jsx(ln,{container:!0,spacing:2,children:C.jsx(pk,{config:l,stepData:{...e,parentCompleted:u},onChange:n})})})]})};XOe.propTypes={config:Z.shape({name:Z.string.isRequired,title:Z.string,size:Z.number,enums:Z.arrayOf(Z.shape({name:Z.string.isRequired,fields:Z.arrayOf(Z.shape({title:Z.string,type:Z.string.isRequired,name:Z.string,default:Z.any}))}))}).isRequired,stepData:Z.object,onChange:Z.func.isRequired};const YOe=nn.createContext({scrollableParent:()=>window}),_4t=()=>{const i=nn.useContext(YOe);if(i===void 0)throw new Error("useScrollableParent must be used within a ScrollableParentProvider");return i.scrollableParent},ZOe=({config:i,stepData:e,onChange:n,isLast:r=!1})=>{const s=e||[],o=_4t(),a=s.length,l=(i==null?void 0:i.maxRepetitions)||1e4;$.useEffect(()=>{Array.isArray(e)||(console.log("Repeatable: stepData is not an array",e),n([]))},[e,n]);const c=()=>{const d=[...s,{}];n(d)};$.useEffect(()=>{if(r){const d=o();let h=d===window?document.documentElement.scrollHeight:d.scrollHeight;d.scrollTo({top:h,behavior:"smooth"})}},[a]);const u=d=>{const h=[...s];h.splice(d,1),n(h)};return C.jsxs(ln,{size:12,children:[s.map((d,h)=>{const f=p=>{const g=[...s];g[h]=p,n(g)};return C.jsxs(Jle,{elevation:0,sx:{mb:4,display:"flex",flexDirection:"column"},children:[C.jsx(ln,{container:!0,spacing:2,children:C.jsx(pk,{config:i,stepData:d,onChange:f})}),C.jsx(SE,{sx:{mt:2,mb:3}}),C.jsx(yI,{variant:"outlined",color:"error",size:"small",startIcon:C.jsx(AMt,{}),sx:{alignSelf:"end"},onClick:()=>u(h),children:"Remove"})]},h)}),s.length<l&&C.jsx(yI,{variant:"text",size:"medium",color:"secondary",startIcon:C.jsx(TPe,{}),onClick:c,children:"Add"})]})};ZOe.propTypes={config:Z.shape({name:Z.string.isRequired,elements:Z.array,maxRepetitions:Z.number}).isRequired,stepData:Z.any,onChange:Z.func.isRequired,isLast:Z.bool};const QOe=function({config:i,stepData:e,onChange:n}){return C.jsx(ln,{size:12,children:C.jsx(Jle,{elevation:0,children:C.jsx(ln,{container:!0,spacing:"1.25rem",children:C.jsx(pk,{config:i,stepData:e,onChange:n})})})})};QOe.propTypes={config:Z.shape({name:Z.string,elements:Z.array}).isRequired,stepData:Z.any,onChange:Z.func.isRequired};const JOe=function({config:i,stepData:e,onChange:n}){const r=i.size||12;return C.jsx(ln,{size:r,children:C.jsxs(u4t,{children:[C.jsx(X$e,{expandIcon:C.jsx(Vet,{size:20}),children:"Advanced Configuration"}),C.jsx(I$e,{children:C.jsx(ln,{container:!0,spacing:2,children:C.jsx(pk,{config:i,stepData:e,onChange:n})})})]})})};JOe.propTypes={config:Z.shape({name:Z.string,elements:Z.array,size:Z.number}).isRequired,stepData:Z.any,onChange:Z.func.isRequired};const e5e=({config:i,stepData:e,onChange:n})=>{const r=i.defaultValue,s=e||r,o=i.options,a=o.indexOf(r),l=d=>{n(o[d.target.value])},c=o.map((d,h)=>({value:h,label:d}));function u(d){return o[d]}return C.jsx(Ye,{sx:{mr:3},children:C.jsx(d4t,{"aria-label":i.title,defaultValue:a,getAriaValueText:u,value:o.indexOf(s),step:null,valueLabelDisplay:"off",marks:c,onChange:l,min:0,max:o.length-1})})};e5e.propTypes={config:Z.shape({options:Z.arrayOf(Z.string).isRequired,name:Z.string.isRequired,defaultValue:Z.string,title:Z.string}).isRequired,stepData:Z.string,onChange:Z.func.isRequired};const D4=({config:i,sx:e={}})=>{const n=$i();let r=i==null?void 0:i.link,s=(i==null?void 0:i.linkText)||"Learn more";return C.jsx(c4t,{elevation:0,sx:{"& code":{borderRadius:"4px",border:`1px solid ${n.palette.divider}`,background:n.palette.background.paperElevation1,padding:"2px 4px"}},children:C.jsxs(Je,{variant:"caption",sx:{...e},children:[C.jsx("span",{dangerouslySetInnerHTML:{__html:i.description}})," ",r&&C.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",children:[s,C.jsx(rtt,{size:16})]})]})})};D4.propTypes={config:Z.shape({link:Z.string,linkText:Z.string,description:Z.string.isRequired}).isRequired,sx:Z.object};const t5e=({config:i,stepData:e,onChange:n})=>{const r=e||"",s=o=>{n(o.target.value)};return C.jsxs(k4,{variant:"standard",children:[C.jsx(L4,{shrink:!0,htmlFor:i.name,children:i.title}),C.jsx(sse,{labelId:"",id:"",value:r,onChange:s,input:C.jsx(yV,{variant:"outlined"}),MenuProps:{classes:{list:"dropdown-list"}},children:i.options.map(o=>C.jsx(hf,{value:o,children:o},o))}),i.description&&C.jsx(D4,{config:i,sx:{mt:"3px"}})]})};t5e.propTypes={config:Z.shape({options:Z.arrayOf(Z.string).isRequired,name:Z.string.isRequired,title:Z.string,description:Z.string}).isRequired,stepData:Z.string,onChange:Z.func.isRequired};const n5e=({config:i,stepData:e,onChange:n})=>{const r=i.default||"",s=!e&&e!==""?r:e,o=$.useRef(null);return $.useEffect(()=>{i.setFocus&&o.current&&o.current.focus()},[i.setFocus]),C.jsxs(k4,{variant:"standard",children:[i.title&&C.jsx(L4,{shrink:!0,htmlFor:i.name,children:i.title}),C.jsx(yV,{id:i.name,placeholder:i.placeholder||"",inputRef:o,variant:"outlined",value:s,onChange:a=>{n(a.target.value)}},i.title),i.description&&C.jsx(D4,{config:i,sx:{mt:"3px"}})]})};n5e.propTypes={config:Z.shape({title:Z.string.isRequired,name:Z.string.isRequired,default:Z.string,placeholder:Z.string,variant:Z.string,description:Z.string}).isRequired,stepData:Z.string,onChange:Z.func.isRequired};const i5e=({config:i,stepData:e,onChange:n})=>{const r=e||!1,s=o=>{n(o.target.checked)};return C.jsxs(Ye,{children:[C.jsx(k4,{sx:{display:"flex",flexDirection:"row"},children:C.jsx(Qre,{label:i.title,control:C.jsx(l4t,{size:"small",sx:{alignSelf:"start"},checked:r,onChange:s,inputProps:{"aria-label":"controlled"}})})}),i.description&&C.jsx(D4,{config:i})]})};i5e.propTypes={config:Z.shape({title:Z.string.isRequired,name:Z.string.isRequired,description:Z.string}).isRequired,stepData:Z.bool,onChange:Z.func.isRequired};const r5e=({config:i,stepData:e,onChange:n})=>{const r=e||0,s=i==null?void 0:i.max,o=i==null?void 0:i.min,a=l=>{let c=parseInt(l.target.value);isNaN(c)?c=0:(s&&c>s&&(c=s),o&&c<o&&(c=o)),n(c)};return C.jsxs(k4,{variant:"standard",children:[C.jsx(L4,{shrink:!0,htmlFor:i.name,children:i.title}),C.jsx(yV,{variant:"outlined",id:i.name,value:r||i.default||"",onChange:a,ownerState:{variant:"outlined"}},i.title)]})};r5e.propTypes={config:Z.shape({title:Z.string.isRequired,name:Z.string.isRequired,default:Z.number,max:Z.number,min:Z.number}).isRequired,stepData:Z.number,onChange:Z.func.isRequired};const s5e=({config:i,element:e,...n})=>C.jsx(ln,{size:{xs:12,md:(i==null?void 0:i.size)||6},children:e({config:i,...n})});s5e.propTypes={config:Z.shape({size:Z.number}),element:Z.func.isRequired};function gC(i){return function(e){return s5e({element:i,...e})}}const o5e={"dense-vector-configuration":g4t,"sparse-vector-configuration":m4t,"string-input":gC(n5e),"number-with-suggestions":gC(GOe),"button-group-with-inputs":XOe,dropdown:gC(t5e),checkbox:gC(i5e),repeatable:ZOe,number:gC(r5e),group:QOe,description:gC(D4),details:JOe,"enum-slider":gC(e5e)},oT=function({stepName:i,config:e,stepData:n,onApply:r,isLast:s=!0,handleClear:o,useCard:a=!1}){const l=n||{};let c=!0,u=e.elements&&e.elements.length;const d=e.elements&&e.elements.map((p,g)=>{const m={...VOe[p.type]||{},...p},_=l[p.name],b=m.required===!0;let y=ece(_,b);c=c&&y;const x=D=>{const R={...n,[p.name]:D};r(i,R,null)},k=o5e[p.type];return k?C.jsx($.Fragment,{children:C.jsx(k,{config:m,stepData:_,onChange:x,isLast:g===u-1&&s},p.name)},g):(console.log("Skipping element",p.type),null)}),h=a?C.jsx(ln,{size:12,children:C.jsx(Jle,{elevation:0,children:C.jsx(ln,{container:!0,spacing:2,children:d})})}):d;$.useEffect(()=>{const p=n&&n.completed===!0;c!==p&&r(i,{...n,completed:c},null)},[n,c,r,i]);const f=C.jsxs(C.Fragment,{children:[h,e.button&&s&&C.jsxs(ln,{size:12,display:"flex",justifyContent:"flex-end",children:[o&&typeof o=="function"&&C.jsx(yI,{variant:"text",onClick:o,children:"Clear"}),C.jsx(yI,{disabled:!c,variant:"contained",onClick:()=>r(i,l,e.button["on-click"]["continue-step"]),sx:{ml:4},children:e.button.title})]})]});return C.jsxs(ln,{container:!0,spacing:3,children:[C.jsxs(ln,{size:12,children:[C.jsx(HOe,{children:e.title}),e.description&&C.jsx(UOe,{children:e.description})]}),f]})};oT.propTypes={stepName:Z.string.isRequired,config:Z.shape({title:Z.string.isRequired,description:Z.string,elements:Z.arrayOf(Z.shape({type:Z.string.isRequired,name:Z.string.isRequired})),button:Z.shape({title:Z.string.isRequired,"on-click":Z.shape({"continue-step":Z.string})})}),stepData:Z.any,onApply:Z.func.isRequired,isLast:Z.bool,handleClear:Z.func,useCard:Z.bool};const v4t=oT,b4t=oT,y4t=oT,w4t=oT;var mC={},Zs={},Zbe;function a5e(){if(Zbe)return Zs;Zbe=1;var i=Zs&&Zs.__rest||function(p,g){var m={};for(var _ in p)Object.prototype.hasOwnProperty.call(p,_)&&g.indexOf(_)<0&&(m[_]=p[_]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var b=0,_=Object.getOwnPropertySymbols(p);b<_.length;b++)g.indexOf(_[b])<0&&Object.prototype.propertyIsEnumerable.call(p,_[b])&&(m[_[b]]=p[_[b]]);return m};Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.isSchema=Zs.isValidSchema=Zs.isDiscriminatorForm=Zs.isValuesForm=Zs.isPropertiesForm=Zs.isElementsForm=Zs.isEnumForm=Zs.isTypeForm=Zs.isRefForm=Zs.isEmptyForm=void 0;function e(p){const{definitions:g,nullable:m,metadata:_}=p,b=i(p,["definitions","nullable","metadata"]);return Object.keys(b).length===0}Zs.isEmptyForm=e;function n(p){return"ref"in p}Zs.isRefForm=n;function r(p){return"type"in p}Zs.isTypeForm=r;function s(p){return"enum"in p}Zs.isEnumForm=s;function o(p){return"elements"in p}Zs.isElementsForm=o;function a(p){return"properties"in p||"optionalProperties"in p}Zs.isPropertiesForm=a;function l(p){return"values"in p}Zs.isValuesForm=l;function c(p){return"discriminator"in p}Zs.isDiscriminatorForm=c;function u(p,g){if(g===void 0&&(g=p),p.definitions!==void 0){if(g!==p)return!1;for(const m of Object.values(p.definitions))if(!u(m,g))return!1}if(n(p)&&!(p.ref in(g.definitions||{}))||s(p)&&(p.enum.length===0||p.enum.length!==new Set(p.enum).size))return!1;if(o(p))return u(p.elements,g);if(a(p)){for(const m of Object.values(p.properties||{}))if(!u(m,g))return!1;for(const m of Object.values(p.optionalProperties||{}))if(!u(m,g))return!1;for(const m of Object.keys(p.properties||{}))if(m in(p.optionalProperties||{}))return!1}if(l(p))return u(p.values,g);if(c(p)){for(const m of Object.values(p.mapping))if(!u(m,g)||!a(m)||m.nullable||p.discriminator in(m.properties||{})||p.discriminator in(m.optionalProperties||{}))return!1}return!0}Zs.isValidSchema=u;const d=[[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1],[!0,!1,!1,!1,!1,!1,!1,!1,!1,!1],[!1,!0,!1,!1,!1,!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1,!1,!1,!1,!1,!1],[!1,!1,!1,!0,!1,!1,!1,!1,!1,!1],[!1,!1,!1,!1,!0,!1,!1,!1,!1,!1],[!1,!1,!1,!1,!1,!0,!1,!1,!1,!1],[!1,!1,!1,!1,!0,!0,!1,!1,!1,!1],[!1,!1,!1,!1,!0,!1,!0,!1,!1,!1],[!1,!1,!1,!1,!1,!0,!0,!1,!1,!1],[!1,!1,!1,!1,!0,!0,!0,!1,!1,!1],[!1,!1,!1,!1,!1,!1,!1,!0,!1,!1],[!1,!1,!1,!1,!1,!1,!1,!1,!0,!0]],h=["boolean","float32","float64","int8","uint8","int16","uint16","int32","uint32","string","timestamp"];function f(p){if(typeof p!="object"||Array.isArray(p)||p===null)return!1;const g=p,{definitions:m=void 0,nullable:_=void 0,metadata:b=void 0,ref:y=void 0,type:x=void 0,enum:k=void 0,elements:D=void 0,properties:R=void 0,optionalProperties:E=void 0,additionalProperties:A=void 0,values:M=void 0,discriminator:N=void 0,mapping:P=void 0}=g,O=i(g,["definitions","nullable","metadata","ref","type","enum","elements","properties","optionalProperties","additionalProperties","values","discriminator","mapping"]),B=[y!==void 0,x!==void 0,k!==void 0,D!==void 0,R!==void 0,E!==void 0,A!==void 0,M!==void 0,N!==void 0,P!==void 0];let j=!1;for(const z of d)j=j||z.every((H,Y)=>H===B[Y]);if(!j)return!1;if(m!==void 0){if(typeof m!="object"||Array.isArray(m)||m===null)return!1;for(const z of Object.values(m))if(!f(z))return!1}if(_!==void 0&&typeof _!="boolean"||b!==void 0&&(typeof b!="object"||Array.isArray(b)||b===null)||y!==void 0&&typeof y!="string"||x!==void 0&&(typeof x!="string"||!h.includes(x))||k!==void 0&&(!Array.isArray(k)||!k.every(z=>typeof z=="string"))||D!==void 0&&!f(D))return!1;if(R!==void 0){if(typeof R!="object"||Array.isArray(R)||R===null)return!1;for(const z of Object.values(R))if(!f(z))return!1}if(E!==void 0){if(typeof E!="object"||Array.isArray(E)||E===null)return!1;for(const z of Object.values(E))if(!f(z))return!1}if(A!==void 0&&typeof A!="boolean"||M!==void 0&&!f(M)||N!==void 0&&typeof N!="string")return!1;if(P!==void 0){if(typeof P!="object"||Array.isArray(P)||P===null)return!1;for(const z of Object.values(P))if(!f(z))return!1}return Object.keys(O).length===0}return Zs.isSchema=f,Zs}var d0={},fB={},Qbe;function C4t(){if(Qbe)return fB;Qbe=1,Object.defineProperty(fB,"__esModule",{value:!0});const i=/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(\.\d+)?([zZ]|((\+|-)(\d{2}):(\d{2})))$/;function e(o){const a=o.match(i);if(a===null)return!1;const l=parseInt(a[1],10),c=parseInt(a[2],10),u=parseInt(a[3],10),d=parseInt(a[4],10),h=parseInt(a[5],10),f=parseInt(a[6],10);return!(c>12||u>n(l,c)||d>23||h>59||f>60)}fB.default=e;function n(o,a){return a===2?r(o)?29:28:s[a]}function r(o){return o%4===0&&(o%100!==0||o%400===0)}const s=[0,31,0,31,30,31,30,31,31,30,31,30,31];return fB}var Jbe;function S4t(){if(Jbe)return d0;Jbe=1;var i=d0&&d0.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(d0,"__esModule",{value:!0}),d0.validate=d0.MaxDepthExceededError=void 0;const e=i(C4t()),n=a5e();class r extends Error{}d0.MaxDepthExceededError=r;class s extends Error{}function o(p,g,m){const _={errors:[],instanceTokens:[],schemaTokens:[[]],root:p,config:m||{maxDepth:0,maxErrors:0}};try{a(_,p,g)}catch(b){if(!(b instanceof s))throw b}return _.errors}d0.validate=o;function a(p,g,m,_){if(!(g.nullable&&m===null)){if(n.isRefForm(g)){if(p.schemaTokens.length===p.config.maxDepth)throw new r;p.schemaTokens.push(["definitions",g.ref]),a(p,p.root.definitions[g.ref],m),p.schemaTokens.pop()}else if(n.isTypeForm(g)){switch(d(p,"type"),g.type){case"boolean":typeof m!="boolean"&&f(p);break;case"float32":case"float64":typeof m!="number"&&f(p);break;case"int8":l(p,m,-128,127);break;case"uint8":l(p,m,0,255);break;case"int16":l(p,m,-32768,32767);break;case"uint16":l(p,m,0,65535);break;case"int32":l(p,m,-2147483648,2147483647);break;case"uint32":l(p,m,0,4294967295);break;case"string":typeof m!="string"&&f(p);break;case"timestamp":typeof m!="string"?f(p):e.default(m)||f(p);break}h(p)}else if(n.isEnumForm(g))d(p,"enum"),(typeof m!="string"||!g.enum.includes(m))&&f(p),h(p);else if(n.isElementsForm(g)){if(d(p,"elements"),Array.isArray(m))for(const[b,y]of m.entries())c(p,b.toString()),a(p,g.elements,y),u(p);else f(p);h(p)}else if(n.isPropertiesForm(g))if(typeof m=="object"&&m!==null&&!Array.isArray(m)){if(g.properties!==void 0){d(p,"properties");for(const[b,y]of Object.entries(g.properties))d(p,b),m.hasOwnProperty(b)?(c(p,b),a(p,y,m[b]),u(p)):f(p),h(p);h(p)}if(g.optionalProperties!==void 0){d(p,"optionalProperties");for(const[b,y]of Object.entries(g.optionalProperties))d(p,b),m.hasOwnProperty(b)&&(c(p,b),a(p,y,m[b]),u(p)),h(p);h(p)}if(g.additionalProperties!==!0)for(const b of Object.keys(m)){const y=g.properties&&b in g.properties,x=g.optionalProperties&&b in g.optionalProperties;!y&&!x&&b!==_&&(c(p,b),f(p),u(p))}}else g.properties!==void 0?d(p,"properties"):d(p,"optionalProperties"),f(p),h(p);else if(n.isValuesForm(g)){if(d(p,"values"),typeof m=="object"&&m!==null&&!Array.isArray(m))for(const[b,y]of Object.entries(m))c(p,b),a(p,g.values,y),u(p);else f(p);h(p)}else if(n.isDiscriminatorForm(g))if(typeof m=="object"&&m!==null&&!Array.isArray(m))if(m.hasOwnProperty(g.discriminator)){const b=m[g.discriminator];typeof b=="string"?b in g.mapping?(d(p,"mapping"),d(p,b),a(p,g.mapping[b],m,g.discriminator),h(p),h(p)):(d(p,"mapping"),c(p,g.discriminator),f(p),u(p),h(p)):(d(p,"discriminator"),c(p,g.discriminator),f(p),u(p),h(p))}else d(p,"discriminator"),f(p),h(p);else d(p,"discriminator"),f(p),h(p)}}function l(p,g,m,_){(typeof g!="number"||!Number.isInteger(g)||g<m||g>_)&&f(p)}function c(p,g){p.instanceTokens.push(g)}function u(p){p.instanceTokens.pop()}function d(p,g){p.schemaTokens[p.schemaTokens.length-1].push(g)}function h(p){p.schemaTokens[p.schemaTokens.length-1].pop()}function f(p){if(p.errors.push({instancePath:[...p.instanceTokens],schemaPath:[...p.schemaTokens[p.schemaTokens.length-1]]}),p.errors.length===p.config.maxErrors)throw new s}return d0}var eye;function x4t(){return eye||(eye=1,function(i){var e=mC&&mC.__createBinding||(Object.create?function(r,s,o,a){a===void 0&&(a=o),Object.defineProperty(r,a,{enumerable:!0,get:function(){return s[o]}})}:function(r,s,o,a){a===void 0&&(a=o),r[a]=s[o]}),n=mC&&mC.__exportStar||function(r,s){for(var o in r)o!=="default"&&!s.hasOwnProperty(o)&&e(s,r,o)};Object.defineProperty(i,"__esModule",{value:!0}),n(a5e(),i),n(S4t(),i)}(mC)),mC}var k4t=x4t();const L4t={collection_name:{type:"string"},dense_vectors:{elements:{properties:{name:{type:"string"},size:{type:"uint32"},distance:{enum:["Cosine","Euclid","Dot","Manhattan"]},multivector:{type:"boolean"},storage_tier:{enum:["storage","balanced","performance"]},precision_tier:{enum:["low","medium","high"]}}}},payload_indexes:{elements:{properties:{name:{type:"string"},type:{enum:["keyword","integer","float","uuid","datetime","text","geo","bool"]}},optionalProperties:{params:{optionalProperties:{lowercase:{type:"boolean"},tokenizer:{enum:["prefix","whitespace","word","multilingual"]},min_token_length:{type:"uint32"},max_token_length:{type:"uint32"},range:{type:"boolean"},lookup:{type:"boolean"},phrase_matching:{type:"boolean"}}}}}},tenant_field:{properties:{name:{type:"string"},type:{enum:["keyword"]}}},sparse_vectors:{elements:{properties:{name:{type:"string"},use_idf:{type:"boolean"},storage_tier:{enum:["storage","balanced","performance"]},precision_tier:{enum:["low","medium","high"]}}}}},D4t={optionalProperties:L4t};function E4t(i){if(i.sparse_vectors&&i.sparse_vectors.length>0&&!i.sparse_vectors.every(n=>n.name&&n.name.trim()!==""))throw new Error("Every sparse vector must have a non-empty name");const e=k4t.validate(D4t,i);if(e.length>0)throw new Error(`Invalid form output: ${JSON.stringify(e,null,2)}`);return i}function tye(i,e){}function I4t(i,e){i.collection_name=e==null?void 0:e.collection_name}function T4t(i,e){i.tenant_field={name:e.tenant_id,type:"keyword"}}function R4t(i,e){var s,o,a,l;let n=(o=(s=e==null?void 0:e.vector_config_group)==null?void 0:s.vector_config)==null?void 0:o.dimensions,r=((l=(a=e==null?void 0:e.vector_config_group)==null?void 0:a.vector_config)==null?void 0:l.metric)||"Cosine";i.dense_vectors=[{name:"",size:n,distance:r,multivector:!1,storage_tier:"balanced",precision_tier:"high"}]}function A4t(i,e){var l,c,u,d,h,f,p,g;let n=(l=e==null?void 0:e.vector_config_group)==null?void 0:l.dense_vector_name,r=(u=(c=e==null?void 0:e.vector_config_group)==null?void 0:c.dense_vector_config)==null?void 0:u.dimensions,s=((h=(d=e==null?void 0:e.vector_config_group)==null?void 0:d.dense_vector_config)==null?void 0:h.metric)||"Cosine",o=(f=e==null?void 0:e.sparse_vector_config_group)==null?void 0:f.sparse_vector_name,a=((g=(p=e==null?void 0:e.sparse_vector_config_group)==null?void 0:p.sparse_vector_config)==null?void 0:g.use_idf)||!1;i.dense_vectors=[{name:n,size:r,distance:s,multivector:!1,storage_tier:"balanced",precision_tier:"high"}],i.sparse_vectors=[{name:o,use_idf:a,storage_tier:"balanced",precision_tier:"high"}]}function N4t(i,e){if(!(e!=null&&e.custom_dense_vectors)){i.dense_vectors=[];return}i.dense_vectors=e.custom_dense_vectors.map(n=>{var r,s,o;return{name:n.vector_name,size:n.vector_config.dimensions,distance:n.vector_config.metric||"Cosine",multivector:((r=n==null?void 0:n.advanced_config)==null?void 0:r.multivector)||!1,storage_tier:((s=n==null?void 0:n.advanced_config)==null?void 0:s.storage_tier)||"balanced",precision_tier:((o=n==null?void 0:n.advanced_config)==null?void 0:o.precision_tier)||"high"}})}function M4t(i,e){if(!(e!=null&&e.custom_sparse_vectors)){i.sparse_vectors=[];return}i.sparse_vectors=e.custom_sparse_vectors.map(n=>{var r,s,o;return{name:n.vector_name,use_idf:((r=n==null?void 0:n.vector_config)==null?void 0:r.use_idf)??!1,storage_tier:((s=n==null?void 0:n.advanced_config)==null?void 0:s.storage_tier)||"balanced",precision_tier:((o=n==null?void 0:n.advanced_config)==null?void 0:o.precision_tier)||"high"}})}function P4t(i,e){if(!(e!=null&&e.payload_fields)){i.payload_indexes=[];return}i.payload_indexes=e.payload_fields.map(n=>{var s,o,a,l,c,u,d;let r={};if(n.field_config.field_config_enum==="text"){r.lowercase=((s=n.field_config)==null?void 0:s.lowercase)??!0,r.tokenizer=((o=n.field_config)==null?void 0:o.tokenizer)||"whitespace",r.phrase_matching=((a=n.field_config)==null?void 0:a.phrase_matching)??!0;const h=(l=n.field_config)==null?void 0:l.min_token_length,f=(c=n.field_config)==null?void 0:c.max_token_length;if(h!==void 0&&h!==""){const p=typeof h=="number"?h:parseInt(h,10);!isNaN(p)&&p>=0&&(r.min_token_length=p)}if(f!==void 0&&f!==""){const p=typeof f=="number"?f:parseInt(f,10);!isNaN(p)&&p>=0&&(r.max_token_length=p)}}else n.field_config.field_config_enum==="integer"&&(r.range=((u=n.field_config)==null?void 0:u.range)??!0,r.lookup=((d=n.field_config)==null?void 0:d.lookup)??!0);return{name:n.field_name,type:n.field_config.field_config_enum,params:r}})}const nye={"collection-name-step":I4t,"use-case-step":tye,"tenant-field-selection-step":T4t,"templates-selection-step":tye,"simple-dense-embedding-step":R4t,"simple-hybrid-embedding-step":A4t,"custom-collection-dense-step":N4t,"custom-collection-sparse-step":M4t,"index-field-selection-step":P4t};function O4t(i,e){let n={};return(e||[]).forEach(r=>{let s=i[r];nye[r]&&nye[r](n,s)}),E4t(n)}const l5e=function({onFinish:e,hideSidebar:n=!1,scrollableParent:r,sx:s,...o}){const a=r||(()=>window),[l,c]=$.useState(()=>JSON.parse(localStorage.getItem("path"))||["collection-name-step"]),[u,d]=$.useState(()=>JSON.parse(localStorage.getItem("formData"))||{}),h=(k,D)=>{const R=l.indexOf(k),E=l.slice(0,R+1);E.push(D),c(E)},f=(k,D,R)=>{d(E=>({...E,[k]:D})),R&&h(k,R)},p=()=>{c(["collection-name-step"]),d({})};$.useEffect(()=>{u&&localStorage.setItem("formData",JSON.stringify(u)),l.length>0&&localStorage.setItem("path",JSON.stringify(l))},[l,u]),$.useEffect(()=>{const k=a();let D=k===window?document.documentElement.scrollHeight:k.scrollHeight;k.scrollTo({top:D,behavior:"smooth"})},[l]);const g={"use-case-step":Eie,"tenant-field-selection-step":v4t,"templates-selection-step":Eie,"simple-dense-embedding-step":b4t,"simple-hybrid-embedding-step":y4t,"index-field-selection-step":w4t},m=l.length;let _=!0,b=!1;const y=l.map((k,D)=>{let R=g[k];R||(R=oT);const E=u[k],A=D===m-1;let M;typeof E=="object"?M=E==null?void 0:E.completed:M=!!E,_=_&&M;const N=o4t[k];return N!=null&&N.finish&&(b=!0),C.jsx(Ye,{sx:{mb:4},children:C.jsx(R,{stepName:k,config:N,stepData:E,onApply:f,isLast:A,handleClear:p,useCard:N.useCard})},k)}),x=()=>{const k=O4t(u,l);k?e(k).then(D=>{D&&p()}):console.error("Failed to prepare output")};return C.jsx(YOe.Provider,{value:{scrollableParent:a},children:C.jsxs(a4t,{children:[C.jsxs(aLe,{maxWidth:"md",children:[y,b&&Object.values(u).some(k=>typeof k=="object"&&(k==null?void 0:k.completed))?C.jsxs(ln,{size:12,display:"flex",justifyContent:"flex-end",children:[C.jsx(yI,{variant:"text",onClick:p,children:"Clear"}),C.jsx(yI,{disabled:!_,variant:"contained",onClick:x,sx:{ml:4},children:"Finish"})]}):C.jsx(C.Fragment,{})]}),!n&&C.jsxs(f4t,{children:[C.jsx(Je,{variant:"h6",sx:{mb:2},children:"Estimated Price:"}),C.jsx(Je,{variant:"h4",children:"200$"})]})]})})};l5e.propTypes={ref:Z.object,onFinish:Z.func.isRequired,hideSidebar:Z.bool,scrollableParent:Z.func,sx:Z.object};const pB={STORAGE:"storage",BALANCED:"balanced",PERFORMANCE:"performance"},Iy={LOW:"low",MEDIUM:"medium",HIGH:"high"};function F4t(i,e){const{size:n,distance:r,multivector:s=!1,rescoring:o=!1,storage_tier:a=pB.BALANCED,precision_tier:l=Iy.HIGH}=i;let c=null;s&&(c={comparator:"max_sim"});let u=null,d=null,h=!0,f=!0,p=null;return a===pB.STORAGE?(e&&(h=!1),f=!1):a===pB.BALANCED?(f=!1,h=!0):a===pB.PERFORMANCE&&(f=!0,h=!0),l===Iy.LOW?(p="float16",n>=1024?d={binary:{always_ram:h}}:d={scalar:{type:"int8",always_ram:h,quantile:.99}}):l===Iy.MEDIUM?(p="float32",d={scalar:{type:"int8",always_ram:h,quantile:.99}}):l===Iy.HIGH&&(p="float32",d=null,u={m:24,payload_m:24,ef_construct:256},e?f=!1:f=!0),o&&(u={m:0,payload_m:0}),e&&(u?u.m=0:u={m:0,payload_m:16}),{size:n,distance:r,multivector_config:c,on_disk:!f,quantization_config:d,hnsw_config:u,datatype:p}}function B4t(i){const{precisionTier:e=Iy.HIGH,modifier:n=null}=i;let r=null;return e===Iy.LOW?r="uint8":e===Iy.MEDIUM?r="float16":e===Iy.HIGH&&(r="float32"),{modifier:n,index:{on_disk:!0,datatype:r}}}function j4t(i,e){const n=!!e.tenant_field;e.tenant_field&&e.payload_indexes.push({name:e.tenant_field.name,type:e.tenant_field.type,params:{on_disk:!1,is_tenant:!0,is_principal:!0}});const r={};if(e.dense_vectors)for(const o of e.dense_vectors){const a=o.name;r[a]=F4t(o,n)}const s={};if(e.sparse_vectors)for(const o of e.sparse_vectors){const a=o.name;s[a]=B4t(o)}return{collection_name:i,vectors_config:r,sparse_vectors_config:s,payload_indexes:e.payload_indexes}}async function W4t(i,e,n=!1){const r=e.collection_name;if(await i.collectionExists(r).then(c=>c.exists))if(n)await i.deleteCollection(r);else throw new Error(`Collection "${r}" already exists. Remove it first to recreate.`);const o=j4t(r,e),a={vectors:o.vectors_config,sparse_vectors:o.sparse_vectors_config},l=await i.createCollection(o.collection_name,a);if(l&&o.payload_indexes)for(const c of o.payload_indexes){const u=c.name,d={type:c.type,...c.params||{}};await i.createPayloadIndex(r,{field_name:u,field_schema:d})}return l}const c5e=({open:i,handleClose:e})=>{const{client:n}=Ur(),r=$i(),s=nn.useRef(),o=()=>s.current?s.current:window,a=$.useCallback(async l=>{let c=null;try{c=await W4t(n,l)}catch(u){rf(u.message,as("warning",Xd,2e3))}finally{e()}return c},[n,e]);return C.jsxs(Vm,{fullScreen:!0,open:i,onClose:e,"aria-labelledby":"create-collection-dialog-title",children:[C.jsx(zke,{sx:{background:r.palette.background.paperElevation1,boxShadow:"none",borderBottom:`1px solid ${r.palette.divider}`,position:"sticky"},children:C.jsxs(ELe,{sx:{width:"848px",maxWidth:"848px",minHeight:"48px",px:2,py:.5,mx:"auto"},children:[C.jsx(Ga,{edge:"start",color:"default",onClick:e,"aria-label":"close",children:C.jsx(Fet,{size:24})}),C.jsx(Je,{id:"create-collection-dialog-title",sx:{ml:1,flex:1,color:r.palette.text.primary},variant:"body1",component:"div",children:"Create New Collection"})]})}),C.jsx(a1,{ref:s,sx:{p:0,backgroundColor:r.palette.background.default},children:C.jsx(l5e,{onFinish:a,hideSidebar:!0,scrollableParent:o,"aria-label":"Create Collection Form","aria-role":"dialog"})})]})};c5e.propTypes={open:Z.bool.isRequired,handleClose:Z.func.isRequired};const u5e=({onComplete:i})=>{const[e,n]=$.useState(!1),{isRestricted:r}=Ur(),s=$.useCallback(()=>{n(!1),i()},[i]),o=$.useCallback(()=>{r||n(!0)},[r]);return C.jsxs(C.Fragment,{children:[C.jsx(ua,{title:r?"Access Denied: You do not have permission to create collections. Please contact your administrator.":"Create collection",placement:"left",children:C.jsx("span",{children:C.jsx(Ci,{variant:"contained",startIcon:C.jsx(TPe,{fontSize:"small"}),onClick:o,disabled:r,"aria-label":"Create Collection",children:"Create Collection"})})}),C.jsx(c5e,{open:e,handleClose:s})]})};u5e.propTypes={onComplete:Z.func.isRequired};function $4t(){const[i,e]=$.useState(null),[n,r]=$.useState(null),[s,o]=$.useState(null),[a,l]=$.useState(""),[c,u]=$.useState(null),{client:d}=Ur(),[h,f]=$.useState(1),p=5,{maxCollections:g}=mnt(),m=$.useCallback(D=>{const R=d.getApiKey();return z8(D,{withApiKey:{apiKey:R}})},[d]),_=$.useCallback(async(D=1)=>{try{const R=await d.getCollections(),E=await d.getAliases(),A=R.collections.sort((P,O)=>P.name.localeCompare(O.name));r(A);const M=A.slice((D-1)*p,D*p),N=await Promise.all(M.map(async P=>{const O=await d.getCollection(P.name),B=E.aliases.filter(j=>j.collection_name===P.name).map(j=>j.alias_name);return{name:P.name,...O,aliases:[...B]}}));e(N.sort((P,O)=>P.name.localeCompare(O.name))),u(null)}catch(R){const E=m(R);E&&u(E),e(null)}},[d,m]),b=$.useCallback(async D=>{try{if(!n)return;const R=n.filter(A=>A.name.match(D));o(R);const E=await Promise.all(R.map(async A=>{const M=await d.getCollection(A.name);return{name:A.name,...M}}));e(E.sort((A,M)=>A.name.localeCompare(M.name))),u(null)}catch(R){const E=m(R);E&&u(E),e(null)}},[n,d,m]);$.useEffect(()=>{_(h)},[h,_]),$.useEffect(()=>{a?y(a):_(h)},[a,h,_]);const y=$.useMemo(()=>gV.debounce(b,100),[b]),x=(D,R)=>{f(R)},k=a?s:n;return C.jsx(C.Fragment,{children:C.jsxs(iT,{children:[c!==null&&C.jsx(g4,{message:c}),C.jsxs(ln,{container:!0,maxWidth:"xl",width:"100%",spacing:3,children:[C.jsx(ln,{size:{xs:12,md:5},children:C.jsxs(Je,{variant:"h4",component:"h1",sx:{lineHeight:"1"},children:["Collections"," ",g&&k?`(${k.length} / ${g})`:""]})}),C.jsxs(ln,{sx:{display:"flex",justifyContent:{md:"end"},gap:2},size:{xs:12,md:7},children:[C.jsx(u5e,{onComplete:()=>_(h)}),C.jsx(FOe,{onComplete:()=>_(h)},"snapshots")]}),C.jsx(ln,{size:12,mb:2,children:C.jsx(GPe,{value:a,setValue:l})}),c&&C.jsx(ln,{textAlign:"center",mt:3,size:12,children:C.jsxs(Je,{children:["⚠ Error: ",c]})}),!k&&!c&&C.jsxs(ln,{textAlign:"center",size:12,children:[C.jsx(bU,{variant:"rounded",height:70,animation:"wave",sx:{mb:1}}),C.jsx(bU,{variant:"rounded",height:70,animation:"wave",sx:{mb:1}}),C.jsx(bU,{variant:"rounded",height:70,animation:"wave",sx:{mb:1}})]}),k&&!c&&k.length===0&&C.jsx(ln,{textAlign:"center",mt:3,size:12,children:C.jsx(Je,{children:" 📪 No collection is present"})}),i!=null&&i.length&&!c?C.jsxs(ln,{size:12,children:[C.jsx(zOe,{collections:i,getCollectionsCall:()=>_(h)}),k&&k.length>p&&C.jsx(Ye,{justifyContent:"center",display:"flex",mt:3,children:C.jsx(FGe,{shape:"rounded",count:Math.ceil(k.length/p),page:h,onChange:x})})]}):C.jsx(C.Fragment,{})]})]})})}const z4t=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],V4t=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],H4t=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],U4t=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],iye=(i,e,n)=>{let r=i;return typeof e=="string"||Array.isArray(e)?r=i.toLocaleString(e,n):(e===!0||n!==void 0)&&(r=i.toLocaleString(void 0,n)),r};function d5e(i,e){if(!Number.isFinite(i))throw new TypeError(`Expected a finite number, got ${typeof i}: ${i}`);e={bits:!1,binary:!1,space:!0,...e};const n=e.bits?e.binary?U4t:H4t:e.binary?V4t:z4t,r=e.space?" ":"";if(e.signed&&i===0)return` 0${r}${n[0]}`;const s=i<0,o=s?"-":e.signed?"+":"";s&&(i=-i);let a;if(e.minimumFractionDigits!==void 0&&(a={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(a={maximumFractionDigits:e.maximumFractionDigits,...a}),i<1){const d=iye(i,e.locale,a);return o+d+r+n[0]}const l=Math.min(Math.floor(e.binary?Math.log(i)/Math.log(1024):Math.log10(i)/3),n.length-1);i/=(e.binary?1024:1e3)**l,a||(i=i.toPrecision(3));const c=iye(Number(i),e.locale,a),u=n[l];return o+c+r+u}function h5e({value:i,size:e=40,sx:n={},circularProgressProps:r={},...s}){return C.jsxs(Ye,{sx:{position:"relative",display:"inline-flex",width:e,height:e,...n},...s,children:[C.jsx(c5,{variant:"determinate",sx:{position:"absolute",top:"50%",left:"50%",marginTop:`-${e/2}px`,marginLeft:`-${e/2}px`,...r.sx},size:e,value:i,...r}),C.jsx(Ye,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:C.jsx(Je,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(i)}%`})})]})}h5e.propTypes={value:Z.number.isRequired,size:Z.number,sx:Z.object,circularProgressProps:Z.object};const f5e=({snapshot:i,downloadSnapshot:e,deleteSnapshot:n})=>{const r=$i(),{client:s}=Ur(),[o,a]=$.useState(!1),[l,c]=$.useState(0);return C.jsxs(fk,{children:[C.jsxs(ki,{width:"60%",children:[C.jsx(ua,{title:"Download snapshot",arrow:!0,placement:"top",children:C.jsxs(Ye,{sx:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",cursor:l===0?"pointer":"default",textDecorationThickness:"1px",textUnderlineOffset:"2px","&:hover":{textDecoration:l===0?"underline":"none",textDecorationThickness:"1px","& .MuiSvgIcon-root":{color:l===0?r.palette.primary.dark:r.palette.divider}}},onClick:()=>e(i.name,i.size,l,c),children:[C.jsxs(Ye,{sx:{position:"relative"},children:[C.jsx(Ye,{sx:{display:"flex",alignItems:"center",backgroundColor:Pt(r.palette.secondary.main,.16),borderRadius:"0.5rem",padding:"0.5rem",marginRight:"0.5rem"},children:C.jsx(CDe,{size:16,color:l===0?r.palette.secondary.main:r.palette.divider})}),l>0&&C.jsx(h5e,{value:l,size:16,color:r.palette.secondary.main,sx:{position:"absolute",top:"50%",left:"50%",marginTop:"-8px",marginLeft:"-12px"}})]}),l===0?i.name:`${i.name.slice(0,20)}...`]})}),l>0&&C.jsx(JS,{label:"Preparing download",size:"small",sx:{ml:3,mb:"2px"},deleteIcon:C.jsx(ua,{title:"Cancel download",placement:"right",children:C.jsx(Xet,{size:16})}),onDelete:()=>{s.abortDownload(),c(0)}})]}),C.jsx(ki,{align:"center",children:i.creation_time||"unknown"}),C.jsx(ki,{align:"center",sx:{whiteSpace:"nowrap"},children:d5e(i.size)}),C.jsx(ki,{align:"right",children:C.jsxs(Ye,{sx:{display:"flex",gap:1},children:[C.jsx(Ci,{variant:"outlined",size:"small",startIcon:C.jsx(ett,{size:18}),onClick:()=>e(i.name,i.size,l,c),sx:{px:"10px",py:"4px"},children:"Download"}),C.jsx(Ci,{variant:"outlined",size:"small",color:"error",startIcon:C.jsx(vse,{size:18}),onClick:()=>a(!0),sx:{px:"10px",py:"4px"},children:"Delete"})]})}),C.jsx(x4,{open:o,onClose:()=>a(!1),title:"Delete snapshot",content:`Are you sure you want to delete snapshot ${i.name}?`,warning:"This action cannot be undone.",actionName:"Delete",actionHandler:()=>n(i.name)})]},i.name)};f5e.propTypes={snapshot:Z.shape({name:Z.string,creation_time:Z.string,size:Z.number}),downloadSnapshot:Z.func,deleteSnapshot:Z.func};const tce=({severity:i,children:e,onClose:n,hideCloseButton:r})=>{const[s,o]=$.useState(!0),a=()=>{n&&n(),o(!1)};return C.jsx(Ye,{sx:{width:"100%"},children:C.jsx(_E,{in:s,children:C.jsx(l_,{severity:i,action:!r&&C.jsx(Ga,{"aria-label":"close",color:"inherit",size:"small",onClick:a,children:C.jsx(RPe,{fontSize:"inherit"})}),sx:{my:2,lineHeight:1.7},children:e})})})};tce.propTypes={severity:Z.string.isRequired,children:Z.node.isRequired,onClose:Z.func,hideCloseButton:Z.bool};const p5e=({collectionName:i})=>{const{client:e}=Ur(),[n,r]=$.useState([]),[s,o]=$.useState(!1),[a,l]=$.useState(!1),{enqueueSnackbar:c,closeSnackbar:u}=pu(),d=as("error",u),[h,f]=$.useState([]),[p,g]=$.useState([]);$.useEffect(()=>{o(!0),e.listSnapshots(i).then(x=>{r([...x])}).catch(x=>{c(x.message,d)}).finally(()=>{o(!1)}),e.api("cluster").collectionClusterInfo({collection_name:i}).then(x=>{const k=x.data.result.remote_shards,D=x.data.result.local_shards;k.length>0&&(g(k),f(D))}).catch(x=>{c(x.message,d)})},[e,i]);const m=()=>{l(!0),e.createSnapshot(i).then(x=>{r([...n,x])}).catch(x=>{c(x.message,d)}).finally(()=>{l(!1)})},_=(x,k,D,R)=>{if(D>0){c("Please wait until the previous download is finished",as("warning",u,2e3));return}e.downloadSnapshot(i,x).then(E=>{const A=E.body.getReader(),M=GJe(k,R);return pDe(A,M)}).then(E=>new Blob(E)).then(E=>{const A=window.URL.createObjectURL(E),M=document.createElement("a");M.href=A,M.download=x,document.body.appendChild(M),M.click(),M.remove(),setTimeout(()=>{R(0)},500)}).catch(E=>{if(E.name==="AbortError"){c("Download canceled",as("warning",u,2e3));return}c(E.message,d)})},b=x=>{o(!0),e.deleteSnapshot(i,x).then(()=>{r([...n.filter(k=>k.name!==x)]),c("Snapshot successfully deleted",as("success",u,2e3))}).catch(k=>{c(k.message,d)}).finally(()=>{o(!1)})},y=n.map(x=>{var k;return C.jsx(f5e,{snapshot:x,downloadSnapshot:_,deleteSnapshot:b},((k=x.creation_time)==null?void 0:k.valueOf())||"unknown")});return C.jsx("div",{children:C.jsxs(ln,{container:!0,alignItems:"center",spacing:3,children:[C.jsx(ln,{size:{xs:12,md:8},children:C.jsx(Je,{variant:"h4",component:"h1",children:"Snapshots"})}),C.jsx(ln,{sx:{display:"flex",justifyContent:"end"},size:{xs:12,md:4},children:C.jsx(Ci,{variant:"contained",onClick:m,startIcon:C.jsx($et,{size:18}),disabled:a,children:"Take snapshot"})}),p&&p.length!==0&&C.jsxs(tce,{severity:"warning",children:[C.jsx(Je,{children:"Snapshot will not contain the full collection. It will only include shards on the current machine."}),h.length>0&&C.jsxs(C.Fragment,{children:[C.jsx(Je,{children:"Local shards:"}),C.jsx("ul",{children:h.map(x=>C.jsxs(Je,{component:"li",children:["Id: ",x.shard_id]},x.shard_id))})]}),C.jsxs(C.Fragment,{children:[C.jsx(Je,{children:"Remote shards (not included in the snapshot):"}),C.jsx("ul",{children:p.map(x=>C.jsxs(Je,{component:"li",children:["Id: ",x.shard_id," (",x.peer_id,")"]},x.shard_id))})]}),C.jsxs(Je,{children:["For more information, please visit the"," ",C.jsx(XM,{href:"https://qdrant.tech/documentation/tutorials/create-snapshot/",target:"_blank",children:"documentation"}),"."]})]}),s&&C.jsx("div",{children:"Loading..."}),((n==null?void 0:n.length)>0||a)&&C.jsx(ln,{size:12,children:C.jsx(w4,{children:C.jsxs(Bv,{"aria-label":"simple table",children:[C.jsx(C4,{children:C.jsxs(ng,{children:[C.jsx(Yc,{children:"Snapshot Name"}),C.jsx(Yc,{align:"center",children:"Created at"}),C.jsx(Yc,{align:"center",children:"Size"}),C.jsx(Yc,{align:"center",children:"Actions"})]})}),C.jsxs(S4,{children:[y,a&&C.jsx(fk,{children:C.jsx(ki,{colSpan:4,align:"center",children:"Loading..."})})]})]})})}),!s&&!(n!=null&&n.length)&&!a&&C.jsx(ln,{textAlign:"center",size:12,children:C.jsx(Je,{children:"No snapshots yet, take one! 📸"})})]})})};p5e.propTypes={collectionName:Z.string.isRequired};const q4t=({successMessage:i="Copied to clipboard",duration:e=1e3})=>{const{enqueueSnackbar:n,closeSnackbar:r}=pu(),s=as("success",r,e),o=as("error",r);return{copyToClipboard:async l=>{try{return await navigator.clipboard.writeText(l),n(i,s),!0}catch(c){return n(c.message,o),!1}}}},nce=({text:i,tooltip:e="Copy to clipboard",tooltipPlacement:n="left",successMessage:r="Copied to clipboard",renderButton:s})=>{const{copyToClipboard:o}=q4t({successMessage:r}),l=s({handleCopy:()=>{o(i)}});return C.jsx(ua,{title:e,placement:n,children:l})};nce.propTypes={text:Z.string.isRequired,tooltip:Z.string,tooltipPlacement:Z.string,successMessage:Z.string,renderButton:Z.func.isRequired};const p_=({text:i,tooltip:e="Copy to clipboard",tooltipPlacement:n="left",successMessage:r="Copied to clipboard",size:s,iconButtonProps:o})=>{const a=({handleCopy:l})=>C.jsx(Ga,{sx:{color:"text.primary"},"aria-label":e,onClick:l,...o,children:C.jsx(SDe,{size:s||"1.25rem"})});return C.jsx(nce,{text:i,tooltip:e,tooltipPlacement:n,successMessage:r,renderButton:a})};p_.propTypes={text:Z.string.isRequired,tooltip:Z.string,tooltipPlacement:Z.string,successMessage:Z.string,size:Z.string,iconButtonProps:Z.object};const K4t=()=>C.jsx(OW,{children:C.jsxs(ng,{children:[C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",fontWeight:600,children:"Shard ID"})}),C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",fontWeight:600,children:"Location"})}),C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",fontWeight:600,children:"Status"})})]})}),g5e=({shard:i,clusterPeerId:e})=>C.jsxs(ng,{"data-testid":"shard-row",children:[C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",component:"span",color:"text.secondary",children:i.shard_id})}),C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",component:"span",color:"text.secondary",children:i.peer_id?`Remote (${i.peer_id})`:`Local (${e??"unknown"})`})}),C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",component:"span",color:"text.secondary",children:i.state})})]});g5e.propTypes={shard:Z.shape({shard_id:Z.number,peer_id:Z.number,state:Z.string}).isRequired,clusterPeerId:Z.number};const m5e=({collectionCluster:i={result:{}},...e})=>{var s,o;const r=[...((s=i.result)==null?void 0:s.local_shards)||[],...((o=i.result)==null?void 0:o.remote_shards)||[]].map(a=>{var l;return C.jsx(g5e,{shard:a,clusterPeerId:(l=i.result)==null?void 0:l.peer_id},a.shard_id.toString()+(a.peer_id||""))});return C.jsxs(Fv,{elevation:0,...e,children:[C.jsx(h5,{title:"Collection Cluster Info",variant:"heading",sx:{flexGrow:1},action:C.jsx(p_,{text:ls.stringify(i)})}),C.jsxs(Bv,{children:[C.jsx(K4t,{}),C.jsx(PW,{sx:{"& tr:last-of-type td":{borderBottom:"none"}},children:r})]})]})};m5e.propTypes={collectionCluster:Z.shape({result:Z.shape({peer_id:Z.number,local_shards:Z.arrayOf(Z.shape({shard_id:Z.number,state:Z.string})),remote_shards:Z.arrayOf(Z.shape({shard_id:Z.number,peer_id:Z.number,state:Z.string}))})}).isRequired,other:Z.object};const _5e=({collectionName:i})=>{const{client:e}=Ur(),[n,r]=$.useState(!1),[s,o]=$.useState(""),[a,l]=$.useState([]),c=$i();$.useEffect(()=>{(async()=>{try{const p=await e.getCollectionAliases(i);l(p.aliases||[])}catch(p){rf(p.message,as("error",Xd))}})().catch(p=>console.error(p))},[i,e]);const u=$.useCallback(async f=>{try{await e.updateCollectionAliases({actions:[{delete_alias:{alias_name:f}}]}),l(p=>p.filter(g=>g.alias_name!==f)),rf("Alias deleted successfully",as("success",Xd,2e3))}catch(p){rf(p.message,as("error",Xd))}},[e]),d=$.useCallback(async f=>{const p=f.trim();if(a.some(g=>g.alias_name===p)){rf("Alias name already exists",as("error",Xd,2e3)),r(!1);return}if(!p){rf("Alias name cannot be empty",as("error",Xd,2e3));return}try{await e.updateCollectionAliases({actions:[{create_alias:{collection_name:i,alias_name:p}}]}),l(g=>[...g,{alias_name:p}]),r(!1),rf("Alias created successfully",as("success",Xd,2e3))}catch(g){rf(g.message,as("error",Xd))}},[i,e,a]),h=a.map(f=>C.jsx(v5e,{aliasName:f.alias_name,onDelete:()=>o(f.alias_name)},f.alias_name));return C.jsxs(w4,{sx:{mb:5},children:[C.jsxs(Bv,{"aria-label":"aliases table",children:[C.jsx(C4,{sx:{background:c.palette.background.paperElevation1,borderBottom:0},children:C.jsxs(ng,{sx:{background:Pt(c.palette.action.hover,.04)},children:[C.jsx(ki,{sx:{py:1,borderBottom:0},children:C.jsx(Je,{variant:"h6",children:"Aliases"})}),C.jsx(ki,{sx:{py:.5,borderBottom:0},align:"right",children:C.jsx(Ye,{sx:{display:"flex",justifyContent:"flex-end"},children:C.jsx(Ci,{variant:"contained",size:"small",sx:{display:"block",py:.75,mb:.2},onClick:()=>r(!0),children:"Create alias"})})})]})}),C.jsx(S4,{children:a.length===0?C.jsx(fk,{children:C.jsx(ki,{colSpan:2,width:"100%",align:"left",children:C.jsx(Je,{variant:"subtitle1",color:"text.secondary",children:"No aliases found"})})}):h})]}),C.jsx(b5e,{open:n,onClose:()=>r(!1),onCreate:d}),C.jsx(x4,{open:!!s,onClose:()=>o(""),title:"Delete Alias",content:`Are you sure you want to delete the alias ${s}?`,warning:"This action cannot be undone.",actionName:"Delete",actionHandler:()=>{u(s).catch(f=>console.error(f)),o("")}})]})},v5e=({aliasName:i,onDelete:e})=>C.jsxs(fk,{children:[C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",color:"text.secondary",children:i})}),C.jsx(ki,{align:"right",children:C.jsx(Ye,{sx:{display:"flex",justifyContent:"flex-end"},children:C.jsx(ua,{title:"Delete alias",placement:"left",children:C.jsx(Ci,{variant:"outlined",size:"small",startIcon:C.jsx(vse,{size:18}),sx:{px:"10px",py:"4px"},onClick:e,"aria-label":"delete",color:"error","data-testid":`delete-alias-${i}`,children:"Delete"})})})})]});v5e.propTypes={aliasName:Z.string.isRequired,onDelete:Z.func.isRequired};const b5e=({open:i,onClose:e,onCreate:n})=>{const[r,s]=$.useState(""),[o,a]=$.useState(!1),l=d=>{d.target.value&&o&&a(!1),s(d.target.value)},c=()=>{if(!r){a(!0);return}n(r),a(!1),s("")},u=()=>{a(!1),s(""),e()};return C.jsxs(Vm,{fullWidth:!0,open:i,onClose:u,"aria-labelledby":"create-alias-title","data-testid":"create-alias-dialog",role:"dialog",slotProps:{transition:{onEntered:()=>{const d=document.getElementById("alias-name-input");d&&d.focus()}}},children:[C.jsx(tx,{sx:{p:3},id:"create-alias-title",children:"Create Collection Alias"}),C.jsx(a1,{children:C.jsx(Ep,{id:"alias-name-input","data-testid":"alias-name-input",placeholder:"Alias Name",value:r,onChange:l,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c())},error:o,helperText:o?"Alias name is required":"",autoFocus:!0,required:!0,margin:"dense",fullWidth:!0,variant:"outlined"})}),C.jsxs(CE,{sx:{p:3},children:[C.jsx(Ci,{variant:"outlined",color:"inherit",onClick:u,children:"Cancel"}),C.jsx(Ci,{variant:"contained",disabled:!r,onClick:c,"data-testid":"create-alias-button",children:"Create"})]})]})};b5e.propTypes={open:Z.bool.isRequired,onClose:Z.func.isRequired,onCreate:Z.func.isRequired};_5e.propTypes={collectionName:Z.string.isRequired};var cf=C.Fragment,vn=function(e,n,r){return t5.call(n,"css")?C.jsx(kre,xre(e,n),r):C.jsx(e,n,r)},Qc=function(e,n,r){return t5.call(n,"css")?C.jsxs(kre,xre(e,n),r):C.jsxs(e,n,r)};const PO={black:"#000",white:"#fff"},bD={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},yD={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},wD={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},CD={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},SD={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},NA={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},G4t={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function wI(i){let e="https://mui.com/production-error/?code="+i;for(let n=1;n<arguments.length;n+=1)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+i+"; visit "+e+" for the full message."}const X4t=Object.freeze(Object.defineProperty({__proto__:null,default:wI},Symbol.toStringTag,{value:"Module"})),OO="$$material";let Iie;typeof document=="object"&&(Iie=wre({key:"css",prepend:!0}));function Y4t(i){const{injectFirst:e,children:n}=i;return e&&Iie?C.jsx(V9e,{value:Iie,children:n}):n}function Z4t(i){return i==null||Object.keys(i).length===0}function y5e(i){const{styles:e,defaultTheme:n={}}=i,r=typeof e=="function"?s=>e(Z4t(s)?n:s):e;return C.jsx(rke,{styles:r})}function w5e(i,e){return o9(i,e)}const Q4t=(i,e)=>{Array.isArray(i.__emotion_styles)&&(i.__emotion_styles=e(i.__emotion_styles))},J4t=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:y5e,StyledEngineProvider:Y4t,ThemeContext:j1,css:Mv,default:w5e,internal_processStyles:Q4t,keyframes:tg},Symbol.toStringTag,{value:"Module"}));function dy(i){if(typeof i!="object"||i===null)return!1;const e=Object.getPrototypeOf(i);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)}function C5e(i){if($.isValidElement(i)||!dy(i))return i;const e={};return Object.keys(i).forEach(n=>{e[n]=C5e(i[n])}),e}function Om(i,e,n={clone:!0}){const r=n.clone?Bn({},i):i;return dy(i)&&dy(e)&&Object.keys(e).forEach(s=>{$.isValidElement(e[s])?r[s]=e[s]:dy(e[s])&&Object.prototype.hasOwnProperty.call(i,s)&&dy(i[s])?r[s]=Om(i[s],e[s],n):n.clone?r[s]=dy(e[s])?C5e(e[s]):e[s]:r[s]=e[s]}),r}const eFt=Object.freeze(Object.defineProperty({__proto__:null,default:Om,isPlainObject:dy},Symbol.toStringTag,{value:"Module"})),tFt=["values","unit","step"],nFt=i=>{const e=Object.keys(i).map(n=>({key:n,val:i[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>Bn({},n,{[r.key]:r.val}),{})};function S5e(i){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=i,s=Dc(i,tFt),o=nFt(e),a=Object.keys(o);function l(f){return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n})`}function c(f){return`@media (max-width:${(typeof e[f]=="number"?e[f]:f)-r/100}${n})`}function u(f,p){const g=a.indexOf(p);return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n}) and (max-width:${(g!==-1&&typeof e[a[g]]=="number"?e[a[g]]:p)-r/100}${n})`}function d(f){return a.indexOf(f)+1<a.length?u(f,a[a.indexOf(f)+1]):l(f)}function h(f){const p=a.indexOf(f);return p===0?l(a[1]):p===a.length-1?c(a[p]):u(f,a[a.indexOf(f)+1]).replace("@media","@media not all and")}return Bn({keys:a,values:o,up:l,down:c,between:u,only:d,not:h,unit:n},s)}const iFt={borderRadius:4};function PM(i,e){return e?Om(i,e,{clone:!1}):i}const ice={xs:0,sm:600,md:900,lg:1200,xl:1536},rye={keys:["xs","sm","md","lg","xl"],up:i=>`@media (min-width:${ice[i]}px)`};function Av(i,e,n){const r=i.theme||{};if(Array.isArray(e)){const o=r.breakpoints||rye;return e.reduce((a,l,c)=>(a[o.up(o.keys[c])]=n(e[c]),a),{})}if(typeof e=="object"){const o=r.breakpoints||rye;return Object.keys(e).reduce((a,l)=>{if(Object.keys(o.values||ice).indexOf(l)!==-1){const c=o.up(l);a[c]=n(e[l],l)}else{const c=l;a[c]=e[c]}return a},{})}return n(e)}function rFt(i={}){var e;return((e=i.keys)==null?void 0:e.reduce((r,s)=>{const o=i.up(s);return r[o]={},r},{}))||{}}function sFt(i,e){return i.reduce((n,r)=>{const s=n[r];return(!s||Object.keys(s).length===0)&&delete n[r],n},e)}function s_(i){if(typeof i!="string")throw new Error(wI(7));return i.charAt(0).toUpperCase()+i.slice(1)}const oFt=Object.freeze(Object.defineProperty({__proto__:null,default:s_},Symbol.toStringTag,{value:"Module"}));function wV(i,e,n=!0){if(!e||typeof e!="string")return null;if(i&&i.vars&&n){const r=`vars.${e}`.split(".").reduce((s,o)=>s&&s[o]?s[o]:null,i);if(r!=null)return r}return e.split(".").reduce((r,s)=>r&&r[s]!=null?r[s]:null,i)}function Nj(i,e,n,r=n){let s;return typeof i=="function"?s=i(n):Array.isArray(i)?s=i[n]||r:s=wV(i,n)||r,e&&(s=e(s,r,i)),s}function ga(i){const{prop:e,cssProperty:n=i.prop,themeKey:r,transform:s}=i,o=a=>{if(a[e]==null)return null;const l=a[e],c=a.theme,u=wV(c,r)||{};return Av(a,l,h=>{let f=Nj(u,s,h);return h===f&&typeof h=="string"&&(f=Nj(u,s,`${e}${h==="default"?"":s_(h)}`,h)),n===!1?f:{[n]:f}})};return o.propTypes={},o.filterProps=[e],o}function aFt(i){const e={};return n=>(e[n]===void 0&&(e[n]=i(n)),e[n])}const lFt={m:"margin",p:"padding"},cFt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},sye={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},uFt=aFt(i=>{if(i.length>2)if(sye[i])i=sye[i];else return[i];const[e,n]=i.split(""),r=lFt[e],s=cFt[n]||"";return Array.isArray(s)?s.map(o=>r+o):[r+s]}),rce=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],sce=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...rce,...sce];function E4(i,e,n,r){var s;const o=(s=wV(i,e,!1))!=null?s:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function x5e(i){return E4(i,"spacing",8)}function I4(i,e){if(typeof e=="string"||e==null)return e;const n=Math.abs(e),r=i(n);return e>=0?r:typeof r=="number"?-r:`-${r}`}function dFt(i,e){return n=>i.reduce((r,s)=>(r[s]=I4(e,n),r),{})}function hFt(i,e,n,r){if(e.indexOf(n)===-1)return null;const s=uFt(n),o=dFt(s,r),a=i[n];return Av(i,a,o)}function k5e(i,e){const n=x5e(i.theme);return Object.keys(i).map(r=>hFt(i,e,r,n)).reduce(PM,{})}function Mo(i){return k5e(i,rce)}Mo.propTypes={};Mo.filterProps=rce;function Po(i){return k5e(i,sce)}Po.propTypes={};Po.filterProps=sce;function fFt(i=8){if(i.mui)return i;const e=x5e({spacing:i}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=e(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function CV(...i){const e=i.reduce((r,s)=>(s.filterProps.forEach(o=>{r[o]=s}),r),{}),n=r=>Object.keys(r).reduce((s,o)=>e[o]?PM(s,e[o](r)):s,{});return n.propTypes={},n.filterProps=i.reduce((r,s)=>r.concat(s.filterProps),[]),n}function uf(i){return typeof i!="number"?i:`${i}px solid`}function $f(i,e){return ga({prop:i,themeKey:"borders",transform:e})}const pFt=$f("border",uf),gFt=$f("borderTop",uf),mFt=$f("borderRight",uf),_Ft=$f("borderBottom",uf),vFt=$f("borderLeft",uf),bFt=$f("borderColor"),yFt=$f("borderTopColor"),wFt=$f("borderRightColor"),CFt=$f("borderBottomColor"),SFt=$f("borderLeftColor"),xFt=$f("outline",uf),kFt=$f("outlineColor"),SV=i=>{if(i.borderRadius!==void 0&&i.borderRadius!==null){const e=E4(i.theme,"shape.borderRadius",4),n=r=>({borderRadius:I4(e,r)});return Av(i,i.borderRadius,n)}return null};SV.propTypes={};SV.filterProps=["borderRadius"];CV(pFt,gFt,mFt,_Ft,vFt,bFt,yFt,wFt,CFt,SFt,SV,xFt,kFt);const xV=i=>{if(i.gap!==void 0&&i.gap!==null){const e=E4(i.theme,"spacing",8),n=r=>({gap:I4(e,r)});return Av(i,i.gap,n)}return null};xV.propTypes={};xV.filterProps=["gap"];const kV=i=>{if(i.columnGap!==void 0&&i.columnGap!==null){const e=E4(i.theme,"spacing",8),n=r=>({columnGap:I4(e,r)});return Av(i,i.columnGap,n)}return null};kV.propTypes={};kV.filterProps=["columnGap"];const LV=i=>{if(i.rowGap!==void 0&&i.rowGap!==null){const e=E4(i.theme,"spacing",8),n=r=>({rowGap:I4(e,r)});return Av(i,i.rowGap,n)}return null};LV.propTypes={};LV.filterProps=["rowGap"];const LFt=ga({prop:"gridColumn"}),DFt=ga({prop:"gridRow"}),EFt=ga({prop:"gridAutoFlow"}),IFt=ga({prop:"gridAutoColumns"}),TFt=ga({prop:"gridAutoRows"}),RFt=ga({prop:"gridTemplateColumns"}),AFt=ga({prop:"gridTemplateRows"}),NFt=ga({prop:"gridTemplateAreas"}),MFt=ga({prop:"gridArea"});CV(xV,kV,LV,LFt,DFt,EFt,IFt,TFt,RFt,AFt,NFt,MFt);function uE(i,e){return e==="grey"?e:i}const PFt=ga({prop:"color",themeKey:"palette",transform:uE}),OFt=ga({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:uE}),FFt=ga({prop:"backgroundColor",themeKey:"palette",transform:uE});CV(PFt,OFt,FFt);function ih(i){return i<=1&&i!==0?`${i*100}%`:i}const BFt=ga({prop:"width",transform:ih}),oce=i=>{if(i.maxWidth!==void 0&&i.maxWidth!==null){const e=n=>{var r,s;const o=((r=i.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||ice[n];return o?((s=i.theme)==null||(s=s.breakpoints)==null?void 0:s.unit)!=="px"?{maxWidth:`${o}${i.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ih(n)}};return Av(i,i.maxWidth,e)}return null};oce.filterProps=["maxWidth"];const jFt=ga({prop:"minWidth",transform:ih}),WFt=ga({prop:"height",transform:ih}),$Ft=ga({prop:"maxHeight",transform:ih}),zFt=ga({prop:"minHeight",transform:ih});ga({prop:"size",cssProperty:"width",transform:ih});ga({prop:"size",cssProperty:"height",transform:ih});const VFt=ga({prop:"boxSizing"});CV(BFt,oce,jFt,WFt,$Ft,zFt,VFt);const T4={border:{themeKey:"borders",transform:uf},borderTop:{themeKey:"borders",transform:uf},borderRight:{themeKey:"borders",transform:uf},borderBottom:{themeKey:"borders",transform:uf},borderLeft:{themeKey:"borders",transform:uf},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:uf},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:SV},color:{themeKey:"palette",transform:uE},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:uE},backgroundColor:{themeKey:"palette",transform:uE},p:{style:Po},pt:{style:Po},pr:{style:Po},pb:{style:Po},pl:{style:Po},px:{style:Po},py:{style:Po},padding:{style:Po},paddingTop:{style:Po},paddingRight:{style:Po},paddingBottom:{style:Po},paddingLeft:{style:Po},paddingX:{style:Po},paddingY:{style:Po},paddingInline:{style:Po},paddingInlineStart:{style:Po},paddingInlineEnd:{style:Po},paddingBlock:{style:Po},paddingBlockStart:{style:Po},paddingBlockEnd:{style:Po},m:{style:Mo},mt:{style:Mo},mr:{style:Mo},mb:{style:Mo},ml:{style:Mo},mx:{style:Mo},my:{style:Mo},margin:{style:Mo},marginTop:{style:Mo},marginRight:{style:Mo},marginBottom:{style:Mo},marginLeft:{style:Mo},marginX:{style:Mo},marginY:{style:Mo},marginInline:{style:Mo},marginInlineStart:{style:Mo},marginInlineEnd:{style:Mo},marginBlock:{style:Mo},marginBlockStart:{style:Mo},marginBlockEnd:{style:Mo},displayPrint:{cssProperty:!1,transform:i=>({"@media print":{display:i}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:xV},rowGap:{style:LV},columnGap:{style:kV},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ih},maxWidth:{style:oce},minWidth:{transform:ih},height:{transform:ih},maxHeight:{transform:ih},minHeight:{transform:ih},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function HFt(...i){const e=i.reduce((r,s)=>r.concat(Object.keys(s)),[]),n=new Set(e);return i.every(r=>n.size===Object.keys(r).length)}function UFt(i,e){return typeof i=="function"?i(e):i}function L5e(){function i(n,r,s,o){const a={[n]:r,theme:s},l=o[n];if(!l)return{[n]:r};const{cssProperty:c=n,themeKey:u,transform:d,style:h}=l;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const f=wV(s,u)||{};return h?h(a):Av(a,r,g=>{let m=Nj(f,d,g);return g===m&&typeof g=="string"&&(m=Nj(f,d,`${n}${g==="default"?"":s_(g)}`,g)),c===!1?m:{[c]:m}})}function e(n){var r;const{sx:s,theme:o={}}=n||{};if(!s)return null;const a=(r=o.unstable_sxConfig)!=null?r:T4;function l(c){let u=c;if(typeof c=="function")u=c(o);else if(typeof c!="object")return c;if(!u)return null;const d=rFt(o.breakpoints),h=Object.keys(d);let f=d;return Object.keys(u).forEach(p=>{const g=UFt(u[p],o);if(g!=null)if(typeof g=="object")if(a[p])f=PM(f,i(p,g,o,a));else{const m=Av({theme:o},g,_=>({[p]:_}));HFt(m,g)?f[p]=e({sx:g,theme:o}):f=PM(f,m)}else f=PM(f,i(p,g,o,a))}),sFt(h,f)}return Array.isArray(s)?s.map(l):l(s)}return e}const R4=L5e();R4.filterProps=["sx"];function D5e(i,e){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(i).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:n.palette.mode===i?e:{}}const qFt=["breakpoints","palette","spacing","shape"];function ace(i={},...e){const{breakpoints:n={},palette:r={},spacing:s,shape:o={}}=i,a=Dc(i,qFt),l=S5e(n),c=fFt(s);let u=Om({breakpoints:l,direction:"ltr",components:{},palette:Bn({mode:"light"},r),spacing:c,shape:Bn({},iFt,o)},a);return u.applyStyles=D5e,u=e.reduce((d,h)=>Om(d,h),u),u.unstable_sxConfig=Bn({},T4,a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(h){return R4({sx:h,theme:this})},u}const KFt=Object.freeze(Object.defineProperty({__proto__:null,default:ace,private_createBreakpoints:S5e,unstable_applyStyles:D5e},Symbol.toStringTag,{value:"Module"}));function GFt(i){return Object.keys(i).length===0}function E5e(i=null){const e=$.useContext(j1);return!e||GFt(e)?i:e}const XFt=ace();function I5e(i=XFt){return E5e(i)}function YFt({styles:i,themeId:e,defaultTheme:n={}}){const r=I5e(n),s=typeof i=="function"?i(e&&r[e]||r):i;return C.jsx(y5e,{styles:s})}const ZFt=["sx"],QFt=i=>{var e,n;const r={systemProps:{},otherProps:{}},s=(e=i==null||(n=i.theme)==null?void 0:n.unstable_sxConfig)!=null?e:T4;return Object.keys(i).forEach(o=>{s[o]?r.systemProps[o]=i[o]:r.otherProps[o]=i[o]}),r};function T5e(i){const{sx:e}=i,n=Dc(i,ZFt),{systemProps:r,otherProps:s}=QFt(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...a)=>{const l=e(...a);return dy(l)?Bn({},r,l):r}:o=Bn({},r,e),Bn({},s,{sx:o})}const JFt=Object.freeze(Object.defineProperty({__proto__:null,default:R4,extendSxProp:T5e,unstable_createStyleFunctionSx:L5e,unstable_defaultSxConfig:T4},Symbol.toStringTag,{value:"Module"})),oye=i=>i,e3t=()=>{let i=oye;return{configure(e){i=e},generate(e){return i(e)},reset(){i=oye}}},R5e=e3t();function A5e(i){var e,n,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var s=i.length;for(e=0;e<s;e++)i[e]&&(n=A5e(i[e]))&&(r&&(r+=" "),r+=n)}else for(n in i)i[n]&&(r&&(r+=" "),r+=n);return r}function t3t(){for(var i,e,n=0,r="",s=arguments.length;n<s;n++)(i=arguments[n])&&(e=A5e(i))&&(r&&(r+=" "),r+=e);return r}const n3t=["className","component"];function i3t(i={}){const{themeId:e,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:s}=i,o=w5e("div",{shouldForwardProp:l=>l!=="theme"&&l!=="sx"&&l!=="as"})(R4);return $.forwardRef(function(c,u){const d=I5e(n),h=T5e(c),{className:f,component:p="div"}=h,g=Dc(h,n3t);return C.jsx(o,Bn({as:p,ref:u,className:t3t(f,s?s(r):r),theme:e&&d[e]||d},g))})}const r3t={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function DV(i,e,n="Mui"){const r=r3t[e];return r?`${n}-${r}`:`${R5e.generate(i)}-${e}`}function EV(i,e,n="Mui"){const r={};return e.forEach(s=>{r[s]=DV(i,s,n)}),r}const s3t=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function N5e(i){const e=`${i}`.match(s3t);return e&&e[1]||""}function M5e(i,e=""){return i.displayName||i.name||N5e(i)||e}function aye(i,e,n){const r=M5e(e);return i.displayName||(r!==""?`${n}(${r})`:n)}function o3t(i){if(i!=null){if(typeof i=="string")return i;if(typeof i=="function")return M5e(i,"Component");if(typeof i=="object")switch(i.$$typeof){case a9.ForwardRef:return aye(i,i.render,"ForwardRef");case a9.Memo:return aye(i,i.type,"memo");default:return}}}const a3t=Object.freeze(Object.defineProperty({__proto__:null,default:o3t,getFunctionName:N5e},Symbol.toStringTag,{value:"Module"}));function Tie(i,e){const n=Bn({},e);return Object.keys(i).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=Bn({},i[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const s=i[r]||{},o=e[r];n[r]={},!o||!Object.keys(o)?n[r]=s:!s||!Object.keys(s)?n[r]=o:(n[r]=Bn({},o),Object.keys(s).forEach(a=>{n[r][a]=Tie(s[a],o[a])}))}else n[r]===void 0&&(n[r]=i[r])}),n}const FO=typeof window<"u"?$.useLayoutEffect:$.useEffect;function l3t(i,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(i,n))}const c3t=Object.freeze(Object.defineProperty({__proto__:null,default:l3t},Symbol.toStringTag,{value:"Module"}));function u3t(i,e=166){let n;function r(...s){const o=()=>{i.apply(this,s)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function d3t(i){return i&&i.ownerDocument||document}function lye(i){return d3t(i).defaultView||window}function h3t(i,e){typeof i=="function"?i(e):i&&(i.current=e)}function f3t(i){const e=$.useRef(i);return FO(()=>{e.current=i}),$.useRef((...n)=>(0,e.current)(...n)).current}function P5e(...i){return $.useMemo(()=>i.every(e=>e==null)?null:e=>{i.forEach(n=>{h3t(n,e)})},i)}function lce(i,e,n=void 0){const r={};return Object.keys(i).forEach(s=>{r[s]=i[s].reduce((o,a)=>{if(a){const l=e(a);l!==""&&o.push(l),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}function cye(i){return typeof i=="string"}const O5e=$.createContext(null);function F5e(){return $.useContext(O5e)}const p3t=typeof Symbol=="function"&&Symbol.for,g3t=p3t?Symbol.for("mui.nested"):"__THEME_NESTED__";function m3t(i,e){return typeof e=="function"?e(i):Bn({},i,e)}function _3t(i){const{children:e,theme:n}=i,r=F5e(),s=$.useMemo(()=>{const o=r===null?n:m3t(r,n);return o!=null&&(o[g3t]=r!==null),o},[n,r]);return C.jsx(O5e.Provider,{value:s,children:e})}const v3t=["value"],b3t=$.createContext();function y3t(i){let{value:e}=i,n=Dc(i,v3t);return C.jsx(b3t.Provider,Bn({value:e??!0},n))}const B5e=$.createContext(void 0);function w3t({value:i,children:e}){return C.jsx(B5e.Provider,{value:i,children:e})}function C3t(i){const{theme:e,name:n,props:r}=i;if(!e||!e.components||!e.components[n])return r;const s=e.components[n];return s.defaultProps?Tie(s.defaultProps,r):!s.styleOverrides&&!s.variants?Tie(s,r):r}function S3t({props:i,name:e}){const n=$.useContext(B5e);return C3t({props:i,name:e,theme:{components:n}})}const uye={};function dye(i,e,n,r=!1){return $.useMemo(()=>{const s=i&&e[i]||e;if(typeof n=="function"){const o=n(s),a=i?Bn({},e,{[i]:o}):o;return r?()=>a:a}return i?Bn({},e,{[i]:n}):Bn({},e,n)},[i,e,n,r])}function x3t(i){const{children:e,theme:n,themeId:r}=i,s=E5e(uye),o=F5e()||uye,a=dye(r,s,n),l=dye(r,o,n,!0),c=a.direction==="rtl";return C.jsx(_3t,{theme:l,children:C.jsx(j1.Provider,{value:a,children:C.jsx(y3t,{value:c,children:C.jsx(w3t,{value:a==null?void 0:a.components,children:e})})})})}function k3t(i,e){return Bn({toolbar:{minHeight:56,[i.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[i.up("sm")]:{minHeight:64}}},e)}var wo={},RG={exports:{}},hye;function j5e(){return hye||(hye=1,function(i){function e(n){return n&&n.__esModule?n:{default:n}}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports}(RG)),RG.exports}const L3t=a_(X4t),D3t=a_(c3t);var fye;function E3t(){if(fye)return wo;fye=1;var i=j5e();Object.defineProperty(wo,"__esModule",{value:!0}),wo.alpha=g,wo.blend=R,wo.colorChannel=void 0,wo.darken=_,wo.decomposeColor=a,wo.emphasize=k,wo.getContrastRatio=p,wo.getLuminance=f,wo.hexToRgb=s,wo.hslToRgb=h,wo.lighten=y,wo.private_safeAlpha=m,wo.private_safeColorChannel=void 0,wo.private_safeDarken=b,wo.private_safeEmphasize=D,wo.private_safeLighten=x,wo.recomposeColor=u,wo.rgbToHex=d;var e=i(L3t),n=i(D3t);function r(E,A=0,M=1){return(0,n.default)(E,A,M)}function s(E){E=E.slice(1);const A=new RegExp(`.{1,${E.length>=6?2:1}}`,"g");let M=E.match(A);return M&&M[0].length===1&&(M=M.map(N=>N+N)),M?`rgb${M.length===4?"a":""}(${M.map((N,P)=>P<3?parseInt(N,16):Math.round(parseInt(N,16)/255*1e3)/1e3).join(", ")})`:""}function o(E){const A=E.toString(16);return A.length===1?`0${A}`:A}function a(E){if(E.type)return E;if(E.charAt(0)==="#")return a(s(E));const A=E.indexOf("("),M=E.substring(0,A);if(["rgb","rgba","hsl","hsla","color"].indexOf(M)===-1)throw new Error((0,e.default)(9,E));let N=E.substring(A+1,E.length-1),P;if(M==="color"){if(N=N.split(" "),P=N.shift(),N.length===4&&N[3].charAt(0)==="/"&&(N[3]=N[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(P)===-1)throw new Error((0,e.default)(10,P))}else N=N.split(",");return N=N.map(O=>parseFloat(O)),{type:M,values:N,colorSpace:P}}const l=E=>{const A=a(E);return A.values.slice(0,3).map((M,N)=>A.type.indexOf("hsl")!==-1&&N!==0?`${M}%`:M).join(" ")};wo.colorChannel=l;const c=(E,A)=>{try{return l(E)}catch{return E}};wo.private_safeColorChannel=c;function u(E){const{type:A,colorSpace:M}=E;let{values:N}=E;return A.indexOf("rgb")!==-1?N=N.map((P,O)=>O<3?parseInt(P,10):P):A.indexOf("hsl")!==-1&&(N[1]=`${N[1]}%`,N[2]=`${N[2]}%`),A.indexOf("color")!==-1?N=`${M} ${N.join(" ")}`:N=`${N.join(", ")}`,`${A}(${N})`}function d(E){if(E.indexOf("#")===0)return E;const{values:A}=a(E);return`#${A.map((M,N)=>o(N===3?Math.round(255*M):M)).join("")}`}function h(E){E=a(E);const{values:A}=E,M=A[0],N=A[1]/100,P=A[2]/100,O=N*Math.min(P,1-P),B=(H,Y=(H+M/30)%12)=>P-O*Math.max(Math.min(Y-3,9-Y,1),-1);let j="rgb";const z=[Math.round(B(0)*255),Math.round(B(8)*255),Math.round(B(4)*255)];return E.type==="hsla"&&(j+="a",z.push(A[3])),u({type:j,values:z})}function f(E){E=a(E);let A=E.type==="hsl"||E.type==="hsla"?a(h(E)).values:E.values;return A=A.map(M=>(E.type!=="color"&&(M/=255),M<=.03928?M/12.92:((M+.055)/1.055)**2.4)),Number((.2126*A[0]+.7152*A[1]+.0722*A[2]).toFixed(3))}function p(E,A){const M=f(E),N=f(A);return(Math.max(M,N)+.05)/(Math.min(M,N)+.05)}function g(E,A){return E=a(E),A=r(A),(E.type==="rgb"||E.type==="hsl")&&(E.type+="a"),E.type==="color"?E.values[3]=`/${A}`:E.values[3]=A,u(E)}function m(E,A,M){try{return g(E,A)}catch{return E}}function _(E,A){if(E=a(E),A=r(A),E.type.indexOf("hsl")!==-1)E.values[2]*=1-A;else if(E.type.indexOf("rgb")!==-1||E.type.indexOf("color")!==-1)for(let M=0;M<3;M+=1)E.values[M]*=1-A;return u(E)}function b(E,A,M){try{return _(E,A)}catch{return E}}function y(E,A){if(E=a(E),A=r(A),E.type.indexOf("hsl")!==-1)E.values[2]+=(100-E.values[2])*A;else if(E.type.indexOf("rgb")!==-1)for(let M=0;M<3;M+=1)E.values[M]+=(255-E.values[M])*A;else if(E.type.indexOf("color")!==-1)for(let M=0;M<3;M+=1)E.values[M]+=(1-E.values[M])*A;return u(E)}function x(E,A,M){try{return y(E,A)}catch{return E}}function k(E,A=.15){return f(E)>.5?_(E,A):y(E,A)}function D(E,A,M){try{return k(E,A)}catch{return E}}function R(E,A,M,N=1){const P=(z,H)=>Math.round((z**(1/N)*(1-M)+H**(1/N)*M)**N),O=a(E),B=a(A),j=[P(O.values[0],B.values[0]),P(O.values[1],B.values[1]),P(O.values[2],B.values[2])];return u({type:"rgb",values:j})}return wo}var BO=E3t();const I3t=["mode","contrastThreshold","tonalOffset"],pye={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:PO.white,default:PO.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},AG={text:{primary:PO.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:PO.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function gye(i,e,n,r){const s=r.light||r,o=r.dark||r*1.5;i[e]||(i.hasOwnProperty(n)?i[e]=i[n]:e==="light"?i.light=BO.lighten(i.main,s):e==="dark"&&(i.dark=BO.darken(i.main,o)))}function T3t(i="light"){return i==="dark"?{main:wD[200],light:wD[50],dark:wD[400]}:{main:wD[700],light:wD[400],dark:wD[800]}}function R3t(i="light"){return i==="dark"?{main:yD[200],light:yD[50],dark:yD[400]}:{main:yD[500],light:yD[300],dark:yD[700]}}function A3t(i="light"){return i==="dark"?{main:bD[500],light:bD[300],dark:bD[700]}:{main:bD[700],light:bD[400],dark:bD[800]}}function N3t(i="light"){return i==="dark"?{main:CD[400],light:CD[300],dark:CD[700]}:{main:CD[700],light:CD[500],dark:CD[900]}}function M3t(i="light"){return i==="dark"?{main:SD[400],light:SD[300],dark:SD[700]}:{main:SD[800],light:SD[500],dark:SD[900]}}function P3t(i="light"){return i==="dark"?{main:NA[400],light:NA[300],dark:NA[700]}:{main:"#ed6c02",light:NA[500],dark:NA[900]}}function O3t(i){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=i,s=Dc(i,I3t),o=i.primary||T3t(e),a=i.secondary||R3t(e),l=i.error||A3t(e),c=i.info||N3t(e),u=i.success||M3t(e),d=i.warning||P3t(e);function h(m){return BO.getContrastRatio(m,AG.text.primary)>=n?AG.text.primary:pye.text.primary}const f=({color:m,name:_,mainShade:b=500,lightShade:y=300,darkShade:x=700})=>{if(m=Bn({},m),!m.main&&m[b]&&(m.main=m[b]),!m.hasOwnProperty("main"))throw new Error(wI(11,_?` (${_})`:"",b));if(typeof m.main!="string")throw new Error(wI(12,_?` (${_})`:"",JSON.stringify(m.main)));return gye(m,"light",y,r),gye(m,"dark",x,r),m.contrastText||(m.contrastText=h(m.main)),m},p={dark:AG,light:pye};return Om(Bn({common:Bn({},PO),mode:e,primary:f({color:o,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:l,name:"error"}),warning:f({color:d,name:"warning"}),info:f({color:c,name:"info"}),success:f({color:u,name:"success"}),grey:G4t,contrastThreshold:n,getContrastText:h,augmentColor:f,tonalOffset:r},p[e]),s)}const F3t=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function B3t(i){return Math.round(i*1e5)/1e5}const mye={textTransform:"uppercase"},_ye='"Roboto", "Helvetica", "Arial", sans-serif';function j3t(i,e){const n=typeof e=="function"?e(i):e,{fontFamily:r=_ye,fontSize:s=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:l=500,fontWeightBold:c=700,htmlFontSize:u=16,allVariants:d,pxToRem:h}=n,f=Dc(n,F3t),p=s/14,g=h||(b=>`${b/u*p}rem`),m=(b,y,x,k,D)=>Bn({fontFamily:r,fontWeight:b,fontSize:g(y),lineHeight:x},r===_ye?{letterSpacing:`${B3t(k/y)}em`}:{},D,d),_={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(l,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(l,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(l,14,1.75,.4,mye),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,mye),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Om(Bn({htmlFontSize:u,pxToRem:g,fontFamily:r,fontSize:s,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:l,fontWeightBold:c},_),f,{clone:!1})}const W3t=.2,$3t=.14,z3t=.12;function lo(...i){return[`${i[0]}px ${i[1]}px ${i[2]}px ${i[3]}px rgba(0,0,0,${W3t})`,`${i[4]}px ${i[5]}px ${i[6]}px ${i[7]}px rgba(0,0,0,${$3t})`,`${i[8]}px ${i[9]}px ${i[10]}px ${i[11]}px rgba(0,0,0,${z3t})`].join(",")}const V3t=["none",lo(0,2,1,-1,0,1,1,0,0,1,3,0),lo(0,3,1,-2,0,2,2,0,0,1,5,0),lo(0,3,3,-2,0,3,4,0,0,1,8,0),lo(0,2,4,-1,0,4,5,0,0,1,10,0),lo(0,3,5,-1,0,5,8,0,0,1,14,0),lo(0,3,5,-1,0,6,10,0,0,1,18,0),lo(0,4,5,-2,0,7,10,1,0,2,16,1),lo(0,5,5,-3,0,8,10,1,0,3,14,2),lo(0,5,6,-3,0,9,12,1,0,3,16,2),lo(0,6,6,-3,0,10,14,1,0,4,18,3),lo(0,6,7,-4,0,11,15,1,0,4,20,3),lo(0,7,8,-4,0,12,17,2,0,5,22,4),lo(0,7,8,-4,0,13,19,2,0,5,24,4),lo(0,7,9,-4,0,14,21,2,0,5,26,4),lo(0,8,9,-5,0,15,22,2,0,6,28,5),lo(0,8,10,-5,0,16,24,2,0,6,30,5),lo(0,8,11,-5,0,17,26,2,0,6,32,5),lo(0,9,11,-5,0,18,28,2,0,7,34,6),lo(0,9,12,-6,0,19,29,2,0,7,36,6),lo(0,10,13,-6,0,20,31,3,0,8,38,7),lo(0,10,13,-6,0,21,33,3,0,8,40,7),lo(0,10,14,-6,0,22,35,3,0,8,42,7),lo(0,11,14,-7,0,23,36,3,0,9,44,8),lo(0,11,15,-7,0,24,38,3,0,9,46,8)],H3t=["duration","easing","delay"],U3t={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},q3t={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function vye(i){return`${Math.round(i)}ms`}function K3t(i){if(!i)return 0;const e=i/36;return Math.round((4+15*e**.25+e/5)*10)}function G3t(i){const e=Bn({},U3t,i.easing),n=Bn({},q3t,i.duration);return Bn({getAutoHeightDuration:K3t,create:(s=["all"],o={})=>{const{duration:a=n.standard,easing:l=e.easeInOut,delay:c=0}=o;return Dc(o,H3t),(Array.isArray(s)?s:[s]).map(u=>`${u} ${typeof a=="string"?a:vye(a)} ${l} ${typeof c=="string"?c:vye(c)}`).join(",")}},i,{easing:e,duration:n})}const X3t={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Y3t=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function cce(i={},...e){const{mixins:n={},palette:r={},transitions:s={},typography:o={}}=i,a=Dc(i,Y3t);if(i.vars&&i.generateCssVars===void 0)throw new Error(wI(18));const l=O3t(r),c=ace(i);let u=Om(c,{mixins:k3t(c.breakpoints,n),palette:l,shadows:V3t.slice(),typography:j3t(l,o),transitions:G3t(s),zIndex:Bn({},X3t)});return u=Om(u,a),u=e.reduce((d,h)=>Om(d,h),u),u.unstable_sxConfig=Bn({},T4,a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(h){return R4({sx:h,theme:this})},u}const W5e=cce();var _C={},NG={exports:{}},bye;function Z3t(){return bye||(bye=1,function(i){function e(){return i.exports=e=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var o in s)({}).hasOwnProperty.call(s,o)&&(n[o]=s[o])}return n},i.exports.__esModule=!0,i.exports.default=i.exports,e.apply(null,arguments)}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports}(NG)),NG.exports}var MG={exports:{}},yye;function Q3t(){return yye||(yye=1,function(i){function e(n,r){if(n==null)return{};var s={};for(var o in n)if({}.hasOwnProperty.call(n,o)){if(r.indexOf(o)!==-1)continue;s[o]=n[o]}return s}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports}(MG)),MG.exports}const J3t=a_(J4t),e6t=a_(eFt),t6t=a_(oFt),n6t=a_(a3t),i6t=a_(KFt),r6t=a_(JFt);var wye;function s6t(){if(wye)return _C;wye=1;var i=j5e();Object.defineProperty(_C,"__esModule",{value:!0}),_C.default=k,_C.shouldForwardProp=g,_C.systemDefaultTheme=void 0;var e=i(Z3t()),n=i(Q3t()),r=h(J3t),s=e6t;i(t6t),i(n6t);var o=i(i6t),a=i(r6t);const l=["ownerState"],c=["variants"],u=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function d(D){if(typeof WeakMap!="function")return null;var R=new WeakMap,E=new WeakMap;return(d=function(A){return A?E:R})(D)}function h(D,R){if(D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var E=d(R);if(E&&E.has(D))return E.get(D);var A={__proto__:null},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var N in D)if(N!=="default"&&Object.prototype.hasOwnProperty.call(D,N)){var P=M?Object.getOwnPropertyDescriptor(D,N):null;P&&(P.get||P.set)?Object.defineProperty(A,N,P):A[N]=D[N]}return A.default=D,E&&E.set(D,A),A}function f(D){return Object.keys(D).length===0}function p(D){return typeof D=="string"&&D.charCodeAt(0)>96}function g(D){return D!=="ownerState"&&D!=="theme"&&D!=="sx"&&D!=="as"}const m=_C.systemDefaultTheme=(0,o.default)(),_=D=>D&&D.charAt(0).toLowerCase()+D.slice(1);function b({defaultTheme:D,theme:R,themeId:E}){return f(R)?D:R[E]||R}function y(D){return D?(R,E)=>E[D]:null}function x(D,R){let{ownerState:E}=R,A=(0,n.default)(R,l);const M=typeof D=="function"?D((0,e.default)({ownerState:E},A)):D;if(Array.isArray(M))return M.flatMap(N=>x(N,(0,e.default)({ownerState:E},A)));if(M&&typeof M=="object"&&Array.isArray(M.variants)){const{variants:N=[]}=M;let O=(0,n.default)(M,c);return N.forEach(B=>{let j=!0;typeof B.props=="function"?j=B.props((0,e.default)({ownerState:E},A,E)):Object.keys(B.props).forEach(z=>{(E==null?void 0:E[z])!==B.props[z]&&A[z]!==B.props[z]&&(j=!1)}),j&&(Array.isArray(O)||(O=[O]),O.push(typeof B.style=="function"?B.style((0,e.default)({ownerState:E},A,E)):B.style))}),O}return M}function k(D={}){const{themeId:R,defaultTheme:E=m,rootShouldForwardProp:A=g,slotShouldForwardProp:M=g}=D,N=P=>(0,a.default)((0,e.default)({},P,{theme:b((0,e.default)({},P,{defaultTheme:E,themeId:R}))}));return N.__mui_systemSx=!0,(P,O={})=>{(0,r.internal_processStyles)(P,me=>me.filter(Ee=>!(Ee!=null&&Ee.__mui_systemSx)));const{name:B,slot:j,skipVariantsResolver:z,skipSx:H,overridesResolver:Y=y(_(j))}=O,X=(0,n.default)(O,u),Q=z!==void 0?z:j&&j!=="Root"&&j!=="root"||!1,ie=H||!1;let K,ee=g;j==="Root"||j==="root"?ee=A:j?ee=M:p(P)&&(ee=void 0);const le=(0,r.default)(P,(0,e.default)({shouldForwardProp:ee,label:K},X)),ke=me=>typeof me=="function"&&me.__emotion_real!==me||(0,s.isPlainObject)(me)?Ee=>x(me,(0,e.default)({},Ee,{theme:b({theme:Ee.theme,defaultTheme:E,themeId:R})})):me,xe=(me,...Ee)=>{let je=ke(me);const qe=Ee?Ee.map(ke):[];B&&Y&&qe.push(ut=>{const st=b((0,e.default)({},ut,{defaultTheme:E,themeId:R}));if(!st.components||!st.components[B]||!st.components[B].styleOverrides)return null;const mt=st.components[B].styleOverrides,Rt={};return Object.entries(mt).forEach(([Vt,Ot])=>{Rt[Vt]=x(Ot,(0,e.default)({},ut,{theme:st}))}),Y(ut,Rt)}),B&&!Q&&qe.push(ut=>{var st;const mt=b((0,e.default)({},ut,{defaultTheme:E,themeId:R})),Rt=mt==null||(st=mt.components)==null||(st=st[B])==null?void 0:st.variants;return x({variants:Rt},(0,e.default)({},ut,{theme:mt}))}),ie||qe.push(N);const Ze=qe.length-Ee.length;if(Array.isArray(me)&&Ze>0){const ut=new Array(Ze).fill("");je=[...me,...ut],je.raw=[...me.raw,...ut]}const We=le(je,...qe);return P.muiName&&(We.muiName=P.muiName),We};return le.withConfig&&(xe.withConfig=le.withConfig),xe}}return _C}var o6t=s6t();const a6t=ql(o6t);function l6t(i){return i!=="ownerState"&&i!=="theme"&&i!=="sx"&&i!=="as"}const c6t=i=>l6t(i)&&i!=="classes",IV=a6t({themeId:OO,defaultTheme:W5e,rootShouldForwardProp:c6t}),u6t=["theme"];function d6t(i){let{theme:e}=i,n=Dc(i,u6t);const r=e[OO];let s=r||e;return typeof e!="function"&&(r&&!r.vars?s=Bn({},r,{vars:null}):e&&!e.vars&&(s=Bn({},e,{vars:null}))),C.jsx(x3t,Bn({},n,{themeId:r?OO:void 0,theme:s}))}const Cye=i=>{let e;return i<1?e=5.11916*i**2:e=4.5*Math.log(i+1)+2,(e/100).toFixed(2)};function $5e(i){var e,n,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var s=i.length;for(e=0;e<s;e++)i[e]&&(n=$5e(i[e]))&&(r&&(r+=" "),r+=n)}else for(n in i)i[n]&&(r&&(r+=" "),r+=n);return r}function Mj(){for(var i,e,n=0,r="",s=arguments.length;n<s;n++)(i=arguments[n])&&(e=$5e(i))&&(r&&(r+=" "),r+=e);return r}function uce(i){return S3t(i)}function h6t(i){return DV("MuiSvgIcon",i)}EV("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const f6t=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],p6t=i=>{const{color:e,fontSize:n,classes:r}=i,s={root:["root",e!=="inherit"&&`color${s_(e)}`,`fontSize${s_(n)}`]};return lce(s,h6t,r)},g6t=IV("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,n.color!=="inherit"&&e[`color${s_(n.color)}`],e[`fontSize${s_(n.fontSize)}`]]}})(({theme:i,ownerState:e})=>{var n,r,s,o,a,l,c,u,d,h,f,p,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=i.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(s=i.transitions)==null||(s=s.duration)==null?void 0:s.shorter}),fontSize:{inherit:"inherit",small:((o=i.typography)==null||(a=o.pxToRem)==null?void 0:a.call(o,20))||"1.25rem",medium:((l=i.typography)==null||(c=l.pxToRem)==null?void 0:c.call(l,24))||"1.5rem",large:((u=i.typography)==null||(d=u.pxToRem)==null?void 0:d.call(u,35))||"2.1875rem"}[e.fontSize],color:(h=(f=(i.vars||i).palette)==null||(f=f[e.color])==null?void 0:f.main)!=null?h:{action:(p=(i.vars||i).palette)==null||(p=p.action)==null?void 0:p.active,disabled:(g=(i.vars||i).palette)==null||(g=g.action)==null?void 0:g.disabled,inherit:void 0}[e.color]}}),z5e=$.forwardRef(function(e,n){const r=uce({props:e,name:"MuiSvgIcon"}),{children:s,className:o,color:a="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:d=!1,titleAccess:h,viewBox:f="0 0 24 24"}=r,p=Dc(r,f6t),g=$.isValidElement(s)&&s.type==="svg",m=Bn({},r,{color:a,component:l,fontSize:c,instanceFontSize:e.fontSize,inheritViewBox:d,viewBox:f,hasSvgAsChild:g}),_={};d||(_.viewBox=f);const b=p6t(m);return C.jsxs(g6t,Bn({as:l,className:Mj(b.root,o),focusable:"false",color:u,"aria-hidden":h?void 0:!0,role:h?"img":void 0,ref:n},_,p,g&&s.props,{ownerState:m,children:[g?s.props.children:s,h?C.jsx("title",{children:h}):null]}))});z5e.muiName="SvgIcon";function m6t(i){return DV("MuiPaper",i)}EV("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const _6t=["className","component","elevation","square","variant"],v6t=i=>{const{square:e,elevation:n,variant:r,classes:s}=i,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return lce(o,m6t,s)},b6t=IV("div",{name:"MuiPaper",slot:"Root",overridesResolver:(i,e)=>{const{ownerState:n}=i;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(({theme:i,ownerState:e})=>{var n;return Bn({backgroundColor:(i.vars||i).palette.background.paper,color:(i.vars||i).palette.text.primary,transition:i.transitions.create("box-shadow")},!e.square&&{borderRadius:i.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(i.vars||i).palette.divider}`},e.variant==="elevation"&&Bn({boxShadow:(i.vars||i).shadows[e.elevation]},!i.vars&&i.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${BO.alpha("#fff",Cye(e.elevation))}, ${BO.alpha("#fff",Cye(e.elevation))})`},i.vars&&{backgroundImage:(n=i.vars.overlays)==null?void 0:n[e.elevation]}))}),y6t=$.forwardRef(function(e,n){const r=uce({props:e,name:"MuiPaper"}),{className:s,component:o="div",elevation:a=1,square:l=!1,variant:c="elevation"}=r,u=Dc(r,_6t),d=Bn({},r,{component:o,elevation:a,square:l,variant:c}),h=v6t(d);return C.jsx(b6t,Bn({as:o,ownerState:d,className:Mj(h.root,s),ref:n},u))}),w6t=["onChange","maxRows","minRows","style","value"];function gB(i){return parseInt(i,10)||0}const C6t={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function S6t(i){for(const e in i)return!1;return!0}function Sye(i){return S6t(i)||i.outerHeightStyle===0&&!i.overflowing}const x6t=$.forwardRef(function(e,n){const{onChange:r,maxRows:s,minRows:o=1,style:a,value:l}=e,c=Dc(e,w6t),{current:u}=$.useRef(l!=null),d=$.useRef(null),h=P5e(n,d),f=$.useRef(null),p=$.useRef(null),g=$.useCallback(()=>{const x=d.current,k=p.current;if(!x||!k)return;const R=lye(x).getComputedStyle(x);if(R.width==="0px")return{outerHeightStyle:0,overflowing:!1};k.style.width=R.width,k.value=x.value||e.placeholder||"x",k.value.slice(-1)===`
`&&(k.value+=" ");const E=R.boxSizing,A=gB(R.paddingBottom)+gB(R.paddingTop),M=gB(R.borderBottomWidth)+gB(R.borderTopWidth),N=k.scrollHeight;k.value="x";const P=k.scrollHeight;let O=N;o&&(O=Math.max(Number(o)*P,O)),s&&(O=Math.min(Number(s)*P,O)),O=Math.max(O,P);const B=O+(E==="border-box"?A+M:0),j=Math.abs(O-N)<=1;return{outerHeightStyle:B,overflowing:j}},[s,o,e.placeholder]),m=f3t(()=>{const x=d.current,k=g();if(!x||!k||Sye(k))return!1;const D=k.outerHeightStyle;return f.current!=null&&f.current!==D}),_=$.useCallback(()=>{const x=d.current,k=g();if(!x||!k||Sye(k))return;const D=k.outerHeightStyle;f.current!==D&&(f.current=D,x.style.height=`${D}px`),x.style.overflow=k.overflowing?"hidden":""},[g]),b=$.useRef(-1);FO(()=>{const x=u3t(_),k=d==null?void 0:d.current;if(!k)return;const D=lye(k);D.addEventListener("resize",x);let R;return typeof ResizeObserver<"u"&&(R=new ResizeObserver(()=>{m()&&(R.unobserve(k),cancelAnimationFrame(b.current),_(),b.current=requestAnimationFrame(()=>{R.observe(k)}))}),R.observe(k)),()=>{x.clear(),cancelAnimationFrame(b.current),D.removeEventListener("resize",x),R&&R.disconnect()}},[g,_,m]),FO(()=>{_()});const y=x=>{u||_(),r&&r(x)};return C.jsxs($.Fragment,{children:[C.jsx("textarea",Bn({value:l,onChange:y,ref:h,rows:o,style:a},c)),C.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:p,tabIndex:-1,style:Bn({},C6t.shadow,a,{paddingTop:0,paddingBottom:0})})]})});function k6t({props:i,states:e,muiFormControl:n}){return e.reduce((r,s)=>(r[s]=i[s],n&&typeof i[s]>"u"&&(r[s]=n[s]),r),{})}const V5e=$.createContext(void 0);function L6t(){return $.useContext(V5e)}function D6t(i){return C.jsx(YFt,Bn({},i,{defaultTheme:W5e,themeId:OO}))}function xye(i){return i!=null&&!(Array.isArray(i)&&i.length===0)}function E6t(i,e=!1){return i&&(xye(i.value)&&i.value!==""||e&&xye(i.defaultValue)&&i.defaultValue!=="")}function I6t(i){return DV("MuiInputBase",i)}const Rie=EV("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),T6t=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],R6t=(i,e)=>{const{ownerState:n}=i;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${s_(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},A6t=(i,e)=>{const{ownerState:n}=i;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},N6t=i=>{const{classes:e,color:n,disabled:r,error:s,endAdornment:o,focused:a,formControl:l,fullWidth:c,hiddenLabel:u,multiline:d,readOnly:h,size:f,startAdornment:p,type:g}=i,m={root:["root",`color${s_(n)}`,r&&"disabled",s&&"error",c&&"fullWidth",a&&"focused",l&&"formControl",f&&f!=="medium"&&`size${s_(f)}`,d&&"multiline",p&&"adornedStart",o&&"adornedEnd",u&&"hiddenLabel",h&&"readOnly"],input:["input",r&&"disabled",g==="search"&&"inputTypeSearch",d&&"inputMultiline",f==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",o&&"inputAdornedEnd",h&&"readOnly"]};return lce(m,I6t,e)},M6t=IV("div",{name:"MuiInputBase",slot:"Root",overridesResolver:R6t})(({theme:i,ownerState:e})=>Bn({},i.typography.body1,{color:(i.vars||i).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Rie.disabled}`]:{color:(i.vars||i).palette.text.disabled,cursor:"default"}},e.multiline&&Bn({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),P6t=IV("input",{name:"MuiInputBase",slot:"Input",overridesResolver:A6t})(({theme:i,ownerState:e})=>{const n=i.palette.mode==="light",r=Bn({color:"currentColor"},i.vars?{opacity:i.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:i.transitions.create("opacity",{duration:i.transitions.duration.shorter})}),s={opacity:"0 !important"},o=i.vars?{opacity:i.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return Bn({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Rie.formControl} &`]:{"&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${Rie.disabled}`]:{opacity:1,WebkitTextFillColor:(i.vars||i).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),O6t=C.jsx(D6t,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),F6t=$.forwardRef(function(e,n){var r;const s=uce({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:l,className:c,components:u={},componentsProps:d={},defaultValue:h,disabled:f,disableInjectingGlobalStyles:p,endAdornment:g,fullWidth:m=!1,id:_,inputComponent:b="input",inputProps:y={},inputRef:x,maxRows:k,minRows:D,multiline:R=!1,name:E,onBlur:A,onChange:M,onClick:N,onFocus:P,onKeyDown:O,onKeyUp:B,placeholder:j,readOnly:z,renderSuffix:H,rows:Y,slotProps:X={},slots:Q={},startAdornment:ie,type:K="text",value:ee}=s,le=Dc(s,T6t),ke=y.value!=null?y.value:ee,{current:xe}=$.useRef(ke!=null),me=$.useRef(),Ee=$.useCallback(Ie=>{},[]),je=P5e(me,x,y.ref,Ee),[qe,Ze]=$.useState(!1),We=L6t(),ut=k6t({props:s,muiFormControl:We,states:["color","disabled","error","hiddenLabel","size","required","filled"]});ut.focused=We?We.focused:qe,$.useEffect(()=>{!We&&f&&qe&&(Ze(!1),A&&A())},[We,f,qe,A]);const st=We&&We.onFilled,mt=We&&We.onEmpty,Rt=$.useCallback(Ie=>{E6t(Ie)?st&&st():mt&&mt()},[st,mt]);FO(()=>{xe&&Rt({value:ke})},[ke,Rt,xe]);const Vt=Ie=>{if(ut.disabled){Ie.stopPropagation();return}P&&P(Ie),y.onFocus&&y.onFocus(Ie),We&&We.onFocus?We.onFocus(Ie):Ze(!0)},Ot=Ie=>{A&&A(Ie),y.onBlur&&y.onBlur(Ie),We&&We.onBlur?We.onBlur(Ie):Ze(!1)},vt=(Ie,...nt)=>{if(!xe){const Oe=Ie.target||me.current;if(Oe==null)throw new Error(wI(1));Rt({value:Oe.value})}y.onChange&&y.onChange(Ie,...nt),M&&M(Ie,...nt)};$.useEffect(()=>{Rt(me.current)},[]);const wn=Ie=>{me.current&&Ie.currentTarget===Ie.target&&me.current.focus(),N&&N(Ie)};let Ce=b,ge=y;R&&Ce==="input"&&(Y?ge=Bn({type:void 0,minRows:Y,maxRows:Y},ge):ge=Bn({type:void 0,maxRows:k,minRows:D},ge),Ce=x6t);const pe=Ie=>{Rt(Ie.animationName==="mui-auto-fill-cancel"?me.current:{value:"x"})};$.useEffect(()=>{We&&We.setAdornedStart(!!ie)},[We,ie]);const ne=Bn({},s,{color:ut.color||"primary",disabled:ut.disabled,endAdornment:g,error:ut.error,focused:ut.focused,formControl:We,fullWidth:m,hiddenLabel:ut.hiddenLabel,multiline:R,size:ut.size,startAdornment:ie,type:K}),ae=N6t(ne),ue=Q.root||u.Root||M6t,de=X.root||d.root||{},Se=Q.input||u.Input||P6t;return ge=Bn({},ge,(r=X.input)!=null?r:d.input),C.jsxs($.Fragment,{children:[!p&&O6t,C.jsxs(ue,Bn({},de,!cye(ue)&&{ownerState:Bn({},ne,de.ownerState)},{ref:n,onClick:wn},le,{className:Mj(ae.root,de.className,c,z&&"MuiInputBase-readOnly"),children:[ie,C.jsx(V5e.Provider,{value:null,children:C.jsx(Se,Bn({ownerState:ne,"aria-invalid":ut.error,"aria-describedby":o,autoComplete:a,autoFocus:l,defaultValue:h,disabled:ut.disabled,id:_,onAnimationStart:pe,name:E,placeholder:j,readOnly:z,required:ut.required,rows:Y,value:ke,onKeyDown:O,onKeyUp:B,type:K},ge,!cye(Se)&&{as:Ce,ownerState:Bn({},ne,ge.ownerState)},{ref:je,className:Mj(ae.input,ge.className,z&&"MuiInputBase-readOnly"),onBlur:Ot,onChange:vt,onFocus:Vt}))}),g,H?H(Bn({},ut,{startAdornment:ie})):null]}))]})}),B6t=EV("MuiBox",["root"]),j6t=cce(),ra=i3t({themeId:OO,defaultTheme:j6t,defaultClassName:B6t.root,generateClassName:R5e.generate});function dce(i){const{children:e,defer:n=!1,fallback:r=null}=i,[s,o]=$.useState(!1);return FO(()=>{n||o(!0)},[n]),$.useEffect(()=>{n&&o(!0)},[n]),C.jsx($.Fragment,{children:s?e:r})}const W6t={},kye=i=>{let e;const n=new Set,r=(d,h)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const p=e;e=h??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(g=>g(e,p))}},s=()=>e,c={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(W6t?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=e=i(r,s,c);return c},H5e=i=>i?kye(i):kye;var PG={exports:{}},OG={},FG={exports:{}},BG={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Lye;function $6t(){if(Lye)return BG;Lye=1;var i=B1();function e(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=i.useState,s=i.useEffect,o=i.useLayoutEffect,a=i.useDebugValue;function l(h,f){var p=f(),g=r({inst:{value:p,getSnapshot:f}}),m=g[0].inst,_=g[1];return o(function(){m.value=p,m.getSnapshot=f,c(m)&&_({inst:m})},[h,p,f]),s(function(){return c(m)&&_({inst:m}),h(function(){c(m)&&_({inst:m})})},[h]),a(p),p}function c(h){var f=h.getSnapshot;h=h.value;try{var p=f();return!n(h,p)}catch{return!0}}function u(h,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return BG.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:d,BG}var Dye;function z6t(){return Dye||(Dye=1,FG.exports=$6t()),FG.exports}/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Eye;function V6t(){if(Eye)return OG;Eye=1;var i=B1(),e=z6t();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,o=i.useRef,a=i.useEffect,l=i.useMemo,c=i.useDebugValue;return OG.useSyncExternalStoreWithSelector=function(u,d,h,f,p){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=l(function(){function b(R){if(!y){if(y=!0,x=R,R=f(R),p!==void 0&&m.hasValue){var E=m.value;if(p(E,R))return k=E}return k=R}if(E=k,r(x,R))return E;var A=f(R);return p!==void 0&&p(E,A)?(x=R,E):(x=R,k=A)}var y=!1,x,k,D=h===void 0?null:h;return[function(){return b(d())},D===null?void 0:function(){return b(D())}]},[d,h,f,p]);var _=s(u,g[0],g[1]);return a(function(){m.hasValue=!0,m.value=_},[_]),c(_),_},OG}var Iye;function H6t(){return Iye||(Iye=1,PG.exports=V6t()),PG.exports}var U6t=H6t();const q6t=ql(U6t),U5e={},{useDebugValue:K6t}=nn,{useSyncExternalStoreWithSelector:G6t}=q6t;let Tye=!1;const X6t=i=>i;function hce(i,e=X6t,n){(U5e?"production":void 0)!=="production"&&n&&!Tye&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Tye=!0);const r=G6t(i.subscribe,i.getState,i.getServerState||i.getInitialState,e,n);return K6t(r),r}const Rye=i=>{(U5e?"production":void 0)!=="production"&&typeof i!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof i=="function"?H5e(i):i,n=(r,s)=>hce(e,r,s);return Object.assign(n,e),n},Y6t=i=>i?Rye(i):Rye;var jG,Aye;function Z6t(){return Aye||(Aye=1,jG=function(){var i=document.getSelection();if(!i.rangeCount)return function(){};for(var e=document.activeElement,n=[],r=0;r<i.rangeCount;r++)n.push(i.getRangeAt(r));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return i.removeAllRanges(),function(){i.type==="Caret"&&i.removeAllRanges(),i.rangeCount||n.forEach(function(s){i.addRange(s)}),e&&e.focus()}}),jG}var WG,Nye;function Q6t(){if(Nye)return WG;Nye=1;var i=Z6t(),e={"text/plain":"Text","text/html":"Url",default:"Text"},n="Copy to clipboard: #{key}, Enter";function r(o){var a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return o.replace(/#{\s*key\s*}/g,a)}function s(o,a){var l,c,u,d,h,f,p=!1;a||(a={}),l=a.debug||!1;try{u=i(),d=document.createRange(),h=document.getSelection(),f=document.createElement("span"),f.textContent=o,f.ariaHidden="true",f.style.all="unset",f.style.position="fixed",f.style.top=0,f.style.clip="rect(0, 0, 0, 0)",f.style.whiteSpace="pre",f.style.webkitUserSelect="text",f.style.MozUserSelect="text",f.style.msUserSelect="text",f.style.userSelect="text",f.addEventListener("copy",function(m){if(m.stopPropagation(),a.format)if(m.preventDefault(),typeof m.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var _=e[a.format]||e.default;window.clipboardData.setData(_,o)}else m.clipboardData.clearData(),m.clipboardData.setData(a.format,o);a.onCopy&&(m.preventDefault(),a.onCopy(m.clipboardData))}),document.body.appendChild(f),d.selectNodeContents(f),h.addRange(d);var g=document.execCommand("copy");if(!g)throw new Error("copy command was unsuccessful");p=!0}catch(m){l&&console.error("unable to copy using execCommand: ",m),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(a.format||"text",o),a.onCopy&&a.onCopy(window.clipboardData),p=!0}catch(_){l&&console.error("unable to copy using clipboardData: ",_),l&&console.error("falling back to prompt"),c=r("message"in a?a.message:n),window.prompt(c,o)}}finally{h&&(typeof h.removeRange=="function"?h.removeRange(d):h.removeAllRanges()),f&&document.body.removeChild(f),u()}return p}return WG=s,WG}var J6t=Q6t();const eBt=ql(J6t);function fce(i,e,n){return e in i?Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[e]=n,i}function os(i){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable}))),r.forEach(function(s){fce(i,s,n[s])})}return i}function tBt(i,e){var n=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);n.push.apply(n,r)}return n}function A4(i,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):tBt(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))}),i}function Aie(i,e){(e==null||e>i.length)&&(e=i.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=i[n];return r}function nBt(i){if(Array.isArray(i))return Aie(i)}function iBt(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function rBt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q5e(i,e){if(i){if(typeof i=="string")return Aie(i,e);var n=Object.prototype.toString.call(i).slice(8,-1);if(n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Aie(i,e)}}function df(i){return nBt(i)||iBt(i)||q5e(i)||rBt()}function K5e(i){var e,n,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i))for(e=0;e<i.length;e++)i[e]&&(n=K5e(i[e]))&&(r&&(r+=" "),r+=n);else for(e in i)i[e]&&(r&&(r+=" "),r+=e);return r}function sBt(){for(var i,e,n=0,r="";n<arguments.length;)(i=arguments[n++])&&(e=K5e(i))&&(r&&(r+=" "),r+=e);return r}function oBt(i){if(Array.isArray(i))return i}function aBt(i,e){var n=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(n!=null){var r=[],s=!0,o=!1,a,l;try{for(n=n.call(i);!(s=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));s=!0);}catch(c){o=!0,l=c}finally{try{!s&&n.return!=null&&n.return()}finally{if(o)throw l}}return r}}function lBt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vu(i,e){return oBt(i)||aBt(i,e)||q5e(i,e)||lBt()}function Pj(i){"@swc/helpers - typeof";return i&&typeof Symbol<"u"&&i.constructor===Symbol?"symbol":typeof i}var pce={scheme:"Light Theme",author:"mac gainor (https://github.com/mac-s-g)",base00:"rgba(0, 0, 0, 0)",base01:"rgb(245, 245, 245)",base02:"rgb(235, 235, 235)",base03:"#93a1a1",base04:"rgba(0, 0, 0, 0.3)",base05:"#586e75",base06:"#073642",base07:"#002b36",base08:"#d33682",base09:"#cb4b16",base0A:"#ffd500",base0B:"#859900",base0C:"#6c71c4",base0D:"#586e75",base0E:"#2aa198",base0F:"#268bd2"},G5e={scheme:"Dark Theme",author:"Chris Kempson (http://chriskempson.com)",base00:"#181818",base01:"#282828",base02:"#383838",base03:"#585858",base04:"#b8b8b8",base05:"#d8d8d8",base06:"#e8e8e8",base07:"#f8f8f8",base08:"#ab4642",base09:"#dc9656",base0A:"#f7ca88",base0B:"#a1b56c",base0C:"#86c1b9",base0D:"#7cafc2",base0E:"#ba8baf",base0F:"#a16946"},X5e=function(){return null};X5e.when=function(){return!1};var cBt=function(i){var e,n,r,s,o,a,l,c,u,d,h,f,p,g,m,_,b;return Y6t()(function(y,x){return{enableClipboard:(e=i.enableClipboard)!==null&&e!==void 0?e:!0,highlightUpdates:(n=i.highlightUpdates)!==null&&n!==void 0?n:!1,indentWidth:(r=i.indentWidth)!==null&&r!==void 0?r:3,groupArraysAfterLength:(s=i.groupArraysAfterLength)!==null&&s!==void 0?s:100,collapseStringsAfterLength:i.collapseStringsAfterLength===!1?Number.MAX_VALUE:(o=i.collapseStringsAfterLength)!==null&&o!==void 0?o:50,maxDisplayLength:(a=i.maxDisplayLength)!==null&&a!==void 0?a:30,rootName:(l=i.rootName)!==null&&l!==void 0?l:"root",onChange:(c=i.onChange)!==null&&c!==void 0?c:function(){},onCopy:(u=i.onCopy)!==null&&u!==void 0?u:void 0,onSelect:(d=i.onSelect)!==null&&d!==void 0?d:void 0,keyRenderer:(h=i.keyRenderer)!==null&&h!==void 0?h:X5e,editable:(f=i.editable)!==null&&f!==void 0?f:!1,defaultInspectDepth:(p=i.defaultInspectDepth)!==null&&p!==void 0?p:5,objectSortKeys:(g=i.objectSortKeys)!==null&&g!==void 0?g:!1,quotesOnKeys:(m=i.quotesOnKeys)!==null&&m!==void 0?m:!0,displayDataTypes:(_=i.displayDataTypes)!==null&&_!==void 0?_:!0,inspectCache:{},hoverPath:null,colorspace:pce,value:i.value,prevValue:void 0,displayObjectSize:(b=i.displayObjectSize)!==null&&b!==void 0?b:!0,getInspectCache:function(k,D){var R=D!==void 0?k.join(".")+"[".concat(D,"]nt"):k.join(".");return x().inspectCache[R]},setInspectCache:function(k,D,R){var E=R!==void 0?k.join(".")+"[".concat(R,"]nt"):k.join(".");y(function(A){return{inspectCache:A4(os({},A.inspectCache),fce({},E,typeof D=="function"?D(A.inspectCache[E]):D))}})},setHover:function(k,D){y({hoverPath:k?{path:k,nestedIndex:D}:null})}}})},N4=$.createContext(void 0);N4.Provider;var Gi=function(i,e){var n=$.useContext(N4);return hce(n,i,e)},gce=function(){return Gi(function(i){return i.colorspace.base07})};function Mye(i,e,n,r,s,o,a){try{var l=i[o](a),c=l.value}catch(u){n(u);return}l.done?e(c):Promise.resolve(c).then(r,s)}function Y5e(i){return function(){var e=this,n=arguments;return new Promise(function(r,s){var o=i.apply(e,n);function a(c){Mye(o,r,s,a,l,"next",c)}function l(c){Mye(o,r,s,a,l,"throw",c)}a(void 0)})}}function Z5e(i,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,s,o,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(o=u[0]&2?s.return:u[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,u[1])).done)return o;switch(s=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(i,n)}catch(d){u=[6,d],s=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Fm(i,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](i):i instanceof e}Object.prototype.constructor.toString();var uBt=function(i,e,n){if(i===null||n===null||typeof i!="object"||typeof n!="object")return!1;if(Object.is(i,n)&&e.length!==0)return"";for(var r=[],s=df(e),o=i;o!==n||s.length!==0;){if(typeof o!="object"||o===null)return!1;if(Object.is(o,n))return r.reduce(function(l,c,u){return typeof c=="number"?l+"[".concat(c,"]"):l+"".concat(u===0?"":".").concat(c)},"");var a=s.shift();r.push(a),o=o[a]}return!1};function M4(i){return i===null?0:Array.isArray(i)?i.length:Fm(i,Map)||Fm(i,Set)?i.size:Fm(i,Date)?1:typeof i=="object"?Object.keys(i).length:typeof i=="string"?i.length:1}function Pye(i,e){for(var n=[],r=0;r<i.length;)n.push(i.slice(r,r+e)),r+=e;return n}function dBt(i,e){var n=function(o,a){if((typeof a>"u"?"undefined":Pj(a))==="bigint")return a.toString();if(Fm(a,Map)){if("toJSON"in a&&typeof a.toJSON=="function")return a.toJSON();if(a.size===0)return{};if(r.includes(a))return"[Circular]";r.push(a);var l=Array.from(a.entries());return l.every(function(d){var h=Vu(d,1),f=h[0];return typeof f=="string"||typeof f=="number"})?Object.fromEntries(l):{}}if(Fm(a,Set))return"toJSON"in a&&typeof a.toJSON=="function"?a.toJSON():r.includes(a)?"[Circular]":(r.push(a),Array.from(a.values()));if(typeof a=="object"&&a!==null&&Object.keys(a).length){var c=r.length;if(c){for(var u=c-1;u>=0&&r[u][o]!==a;--u)r.pop();if(r.includes(a))return"[Circular]"}r.push(a)}return a},r=[];return JSON.stringify(i,n,e)}function Nie(i){return Mie.apply(this,arguments)}function Mie(){return Mie=Y5e(function(i){return Z5e(this,function(e){switch(e.label){case 0:if(!("clipboard"in navigator))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.clipboard.writeText(i)];case 2:return e.sent(),[3,4];case 3:return e.sent(),[3,4];case 4:return eBt(i),[2]}})}),Mie.apply(this,arguments)}function hBt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.timeout,n=e===void 0?2e3:e,r=Vu($.useState(!1),2),s=r[0],o=r[1],a=$.useRef(null),l=$.useCallback(function(h){var f=a.current;f&&window.clearTimeout(f),a.current=window.setTimeout(function(){return o(!1)},n),o(h)},[n]),c=Gi(function(h){return h.onCopy}),u=$.useCallback(function(){var h=Y5e(function(f,p){var g,m,_;return Z5e(this,function(b){switch(b.label){case 0:if(typeof c!="function")return[3,5];b.label=1;case 1:return b.trys.push([1,3,,4]),[4,c(f,p,Nie)];case 2:return b.sent(),l(!0),[3,4];case 3:return g=b.sent(),console.error("error when copy ".concat(f.length===0?"src":"src[".concat(f.join(".")),"]"),g),[3,4];case 4:return[3,8];case 5:return b.trys.push([5,7,,8]),m=dBt(typeof p=="function"?p.toString():p," "),[4,Nie(m)];case 6:return b.sent(),l(!0),[3,8];case 7:return _=b.sent(),console.error("error when copy ".concat(f.length===0?"src":"src[".concat(f.join(".")),"]"),_),[3,8];case 8:return[2]}})});return function(f,p){return h.apply(this,arguments)}}(),[l,c]),d=$.useCallback(function(){o(!1),a.current&&clearTimeout(a.current)},[]);return{copy:u,reset:d,copied:s}}function mce(i,e){var n=Gi(function(r){return r.value});return $.useMemo(function(){return uBt(n,i,e)},[i,e,n])}function fBt(i,e,n){var r=i.length,s=mce(i,e),o=Gi(function(f){return f.getInspectCache}),a=Gi(function(f){return f.setInspectCache}),l=Gi(function(f){return f.defaultInspectDepth});$.useEffect(function(){var f=o(i,n);if(f===void 0)if(n!==void 0)a(i,!1,n);else{var p=s?!1:r<l;a(i,p)}},[l,r,o,s,n,i,a]);var c=Vu($.useState(function(){var f=o(i,n);return f!==void 0?f:n!==void 0||s?!1:r<l}),2),u=c[0],d=c[1],h=$.useCallback(function(f){d(function(p){var g=typeof f=="boolean"?f:f(p);return a(i,g,n),g})},[n,i,a]);return[u,h]}var t1=function(i){return vn(ra,A4(os({component:"div"},i),{sx:os({display:"inline-block"},i.sx)}))},Q5e=function(i){var e=i.dataType,n=i.enable,r=n===void 0?!0:n;return r?vn(t1,{className:"data-type-label",sx:{mx:.5,fontSize:"0.7rem",opacity:.8,userSelect:"none"},children:e}):null};function h0(i,e,n){var r=n.fromString,s=n.colorKey,o=n.displayTypeLabel,a=o===void 0?!0:o,l=$.memo(e),c=function(d){var h=Gi(function(g){return g.displayDataTypes}),f=Gi(function(g){return g.colorspace[s]}),p=Gi(function(g){return g.onSelect});return Qc(t1,{onClick:function(){return p==null?void 0:p(d.path,d.value)},sx:{color:f},children:[a&&h&&vn(Q5e,{dataType:i}),vn(t1,{className:"".concat(i,"-value"),children:vn(l,{value:d.value})})]})};if(c.displayName="easy-".concat(i,"-type"),!r)return{Component:c};var u=function(d){var h=d.value,f=d.setValue,p=Gi(function(g){return g.colorspace[s]});return vn(F6t,{value:h,onChange:$.useCallback(function(g){var m=r(g.target.value);f(m)},[f]),size:"small",multiline:!0,sx:{color:p,padding:.5,borderStyle:"solid",borderColor:"black",borderWidth:1,fontSize:"0.8rem",fontFamily:"monospace",display:"inline-flex"}})};return u.displayName="easy-".concat(i,"-type-editor"),{Component:c,Editor:u}}var pBt=function(i){var e=i.toString(),n=!0,r=e.indexOf(")"),s=e.indexOf("=>");return s!==-1&&s>r&&(n=!1),n?e.substring(e.indexOf("{",r)+1,e.lastIndexOf("}")):e.substring(e.indexOf("=>")+2)},gBt=function(i){var e=i.toString(),n=e.indexOf("function")!==-1;return n?e.substring(8,e.indexOf("{")).trim():e.substring(0,e.indexOf("=>")+2).trim()},mBt="{",_Bt="}",vBt=function(i){return Qc(dce,{children:[vn(Q5e,{dataType:"function"}),Qc(ra,{component:"span",className:"data-function-start",sx:{letterSpacing:.5},children:[gBt(i.value)," ",mBt]})]})},bBt=function(){return vn(dce,{children:vn(ra,{component:"span",className:"data-function-end",children:_Bt})})},yBt=function(i){var e=Gi(function(n){return n.colorspace.base05});return vn(dce,{children:vn(ra,{className:"data-function",sx:{display:i.inspect?"block":"inline-block",pl:i.inspect?2:0,color:e},children:i.inspect?pBt(i.value):vn(ra,{component:"span",className:"data-function-body",onClick:function(){return i.setInspect(!0)},sx:{"&:hover":{cursor:"pointer"},padding:.5},children:"…"})})})};function wBt(i,e){if(i==null)return{};var n={},r=Object.keys(i),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(n[s]=i[s]);return n}function CBt(i,e){if(i==null)return{};var n=wBt(i,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(i,r)&&(n[r]=i[r])}return n}var gk=function(i){var e=i.d,n=CBt(i,["d"]);return vn(z5e,A4(os({},n),{children:vn("path",{d:e})}))},SBt="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z",xBt="M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",kBt="M 12 2 C 10.615 1.998 9.214625 2.2867656 7.890625 2.8847656 L 8.9003906 4.6328125 C 9.9043906 4.2098125 10.957 3.998 12 4 C 15.080783 4 17.738521 5.7633175 19.074219 8.3222656 L 17.125 9 L 21.25 11 L 22.875 7 L 20.998047 7.6523438 C 19.377701 4.3110398 15.95585 2 12 2 z M 6.5097656 4.4882812 L 2.2324219 5.0820312 L 3.734375 6.3808594 C 1.6515335 9.4550558 1.3615962 13.574578 3.3398438 17 C 4.0308437 18.201 4.9801562 19.268234 6.1601562 20.115234 L 7.1699219 18.367188 C 6.3019219 17.710187 5.5922656 16.904 5.0722656 16 C 3.5320014 13.332354 3.729203 10.148679 5.2773438 7.7128906 L 6.8398438 9.0625 L 6.5097656 4.4882812 z M 19.929688 13 C 19.794687 14.08 19.450734 15.098 18.927734 16 C 17.386985 18.668487 14.531361 20.090637 11.646484 19.966797 L 12.035156 17.9375 L 8.2402344 20.511719 L 10.892578 23.917969 L 11.265625 21.966797 C 14.968963 22.233766 18.681899 20.426323 20.660156 17 C 21.355156 15.801 21.805219 14.445 21.949219 13 L 19.929688 13 z",LBt="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",DBt="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",EBt="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z",IBt="M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z",Oye=function(i){return vn(gk,os({d:SBt},i))},TBt=function(i){return vn(gk,os({d:xBt},i))},RBt=function(i){return vn(gk,os({d:kBt},i))},ABt=function(i){return vn(gk,os({d:LBt},i))},NBt=function(i){return vn(gk,os({d:DBt},i))},MBt=function(i){return vn(gk,os({d:EBt},i))},PBt=function(i){return vn(gk,os({d:IBt},i))},OBt="{",FBt="[",BBt="}",jBt="]";function J5e(i){var e=M4(i),n="";return(Fm(i,Map)||Fm(i,Set))&&(n=i[Symbol.toStringTag]),Object.prototype.hasOwnProperty.call(i,Symbol.toStringTag)&&(n=i[Symbol.toStringTag]),"".concat(e," Items").concat(n?" (".concat(n,")"):"")}var WBt=function(i){var e=Gi(function(c){return c.colorspace.base04}),n=gce(),r=$.useMemo(function(){return Array.isArray(i.value)},[i.value]),s=$.useMemo(function(){return M4(i.value)===0},[i.value]),o=$.useMemo(function(){return J5e(i.value)},[i.value]),a=Gi(function(c){return c.displayObjectSize}),l=mce(i.path,i.value);return Qc(ra,{component:"span",className:"data-object-start",sx:{letterSpacing:.5},children:[r?FBt:OBt,a&&i.inspect&&!s&&vn(ra,{component:"span",sx:{pl:.5,fontStyle:"italic",color:e,userSelect:"none"},children:o}),l&&!i.inspect&&Qc(cf,{children:[vn(RBt,{sx:{fontSize:12,color:n,mx:.5}}),l]})]})},$Bt=function(i){var e=Gi(function(a){return a.colorspace.base04}),n=$.useMemo(function(){return Array.isArray(i.value)},[i.value]),r=Gi(function(a){return a.displayObjectSize}),s=$.useMemo(function(){return M4(i.value)===0},[i.value]),o=$.useMemo(function(){return J5e(i.value)},[i.value]);return Qc(ra,{component:"span",className:"data-object-end",children:[n?jBt:BBt,r&&(s||!i.inspect)?vn(ra,{component:"span",sx:{pl:.5,fontStyle:"italic",color:e,userSelect:"none"},children:o}):null]})};function zBt(i){return typeof(i==null?void 0:i[Symbol.iterator])=="function"}var VBt=function(i){var e=gce(),n=Gi(function(g){return g.colorspace.base02}),r=Gi(function(g){return g.groupArraysAfterLength}),s=mce(i.path,i.value),o=Vu($.useState(Gi(function(g){return g.maxDisplayLength})),2),a=o[0],l=o[1],c=Gi(function(g){return g.objectSortKeys}),u=$.useMemo(function(){if(!i.inspect)return null;var g=i.value,m=zBt(g);if(m&&!Array.isArray(g)){var _=[];if(Fm(g,Map))g.forEach(function(P,O){var B=O.toString(),j=df(i.path).concat([B]);_.push(vn(KD,{path:j,value:P,prevValue:Fm(i.prevValue,Map)?i.prevValue.get(O):void 0,editable:!1},B))});else for(var b=g[Symbol.iterator](),y=b.next(),x=0;!y.done;)_.push(vn(KD,{path:df(i.path).concat(["iterator:".concat(x)]),value:y.value,nestedIndex:x,editable:!1},x)),x++,y=b.next();return _}if(Array.isArray(g)){if(g.length<=r){var k=g.slice(0,a).map(function(P,O){var B=df(i.path).concat([O]);return vn(KD,{path:B,value:P,prevValue:Array.isArray(i.prevValue)?i.prevValue[O]:void 0},O)});if(g.length>a){var D=g.length-a;k.push(Qc(t1,{sx:{cursor:"pointer",lineHeight:1.5,color:e,letterSpacing:.5,opacity:.8,userSelect:"none"},onClick:function(){return l(function(P){return P*2})},children:["hidden ",D," items…"]},"last"))}return k}var R=Pye(g,r),E=Array.isArray(i.prevValue)?Pye(i.prevValue,r):void 0;return R.map(function(P,O){var B=df(i.path);return vn(KD,{path:B,value:P,nestedIndex:O,prevValue:E==null?void 0:E[O]},O)})}var A=Object.entries(g);c&&(A=c===!0?A.sort(function(P,O){var B=Vu(P,1),j=B[0],z=Vu(O,1),H=z[0];return j.localeCompare(H)}):A.sort(function(P,O){var B=Vu(P,1),j=B[0],z=Vu(O,1),H=z[0];return c(j,H)}));var M=A.slice(0,a).map(function(P){var O=Vu(P,2),B=O[0],j=O[1],z,H=df(i.path).concat([B]);return vn(KD,{path:H,value:j,prevValue:(z=i.prevValue)===null||z===void 0?void 0:z[B]},B)});if(A.length>a){var N=A.length-a;M.push(Qc(t1,{sx:{cursor:"pointer",lineHeight:1.5,color:e,letterSpacing:.5,opacity:.8,userSelect:"none"},onClick:function(){return l(function(P){return P*2})},children:["hidden ",N," items…"]},"last"))}return M},[i.inspect,i.value,i.prevValue,i.path,r,a,e,c]),d=i.inspect?.6:0,h=Gi(function(g){return g.indentWidth}),f=i.inspect?h-d:h,p=$.useMemo(function(){return M4(i.value)===0},[i.value]);return p?null:vn(ra,{className:"data-object",sx:{display:i.inspect?"block":"inline-block",pl:i.inspect?f-.6:0,marginLeft:d,color:e,borderLeft:i.inspect?"1px solid ".concat(n):"none"},children:i.inspect?u:!s&&vn(ra,{component:"span",className:"data-object-body",onClick:function(){return i.setInspect(!0)},sx:{"&:hover":{cursor:"pointer"},padding:.5,userSelect:"none"},children:"…"})})},HBt=function(){return H5e()(function(i){return{registry:[],registerTypes:function(e){i(function(n){return{registry:typeof e=="function"?e(n.registry):e}})}}})},_ce=$.createContext(void 0);_ce.Provider;var e4e=function(i,e){var n=$.useContext(_ce);return hce(n,i,e)},UBt={is:function(i){return typeof i=="object"},Component:VBt,PreComponent:WBt,PostComponent:$Bt};function qBt(i,e,n){var r,s=!0,o=!1,a=void 0;try{for(var l=n[Symbol.iterator](),c;!(s=(c=l.next()).done);s=!0){var u=c.value;if(u.is(i,e)&&(r=u,typeof i=="object"))return u}}catch(d){o=!0,a=d}finally{try{!s&&l.return!=null&&l.return()}finally{if(o)throw a}}if(r===void 0){if(typeof i=="object")return UBt;throw new Error("this is not possible")}return r}function KBt(i,e){var n=e4e(function(r){return r.registry});return $.useMemo(function(){return qBt(i,e,n)},[i,e,n])}function GBt(){var i=function(o){function a(l,c){var u,d;return Object.is(l.value,c.value)&&l.inspect&&c.inspect&&((u=l.path)===null||u===void 0?void 0:u.join("."))===((d=c.path)===null||d===void 0?void 0:d.join("."))}o.Component=$.memo(o.Component,a),o.Editor&&(o.Editor=$.memo(o.Editor,function(c,u){return Object.is(c.value,u.value)})),o.PreComponent&&(o.PreComponent=$.memo(o.PreComponent,a)),o.PostComponent&&(o.PostComponent=$.memo(o.PostComponent,a)),e.push(o)},e=[];i(os({is:function(s){return typeof s=="boolean"}},h0("bool",function(s){var o=s.value;return vn(cf,{children:o?"true":"false"})},{colorKey:"base0E",fromString:function(s){return!!s}})));var n={weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"};i(os({is:function(s){return Fm(s,Date)}},h0("date",function(s){var o=s.value;return vn(cf,{children:o.toLocaleTimeString("en-us",n)})},{colorKey:"base0D"}))),i(os({is:function(s){return s===null}},h0("null",function(){var s=Gi(function(o){return o.colorspace.base02});return vn(ra,{sx:{fontSize:"0.8rem",backgroundColor:s,fontWeight:"bold",borderRadius:"3px",padding:"0.5px 2px"},children:"NULL"})},{colorKey:"base08",displayTypeLabel:!1}))),i(os({is:function(s){return s===void 0}},h0("undefined",function(){var s=Gi(function(o){return o.colorspace.base02});return vn(ra,{sx:{fontSize:"0.7rem",backgroundColor:s,borderRadius:"3px",padding:"0.5px 2px"},children:"undefined"})},{colorKey:"base05",displayTypeLabel:!1}))),i(os({is:function(s){return typeof s=="string"}},h0("string",function(s){var o=Vu($.useState(!1),2),a=o[0],l=o[1],c=Gi(function(h){return h.collapseStringsAfterLength}),u=a?s.value:s.value.slice(0,c),d=s.value.length>c;return Qc(ra,{component:"span",sx:{overflowWrap:"anywhere",cursor:d?"pointer":"inherit"},onClick:function(){d&&l(function(h){return!h})},children:['"',u,d&&!a&&vn(ra,{component:"span",sx:{padding:.5},children:"…"}),'"']})},{colorKey:"base09",fromString:function(s){return s}}))),i({is:function(s){return typeof s=="function"},Component:yBt,PreComponent:vBt,PostComponent:bBt});var r=function(s){return s%1===0};return i(os({is:function(s){return typeof s=="number"&&isNaN(s)}},h0("NaN",function(){var s=Gi(function(o){return o.colorspace.base02});return vn(ra,{sx:{backgroundColor:s,fontSize:"0.8rem",fontWeight:"bold",borderRadius:"3px"},children:"NaN"})},{colorKey:"base08",displayTypeLabel:!1}))),i(os({is:function(s){return typeof s=="number"&&!r(s)}},h0("float",function(s){var o=s.value;return vn(cf,{children:o})},{colorKey:"base0B",fromString:function(s){return parseFloat(s)}}))),i(os({is:function(s){return typeof s=="number"&&r(s)}},h0("int",function(s){var o=s.value;return vn(cf,{children:o})},{colorKey:"base0F",fromString:function(s){return parseInt(s)}}))),i(os({is:function(s){return(typeof s>"u"?"undefined":Pj(s))==="bigint"}},h0("bigint",function(s){var o=s.value;return vn(cf,{children:"".concat(o,"n")})},{colorKey:"base0F",fromString:function(s){return BigInt(s.replace(/\D/g,""))}}))),e}var mB=function(i){return vn(ra,A4(os({component:"span"},i),{sx:os({cursor:"pointer",paddingLeft:"0.7rem"},i.sx)}))},KD=function(i){var e=i.value,n=i.prevValue,r=i.path,s=i.nestedIndex,o,a=(o=i.editable)!==null&&o!==void 0?o:void 0,l=Gi(function(st){return st.editable}),c=$.useMemo(function(){return l===!1||a===!1?!1:typeof l=="function"?!!l(r,e):l},[r,a,l,e]),u=Vu($.useState(typeof e=="function"?function(){return e}:e),2),d=u[0],h=u[1],f=r.length,p=r[f-1],g=Gi(function(st){return st.hoverPath}),m=$.useMemo(function(){return g&&r.every(function(st,mt){return st===g.path[mt]&&s===g.nestedIndex})},[g,r,s]),_=Gi(function(st){return st.setHover}),b=Gi(function(st){return st.value}),y=Vu(fBt(r,e,s),2),x=y[0],k=y[1],D=Vu($.useState(!1),2),R=D[0],E=D[1],A=Gi(function(st){return st.onChange}),M=gce(),N=Gi(function(st){return st.colorspace.base0C}),P=Gi(function(st){return st.colorspace.base0A}),O=KBt(e,r),B=O.Component,j=O.PreComponent,z=O.PostComponent,H=O.Editor,Y=Gi(function(st){return st.quotesOnKeys}),X=Gi(function(st){return st.rootName}),Q=b===e,ie=Number.isInteger(Number(p)),K=Gi(function(st){return st.enableClipboard}),ee=hBt(),le=ee.copy,ke=ee.copied,xe=Gi(function(st){return st.highlightUpdates}),me=$.useMemo(function(){return!xe||n===void 0?!1:(typeof e>"u"?"undefined":Pj(e))!==(typeof n>"u"?"undefined":Pj(n))?!0:typeof e=="number"?isNaN(e)&&isNaN(n)?!1:e!==n:Array.isArray(e)!==Array.isArray(n)?!0:typeof e=="object"||typeof e=="function"?!1:e!==n},[xe,n,e]),Ee=$.useRef();$.useEffect(function(){Ee.current&&me&&"animate"in Ee.current&&Ee.current.animate([{backgroundColor:P},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})},[P,me,n,e]);var je=$.useMemo(function(){return R?Qc(cf,{children:[vn(mB,{children:vn(ABt,{sx:{fontSize:".8rem"},onClick:function(){E(!1),h(e)}})}),vn(mB,{children:vn(Oye,{sx:{fontSize:".8rem"},onClick:function(){E(!1),A(r,e,d)}})})]}):Qc(cf,{children:[K&&vn(mB,{onClick:function(st){st.preventDefault();try{le(r,e,Nie)}catch(mt){console.error(mt)}},children:ke?vn(Oye,{sx:{fontSize:".8rem"}}):vn(NBt,{sx:{fontSize:".8rem"}})}),H&&c&&vn(mB,{onClick:function(st){st.preventDefault(),E(!0),h(e)},children:vn(MBt,{sx:{fontSize:".8rem"}})})]})},[H,ke,le,c,R,K,A,r,d,e]),qe=$.useMemo(function(){return M4(e)===0},[e]),Ze=!qe&&!!(j&&z),We=Gi(function(st){return st.keyRenderer}),ut=$.useMemo(function(){return{path:r,inspect:x,setInspect:k,value:e,prevValue:n}},[x,r,k,e,n]);return Qc(ra,{className:"data-key-pair","data-testid":"data-key-pair"+r.join("."),sx:{userSelect:"text"},onMouseEnter:$.useCallback(function(){return _(r,s)},[_,r,s]),children:[Qc(t1,{component:"span",className:"data-key",sx:{lineHeight:1.5,color:M,letterSpacing:.5,opacity:.8},onClick:$.useCallback(function(st){st.isDefaultPrevented()||qe||k(function(mt){return!mt})},[qe,k]),children:[Ze?x?vn(PBt,{sx:{fontSize:".8rem","&:hover":{cursor:"pointer"}}}):vn(TBt,{sx:{fontSize:".8rem","&:hover":{cursor:"pointer"}}}):null,vn(ra,{ref:Ee,component:"span",children:Q?X!==!1?Y?Qc(cf,{children:['"',X,'"']}):vn(cf,{children:X}):null:We.when(ut)?vn(We,os({},ut)):s===void 0&&(ie?vn(ra,{component:"span",style:{color:N},children:p}):Y?Qc(cf,{children:['"',p,'"']}):vn(cf,{children:p}))}),Q?X!==!1&&vn(t1,{sx:{mr:.5},children:":"}):s===void 0&&vn(t1,{sx:{mr:.5},children:":"}),j&&vn(j,os({},ut)),m&&Ze&&x&&je]}),R&&c?H&&vn(H,{value:d,setValue:h}):B?vn(B,os({},ut)):vn(ra,{component:"span",className:"data-value-fallback",children:"fallback: ".concat(e)}),z&&vn(z,os({},ut)),m&&Ze&&!x&&je,m&&!Ze&&je]})},Fye="(prefers-color-scheme: dark)";function XBt(){var i=Vu($.useState(!1),2),e=i[0],n=i[1];return $.useEffect(function(){var r=function(o){n(o.matches)};n(window.matchMedia(Fye).matches);var s=window.matchMedia(Fye);return s.addEventListener("change",r),function(){return s.removeEventListener("change",r)}},[]),e}function Fd(i,e){var n=$.useContext(N4).setState;$.useEffect(function(){e!==void 0&&n(fce({},i,e))},[i,e,n])}var YBt=function(i){var e=$.useContext(N4).setState;$.useEffect(function(){e(function(h){return{prevValue:h.value,value:i.value}})},[i.value,e]),Fd("editable",i.editable),Fd("indentWidth",i.indentWidth),Fd("onChange",i.onChange),Fd("groupArraysAfterLength",i.groupArraysAfterLength),Fd("keyRenderer",i.keyRenderer),Fd("maxDisplayLength",i.maxDisplayLength),Fd("enableClipboard",i.enableClipboard),Fd("highlightUpdates",i.highlightUpdates),Fd("rootName",i.rootName),Fd("displayDataTypes",i.displayDataTypes),Fd("displayObjectSize",i.displayObjectSize),Fd("onCopy",i.onCopy),Fd("onSelect",i.onSelect),$.useEffect(function(){i.theme==="light"?e({colorspace:pce}):i.theme==="dark"?e({colorspace:G5e}):typeof i.theme=="object"&&e({colorspace:i.theme})},[e,i.theme]);var n=$.useMemo(function(){return typeof i.theme=="object"?"json-viewer-theme-custom":i.theme==="dark"?"json-viewer-theme-dark":"json-viewer-theme-light"},[i.theme]),r=$.useRef(!0),s=$.useMemo(function(){return GBt()},[]),o=e4e(function(h){return h.registerTypes});if(r.current){var a=i.valueTypes?df(s).concat(df(i.valueTypes)):df(s);o(a),r.current=!1}$.useEffect(function(){var h=i.valueTypes?df(s).concat(df(i.valueTypes)):df(s);o(h)},[i.valueTypes,s,o]);var l=Gi(function(h){return h.value}),c=Gi(function(h){return h.prevValue}),u=Gi(function(h){return h.setHover}),d=$.useCallback(function(){return u(null)},[u]);return vn(y6t,{elevation:0,className:sBt(n,i.className),style:i.style,sx:os({fontFamily:"monospace",userSelect:"none",contentVisibility:"auto"},i.sx),onMouseLeave:d,children:vn(KD,{value:l,prevValue:c,path:$.useMemo(function(){return[]},[])})})},t4e=function(e){var n=XBt(),r,s=$.useMemo(function(){return e.theme==="auto"?n?"light":"dark":(r=e.theme)!==null&&r!==void 0?r:"light"},[n,e.theme]),o=$.useMemo(function(){var u=typeof s=="object"?s.base00:s==="dark"?G5e.base00:pce.base00;return cce({components:{MuiPaper:{styleOverrides:{root:{backgroundColor:u}}}},palette:{mode:s==="dark"?"dark":"light",background:{default:u}}})},[s]),a=A4(os({},e),{theme:s}),l=$.useMemo(function(){return cBt(e)},[]),c=$.useMemo(function(){return HBt()},[]);return vn(d6t,{theme:o,children:vn(_ce.Provider,{value:c,children:vn(N4.Provider,{value:l,children:vn(YBt,os({},a))})})})};const Bye={"qdrant-custom":{scheme:"qdrant-custom",author:"Qdrant Web UI",getColors:i=>{const e=i.palette.mode==="dark";return{base00:i.palette.background.paperElevation1,base02:e?xi[700]:xi[200],base04:e?xi[500]:xi[400],base05:Yu[600],base06:e?xi[300]:xi[600],base07:Yu[600],base08:i.palette.error.main,base09:tu[600],base0A:i.palette.warning.main,base0B:tu[600],base0C:Yu[600],base0D:e?xi[500]:xi[400],base0E:i.palette.warning.main,base0F:tu[600]}},getOverrides:i=>{const e=i.palette.mode==="dark";return{fontSize:"0.75rem",lineHeight:"150%","& .data-object-start":{color:cfe[600]},"& .data-object-end":{color:cfe[600]},"& .MuiSvgIcon-root":{color:e?xi[500]:xi[400]}}}},info:{scheme:"info",author:"Qdrant Web UI",getColors:i=>{const e=i.palette.mode==="dark";return{base00:i.palette.background.paperElevation1,base02:e?xi[700]:xi[200],base04:i.palette.text.secondary,base05:i.palette.text.secondary,base06:e?xi[300]:xi[600],base07:i.palette.text.secondary,base08:i.palette.error.main,base09:i.palette.success.main,base0A:i.palette.error.main,base0B:i.palette.success.main,base0C:i.palette.text.secondary,base0D:i.palette.text.secondary,base0E:i.palette.warning.main,base0F:i.palette.warning.main}},getOverrides:i=>({fontSize:"0.75rem",lineHeight:"150%","& .data-object-start":{color:i.palette.warning.main},"& .data-object-end":{color:i.palette.warning.main},"& .MuiSvgIcon-root":{color:i.palette.text.secondary}})}},ZBt=(i,e="qdrant-custom")=>{const n=Bye[e]||Bye["qdrant-custom"];return{theme:{scheme:n.scheme,author:n.author,...n.getColors(i)},overrides:n.getOverrides(i)}},QBt=(i="qdrant-custom")=>{const e=$i();return ZBt(e,i)},vce=({sx:i={},jsonViewerProps:e={},theme:n="qdrant-custom",...r})=>{const{theme:s,overrides:o}=QBt(n);return C.jsx(t4e,{theme:s,...e,sx:{...o,...i},...r})};vce.propTypes={sx:Z.object,jsonViewerProps:Z.object,theme:Z.string};const bce=({collectionName:i})=>{var h;const{enqueueSnackbar:e,closeSnackbar:n}=pu(),{client:r,isRestricted:s}=Ur(),[o,a]=nn.useState({}),[l,c]=nn.useState(null);$.useEffect(()=>{u(),!s&&r.api("cluster").collectionClusterInfo({collection_name:i}).then(f=>{c(()=>({...f.data}))}).catch(f=>{e(f.message,as("error",n))})},[i]);const u=()=>{r.getCollection(i).then(f=>{a(()=>({...f}))}).catch(f=>{e(f.message,as("error",n))})},d=()=>{r.updateCollection(i,{optimizers_config:{}}).then(()=>{e("Optimizers triggered",as("success",n)),u()}).catch(f=>{e(f.message,as("error",n))})};return C.jsxs(Ye,{pt:2,children:[C.jsx(_5e,{collectionName:i}),C.jsxs(Fv,{elevation:0,children:[C.jsx(h5,{title:"Collection Info",variant:"heading",sx:{flexGrow:1},action:C.jsxs(Ye,{display:"flex",gap:1,children:[C.jsx(Ci,{variant:"contained",size:"small",onClick:d,disabled:o.status==="green"||((h=o.optimizer_status)==null?void 0:h.error)==="optimizations pending, awaiting update operation",sx:{py:.75,mb:.2},children:"Trigger optimizers"}),C.jsx(p_,{text:ls.stringify(o)})]})}),C.jsx(ex,{children:C.jsx(vce,{theme:"info",value:o,displayDataTypes:!1,displayObjectSize:!1,rootName:!1,enableClipboard:!1})})]}),l&&C.jsx(m5e,{sx:{mt:5},collectionCluster:l})]})};bce.displayName="CollectionInfo";bce.propTypes={collectionName:Z.string.isRequired};const JBt=$.memo(bce);function n4e({conditions:i,onConditionChange:e,usingVector:n}){const r=a=>{const l=i.filter(c=>!(c.key===a.key&&c.value===a.value&&c.type===a.type));e(l)},s=a=>n&&a.type==="id"?a.key+": "+a.value+" using "+n:a.key+": "+a.value,o=()=>{e([])};return(i==null?void 0:i.length)>0&&C.jsxs(Ye,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[C.jsxs(Ye,{sx:{display:"flex",gap:1,alignItems:"center",flexWrap:"wrap"},children:[C.jsx(Je,{variant:"subtitle2",children:"Similar:"}),i.map(a=>C.jsx(JS,{color:"primary",size:"medium",label:s(a),onDelete:()=>r(a)},a.key+"_"+a.value))]}),C.jsxs(Ci,{variant:"text",onClick:o,color:"inherit",sx:{gap:1,p:.5},children:[C.jsx(kDe,{size:18}),"Clear All"]})]})}n4e.propTypes={conditions:Z.array.isRequired,onConditionChange:Z.func.isRequired,vectors:Z.array.isRequired,usingVector:Z.string};const i4e=({text:i,tooltip:e="Copy to clipboard",tooltipPlacement:n="left",successMessage:r="Copied to clipboard",size:s,buttonProps:o,showIcon:a=!0,iconPosition:l="start",children:c="Copy"})=>{const u=()=>a?C.jsx(SDe,{size:s||"1.25rem"}):null,d=()=>l==="start"?C.jsxs(C.Fragment,{children:[u(),c]}):C.jsxs(C.Fragment,{children:[c,u()]}),h=({handleCopy:f})=>C.jsx(Ci,{variant:"text",onClick:f,sx:{color:"text.primary",gap:1,lineHeight:1.5,border:"none"},...o,children:d()});return C.jsx(nce,{text:i,tooltip:e,tooltipPlacement:n,successMessage:r,renderButton:h})};i4e.propTypes={text:Z.string.isRequired,tooltip:Z.string,tooltipPlacement:Z.string,successMessage:Z.string,size:Z.string,buttonProps:Z.object,showIcon:Z.bool,iconPosition:Z.oneOf(["start","end"]),children:Z.node};const jye=ye(Ci)({display:"flex",padding:"0.25rem 0.625rem",flexDirection:"column",justifyContent:"center",alignItems:"center",fontSize:"0.8125rem",fontStyle:"normal",fontWeight:500,textTransform:"capitalize"}),yce=$.memo(function({point:e,onConditionChange:n}){const{collectionName:r}=V1(),s=z1();if(!Object.getOwnPropertyDescriptor(e,"vector"))return null;let o={};Array.isArray(e.vector)?o[""]=e.vector:o=e.vector;const a=l=>{s(`/collections/${r}/graph`,{state:{newInitNode:e,vectorName:l}})};return C.jsxs(Ye,{children:[C.jsx(Je,{variant:"subtitle2",children:"Vectors:"}),Object.keys(o).map(l=>{var c,u;return C.jsxs(ln,{container:!0,spacing:2,alignItems:"center",children:[C.jsx(ln,{size:{xs:12,md:4},display:"flex",alignItems:"center",children:l===""?C.jsx(Je,{variant:"body2",color:"text.secondary",display:"inline",mr:1,children:"Default vector"}):C.jsxs(C.Fragment,{children:[C.jsx(Je,{variant:"body2",color:"text.secondary",display:"inline",mr:1,children:"Name:"}),C.jsx(JS,{label:l,size:"small",variant:"outlined",sx:{mr:1}})]})}),C.jsxs(ln,{my:1,size:{xs:12,md:4},children:[C.jsx(Je,{variant:"body2",color:"text.secondary",display:"inline",mr:1,children:"Length:"}),C.jsx(JS,{sx:{borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.12)",fontSize:"13px"},label:Array.isArray(o[l])?Array.isArray(o[l][0])?`${o[l].length}x${o[l][0].length}`:o[l].length:(u=(c=o[l])==null?void 0:c.indices)==null?void 0:u.length,variant:"outlined",size:"small"})]}),C.jsxs(ln,{my:1,sx:{display:"flex",justifyContent:"end",gap:2},size:{xs:12,md:4},display:"flex",alignItems:"center",children:[C.jsx(i4e,{text:ls.stringify(o[l]),tooltip:"Copy vector to clipboard",tooltipPlacement:"left",successMessage:`Copied ${l===""?"default vector":"vector "+l} to clipboard`,buttonProps:{size:"small"}}),C.jsx(jye,{variant:"outlined",size:"small",onClick:()=>a(l),sx:{width:{xs:"100%",md:"auto"}},children:"Open graph"}),typeof n!="function"?null:C.jsx(jye,{variant:"outlined",size:"small",onClick:()=>n([{key:"id",type:"id",value:e.id}],l===""?null:l),sx:{width:{xs:"100%",md:"auto"}},children:"Find Similar"})]})]},l)})]})});yce.propTypes={point:Z.object.isRequired,onConditionChange:Z.func};function wce({data:i,sx:e}){const[n,r]=$.useState(null),o=(()=>{const a=[];function l(c){let u;try{u=new URL(c)}catch{return!1}return u?/\.(jpg|jpeg|png|webp|gif|svg)$/.test(u.pathname):!1}for(const c in i)typeof i[c]=="string"&&l(i[c])&&a.push(C.jsx(Ye,{sx:{py:1,px:.5,ml:5},children:C.jsx(fUe,{component:"img",sx:{width:"120px",height:"120px",aspectRatio:"1/1",wordWrap:"break-word",border:"1px solid #ccc",borderRadius:"5px",...e},image:i[c],alt:i[c],onClick:()=>r(i[c])})},c));return a})();return o.length===0?null:C.jsxs(Ye,{children:[o,C.jsx(IW,{open:!!n,onClose:()=>r(null),slotProps:{backdrop:{sx:{cursor:"pointer"},title:"Click to close"}},children:C.jsxs(Ye,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",maxWidth:"100%",maxHeight:"100%","&:focus":{outline:"none"}},children:[C.jsx(Je,{variant:"h6",component:"p",onClick:()=>r(null),sx:{position:"absolute",top:"-60px",right:0,padding:1,cursor:"pointer",color:"white",backgroundColor:"rgba(0,0,0,0.5)",borderRadius:"5px"},children:"Close [ESC]"}),C.jsx("img",{src:n,alt:n,style:{maxWidth:"100%",maxHeight:"100%"}})]})})]})}wce.propTypes={data:Z.object.isRequired,sx:Z.object,xs:Z.number};var $G,Wye;function e8t(){if(Wye)return $G;Wye=1;function i(){this.__data__=[],this.size=0}return $G=i,$G}var zG,$ye;function r4e(){if($ye)return zG;$ye=1;function i(e,n){return e===n||e!==e&&n!==n}return zG=i,zG}var VG,zye;function TV(){if(zye)return VG;zye=1;var i=r4e();function e(n,r){for(var s=n.length;s--;)if(i(n[s][0],r))return s;return-1}return VG=e,VG}var HG,Vye;function t8t(){if(Vye)return HG;Vye=1;var i=TV(),e=Array.prototype,n=e.splice;function r(s){var o=this.__data__,a=i(o,s);if(a<0)return!1;var l=o.length-1;return a==l?o.pop():n.call(o,a,1),--this.size,!0}return HG=r,HG}var UG,Hye;function n8t(){if(Hye)return UG;Hye=1;var i=TV();function e(n){var r=this.__data__,s=i(r,n);return s<0?void 0:r[s][1]}return UG=e,UG}var qG,Uye;function i8t(){if(Uye)return qG;Uye=1;var i=TV();function e(n){return i(this.__data__,n)>-1}return qG=e,qG}var KG,qye;function r8t(){if(qye)return KG;qye=1;var i=TV();function e(n,r){var s=this.__data__,o=i(s,n);return o<0?(++this.size,s.push([n,r])):s[o][1]=r,this}return KG=e,KG}var GG,Kye;function RV(){if(Kye)return GG;Kye=1;var i=e8t(),e=t8t(),n=n8t(),r=i8t(),s=r8t();function o(a){var l=-1,c=a==null?0:a.length;for(this.clear();++l<c;){var u=a[l];this.set(u[0],u[1])}}return o.prototype.clear=i,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,GG=o,GG}var XG,Gye;function s8t(){if(Gye)return XG;Gye=1;var i=RV();function e(){this.__data__=new i,this.size=0}return XG=e,XG}var YG,Xye;function o8t(){if(Xye)return YG;Xye=1;function i(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r}return YG=i,YG}var ZG,Yye;function a8t(){if(Yye)return ZG;Yye=1;function i(e){return this.__data__.get(e)}return ZG=i,ZG}var QG,Zye;function l8t(){if(Zye)return QG;Zye=1;function i(e){return this.__data__.has(e)}return QG=i,QG}var JG,Qye;function s4e(){if(Qye)return JG;Qye=1;var i=_4(),e=m4(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function a(l){if(!e(l))return!1;var c=i(l);return c==r||c==s||c==n||c==o}return JG=a,JG}var eX,Jye;function c8t(){if(Jye)return eX;Jye=1;var i=f_(),e=i["__core-js_shared__"];return eX=e,eX}var tX,e1e;function u8t(){if(e1e)return tX;e1e=1;var i=c8t(),e=function(){var r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!e&&e in r}return tX=n,tX}var nX,t1e;function o4e(){if(t1e)return nX;t1e=1;var i=Function.prototype,e=i.toString;function n(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return nX=n,nX}var iX,n1e;function d8t(){if(n1e)return iX;n1e=1;var i=s4e(),e=u8t(),n=m4(),r=o4e(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,l=Object.prototype,c=a.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(f){if(!n(f)||e(f))return!1;var p=i(f)?d:o;return p.test(r(f))}return iX=h,iX}var rX,i1e;function h8t(){if(i1e)return rX;i1e=1;function i(e,n){return e==null?void 0:e[n]}return rX=i,rX}var sX,r1e;function aT(){if(r1e)return sX;r1e=1;var i=d8t(),e=h8t();function n(r,s){var o=e(r,s);return i(o)?o:void 0}return sX=n,sX}var oX,s1e;function Cce(){if(s1e)return oX;s1e=1;var i=aT(),e=f_(),n=i(e,"Map");return oX=n,oX}var aX,o1e;function AV(){if(o1e)return aX;o1e=1;var i=aT(),e=i(Object,"create");return aX=e,aX}var lX,a1e;function f8t(){if(a1e)return lX;a1e=1;var i=AV();function e(){this.__data__=i?i(null):{},this.size=0}return lX=e,lX}var cX,l1e;function p8t(){if(l1e)return cX;l1e=1;function i(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}return cX=i,cX}var uX,c1e;function g8t(){if(c1e)return uX;c1e=1;var i=AV(),e="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(o){var a=this.__data__;if(i){var l=a[o];return l===e?void 0:l}return r.call(a,o)?a[o]:void 0}return uX=s,uX}var dX,u1e;function m8t(){if(u1e)return dX;u1e=1;var i=AV(),e=Object.prototype,n=e.hasOwnProperty;function r(s){var o=this.__data__;return i?o[s]!==void 0:n.call(o,s)}return dX=r,dX}var hX,d1e;function _8t(){if(d1e)return hX;d1e=1;var i=AV(),e="__lodash_hash_undefined__";function n(r,s){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=i&&s===void 0?e:s,this}return hX=n,hX}var fX,h1e;function v8t(){if(h1e)return fX;h1e=1;var i=f8t(),e=p8t(),n=g8t(),r=m8t(),s=_8t();function o(a){var l=-1,c=a==null?0:a.length;for(this.clear();++l<c;){var u=a[l];this.set(u[0],u[1])}}return o.prototype.clear=i,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,fX=o,fX}var pX,f1e;function b8t(){if(f1e)return pX;f1e=1;var i=v8t(),e=RV(),n=Cce();function r(){this.size=0,this.__data__={hash:new i,map:new(n||e),string:new i}}return pX=r,pX}var gX,p1e;function y8t(){if(p1e)return gX;p1e=1;function i(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}return gX=i,gX}var mX,g1e;function NV(){if(g1e)return mX;g1e=1;var i=y8t();function e(n,r){var s=n.__data__;return i(r)?s[typeof r=="string"?"string":"hash"]:s.map}return mX=e,mX}var _X,m1e;function w8t(){if(m1e)return _X;m1e=1;var i=NV();function e(n){var r=i(this,n).delete(n);return this.size-=r?1:0,r}return _X=e,_X}var vX,_1e;function C8t(){if(_1e)return vX;_1e=1;var i=NV();function e(n){return i(this,n).get(n)}return vX=e,vX}var bX,v1e;function S8t(){if(v1e)return bX;v1e=1;var i=NV();function e(n){return i(this,n).has(n)}return bX=e,bX}var yX,b1e;function x8t(){if(b1e)return yX;b1e=1;var i=NV();function e(n,r){var s=i(this,n),o=s.size;return s.set(n,r),this.size+=s.size==o?0:1,this}return yX=e,yX}var wX,y1e;function Sce(){if(y1e)return wX;y1e=1;var i=b8t(),e=w8t(),n=C8t(),r=S8t(),s=x8t();function o(a){var l=-1,c=a==null?0:a.length;for(this.clear();++l<c;){var u=a[l];this.set(u[0],u[1])}}return o.prototype.clear=i,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,wX=o,wX}var CX,w1e;function k8t(){if(w1e)return CX;w1e=1;var i=RV(),e=Cce(),n=Sce(),r=200;function s(o,a){var l=this.__data__;if(l instanceof i){var c=l.__data__;if(!e||c.length<r-1)return c.push([o,a]),this.size=++l.size,this;l=this.__data__=new n(c)}return l.set(o,a),this.size=l.size,this}return CX=s,CX}var SX,C1e;function L8t(){if(C1e)return SX;C1e=1;var i=RV(),e=s8t(),n=o8t(),r=a8t(),s=l8t(),o=k8t();function a(l){var c=this.__data__=new i(l);this.size=c.size}return a.prototype.clear=e,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,SX=a,SX}var xX,S1e;function D8t(){if(S1e)return xX;S1e=1;var i="__lodash_hash_undefined__";function e(n){return this.__data__.set(n,i),this}return xX=e,xX}var kX,x1e;function E8t(){if(x1e)return kX;x1e=1;function i(e){return this.__data__.has(e)}return kX=i,kX}var LX,k1e;function I8t(){if(k1e)return LX;k1e=1;var i=Sce(),e=D8t(),n=E8t();function r(s){var o=-1,a=s==null?0:s.length;for(this.__data__=new i;++o<a;)this.add(s[o])}return r.prototype.add=r.prototype.push=e,r.prototype.has=n,LX=r,LX}var DX,L1e;function T8t(){if(L1e)return DX;L1e=1;function i(e,n){for(var r=-1,s=e==null?0:e.length;++r<s;)if(n(e[r],r,e))return!0;return!1}return DX=i,DX}var EX,D1e;function R8t(){if(D1e)return EX;D1e=1;function i(e,n){return e.has(n)}return EX=i,EX}var IX,E1e;function a4e(){if(E1e)return IX;E1e=1;var i=I8t(),e=T8t(),n=R8t(),r=1,s=2;function o(a,l,c,u,d,h){var f=c&r,p=a.length,g=l.length;if(p!=g&&!(f&&g>p))return!1;var m=h.get(a),_=h.get(l);if(m&&_)return m==l&&_==a;var b=-1,y=!0,x=c&s?new i:void 0;for(h.set(a,l),h.set(l,a);++b<p;){var k=a[b],D=l[b];if(u)var R=f?u(D,k,b,l,a,h):u(k,D,b,a,l,h);if(R!==void 0){if(R)continue;y=!1;break}if(x){if(!e(l,function(E,A){if(!n(x,A)&&(k===E||d(k,E,c,u,h)))return x.push(A)})){y=!1;break}}else if(!(k===D||d(k,D,c,u,h))){y=!1;break}}return h.delete(a),h.delete(l),y}return IX=o,IX}var TX,I1e;function A8t(){if(I1e)return TX;I1e=1;var i=f_(),e=i.Uint8Array;return TX=e,TX}var RX,T1e;function N8t(){if(T1e)return RX;T1e=1;function i(e){var n=-1,r=Array(e.size);return e.forEach(function(s,o){r[++n]=[o,s]}),r}return RX=i,RX}var AX,R1e;function M8t(){if(R1e)return AX;R1e=1;function i(e){var n=-1,r=Array(e.size);return e.forEach(function(s){r[++n]=s}),r}return AX=i,AX}var NX,A1e;function P8t(){if(A1e)return NX;A1e=1;var i=mV(),e=A8t(),n=r4e(),r=a4e(),s=N8t(),o=M8t(),a=1,l=2,c="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Map]",f="[object Number]",p="[object RegExp]",g="[object Set]",m="[object String]",_="[object Symbol]",b="[object ArrayBuffer]",y="[object DataView]",x=i?i.prototype:void 0,k=x?x.valueOf:void 0;function D(R,E,A,M,N,P,O){switch(A){case y:if(R.byteLength!=E.byteLength||R.byteOffset!=E.byteOffset)return!1;R=R.buffer,E=E.buffer;case b:return!(R.byteLength!=E.byteLength||!P(new e(R),new e(E)));case c:case u:case f:return n(+R,+E);case d:return R.name==E.name&&R.message==E.message;case p:case m:return R==E+"";case h:var B=s;case g:var j=M&a;if(B||(B=o),R.size!=E.size&&!j)return!1;var z=O.get(R);if(z)return z==E;M|=l,O.set(R,E);var H=r(B(R),B(E),M,N,P,O);return O.delete(R),H;case _:if(k)return k.call(R)==k.call(E)}return!1}return NX=D,NX}var MX,N1e;function O8t(){if(N1e)return MX;N1e=1;function i(e,n){for(var r=-1,s=n.length,o=e.length;++r<s;)e[o+r]=n[r];return e}return MX=i,MX}var PX,M1e;function lT(){if(M1e)return PX;M1e=1;var i=Array.isArray;return PX=i,PX}var OX,P1e;function F8t(){if(P1e)return OX;P1e=1;var i=O8t(),e=lT();function n(r,s,o){var a=s(r);return e(r)?a:i(a,o(r))}return OX=n,OX}var FX,O1e;function B8t(){if(O1e)return FX;O1e=1;function i(e,n){for(var r=-1,s=e==null?0:e.length,o=0,a=[];++r<s;){var l=e[r];n(l,r,e)&&(a[o++]=l)}return a}return FX=i,FX}var BX,F1e;function j8t(){if(F1e)return BX;F1e=1;function i(){return[]}return BX=i,BX}var jX,B1e;function W8t(){if(B1e)return jX;B1e=1;var i=B8t(),e=j8t(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,o=s?function(a){return a==null?[]:(a=Object(a),i(s(a),function(l){return r.call(a,l)}))}:e;return jX=o,jX}var WX,j1e;function $8t(){if(j1e)return WX;j1e=1;function i(e,n){for(var r=-1,s=Array(e);++r<e;)s[r]=n(r);return s}return WX=i,WX}var $X,W1e;function z8t(){if(W1e)return $X;W1e=1;var i=_4(),e=v4(),n="[object Arguments]";function r(s){return e(s)&&i(s)==n}return $X=r,$X}var zX,$1e;function V8t(){if($1e)return zX;$1e=1;var i=z8t(),e=v4(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,o=i(function(){return arguments}())?i:function(a){return e(a)&&r.call(a,"callee")&&!s.call(a,"callee")};return zX=o,zX}var IN={exports:{}},VX,z1e;function H8t(){if(z1e)return VX;z1e=1;function i(){return!1}return VX=i,VX}IN.exports;var V1e;function l4e(){return V1e||(V1e=1,function(i,e){var n=f_(),r=H8t(),s=e&&!e.nodeType&&e,o=s&&!0&&i&&!i.nodeType&&i,a=o&&o.exports===s,l=a?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;i.exports=u}(IN,IN.exports)),IN.exports}var HX,H1e;function U8t(){if(H1e)return HX;H1e=1;var i=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function n(r,s){var o=typeof r;return s=s??i,!!s&&(o=="number"||o!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<s}return HX=n,HX}var UX,U1e;function c4e(){if(U1e)return UX;U1e=1;var i=9007199254740991;function e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=i}return UX=e,UX}var qX,q1e;function q8t(){if(q1e)return qX;q1e=1;var i=_4(),e=c4e(),n=v4(),r="[object Arguments]",s="[object Array]",o="[object Boolean]",a="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",h="[object Object]",f="[object RegExp]",p="[object Set]",g="[object String]",m="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",D="[object Int16Array]",R="[object Int32Array]",E="[object Uint8Array]",A="[object Uint8ClampedArray]",M="[object Uint16Array]",N="[object Uint32Array]",P={};P[y]=P[x]=P[k]=P[D]=P[R]=P[E]=P[A]=P[M]=P[N]=!0,P[r]=P[s]=P[_]=P[o]=P[b]=P[a]=P[l]=P[c]=P[u]=P[d]=P[h]=P[f]=P[p]=P[g]=P[m]=!1;function O(B){return n(B)&&e(B.length)&&!!P[i(B)]}return qX=O,qX}var KX,K1e;function K8t(){if(K1e)return KX;K1e=1;function i(e){return function(n){return e(n)}}return KX=i,KX}var TN={exports:{}};TN.exports;var G1e;function G8t(){return G1e||(G1e=1,function(i,e){var n=ZPe(),r=e&&!e.nodeType&&e,s=r&&!0&&i&&!i.nodeType&&i,o=s&&s.exports===r,a=o&&n.process,l=function(){try{var c=s&&s.require&&s.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}}();i.exports=l}(TN,TN.exports)),TN.exports}var GX,X1e;function u4e(){if(X1e)return GX;X1e=1;var i=q8t(),e=K8t(),n=G8t(),r=n&&n.isTypedArray,s=r?e(r):i;return GX=s,GX}var XX,Y1e;function X8t(){if(Y1e)return XX;Y1e=1;var i=$8t(),e=V8t(),n=lT(),r=l4e(),s=U8t(),o=u4e(),a=Object.prototype,l=a.hasOwnProperty;function c(u,d){var h=n(u),f=!h&&e(u),p=!h&&!f&&r(u),g=!h&&!f&&!p&&o(u),m=h||f||p||g,_=m?i(u.length,String):[],b=_.length;for(var y in u)(d||l.call(u,y))&&!(m&&(y=="length"||p&&(y=="offset"||y=="parent")||g&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||s(y,b)))&&_.push(y);return _}return XX=c,XX}var YX,Z1e;function Y8t(){if(Z1e)return YX;Z1e=1;var i=Object.prototype;function e(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||i;return n===s}return YX=e,YX}var ZX,Q1e;function Z8t(){if(Q1e)return ZX;Q1e=1;function i(e,n){return function(r){return e(n(r))}}return ZX=i,ZX}var QX,J1e;function Q8t(){if(J1e)return QX;J1e=1;var i=Z8t(),e=i(Object.keys,Object);return QX=e,QX}var JX,ewe;function J8t(){if(ewe)return JX;ewe=1;var i=Y8t(),e=Q8t(),n=Object.prototype,r=n.hasOwnProperty;function s(o){if(!i(o))return e(o);var a=[];for(var l in Object(o))r.call(o,l)&&l!="constructor"&&a.push(l);return a}return JX=s,JX}var eY,twe;function e9t(){if(twe)return eY;twe=1;var i=s4e(),e=c4e();function n(r){return r!=null&&e(r.length)&&!i(r)}return eY=n,eY}var tY,nwe;function t9t(){if(nwe)return tY;nwe=1;var i=X8t(),e=J8t(),n=e9t();function r(s){return n(s)?i(s):e(s)}return tY=r,tY}var nY,iwe;function n9t(){if(iwe)return nY;iwe=1;var i=F8t(),e=W8t(),n=t9t();function r(s){return i(s,n,e)}return nY=r,nY}var iY,rwe;function i9t(){if(rwe)return iY;rwe=1;var i=n9t(),e=1,n=Object.prototype,r=n.hasOwnProperty;function s(o,a,l,c,u,d){var h=l&e,f=i(o),p=f.length,g=i(a),m=g.length;if(p!=m&&!h)return!1;for(var _=p;_--;){var b=f[_];if(!(h?b in a:r.call(a,b)))return!1}var y=d.get(o),x=d.get(a);if(y&&x)return y==a&&x==o;var k=!0;d.set(o,a),d.set(a,o);for(var D=h;++_<p;){b=f[_];var R=o[b],E=a[b];if(c)var A=h?c(E,R,b,a,o,d):c(R,E,b,o,a,d);if(!(A===void 0?R===E||u(R,E,l,c,d):A)){k=!1;break}D||(D=b=="constructor")}if(k&&!D){var M=o.constructor,N=a.constructor;M!=N&&"constructor"in o&&"constructor"in a&&!(typeof M=="function"&&M instanceof M&&typeof N=="function"&&N instanceof N)&&(k=!1)}return d.delete(o),d.delete(a),k}return iY=s,iY}var rY,swe;function r9t(){if(swe)return rY;swe=1;var i=aT(),e=f_(),n=i(e,"DataView");return rY=n,rY}var sY,owe;function s9t(){if(owe)return sY;owe=1;var i=aT(),e=f_(),n=i(e,"Promise");return sY=n,sY}var oY,awe;function o9t(){if(awe)return oY;awe=1;var i=aT(),e=f_(),n=i(e,"Set");return oY=n,oY}var aY,lwe;function a9t(){if(lwe)return aY;lwe=1;var i=aT(),e=f_(),n=i(e,"WeakMap");return aY=n,aY}var lY,cwe;function l9t(){if(cwe)return lY;cwe=1;var i=r9t(),e=Cce(),n=s9t(),r=o9t(),s=a9t(),o=_4(),a=o4e(),l="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",p=a(i),g=a(e),m=a(n),_=a(r),b=a(s),y=o;return(i&&y(new i(new ArrayBuffer(1)))!=f||e&&y(new e)!=l||n&&y(n.resolve())!=u||r&&y(new r)!=d||s&&y(new s)!=h)&&(y=function(x){var k=o(x),D=k==c?x.constructor:void 0,R=D?a(D):"";if(R)switch(R){case p:return f;case g:return l;case m:return u;case _:return d;case b:return h}return k}),lY=y,lY}var cY,uwe;function c9t(){if(uwe)return cY;uwe=1;var i=L8t(),e=a4e(),n=P8t(),r=i9t(),s=l9t(),o=lT(),a=l4e(),l=u4e(),c=1,u="[object Arguments]",d="[object Array]",h="[object Object]",f=Object.prototype,p=f.hasOwnProperty;function g(m,_,b,y,x,k){var D=o(m),R=o(_),E=D?d:s(m),A=R?d:s(_);E=E==u?h:E,A=A==u?h:A;var M=E==h,N=A==h,P=E==A;if(P&&a(m)){if(!a(_))return!1;D=!0,M=!1}if(P&&!M)return k||(k=new i),D||l(m)?e(m,_,b,y,x,k):n(m,_,E,b,y,x,k);if(!(b&c)){var O=M&&p.call(m,"__wrapped__"),B=N&&p.call(_,"__wrapped__");if(O||B){var j=O?m.value():m,z=B?_.value():_;return k||(k=new i),x(j,z,b,y,k)}}return P?(k||(k=new i),r(m,_,b,y,x,k)):!1}return cY=g,cY}var uY,dwe;function u9t(){if(dwe)return uY;dwe=1;var i=c9t(),e=v4();function n(r,s,o,a,l){return r===s?!0:r==null||s==null||!e(r)&&!e(s)?r!==r&&s!==s:i(r,s,o,a,n,l)}return uY=n,uY}var dY,hwe;function d9t(){if(hwe)return dY;hwe=1;var i=u9t();function e(n,r){return i(n,r)}return dY=e,dY}var h9t=d9t();const fwe=ql(h9t);var ap={},zc={},hY={},fY={},pwe;function rw(){return pwe||(pwe=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=e;function e(){}e.prototype={diff:function(s,o){var a,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=l.callback;typeof l=="function"&&(c=l,l={}),this.options=l;var u=this;function d(E){return c?(setTimeout(function(){c(void 0,E)},0),!0):E}s=this.castInput(s),o=this.castInput(o),s=this.removeEmpty(this.tokenize(s)),o=this.removeEmpty(this.tokenize(o));var h=o.length,f=s.length,p=1,g=h+f;l.maxEditLength&&(g=Math.min(g,l.maxEditLength));var m=(a=l.timeout)!==null&&a!==void 0?a:1/0,_=Date.now()+m,b=[{oldPos:-1,lastComponent:void 0}],y=this.extractCommon(b[0],o,s,0);if(b[0].oldPos+1>=f&&y+1>=h)return d([{value:this.join(o),count:o.length}]);var x=-1/0,k=1/0;function D(){for(var E=Math.max(x,-p);E<=Math.min(k,p);E+=2){var A=void 0,M=b[E-1],N=b[E+1];M&&(b[E-1]=void 0);var P=!1;if(N){var O=N.oldPos-E;P=N&&0<=O&&O<h}var B=M&&M.oldPos+1<f;if(!P&&!B){b[E]=void 0;continue}if(!B||P&&M.oldPos+1<N.oldPos?A=u.addToPath(N,!0,void 0,0):A=u.addToPath(M,void 0,!0,1),y=u.extractCommon(A,o,s,E),A.oldPos+1>=f&&y+1>=h)return d(n(u,A.lastComponent,o,s,u.useLongestToken));b[E]=A,A.oldPos+1>=f&&(k=Math.min(k,E-1)),y+1>=h&&(x=Math.max(x,E+1))}p++}if(c)(function E(){setTimeout(function(){if(p>g||Date.now()>_)return c();D()||E()},0)})();else for(;p<=g&&Date.now()<=_;){var R=D();if(R)return R}},addToPath:function(s,o,a,l){var c=s.lastComponent;return c&&c.added===o&&c.removed===a?{oldPos:s.oldPos+l,lastComponent:{count:c.count+1,added:o,removed:a,previousComponent:c.previousComponent}}:{oldPos:s.oldPos+l,lastComponent:{count:1,added:o,removed:a,previousComponent:c}}},extractCommon:function(s,o,a,l){for(var c=o.length,u=a.length,d=s.oldPos,h=d-l,f=0;h+1<c&&d+1<u&&this.equals(o[h+1],a[d+1]);)h++,d++,f++;return f&&(s.lastComponent={count:f,previousComponent:s.lastComponent}),s.oldPos=d,h},equals:function(s,o){return this.options.comparator?this.options.comparator(s,o):s===o||this.options.ignoreCase&&s.toLowerCase()===o.toLowerCase()},removeEmpty:function(s){for(var o=[],a=0;a<s.length;a++)s[a]&&o.push(s[a]);return o},castInput:function(s){return s},tokenize:function(s){return s.split("")},join:function(s){return s.join("")}};function n(r,s,o,a,l){for(var c=[],u;s;)c.push(s),u=s.previousComponent,delete s.previousComponent,s=u;c.reverse();for(var d=0,h=c.length,f=0,p=0;d<h;d++){var g=c[d];if(g.removed){if(g.value=r.join(a.slice(p,p+g.count)),p+=g.count,d&&c[d-1].added){var _=c[d-1];c[d-1]=c[d],c[d]=_}}else{if(!g.added&&l){var m=o.slice(f,f+g.count);m=m.map(function(y,x){var k=a[p+x];return k.length>y.length?k:y}),g.value=r.join(m)}else g.value=r.join(o.slice(f,f+g.count));f+=g.count,g.added||(p+=g.count)}}var b=c[h-1];return h>1&&typeof b.value=="string"&&(b.added||b.removed)&&r.equals("",b.value)&&(c[h-2].value+=b.value,c.pop()),c}}(fY)),fY}var xD={},gwe;function f9t(){if(gwe)return xD;gwe=1,Object.defineProperty(xD,"__esModule",{value:!0}),xD.diffChars=r,xD.characterDiff=void 0;var i=e(rw());function e(s){return s&&s.__esModule?s:{default:s}}var n=new i.default;xD.characterDiff=n;function r(s,o,a){return n.diff(s,o,a)}return xD}var vC={},_B={},mwe;function d4e(){if(mwe)return _B;mwe=1,Object.defineProperty(_B,"__esModule",{value:!0}),_B.generateOptions=i;function i(e,n){if(typeof e=="function")n.callback=e;else if(e)for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}return _B}var _we;function p9t(){if(_we)return vC;_we=1,Object.defineProperty(vC,"__esModule",{value:!0}),vC.diffWords=a,vC.diffWordsWithSpace=l,vC.wordDiff=void 0;var i=n(rw()),e=d4e();function n(c){return c&&c.__esModule?c:{default:c}}var r=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,s=/\S/,o=new i.default;vC.wordDiff=o,o.equals=function(c,u){return this.options.ignoreCase&&(c=c.toLowerCase(),u=u.toLowerCase()),c===u||this.options.ignoreWhitespace&&!s.test(c)&&!s.test(u)},o.tokenize=function(c){for(var u=c.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),d=0;d<u.length-1;d++)!u[d+1]&&u[d+2]&&r.test(u[d])&&r.test(u[d+2])&&(u[d]+=u[d+2],u.splice(d+1,2),d--);return u};function a(c,u,d){return d=(0,e.generateOptions)(d,{ignoreWhitespace:!0}),o.diff(c,u,d)}function l(c,u,d){return o.diff(c,u,d)}return vC}var bC={},vwe;function xce(){if(vwe)return bC;vwe=1,Object.defineProperty(bC,"__esModule",{value:!0}),bC.diffLines=s,bC.diffTrimmedLines=o,bC.lineDiff=void 0;var i=n(rw()),e=d4e();function n(a){return a&&a.__esModule?a:{default:a}}var r=new i.default;bC.lineDiff=r,r.tokenize=function(a){this.options.stripTrailingCr&&(a=a.replace(/\r\n/g,`
`));var l=[],c=a.split(/(\n|\r\n)/);c[c.length-1]||c.pop();for(var u=0;u<c.length;u++){var d=c[u];u%2&&!this.options.newlineIsToken?l[l.length-1]+=d:(this.options.ignoreWhitespace&&(d=d.trim()),l.push(d))}return l};function s(a,l,c){return r.diff(a,l,c)}function o(a,l,c){var u=(0,e.generateOptions)(c,{ignoreWhitespace:!0});return r.diff(a,l,u)}return bC}var kD={},bwe;function g9t(){if(bwe)return kD;bwe=1,Object.defineProperty(kD,"__esModule",{value:!0}),kD.diffSentences=r,kD.sentenceDiff=void 0;var i=e(rw());function e(s){return s&&s.__esModule?s:{default:s}}var n=new i.default;kD.sentenceDiff=n,n.tokenize=function(s){return s.split(/(\S.+?[.!?])(?=\s+|$)/)};function r(s,o,a){return n.diff(s,o,a)}return kD}var LD={},ywe;function m9t(){if(ywe)return LD;ywe=1,Object.defineProperty(LD,"__esModule",{value:!0}),LD.diffCss=r,LD.cssDiff=void 0;var i=e(rw());function e(s){return s&&s.__esModule?s:{default:s}}var n=new i.default;LD.cssDiff=n,n.tokenize=function(s){return s.split(/([{}:;,]|\s+)/)};function r(s,o,a){return n.diff(s,o,a)}return LD}var yC={},wwe;function _9t(){if(wwe)return yC;wwe=1,Object.defineProperty(yC,"__esModule",{value:!0}),yC.diffJson=a,yC.canonicalize=l,yC.jsonDiff=void 0;var i=n(rw()),e=xce();function n(c){return c&&c.__esModule?c:{default:c}}function r(c){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r=function(d){return typeof d}:r=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},r(c)}var s=Object.prototype.toString,o=new i.default;yC.jsonDiff=o,o.useLongestToken=!0,o.tokenize=e.lineDiff.tokenize,o.castInput=function(c){var u=this.options,d=u.undefinedReplacement,h=u.stringifyReplacer,f=h===void 0?function(p,g){return typeof g>"u"?d:g}:h;return typeof c=="string"?c:JSON.stringify(l(c,null,null,f),f," ")},o.equals=function(c,u){return i.default.prototype.equals.call(o,c.replace(/,([\r\n])/g,"$1"),u.replace(/,([\r\n])/g,"$1"))};function a(c,u,d){return o.diff(c,u,d)}function l(c,u,d,h,f){u=u||[],d=d||[],h&&(c=h(f,c));var p;for(p=0;p<u.length;p+=1)if(u[p]===c)return d[p];var g;if(s.call(c)==="[object Array]"){for(u.push(c),g=new Array(c.length),d.push(g),p=0;p<c.length;p+=1)g[p]=l(c[p],u,d,h,f);return u.pop(),d.pop(),g}if(c&&c.toJSON&&(c=c.toJSON()),r(c)==="object"&&c!==null){u.push(c),g={},d.push(g);var m=[],_;for(_ in c)c.hasOwnProperty(_)&&m.push(_);for(m.sort(),p=0;p<m.length;p+=1)_=m[p],g[_]=l(c[_],u,d,h,_);u.pop(),d.pop()}else g=c;return g}return yC}var DD={},Cwe;function v9t(){if(Cwe)return DD;Cwe=1,Object.defineProperty(DD,"__esModule",{value:!0}),DD.diffArrays=r,DD.arrayDiff=void 0;var i=e(rw());function e(s){return s&&s.__esModule?s:{default:s}}var n=new i.default;DD.arrayDiff=n,n.tokenize=function(s){return s.slice()},n.join=n.removeEmpty=function(s){return s};function r(s,o,a){return n.diff(s,o,a)}return DD}var MA={},vB={},Swe;function kce(){if(Swe)return vB;Swe=1,Object.defineProperty(vB,"__esModule",{value:!0}),vB.parsePatch=i;function i(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.split(/\r\n|[\n\v\f\r\x85]/),s=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],o=[],a=0;function l(){var d={};for(o.push(d);a<r.length;){var h=r[a];if(/^(\-\-\-|\+\+\+|@@)\s/.test(h))break;var f=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(h);f&&(d.index=f[1]),a++}for(c(d),c(d),d.hunks=[];a<r.length;){var p=r[a];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(p))break;if(/^@@/.test(p))d.hunks.push(u());else{if(p&&n.strict)throw new Error("Unknown line "+(a+1)+" "+JSON.stringify(p));a++}}}function c(d){var h=/^(---|\+\+\+)\s+(.*)$/.exec(r[a]);if(h){var f=h[1]==="---"?"old":"new",p=h[2].split(" ",2),g=p[0].replace(/\\\\/g,"\\");/^".*"$/.test(g)&&(g=g.substr(1,g.length-2)),d[f+"FileName"]=g,d[f+"Header"]=(p[1]||"").trim(),a++}}function u(){var d=a,h=r[a++],f=h.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),p={oldStart:+f[1],oldLines:typeof f[2]>"u"?1:+f[2],newStart:+f[3],newLines:typeof f[4]>"u"?1:+f[4],lines:[],linedelimiters:[]};p.oldLines===0&&(p.oldStart+=1),p.newLines===0&&(p.newStart+=1);for(var g=0,m=0;a<r.length&&!(r[a].indexOf("--- ")===0&&a+2<r.length&&r[a+1].indexOf("+++ ")===0&&r[a+2].indexOf("@@")===0);a++){var _=r[a].length==0&&a!=r.length-1?" ":r[a][0];if(_==="+"||_==="-"||_===" "||_==="\\")p.lines.push(r[a]),p.linedelimiters.push(s[a]||`
`),_==="+"?g++:_==="-"?m++:_===" "&&(g++,m++);else break}if(!g&&p.newLines===1&&(p.newLines=0),!m&&p.oldLines===1&&(p.oldLines=0),n.strict){if(g!==p.newLines)throw new Error("Added line count did not match for hunk at line "+(d+1));if(m!==p.oldLines)throw new Error("Removed line count did not match for hunk at line "+(d+1))}return p}for(;a<r.length;)l();return o}return vB}var pY={},xwe;function b9t(){return xwe||(xwe=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=e;function e(n,r,s){var o=!0,a=!1,l=!1,c=1;return function u(){if(o&&!l){if(a?c++:o=!1,n+c<=s)return c;l=!0}if(!a)return l||(o=!0),r<=n-c?-c++:(a=!0,u())}}}(pY)),pY}var kwe;function y9t(){if(kwe)return MA;kwe=1,Object.defineProperty(MA,"__esModule",{value:!0}),MA.applyPatch=r,MA.applyPatches=s;var i=kce(),e=n(b9t());function n(o){return o&&o.__esModule?o:{default:o}}function r(o,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof a=="string"&&(a=(0,i.parsePatch)(a)),Array.isArray(a)){if(a.length>1)throw new Error("applyPatch only works with a single input.");a=a[0]}var c=o.split(/\r\n|[\n\v\f\r\x85]/),u=o.match(/\r\n|[\n\v\f\r\x85]/g)||[],d=a.hunks,h=l.compareLine||function(ie,K,ee,le){return K===le},f=0,p=l.fuzzFactor||0,g=0,m=0,_,b;function y(ie,K){for(var ee=0;ee<ie.lines.length;ee++){var le=ie.lines[ee],ke=le.length>0?le[0]:" ",xe=le.length>0?le.substr(1):le;if(ke===" "||ke==="-"){if(!h(K+1,c[K],ke,xe)&&(f++,f>p))return!1;K++}}return!0}for(var x=0;x<d.length;x++){for(var k=d[x],D=c.length-k.oldLines,R=0,E=m+k.oldStart-1,A=(0,e.default)(E,g,D);R!==void 0;R=A())if(y(k,E+R)){k.offset=m+=R;break}if(R===void 0)return!1;g=k.offset+k.oldStart+k.oldLines}for(var M=0,N=0;N<d.length;N++){var P=d[N],O=P.oldStart+P.offset+M-1;M+=P.newLines-P.oldLines;for(var B=0;B<P.lines.length;B++){var j=P.lines[B],z=j.length>0?j[0]:" ",H=j.length>0?j.substr(1):j,Y=P.linedelimiters&&P.linedelimiters[B]||`
`;if(z===" ")O++;else if(z==="-")c.splice(O,1),u.splice(O,1);else if(z==="+")c.splice(O,0,H),u.splice(O,0,Y),O++;else if(z==="\\"){var X=P.lines[B-1]?P.lines[B-1][0]:null;X==="+"?_=!0:X==="-"&&(b=!0)}}}if(_)for(;!c[c.length-1];)c.pop(),u.pop();else b&&(c.push(""),u.push(`
`));for(var Q=0;Q<c.length-1;Q++)c[Q]=c[Q]+u[Q];return c.join("")}function s(o,a){typeof o=="string"&&(o=(0,i.parsePatch)(o));var l=0;function c(){var u=o[l++];if(!u)return a.complete();a.loadFile(u,function(d,h){if(d)return a.complete(d);var f=r(h,u,a);a.patched(u,f,function(p){if(p)return a.complete(p);c()})})}c()}return MA}var PA={},wC={},Lwe;function h4e(){if(Lwe)return wC;Lwe=1,Object.defineProperty(wC,"__esModule",{value:!0}),wC.structuredPatch=l,wC.formatPatch=c,wC.createTwoFilesPatch=u,wC.createPatch=d;var i=xce();function e(h){return o(h)||s(h)||r(h)||n()}function n(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(h,f){if(h){if(typeof h=="string")return a(h,f);var p=Object.prototype.toString.call(h).slice(8,-1);if(p==="Object"&&h.constructor&&(p=h.constructor.name),p==="Map"||p==="Set")return Array.from(h);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return a(h,f)}}function s(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}function o(h){if(Array.isArray(h))return a(h)}function a(h,f){(f==null||f>h.length)&&(f=h.length);for(var p=0,g=new Array(f);p<f;p++)g[p]=h[p];return g}function l(h,f,p,g,m,_,b){b||(b={}),typeof b.context>"u"&&(b.context=4);var y=(0,i.diffLines)(p,g,b);if(!y)return;y.push({value:"",lines:[]});function x(O){return O.map(function(B){return" "+B})}for(var k=[],D=0,R=0,E=[],A=1,M=1,N=function(B){var j=y[B],z=j.lines||j.value.replace(/\n$/,"").split(`
`);if(j.lines=z,j.added||j.removed){var H;if(!D){var Y=y[B-1];D=A,R=M,Y&&(E=b.context>0?x(Y.lines.slice(-b.context)):[],D-=E.length,R-=E.length)}(H=E).push.apply(H,e(z.map(function(xe){return(j.added?"+":"-")+xe}))),j.added?M+=z.length:A+=z.length}else{if(D)if(z.length<=b.context*2&&B<y.length-2){var X;(X=E).push.apply(X,e(x(z)))}else{var Q,ie=Math.min(z.length,b.context);(Q=E).push.apply(Q,e(x(z.slice(0,ie))));var K={oldStart:D,oldLines:A-D+ie,newStart:R,newLines:M-R+ie,lines:E};if(B>=y.length-2&&z.length<=b.context){var ee=/\n$/.test(p),le=/\n$/.test(g),ke=z.length==0&&E.length>K.oldLines;!ee&&ke&&p.length>0&&E.splice(K.oldLines,0,"\\ No newline at end of file"),(!ee&&!ke||!le)&&E.push("\\ No newline at end of file")}k.push(K),D=0,R=0,E=[]}A+=z.length,M+=z.length}},P=0;P<y.length;P++)N(P);return{oldFileName:h,newFileName:f,oldHeader:m,newHeader:_,hunks:k}}function c(h){if(Array.isArray(h))return h.map(c).join(`
`);var f=[];h.oldFileName==h.newFileName&&f.push("Index: "+h.oldFileName),f.push("==================================================================="),f.push("--- "+h.oldFileName+(typeof h.oldHeader>"u"?"":" "+h.oldHeader)),f.push("+++ "+h.newFileName+(typeof h.newHeader>"u"?"":" "+h.newHeader));for(var p=0;p<h.hunks.length;p++){var g=h.hunks[p];g.oldLines===0&&(g.oldStart-=1),g.newLines===0&&(g.newStart-=1),f.push("@@ -"+g.oldStart+","+g.oldLines+" +"+g.newStart+","+g.newLines+" @@"),f.push.apply(f,g.lines)}return f.join(`
`)+`
`}function u(h,f,p,g,m,_,b){return c(l(h,f,p,g,m,_,b))}function d(h,f,p,g,m,_){return u(h,h,f,p,g,m,_)}return wC}var OA={},Dwe;function w9t(){if(Dwe)return OA;Dwe=1,Object.defineProperty(OA,"__esModule",{value:!0}),OA.arrayEqual=i,OA.arrayStartsWith=e;function i(n,r){return n.length!==r.length?!1:e(n,r)}function e(n,r){if(r.length>n.length)return!1;for(var s=0;s<r.length;s++)if(r[s]!==n[s])return!1;return!0}return OA}var Ewe;function C9t(){if(Ewe)return PA;Ewe=1,Object.defineProperty(PA,"__esModule",{value:!0}),PA.calcLineCount=u,PA.merge=d;var i=h4e(),e=kce(),n=w9t();function r(P){return l(P)||a(P)||o(P)||s()}function s(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(P,O){if(P){if(typeof P=="string")return c(P,O);var B=Object.prototype.toString.call(P).slice(8,-1);if(B==="Object"&&P.constructor&&(B=P.constructor.name),B==="Map"||B==="Set")return Array.from(P);if(B==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(B))return c(P,O)}}function a(P){if(typeof Symbol<"u"&&Symbol.iterator in Object(P))return Array.from(P)}function l(P){if(Array.isArray(P))return c(P)}function c(P,O){(O==null||O>P.length)&&(O=P.length);for(var B=0,j=new Array(O);B<O;B++)j[B]=P[B];return j}function u(P){var O=N(P.lines),B=O.oldLines,j=O.newLines;B!==void 0?P.oldLines=B:delete P.oldLines,j!==void 0?P.newLines=j:delete P.newLines}function d(P,O,B){P=h(P,B),O=h(O,B);var j={};(P.index||O.index)&&(j.index=P.index||O.index),(P.newFileName||O.newFileName)&&(f(P)?f(O)?(j.oldFileName=p(j,P.oldFileName,O.oldFileName),j.newFileName=p(j,P.newFileName,O.newFileName),j.oldHeader=p(j,P.oldHeader,O.oldHeader),j.newHeader=p(j,P.newHeader,O.newHeader)):(j.oldFileName=P.oldFileName,j.newFileName=P.newFileName,j.oldHeader=P.oldHeader,j.newHeader=P.newHeader):(j.oldFileName=O.oldFileName||P.oldFileName,j.newFileName=O.newFileName||P.newFileName,j.oldHeader=O.oldHeader||P.oldHeader,j.newHeader=O.newHeader||P.newHeader)),j.hunks=[];for(var z=0,H=0,Y=0,X=0;z<P.hunks.length||H<O.hunks.length;){var Q=P.hunks[z]||{oldStart:1/0},ie=O.hunks[H]||{oldStart:1/0};if(g(Q,ie))j.hunks.push(m(Q,Y)),z++,X+=Q.newLines-Q.oldLines;else if(g(ie,Q))j.hunks.push(m(ie,X)),H++,Y+=ie.newLines-ie.oldLines;else{var K={oldStart:Math.min(Q.oldStart,ie.oldStart),oldLines:0,newStart:Math.min(Q.newStart+Y,ie.oldStart+X),newLines:0,lines:[]};_(K,Q.oldStart,Q.lines,ie.oldStart,ie.lines),H++,z++,j.hunks.push(K)}}return j}function h(P,O){if(typeof P=="string"){if(/^@@/m.test(P)||/^Index:/m.test(P))return(0,e.parsePatch)(P)[0];if(!O)throw new Error("Must provide a base reference or pass in a patch");return(0,i.structuredPatch)(void 0,void 0,O,P)}return P}function f(P){return P.newFileName&&P.newFileName!==P.oldFileName}function p(P,O,B){return O===B?O:(P.conflict=!0,{mine:O,theirs:B})}function g(P,O){return P.oldStart<O.oldStart&&P.oldStart+P.oldLines<O.oldStart}function m(P,O){return{oldStart:P.oldStart,oldLines:P.oldLines,newStart:P.newStart+O,newLines:P.newLines,lines:P.lines}}function _(P,O,B,j,z){var H={offset:O,lines:B,index:0},Y={offset:j,lines:z,index:0};for(k(P,H,Y),k(P,Y,H);H.index<H.lines.length&&Y.index<Y.lines.length;){var X=H.lines[H.index],Q=Y.lines[Y.index];if((X[0]==="-"||X[0]==="+")&&(Q[0]==="-"||Q[0]==="+"))b(P,H,Y);else if(X[0]==="+"&&Q[0]===" "){var ie;(ie=P.lines).push.apply(ie,r(R(H)))}else if(Q[0]==="+"&&X[0]===" "){var K;(K=P.lines).push.apply(K,r(R(Y)))}else X[0]==="-"&&Q[0]===" "?y(P,H,Y):Q[0]==="-"&&X[0]===" "?y(P,Y,H,!0):X===Q?(P.lines.push(X),H.index++,Y.index++):x(P,R(H),R(Y))}D(P,H),D(P,Y),u(P)}function b(P,O,B){var j=R(O),z=R(B);if(A(j)&&A(z)){if((0,n.arrayStartsWith)(j,z)&&M(B,j,j.length-z.length)){var H;(H=P.lines).push.apply(H,r(j));return}else if((0,n.arrayStartsWith)(z,j)&&M(O,z,z.length-j.length)){var Y;(Y=P.lines).push.apply(Y,r(z));return}}else if((0,n.arrayEqual)(j,z)){var X;(X=P.lines).push.apply(X,r(j));return}x(P,j,z)}function y(P,O,B,j){var z=R(O),H=E(B,z);if(H.merged){var Y;(Y=P.lines).push.apply(Y,r(H.merged))}else x(P,j?H:z,j?z:H)}function x(P,O,B){P.conflict=!0,P.lines.push({conflict:!0,mine:O,theirs:B})}function k(P,O,B){for(;O.offset<B.offset&&O.index<O.lines.length;){var j=O.lines[O.index++];P.lines.push(j),O.offset++}}function D(P,O){for(;O.index<O.lines.length;){var B=O.lines[O.index++];P.lines.push(B)}}function R(P){for(var O=[],B=P.lines[P.index][0];P.index<P.lines.length;){var j=P.lines[P.index];if(B==="-"&&j[0]==="+"&&(B="+"),B===j[0])O.push(j),P.index++;else break}return O}function E(P,O){for(var B=[],j=[],z=0,H=!1,Y=!1;z<O.length&&P.index<P.lines.length;){var X=P.lines[P.index],Q=O[z];if(Q[0]==="+")break;if(H=H||X[0]!==" ",j.push(Q),z++,X[0]==="+")for(Y=!0;X[0]==="+";)B.push(X),X=P.lines[++P.index];Q.substr(1)===X.substr(1)?(B.push(X),P.index++):Y=!0}if((O[z]||"")[0]==="+"&&H&&(Y=!0),Y)return B;for(;z<O.length;)j.push(O[z++]);return{merged:j,changes:B}}function A(P){return P.reduce(function(O,B){return O&&B[0]==="-"},!0)}function M(P,O,B){for(var j=0;j<B;j++){var z=O[O.length-B+j].substr(1);if(P.lines[P.index+j]!==" "+z)return!1}return P.index+=B,!0}function N(P){var O=0,B=0;return P.forEach(function(j){if(typeof j!="string"){var z=N(j.mine),H=N(j.theirs);O!==void 0&&(z.oldLines===H.oldLines?O+=z.oldLines:O=void 0),B!==void 0&&(z.newLines===H.newLines?B+=z.newLines:B=void 0)}else B!==void 0&&(j[0]==="+"||j[0]===" ")&&B++,O!==void 0&&(j[0]==="-"||j[0]===" ")&&O++}),{oldLines:O,newLines:B}}return PA}var bB={},Iwe;function S9t(){if(Iwe)return bB;Iwe=1,Object.defineProperty(bB,"__esModule",{value:!0}),bB.reversePatch=r;function i(s,o){var a=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);o&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(s,c).enumerable})),a.push.apply(a,l)}return a}function e(s){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{};o%2?i(Object(a),!0).forEach(function(l){n(s,l,a[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(a,l))})}return s}function n(s,o,a){return o in s?Object.defineProperty(s,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):s[o]=a,s}function r(s){return Array.isArray(s)?s.map(r).reverse():e(e({},s),{},{oldFileName:s.newFileName,oldHeader:s.newHeader,newFileName:s.oldFileName,newHeader:s.oldHeader,hunks:s.hunks.map(function(o){return{oldLines:o.newLines,oldStart:o.newStart,newLines:o.oldLines,newStart:o.oldStart,linedelimiters:o.linedelimiters,lines:o.lines.map(function(a){return a.startsWith("-")?"+".concat(a.slice(1)):a.startsWith("+")?"-".concat(a.slice(1)):a})}})})}return bB}var yB={},Twe;function x9t(){if(Twe)return yB;Twe=1,Object.defineProperty(yB,"__esModule",{value:!0}),yB.convertChangesToDMP=i;function i(e){for(var n=[],r,s,o=0;o<e.length;o++)r=e[o],r.added?s=1:r.removed?s=-1:s=0,n.push([s,r.value]);return n}return yB}var wB={},Rwe;function k9t(){if(Rwe)return wB;Rwe=1,Object.defineProperty(wB,"__esModule",{value:!0}),wB.convertChangesToXML=i;function i(n){for(var r=[],s=0;s<n.length;s++){var o=n[s];o.added?r.push("<ins>"):o.removed&&r.push("<del>"),r.push(e(o.value)),o.added?r.push("</ins>"):o.removed&&r.push("</del>")}return r.join("")}function e(n){var r=n;return r=r.replace(/&/g,"&amp;"),r=r.replace(/</g,"&lt;"),r=r.replace(/>/g,"&gt;"),r=r.replace(/"/g,"&quot;"),r}return wB}var Awe;function L9t(){return Awe||(Awe=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"Diff",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(i,"diffChars",{enumerable:!0,get:function(){return n.diffChars}}),Object.defineProperty(i,"diffWords",{enumerable:!0,get:function(){return r.diffWords}}),Object.defineProperty(i,"diffWordsWithSpace",{enumerable:!0,get:function(){return r.diffWordsWithSpace}}),Object.defineProperty(i,"diffLines",{enumerable:!0,get:function(){return s.diffLines}}),Object.defineProperty(i,"diffTrimmedLines",{enumerable:!0,get:function(){return s.diffTrimmedLines}}),Object.defineProperty(i,"diffSentences",{enumerable:!0,get:function(){return o.diffSentences}}),Object.defineProperty(i,"diffCss",{enumerable:!0,get:function(){return a.diffCss}}),Object.defineProperty(i,"diffJson",{enumerable:!0,get:function(){return l.diffJson}}),Object.defineProperty(i,"canonicalize",{enumerable:!0,get:function(){return l.canonicalize}}),Object.defineProperty(i,"diffArrays",{enumerable:!0,get:function(){return c.diffArrays}}),Object.defineProperty(i,"applyPatch",{enumerable:!0,get:function(){return u.applyPatch}}),Object.defineProperty(i,"applyPatches",{enumerable:!0,get:function(){return u.applyPatches}}),Object.defineProperty(i,"parsePatch",{enumerable:!0,get:function(){return d.parsePatch}}),Object.defineProperty(i,"merge",{enumerable:!0,get:function(){return h.merge}}),Object.defineProperty(i,"reversePatch",{enumerable:!0,get:function(){return f.reversePatch}}),Object.defineProperty(i,"structuredPatch",{enumerable:!0,get:function(){return p.structuredPatch}}),Object.defineProperty(i,"createTwoFilesPatch",{enumerable:!0,get:function(){return p.createTwoFilesPatch}}),Object.defineProperty(i,"createPatch",{enumerable:!0,get:function(){return p.createPatch}}),Object.defineProperty(i,"formatPatch",{enumerable:!0,get:function(){return p.formatPatch}}),Object.defineProperty(i,"convertChangesToDMP",{enumerable:!0,get:function(){return g.convertChangesToDMP}}),Object.defineProperty(i,"convertChangesToXML",{enumerable:!0,get:function(){return m.convertChangesToXML}});var e=_(rw()),n=f9t(),r=p9t(),s=xce(),o=g9t(),a=m9t(),l=_9t(),c=v9t(),u=y9t(),d=kce(),h=C9t(),f=S9t(),p=h4e(),g=x9t(),m=k9t();function _(b){return b&&b.__esModule?b:{default:b}}}(hY)),hY}var Nwe;function D9t(){if(Nwe)return zc;Nwe=1;var i=zc&&zc.__createBinding||(Object.create?function(d,h,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(h,f);(!g||("get"in g?!h.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return h[f]}}),Object.defineProperty(d,p,g)}:function(d,h,f,p){p===void 0&&(p=f),d[p]=h[f]}),e=zc&&zc.__setModuleDefault||(Object.create?function(d,h){Object.defineProperty(d,"default",{enumerable:!0,value:h})}:function(d,h){d.default=h}),n=zc&&zc.__importStar||function(d){if(d&&d.__esModule)return d;var h={};if(d!=null)for(var f in d)f!=="default"&&Object.prototype.hasOwnProperty.call(d,f)&&i(h,d,f);return e(h,d),h};Object.defineProperty(zc,"__esModule",{value:!0}),zc.computeLineInformation=zc.DiffMethod=zc.DiffType=void 0;const r=n(L9t()),s=r;var o;(function(d){d[d.DEFAULT=0]="DEFAULT",d[d.ADDED=1]="ADDED",d[d.REMOVED=2]="REMOVED",d[d.CHANGED=3]="CHANGED"})(o||(zc.DiffType=o={}));var a;(function(d){d.CHARS="diffChars",d.WORDS="diffWords",d.WORDS_WITH_SPACE="diffWordsWithSpace",d.LINES="diffLines",d.TRIMMED_LINES="diffTrimmedLines",d.SENTENCES="diffSentences",d.CSS="diffCss",d.JSON="diffJson"})(a||(zc.DiffMethod=a={}));const l=d=>d===""?[]:d.replace(/\n$/,"").split(`
`),c=(d,h,f=a.CHARS)=>{const p=s[f](d,h),g={left:[],right:[]};return p.forEach(({added:m,removed:_,value:b})=>{const y={};return m&&(y.type=o.ADDED,y.value=b,g.right.push(y)),_&&(y.type=o.REMOVED,y.value=b,g.left.push(y)),!_&&!m&&(y.type=o.DEFAULT,y.value=b,g.right.push(y),g.left.push(y)),y}),g},u=(d,h,f=!1,p=a.CHARS,g=0,m=[])=>{let _=[];typeof d=="string"&&typeof h=="string"?_=r.diffLines(d.trimRight(),h.trimRight(),{newlineIsToken:!1,ignoreWhitespace:!1,ignoreCase:!1}):_=r.diffJson(d,h);let b=g,y=g,x=[],k=0;const D=[],R=[],E=(A,M,N,P,O)=>l(A).map((j,z)=>{const H={},Y={};if(!(R.includes(`${M}-${z}`)||O&&z!==0)){if(N||P){let X=!0;if(P){y+=1,H.lineNumber=y,H.type=o.REMOVED,H.value=j||" ";const Q=_[M+1];if(Q&&Q.added){const ie=l(Q.value)[z];if(ie){const K=E(ie,M,!0,!1,!0),{value:ee,lineNumber:le,type:ke}=K[0].right;if(R.push(`${M+1}-${z}`),Y.lineNumber=le,H.value===ee)X=!1,Y.type=0,H.type=0,Y.value=ee;else if(Y.type=ke,f)Y.value=ee;else{const xe=c(j,ee,p);Y.value=xe.right,H.value=xe.left}}}}else b+=1,Y.lineNumber=b,Y.type=o.ADDED,Y.value=j;X&&!O&&(D.includes(k)||D.push(k))}else y+=1,b+=1,H.lineNumber=y,H.type=o.DEFAULT,H.value=j,Y.lineNumber=b,Y.type=o.DEFAULT,Y.value=j;return(m!=null&&m.includes(`L-${H.lineNumber}`)||m!=null&&m.includes(`R-${Y.lineNumber}`)&&!D.includes(k))&&D.push(k),O||(k+=1),{right:Y,left:H}}}).filter(Boolean);return _.forEach(({added:A,removed:M,value:N},P)=>{x=[...x,...E(N,P,A,M)]}),{lineInformation:x,diffLines:D}};return zc.computeLineInformation=u,zc}var zb={};function Mwe(i,e){if(i.inserted[e.name]===void 0)return i.insert("",e,i.sheet,!0)}function Pwe(i,e,n){var r=[],s=lW(i,r,n);return r.length<2?n:s+e(r)}var E9t=function(e){var n=wre(e);n.sheet.speedy=function(l){this.isSpeedy=l},n.compat=!0;var r=function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];var h=My(u,n.registered,void 0);return cW(n,h,!1),n.key+"-"+h.name},s=function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];var h=My(u,n.registered),f="animation-"+h.name;return Mwe(n,{name:h.name,styles:"@keyframes "+f+"{"+h.styles+"}"}),f},o=function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];var h=My(u,n.registered);Mwe(n,h)},a=function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];return Pwe(n.registered,r,I9t(u))};return{css:r,cx:a,injectGlobal:o,keyframes:s,hydrate:function(c){c.forEach(function(u){n.inserted[u]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:lW.bind(null,n.registered),merge:Pwe.bind(null,n.registered,r)}},I9t=function i(e){for(var n="",r=0;r<e.length;r++){var s=e[r];if(s!=null){var o=void 0;switch(typeof s){case"boolean":break;case"object":{if(Array.isArray(s))o=i(s);else{o="";for(var a in s)s[a]&&a&&(o&&(o+=" "),o+=a)}break}default:o=s}o&&(n&&(n+=" "),n+=o)}}return n};const T9t=Object.freeze(Object.defineProperty({__proto__:null,default:E9t},Symbol.toStringTag,{value:"Module"})),R9t=a_(T9t);var Owe;function A9t(){if(Owe)return zb;Owe=1;var i=zb&&zb.__rest||function(r,s){var o={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&s.indexOf(a)<0&&(o[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(r);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(r,a[l])&&(o[a[l]]=r[a[l]]);return o},e=zb&&zb.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zb,"__esModule",{value:!0});const n=e(R9t);return zb.default=(r,s=!1,o="")=>{const{variables:a={}}=r,l=i(r,["variables"]),c={light:Object.assign({diffViewerBackground:"#fff",diffViewerColor:"#212529",addedBackground:"#e6ffed",addedColor:"#24292e",removedBackground:"#ffeef0",removedColor:"#24292e",changedBackground:"#fffbdd",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0",addedGutterBackground:"#cdffd8",removedGutterBackground:"#ffdce0",gutterBackground:"#f7f7f7",gutterBackgroundDark:"#f3f1f1",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1",codeFoldGutterBackground:"#dbedff",codeFoldBackground:"#f1f8ff",emptyLineBackground:"#fafbfc",gutterColor:"#212529",addedGutterColor:"#212529",removedGutterColor:"#212529",codeFoldContentColor:"#212529",diffViewerTitleBackground:"#fafbfc",diffViewerTitleColor:"#212529",diffViewerTitleBorderColor:"#eee"},a.light||{}),dark:Object.assign({diffViewerBackground:"#2e303c",diffViewerColor:"#FFF",addedBackground:"#044B53",addedColor:"white",removedBackground:"#632F34",removedColor:"white",changedBackground:"#3e302c",wordAddedBackground:"#055d67",wordRemovedBackground:"#7d383f",addedGutterBackground:"#034148",removedGutterBackground:"#632b30",gutterBackground:"#2c2f3a",gutterBackgroundDark:"#262933",highlightBackground:"#2a3967",highlightGutterBackground:"#2d4077",codeFoldGutterBackground:"#21232b",codeFoldBackground:"#262831",emptyLineBackground:"#363946",gutterColor:"#666c87",addedGutterColor:"#8c8c8c",removedGutterColor:"#8c8c8c",codeFoldContentColor:"#656a8b",diffViewerTitleBackground:"#2f323e",diffViewerTitleColor:"#555a7b",diffViewerTitleBorderColor:"#353846"},a.dark||{})},u=s?c.dark:c.light,{css:d,cx:h}=(0,n.default)({key:"react-diff",nonce:o}),f=d({width:"100%",label:"content"}),p=d({[`.${f}`]:{width:"50%"},label:"split-view"}),g=d({width:"100%",background:u.diffViewerBackground,pre:{margin:0,whiteSpace:"pre-wrap",lineHeight:"25px"},label:"diff-container",borderCollapse:"collapse"}),m=d({color:u.codeFoldContentColor,label:"code-fold-content"}),_=d({color:u.diffViewerColor,label:"content-text"}),b=d({background:u.diffViewerTitleBackground,padding:10,borderBottom:`1px solid ${u.diffViewerTitleBorderColor}`,label:"title-block",":last-child":{borderLeft:`1px solid ${u.diffViewerTitleBorderColor}`},[`.${_}`]:{color:u.diffViewerTitleColor}}),y=d({color:u.gutterColor,label:"line-number"}),x=d({background:u.removedBackground,color:u.removedColor,pre:{color:u.removedColor},[`.${y}`]:{color:u.removedGutterColor},label:"diff-removed"}),k=d({background:u.addedBackground,color:u.addedColor,pre:{color:u.addedColor},[`.${y}`]:{color:u.addedGutterColor},label:"diff-added"}),D=d({background:u.changedBackground,[`.${y}`]:{color:u.gutterColor},label:"diff-changed"}),R=d({padding:2,display:"inline-flex",borderRadius:4,wordBreak:"break-all",label:"word-diff"}),E=d({background:u.wordAddedBackground,label:"word-added"}),A=d({background:u.wordRemovedBackground,label:"word-removed"}),M=d({backgroundColor:u.codeFoldGutterBackground,label:"code-fold-gutter"}),N=d({backgroundColor:u.codeFoldBackground,height:40,fontSize:14,fontWeight:700,label:"code-fold",a:{textDecoration:"underline !important",cursor:"pointer",pre:{display:"inline"}}}),P=d({backgroundColor:u.emptyLineBackground,label:"empty-line"}),O=d({width:25,paddingLeft:10,paddingRight:10,userSelect:"none",label:"marker",[`&.${k}`]:{pre:{color:u.addedColor}},[`&.${x}`]:{pre:{color:u.removedColor}}}),B=d({background:u.highlightBackground,label:"highlighted-line",[`.${E}, .${A}`]:{backgroundColor:"initial"}}),j=d({label:"highlighted-gutter"}),z=d({userSelect:"none",minWidth:50,padding:"0 10px",whiteSpace:"nowrap",label:"gutter",textAlign:"right",background:u.gutterBackground,"&:hover":{cursor:"pointer",background:u.gutterBackgroundDark,pre:{opacity:1}},pre:{opacity:.5},[`&.${k}`]:{background:u.addedGutterBackground},[`&.${x}`]:{background:u.removedGutterBackground},[`&.${j}`]:{background:u.highlightGutterBackground,"&:hover":{background:u.highlightGutterBackground}}}),H=d({"&:hover":{background:u.gutterBackground,cursor:"initial"},label:"empty-gutter"}),Y=d({verticalAlign:"baseline",label:"line"}),X={diffContainer:g,diffRemoved:x,diffAdded:k,diffChanged:D,splitView:p,marker:O,highlightedGutter:j,highlightedLine:B,gutter:z,line:Y,wordDiff:R,wordAdded:E,wordRemoved:A,codeFoldGutter:M,codeFold:N,emptyGutter:H,emptyLine:P,lineNumber:y,contentText:_,content:f,codeFoldContent:m,titleBlock:b},Q=Object.keys(l).reduce((ie,K)=>Object.assign(Object.assign({},ie),{[K]:d(l[K])}),{});return Object.keys(X).reduce((ie,K)=>Object.assign(Object.assign({},ie),{[K]:Q[K]?h(X[K],Q[K]):X[K]}),{})},zb}var FA={},Fwe;function N9t(){if(Fwe)return FA;Fwe=1,Object.defineProperty(FA,"__esModule",{value:!0}),FA.computeHiddenBlocks=void 0;function i(e,n,r){let s=0,o,a={},l=[];return e.forEach((c,u)=>{const d=n.some(h=>h>=u-r&&h<=u+r);!d&&o==null?(o={index:s,startLine:u,endLine:u,lines:1},l.push(o),a[u]=o.index,s++):d?o=void 0:(o.endLine=u,o.lines++,a[u]=o.index)}),{lineBlocks:a,blocks:l}}return FA.computeHiddenBlocks=i,FA}var Bwe=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function M9t(i,e){return!!(i===e||Bwe(i)&&Bwe(e))}function P9t(i,e){if(i.length!==e.length)return!1;for(var n=0;n<i.length;n++)if(!M9t(i[n],e[n]))return!1;return!0}function O9t(i,e){e===void 0&&(e=P9t);var n=null;function r(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];if(n&&n.lastThis===this&&e(s,n.lastArgs))return n.lastResult;var a=i.apply(this,s);return n={lastResult:a,lastArgs:s,lastThis:this},a}return r.clear=function(){n=null},r}const F9t=Object.freeze(Object.defineProperty({__proto__:null,default:O9t},Symbol.toStringTag,{value:"Module"})),B9t=a_(F9t);var jwe;function j9t(){return jwe||(jwe=1,function(i){var e=ap&&ap.__createBinding||(Object.create?function(m,_,b,y){y===void 0&&(y=b);var x=Object.getOwnPropertyDescriptor(_,b);(!x||("get"in x?!_.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return _[b]}}),Object.defineProperty(m,y,x)}:function(m,_,b,y){y===void 0&&(y=b),m[y]=_[b]}),n=ap&&ap.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),r=ap&&ap.__importStar||function(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var b in m)b!=="default"&&Object.prototype.hasOwnProperty.call(m,b)&&e(_,m,b);return n(_,m),_},s=ap&&ap.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(i,"__esModule",{value:!0}),i.DiffMethod=i.LineNumberPrefix=void 0;const o=Uxe(),a=r(B1()),l=s(AOe()),c=D9t();Object.defineProperty(i,"DiffMethod",{enumerable:!0,get:function(){return c.DiffMethod}});const u=s(A9t()),d=N9t(),h=B9t,f=h.default||h;var p;(function(m){m.LEFT="L",m.RIGHT="R"})(p||(i.LineNumberPrefix=p={}));class g extends a.Component{constructor(_){super(_),this.resetCodeBlocks=()=>this.state.expandedBlocks.length>0?(this.setState({expandedBlocks:[]}),!0):!1,this.onBlockExpand=b=>{const y=this.state.expandedBlocks.slice();y.push(b),this.setState({expandedBlocks:y})},this.computeStyles=f(u.default),this.onLineNumberClickProxy=b=>this.props.onLineNumberClick?y=>this.props.onLineNumberClick(b,y):()=>{},this.renderWordDiff=(b,y)=>b.map((x,k)=>(0,o.jsx)("span",{className:(0,l.default)(this.styles.wordDiff,{[this.styles.wordAdded]:x.type===c.DiffType.ADDED,[this.styles.wordRemoved]:x.type===c.DiffType.REMOVED}),children:y?y(x.value):x.value},k)),this.renderLine=(b,y,x,k,D,R)=>{const E=`${x}-${b}`,A=`${R}-${D}`,M=this.props.highlightLines.includes(E)||this.props.highlightLines.includes(A),N=y===c.DiffType.ADDED,P=y===c.DiffType.REMOVED,O=y===c.DiffType.CHANGED;let B;return Array.isArray(k)?B=this.renderWordDiff(k,this.props.renderContent):this.props.renderContent?B=this.props.renderContent(k):B=k,(0,o.jsxs)(a.Fragment,{children:[!this.props.hideLineNumbers&&(0,o.jsx)("td",{onClick:b&&this.onLineNumberClickProxy(E),className:(0,l.default)(this.styles.gutter,{[this.styles.emptyGutter]:!b,[this.styles.diffAdded]:N,[this.styles.diffRemoved]:P,[this.styles.diffChanged]:O,[this.styles.highlightedGutter]:M}),children:(0,o.jsx)("pre",{className:this.styles.lineNumber,children:b})}),!this.props.splitView&&!this.props.hideLineNumbers&&(0,o.jsx)("td",{onClick:D&&this.onLineNumberClickProxy(A),className:(0,l.default)(this.styles.gutter,{[this.styles.emptyGutter]:!D,[this.styles.diffAdded]:N,[this.styles.diffRemoved]:P,[this.styles.diffChanged]:O,[this.styles.highlightedGutter]:M}),children:(0,o.jsx)("pre",{className:this.styles.lineNumber,children:D})}),this.props.renderGutter?this.props.renderGutter({lineNumber:b,type:y,prefix:x,value:k,additionalLineNumber:D,additionalPrefix:R,styles:this.styles}):null,!this.props.hideMarkers&&(0,o.jsx)("td",{className:(0,l.default)(this.styles.marker,{[this.styles.emptyLine]:!B,[this.styles.diffAdded]:N,[this.styles.diffRemoved]:P,[this.styles.diffChanged]:O,[this.styles.highlightedLine]:M}),children:(0,o.jsxs)("pre",{children:[N&&"+",P&&"-"]})}),(0,o.jsx)("td",{className:(0,l.default)(this.styles.content,{[this.styles.emptyLine]:!B,[this.styles.diffAdded]:N,[this.styles.diffRemoved]:P,[this.styles.diffChanged]:O,[this.styles.highlightedLine]:M}),children:(0,o.jsx)("pre",{className:this.styles.contentText,children:B})})]})},this.renderSplitView=({left:b,right:y},x)=>(0,o.jsxs)("tr",{className:this.styles.line,children:[this.renderLine(b.lineNumber,b.type,p.LEFT,b.value),this.renderLine(y.lineNumber,y.type,p.RIGHT,y.value)]},x),this.renderInlineView=({left:b,right:y},x)=>{let k;return b.type===c.DiffType.REMOVED&&y.type===c.DiffType.ADDED?(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)("tr",{className:this.styles.line,children:this.renderLine(b.lineNumber,b.type,p.LEFT,b.value,null)}),(0,o.jsx)("tr",{className:this.styles.line,children:this.renderLine(null,y.type,p.RIGHT,y.value,y.lineNumber)})]},x):(b.type===c.DiffType.REMOVED&&(k=this.renderLine(b.lineNumber,b.type,p.LEFT,b.value,null)),b.type===c.DiffType.DEFAULT&&(k=this.renderLine(b.lineNumber,b.type,p.LEFT,b.value,y.lineNumber,p.RIGHT)),y.type===c.DiffType.ADDED&&(k=this.renderLine(null,y.type,p.RIGHT,y.value,y.lineNumber)),(0,o.jsx)("tr",{className:this.styles.line,children:k},x))},this.onBlockClickProxy=b=>()=>this.onBlockExpand(b),this.renderSkippedLineIndicator=(b,y,x,k)=>{const{hideLineNumbers:D,splitView:R}=this.props,E=this.props.codeFoldMessageRenderer?this.props.codeFoldMessageRenderer(b,x,k):(0,o.jsxs)("pre",{className:this.styles.codeFoldContent,children:["Expand ",b," lines ..."]}),A=(0,o.jsx)("td",{children:(0,o.jsx)("a",{onClick:this.onBlockClickProxy(y),tabIndex:0,children:E})}),M=!R&&!D;return(0,o.jsxs)("tr",{className:this.styles.codeFold,children:[!D&&(0,o.jsx)("td",{className:this.styles.codeFoldGutter}),this.props.renderGutter?(0,o.jsx)("td",{className:this.styles.codeFoldGutter}):null,(0,o.jsx)("td",{className:(0,l.default)({[this.styles.codeFoldGutter]:M})}),M?(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)("td",{}),A]}):(0,o.jsxs)(a.Fragment,{children:[A,this.props.renderGutter?(0,o.jsx)("td",{}):null,(0,o.jsx)("td",{})]}),(0,o.jsx)("td",{}),(0,o.jsx)("td",{})]},`${x}-${k}`)},this.renderDiff=()=>{const{oldValue:b,newValue:y,splitView:x,disableWordDiff:k,compareMethod:D,linesOffset:R}=this.props,{lineInformation:E,diffLines:A}=(0,c.computeLineInformation)(b,y,k,D,R,this.props.alwaysShowLines),M=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:N,blocks:P}=(0,d.computeHiddenBlocks)(E,A,M);return E.map((O,B)=>{if(this.props.showDiffOnly){const z=N[B];if(z!==void 0){const H=P[z].endLine===B;if(!this.state.expandedBlocks.includes(z)&&H)return(0,o.jsx)(a.Fragment,{children:this.renderSkippedLineIndicator(P[z].lines,z,O.left.lineNumber,O.right.lineNumber)},B);if(!this.state.expandedBlocks.includes(z))return null}}return x?this.renderSplitView(O,B):this.renderInlineView(O,B)})},this.render=()=>{const{oldValue:b,newValue:y,useDarkTheme:x,leftTitle:k,rightTitle:D,splitView:R,hideLineNumbers:E,hideMarkers:A,nonce:M}=this.props;if(this.props.compareMethod!==c.DiffMethod.JSON&&(typeof b!="string"||typeof y!="string"))throw Error('"oldValue" and "newValue" should be strings');this.styles=this.computeStyles(this.props.styles,x,M);const N=this.renderDiff();let P=E?2:3,O=E?2:4;A&&(P-=1,O-=1);const B=this.props.renderGutter?1:0,j=(k||D)&&(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{colSpan:(R?P:O)+B,className:this.styles.titleBlock,children:(0,o.jsx)("pre",{className:this.styles.contentText,children:k})}),R&&(0,o.jsx)("td",{colSpan:P+B,className:this.styles.titleBlock,children:(0,o.jsx)("pre",{className:this.styles.contentText,children:D})})]});return(0,o.jsx)("table",{className:(0,l.default)(this.styles.diffContainer,{[this.styles.splitView]:R}),children:(0,o.jsxs)("tbody",{children:[j,N]})})},this.state={expandedBlocks:[]}}}g.defaultProps={oldValue:"",newValue:"",splitView:!0,highlightLines:[],disableWordDiff:!1,compareMethod:c.DiffMethod.CHARS,styles:{},hideLineNumbers:!1,hideMarkers:!1,extraLinesSurroundingDiff:3,showDiffOnly:!0,useDarkTheme:!1,linesOffset:0,nonce:""},i.default=g}(ap)),ap}var W9t=j9t();const $9t=ql(W9t),Lce=$.memo(({point:i,open:e,onClose:n,onSave:r,setLoading:s})=>{const o=Ur().client,{enqueueSnackbar:a,closeSnackbar:l}=pu(),c=as("error",l,6e3),u=as("success",l,2e3),[d,h]=$.useState(()=>ls.stringify(i.payload,null,2)),[f,p]=$.useState(!1),g=$i(),{collectionName:m}=V1(),_=async(k,D)=>Object.keys(i.payload).length!==0?o.overwritePayload(k,D):o.setPayload(k,D),b=k=>{h(k)},y=()=>{let k;try{k=ls.parse(d)}catch(D){a(D.message,c);return}if(fwe(i.payload,k)){n();return}p(!0)},x=()=>{let k;try{k=ls.parse(d)}catch(R){a(R.message,c);return}if(fwe(i.payload,k)){n();return}s(!0);const D=structuredClone(i.payload);_(m,{payload:k,points:[i.id],wait:!0}).then(R=>{r&&R.status==="completed"&&(r(k),a("Payload saved",u))}).catch(R=>{r&&r(D),a(R.message,c)}).finally(()=>{s(!1),p(!1)}),n()};return C.jsxs(C.Fragment,{children:[C.jsxs(Vm,{open:e,onClose:n,fullWidth:!0,maxWidth:"md",children:[C.jsx(tx,{sx:{display:"flex",justifyContent:"space-between"},children:C.jsxs(C.Fragment,{children:["Edit payload for point ",i.id]})}),C.jsx(a1,{sx:{pb:1},children:C.jsx(h4,{height:"360px",language:"json",value:ls.stringify(i.payload,null,2),onChange:b,options:{scrollBeyondLastLine:!1,fontSize:12,wordWrap:"on",minimap:{enabled:!1},automaticLayout:!0,quickSuggestions:{other:!1,comments:!1,strings:!1},parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1,acceptSuggestionOnEnter:"off",tabCompletion:"off",wordBasedSuggestions:!1,padding:{top:16,bottom:16}}})}),C.jsxs(CE,{sx:{p:3},children:[C.jsx(Ci,{onClick:n,color:"inherit",variant:"outlined",sx:{mr:1},children:"Cancel"}),C.jsx(Ci,{onClick:y,color:"primary",variant:"contained",children:"Save"})]})]}),C.jsxs(Vm,{open:f,onClose:()=>p(!1),fullWidth:!0,maxWidth:"lg",children:[C.jsx(tx,{children:C.jsx(C.Fragment,{children:"Confirm to save payload changes"})}),C.jsx(a1,{sx:{scrollbarWidth:"thin",scrollbarColor:`${g.palette.nativeScrollbarBg} transparent`,"& *::-webkit-scrollbar":{width:"4px",height:"4px"},"& *::-webkit-scrollbar-track":{background:"transparent"},"& *::-webkit-scrollbar-thumb":{background:`${g.palette.nativeScrollbarBg}`,borderRadius:"2px"}},children:C.jsx($9t,{oldValue:ls.stringify(i.payload,null,2),newValue:d,splitView:!0,useDarkTheme:g.palette.mode==="dark",styles:{diffContainer:{fontSize:"12px"},wordDiff:{padding:"0px",wordBreak:"normal"}}})}),C.jsxs(CE,{children:[C.jsx(Ci,{onClick:()=>p(!1),color:"inherit",variant:"outlined",sx:{mr:1},children:"Cancel"}),C.jsx(Ci,{onClick:x,color:"primary",variant:"contained",children:"Confirm"})]})]})]})});Lce.propTypes={point:Z.object.isRequired,open:Z.bool.isRequired,onClose:Z.func.isRequired,onSave:Z.func,setLoading:Z.func.isRequired};Lce.displayName="PayloadEditor";const Dce=({point:i,showImage:e=!0,onPayloadEdit:n,setLoading:r,buttonsToShow:s=["copy","edit"]})=>{const[o,a]=$.useState(!1);return!i||!i.payload||Object.keys(i.payload).length===0?null:C.jsxs(C.Fragment,{children:[C.jsxs(Ye,{display:"flex",justifyContent:"space-between","aria-label":"Point Payload",children:[C.jsxs(Ye,{children:[C.jsxs(Ye,{display:"flex",alignItems:"center",gap:1,children:[C.jsx(Je,{variant:"subtitle2",marginRight:"24px",children:"Payload"}),s.includes("copy")&&C.jsx(p_,{text:ls.stringify(i.payload),tooltip:"Copy payload to clipboard",successMessage:"Payload JSON copied to clipboard."}),s.includes("edit")&&C.jsx(ua,{title:"Edit payload",placement:"left",children:C.jsx(Ga,{"aria-label":"add payload",onClick:()=>a(!0),sx:{color:"text.primary"},children:C.jsx(Stt,{size:"1.25rem"})})})]}),C.jsx(vce,{value:i.payload,displayDataTypes:!1,defaultInspectDepth:2,displayObjectSize:!1,rootName:!1,enableClipboard:!1})]}),e&&i.payload&&C.jsx(wce,{data:i.payload})]}),C.jsx(Lce,{point:i,open:o,onClose:()=>a(!1),onSave:n,setLoading:r||(()=>{}),"aria-label":"Payload Editor"})]})};Dce.propTypes={point:Z.object.isRequired,showImage:Z.bool,onPayloadEdit:Z.func.isRequired,setLoading:Z.func,buttonsToShow:Z.array};const f4e=i=>{const{onConditionChange:e}=i,[n,r]=nn.useState(i.point),[s,o]=nn.useState(!1),[a,l]=nn.useState(!1),c=d=>{r({...n,payload:structuredClone(d)})},u=async()=>{o(!0),i.deletePoint(i.collectionName,[n.id]).then(()=>{r(null),o(!1)})};return n?C.jsxs(C.Fragment,{children:[C.jsxs(Fv,{elevation:0,sx:{display:"flex",flexDirection:"column",height:"100%",position:"relative"},role:"listitem",children:[s&&C.jsx(Ye,{sx:{position:"absolute",left:0,right:0,top:0},children:C.jsx(AW,{})}),C.jsx(h5,{title:"Point "+n.id,variant:"heading","aria-label":"Point Card Header",action:C.jsxs(C.Fragment,{children:[C.jsx(p_,{text:ls.stringify(n),tooltip:"Copy point to clipboard",successMessage:"Point JSON copied to clipboard."}),C.jsx(ua,{title:"Delete point",placement:"left",children:C.jsx(Ga,{"aria-label":"delete point",onClick:()=>{l(!0)},sx:{color:"text.primary"},children:C.jsx(vse,{size:"1.25rem"})})})]})}),Object.keys(n.payload).length>0&&C.jsx(C.Fragment,{children:C.jsx(ex,{sx:{padding:"0.5rem 1rem"},children:C.jsx(Dce,{point:n,onPayloadEdit:c,setLoading:o})})}),C.jsx(SE,{}),C.jsx(ex,{sx:{padding:"1rem"},children:(n==null?void 0:n.vector)&&C.jsx(yce,{point:n,onConditionChange:e})})]}),C.jsx(x4,{open:a,onClose:()=>l(!1),title:"Delete point "+n.id,content:`Are you sure you want to delete point with id ${n.id}?`,warning:"This action cannot be undone.",actionName:"Delete",actionHandler:()=>u(),"aria-label":"Delete Point Confirmation Dialog"})]}):null};f4e.propTypes={point:Z.object.isRequired,onConditionChange:Z.func.isRequired,conditions:Z.array.isRequired,collectionName:Z.string.isRequired,deletePoint:Z.func.isRequired,payloadSchema:Z.object.isRequired,client:Z.object};const z9t=i=>{var e,n,r,s;return!((n=(e=i==null?void 0:i.config)==null?void 0:e.params.vectors)!=null&&n.size)&&HPe.isObject((s=(r=i==null?void 0:i.config)==null?void 0:r.params)==null?void 0:s.vectors)},p4e=i=>{var e,n,r,s;return z9t(i)?(n=(e=i==null?void 0:i.config)==null?void 0:e.params)==null?void 0:n.vectors:{"":(s=(r=i==null?void 0:i.config)==null?void 0:r.params)==null?void 0:s.vectors}},g4e=({collectionName:i,client:e})=>{var R,E;const[r,s]=$.useState(null),[o,a]=$.useState(null),[l,c]=$.useState(null),[u,d]=$.useState([]),h=e||Ur().client,[f,p]=$.useState(null),[g,m]=$.useState(null),[_,b]=$.useState({}),[y,x]=$.useState([]),k=(A,M)=>{M&&m(M),a(null),d(A),s({points:[]})},D=(A,M)=>h.delete(A,{points:M}).catch(N=>{console.log(N);const P=z8(N,{withApiKey:{apiKey:h.getApiKey()}});P&&c(P)});return $.useEffect(()=>{(async()=>{const M=await h.getCollection(i),N=[],P=p4e(M);Object.keys(P).map(O=>{O!==""&&typeof P[O]=="object"&&N.push(O)}),x(N),b(M.payload_schema)})()},[]),$.useEffect(()=>{(async()=>{if(u.length!==0){const M=[],N=[];u.forEach(P=>{P.type==="id"?M.push(P.value):P.type==="payload"&&(P.value===null||P.value===void 0?N.push({is_null:{key:P.key}}):P.value===""?N.push({is_empty:{key:P.key}}):_[P.key]&&_[P.key].data_type==="text"?N.push({key:P.key,match:{text:P.value}}):N.push({key:P.key,match:{value:P.value}}))});try{if(M.length!==0){const P=await h.recommend(i,{positive:M,limit:10+(o||0),with_payload:!0,with_vector:!0,using:g,filter:{must:N}});p(P.length),s({points:P}),c(null)}else if(N.length!==0){const P=await h.scroll(i,{offset:o,filter:{must:N},limit:10,with_payload:!0,with_vector:!0});s({points:[...(r==null?void 0:r.points)||[],...(P==null?void 0:P.points)||[]]}),p(P==null?void 0:P.next_page_offset),c(null)}}catch(P){const O=z8(P,{withApiKey:{apiKey:h.getApiKey()}});O&&c(O),s({})}}else try{const M=await h.scroll(i,{offset:o,limit:10,with_vector:!0,with_payload:!0});s({points:[...(r==null?void 0:r.points)||[],...(M==null?void 0:M.points)||[]]}),p(M==null?void 0:M.next_page_offset),c(null)}catch(M){const N=z8(M,{withApiKey:{apiKey:h.getApiKey()}});N&&c(N),s({})}})()},[i,o,u]),C.jsxs(ln,{container:!0,spacing:3,role:"list","aria-label":"Collection Points",children:[l!==null&&C.jsx(g4,{message:l}),u&&Object.keys(u).length>0&&C.jsx(ln,{size:12,children:C.jsx(n4e,{conditions:u,onConditionChange:k,vectors:y,usingVector:g})}),l&&C.jsx(ln,{textAlign:"center",size:12,children:C.jsxs(Je,{children:["⚠ Error: ",l]})}),!r&&!l&&C.jsx(ln,{textAlign:"center",size:12,role:"progressbar","aria-label":"Loading Points",children:C.jsx(Je,{children:" 🔃 Loading..."})}),r&&!l&&((R=r.points)==null?void 0:R.length)===0&&C.jsx(ln,{textAlign:"center",size:12,role:"alert","aria-label":"No Points",children:C.jsxs(Je,{children:["📪 No Points are present, ",i," is empty"]})}),r&&!l&&((E=r.points)==null?void 0:E.map(A=>C.jsx(ln,{size:12,children:C.jsx(f4e,{point:A,onConditionChange:k,conditions:u,collectionName:i,deletePoint:D,payloadSchema:_,client:e})},A.id))),C.jsx(ln,{textAlign:"center",size:12,children:C.jsx(Ci,{variant:"outlined",disabled:!r||!f,onClick:()=>{a(f)},children:"Load More"})})]})};g4e.propTypes={collectionName:Z.string.isRequired,client:Z.object};const V9t=async(i,e,n,r,s,o,a=null,l=null,c=null,u=10,d=20)=>{try{const h=new Date().getTime(),f=await i.query(e,{limit:u,with_payload:!1,with_vectors:!1,query:n,params:{exact:!0},filter:a,using:c,timeout:d}),p=new Date().getTime()-h,g=new Date().getTime(),m=await i.query(e,{timeout:d,limit:u,with_payload:!1,with_vectors:!1,query:n,params:l,filter:a,using:c}),_=new Date().getTime()-g,b=f.points.map(k=>k.id),y=m.points.map(k=>k.id),x=b.filter(k=>y.includes(k)).length/b.length;return r&&r("Point ID "+s+"("+s+"/"+o+") precision@"+u+": "+x+" (search time exact: "+p+"ms, regular: "+_+"ms)"),x}catch(h){return console.error("Error: ",h),console.error("Skipping point: ",s),null}},H9t={scrollBeyondLastLine:!1,readOnly:!1,fontSize:12,wordWrap:"on",minimap:{enabled:!1},automaticLayout:!0,mouseWheelZoom:!0,glyphMargin:!0,wordBasedSuggestions:!1};function U9t(i){return{provideCodeLenses:function(e){const n=m4e(e.getValue()),r=[];for(let s=0;s<n.length;++s)r.push({range:{startLineNumber:n[s].blockStartLine,startColumn:1,endLineNumber:n[s].blockStartLine,endColumn:1},id:"RUN",command:{id:i,title:"RUN",arguments:[n[s].blockText]}});return{lenses:r,dispose:()=>{}}},resolveCodeLens:function(e,n){return n}}}function q9t(i,e){for(let n=0;n<i.length;++n)if(i[n].blockStartLine<=e&&e<=i[n].blockEndLine)return i[n];return null}function m4e(i){const e=i.replace(/\/\/.*$/gm,"").split(/\r?\n/),n=[];let r={blockText:"",blockStartLine:null,blockEndLine:null},s=0,o=0,a=0;for(let l=0;l<e.length;++l)e[l].includes("{")&&(s===0&&(o=l+1),s=s+e[l].match(/{/gi).length),e[l].includes("}")&&(s=s-e[l].match(/}/gi).length,s===0&&(a=l+1)),o&&(r.blockStartLine=o,r.blockText=r.blockText+e[l]+`
`,a&&(r.blockEndLine=a,n.push(r),a=0,o=0,r={blockText:"",blockStartLine:null,blockEndLine:null}));return n}const K9t=async(i,e,n,r)=>{const o=await(await fetch("/dashboard/./openapi.json")).json(),a=[];try{const c=await e.getCollection(n);Object.keys(c.config.params.vectors).map(u=>{typeof c.config.params.vectors[u]=="object"&&a.push(u)})}catch(c){console.error(c)}o.components.schemas.CustomRequest=r(a);const l=new n2e(o,[]);return{provideCompletionItems:(c,u)=>{const d=i.editor.selectedCodeBlock;if(!d)return{suggestions:[]};const h=u.lineNumber-d.blockStartLine;if(h<0)return{suggestions:[]};if(h>0){const f=d.blockText.split(/\r?\n/),p=f[h].slice(0,u.column),g=f.slice(0,h);g.push(p);const m=g.join(`
`);let _=l.completeRequestBodyByDataRef("#/components/schemas/CustomRequest",m);return _=_.map(b=>({label:b,kind:17,insertText:b})),{suggestions:_}}}}},MV=({onChange:i,code:e,onChangeResult:n,customRequestSchema:r,customHeight:s=null})=>{const{enqueueSnackbar:o}=pu(),a=$.useRef(null),l=$.useRef(null),c=$.useRef(null),{collectionName:u}=V1(),{client:d}=Ur();let h=null;const f=$i();$.useEffect(()=>()=>{var b,y;(b=l.current)==null||b.dispose(),(y=c.current)==null||y.dispose()},[]);function p(b){if(b)try{return ls.parse(b)}catch{return{reqBody:b,error:"Fix the position brackets to run & check the json"}}}function g(b){const y=p(b);if(y.error)return o(`Visualization Unsuccessful, error: ${JSON.stringify(y.error)}`,{variant:"error"}),y;n(y,u)}function m(b,y){a.current=b;let x=[];h=b.addCommand(0,async(k,...D)=>{g(D[0])},""),l.current=y.languages.registerCodeLensProvider("custom-language",U9t(h)),b.onDidChangeCursorPosition(()=>{const k=b.getValue(),D=m4e(k),R=q9t(D,b.getPosition().lineNumber);if(y.editor.selectedCodeBlock=R,R){const E=R.blockStartLine,A=R.blockEndLine;x=b.deltaDecorations([x[0]],[{range:new y.Range(E,0,A,3),options:{className:(f.palette.mode==="dark","blockSelector"),glyphMarginClassName:(f.palette.mode==="dark","blockSelectorStrip"),isWholeLine:!0}}]),b.addCommand(y.KeyMod.CtrlCmd+y.KeyCode.Enter,async()=>{const M=R.blockText;g(M)})}})}function _(b){K9t(b,d,u,r).then(y=>{c.current=b.languages.registerCompletionItemProvider("custom-language",y)})}return C.jsx(h4,{customHeight:s,language:"custom-language",value:e,theme:"custom-language-theme",defaultValue:"//input",onChange:i,onMount:m,beforeMount:_,formatOnPaste:!0,autoIndent:!0,formatOnType:!0,options:H9t})};MV.propTypes={onChange:Z.func.isRequired,code:Z.string.isRequired,onChangeResult:Z.func.isRequired,customRequestSchema:Z.func.isRequired,customHeight:Z.oneOfType([Z.number,Z.string])};const _4e=({vectorObj:i,name:e,onCheckIndexQuality:n,precision:r,isInProgress:s})=>C.jsxs(ng,{"data-testid":"vector-row",children:[C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",component:"span",color:"text.secondary",children:e==""?"—":e})}),C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",component:"span",color:"text.secondary",children:i.size})}),C.jsx(ki,{children:C.jsx(Je,{variant:"subtitle1",component:"span",color:"text.secondary",children:i.distance})}),C.jsxs(ki,{children:[s&&C.jsx(AW,{}),!s&&C.jsxs(Ye,{display:"flex",alignItems:"center",gap:1.5,children:[C.jsx(Je,{variant:"subtitle1",component:"span",color:"text.secondary",children:r?`${r*100}%`:"—"}),C.jsx(Ci,{variant:"contained",size:"small","aria-label":"Check index quality","data-testid":"index-quality-check-button",onClick:n,startIcon:C.jsx(Att,{size:18}),children:"Check Index Quality"})]})]})]});_4e.propTypes={vectorObj:Z.object,name:Z.string,onCheckIndexQuality:Z.func,precision:Z.number,isInProgress:Z.bool};const v4e=({collectionName:i,vectors:e,loggingFoo:n,clearLogsFoo:r,...s})=>{const{client:o}=Ur(),a=Object.keys(e),[l,c]=$.useState(()=>a?a.reduce((y,x)=>(y[x]=null,y),{}):null),[u,d]=$.useState(!1),[h,f]=$.useState(!1),[p,g]=$.useState(`
// Run this code to estimate search quality versus exact search
{
"limit": 10,
"params": {
"hnsw_ef": 128
}
}
// You can specify filters and different vector fields
// {
// "limit": 100,
// "using": "vector_name",
// "filter": {
// "must": {
// "key": "field_name",
// "match": {
// "value": "field_value"
// }
// }
// },
// "timeout": 20
// }
`),m=y=>({description:"Filter request",type:"object",properties:{limit:{description:"Page size. Default: 10",type:"integer",format:"uint",minimum:1,nullable:!0},filter:{description:"Look only for points which satisfies this conditions. If not provided - all points.",anyOf:[{$ref:"#/components/schemas/Filter"},{nullable:!0}]},using:{description:"Vector field name",type:"string",enum:y},params:{description:"Additional search params",anyOf:[{$ref:"#/components/schemas/SearchParams"},{nullable:!0}]},timeout:{description:"Timeout for search",type:"integer",format:"uint",minimum:1,nullable:!0}}});if(!e)return C.jsx(C.Fragment,{children:"No vectors"});const _=async({using:y="",limit:x=10,params:k=null,filter:D=null,timeout:R})=>{f(!0),r&&r();const E=[];try{const M=(await o.scroll(i,{with_payload:!1,with_vector:!1,limit:x})).points.map(j=>j.id),N=M.length;n&&n("Starting measuring quality on "+N+" requests for "+y||"---");for(let j=0;j<N;j++){const z=M[j],H=await V9t(o,i,z,n,j,N,D,k,y,x,R);H&&E.push(H)}const P=j=>Math.round((j+Number.EPSILON)*1e4)/1e4,O=P(E.reduce((j,z)=>j+z,0)/E.length),B=P(Math.sqrt(E.reduce((j,z)=>j+(z-O)**2,0)/E.length));n("Mean precision@"+x+" for collection: "+O+" ± "+B),c(j=>({...j,[y]:O})),f(!1)}catch(A){f(!1),console.error(A),n&&n(JSON.stringify(A))}},b=async y=>{_(y)};return C.jsxs(Fv,{elevation:0,"data-testid":"vectors-info",...s,children:[C.jsx(h5,{title:"Search Quality",variant:"heading",sx:{flexGrow:1},action:C.jsxs(C.Fragment,{children:[C.jsx(Qre,{sx:{mr:2},control:C.jsx(b9,{checked:u,onChange:()=>d(!u),size:"medium"}),label:C.jsx(Je,{component:"span",variant:"body1",children:"Advanced Mode"})}),C.jsx(p_,{text:u?p:ls.stringify(e)})]})}),!u&&C.jsxs(Bv,{children:[C.jsx(OW,{children:C.jsxs(ng,{sx:{"& th":{borderBottom:"none"}},children:[C.jsx(ki,{sx:{width:"25%"},children:C.jsx(Je,{variant:"subtitle1",fontWeight:600,children:"Vector Name"})}),C.jsx(ki,{sx:{width:"25%"},children:C.jsx(Je,{variant:"subtitle1",fontWeight:600,children:"Size"})}),C.jsx(ki,{sx:{width:"25%"},children:C.jsx(Je,{variant:"subtitle1",fontWeight:600,children:"Distance"})}),C.jsx(ki,{sx:{width:"25%"},children:C.jsx(Je,{variant:"subtitle1",fontWeight:600,children:"Precision"})})]})}),C.jsx(PW,{sx:{"& tr:last-of-type td":{borderBottom:"none"}},children:Object.keys(e).map(y=>C.jsx(_4e,{vectorObj:e[y],name:y,onCheckIndexQuality:()=>_({using:y}),precision:l?l[y]:null,isInProgress:h},y))})]}),u&&C.jsx(ex,{sx:{p:0,pt:1,height:"32vh"},"data-testid":"advanced-mod-editor",children:C.jsx(MV,{code:p,onChange:g,onChangeResult:b,customRequestSchema:m,customHeight:"31vh"})})]})};v4e.propTypes={collectionName:Z.string,vectors:Z.object.isRequired,loggingFoo:Z.func,clearLogsFoo:Z.func,other:Z.object};var G9t=Object.create,PV=Object.defineProperty,X9t=Object.defineProperties,Y9t=Object.getOwnPropertyDescriptor,Z9t=Object.getOwnPropertyDescriptors,b4e=Object.getOwnPropertyNames,Oj=Object.getOwnPropertySymbols,Q9t=Object.getPrototypeOf,Ece=Object.prototype.hasOwnProperty,y4e=Object.prototype.propertyIsEnumerable,Wwe=(i,e,n)=>e in i?PV(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n,Bm=(i,e)=>{for(var n in e||(e={}))Ece.call(e,n)&&Wwe(i,n,e[n]);if(Oj)for(var n of Oj(e))y4e.call(e,n)&&Wwe(i,n,e[n]);return i},OV=(i,e)=>X9t(i,Z9t(e)),w4e=(i,e)=>{var n={};for(var r in i)Ece.call(i,r)&&e.indexOf(r)<0&&(n[r]=i[r]);if(i!=null&&Oj)for(var r of Oj(i))e.indexOf(r)<0&&y4e.call(i,r)&&(n[r]=i[r]);return n},J9t=(i,e)=>function(){return e||(0,i[b4e(i)[0]])((e={exports:{}}).exports,e),e.exports},e7t=(i,e)=>{for(var n in e)PV(i,n,{get:e[n],enumerable:!0})},t7t=(i,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of b4e(e))!Ece.call(i,s)&&s!==n&&PV(i,s,{get:()=>e[s],enumerable:!(r=Y9t(e,s))||r.enumerable});return i},n7t=(i,e,n)=>(n=i!=null?G9t(Q9t(i)):{},t7t(!i||!i.__esModule?PV(n,"default",{value:i,enumerable:!0}):n,i)),i7t=J9t({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(i,e){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},a={util:{encode:function g(m){return m instanceof l?new l(m.type,g(m.content),m.alias):Array.isArray(m)?m.map(g):m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(g){return Object.prototype.toString.call(g).slice(8,-1)},objId:function(g){return g.__id||Object.defineProperty(g,"__id",{value:++s}),g.__id},clone:function g(m,_){_=_||{};var b,y;switch(a.util.type(m)){case"Object":if(y=a.util.objId(m),_[y])return _[y];b={},_[y]=b;for(var x in m)m.hasOwnProperty(x)&&(b[x]=g(m[x],_));return b;case"Array":return y=a.util.objId(m),_[y]?_[y]:(b=[],_[y]=b,m.forEach(function(k,D){b[D]=g(k,_)}),b);default:return m}},getLanguage:function(g){for(;g;){var m=r.exec(g.className);if(m)return m[1].toLowerCase();g=g.parentElement}return"none"},setLanguage:function(g,m){g.className=g.className.replace(RegExp(r,"gi"),""),g.classList.add("language-"+m)},isActive:function(g,m,_){for(var b="no-"+m;g;){var y=g.classList;if(y.contains(m))return!0;if(y.contains(b))return!1;g=g.parentElement}return!!_}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(g,m){var _=a.util.clone(a.languages[g]);for(var b in m)_[b]=m[b];return _},insertBefore:function(g,m,_,b){b=b||a.languages;var y=b[g],x={};for(var k in y)if(y.hasOwnProperty(k)){if(k==m)for(var D in _)_.hasOwnProperty(D)&&(x[D]=_[D]);_.hasOwnProperty(k)||(x[k]=y[k])}var R=b[g];return b[g]=x,a.languages.DFS(a.languages,function(E,A){A===R&&E!=g&&(this[E]=x)}),x},DFS:function g(m,_,b,y){y=y||{};var x=a.util.objId;for(var k in m)if(m.hasOwnProperty(k)){_.call(m,k,m[k],b||k);var D=m[k],R=a.util.type(D);R==="Object"&&!y[x(D)]?(y[x(D)]=!0,g(D,_,null,y)):R==="Array"&&!y[x(D)]&&(y[x(D)]=!0,g(D,_,k,y))}}},plugins:{},highlight:function(g,m,_){var b={code:g,grammar:m,language:_};if(a.hooks.run("before-tokenize",b),!b.grammar)throw new Error('The language "'+b.language+'" has no grammar.');return b.tokens=a.tokenize(b.code,b.grammar),a.hooks.run("after-tokenize",b),l.stringify(a.util.encode(b.tokens),b.language)},tokenize:function(g,m){var _=m.rest;if(_){for(var b in _)m[b]=_[b];delete m.rest}var y=new d;return h(y,y.head,g),u(g,y,m,y.head,0),p(y)},hooks:{all:{},add:function(g,m){var _=a.hooks.all;_[g]=_[g]||[],_[g].push(m)},run:function(g,m){var _=a.hooks.all[g];if(!(!_||!_.length))for(var b=0,y;y=_[b++];)y(m)}},Token:l};function l(g,m,_,b){this.type=g,this.content=m,this.alias=_,this.length=(b||"").length|0}l.stringify=function g(m,_){if(typeof m=="string")return m;if(Array.isArray(m)){var b="";return m.forEach(function(R){b+=g(R,_)}),b}var y={type:m.type,content:g(m.content,_),tag:"span",classes:["token",m.type],attributes:{},language:_},x=m.alias;x&&(Array.isArray(x)?Array.prototype.push.apply(y.classes,x):y.classes.push(x)),a.hooks.run("wrap",y);var k="";for(var D in y.attributes)k+=" "+D+'="'+(y.attributes[D]||"").replace(/"/g,"&quot;")+'"';return"<"+y.tag+' class="'+y.classes.join(" ")+'"'+k+">"+y.content+"</"+y.tag+">"};function c(g,m,_,b){g.lastIndex=m;var y=g.exec(_);if(y&&b&&y[1]){var x=y[1].length;y.index+=x,y[0]=y[0].slice(x)}return y}function u(g,m,_,b,y,x){for(var k in _)if(!(!_.hasOwnProperty(k)||!_[k])){var D=_[k];D=Array.isArray(D)?D:[D];for(var R=0;R<D.length;++R){if(x&&x.cause==k+","+R)return;var E=D[R],A=E.inside,M=!!E.lookbehind,N=!!E.greedy,P=E.alias;if(N&&!E.pattern.global){var O=E.pattern.toString().match(/[imsuy]*$/)[0];E.pattern=RegExp(E.pattern.source,O+"g")}for(var B=E.pattern||E,j=b.next,z=y;j!==m.tail&&!(x&&z>=x.reach);z+=j.value.length,j=j.next){var H=j.value;if(m.length>g.length)return;if(!(H instanceof l)){var Y=1,X;if(N){if(X=c(B,z,g,M),!X||X.index>=g.length)break;var ee=X.index,Q=X.index+X[0].length,ie=z;for(ie+=j.value.length;ee>=ie;)j=j.next,ie+=j.value.length;if(ie-=j.value.length,z=ie,j.value instanceof l)continue;for(var K=j;K!==m.tail&&(ie<Q||typeof K.value=="string");K=K.next)Y++,ie+=K.value.length;Y--,H=g.slice(z,ie),X.index-=z}else if(X=c(B,0,H,M),!X)continue;var ee=X.index,le=X[0],ke=H.slice(0,ee),xe=H.slice(ee+le.length),me=z+H.length;x&&me>x.reach&&(x.reach=me);var Ee=j.prev;ke&&(Ee=h(m,Ee,ke),z+=ke.length),f(m,Ee,Y);var je=new l(k,A?a.tokenize(le,A):le,P,le);if(j=h(m,Ee,je),xe&&h(m,j,xe),Y>1){var qe={cause:k+","+R,reach:me};u(g,m,_,j.prev,z,qe),x&&qe.reach>x.reach&&(x.reach=qe.reach)}}}}}}function d(){var g={value:null,prev:null,next:null},m={value:null,prev:g,next:null};g.next=m,this.head=g,this.tail=m,this.length=0}function h(g,m,_){var b=m.next,y={value:_,prev:m,next:b};return m.next=y,b.prev=y,g.length++,y}function f(g,m,_){for(var b=m.next,y=0;y<_&&b!==g.tail;y++)b=b.next;m.next=b,b.prev=m,g.length-=y}function p(g){for(var m=[],_=g.head.next;_!==g.tail;)m.push(_.value),_=_.next;return m}return a}();e.exports=n,n.default=n}}),bt=n7t(i7t());bt.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},bt.languages.markup.tag.inside["attr-value"].inside.entity=bt.languages.markup.entity,bt.languages.markup.doctype.inside["internal-subset"].inside=bt.languages.markup,bt.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&amp;/,"&"))}),Object.defineProperty(bt.languages.markup.tag,"addInlined",{value:function(i,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:bt.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:bt.languages[r]},{});r[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:n},bt.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(bt.languages.markup.tag,"addAttribute",{value:function(i,e){bt.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:bt.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),bt.languages.html=bt.languages.markup,bt.languages.mathml=bt.languages.markup,bt.languages.svg=bt.languages.markup,bt.languages.xml=bt.languages.extend("markup",{}),bt.languages.ssml=bt.languages.xml,bt.languages.atom=bt.languages.xml,bt.languages.rss=bt.languages.xml,function(i){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),s={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};i.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":s}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":s}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(bt),bt.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},bt.languages.javascript=bt.languages.extend("clike",{"class-name":[bt.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),bt.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,bt.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:bt.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:bt.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:bt.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:bt.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:bt.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),bt.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:bt.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),bt.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),bt.languages.markup&&(bt.languages.markup.tag.addInlined("script","javascript"),bt.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),bt.languages.js=bt.languages.javascript,bt.languages.actionscript=bt.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),bt.languages.actionscript["class-name"].alias="function",delete bt.languages.actionscript.parameter,delete bt.languages.actionscript["literal-property"],bt.languages.markup&&bt.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:bt.languages.markup}}),function(i){var e=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};i.languages.coffeescript=i.languages.extend("javascript",{comment:e,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),i.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:e,interpolation:n}}}),i.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:i.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),i.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete i.languages.coffeescript["template-string"],i.languages.coffee=i.languages.coffeescript}(bt),function(i){var e=i.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(e,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(s){var o=function(h){h.inside||(h.inside={}),h.inside.rest=r},a="doc-comment";if(l=i.languages[s]){var l,c=l[a];if((c=c||(l=i.languages.insertBefore(s,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[a])instanceof RegExp&&(c=l[a]={pattern:c}),Array.isArray(c))for(var u=0,d=c.length;u<d;u++)c[u]instanceof RegExp&&(c[u]={pattern:c[u]}),o(c[u]);else o(c)}})}}),e.addSupport(["java","javascript","php"],e)}(bt),function(i){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,e=(i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css,i.languages.markup);e&&(e.tag.addInlined("style","css"),e.tag.addAttribute("style","css"))}(bt),function(i){var e=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,e=(i.languages.css.selector={pattern:i.languages.css.selector.pattern,lookbehind:!0,inside:e={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+e.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[e,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},i.languages.css.atrule.inside["selector-function-argument"].inside=e,i.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};i.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:e,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:e,number:n})}(bt),function(i){var e=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",s=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function a(l,c){c=(c||"").replace(/m/g,"")+"m";var u=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return l});return RegExp(u,c)}i.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+s+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:a(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:a(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:a(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:a(o),lookbehind:!0,greedy:!0},number:{pattern:a(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},i.languages.yml=i.languages.yaml}(bt),function(i){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,s=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,a=(i.languages.markdown=i.languages.extend("markup",{}),i.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:i.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+s+o+"(?:"+s+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+s+o+")(?:"+s+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:i.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+s+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+s+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:i.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(d){u!==d&&(i.languages.markdown[u].inside.content.inside[d]=i.languages.markdown[d])})}),i.hooks.add("after-tokenize",function(u){u.language!=="markdown"&&u.language!=="md"||function d(h){if(h&&typeof h!="string")for(var f=0,p=h.length;f<p;f++){var g,m=h[f];m.type!=="code"?d(m.content):(g=m.content[1],m=m.content[3],g&&m&&g.type==="code-language"&&m.type==="code-block"&&typeof g.content=="string"&&(g=g.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),g="language-"+(g=(/[a-z][\w-]*/i.exec(g)||[""])[0].toLowerCase()),m.alias?typeof m.alias=="string"?m.alias=[m.alias,g]:m.alias.push(g):m.alias=[g]))}}(u.tokens)}),i.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var d="",h=0,f=u.classes.length;h<f;h++){var p=u.classes[h],p=/language-(.+)/.exec(p);if(p){d=p[1];break}}var g,m=i.languages[d];m?u.content=i.highlight(function(_){return _=_.replace(a,""),_=_.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(b,y){var x;return(y=y.toLowerCase())[0]==="#"?(x=y[1]==="x"?parseInt(y.slice(2),16):Number(y.slice(1)),c(x)):l[y]||b})}(u.content),m,d):d&&d!=="none"&&i.plugins.autoloader&&(g="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),u.attributes.id=g,i.plugins.autoloader.loadLanguages(d,function(){var _=document.getElementById(g);_&&(_.innerHTML=i.highlight(_.textContent,i.languages[d],d))}))}}),RegExp(i.languages.markup.tag.pattern.source,"gi")),l={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;i.languages.md=i.languages.markdown}(bt),bt.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:bt.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},bt.hooks.add("after-tokenize",function(i){if(i.language==="graphql")for(var e=i.tokens.filter(function(g){return typeof g!="string"&&g.type!=="comment"&&g.type!=="scalar"}),n=0;n<e.length;){var r=e[n++];if(r.type==="keyword"&&r.content==="mutation"){var s=[];if(h(["definition-mutation","punctuation"])&&d(1).content==="("){n+=2;var o=f(/^\($/,/^\)$/);if(o===-1)continue;for(;n<o;n++){var a=d(0);a.type==="variable"&&(p(a,"variable-input"),s.push(a.content))}n=o+1}if(h(["punctuation","property-query"])&&d(0).content==="{"&&(n++,p(d(0),"property-mutation"),0<s.length)){var l=f(/^\{$/,/^\}$/);if(l!==-1)for(var c=n;c<l;c++){var u=e[c];u.type==="variable"&&0<=s.indexOf(u.content)&&p(u,"variable-input")}}}}function d(g){return e[n+g]}function h(g,m){m=m||0;for(var _=0;_<g.length;_++){var b=d(_+m);if(!b||b.type!==g[_])return}return 1}function f(g,m){for(var _=1,b=n;b<e.length;b++){var y=e[b],x=y.content;if(y.type==="punctuation"&&typeof x=="string"){if(g.test(x))_++;else if(m.test(x)&&--_===0)return b}}return-1}function p(g,m){var _=g.alias;_?Array.isArray(_)||(g.alias=_=[_]):g.alias=_=[],_.push(m)}}),bt.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(i){var e=i.languages.javascript["template-string"],n=e.pattern.source,r=e.inside.interpolation,s=r.inside["interpolation-punctuation"],o=r.pattern.source;function a(h,f){if(i.languages[h])return{pattern:RegExp("((?:"+f+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:h}}}}function l(h,f,p){return h={code:h,grammar:f,language:p},i.hooks.run("before-tokenize",h),h.tokens=i.tokenize(h.code,h.grammar),i.hooks.run("after-tokenize",h),h.tokens}function c(h,f,p){var _=i.tokenize(h,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),g=0,m={},_=l(_.map(function(y){if(typeof y=="string")return y;for(var x,k,y=y.content;h.indexOf((k=g++,x="___"+p.toUpperCase()+"_"+k+"___"))!==-1;);return m[x]=y,x}).join(""),f,p),b=Object.keys(m);return g=0,function y(x){for(var k=0;k<x.length;k++){if(g>=b.length)return;var D,R,E,A,M,N,P,O=x[k];typeof O=="string"||typeof O.content=="string"?(D=b[g],(P=(N=typeof O=="string"?O:O.content).indexOf(D))!==-1&&(++g,R=N.substring(0,P),M=m[D],E=void 0,(A={})["interpolation-punctuation"]=s,(A=i.tokenize(M,A)).length===3&&((E=[1,1]).push.apply(E,l(A[1],i.languages.javascript,"javascript")),A.splice.apply(A,E)),E=new i.Token("interpolation",A,r.alias,M),A=N.substring(P+D.length),M=[],R&&M.push(R),M.push(E),A&&(y(N=[A]),M.push.apply(M,N)),typeof O=="string"?(x.splice.apply(x,[k,1].concat(M)),k+=M.length-1):O.content=M)):(P=O.content,Array.isArray(P)?y(P):y([P]))}}(_),new i.Token(p,_,"language-"+p,h)}i.languages.javascript["template-string"]=[a("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),a("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),a("svg",/\bsvg/.source),a("markdown",/\b(?:markdown|md)/.source),a("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),a("sql",/\bsql/.source),e].filter(Boolean);var u={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function d(h){return typeof h=="string"?h:Array.isArray(h)?h.map(d).join(""):d(h.content)}i.hooks.add("after-tokenize",function(h){h.language in u&&function f(p){for(var g=0,m=p.length;g<m;g++){var _,b,y,x=p[g];typeof x!="string"&&(_=x.content,Array.isArray(_)?x.type==="template-string"?(x=_[1],_.length===3&&typeof x!="string"&&x.type==="embedded-code"&&(b=d(x),x=x.alias,x=Array.isArray(x)?x[0]:x,y=i.languages[x])&&(_[1]=c(b,y,x))):f(_):typeof _!="string"&&f([_]))}}(h.tokens)})}(bt),function(i){i.languages.typescript=i.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),i.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete i.languages.typescript.parameter,delete i.languages.typescript["literal-property"];var e=i.languages.extend("typescript",{});delete e["class-name"],i.languages.typescript["class-name"].inside=e,i.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),i.languages.ts=i.languages.typescript}(bt),function(i){var e=i.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";i.languages.jsdoc=i.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),i.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:e,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:e.string,number:e.number,boolean:e.boolean,keyword:i.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:e,alias:"language-javascript"}}}}),i.languages.javadoclike.addSupport("javascript",i.languages.jsdoc)}(bt),function(i){i.languages.flow=i.languages.extend("javascript",{}),i.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),i.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete i.languages.flow.parameter,i.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(i.languages.flow.keyword)||(i.languages.flow.keyword=[i.languages.flow.keyword]),i.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(bt),bt.languages.n4js=bt.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),bt.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),bt.languages.n4jsd=bt.languages.n4js,function(i){function e(a,l){return RegExp(a.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),l)}i.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+i.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),i.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+i.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),i.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),i.languages.insertBefore("javascript","keyword",{imports:{pattern:e(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:i.languages.javascript},exports:{pattern:e(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:i.languages.javascript}}),i.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),i.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),i.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:e(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var o=n[r],s=i.languages.javascript[o],o=(s=i.util.type(s)==="RegExp"?i.languages.javascript[o]={pattern:s}:s).inside||{};(s.inside=o)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(bt),function(i){var e=i.util.clone(i.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,s=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(c,u){return c=c.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return s}),RegExp(c,u)}s=o(s).source,i.languages.jsx=i.languages.extend("markup",e),i.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),i.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,i.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,i.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,i.languages.jsx.tag.inside.comment=e.comment,i.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:i.languages.jsx}},i.languages.jsx.tag),i.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:i.languages.jsx}}},i.languages.jsx.tag);function a(c){for(var u=[],d=0;d<c.length;d++){var h=c[d],f=!1;typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?0<u.length&&u[u.length-1].tagName===l(h.content[0].content[1])&&u.pop():h.content[h.content.length-1].content!=="/>"&&u.push({tagName:l(h.content[0].content[1]),openedBraces:0}):0<u.length&&h.type==="punctuation"&&h.content==="{"?u[u.length-1].openedBraces++:0<u.length&&0<u[u.length-1].openedBraces&&h.type==="punctuation"&&h.content==="}"?u[u.length-1].openedBraces--:f=!0),(f||typeof h=="string")&&0<u.length&&u[u.length-1].openedBraces===0&&(f=l(h),d<c.length-1&&(typeof c[d+1]=="string"||c[d+1].type==="plain-text")&&(f+=l(c[d+1]),c.splice(d+1,1)),0<d&&(typeof c[d-1]=="string"||c[d-1].type==="plain-text")&&(f=l(c[d-1])+f,c.splice(d-1,1),d--),c[d]=new i.Token("plain-text",f,null,f)),h.content&&typeof h.content!="string"&&a(h.content)}}var l=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(l).join(""):""};i.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||a(c.tokens)})}(bt),function(i){var e=i.util.clone(i.languages.typescript),e=(i.languages.tsx=i.languages.extend("jsx",e),delete i.languages.tsx.parameter,delete i.languages.tsx["literal-property"],i.languages.tsx.tag);e.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+e.pattern.source+")",e.pattern.flags),e.lookbehind=!0}(bt),bt.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},bt.languages.swift["string-literal"].forEach(function(i){i.inside.interpolation.inside=bt.languages.swift}),function(i){i.languages.kotlin=i.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete i.languages.kotlin["class-name"];var e={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:i.languages.kotlin}};i.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:e},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:e},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete i.languages.kotlin.string,i.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),i.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),i.languages.kt=i.languages.kotlin,i.languages.kts=i.languages.kotlin}(bt),bt.languages.c=bt.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),bt.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),bt.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},bt.languages.c.string],char:bt.languages.c.char,comment:bt.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:bt.languages.c}}}}),bt.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete bt.languages.c.boolean,bt.languages.objectivec=bt.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete bt.languages.objectivec["class-name"],bt.languages.objc=bt.languages.objectivec,bt.languages.reason=bt.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),bt.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete bt.languages.reason.function,function(i){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),i.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},i.languages.rust["closure-params"].inside.rest=i.languages.rust,i.languages.rust.attribute.inside.string=i.languages.rust.string}(bt),bt.languages.go=bt.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),bt.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete bt.languages.go["class-name"],function(i){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});i.languages.cpp=i.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),i.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),i.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:i.languages.cpp}}}}),i.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),i.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:i.languages.extend("cpp",{})}}),i.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},i.languages.cpp["base-clause"])}(bt),bt.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},bt.languages.python["string-interpolation"].inside.interpolation.inside.rest=bt.languages.python,bt.languages.py=bt.languages.python,bt.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},bt.languages.webmanifest=bt.languages.json;var r7t={};e7t(r7t,{dracula:()=>o7t,duotoneDark:()=>l7t,duotoneLight:()=>u7t,github:()=>h7t,gruvboxMaterialDark:()=>$7t,gruvboxMaterialLight:()=>V7t,jettwaveDark:()=>N7t,jettwaveLight:()=>P7t,nightOwl:()=>p7t,nightOwlLight:()=>m7t,oceanicNext:()=>v7t,okaidia:()=>y7t,oneDark:()=>F7t,oneLight:()=>j7t,palenight:()=>C7t,shadesOfPurple:()=>x7t,synthwave84:()=>L7t,ultramin:()=>E7t,vsDark:()=>C4e,vsLight:()=>R7t});var s7t={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},o7t=s7t,a7t={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},l7t=a7t,c7t={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},u7t=c7t,d7t={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},h7t=d7t,f7t={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},p7t=f7t,g7t={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},m7t=g7t,Bd={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},_7t={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Bd.keyword}},{types:["attr-value"],style:{color:Bd.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Bd.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Bd.primitive}},{types:["boolean"],style:{color:Bd.boolean}},{types:["tag"],style:{color:Bd.tag}},{types:["string"],style:{color:Bd.string}},{types:["punctuation"],style:{color:Bd.string}},{types:["selector","char","builtin","inserted"],style:{color:Bd.char}},{types:["function"],style:{color:Bd.function}},{types:["operator","entity","url","variable"],style:{color:Bd.variable}},{types:["keyword"],style:{color:Bd.keyword}},{types:["atrule","class-name"],style:{color:Bd.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},v7t=_7t,b7t={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},y7t=b7t,w7t={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},C7t=w7t,S7t={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},x7t=S7t,k7t={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},L7t=k7t,D7t={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},E7t=D7t,I7t={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},C4e=I7t,T7t={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},R7t=T7t,A7t={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},N7t=A7t,M7t={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},P7t=M7t,O7t={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},F7t=O7t,B7t={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},j7t=B7t,W7t={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},$7t=W7t,z7t={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},V7t=z7t,H7t=i=>$.useCallback(e=>{var n=e,{className:r,style:s,line:o}=n,a=w4e(n,["className","style","line"]);const l=OV(Bm({},a),{className:dt("token-line",r)});return typeof i=="object"&&"plain"in i&&(l.style=i.plain),typeof s=="object"&&(l.style=Bm(Bm({},l.style||{}),s)),l},[i]),U7t=i=>{const e=$.useCallback(({types:n,empty:r})=>{if(i!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return i[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(s=>i[s]))}},[i]);return $.useCallback(n=>{var r=n,{token:s,className:o,style:a}=r,l=w4e(r,["token","className","style"]);const c=OV(Bm({},l),{className:dt("token",...s.types,o),children:s.content,style:e(s)});return a!=null&&(c.style=Bm(Bm({},c.style||{}),a)),c},[e])},q7t=/\r\n|\r|\n/,$we=i=>{i.length===0?i.push({types:["plain"],content:`
`,empty:!0}):i.length===1&&i[0].content===""&&(i[0].content=`
`,i[0].empty=!0)},zwe=(i,e)=>{const n=i.length;return n>0&&i[n-1]===e?i:i.concat(e)},K7t=i=>{const e=[[]],n=[i],r=[0],s=[i.length];let o=0,a=0,l=[];const c=[l];for(;a>-1;){for(;(o=r[a]++)<s[a];){let u,d=e[a];const f=n[a][o];if(typeof f=="string"?(d=a>0?d:["plain"],u=f):(d=zwe(d,f.type),f.alias&&(d=zwe(d,f.alias)),u=f.content),typeof u!="string"){a++,e.push(d),n.push(u),r.push(0),s.push(u.length);continue}const p=u.split(q7t),g=p.length;l.push({types:d,content:p[0]});for(let m=1;m<g;m++)$we(l),c.push(l=[]),l.push({types:d,content:p[m]})}a--,e.pop(),n.pop(),r.pop(),s.pop()}return $we(l),c},Vwe=K7t,G7t=({prism:i,code:e,grammar:n,language:r})=>$.useMemo(()=>{if(n==null)return Vwe([e]);const s={code:e,grammar:n,language:r,tokens:[]};return i.hooks.run("before-tokenize",s),s.tokens=i.tokenize(e,n),i.hooks.run("after-tokenize",s),Vwe(s.tokens)},[e,n,r,i]),X7t=(i,e)=>{const{plain:n}=i,r=i.styles.reduce((s,o)=>{const{languages:a,style:l}=o;return a&&!a.includes(e)||o.types.forEach(c=>{const u=Bm(Bm({},s[c]),l);s[c]=u}),s},{});return r.root=n,r.plain=OV(Bm({},n),{backgroundColor:void 0}),r},Y7t=X7t,Z7t=({children:i,language:e,code:n,theme:r,prism:s})=>{const o=e.toLowerCase(),a=Y7t(r,o),l=H7t(a),c=U7t(a),u=s.languages[o],d=G7t({prism:s,language:o,code:n,grammar:u});return i({tokens:d,className:`prism-code language-${o}`,style:a!=null?a.root:{},getLineProps:l,getTokenProps:c})},Q7t=i=>$.createElement(Z7t,OV(Bm({},i),{prism:i.prism||bt,theme:i.theme||C4e,code:i.code,language:i.language}));/*! Bundled license information:
prismjs/prism.js:
(**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*)
*/var sc={},Hwe;function J7t(){if(Hwe)return sc;Hwe=1;var i=sc&&sc.__extends||function(){var N=function(P,O){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,j){B.__proto__=j}||function(B,j){for(var z in j)Object.prototype.hasOwnProperty.call(j,z)&&(B[z]=j[z])},N(P,O)};return function(P,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");N(P,O);function B(){this.constructor=P}P.prototype=O===null?Object.create(O):(B.prototype=O.prototype,new B)}}(),e=sc&&sc.__assign||function(){return e=Object.assign||function(N){for(var P,O=1,B=arguments.length;O<B;O++){P=arguments[O];for(var j in P)Object.prototype.hasOwnProperty.call(P,j)&&(N[j]=P[j])}return N},e.apply(this,arguments)},n=sc&&sc.__createBinding||(Object.create?function(N,P,O,B){B===void 0&&(B=O);var j=Object.getOwnPropertyDescriptor(P,O);(!j||("get"in j?!P.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return P[O]}}),Object.defineProperty(N,B,j)}:function(N,P,O,B){B===void 0&&(B=O),N[B]=P[O]}),r=sc&&sc.__setModuleDefault||(Object.create?function(N,P){Object.defineProperty(N,"default",{enumerable:!0,value:P})}:function(N,P){N.default=P}),s=sc&&sc.__importStar||function(N){if(N&&N.__esModule)return N;var P={};if(N!=null)for(var O in N)O!=="default"&&Object.prototype.hasOwnProperty.call(N,O)&&n(P,N,O);return r(P,N),P},o=sc&&sc.__rest||function(N,P){var O={};for(var B in N)Object.prototype.hasOwnProperty.call(N,B)&&P.indexOf(B)<0&&(O[B]=N[B]);if(N!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,B=Object.getOwnPropertySymbols(N);j<B.length;j++)P.indexOf(B[j])<0&&Object.prototype.propertyIsEnumerable.call(N,B[j])&&(O[B[j]]=N[B[j]]);return O};Object.defineProperty(sc,"__esModule",{value:!0});var a=s(B1()),l=13,c=9,u=8,d=89,h=90,f=77,p=57,g=219,m=222,_=192,b=27,y=100,x=3e3,k=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),D=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),R="npm__react-simple-code-editor__textarea",E=`
/**
* Reset the text fill color so that placeholder is visible
*/
.`.concat(R,`:empty {
-webkit-text-fill-color: inherit !important;
}
/**
* Hack to apply on some CSS on IE10 and IE11
*/
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/**
* IE doesn't support '-webkit-text-fill-color'
* So we use 'color: transparent' to make the text transparent on IE
* Unlike other browsers, it doesn't affect caret color in IE
*/
.`).concat(R,` {
color: transparent !important;
}
.`).concat(R,`::selection {
background-color: #accef7 !important;
color: transparent !important;
}
}
`),A=function(N){i(P,N);function P(){var O=N!==null&&N.apply(this,arguments)||this;return O.state={capture:!0},O._recordCurrentState=function(){var B=O._input;if(B){var j=B.value,z=B.selectionStart,H=B.selectionEnd;O._recordChange({value:j,selectionStart:z,selectionEnd:H})}},O._getLines=function(B,j){return B.substring(0,j).split(`
`)},O._recordChange=function(B,j){var z,H,Y;j===void 0&&(j=!1);var X=O._history,Q=X.stack,ie=X.offset;if(Q.length&&ie>-1){O._history.stack=Q.slice(0,ie+1);var K=O._history.stack.length;if(K>y){var ee=K-y;O._history.stack=Q.slice(ee,K),O._history.offset=Math.max(O._history.offset-ee,0)}}var le=Date.now();if(j){var ke=O._history.stack[O._history.offset];if(ke&&le-ke.timestamp<x){var xe=/[^a-z0-9]([a-z0-9]+)$/i,me=(z=O._getLines(ke.value,ke.selectionStart).pop())===null||z===void 0?void 0:z.match(xe),Ee=(H=O._getLines(B.value,B.selectionStart).pop())===null||H===void 0?void 0:H.match(xe);if(me!=null&&me[1]&&(!((Y=Ee==null?void 0:Ee[1])===null||Y===void 0)&&Y.startsWith(me[1]))){O._history.stack[O._history.offset]=e(e({},B),{timestamp:le});return}}}O._history.stack.push(e(e({},B),{timestamp:le})),O._history.offset++},O._updateInput=function(B){var j=O._input;j&&(j.value=B.value,j.selectionStart=B.selectionStart,j.selectionEnd=B.selectionEnd,O.props.onValueChange(B.value))},O._applyEdits=function(B){var j=O._input,z=O._history.stack[O._history.offset];z&&j&&(O._history.stack[O._history.offset]=e(e({},z),{selectionStart:j.selectionStart,selectionEnd:j.selectionEnd})),O._recordChange(B),O._updateInput(B)},O._undoEdit=function(){var B=O._history,j=B.stack,z=B.offset,H=j[z-1];H&&(O._updateInput(H),O._history.offset=Math.max(z-1,0))},O._redoEdit=function(){var B=O._history,j=B.stack,z=B.offset,H=j[z+1];H&&(O._updateInput(H),O._history.offset=Math.min(z+1,j.length-1))},O._handleKeyDown=function(B){var j=O.props,z=j.tabSize,H=j.insertSpaces,Y=j.ignoreTabKey,X=j.onKeyDown;if(!(X&&(X(B),B.defaultPrevented))){B.keyCode===b&&B.currentTarget.blur();var Q=B.currentTarget,ie=Q.value,K=Q.selectionStart,ee=Q.selectionEnd,le=(H?" ":" ").repeat(z);if(B.keyCode===c&&!Y&&O.state.capture)if(B.preventDefault(),B.shiftKey){var ke=O._getLines(ie,K),xe=ke.length-1,me=O._getLines(ie,ee).length-1,Ee=ie.split(`
`).map(function(vt,wn){return wn>=xe&&wn<=me&&vt.startsWith(le)?vt.substring(le.length):vt}).join(`
`);if(ie!==Ee){var je=ke[xe];O._applyEdits({value:Ee,selectionStart:je!=null&&je.startsWith(le)?K-le.length:K,selectionEnd:ee-(ie.length-Ee.length)})}}else if(K!==ee){var ke=O._getLines(ie,K),qe=ke.length-1,Ze=O._getLines(ie,ee).length-1,je=ke[qe];O._applyEdits({value:ie.split(`
`).map(function(Ce,ge){return ge>=qe&&ge<=Ze?le+Ce:Ce}).join(`
`),selectionStart:je&&/\S/.test(je)?K+le.length:K,selectionEnd:ee+le.length*(Ze-qe+1)})}else{var We=K+le.length;O._applyEdits({value:ie.substring(0,K)+le+ie.substring(ee),selectionStart:We,selectionEnd:We})}else if(B.keyCode===u){var ut=K!==ee,st=ie.substring(0,K);if(st.endsWith(le)&&!ut){B.preventDefault();var We=K-le.length;O._applyEdits({value:ie.substring(0,K-le.length)+ie.substring(ee),selectionStart:We,selectionEnd:We})}}else if(B.keyCode===l){if(K===ee){var mt=O._getLines(ie,K).pop(),Rt=mt==null?void 0:mt.match(/^\s+/);if(Rt!=null&&Rt[0]){B.preventDefault();var Vt=`
`+Rt[0],We=K+Vt.length;O._applyEdits({value:ie.substring(0,K)+Vt+ie.substring(ee),selectionStart:We,selectionEnd:We})}}}else if(B.keyCode===p||B.keyCode===g||B.keyCode===m||B.keyCode===_){var Ot=void 0;B.keyCode===p&&B.shiftKey?Ot=["(",")"]:B.keyCode===g?B.shiftKey?Ot=["{","}"]:Ot=["[","]"]:B.keyCode===m?B.shiftKey?Ot=['"','"']:Ot=["'","'"]:B.keyCode===_&&!B.shiftKey&&(Ot=["`","`"]),K!==ee&&Ot&&(B.preventDefault(),O._applyEdits({value:ie.substring(0,K)+Ot[0]+ie.substring(K,ee)+Ot[1]+ie.substring(ee),selectionStart:K,selectionEnd:ee+2}))}else(D?B.metaKey&&B.keyCode===h:B.ctrlKey&&B.keyCode===h)&&!B.shiftKey&&!B.altKey?(B.preventDefault(),O._undoEdit()):(D?B.metaKey&&B.keyCode===h&&B.shiftKey:k?B.ctrlKey&&B.keyCode===d:B.ctrlKey&&B.keyCode===h&&B.shiftKey)&&!B.altKey?(B.preventDefault(),O._redoEdit()):B.keyCode===f&&B.ctrlKey&&(!D||B.shiftKey)&&(B.preventDefault(),O.setState(function(vt){return{capture:!vt.capture}}))}},O._handleChange=function(B){var j=B.currentTarget,z=j.value,H=j.selectionStart,Y=j.selectionEnd;O._recordChange({value:z,selectionStart:H,selectionEnd:Y},!0),O.props.onValueChange(z)},O._history={stack:[],offset:-1},O._input=null,O}return P.prototype.componentDidMount=function(){this._recordCurrentState()},Object.defineProperty(P.prototype,"session",{get:function(){return{history:this._history}},set:function(O){this._history=O.history},enumerable:!1,configurable:!0}),P.prototype.render=function(){var O=this,B=this.props,j=B.value,z=B.style,H=B.padding,Y=B.highlight,X=B.textareaId,Q=B.textareaClassName,ie=B.autoFocus,K=B.disabled,ee=B.form,le=B.maxLength,ke=B.minLength,xe=B.name,me=B.placeholder,Ee=B.readOnly,je=B.required,qe=B.onClick,Ze=B.onFocus,We=B.onBlur,ut=B.onKeyUp;B.onKeyDown,B.onValueChange,B.tabSize,B.insertSpaces,B.ignoreTabKey;var st=B.preClassName,mt=o(B,["value","style","padding","highlight","textareaId","textareaClassName","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey","preClassName"]),Rt={paddingTop:typeof H=="object"?H.top:H,paddingRight:typeof H=="object"?H.right:H,paddingBottom:typeof H=="object"?H.bottom:H,paddingLeft:typeof H=="object"?H.left:H},Vt=Y(j);return a.createElement("div",e({},mt,{style:e(e({},M.container),z)}),a.createElement("pre",e({className:st,"aria-hidden":"true",style:e(e(e({},M.editor),M.highlight),Rt)},typeof Vt=="string"?{dangerouslySetInnerHTML:{__html:Vt+"<br />"}}:{children:Vt})),a.createElement("textarea",{ref:function(Ot){return O._input=Ot},style:e(e(e({},M.editor),M.textarea),Rt),className:R+(Q?" ".concat(Q):""),id:X,value:j,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:qe,onKeyUp:ut,onFocus:Ze,onBlur:We,disabled:K,form:ee,maxLength:le,minLength:ke,name:xe,placeholder:me,readOnly:Ee,required:je,autoFocus:ie,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),a.createElement("style",{dangerouslySetInnerHTML:{__html:E}}))},P.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},P}(a.Component);sc.default=A;var M={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}};return sc}var ejt=J7t();const S4e=ql(ejt),x4e=ye(i=>C.jsx(S4e,{padding:0,textareaClassName:"code-block-textarea",...i}))({fontFamily:'"Menlo", monospace',fontSize:"16px",lineHeight:"24px",fontWeight:"400","& .code-block-textarea":{margin:"1rem 0 !important",outline:"none"}});x4e.propTypes={...S4e.propTypes};const FV=({value:i,language:e="javascript",onChange:n,readOnly:r=!1,height:s="auto",options:o={},sx:a={},...l})=>{const c=$i(),u={plain:{color:c.palette.text.primary,backgroundColor:c.palette.background.code},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:EU[300],fontStyle:"italic"}},{types:["string","attr-value"],style:{color:LDe[300]}},{types:["punctuation","operator"],style:{color:c.palette.text.primary}},{types:["entity","url","symbol","number","boolean","variable","constant","regex","inserted"],style:{color:EU[300]}},{types:["property"],style:{color:c.palette.secondary.main}},{types:["atrule","keyword","attr-name","selector"],style:{color:tu[500]}},{types:["function","deleted","tag"],style:{color:tu[500]}},{types:["function-variable"],style:{color:EU[300]}}]},d=h=>C.jsx(Q7t,{code:h,language:e,theme:u,prism:bt,children:({className:f,style:p,tokens:g,getLineProps:m,getTokenProps:_})=>C.jsx("pre",{className:f,style:{wordBreak:"keep-all",whiteSpace:"pre-wrap",...p},"data-testid":"code-editor-pre",children:g.map((b,y)=>{const x=m({line:b,key:y}),{key:k,...D}=x;return C.jsx("div",{...D,children:b.map((R,E)=>{const A=_({token:R,key:E}),{key:M,...N}=A;return C.jsx("span",{...N},M)})},k)})})});return C.jsx(Ye,{sx:{background:c.palette.background.code,borderRadius:"0.5rem",height:s,overflow:"auto",...a},"data-testid":"code-editor",children:C.jsx(Ye,{sx:{p:2},children:r?d(i):C.jsx(x4e,{value:i,onValueChange:n,highlight:d,"data-testid":"code-editor-input",...o,...l})})})};FV.propTypes={value:Z.string.isRequired,language:Z.string,onChange:Z.func,readOnly:Z.bool,height:Z.oneOfType([Z.string,Z.number]),options:Z.object,sx:Z.object};const k4e=({collectionName:i})=>{var h,f;const{enqueueSnackbar:e,closeSnackbar:n}=pu(),{client:r}=Ur(),[s,o]=nn.useState(null),[a,l]=nn.useState(""),c=p=>{p=`[${new Date().toLocaleString()}] ${p}`,l(m=>p+`
`+m)},u=()=>{l("")};$.useEffect(()=>{r.getCollection(i).then(p=>{o(()=>({...p}))}).catch(p=>{e(p.message,as("error",n))})},[]);let d={};return s&&(d=p4e(s)),C.jsxs(C.Fragment,{children:[((f=(h=s==null?void 0:s.config)==null?void 0:h.params)==null?void 0:f.vectors)&&C.jsx(v4e,{collectionName:i,vectors:d,loggingFoo:c,clearLogsFoo:u,sx:{mt:5}}),C.jsxs(Fv,{elevation:0,sx:{mt:5},children:[C.jsx(h5,{title:"Report",variant:"heading",sx:{flexGrow:1},action:C.jsx(p_,{text:ls.stringify(a)})}),C.jsx(Ye,{sx:{pr:1},children:C.jsx(FV,{value:a,language:"markdown",readOnly:!0})})]})]})};k4e.propTypes={collectionName:Z.string};var V8={exports:{}},tjt=V8.exports,Uwe;function njt(){return Uwe||(Uwe=1,function(i,e){(function(n,r){i.exports=r(B1())})(typeof self<"u"?self:tjt,function(n){return function(r){var s={};function o(a){if(s[a])return s[a].exports;var l=s[a]={i:a,l:!1,exports:{}};return r[a].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=r,o.c=s,o.d=function(a,l,c){o.o(a,l)||Object.defineProperty(a,l,{enumerable:!0,get:c})},o.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},o.t=function(a,l){if(1&l&&(a=o(a)),8&l||4&l&&typeof a=="object"&&a&&a.__esModule)return a;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:a}),2&l&&typeof a!="string")for(var u in a)o.d(c,u,(function(d){return a[d]}).bind(null,u));return c},o.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return o.d(l,"a",l),l},o.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},o.p="lib/",o(o.s=5)}([function(r,s){r.exports=n},function(r,s,o){var a=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(s,"__esModule",{value:!0}),s.ArcherContainerContextProvider=s.ArcherContainerContext=void 0;var l=a(o(0));s.ArcherContainerContext=l.default.createContext(null),s.ArcherContainerContextProvider=s.ArcherContainerContext.Provider},function(r,s,o){Object.defineProperty(s,"__esModule",{value:!0}),s.encodeId=void 0,s.encodeId=function(a){return encodeURI(a).replace(/%/g,"_")}},function(r,s,o){Object.defineProperty(s,"__esModule",{value:!0}),s.getMarkerId=s.createShapeObj=s.getSourceToTargets=s.getEndShapeFromStyle=void 0;var a=["arrow","circle"];s.getEndShapeFromStyle=function(l){return l.endShape&&Object.keys(l.endShape).filter(function(c){return a.includes(c)})[0]||a[0]},s.getSourceToTargets=function(l){var c=Object.keys(l).map(function(u){return l[u]});return[].concat.apply([],c).sort(function(u,d){return u.order-d.order})},s.createShapeObj=function(l,c){return{arrow:function(){var u;return{arrow:Object.assign(Object.assign({},c==null?void 0:c.arrow),(u=l.endShape)===null||u===void 0?void 0:u.arrow)}},circle:function(){var u;return{circle:Object.assign(Object.assign({},c==null?void 0:c.circle),(u=l.endShape)===null||u===void 0?void 0:u.circle)}}}[(0,s.getEndShapeFromStyle)(l)]()},s.getMarkerId=function(l,c,u){return"".concat(l).concat(c.id).concat(u.id)}},function(r,s,o){Object.defineProperty(s,"__esModule",{value:!0}),s.endShapeDefaultProp=void 0,s.endShapeDefaultProp={arrow:{arrowLength:10,arrowThickness:6},circle:{radius:2,fillColor:"#f00",strokeColor:"#0ff",strokeWidth:1}}},function(r,s,o){var a=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(s,"__esModule",{value:!0}),s.ArcherContainer=s.ArcherElement=void 0;var l=o(6);Object.defineProperty(s,"ArcherElement",{enumerable:!0,get:function(){return a(l).default}});var c=o(11);Object.defineProperty(s,"ArcherContainer",{enumerable:!0,get:function(){return a(c).default}})},function(r,s,o){var a=this&&this.__createBinding||(Object.create?function(m,_,b,y){y===void 0&&(y=b);var x=Object.getOwnPropertyDescriptor(_,b);x&&("get"in x?_.__esModule:!x.writable&&!x.configurable)||(x={enumerable:!0,get:function(){return _[b]}}),Object.defineProperty(m,y,x)}:function(m,_,b,y){y===void 0&&(y=b),m[y]=_[b]}),l=this&&this.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),c=this&&this.__importStar||function(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var b in m)b!=="default"&&Object.prototype.hasOwnProperty.call(m,b)&&a(_,m,b);return l(_,m),_};Object.defineProperty(s,"__esModule",{value:!0});var u=c(o(0)),d=o(7),h=o(1),f=o(2),p=o(8),g=o(10);s.default=function(m){var _=m.id,b=m.relations,y=b===void 0?[]:b,x=m.children,k=(0,u.useMemo)(function(){return(0,f.encodeId)(_)},[_]),D=(0,u.useContext)(h.ArcherContainerContext),R=(0,u.useRef)(),E=(0,u.useCallback)(function(O){var B=(0,g.generateSourceToTarget)(k,O);(0,g.assertContextExists)(D),D.registerTransitions(k,B)},[D,k]),A=(0,u.useCallback)(function(){(0,g.assertContextExists)(D),D.unregisterTransitions(k)},[D,k]),M=(0,u.useCallback)(function(O){O&&((0,g.assertContextExists)(D),D.registerChild(k,O))},[k,D]),N=(0,u.useCallback)(function(){(0,g.assertContextExists)(D),D.unregisterChild(k)},[D,k]);(0,d.useIsomorphicLayoutEffect)(function(){return M(R.current),function(){return N()}},[M,N]),(0,p.useDeepCompareEffect)(function(){return E(y),function(){return A()}},[E,y,A]),u.default.Children.only(x);var P=x;return u.default.cloneElement(P,Object.assign(Object.assign({},P.props),{ref:R}))}},function(r,s,o){Object.defineProperty(s,"__esModule",{value:!0}),s.useIsomorphicLayoutEffect=void 0;var a=o(0);s.useIsomorphicLayoutEffect=typeof window<"u"?a.useLayoutEffect:a.useEffect},function(r,s,o){var a=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(s,"__esModule",{value:!0}),s.useDeepCompareEffect=void 0;var l=o(0),c=a(o(9));function u(d){var h=(0,l.useRef)();return(0,c.default)(d,h.current)||(h.current=d),h.current}s.useDeepCompareEffect=function(d,h){(0,l.useEffect)(d,h.map(u))}},function(r,s,o){var a=Array.isArray,l=Object.keys,c=Object.prototype.hasOwnProperty,u=typeof Element<"u";r.exports=function(d,h){try{return function f(p,g){if(p===g)return!0;if(p&&g&&typeof p=="object"&&typeof g=="object"){var m,_,b,y=a(p),x=a(g);if(y&&x){if((_=p.length)!=g.length)return!1;for(m=_;m--!=0;)if(!f(p[m],g[m]))return!1;return!0}if(y!=x)return!1;var k=p instanceof Date,D=g instanceof Date;if(k!=D)return!1;if(k&&D)return p.getTime()==g.getTime();var R=p instanceof RegExp,E=g instanceof RegExp;if(R!=E)return!1;if(R&&E)return p.toString()==g.toString();var A=l(p);if((_=A.length)!==l(g).length)return!1;for(m=_;m--!=0;)if(!c.call(g,A[m]))return!1;if(u&&p instanceof Element&&g instanceof Element)return p===g;for(m=_;m--!=0;)if(!((b=A[m])==="_owner"&&p.$$typeof||f(p[b],g[b])))return!1;return!0}return p!=p&&g!=g}(d,h)}catch(f){if(f.message&&f.message.match(/stack|recursion/i)||f.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",f.name,f.message),!1;throw f}}},function(r,s,o){Object.defineProperty(s,"__esModule",{value:!0}),s.generateSourceToTarget=s.assertContextExists=void 0;var a=o(2);s.assertContextExists=function(l){if(!l)throw new Error("Could not find ArcherContainerContext in <ArcherElement>. Please wrap the component in a <ArcherContainer>.")},s.generateSourceToTarget=function(l,c){return c.map(function(u){var d=u.targetId,h=u.sourceAnchor,f=u.targetAnchor,p=u.label,g=u.className,m=u.style,_=u.order,b=_===void 0?0:_,y=u.domAttributes,x=u.cursor,k=u.hitSlop;return{source:{id:(0,a.encodeId)(l),anchor:h},target:{id:(0,a.encodeId)(d),anchor:f},className:g,label:p,style:m,order:b,domAttributes:y,cursor:x,hitSlop:k}})}},function(r,s,o){function a(R,E,A){return E in R?Object.defineProperty(R,E,{value:A,enumerable:!0,configurable:!0,writable:!0}):R[E]=A,R}function l(R,E){return function(A){if(Array.isArray(A))return A}(R)||function(A,M){var N=A==null?null:typeof Symbol<"u"&&A[Symbol.iterator]||A["@@iterator"];if(N!=null){var P,O,B=[],j=!0,z=!1;try{for(N=N.call(A);!(j=(P=N.next()).done)&&(B.push(P.value),!M||B.length!==M);j=!0);}catch(H){z=!0,O=H}finally{try{j||N.return==null||N.return()}finally{if(z)throw O}}return B}}(R,E)||function(A,M){if(A){if(typeof A=="string")return c(A,M);var N=Object.prototype.toString.call(A).slice(8,-1);if(N==="Object"&&A.constructor&&(N=A.constructor.name),N==="Map"||N==="Set")return Array.from(A);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return c(A,M)}}(R,E)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function c(R,E){(E==null||E>R.length)&&(E=R.length);for(var A=0,M=new Array(E);A<E;A++)M[A]=R[A];return M}var u=this&&this.__createBinding||(Object.create?function(R,E,A,M){M===void 0&&(M=A);var N=Object.getOwnPropertyDescriptor(E,A);N&&("get"in N?E.__esModule:!N.writable&&!N.configurable)||(N={enumerable:!0,get:function(){return E[A]}}),Object.defineProperty(R,M,N)}:function(R,E,A,M){M===void 0&&(M=A),R[M]=E[A]}),d=this&&this.__setModuleDefault||(Object.create?function(R,E){Object.defineProperty(R,"default",{enumerable:!0,value:E})}:function(R,E){R.default=E}),h=this&&this.__importStar||function(R){if(R&&R.__esModule)return R;var E={};if(R!=null)for(var A in R)A!=="default"&&Object.prototype.hasOwnProperty.call(R,A)&&u(E,R,A);return d(E,R),E},f=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(s,"__esModule",{value:!0});var p=h(o(0)),g=f(o(12)),m=o(1),_=o(14),b=o(4),y=o(19),x=o(20),k={position:"absolute",width:"100%",height:"100%",top:0,left:0,pointerEvents:"none"},D=p.default.forwardRef(function(R,E){var A=R.endShape,M=A===void 0?b.endShapeDefaultProp:A,N=R.strokeColor,P=N===void 0?"#f00":N,O=R.strokeWidth,B=O===void 0?2:O,j=R.svgContainerStyle,z=j===void 0?{}:j,H=R.noCurves,Y=R.children,X=R.className,Q=R.endMarker,ie=R.lineStyle,K=R.offset,ee=R.startMarker,le=R.strokeDasharray,ke=R.style,xe=l((0,p.useState)({}),2),me=xe[0],Ee=xe[1],je=l((0,p.useState)({}),2),qe=je[0],Ze=je[1],We=(0,p.useRef)(new g.default(function(){Vt()})).current,ut=(0,p.useRef)(null),st=l(p.default.useState(),2)[1],mt=(0,p.useRef)("arrow".concat(Math.random().toString().slice(2))).current;(0,p.useImperativeHandle)(E,function(){return{refreshScreen:Vt,arrowMarkerUniquePrefix:mt}});var Rt,Vt=p.default.useCallback(function(){return st({})},[]),Ot=(0,p.useCallback)(function(ne,ae){Ze(function(ue){return Object.assign(Object.assign({},ue),a({},ne,ae))})},[]),vt=(0,p.useCallback)(function(ne){Ze(function(ae){var ue=Object.assign({},ae);return delete ue[ne],ue})},[]),wn=(0,p.useCallback)(function(ne,ae){Ee(function(ue){return ue[ne]===ae?ue:Object.assign(Object.assign({},ue),a({},ne,ae))})},[]),Ce=(0,p.useCallback)(function(ne){Ee(function(ae){var ue=Object.assign({},ae);return delete ue[ne],ue})},[]),ge=(0,p.useMemo)(function(){return Object.assign(Object.assign({},k),z)},[z]);Rt=typeof Y=="function"?Y(m.ArcherContainerContext):Y,(0,x.useResizeListener)(Vt),(0,x.useObserveElements)(me,We);var pe=(0,p.useMemo)(function(){return{registerTransitions:Ot,unregisterTransitions:vt,registerChild:wn,unregisterChild:Ce}},[Ot,vt,wn,Ce]);return p.default.createElement(m.ArcherContainerContextProvider,{value:pe},p.default.createElement("div",{style:Object.assign(Object.assign({},ke),{position:"relative"}),className:X},p.default.createElement("svg",{style:ge},p.default.createElement("defs",null,p.default.createElement(y.ArrowMarkers,{endShape:M,sourceToTargetsMap:qe,strokeColor:P,uniqueId:mt})),p.default.createElement(_.SvgArrows,{startMarker:ee,endMarker:Q,endShape:M,strokeColor:P,strokeWidth:B,strokeDasharray:le,noCurves:H,lineStyle:ie,offset:K,parentCurrent:ut.current,refs:me,uniqueId:mt,sourceToTargetsMap:qe})),p.default.createElement("div",{style:{height:"100%"},ref:ut},Rt)))});s.default=D},function(r,s,o){o.r(s),(function(a){var l=function(){if(typeof Map<"u")return Map;function j(z,H){var Y=-1;return z.some(function(X,Q){return X[0]===H&&(Y=Q,!0)}),Y}return function(){function z(){this.__entries__=[]}var H={size:{configurable:!0}};return H.size.get=function(){return this.__entries__.length},z.prototype.get=function(Y){var X=j(this.__entries__,Y),Q=this.__entries__[X];return Q&&Q[1]},z.prototype.set=function(Y,X){var Q=j(this.__entries__,Y);~Q?this.__entries__[Q][1]=X:this.__entries__.push([Y,X])},z.prototype.delete=function(Y){var X=this.__entries__,Q=j(X,Y);~Q&&X.splice(Q,1)},z.prototype.has=function(Y){return!!~j(this.__entries__,Y)},z.prototype.clear=function(){this.__entries__.splice(0)},z.prototype.forEach=function(Y,X){X===void 0&&(X=null);for(var Q=0,ie=this.__entries__;Q<ie.length;Q+=1){var K=ie[Q];Y.call(X,K[1],K[0])}},Object.defineProperties(z.prototype,H),z}()}(),c=typeof window<"u"&&typeof document<"u"&&window.document===document,u=function(){return a!==void 0&&a.Math===Math?a:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),d=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(u):function(j){return setTimeout(function(){return j(Date.now())},1e3/60)}}(),h=2,f=["top","right","bottom","left","width","height","size","weight"],p=typeof MutationObserver<"u",g=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(j,z){var H=!1,Y=!1,X=0;function Q(){H&&(H=!1,j()),Y&&K()}function ie(){d(Q)}function K(){var ee=Date.now();if(H){if(ee-X<h)return;Y=!0}else H=!0,Y=!1,setTimeout(ie,z);X=ee}return K}(this.refresh.bind(this),20)};g.prototype.addObserver=function(j){~this.observers_.indexOf(j)||this.observers_.push(j),this.connected_||this.connect_()},g.prototype.removeObserver=function(j){var z=this.observers_,H=z.indexOf(j);~H&&z.splice(H,1),!z.length&&this.connected_&&this.disconnect_()},g.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},g.prototype.updateObservers_=function(){var j=this.observers_.filter(function(z){return z.gatherActive(),z.hasActive()});return j.forEach(function(z){return z.broadcastActive()}),j.length>0},g.prototype.connect_=function(){c&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),p?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},g.prototype.disconnect_=function(){c&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},g.prototype.onTransitionEnd_=function(j){var z=j.propertyName;z===void 0&&(z=""),f.some(function(H){return!!~z.indexOf(H)})&&this.refresh()},g.getInstance=function(){return this.instance_||(this.instance_=new g),this.instance_},g.instance_=null;var m=function(j,z){for(var H=0,Y=Object.keys(z);H<Y.length;H+=1){var X=Y[H];Object.defineProperty(j,X,{value:z[X],enumerable:!1,writable:!1,configurable:!0})}return j},_=function(j){return j&&j.ownerDocument&&j.ownerDocument.defaultView||u},b=E(0,0,0,0);function y(j){return parseFloat(j)||0}function x(j){for(var z=[],H=arguments.length-1;H-- >0;)z[H]=arguments[H+1];return z.reduce(function(Y,X){return Y+y(j["border-"+X+"-width"])},0)}function k(j){var z=j.clientWidth,H=j.clientHeight;if(!z&&!H)return b;var Y=_(j).getComputedStyle(j),X=function(xe){for(var me={},Ee=0,je=["top","right","bottom","left"];Ee<je.length;Ee+=1){var qe=je[Ee],Ze=xe["padding-"+qe];me[qe]=y(Ze)}return me}(Y),Q=X.left+X.right,ie=X.top+X.bottom,K=y(Y.width),ee=y(Y.height);if(Y.boxSizing==="border-box"&&(Math.round(K+Q)!==z&&(K-=x(Y,"left","right")+Q),Math.round(ee+ie)!==H&&(ee-=x(Y,"top","bottom")+ie)),!function(xe){return xe===_(xe).document.documentElement}(j)){var le=Math.round(K+Q)-z,ke=Math.round(ee+ie)-H;Math.abs(le)!==1&&(K-=le),Math.abs(ke)!==1&&(ee-=ke)}return E(X.left,X.top,K,ee)}var D=function(){return typeof SVGGraphicsElement<"u"?function(j){return j instanceof _(j).SVGGraphicsElement}:function(j){return j instanceof _(j).SVGElement&&typeof j.getBBox=="function"}}();function R(j){return c?D(j)?function(z){var H=z.getBBox();return E(0,0,H.width,H.height)}(j):k(j):b}function E(j,z,H,Y){return{x:j,y:z,width:H,height:Y}}var A=function(j){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=E(0,0,0,0),this.target=j};A.prototype.isActive=function(){var j=R(this.target);return this.contentRect_=j,j.width!==this.broadcastWidth||j.height!==this.broadcastHeight},A.prototype.broadcastRect=function(){var j=this.contentRect_;return this.broadcastWidth=j.width,this.broadcastHeight=j.height,j};var M=function(j,z){var H=function(Y){var X=Y.x,Q=Y.y,ie=Y.width,K=Y.height,ee=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,le=Object.create(ee.prototype);return m(le,{x:X,y:Q,width:ie,height:K,top:Q,right:X+ie,bottom:K+Q,left:X}),le}(z);m(this,{target:j,contentRect:H})},N=function(j,z,H){if(this.activeObservations_=[],this.observations_=new l,typeof j!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=j,this.controller_=z,this.callbackCtx_=H};N.prototype.observe=function(j){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(j instanceof _(j).Element))throw new TypeError('parameter 1 is not of type "Element".');var z=this.observations_;z.has(j)||(z.set(j,new A(j)),this.controller_.addObserver(this),this.controller_.refresh())}},N.prototype.unobserve=function(j){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(j instanceof _(j).Element))throw new TypeError('parameter 1 is not of type "Element".');var z=this.observations_;z.has(j)&&(z.delete(j),z.size||this.controller_.removeObserver(this))}},N.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},N.prototype.gatherActive=function(){var j=this;this.clearActive(),this.observations_.forEach(function(z){z.isActive()&&j.activeObservations_.push(z)})},N.prototype.broadcastActive=function(){if(this.hasActive()){var j=this.callbackCtx_,z=this.activeObservations_.map(function(H){return new M(H.target,H.broadcastRect())});this.callback_.call(j,z,j),this.clearActive()}},N.prototype.clearActive=function(){this.activeObservations_.splice(0)},N.prototype.hasActive=function(){return this.activeObservations_.length>0};var P=typeof WeakMap<"u"?new WeakMap:new l,O=function(j){if(!(this instanceof O))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var z=g.getInstance(),H=new N(j,z,this);P.set(this,H)};["observe","unobserve","disconnect"].forEach(function(j){O.prototype[j]=function(){return(z=P.get(this))[j].apply(z,arguments);var z}});var B=function(){return u.ResizeObserver!==void 0?u.ResizeObserver:O}();s.default=B}).call(this,o(13))},function(r,s){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch{typeof window=="object"&&(o=window)}r.exports=o},function(r,s,o){var a=this&&this.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(s,"__esModule",{value:!0}),s.SvgArrows=void 0;var l=a(o(0)),c=o(15),u=a(o(17)),d=o(3),h=function(f){var p,g,m=f.style||{},_=m.startMarker||f.startMarker,b=(g=(p=m.endMarker)!==null&&p!==void 0?p:f.endMarker)===null||g===void 0||g,y=(0,d.createShapeObj)(m,f.endShape),x=f.domAttributes,k=f.cursor,D=f.hitSlop,R=m.strokeColor||f.strokeColor,E=m.strokeWidth||f.strokeWidth,A=m.strokeDasharray||f.strokeDasharray,M=!(!m.noCurves&&!f.noCurves),N=m.lineStyle||f.lineStyle||(M?"angle":"curve"),P=f.offset||0,O=f.source.anchor,B=(0,c.getPointCoordinatesFromAnchorPosition)(f.source.anchor,f.source.id,f.parentCoordinates,f.refs),j=f.target.anchor,z=(0,c.getPointCoordinatesFromAnchorPosition)(f.target.anchor,f.target.id,f.parentCoordinates,f.refs);return B?z?l.default.createElement(u.default,{className:f.className,startingPoint:B,startingAnchorOrientation:O,endingPoint:z,endingAnchorOrientation:j,strokeColor:R,strokeWidth:E,strokeDasharray:A,arrowLabel:f.label,arrowMarkerId:(0,d.getMarkerId)(f.uniqueId,f.source,f.target),lineStyle:N,offset:P,enableStartMarker:!!_,disableEndMarker:!b,endShape:y,domAttributes:x,hitSlop:D,cursor:k}):(console.warn("[React Archer] Could not find target element! Not drawing the arrow."),null):(console.warn("[React Archer] Could not find starting point of element! Not drawing the arrow."),null)};s.SvgArrows=function(f){var p=(0,c.getPointFromElement)(f.parentCurrent);return p?l.default.createElement(l.default.Fragment,null,(0,d.getSourceToTargets)(f.sourceToTargetsMap).map(function(g){return l.default.createElement(h,{key:JSON.stringify({source:g.source,target:g.target}),source:g.source,target:g.target,className:g.className,label:g.label,style:g.style||{},domAttributes:g.domAttributes,hitSlop:g.hitSlop,cursor:g.cursor,startMarker:f.startMarker,endMarker:f.endMarker,endShape:f.endShape,strokeColor:f.strokeColor,strokeWidth:f.strokeWidth,strokeDasharray:f.strokeDasharray,noCurves:f.noCurves,lineStyle:f.lineStyle,offset:f.offset,parentCoordinates:p,refs:f.refs,uniqueId:f.uniqueId})})):null}},function(r,s,o){var a=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(s,"__esModule",{value:!0}),s.getPointCoordinatesFromAnchorPosition=s.getPointFromElement=void 0;var l=a(o(16));function c(d){return new l.default(d.left,d.top)}var u=function(d){return d?d.getBoundingClientRect():null};s.getPointFromElement=function(d){var h=u(d);return h?c(h):null},s.getPointCoordinatesFromAnchorPosition=function(d,h,f,p){var g=u(p[h]);if(!g)return null;var m=function(_,b){switch(_){case"top":return c(b).add(new l.default(b.width/2,0));case"bottom":return c(b).add(new l.default(b.width/2,b.height));case"left":return c(b).add(new l.default(0,b.height/2));case"right":return c(b).add(new l.default(b.width,b.height/2));case"middle":return c(b).add(new l.default(b.width/2,b.height/2));default:return console.error("[React Archer] Invalid anchor position was provided. Not drawing the arrow."),null}}(d,g);return m?m.substract(f):null}},function(r,s,o){function a(c,u){for(var d=0;d<u.length;d++){var h=u[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(c,h.key,h)}}Object.defineProperty(s,"__esModule",{value:!0});var l=function(){function c(u,d){(function(h,f){if(!(h instanceof f))throw new TypeError("Cannot call a class as a function")})(this,c),this.x=u,this.y=d}return function(u,d,h){d&&a(u.prototype,d),Object.defineProperty(u,"prototype",{writable:!1})}(c,[{key:"add",value:function(u){return new c(this.x+u.x,this.y+u.y)}},{key:"substract",value:function(u){return new c(this.x-u.x,this.y-u.y)}}]),c}();s.default=l},function(r,s,o){var a=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(s,"__esModule",{value:!0}),s.computeLabelDimensions=s.computeEndingAnchorPosition=s.computeStartingAnchorPosition=s.computeArrowPointAccordingToArrowHead=void 0;var l=a(o(0)),c=o(18);function u(p,g,m,_,b,y,x,k){var D=(0,c.computeArrowDirectionVector)(b),R=D.arrowX,E=D.arrowY;if(y==="straight"&&x!==void 0&&k!==void 0){var A=Math.atan2(k-g,x-p);R=Math.cos(A),E=Math.sin(A)}return{xPoint:p+R*m*_/2,yPoint:g+E*m*_/2}}function d(p,g,m,_,b){return b==="top"||b==="bottom"?{xAnchor1:p,yAnchor1:g+(_-g)/2}:b==="left"||b==="right"?{xAnchor1:p+(m-p)/2,yAnchor1:g}:{xAnchor1:p,yAnchor1:g}}function h(p,g,m,_,b){return b==="top"||b==="bottom"?{xAnchor2:m,yAnchor2:_-(_-g)/2}:b==="left"||b==="right"?{xAnchor2:m-(m-p)/2,yAnchor2:_}:{xAnchor2:m,yAnchor2:_}}function f(p,g,m,_){return{xLabel:m>p?p:m,yLabel:_>g?g:_,labelWidth:Math.max(Math.abs(m-p),1),labelHeight:Math.max(Math.abs(_-g),1)}}s.computeArrowPointAccordingToArrowHead=u,s.computeStartingAnchorPosition=d,s.computeEndingAnchorPosition=h,s.computeLabelDimensions=f,s.default=function(p){var g=p.className,m=p.startingPoint,_=p.startingAnchorOrientation,b=p.endingPoint,y=p.endingAnchorOrientation,x=p.strokeColor,k=p.strokeWidth,D=p.strokeDasharray,R=p.arrowLabel,E=p.arrowMarkerId,A=p.lineStyle,M=p.offset,N=p.enableStartMarker,P=p.disableEndMarker,O=p.endShape,B=p.domAttributes,j=p.hitSlop,z=j===void 0?10:j,H=p.cursor,Y=H===void 0?"pointer":H,X=O.circle?2*O.circle.radius:2*O.arrow.arrowLength,Q=u(m.x,m.y,N?X:0,k,_,A,b.x,b.y),ie=Q.xPoint,K=Q.yPoint,ee=u(b.x,b.y,P?0:X,k,y,A,m.x,m.y),le=ee.xPoint,ke=ee.yPoint,xe=d(ie,K,le,ke,_),me=xe.xAnchor1,Ee=xe.yAnchor1,je=h(ie,K,le,ke,y),qe=function(Vt){var Ot=Vt.xStart,vt=Vt.yStart,wn=Vt.xAnchor1,Ce=Vt.yAnchor1,ge=Vt.xAnchor2,pe=Vt.yAnchor2,ne=Vt.xEnd,ae=Vt.yEnd,ue=Vt.lineStyle,de=Vt.offset;if(de&&de!==0){var Se=ue==="straight"?Math.atan2(ae-vt,ne-Ot):Math.atan2(Ce-vt,wn-Ot),Ie=de*Math.cos(Se),nt=de*Math.sin(Se);ue!=="straight"&&(Ot+=Ie,vt+=nt),ne-=Ie,ae-=nt}var Oe="M".concat(Ot,",").concat(vt," ");return["curve","angle"].includes(ue)&&(Oe+="".concat(ue==="curve"?"C":"").concat(wn,",").concat(Ce," ").concat(ge,",").concat(pe," ")),Oe+="".concat(ne,",").concat(ae)}({xStart:ie,yStart:K,xAnchor1:me,yAnchor1:Ee,xAnchor2:je.xAnchor2,yAnchor2:je.yAnchor2,xEnd:le,yEnd:ke,lineStyle:A,offset:M}),Ze=f(ie,K,le,ke),We=Ze.xLabel,ut=Ze.yLabel,st=Ze.labelWidth,mt=Ze.labelHeight,Rt="url(#".concat(E,")");return l.default.createElement("g",{className:g},l.default.createElement("path",{d:qe,style:{fill:"none",stroke:x,strokeWidth:k,strokeDasharray:D},markerStart:N?Rt:void 0,markerEnd:P?void 0:Rt}),B&&l.default.createElement("path",Object.assign({d:qe,style:{fill:"none",stroke:"rgba(0, 0, 0, 0)",strokeWidth:z,cursor:B?Y:"initial",pointerEvents:"all"}},B)),R&&l.default.createElement("foreignObject",{x:We,y:ut,width:st,height:mt,style:{overflow:"visible",pointerEvents:"none"}},l.default.createElement("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",pointerEvents:"all"}},l.default.createElement("div",null,R))))}},function(r,s,o){Object.defineProperty(s,"__esModule",{value:!0}),s.computeArrowDirectionVector=void 0,s.computeArrowDirectionVector=function(a){switch(a){case"left":return{arrowX:-1,arrowY:0};case"right":return{arrowX:1,arrowY:0};case"top":return{arrowX:0,arrowY:-1};case"bottom":return{arrowX:0,arrowY:1};default:return{arrowX:0,arrowY:0}}}},function(r,s,o){var a=this&&this.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(s,"__esModule",{value:!0}),s.ArrowMarkers=void 0;var l=a(o(0)),c=o(4),u=o(3),d=function(f,p){return function(){var g,m,_,b,y,x,k,D,R,E,A,M,N=((m=(g=f.endShape)===null||g===void 0?void 0:g.circle)===null||m===void 0?void 0:m.radius)||((_=p.circle)===null||_===void 0?void 0:_.radius)||c.endShapeDefaultProp.circle.radius,P=((y=(b=f.endShape)===null||b===void 0?void 0:b.circle)===null||y===void 0?void 0:y.strokeWidth)||((x=p.circle)===null||x===void 0?void 0:x.strokeWidth)||c.endShapeDefaultProp.circle.strokeWidth,O=((D=(k=f.endShape)===null||k===void 0?void 0:k.circle)===null||D===void 0?void 0:D.strokeColor)||((R=p.circle)===null||R===void 0?void 0:R.strokeColor)||c.endShapeDefaultProp.circle.strokeColor,B=((A=(E=f.endShape)===null||E===void 0?void 0:E.circle)===null||A===void 0?void 0:A.fillColor)||((M=p.circle)===null||M===void 0?void 0:M.fillColor)||c.endShapeDefaultProp.circle.fillColor;return{markerWidth:4*N,markerHeight:4*N,refX:2*N+P,refY:2*N,path:l.default.createElement("circle",{cx:2*N,cy:2*N,r:N,fill:B,stroke:O,strokeWidth:P})}}},h=function(f,p,g){return function(){var m,_,b,y,x,k,D,R,E=f.strokeColor||g,A=(x=(b=(_=(m=f.endShape)===null||m===void 0?void 0:m.arrow)===null||_===void 0?void 0:_.arrowLength)!==null&&b!==void 0?b:(y=p==null?void 0:p.arrow)===null||y===void 0?void 0:y.arrowLength)!==null&&x!==void 0?x:c.endShapeDefaultProp.arrow.arrowLength,M=((D=(k=f.endShape)===null||k===void 0?void 0:k.arrow)===null||D===void 0?void 0:D.arrowThickness)||((R=p==null?void 0:p.arrow)===null||R===void 0?void 0:R.arrowThickness)||c.endShapeDefaultProp.arrow.arrowThickness,N="M0,0 L0,".concat(M," L").concat(A,",").concat(M/2," z");return{markerWidth:A,markerHeight:M,refX:0,refY:M/2,path:l.default.createElement("path",{d:N,fill:E})}}};s.ArrowMarkers=function(f){var p=f.sourceToTargetsMap,g=f.endShape,m=f.strokeColor,_=f.uniqueId;return l.default.createElement(l.default.Fragment,null,(0,u.getSourceToTargets)(p).map(function(b){var y=b.source,x=b.target,k=b.style,D=function(P){var O=P.style,B=P.strokeColor,j=P.endShape,z=(0,u.getEndShapeFromStyle)(O);return{circle:d(O,j),arrow:h(O,j,B)}[z]()}({style:k===void 0?{}:k,endShape:g,strokeColor:m}),R=D.markerHeight,E=D.markerWidth,A=D.path,M=D.refX,N=D.refY;return l.default.createElement("marker",{id:(0,u.getMarkerId)(_,y,x),key:(0,u.getMarkerId)(_,y,x),markerWidth:E,markerHeight:R,refX:M,refY:N,orient:"auto-start-reverse",markerUnits:"strokeWidth"},A)}))}},function(r,s,o){Object.defineProperty(s,"__esModule",{value:!0}),s.useResizeListener=s.useObserveElements=void 0;var a=o(0);s.useObserveElements=function(l,c){(0,a.useEffect)(function(){return Object.keys(l).map(function(u){c.observe(l[u])}),function(){Object.keys(l).map(function(u){c.unobserve(l[u])})}},[l,c])},s.useResizeListener=function(l){(0,a.useEffect)(function(){return window&&window.addEventListener("resize",l),function(){window&&window.removeEventListener("resize",l)}},[l])}}])})}(V8)),V8.exports}var L4e=njt();const Zd={active:AS[500],dead:Yu[500],empty:{dark:xi[800],light:xi[100]},default:RS[400]},ED={background:{dark:xi[800],light:xi[100]},text:{dark:xi[100],light:xi[800]}},D4e={dragAndDrop:{awaiting:{border:"1px dashed #fff"}}},E4e=ye("div")(({theme:i,state:e,dragAndDropState:n,isTransferring:r,sx:s})=>{let o;switch(e){case"active":o=Zd.active;break;case"dead":o=Zd.dead;break;case"empty":o=i.palette.mode==="dark"?Zd.empty.dark:Zd.empty.light;break;default:o=Zd.default}const a={};switch(n){case"grabbed":a.cursor="grabbing",a.transform="scale(1.05)",a.zIndex=1e3,a.opacity=.6,a.filter="grayscale(0.3)";break;case"awaiting":a.border=D4e.dragAndDrop.awaiting.border,a.backgroundColor=Pt(o,.8),a.cursor=e==="empty"?"copy":"default",a["&:hover"]={transform:"scale(1.02)",backgroundColor:Pt(Zd.active,.7)};break}return{borderRadius:2,backgroundColor:o,minHeight:"32px",maxHeight:"80px",alignSelf:"stretch",display:"flex",flexDirection:"column",aspectRatio:"11/16",width:"100%",minWidth:"22px",overflow:"hidden",position:"relative",padding:"4px 2px",transition:"all 0.2s ease-in-out",userSelect:"none",cursor:e==="active"&&!r?"grab":"default",zIndex:1,"& .MuiTypography-root":{color:qp(o,.8),position:"relative",margin:"0 auto",zIndex:2},...a,...s}}),ijt=ye(({className:i,...e})=>C.jsx(ua,{...e,classes:{popper:i}}))(({theme:i})=>({[`& .${co.tooltip}`]:{backgroundColor:i.palette.mode==="dark"?ED.background.dark:ED.background.light,color:i.palette.mode==="dark"?ED.text.dark:ED.text.light,boxShadow:i.shadows[5]},[`& .${co.arrow}`]:{color:i.palette.mode==="dark"?ED.background.dark:ED.background.light}})),w0=({label:i,value:e})=>C.jsxs(Je,{variant:"caption",children:[C.jsxs("b",{children:[i,":"]})," ",e]});w0.propTypes={label:Z.string.isRequired,value:Z.oneOfType([Z.string,Z.number]).isRequired};const Ice=({id:i,currentPeerId:e,shard:n,transfer:r,peersNumber:s,dragAndDropState:o,onSlotGrab:a,onSlotDrop:l,onDragCancel:c})=>{const u=$i(),d=FW(u.breakpoints.down("md")),h=[];if(r!=null&&r.transfer){let m,_;r.transfer.to>r.transfer.from?(m="left",_="right"):(m="right",_="left"),h.push({targetId:`${r.transfer.to}-${r.transfer.to_shard_id||r.transfer.shard_id}`,targetAnchor:m,sourceAnchor:_,style:{strokeWidth:"2",endMarker:!0,endShape:{arrow:{arrowLength:2}}}})}const f=m=>{n&&n.state==="Active"&&!o&&!(r!=null&&r.transfer)&&a(m,e,i,n)},p=()=>{o==="awaiting"&&!n&&l(e,i)},g=()=>{o==="grabbed"&&c()};return C.jsx(L4e.ArcherElement,{id:`${e}-${i}`,relations:h,children:C.jsx("div",{style:{position:"static"},children:C.jsx(ijt,{arrow:!0,placement:"top",title:n?C.jsxs(C.Fragment,{children:[C.jsx(w0,{label:"Peer Id",value:e}),"shard_id"in n&&C.jsxs(C.Fragment,{children:[C.jsx("br",{}),C.jsx(w0,{label:"Shard Id",value:n.shard_id})]}),n.shard_key&&C.jsxs(C.Fragment,{children:[C.jsx("br",{}),C.jsx(w0,{label:"Shard Key",value:n.shard_key})]}),n.state&&C.jsxs(C.Fragment,{children:[C.jsx("br",{}),C.jsx(w0,{label:"Shard State",value:n.state})]}),n.state==="Active"&&!(r!=null&&r.transfer)&&C.jsxs(C.Fragment,{children:[C.jsx("br",{}),C.jsx(Je,{variant:"caption",sx:{color:u.palette.success.main,fontWeight:"bold"},children:"Drag to an empty slot to transfer"})]}),(r==null?void 0:r.transfer)&&C.jsxs(C.Fragment,{children:[C.jsx("br",{}),C.jsxs(Je,{variant:"caption",sx:{color:u.palette.warning.main,fontWeight:"bold"},children:["Transferring to peer ",r.transfer.to]}),C.jsx("br",{}),C.jsx(Je,{variant:"caption",sx:{color:u.palette.error.main,fontStyle:"italic"},children:"Cannot be dragged during transfer"})]})]}):o==="awaiting"?C.jsxs(C.Fragment,{children:[C.jsx(w0,{label:"Peer Id",value:e}),C.jsx("br",{}),C.jsx(w0,{label:"Slot Id",value:i}),C.jsx("br",{}),C.jsx(Je,{variant:"caption",sx:{color:"#fff",fontWeight:"bold"},children:"Drop here to move shard"})]}):C.jsxs(C.Fragment,{children:[C.jsx(w0,{label:"Peer Id",value:e}),C.jsx("br",{}),C.jsx(w0,{label:"Slot Id",value:i}),C.jsx("br",{}),C.jsx(Je,{variant:"caption",children:"Empty slot"})]}),children:C.jsxs(E4e,{state:n?n.state.toLowerCase():"empty",dragAndDropState:o,isTransferring:!!(r!=null&&r.transfer),onMouseDown:f,onMouseUp:p,onDragEnd:g,draggable:n&&n.state==="Active"&&!o&&!(r!=null&&r.transfer),"data-cluster-slot":"true",children:[n&&C.jsx(Je,{variant:"subtitle2",sx:{textAlign:"center",fontWeight:"bold"},children:`${!d&&s<=12?"Shard":""} ${n.shard_id}`}),(n==null?void 0:n.shard_key)&&C.jsxs(C.Fragment,{children:[C.jsx("br",{}),C.jsx(Je,{variant:"subtitle2",sx:{textAlign:"center",fontWeight:"bold"},children:s<=10?`${n.shard_key}`:""})]})]})})})})};Ice.displayName="Slot";Ice.propTypes={id:Z.number.isRequired,currentPeerId:Z.number.isRequired,shard:Z.shape({shard_id:Z.number.isRequired,state:Z.string,points_count:Z.number,peer_id:Z.number.isRequired,shard_key:Z.string}),transfer:Z.shape({transfer:Z.shape({shard_id:Z.number,from:Z.number,to:Z.number,to_shard_id:Z.number})}),peersNumber:Z.number,dragAndDropState:Z.oneOf(["grabbed","awaiting",null]),onSlotGrab:Z.func.isRequired,onSlotDrop:Z.func.isRequired,onDragCancel:Z.func.isRequired};const rjt=ye("div")(()=>({display:"flex",flexDirection:"column",gap:"0.5rem"})),I4e=({peerId:i,cluster:e,dragState:n,onSlotGrab:r,onSlotDrop:s,onDragCancel:o})=>{const a=e.shards.reduce((d,h)=>Math.max(d,h.shard_id),0),l=e.shards.reduce((d,h)=>Math.min(d,h.shard_id),a),c=e.shards.length,u=e.shards.filter(d=>d.peer_id===i);return C.jsx(rjt,{children:c&&Array.from({length:a-l+1},(d,h)=>{const f=l+h,p=u.find(_=>_.shard_id===f);let g;p&&(g={transfer:e.shard_transfers.find(b=>b.shard_id===p.shard_id&&b.from===i)});let m=null;return n.isDragging&&(n.draggedSlot.peerId===i&&n.draggedSlot.slotId===f?m="grabbed":!p&&n.draggedSlot.slotId===f&&(m="awaiting")),C.jsx(Ice,{id:f,currentPeerId:i,shard:p,transfer:g,peersNumber:e==null?void 0:e.peers.length,dragAndDropState:m,onSlotGrab:r,onSlotDrop:s,onDragCancel:o},`${i}-${f}`)})||C.jsx("div",{children:"No slots available"})})};I4e.propTypes={peerId:Z.number.isRequired,cluster:Z.shape({shards:Z.array.isRequired,shard_transfers:Z.arrayOf(Z.shape({shard_id:Z.number,from:Z.number,to:Z.number})),peers:Z.arrayOf(Z.number)}).isRequired,dragState:Z.shape({isDragging:Z.bool.isRequired,draggedSlot:Z.object}).isRequired,onSlotGrab:Z.func.isRequired,onSlotDrop:Z.func.isRequired,onDragCancel:Z.func.isRequired};const GD=({color:i,size:e,sx:n})=>C.jsx(aje,{sx:{width:e,height:e,borderRadius:"50%",backgroundColor:i,display:"inline-block",...n}});GD.propTypes={color:Z.string.isRequired,size:Z.string.isRequired,sx:Z.object};const T4e=({open:i,onClose:e,transferRequest:n,onConfirm:r,loading:s=!1,collectionName:o})=>{const a=$i();if(!n)return null;const{shard:l,fromPeerId:c,toPeerId:u}=n,d={move_shard:{shard_id:l.shard_id,to_peer_id:u,from_peer_id:c}},h=JSON.stringify(d,null,2),f=()=>{r(n)};return C.jsxs(Vm,{open:i,onClose:e,maxWidth:"md",fullWidth:!0,children:[C.jsx(tx,{children:C.jsx(Je,{variant:"h6",component:"div",children:"Transfer Shard"})}),C.jsx(a1,{children:C.jsxs(Ye,{sx:{mb:3},children:[C.jsx(l_,{severity:"info",sx:{mb:2},children:C.jsxs(Je,{variant:"body2",children:["This action will move shard ",l.shard_id," from peer ",c," to peer ",u,".",l.shard_key&&` Shard key: ${l.shard_key}`]})}),C.jsxs(Ye,{sx:{mb:2},children:[C.jsxs(Ye,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[C.jsx(Je,{variant:"subtitle2",fontWeight:"bold",children:"Request"}),C.jsx(p_,{text:`POST collections/${o}/cluster
${h}`,tooltip:"Copy request to clipboard",successMessage:"Request copied to clipboard"})]}),C.jsxs(Ye,{sx:{border:`1px solid ${a.palette.divider}`,borderRadius:1,p:1,backgroundColor:a.palette.background.paper,fontFamily:"monospace",fontSize:"0.875rem"},children:[C.jsxs(Je,{variant:"body2",sx:{color:a.palette.primary.main,fontWeight:"bold",mb:1,fontFamily:"monospace"},children:["POST collections/",o,"/cluster"]}),C.jsx(t4e,{value:d,theme:a.palette.mode==="dark"?"dark":"light",style:{backgroundColor:"transparent",fontSize:"0.875rem"},enableClipboard:!1,displayDataTypes:!1,rootName:!1})]})]}),C.jsxs(Ye,{children:[C.jsx(Je,{variant:"subtitle2",fontWeight:"bold",sx:{mb:1},children:"Shard Details"}),C.jsxs(Ye,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",gap:1,fontSize:"0.875rem"},children:[C.jsx(Je,{variant:"body2",color:"text.secondary",children:"ID:"}),C.jsx(Je,{variant:"body2",children:l.shard_id}),C.jsx(Je,{variant:"body2",color:"text.secondary",children:"State:"}),C.jsx(Je,{variant:"body2",sx:{color:l.state==="Active"?"success.main":"warning.main",fontWeight:"medium"},children:l.state}),l.shard_key&&C.jsxs(C.Fragment,{children:[C.jsx(Je,{variant:"body2",color:"text.secondary",children:"Key:"}),C.jsx(Je,{variant:"body2",fontFamily:"monospace",children:l.shard_key})]}),C.jsx(Je,{variant:"body2",color:"text.secondary",children:"From Peer:"}),C.jsx(Je,{variant:"body2",children:c}),C.jsx(Je,{variant:"body2",color:"text.secondary",children:"To Peer:"}),C.jsx(Je,{variant:"body2",children:u})]})]})]})}),C.jsxs(CE,{sx:{px:3,pb:2},children:[C.jsx(Ci,{onClick:e,disabled:s,children:"Cancel"}),C.jsx(Ci,{onClick:f,variant:"contained",color:"primary",disabled:s,children:s?"Transferring...":"Confirm Transfer"})]})]})};T4e.propTypes={open:Z.bool.isRequired,onClose:Z.func.isRequired,transferRequest:Z.shape({shard:Z.shape({shard_id:Z.number.isRequired,state:Z.string.isRequired,shard_key:Z.oneOfType([Z.string,Z.number])}).isRequired,fromPeerId:Z.number.isRequired,toPeerId:Z.number.isRequired}),onConfirm:Z.func.isRequired,loading:Z.bool,collectionName:Z.string.isRequired};const R4e=({sx:i,dragState:e})=>{const n=$i();return C.jsx(Ye,{sx:{padding:"0 10px",margin:"10px 0",...i},children:C.jsxs(Ye,{sx:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[C.jsxs(Ye,{display:"flex",alignItems:"center",gap:.5,children:[C.jsx(GD,{size:"1rem",color:n.palette.mode==="dark"?Zd.empty.dark:Zd.empty.light}),C.jsx(Je,{variant:"caption",children:"Empty"})]}),C.jsxs(Ye,{display:"flex",alignItems:"center",gap:.5,children:[C.jsx(GD,{size:"1rem",color:Zd.active}),C.jsx(Je,{variant:"caption",children:"Active"})]}),C.jsxs(Ye,{display:"flex",alignItems:"center",gap:.5,children:[C.jsx(GD,{size:"1rem",color:Zd.dead}),C.jsx(Je,{variant:"caption",children:"Dead"})]}),C.jsxs(Ye,{display:"flex",alignItems:"center",gap:.5,children:[C.jsx(GD,{size:"1rem",color:Zd.default}),C.jsx(Je,{variant:"caption",children:"Other"})]}),e.isDragging&&C.jsxs(Ye,{display:"flex",alignItems:"center",gap:.5,sx:{ml:2,pl:2,borderLeft:"1px solid #ccc"},children:[C.jsx(GD,{size:"1rem",color:n.palette.mode==="dark"?Zd.empty.dark:Zd.empty.light,sx:{border:D4e.dragAndDrop.awaiting.border}}),C.jsx(Je,{variant:"caption",children:"Drop Here"})]})]})})};R4e.propTypes={sx:Z.object,dragState:Z.shape({isDragging:Z.bool.isRequired,draggedSlot:Z.object})};const A4e=({collectionName:i})=>{var k;const e=$i(),{client:n,isRestricted:r}=Ur(),[s,o]=nn.useState(null),[a,l]=nn.useState({isDragging:!1,draggedSlot:null}),[c,u]=nn.useState({x:0,y:0}),[d,h]=nn.useState({open:!1,transferRequest:null}),[f,p]=nn.useState(!1),g=(D,R,E,A)=>{!A||A.state!=="Active"||(l({isDragging:!0,draggedSlot:{peerId:R,slotId:E,shard:A}}),u({x:D.clientX,y:D.clientY}))},m=D=>{a.isDragging&&u({x:D.clientX,y:D.clientY});const R=document.querySelector("[data-cluster-monitor]");if(R){const E=R.getBoundingClientRect(),A=R.scrollLeft,M=R.scrollWidth,N=R.clientWidth,P=D.clientX-E.left,O=16;P>N-50&&A+N<M&&(R.scrollLeft=A+O),P<50&&A>0&&(R.scrollLeft=A-O)}},_=(D,R)=>{if(!a.isDragging||!a.draggedSlot)return;const{peerId:E,slotId:A}=a.draggedSlot;if(E===D&&A===R){l({isDragging:!1,draggedSlot:null});return}h({open:!0,transferRequest:{shard:a.draggedSlot.shard,fromPeerId:E,toPeerId:D}}),l({isDragging:!1,draggedSlot:null})},b=async D=>{p(!0);try{await n.updateCollectionCluster(i,{move_shard:{shard_id:D.shard.shard_id,to_peer_id:D.toPeerId,from_peer_id:D.fromPeerId}}),rf("Shard transfer initiated successfully",as("success",Xd,2e3)),h({open:!1,transferRequest:null}),(async()=>{var E,A,M,N;try{const P=await kE.get("/cluster"),B=(await n.api("cluster").collectionClusterInfo({collection_name:i})).data.result,j=B.local_shards.length&&B.local_shards.map(z=>({...z,peer_id:B.peer_id}));B.shards=[...j||[],...B.remote_shards||[]],B.peers=(A=(E=P==null?void 0:P.data)==null?void 0:E.result)!=null&&A.peers?Object.keys(P.data.result.peers).map(z=>parseInt(z)).sort((z,H)=>z-H):[],B.status=((N=(M=P==null?void 0:P.data)==null?void 0:M.result)==null?void 0:N.status)||"disabled",o({...B})}catch(P){console.error("Error refreshing cluster info:",P)}})()}catch(R){console.error("Error moving shard:",R),rf(`Failed to transfer shard: ${R.message}`,as("error",Xd))}finally{p(!1)}},y=()=>{h({open:!1,transferRequest:null})},x=()=>{l({isDragging:!1,draggedSlot:null})};return $.useEffect(()=>{const D=E=>{a.isDragging&&!E.target.closest("[data-cluster-slot]")&&x()},R=E=>{E.key==="Escape"&&a.isDragging&&x()};return a.isDragging&&(document.addEventListener("click",D),document.addEventListener("keydown",R),document.addEventListener("mousemove",m)),()=>{document.removeEventListener("click",D),document.removeEventListener("keydown",R),document.removeEventListener("mousemove",m)}},[a.isDragging]),$.useEffect(()=>{(async()=>{var R,E,A,M;if(!r)try{const N=await kE.get("/cluster"),O=(await n.api("cluster").collectionClusterInfo({collection_name:i})).data.result,B=O.local_shards.length&&O.local_shards.map(j=>({...j,peer_id:O.peer_id}));O.shards=[...B||[],...O.remote_shards||[]],O.peers=(E=(R=N==null?void 0:N.data)==null?void 0:R.result)!=null&&E.peers?Object.keys(N.data.result.peers).map(j=>parseInt(j)).sort((j,z)=>j-z):[],O.status=((M=(A=N==null?void 0:N.data)==null?void 0:A.result)==null?void 0:M.status)||"disabled",o({...O})}catch(N){rf(N.message,as("error",Xd))}})()},[i,r,n]),!s||s.status!=="enabled"?C.jsx(Ye,{children:C.jsx(tce,{severity:"warning",hideCloseButton:!0,children:C.jsx(Je,{children:"Distributed mode is not enabled for this cluster."})})}):C.jsxs(Ye,{sx:{display:"grid",gridTemplateColumns:"20px 1fr",gridTemplateRows:"auto 1fr",gridColumnGap:"0.5rem",gridRowGap:0,[e.breakpoints.up("md")]:{gridTemplateColumns:"50px 1fr"}},children:[C.jsx(Ye,{sx:{gridArea:"1 / 2 / 2 / 3"},children:C.jsx(Je,{variant:"subtitle1",mb:2,children:"Cluster Nodes"})}),C.jsx(Ye,{sx:{gridArea:" 1 / 3 / 2 / 6",justifyContent:"end"},children:C.jsx(R4e,{dragState:a})}),C.jsx(Ye,{sx:{gridArea:"1 / 1 / 6 / 2",alignContent:"center"},children:C.jsx(Je,{variant:"subtitle1",sx:{writingMode:"vertical-lr",textAlign:"center",transform:"rotate(180deg)"},children:"Shards"})}),C.jsx(Ye,{"data-cluster-monitor":!0,sx:{width:"auto",height:"fit-content",padding:"0.5rem 0.5rem 1.5rem 0.5rem",overflowX:"auto",gridArea:"2 / 2 / 6 / 10","& svg":{zIndex:10}},children:C.jsx(Ye,{sx:{minWidth:"100%",width:"max-content"},children:C.jsx(L4e.ArcherContainer,{strokeColor:e.palette.mode==="dark"?"#d4d9e6":"#647cb9",lineStyle:"angle",children:C.jsx(ln,{container:!0,spacing:2,children:(k=s.peers)==null?void 0:k.map(D=>C.jsx(ln,{size:"grow",children:C.jsx(I4e,{peerId:D,cluster:s,dragState:a,onSlotGrab:g,onSlotDrop:_,onDragCancel:x})},D))})})})}),a.isDragging&&a.draggedSlot&&C.jsx(C.Fragment,{children:C.jsx(Ye,{sx:{position:"fixed",left:c.x+10,top:c.y+10,width:"50px",height:"50px",zIndex:9999,pointerEvents:"none",transform:"translate(-50%, -50%)",transition:"none",filter:"drop-shadow(0 8px 16px rgba(0,0,0,0.4))"},children:C.jsxs(E4e,{state:a.draggedSlot.shard.state.toLowerCase(),dragAndDropState:"grabbed",sx:{width:"50px",height:"50px",opacity:.9,transform:"scale(1.1) rotate(5deg)",boxShadow:"0 6px 24px rgba(0,0,0,0.4)"},children:[C.jsx(Je,{variant:"caption",sx:{textAlign:"center",fontWeight:"bold",fontSize:"0.8rem",lineHeight:1,color:"white",textShadow:"0 1px 2px rgba(0,0,0,0.8)"},children:a.draggedSlot.shard.shard_id}),a.draggedSlot.shard.shard_key&&C.jsx(Je,{variant:"caption",sx:{textAlign:"center",fontSize:"0.6rem",lineHeight:1,color:"rgba(255,255,255,0.8)",textShadow:"0 1px 2px rgba(0,0,0,0.8)"},children:a.draggedSlot.shard.shard_key})]})})}),C.jsx(T4e,{open:d.open,onClose:y,transferRequest:d.transferRequest,onConfirm:b,loading:f,collectionName:i})]})};A4e.propTypes={collectionName:Z.string};function sjt(){const{collectionName:i}=V1(),e=z1(),n=Wv(),[r,s]=$.useState(n.hash.slice(1)||"points"),{isRestricted:o}=Ur(),a=(l,c)=>{typeof c=="string"&&(s(c),e(`#${c}`))};return C.jsx(C.Fragment,{children:C.jsx(iT,{children:C.jsxs(ln,{container:!0,maxWidth:"xl",width:"100%",children:[C.jsx(ln,{size:12,children:C.jsx(Je,{variant:"h4",mb:3,children:i})}),C.jsx(ln,{size:12,children:C.jsx(Ye,{sx:{borderBottom:1,borderColor:"divider",mb:"2.5rem"},children:C.jsxs(ose,{value:r,onChange:a,"aria-label":"tabs","aria-description":"Collection tabs menu",children:[C.jsx(mp,{label:"Points",value:"points"}),C.jsx(mp,{label:"Info",value:"info"}),!o&&C.jsx(mp,{label:"Cluster",value:"cluster"}),!o&&C.jsx(mp,{label:"Search Quality",value:"quality"}),!o&&C.jsx(mp,{label:"Snapshots",value:"snapshots"}),C.jsx(mp,{label:"Visualize",component:lh,to:`${n.pathname}/visualize`}),C.jsx(mp,{label:"Graph",component:lh,to:`${n.pathname}/graph`})]})})}),C.jsxs(ln,{size:12,children:[r==="info"&&C.jsx(JBt,{collectionName:i}),!o&&r==="quality"&&C.jsx(k4e,{collectionName:i}),r==="points"&&C.jsx(g4e,{collectionName:i}),!o&&r==="snapshots"&&C.jsx(p5e,{collectionName:i}),r==="cluster"&&C.jsx(A4e,{collectionName:i})]})]})})})}/*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*/function P4(i){return i+.5|0}const Ty=(i,e,n)=>Math.max(Math.min(i,n),e);function RN(i){return Ty(P4(i*2.55),0,255)}function n1(i){return Ty(P4(i*255),0,255)}function O0(i){return Ty(P4(i/2.55)/100,0,1)}function qwe(i){return Ty(P4(i*100),0,100)}const Kh={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Pie=[..."0123456789ABCDEF"],ojt=i=>Pie[i&15],ajt=i=>Pie[(i&240)>>4]+Pie[i&15],CB=i=>(i&240)>>4===(i&15),ljt=i=>CB(i.r)&&CB(i.g)&&CB(i.b)&&CB(i.a);function cjt(i){var e=i.length,n;return i[0]==="#"&&(e===4||e===5?n={r:255&Kh[i[1]]*17,g:255&Kh[i[2]]*17,b:255&Kh[i[3]]*17,a:e===5?Kh[i[4]]*17:255}:(e===7||e===9)&&(n={r:Kh[i[1]]<<4|Kh[i[2]],g:Kh[i[3]]<<4|Kh[i[4]],b:Kh[i[5]]<<4|Kh[i[6]],a:e===9?Kh[i[7]]<<4|Kh[i[8]]:255})),n}const ujt=(i,e)=>i<255?e(i):"";function djt(i){var e=ljt(i)?ojt:ajt;return i?"#"+e(i.r)+e(i.g)+e(i.b)+ujt(i.a,e):void 0}const hjt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function N4e(i,e,n){const r=e*Math.min(n,1-n),s=(o,a=(o+i/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function fjt(i,e,n){const r=(s,o=(s+i/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function pjt(i,e,n){const r=N4e(i,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)r[s]*=1-e-n,r[s]+=e;return r}function gjt(i,e,n,r,s){return i===s?(e-n)/r+(e<n?6:0):e===s?(n-i)/r+2:(i-e)/r+4}function Tce(i){const n=i.r/255,r=i.g/255,s=i.b/255,o=Math.max(n,r,s),a=Math.min(n,r,s),l=(o+a)/2;let c,u,d;return o!==a&&(d=o-a,u=l>.5?d/(2-o-a):d/(o+a),c=gjt(n,r,s,d,o),c=c*60+.5),[c|0,u||0,l]}function Rce(i,e,n,r){return(Array.isArray(e)?i(e[0],e[1],e[2]):i(e,n,r)).map(n1)}function Ace(i,e,n){return Rce(N4e,i,e,n)}function mjt(i,e,n){return Rce(pjt,i,e,n)}function _jt(i,e,n){return Rce(fjt,i,e,n)}function M4e(i){return(i%360+360)%360}function vjt(i){const e=hjt.exec(i);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?RN(+e[5]):n1(+e[5]));const s=M4e(+e[2]),o=+e[3]/100,a=+e[4]/100;return e[1]==="hwb"?r=mjt(s,o,a):e[1]==="hsv"?r=_jt(s,o,a):r=Ace(s,o,a),{r:r[0],g:r[1],b:r[2],a:n}}function bjt(i,e){var n=Tce(i);n[0]=M4e(n[0]+e),n=Ace(n),i.r=n[0],i.g=n[1],i.b=n[2]}function yjt(i){if(!i)return;const e=Tce(i),n=e[0],r=qwe(e[1]),s=qwe(e[2]);return i.a<255?`hsla(${n}, ${r}%, ${s}%, ${O0(i.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const Kwe={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Gwe={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function wjt(){const i={},e=Object.keys(Gwe),n=Object.keys(Kwe);let r,s,o,a,l;for(r=0;r<e.length;r++){for(a=l=e[r],s=0;s<n.length;s++)o=n[s],l=l.replace(o,Kwe[o]);o=parseInt(Gwe[a],16),i[l]=[o>>16&255,o>>8&255,o&255]}return i}let SB;function Cjt(i){SB||(SB=wjt(),SB.transparent=[0,0,0,0]);const e=SB[i.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Sjt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function xjt(i){const e=Sjt.exec(i);let n=255,r,s,o;if(e){if(e[7]!==r){const a=+e[7];n=e[8]?RN(a):Ty(a*255,0,255)}return r=+e[1],s=+e[3],o=+e[5],r=255&(e[2]?RN(r):Ty(r,0,255)),s=255&(e[4]?RN(s):Ty(s,0,255)),o=255&(e[6]?RN(o):Ty(o,0,255)),{r,g:s,b:o,a:n}}}function kjt(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${O0(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const gY=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,ID=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Ljt(i,e,n){const r=ID(O0(i.r)),s=ID(O0(i.g)),o=ID(O0(i.b));return{r:n1(gY(r+n*(ID(O0(e.r))-r))),g:n1(gY(s+n*(ID(O0(e.g))-s))),b:n1(gY(o+n*(ID(O0(e.b))-o))),a:i.a+n*(e.a-i.a)}}function xB(i,e,n){if(i){let r=Tce(i);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=Ace(r),i.r=r[0],i.g=r[1],i.b=r[2]}}function P4e(i,e){return i&&Object.assign(e||{},i)}function Xwe(i){var e={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(e={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(e.a=n1(i[3]))):(e=P4e(i,{r:0,g:0,b:0,a:1}),e.a=n1(e.a)),e}function Djt(i){return i.charAt(0)==="r"?xjt(i):vjt(i)}let O4e=class Oie{constructor(e){if(e instanceof Oie)return e;const n=typeof e;let r;n==="object"?r=Xwe(e):n==="string"&&(r=cjt(e)||Cjt(e)||Djt(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=P4e(this._rgb);return e&&(e.a=O0(e.a)),e}set rgb(e){this._rgb=Xwe(e)}rgbString(){return this._valid?kjt(this._rgb):void 0}hexString(){return this._valid?djt(this._rgb):void 0}hslString(){return this._valid?yjt(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,s=e.rgb;let o;const a=n===o?.5:n,l=2*a-1,c=r.a-s.a,u=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;o=1-u,r.r=255&u*r.r+o*s.r+.5,r.g=255&u*r.g+o*s.g+.5,r.b=255&u*r.b+o*s.b+.5,r.a=a*r.a+(1-a)*s.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=Ljt(this._rgb,e._rgb,n)),this}clone(){return new Oie(this.rgb)}alpha(e){return this._rgb.a=n1(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=P4(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return xB(this._rgb,2,e),this}darken(e){return xB(this._rgb,2,-e),this}saturate(e){return xB(this._rgb,1,e),this}desaturate(e){return xB(this._rgb,1,-e),this}rotate(e){return bjt(this._rgb,e),this}};/*!
* Chart.js v4.5.0
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/function f0(){}const Ejt=(()=>{let i=0;return()=>i++})();function rr(i){return i==null}function fo(i){if(Array.isArray&&Array.isArray(i))return!0;const e=Object.prototype.toString.call(i);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function cr(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function zo(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Vd(i,e){return zo(i)?i:e}function Li(i,e){return typeof i>"u"?e:i}const Ijt=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/e,F4e=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*e:+i;function $s(i,e,n){if(i&&typeof i.call=="function")return i.apply(n,e)}function ss(i,e,n,r){let s,o,a;if(fo(i))for(o=i.length,s=0;s<o;s++)e.call(n,i[s],s);else if(cr(i))for(a=Object.keys(i),o=a.length,s=0;s<o;s++)e.call(n,i[a[s]],a[s])}function Fj(i,e){let n,r,s,o;if(!i||!e||i.length!==e.length)return!1;for(n=0,r=i.length;n<r;++n)if(s=i[n],o=e[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Bj(i){if(fo(i))return i.map(Bj);if(cr(i)){const e=Object.create(null),n=Object.keys(i),r=n.length;let s=0;for(;s<r;++s)e[n[s]]=Bj(i[n[s]]);return e}return i}function B4e(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Tjt(i,e,n,r){if(!B4e(i))return;const s=e[i],o=n[i];cr(s)&&cr(o)?jO(s,o,r):e[i]=Bj(o)}function jO(i,e,n){const r=fo(e)?e:[e],s=r.length;if(!cr(i))return i;n=n||{};const o=n.merger||Tjt;let a;for(let l=0;l<s;++l){if(a=r[l],!cr(a))continue;const c=Object.keys(a);for(let u=0,d=c.length;u<d;++u)o(c[u],i,a,n)}return i}function OM(i,e){return jO(i,e,{merger:Rjt})}function Rjt(i,e,n){if(!B4e(i))return;const r=e[i],s=n[i];cr(r)&&cr(s)?OM(r,s):Object.prototype.hasOwnProperty.call(e,i)||(e[i]=Bj(s))}const Ywe={"":i=>i,x:i=>i.x,y:i=>i.y};function Ajt(i){const e=i.split("."),n=[];let r="";for(const s of e)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function Njt(i){const e=Ajt(i);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function O1(i,e){return(Ywe[e]||(Ywe[e]=Njt(e)))(i)}function Nce(i){return i.charAt(0).toUpperCase()+i.slice(1)}const WO=i=>typeof i<"u",F1=i=>typeof i=="function",Zwe=(i,e)=>{if(i.size!==e.size)return!1;for(const n of i)if(!e.has(n))return!1;return!0};function Mjt(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const Or=Math.PI,io=2*Or,Pjt=io+Or,jj=Number.POSITIVE_INFINITY,Ojt=Or/180,aa=Or/2,CC=Or/4,Qwe=Or*2/3,Ry=Math.log10,jm=Math.sign;function FM(i,e,n){return Math.abs(i-e)<n}function Jwe(i){const e=Math.round(i);i=FM(i,e,i/1e3)?e:i;const n=Math.pow(10,Math.floor(Ry(i))),r=i/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Fjt(i){const e=[],n=Math.sqrt(i);let r;for(r=1;r<n;r++)i%r===0&&(e.push(r),e.push(i/r));return n===(n|0)&&e.push(n),e.sort((s,o)=>s-o).pop(),e}function Bjt(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function CI(i){return!Bjt(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function jjt(i,e){const n=Math.round(i);return n-e<=i&&n+e>=i}function j4e(i,e,n){let r,s,o;for(r=0,s=i.length;r<s;r++)o=i[r][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Op(i){return i*(Or/180)}function Mce(i){return i*(180/Or)}function eCe(i){if(!zo(i))return;let e=1,n=0;for(;Math.round(i*e)/e!==i;)e*=10,n++;return n}function W4e(i,e){const n=e.x-i.x,r=e.y-i.y,s=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*Or&&(o+=io),{angle:o,distance:s}}function Fie(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function Wjt(i,e){return(i-e+Pjt)%io-Or}function pc(i){return(i%io+io)%io}function $O(i,e,n,r){const s=pc(i),o=pc(e),a=pc(n),l=pc(o-s),c=pc(a-s),u=pc(s-o),d=pc(s-a);return s===o||s===a||r&&o===a||l>c&&u<d}function fl(i,e,n){return Math.max(e,Math.min(n,i))}function $jt(i){return fl(i,-32768,32767)}function ov(i,e,n,r=1e-6){return i>=Math.min(e,n)-r&&i<=Math.max(e,n)+r}function Pce(i,e,n){n=n||(a=>i[a]<e);let r=i.length-1,s=0,o;for(;r-s>1;)o=s+r>>1,n(o)?s=o:r=o;return{lo:s,hi:r}}const av=(i,e,n,r)=>Pce(i,n,r?s=>{const o=i[s][e];return o<n||o===n&&i[s+1][e]===n}:s=>i[s][e]<n),zjt=(i,e,n)=>Pce(i,n,r=>i[r][e]>=n);function Vjt(i,e,n){let r=0,s=i.length;for(;r<s&&i[r]<e;)r++;for(;s>r&&i[s-1]>n;)s--;return r>0||s<i.length?i.slice(r,s):i}const $4e=["push","pop","shift","splice","unshift"];function Hjt(i,e){if(i._chartjs){i._chartjs.listeners.push(e);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),$4e.forEach(n=>{const r="_onData"+Nce(n),s=i[n];Object.defineProperty(i,n,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return i._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...o)}),a}})})}function tCe(i,e){const n=i._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(e);s!==-1&&r.splice(s,1),!(r.length>0)&&($4e.forEach(o=>{delete i[o]}),delete i._chartjs)}function z4e(i){const e=new Set(i);return e.size===i.length?i:Array.from(e)}const V4e=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function H4e(i,e){let n=[],r=!1;return function(...s){n=s,r||(r=!0,V4e.call(window,()=>{r=!1,i.apply(e,n)}))}}function Ujt(i,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(i,e,r)):i.apply(this,r),e}}const Oce=i=>i==="start"?"left":i==="end"?"right":"center",uc=(i,e,n)=>i==="start"?e:i==="end"?n:(e+n)/2,qjt=(i,e,n,r)=>i===(r?"left":"right")?n:i==="center"?(e+n)/2:e;function U4e(i,e,n){const r=e.length;let s=0,o=r;if(i._sorted){const{iScale:a,vScale:l,_parsed:c}=i,u=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,d=a.axis,{min:h,max:f,minDefined:p,maxDefined:g}=a.getUserBounds();if(p){if(s=Math.min(av(c,d,h).lo,n?r:av(e,d,a.getPixelForValue(h)).lo),u){const m=c.slice(0,s+1).reverse().findIndex(_=>!rr(_[l.axis]));s-=Math.max(0,m)}s=fl(s,0,r-1)}if(g){let m=Math.max(av(c,a.axis,f,!0).hi+1,n?0:av(e,d,a.getPixelForValue(f),!0).hi+1);if(u){const _=c.slice(m-1).findIndex(b=>!rr(b[l.axis]));m+=Math.max(0,_)}o=fl(m,s,r)-s}else o=r-s}return{start:s,count:o}}function q4e(i){const{xScale:e,yScale:n,_scaleRanges:r}=i,s={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!r)return i._scaleRanges=s,!0;const o=r.xmin!==e.min||r.xmax!==e.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,s),o}const kB=i=>i===0||i===1,nCe=(i,e,n)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-e)*io/n)),iCe=(i,e,n)=>Math.pow(2,-10*i)*Math.sin((i-e)*io/n)+1,BM={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*aa)+1,easeOutSine:i=>Math.sin(i*aa),easeInOutSine:i=>-.5*(Math.cos(Or*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>kB(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>kB(i)?i:nCe(i,.075,.3),easeOutElastic:i=>kB(i)?i:iCe(i,.075,.3),easeInOutElastic(i){return kB(i)?i:i<.5?.5*nCe(i*2,.1125,.45):.5+.5*iCe(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let e=1.70158;return(i/=.5)<1?.5*(i*i*(((e*=1.525)+1)*i-e)):.5*((i-=2)*i*(((e*=1.525)+1)*i+e)+2)},easeInBounce:i=>1-BM.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?BM.easeInBounce(i*2)*.5:BM.easeOutBounce(i*2-1)*.5+.5};function Fce(i){if(i&&typeof i=="object"){const e=i.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function rCe(i){return Fce(i)?i:new O4e(i)}function mY(i){return Fce(i)?i:new O4e(i).saturate(.5).darken(.1).hexString()}const Kjt=["x","y","borderWidth","radius","tension"],Gjt=["color","borderColor","backgroundColor"];function Xjt(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),i.set("animations",{colors:{type:"color",properties:Gjt},numbers:{type:"number",properties:Kjt}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function Yjt(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const sCe=new Map;function Zjt(i,e){e=e||{};const n=i+JSON.stringify(e);let r=sCe.get(n);return r||(r=new Intl.NumberFormat(i,e),sCe.set(n,r)),r}function O4(i,e,n){return Zjt(e,n).format(i)}const K4e={values(i){return fo(i)?i:""+i},numeric(i,e,n){if(i===0)return"0";const r=this.chart.options.locale;let s,o=i;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),o=Qjt(i,n)}const a=Ry(Math.abs(o)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),O4(i,r,c)},logarithmic(i,e,n){if(i===0)return"0";const r=n[e].significand||i/Math.pow(10,Math.floor(Ry(i)));return[1,2,3,5,10,15].includes(r)||e>.8*n.length?K4e.numeric.call(this,i,e,n):""}};function Qjt(i,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&i!==Math.floor(i)&&(n=i-Math.floor(i)),n}var BV={formatters:K4e};function Jjt(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:BV.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Wx=Object.create(null),Bie=Object.create(null);function jM(i,e){if(!e)return i;const n=e.split(".");for(let r=0,s=n.length;r<s;++r){const o=n[r];i=i[o]||(i[o]=Object.create(null))}return i}function _Y(i,e,n){return typeof e=="string"?jO(jM(i,e),n):jO(jM(i,""),e)}class eWt{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>mY(s.backgroundColor),this.hoverBorderColor=(r,s)=>mY(s.borderColor),this.hoverColor=(r,s)=>mY(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return _Y(this,e,n)}get(e){return jM(this,e)}describe(e,n){return _Y(Bie,e,n)}override(e,n){return _Y(Wx,e,n)}route(e,n,r,s){const o=jM(this,e),a=jM(this,r),l="_"+n;Object.defineProperties(o,{[l]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[l],u=a[s];return cr(c)?Object.assign({},u,c):Li(c,u)},set(c){this[l]=c}}})}apply(e){e.forEach(n=>n(this))}}var po=new eWt({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Xjt,Yjt,Jjt]);function tWt(i){return!i||rr(i.size)||rr(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Wj(i,e,n,r,s){let o=e[s];return o||(o=e[s]=i.measureText(s).width,n.push(s)),o>r&&(r=o),r}function nWt(i,e,n,r){r=r||{};let s=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(s=r.data={},o=r.garbageCollect=[],r.font=e),i.save(),i.font=e;let a=0;const l=n.length;let c,u,d,h,f;for(c=0;c<l;c++)if(h=n[c],h!=null&&!fo(h))a=Wj(i,s,o,a,h);else if(fo(h))for(u=0,d=h.length;u<d;u++)f=h[u],f!=null&&!fo(f)&&(a=Wj(i,s,o,a,f));i.restore();const p=o.length/2;if(p>n.length){for(c=0;c<p;c++)delete s[o[c]];o.splice(0,p)}return a}function SC(i,e,n){const r=i.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((e-s)*r)/r+s}function oCe(i,e){!e&&!i||(e=e||i.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,i.width,i.height),e.restore())}function jie(i,e,n,r){G4e(i,e,n,r,null)}function G4e(i,e,n,r,s){let o,a,l,c,u,d,h,f;const p=e.pointStyle,g=e.rotation,m=e.radius;let _=(g||0)*Ojt;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(n,r),i.rotate(_),i.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),i.restore();return}if(!(isNaN(m)||m<=0)){switch(i.beginPath(),p){default:s?i.ellipse(n,r,s/2,m,0,0,io):i.arc(n,r,m,0,io),i.closePath();break;case"triangle":d=s?s/2:m,i.moveTo(n+Math.sin(_)*d,r-Math.cos(_)*m),_+=Qwe,i.lineTo(n+Math.sin(_)*d,r-Math.cos(_)*m),_+=Qwe,i.lineTo(n+Math.sin(_)*d,r-Math.cos(_)*m),i.closePath();break;case"rectRounded":u=m*.516,c=m-u,a=Math.cos(_+CC)*c,h=Math.cos(_+CC)*(s?s/2-u:c),l=Math.sin(_+CC)*c,f=Math.sin(_+CC)*(s?s/2-u:c),i.arc(n-h,r-l,u,_-Or,_-aa),i.arc(n+f,r-a,u,_-aa,_),i.arc(n+h,r+l,u,_,_+aa),i.arc(n-f,r+a,u,_+aa,_+Or),i.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*m,d=s?s/2:c,i.rect(n-d,r-c,2*d,2*c);break}_+=CC;case"rectRot":h=Math.cos(_)*(s?s/2:m),a=Math.cos(_)*m,l=Math.sin(_)*m,f=Math.sin(_)*(s?s/2:m),i.moveTo(n-h,r-l),i.lineTo(n+f,r-a),i.lineTo(n+h,r+l),i.lineTo(n-f,r+a),i.closePath();break;case"crossRot":_+=CC;case"cross":h=Math.cos(_)*(s?s/2:m),a=Math.cos(_)*m,l=Math.sin(_)*m,f=Math.sin(_)*(s?s/2:m),i.moveTo(n-h,r-l),i.lineTo(n+h,r+l),i.moveTo(n+f,r-a),i.lineTo(n-f,r+a);break;case"star":h=Math.cos(_)*(s?s/2:m),a=Math.cos(_)*m,l=Math.sin(_)*m,f=Math.sin(_)*(s?s/2:m),i.moveTo(n-h,r-l),i.lineTo(n+h,r+l),i.moveTo(n+f,r-a),i.lineTo(n-f,r+a),_+=CC,h=Math.cos(_)*(s?s/2:m),a=Math.cos(_)*m,l=Math.sin(_)*m,f=Math.sin(_)*(s?s/2:m),i.moveTo(n-h,r-l),i.lineTo(n+h,r+l),i.moveTo(n+f,r-a),i.lineTo(n-f,r+a);break;case"line":a=s?s/2:Math.cos(_)*m,l=Math.sin(_)*m,i.moveTo(n-a,r-l),i.lineTo(n+a,r+l);break;case"dash":i.moveTo(n,r),i.lineTo(n+Math.cos(_)*(s?s/2:m),r+Math.sin(_)*m);break;case!1:i.closePath();break}i.fill(),e.borderWidth>0&&i.stroke()}}function lv(i,e,n){return n=n||.5,!e||i&&i.x>e.left-n&&i.x<e.right+n&&i.y>e.top-n&&i.y<e.bottom+n}function jV(i,e){i.save(),i.beginPath(),i.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),i.clip()}function WV(i){i.restore()}function iWt(i,e,n,r,s){if(!e)return i.lineTo(n.x,n.y);if(s==="middle"){const o=(e.x+n.x)/2;i.lineTo(o,e.y),i.lineTo(o,n.y)}else s==="after"!=!!r?i.lineTo(e.x,n.y):i.lineTo(n.x,e.y);i.lineTo(n.x,n.y)}function rWt(i,e,n,r){if(!e)return i.lineTo(n.x,n.y);i.bezierCurveTo(r?e.cp1x:e.cp2x,r?e.cp1y:e.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function sWt(i,e){e.translation&&i.translate(e.translation[0],e.translation[1]),rr(e.rotation)||i.rotate(e.rotation),e.color&&(i.fillStyle=e.color),e.textAlign&&(i.textAlign=e.textAlign),e.textBaseline&&(i.textBaseline=e.textBaseline)}function oWt(i,e,n,r,s){if(s.strikethrough||s.underline){const o=i.measureText(r),a=e-o.actualBoundingBoxLeft,l=e+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,u=n+o.actualBoundingBoxDescent,d=s.strikethrough?(c+u)/2:u;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(a,d),i.lineTo(l,d),i.stroke()}}function aWt(i,e){const n=i.fillStyle;i.fillStyle=e.color,i.fillRect(e.left,e.top,e.width,e.height),i.fillStyle=n}function $x(i,e,n,r,s,o={}){const a=fo(e)?e:[e],l=o.strokeWidth>0&&o.strokeColor!=="";let c,u;for(i.save(),i.font=s.string,sWt(i,o),c=0;c<a.length;++c)u=a[c],o.backdrop&&aWt(i,o.backdrop),l&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),rr(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(u,n,r,o.maxWidth)),i.fillText(u,n,r,o.maxWidth),oWt(i,n,r,u,o),r+=Number(s.lineHeight);i.restore()}function zO(i,e){const{x:n,y:r,w:s,h:o,radius:a}=e;i.arc(n+a.topLeft,r+a.topLeft,a.topLeft,1.5*Or,Or,!0),i.lineTo(n,r+o-a.bottomLeft),i.arc(n+a.bottomLeft,r+o-a.bottomLeft,a.bottomLeft,Or,aa,!0),i.lineTo(n+s-a.bottomRight,r+o),i.arc(n+s-a.bottomRight,r+o-a.bottomRight,a.bottomRight,aa,0,!0),i.lineTo(n+s,r+a.topRight),i.arc(n+s-a.topRight,r+a.topRight,a.topRight,0,-aa,!0),i.lineTo(n+a.topLeft,r)}const lWt=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,cWt=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function uWt(i,e){const n=(""+i).match(lWt);if(!n||n[1]==="normal")return e*1.2;switch(i=+n[2],n[3]){case"px":return i;case"%":i/=100;break}return e*i}const dWt=i=>+i||0;function Bce(i,e){const n={},r=cr(e),s=r?Object.keys(e):e,o=cr(i)?r?a=>Li(i[a],i[e[a]]):a=>i[a]:()=>i;for(const a of s)n[a]=dWt(o(a));return n}function X4e(i){return Bce(i,{top:"y",right:"x",bottom:"y",left:"x"})}function KS(i){return Bce(i,["topLeft","topRight","bottomLeft","bottomRight"])}function Lc(i){const e=X4e(i);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function qa(i,e){i=i||{},e=e||po.font;let n=Li(i.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=Li(i.style,e.style);r&&!(""+r).match(cWt)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:Li(i.family,e.family),lineHeight:uWt(Li(i.lineHeight,e.lineHeight),n),size:n,style:r,weight:Li(i.weight,e.weight),string:""};return s.string=tWt(s),s}function AN(i,e,n,r){let s,o,a;for(s=0,o=i.length;s<o;++s)if(a=i[s],a!==void 0&&a!==void 0)return a}function hWt(i,e,n){const{min:r,max:s}=i,o=F4e(e,(s-r)/2),a=(l,c)=>n&&l===0?0:l+c;return{min:a(r,-Math.abs(o)),max:a(s,o)}}function sw(i,e){return Object.assign(Object.create(i),e)}function jce(i,e=[""],n,r,s=()=>i[0]){const o=n||i;typeof r>"u"&&(r=J4e("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:r,_getTarget:s,override:l=>jce([l,...i],e,o,r)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete i[0][c],!0},get(l,c){return Z4e(l,c,()=>yWt(c,e,i,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(l,c){return lCe(l).includes(c)},ownKeys(l){return lCe(l)},set(l,c,u){const d=l._storage||(l._storage=s());return l[c]=d[c]=u,delete l._keys,!0}})}function SI(i,e,n,r){const s={_cacheable:!1,_proxy:i,_context:e,_subProxy:n,_stack:new Set,_descriptors:Y4e(i,r),setContext:o=>SI(i,o,n,r),override:o=>SI(i.override(o),e,n,r)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,l){return Z4e(o,a,()=>pWt(o,a,l))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,l){return i[a]=l,delete o[a],!0}})}function Y4e(i,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:s=e.allKeys}=i;return{allKeys:s,scriptable:n,indexable:r,isScriptable:F1(n)?n:()=>n,isIndexable:F1(r)?r:()=>r}}const fWt=(i,e)=>i?i+Nce(e):e,Wce=(i,e)=>cr(e)&&i!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Z4e(i,e,n){if(Object.prototype.hasOwnProperty.call(i,e)||e==="constructor")return i[e];const r=n();return i[e]=r,r}function pWt(i,e,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=i;let l=r[e];return F1(l)&&a.isScriptable(e)&&(l=gWt(e,l,i,n)),fo(l)&&l.length&&(l=mWt(e,l,i,a.isIndexable)),Wce(e,l)&&(l=SI(l,s,o&&o[e],a)),l}function gWt(i,e,n,r){const{_proxy:s,_context:o,_subProxy:a,_stack:l}=n;if(l.has(i))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+i);l.add(i);let c=e(o,a||r);return l.delete(i),Wce(i,c)&&(c=$ce(s._scopes,s,i,c)),c}function mWt(i,e,n,r){const{_proxy:s,_context:o,_subProxy:a,_descriptors:l}=n;if(typeof o.index<"u"&&r(i))return e[o.index%e.length];if(cr(e[0])){const c=e,u=s._scopes.filter(d=>d!==c);e=[];for(const d of c){const h=$ce(u,s,i,d);e.push(SI(h,o,a&&a[i],l))}}return e}function Q4e(i,e,n){return F1(i)?i(e,n):i}const _Wt=(i,e)=>i===!0?e:typeof i=="string"?O1(e,i):void 0;function vWt(i,e,n,r,s){for(const o of e){const a=_Wt(n,o);if(a){i.add(a);const l=Q4e(a._fallback,n,s);if(typeof l<"u"&&l!==n&&l!==r)return l}else if(a===!1&&typeof r<"u"&&n!==r)return null}return!1}function $ce(i,e,n,r){const s=e._rootScopes,o=Q4e(e._fallback,n,r),a=[...i,...s],l=new Set;l.add(r);let c=aCe(l,a,n,o||n,r);return c===null||typeof o<"u"&&o!==n&&(c=aCe(l,a,o,c,r),c===null)?!1:jce(Array.from(l),[""],s,o,()=>bWt(e,n,r))}function aCe(i,e,n,r,s){for(;n;)n=vWt(i,e,n,r,s);return n}function bWt(i,e,n){const r=i._getTarget();e in r||(r[e]={});const s=r[e];return fo(s)&&cr(n)?n:s||{}}function yWt(i,e,n,r){let s;for(const o of e)if(s=J4e(fWt(o,i),n),typeof s<"u")return Wce(i,s)?$ce(n,r,i,s):s}function J4e(i,e){for(const n of e){if(!n)continue;const r=n[i];if(typeof r<"u")return r}}function lCe(i){let e=i._keys;return e||(e=i._keys=wWt(i._scopes)),e}function wWt(i){const e=new Set;for(const n of i)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))e.add(r);return Array.from(e)}function eFe(i,e,n,r){const{iScale:s}=i,{key:o="r"}=this._parsing,a=new Array(r);let l,c,u,d;for(l=0,c=r;l<c;++l)u=l+n,d=e[u],a[l]={r:s.parse(O1(d,o),u)};return a}const CWt=Number.EPSILON||1e-14,xI=(i,e)=>e<i.length&&!i[e].skip&&i[e],tFe=i=>i==="x"?"y":"x";function SWt(i,e,n,r){const s=i.skip?e:i,o=e,a=n.skip?e:n,l=Fie(o,s),c=Fie(a,o);let u=l/(l+c),d=c/(l+c);u=isNaN(u)?0:u,d=isNaN(d)?0:d;const h=r*u,f=r*d;return{previous:{x:o.x-h*(a.x-s.x),y:o.y-h*(a.y-s.y)},next:{x:o.x+f*(a.x-s.x),y:o.y+f*(a.y-s.y)}}}function xWt(i,e,n){const r=i.length;let s,o,a,l,c,u=xI(i,0);for(let d=0;d<r-1;++d)if(c=u,u=xI(i,d+1),!(!c||!u)){if(FM(e[d],0,CWt)){n[d]=n[d+1]=0;continue}s=n[d]/e[d],o=n[d+1]/e[d],l=Math.pow(s,2)+Math.pow(o,2),!(l<=9)&&(a=3/Math.sqrt(l),n[d]=s*a*e[d],n[d+1]=o*a*e[d])}}function kWt(i,e,n="x"){const r=tFe(n),s=i.length;let o,a,l,c=xI(i,0);for(let u=0;u<s;++u){if(a=l,l=c,c=xI(i,u+1),!l)continue;const d=l[n],h=l[r];a&&(o=(d-a[n])/3,l[`cp1${n}`]=d-o,l[`cp1${r}`]=h-o*e[u]),c&&(o=(c[n]-d)/3,l[`cp2${n}`]=d+o,l[`cp2${r}`]=h+o*e[u])}}function LWt(i,e="x"){const n=tFe(e),r=i.length,s=Array(r).fill(0),o=Array(r);let a,l,c,u=xI(i,0);for(a=0;a<r;++a)if(l=c,c=u,u=xI(i,a+1),!!c){if(u){const d=u[e]-c[e];s[a]=d!==0?(u[n]-c[n])/d:0}o[a]=l?u?jm(s[a-1])!==jm(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}xWt(i,s,o),kWt(i,o,e)}function LB(i,e,n){return Math.max(Math.min(i,n),e)}function DWt(i,e){let n,r,s,o,a,l=lv(i[0],e);for(n=0,r=i.length;n<r;++n)a=o,o=l,l=n<r-1&&lv(i[n+1],e),o&&(s=i[n],a&&(s.cp1x=LB(s.cp1x,e.left,e.right),s.cp1y=LB(s.cp1y,e.top,e.bottom)),l&&(s.cp2x=LB(s.cp2x,e.left,e.right),s.cp2y=LB(s.cp2y,e.top,e.bottom)))}function EWt(i,e,n,r,s){let o,a,l,c;if(e.spanGaps&&(i=i.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")LWt(i,s);else{let u=r?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)l=i[o],c=SWt(u,l,i[Math.min(o+1,a-(r?0:1))%a],e.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,u=l}e.capBezierPoints&&DWt(i,n)}function zce(){return typeof window<"u"&&typeof document<"u"}function Vce(i){let e=i.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function $j(i,e,n){let r;return typeof i=="string"?(r=parseInt(i,10),i.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=i,r}const $V=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function IWt(i,e){return $V(i).getPropertyValue(e)}const TWt=["top","right","bottom","left"];function GS(i,e,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=TWt[s];r[o]=parseFloat(i[e+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const RWt=(i,e,n)=>(i>0||e>0)&&(!n||!n.shadowRoot);function AWt(i,e){const n=i.touches,r=n&&n.length?n[0]:i,{offsetX:s,offsetY:o}=r;let a=!1,l,c;if(RWt(s,o,i.target))l=s,c=o;else{const u=e.getBoundingClientRect();l=r.clientX-u.left,c=r.clientY-u.top,a=!0}return{x:l,y:c,box:a}}function zC(i,e){if("native"in i)return i;const{canvas:n,currentDevicePixelRatio:r}=e,s=$V(n),o=s.boxSizing==="border-box",a=GS(s,"padding"),l=GS(s,"border","width"),{x:c,y:u,box:d}=AWt(i,n),h=a.left+(d&&l.left),f=a.top+(d&&l.top);let{width:p,height:g}=e;return o&&(p-=a.width+l.width,g-=a.height+l.height),{x:Math.round((c-h)/p*n.width/r),y:Math.round((u-f)/g*n.height/r)}}function NWt(i,e,n){let r,s;if(e===void 0||n===void 0){const o=i&&Vce(i);if(!o)e=i.clientWidth,n=i.clientHeight;else{const a=o.getBoundingClientRect(),l=$V(o),c=GS(l,"border","width"),u=GS(l,"padding");e=a.width-u.width-c.width,n=a.height-u.height-c.height,r=$j(l.maxWidth,o,"clientWidth"),s=$j(l.maxHeight,o,"clientHeight")}}return{width:e,height:n,maxWidth:r||jj,maxHeight:s||jj}}const DB=i=>Math.round(i*10)/10;function MWt(i,e,n,r){const s=$V(i),o=GS(s,"margin"),a=$j(s.maxWidth,i,"clientWidth")||jj,l=$j(s.maxHeight,i,"clientHeight")||jj,c=NWt(i,e,n);let{width:u,height:d}=c;if(s.boxSizing==="content-box"){const f=GS(s,"border","width"),p=GS(s,"padding");u-=p.width+f.width,d-=p.height+f.height}return u=Math.max(0,u-o.width),d=Math.max(0,r?u/r:d-o.height),u=DB(Math.min(u,a,c.maxWidth)),d=DB(Math.min(d,l,c.maxHeight)),u&&!d&&(d=DB(u/2)),(e!==void 0||n!==void 0)&&r&&c.height&&d>c.height&&(d=c.height,u=DB(Math.floor(d*r))),{width:u,height:d}}function cCe(i,e,n){const r=e||1,s=Math.floor(i.height*r),o=Math.floor(i.width*r);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==r||a.height!==s||a.width!==o?(i.currentDevicePixelRatio=r,a.height=s,a.width=o,i.ctx.setTransform(r,0,0,r,0,0),!0):!1}const PWt=function(){let i=!1;try{const e={get passive(){return i=!0,!1}};zce()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return i}();function uCe(i,e){const n=IWt(i,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function VC(i,e,n,r){return{x:i.x+n*(e.x-i.x),y:i.y+n*(e.y-i.y)}}function OWt(i,e,n,r){return{x:i.x+n*(e.x-i.x),y:r==="middle"?n<.5?i.y:e.y:r==="after"?n<1?i.y:e.y:n>0?e.y:i.y}}function FWt(i,e,n,r){const s={x:i.cp2x,y:i.cp2y},o={x:e.cp1x,y:e.cp1y},a=VC(i,s,n),l=VC(s,o,n),c=VC(o,e,n),u=VC(a,l,n),d=VC(l,c,n);return VC(u,d,n)}const BWt=function(i,e){return{x(n){return i+i+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},jWt=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,e){return i+e},leftForLtr(i,e){return i}}};function dE(i,e,n){return i?BWt(e,n):jWt()}function nFe(i,e){let n,r;(e==="ltr"||e==="rtl")&&(n=i.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),i.prevTextDirection=r)}function iFe(i,e){e!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",e[0],e[1]))}function rFe(i){return i==="angle"?{between:$O,compare:Wjt,normalize:pc}:{between:ov,compare:(e,n)=>e-n,normalize:e=>e}}function dCe({start:i,end:e,count:n,loop:r,style:s}){return{start:i%n,end:e%n,loop:r&&(e-i+1)%n===0,style:s}}function WWt(i,e,n){const{property:r,start:s,end:o}=n,{between:a,normalize:l}=rFe(r),c=e.length;let{start:u,end:d,loop:h}=i,f,p;if(h){for(u+=c,d+=c,f=0,p=c;f<p&&a(l(e[u%c][r]),s,o);++f)u--,d--;u%=c,d%=c}return d<u&&(d+=c),{start:u,end:d,loop:h,style:i.style}}function sFe(i,e,n){if(!n)return[i];const{property:r,start:s,end:o}=n,a=e.length,{compare:l,between:c,normalize:u}=rFe(r),{start:d,end:h,loop:f,style:p}=WWt(i,e,n),g=[];let m=!1,_=null,b,y,x;const k=()=>c(s,x,b)&&l(s,x)!==0,D=()=>l(o,b)===0||c(o,x,b),R=()=>m||k(),E=()=>!m||D();for(let A=d,M=d;A<=h;++A)y=e[A%a],!y.skip&&(b=u(y[r]),b!==x&&(m=c(b,s,o),_===null&&R()&&(_=l(b,s)===0?A:M),_!==null&&E()&&(g.push(dCe({start:_,end:A,loop:f,count:a,style:p})),_=null),M=A,x=b));return _!==null&&g.push(dCe({start:_,end:h,loop:f,count:a,style:p})),g}function oFe(i,e){const n=[],r=i.segments;for(let s=0;s<r.length;s++){const o=sFe(r[s],i.points,e);o.length&&n.push(...o)}return n}function $Wt(i,e,n,r){let s=0,o=e-1;if(n&&!r)for(;s<e&&!i[s].skip;)s++;for(;s<e&&i[s].skip;)s++;for(s%=e,n&&(o+=s);o>s&&i[o%e].skip;)o--;return o%=e,{start:s,end:o}}function zWt(i,e,n,r){const s=i.length,o=[];let a=e,l=i[e],c;for(c=e+1;c<=n;++c){const u=i[c%s];u.skip||u.stop?l.skip||(r=!1,o.push({start:e%s,end:(c-1)%s,loop:r}),e=a=u.stop?c:null):(a=c,l.skip&&(e=c)),l=u}return a!==null&&o.push({start:e%s,end:a%s,loop:r}),o}function VWt(i,e){const n=i.points,r=i.options.spanGaps,s=n.length;if(!s)return[];const o=!!i._loop,{start:a,end:l}=$Wt(n,s,o,r);if(r===!0)return hCe(i,[{start:a,end:l,loop:o}],n,e);const c=l<a?l+s:l,u=!!i._fullLoop&&a===0&&l===s-1;return hCe(i,zWt(n,a,c,u),n,e)}function hCe(i,e,n,r){return!r||!r.setContext||!n?e:HWt(i,e,n,r)}function HWt(i,e,n,r){const s=i._chart.getContext(),o=fCe(i.options),{_datasetIndex:a,options:{spanGaps:l}}=i,c=n.length,u=[];let d=o,h=e[0].start,f=h;function p(g,m,_,b){const y=l?-1:1;if(g!==m){for(g+=c;n[g%c].skip;)g-=y;for(;n[m%c].skip;)m+=y;g%c!==m%c&&(u.push({start:g%c,end:m%c,loop:_,style:b}),d=b,h=m%c)}}for(const g of e){h=l?h:g.start;let m=n[h%c],_;for(f=h+1;f<=g.end;f++){const b=n[f%c];_=fCe(r.setContext(sw(s,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:a}))),UWt(_,d)&&p(h,f-1,g.loop,d),m=b,d=_}h<f-1&&p(h,f-1,g.loop,d)}return u}function fCe(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function UWt(i,e){if(!e)return!1;const n=[],r=function(s,o){return Fce(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(i,r)!==JSON.stringify(e,r)}function EB(i,e,n){return i.options.clip?i[n]:e[n]}function qWt(i,e){const{xScale:n,yScale:r}=i;return n&&r?{left:EB(n,e,"left"),right:EB(n,e,"right"),top:EB(r,e,"top"),bottom:EB(r,e,"bottom")}:e}function aFe(i,e){const n=e._clip;if(n.disabled)return!1;const r=qWt(e,i.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?i.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?i.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
* Chart.js v4.5.0
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/class KWt{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,s){const o=n.listeners[s],a=n.duration;o.forEach(l=>l({chart:e,initial:n.initial,numSteps:a,currentStep:Math.min(r-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=V4e.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let a=o.length-1,l=!1,c;for(;a>=0;--a)c=o[a],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(e),l=!0):(o[a]=o[o.length-1],o.pop());l&&(s.draw(),this._notify(s,r,e,"progress")),o.length||(r.running=!1,this._notify(s,r,e,"complete"),r.initial=!1),n+=o.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var C0=new KWt;const pCe="transparent",GWt={boolean(i,e,n){return n>.5?e:i},color(i,e,n){const r=rCe(i||pCe),s=r.valid&&rCe(e||pCe);return s&&s.valid?s.mix(r,n).hexString():e},number(i,e,n){return i+(e-i)*n}};class XWt{constructor(e,n,r,s){const o=n[r];s=AN([e.to,s,o,e.from]);const a=AN([e.from,o,s]);this._active=!0,this._fn=e.fn||GWt[e.type||typeof a],this._easing=BM[e.easing]||BM.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,a=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=AN([e.to,n,s,e.from]),this._from=AN([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,s=this._prop,o=this._from,a=this._loop,l=this._to;let c;if(this._active=o!==l&&(a||n<r),!this._active){this._target[s]=l,this._notify(!0);return}if(n<0){this._target[s]=o;return}c=n/r%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,l,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class lFe{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!cr(e))return;const n=Object.keys(po.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const o=e[s];if(!cr(o))return;const a={};for(const l of n)a[l]=o[l];(fo(o.properties)&&o.properties||[s]).forEach(l=>{(l===s||!r.has(l))&&r.set(l,a)})})}_animateOptions(e,n){const r=n.options,s=ZWt(e,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&YWt(e.options.$animations,r).then(()=>{e.options=r},()=>{}),o}_createAnimations(e,n){const r=this._properties,s=[],o=e.$animations||(e.$animations={}),a=Object.keys(n),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const u=a[c];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,n));continue}const d=n[u];let h=o[u];const f=r.get(u);if(h)if(f&&h.active()){h.update(f,d,l);continue}else h.cancel();if(!f||!f.duration){e[u]=d;continue}o[u]=h=new XWt(f,e,u,d),s.push(h)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return C0.add(this._chart,r),!0}}function YWt(i,e){const n=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const o=i[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function ZWt(i,e){if(!e)return;let n=i.options;if(!n){i.options=e;return}return n.$shared&&(i.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function gCe(i,e){const n=i&&i.options||{},r=n.reverse,s=n.min===void 0?e:0,o=n.max===void 0?e:0;return{start:r?o:s,end:r?s:o}}function QWt(i,e,n){if(n===!1)return!1;const r=gCe(i,n),s=gCe(e,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function JWt(i){let e,n,r,s;return cr(i)?(e=i.top,n=i.right,r=i.bottom,s=i.left):e=n=r=s=i,{top:e,right:n,bottom:r,left:s,disabled:i===!1}}function cFe(i,e){const n=[],r=i._getSortedDatasetMetas(e);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].index);return n}function mCe(i,e,n,r={}){const s=i.keys,o=r.mode==="single";let a,l,c,u;if(e===null)return;let d=!1;for(a=0,l=s.length;a<l;++a){if(c=+s[a],c===n){if(d=!0,r.all)continue;break}u=i.values[c],zo(u)&&(o||e===0||jm(e)===jm(u))&&(e+=u)}return!d&&!r.all?0:e}function e$t(i,e){const{iScale:n,vScale:r}=e,s=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",a=Object.keys(i),l=new Array(a.length);let c,u,d;for(c=0,u=a.length;c<u;++c)d=a[c],l[c]={[s]:d,[o]:i[d]};return l}function vY(i,e){const n=i&&i.options.stacked;return n||n===void 0&&e.stack!==void 0}function t$t(i,e,n){return`${i.id}.${e.id}.${n.stack||n.type}`}function n$t(i){const{min:e,max:n,minDefined:r,maxDefined:s}=i.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function i$t(i,e,n){const r=i[e]||(i[e]={});return r[n]||(r[n]={})}function _Ce(i,e,n,r){for(const s of e.getMatchingVisibleMetas(r).reverse()){const o=i[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function vCe(i,e){const{chart:n,_cachedMeta:r}=i,s=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:l}=r,c=o.axis,u=a.axis,d=t$t(o,a,r),h=e.length;let f;for(let p=0;p<h;++p){const g=e[p],{[c]:m,[u]:_}=g,b=g._stacks||(g._stacks={});f=b[u]=i$t(s,d,m),f[l]=_,f._top=_Ce(f,a,!0,r.type),f._bottom=_Ce(f,a,!1,r.type);const y=f._visualValues||(f._visualValues={});y[l]=_}}function bY(i,e){const n=i.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function r$t(i,e){return sw(i,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function s$t(i,e,n){return sw(i,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function BA(i,e){const n=i.controller.index,r=i.vScale&&i.vScale.axis;if(r){e=e||i._parsed;for(const s of e){const o=s._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const yY=i=>i==="reset"||i==="none",bCe=(i,e)=>e?i:Object.assign({},i),o$t=(i,e,n)=>i&&!e.hidden&&e._stacked&&{keys:cFe(n,!0),values:null};class Up{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=vY(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&BA(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(h,f,p,g)=>h==="x"?f:h==="r"?g:p,o=n.xAxisID=Li(r.xAxisID,bY(e,"x")),a=n.yAxisID=Li(r.yAxisID,bY(e,"y")),l=n.rAxisID=Li(r.rAxisID,bY(e,"r")),c=n.indexAxis,u=n.iAxisID=s(c,o,a,l),d=n.vAxisID=s(c,a,o,l);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&tCe(this._data,this),e._stacked&&BA(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(cr(n)){const s=this._cachedMeta;this._data=e$t(n,s)}else if(r!==n){if(r){tCe(r,this);const s=this._cachedMeta;BA(s),s._parsed=[]}n&&Object.isExtensible(n)&&Hjt(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=vY(n.vScale,n),n.stack!==r.stack&&(s=!0,BA(n),n.stack=r.stack),this._resyncElements(e),(s||o!==n._stacked)&&(vCe(this,n._parsed),n._stacked=vY(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:s}=this,{iScale:o,_stacked:a}=r,l=o.axis;let c=e===0&&n===s.length?!0:r._sorted,u=e>0&&r._parsed[e-1],d,h,f;if(this._parsing===!1)r._parsed=s,r._sorted=!0,f=s;else{fo(s[e])?f=this.parseArrayData(r,s,e,n):cr(s[e])?f=this.parseObjectData(r,s,e,n):f=this.parsePrimitiveData(r,s,e,n);const p=()=>h[l]===null||u&&h[l]<u[l];for(d=0;d<n;++d)r._parsed[d+e]=h=f[d],c&&(p()&&(c=!1),u=h);r._sorted=c}a&&vCe(this,f)}parsePrimitiveData(e,n,r,s){const{iScale:o,vScale:a}=e,l=o.axis,c=a.axis,u=o.getLabels(),d=o===a,h=new Array(s);let f,p,g;for(f=0,p=s;f<p;++f)g=f+r,h[f]={[l]:d||o.parse(u[g],g),[c]:a.parse(n[g],g)};return h}parseArrayData(e,n,r,s){const{xScale:o,yScale:a}=e,l=new Array(s);let c,u,d,h;for(c=0,u=s;c<u;++c)d=c+r,h=n[d],l[c]={x:o.parse(h[0],d),y:a.parse(h[1],d)};return l}parseObjectData(e,n,r,s){const{xScale:o,yScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=new Array(s);let d,h,f,p;for(d=0,h=s;d<h;++d)f=d+r,p=n[f],u[d]={x:o.parse(O1(p,l),f),y:a.parse(O1(p,c),f)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const s=this.chart,o=this._cachedMeta,a=n[e.axis],l={keys:cFe(s,!0),values:n._stacks[e.axis]._visualValues};return mCe(l,a,o.index,{mode:r})}updateRangeFromParsed(e,n,r,s){const o=r[n.axis];let a=o===null?NaN:o;const l=s&&r._stacks[n.axis];s&&l&&(s.values=l,a=mCe(s,o,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,n){const r=this._cachedMeta,s=r._parsed,o=r._sorted&&e===r.iScale,a=s.length,l=this._getOtherScale(e),c=o$t(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=n$t(l);let f,p;function g(){p=s[f];const m=p[l.axis];return!zo(p[e.axis])||d>m||h<m}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(u,e,p,c),o));++f);if(o){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(u,e,p,c);break}}return u}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let s,o,a;for(s=0,o=n.length;s<o;++s)a=n[s][e.axis],zo(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,s=n.vScale,o=this.getParsed(e);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=JWt(Li(this.options.clip,QWt(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],o=n.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||s.length-l,u=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(e,o,l,c),d=l;d<l+c;++d){const h=s[d];h.hidden||(h.active&&u?a.push(h):h.draw(e,o))}for(d=0;d<a.length;++d)a[d].draw(e,o)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const s=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const a=this._cachedMeta.data[e];o=a.$context||(a.$context=s$t(this.getContext(),e,a)),o.parsed=this.getParsed(e),o.raw=s.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=r$t(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const s=n==="active",o=this._cachedDataOpts,a=e+"-"+n,l=o[a],c=this.enableOptionSharing&&WO(r);if(l)return bCe(l,c);const u=this.chart.config,d=u.datasetElementScopeKeys(this._type,e),h=s?[`${e}Hover`,"hover",e,""]:[e,""],f=u.getOptionScopes(this.getDataset(),d),p=Object.keys(po.elements[e]),g=()=>this.getContext(r,s,n),m=u.resolveNamedOptions(f,p,g,h);return m.$shared&&(m.$shared=c,o[a]=Object.freeze(bCe(m,c))),m}_resolveAnimations(e,n,r){const s=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,l=o[a];if(l)return l;let c;if(s.options.animation!==!1){const d=this.chart.config,h=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),h);c=d.createResolver(f,this.getContext(e,r,n))}const u=new lFe(s,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||yY(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),s=this._sharedOptions,o=this.getSharedOptions(r),a=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:a}}updateElement(e,n,r,s){yY(s)?Object.assign(e,r):this._resolveAnimations(n,s).update(e,r)}updateSharedOptions(e,n,r){e&&!yY(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,s){e.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(e,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,r=this._cachedMeta.data;for(const[l,c,u]of this._syncList)this[l](c,u);this._syncList=[];const s=r.length,o=n.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,e):o<s&&this._removeElements(o,s-o)}_insertElements(e,n,r=!0){const s=this._cachedMeta,o=s.data,a=e+n;let l;const c=u=>{for(u.length+=n,l=u.length-1;l>=a;l--)u[l]=u[l-n]};for(c(o),l=e;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,n),r&&this.updateElements(o,e,n,"reset")}updateElements(e,n,r,s){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(e,n);r._stacked&&BA(r,s)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,s]=e;this[n](r,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}xt(Up,"defaults",{}),xt(Up,"datasetElementType",null),xt(Up,"dataElementType",null);function a$t(i,e){if(!i._cache.$bar){const n=i.getMatchingVisibleMetas(e);let r=[];for(let s=0,o=n.length;s<o;s++)r=r.concat(n[s].controller.getAllParsedValues(i));i._cache.$bar=z4e(r.sort((s,o)=>s-o))}return i._cache.$bar}function l$t(i){const e=i.iScale,n=a$t(e,i.type);let r=e._length,s,o,a,l;const c=()=>{a===32767||a===-32768||(WO(l)&&(r=Math.min(r,Math.abs(a-l)||r)),l=a)};for(s=0,o=n.length;s<o;++s)a=e.getPixelForValue(n[s]),c();for(l=void 0,s=0,o=e.ticks.length;s<o;++s)a=e.getPixelForTick(s),c();return r}function c$t(i,e,n,r){const s=n.barThickness;let o,a;return rr(s)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=s*r,a=1),{chunk:o/r,ratio:a,start:e.pixels[i]-o/2}}function u$t(i,e,n,r){const s=e.pixels,o=s[i];let a=i>0?s[i-1]:null,l=i<s.length-1?s[i+1]:null;const c=n.categoryPercentage;a===null&&(a=o-(l===null?e.end-e.start:l-o)),l===null&&(l=o+o-a);const u=o-(o-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/r,ratio:n.barPercentage,start:u}}function d$t(i,e,n,r){const s=n.parse(i[0],r),o=n.parse(i[1],r),a=Math.min(s,o),l=Math.max(s,o);let c=a,u=l;Math.abs(a)>Math.abs(l)&&(c=l,u=a),e[n.axis]=u,e._custom={barStart:c,barEnd:u,start:s,end:o,min:a,max:l}}function uFe(i,e,n,r){return fo(i)?d$t(i,e,n,r):e[n.axis]=n.parse(i,r),e}function yCe(i,e,n,r){const s=i.iScale,o=i.vScale,a=s.getLabels(),l=s===o,c=[];let u,d,h,f;for(u=n,d=n+r;u<d;++u)f=e[u],h={},h[s.axis]=l||s.parse(a[u],u),c.push(uFe(f,h,o,u));return c}function wY(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function h$t(i,e,n){return i!==0?jm(i):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function f$t(i){let e,n,r,s,o;return i.horizontal?(e=i.base>i.x,n="left",r="right"):(e=i.base<i.y,n="bottom",r="top"),e?(s="end",o="start"):(s="start",o="end"),{start:n,end:r,reverse:e,top:s,bottom:o}}function p$t(i,e,n,r){let s=e.borderSkipped;const o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:c,top:u,bottom:d}=f$t(i);s==="middle"&&n&&(i.enableBorderRadius=!0,(n._top||0)===r?s=u:(n._bottom||0)===r?s=d:(o[wCe(d,a,l,c)]=!0,s=u)),o[wCe(s,a,l,c)]=!0,i.borderSkipped=o}function wCe(i,e,n,r){return r?(i=g$t(i,e,n),i=CCe(i,n,e)):i=CCe(i,e,n),i}function g$t(i,e,n){return i===e?n:i===n?e:i}function CCe(i,e,n){return i==="start"?e:i==="end"?n:i}function m$t(i,{inflateAmount:e},n){i.inflateAmount=e==="auto"?n===1?.33:0:e}class H8 extends Up{parsePrimitiveData(e,n,r,s){return yCe(e,n,r,s)}parseArrayData(e,n,r,s){return yCe(e,n,r,s)}parseObjectData(e,n,r,s){const{iScale:o,vScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=o.axis==="x"?l:c,d=a.axis==="x"?l:c,h=[];let f,p,g,m;for(f=r,p=r+s;f<p;++f)m=n[f],g={},g[o.axis]=o.parse(O1(m,u),f),h.push(uFe(O1(m,d),g,a,f));return h}updateRangeFromParsed(e,n,r,s){super.updateRangeFromParsed(e,n,r,s);const o=r._custom;o&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:r,vScale:s}=n,o=this.getParsed(e),a=o._custom,l=wY(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,r,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),u=l.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,s);for(let p=n;p<n+r;p++){const g=this.getParsed(p),m=o||rr(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),_=this._calculateBarIndexPixels(p,d),b=(g._stacks||{})[l.axis],y={horizontal:u,base:m.base,enableBorderRadius:!b||wY(g._custom)||a===b._top||a===b._bottom,x:u?m.head:_.center,y:u?_.center:m.head,height:u?_.size:Math.abs(m.size),width:u?Math.abs(m.size):_.size};f&&(y.options=h||this.resolveDataElementOptions(p,e[p].active?"active":s));const x=y.options||e[p].options;p$t(y,x,b,a),m$t(y,x,d.ratio),this.updateElement(e[p],p,y,s)}}_getStacks(e,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=r.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(n),c=l&&l[r.axis],u=d=>{const h=d._parsed.find(p=>p[r.axis]===c),f=h&&h[d.vScale.axis];if(rr(f)||isNaN(f))return!0};for(const d of s)if(!(n!==void 0&&u(d))&&((o===!1||a.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(r=>e[r].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)e[Li(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,r){const s=this._getStacks(e,r),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const e=this.options,n=this._cachedMeta,r=n.iScale,s=[];let o,a;for(o=0,a=n.data.length;o<a;++o)s.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const l=e.barThickness;return{min:l||l$t(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(e),u=c._custom,d=wY(u);let h=c[n.axis],f=0,p=r?this.applyStack(n,c,r):h,g,m;p!==h&&(f=p-h,p=h),d&&(h=u.barStart,p=u.barEnd-u.barStart,h!==0&&jm(h)!==jm(u.barEnd)&&(f=0),f+=h);const _=!rr(o)&&!d?o:f;let b=n.getPixelForValue(_);if(this.chart.getDataVisibility(e)?g=n.getPixelForValue(f+p):g=b,m=g-b,Math.abs(m)<a){m=h$t(m,n,l)*a,h===l&&(b-=m/2);const y=n.getPixelForDecimal(0),x=n.getPixelForDecimal(1),k=Math.min(y,x),D=Math.max(y,x);b=Math.max(Math.min(b,D),k),g=b+m,r&&!d&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(g)-n.getValueForPixel(b))}if(b===n.getPixelForValue(l)){const y=jm(m)*n.getLineWidthForValue(l)/2;b+=y,m-=y}return{size:m,base:b,head:g,center:g+m/2}}_calculateBarIndexPixels(e,n){const r=n.scale,s=this.options,o=s.skipNull,a=Li(s.maxBarThickness,1/0);let l,c;const u=this._getAxisCount();if(n.grouped){const d=o?this._getStackCount(e):n.stackCount,h=s.barThickness==="flex"?u$t(e,n,s,d*u):c$t(e,n,s,d*u),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(Li(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0)+p;l=h.start+h.chunk*g+h.chunk/2,c=Math.min(a,h.chunk*h.ratio)}else l=r.getPixelForValue(this.getParsed(e)[r.axis],e),c=Math.min(a,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,r=e.data,s=r.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}xt(H8,"id","bar"),xt(H8,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),xt(H8,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class U8 extends Up{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,r,s){const o=super.parsePrimitiveData(e,n,r,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+r).radius;return o}parseArrayData(e,n,r,s){const o=super.parseArrayData(e,n,r,s);for(let a=0;a<o.length;a++){const l=n[r+a];o[a]._custom=Li(l[2],this.resolveDataElementOptions(a+r).radius)}return o}parseObjectData(e,n,r,s){const o=super.parseObjectData(e,n,r,s);for(let a=0;a<o.length;a++){const l=n[r+a];o[a]._custom=Li(l&&l.r&&+l.r,this.resolveDataElementOptions(a+r).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let r=e.length-1;r>=0;--r)n=Math.max(n,e[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y),u=a._custom;return{label:r[e]||"",value:"("+l+", "+c+(u?", "+u:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,r,s){const o=s==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(n,s),d=a.axis,h=l.axis;for(let f=n;f<n+r;f++){const p=e[f],g=!o&&this.getParsed(f),m={},_=m[d]=o?a.getPixelForDecimal(.5):a.getPixelForValue(g[d]),b=m[h]=o?l.getBasePixel():l.getPixelForValue(g[h]);m.skip=isNaN(_)||isNaN(b),u&&(m.options=c||this.resolveDataElementOptions(f,p.active?"active":s),o&&(m.options.radius=0)),this.updateElement(p,f,m,s)}}resolveDataElementOptions(e,n){const r=this.getParsed(e);let s=super.resolveDataElementOptions(e,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=Li(r&&r._custom,o),s}}xt(U8,"id","bubble"),xt(U8,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),xt(U8,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function _$t(i,e,n){let r=1,s=1,o=0,a=0;if(e<io){const l=i,c=l+e,u=Math.cos(l),d=Math.sin(l),h=Math.cos(c),f=Math.sin(c),p=(x,k,D)=>$O(x,l,c,!0)?1:Math.max(k,k*n,D,D*n),g=(x,k,D)=>$O(x,l,c,!0)?-1:Math.min(k,k*n,D,D*n),m=p(0,u,h),_=p(aa,d,f),b=g(Or,u,h),y=g(Or+aa,d,f);r=(m-b)/2,s=(_-y)/2,o=-(m+b)/2,a=-(_+y)/2}return{ratioX:r,ratioY:s,offsetX:o,offsetY:a}}class kS extends Up{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let o=c=>+r[c];if(cr(r[e])){const{key:c="value"}=this._parsing;o=u=>+O1(r[u],c)}let a,l;for(a=e,l=e+n;a<l;++a)s._parsed[a]=o(a)}}_getRotation(){return Op(this.options.rotation-90)}_getCircumference(){return Op(this.options.circumference)}_getRotationExtents(){let e=io,n=-io;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,o=s._getRotation(),a=s._getCircumference();e=Math.min(e,o),n=Math.max(n,o+a)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-a)/2,0),c=Math.min(Ijt(this.options.cutout,l),1),u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=_$t(h,d,c),_=(r.width-a)/f,b=(r.height-a)/p,y=Math.max(Math.min(_,b)/2,0),x=F4e(this.options.radius,y),k=Math.max(x*c,0),D=(x-k)/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,s.total=this.calculateTotal(),this.outerRadius=x-D*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-D*u,0),this.updateElements(o,0,o.length,e)}_circumference(e,n){const r=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*o/io)}updateElements(e,n,r,s){const o=s==="reset",a=this.chart,l=a.chartArea,u=a.options.animation,d=(l.left+l.right)/2,h=(l.top+l.bottom)/2,f=o&&u.animateScale,p=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:_}=this._getSharedOptions(n,s);let b=this._getRotation(),y;for(y=0;y<n;++y)b+=this._circumference(y,o);for(y=n;y<n+r;++y){const x=this._circumference(y,o),k=e[y],D={x:d+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:g,innerRadius:p};_&&(D.options=m||this.resolveDataElementOptions(y,k.active?"active":s)),b+=x,this.updateElement(k,y,D,s)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let r=0,s;for(s=0;s<n.length;s++){const o=e._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?io*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=O4(n._parsed[e],r.options.locale);return{label:s[e]||"",value:o}}getMaxBorderWidth(e){let n=0;const r=this.chart;let s,o,a,l,c;if(!e){for(s=0,o=r.data.datasets.length;s<o;++s)if(r.isDatasetVisible(s)){a=r.getDatasetMeta(s),e=a.data,l=a.controller;break}}if(!e)return 0;for(s=0,o=e.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let r=0,s=e.length;r<s;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(e){return Math.max(Li(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}xt(kS,"id","doughnut"),xt(kS,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),xt(kS,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),xt(kS,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:s}}=e.legend.options;return n.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class q8 extends Up{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:r,data:s=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:l,count:c}=U4e(n,s,a);this._drawStart=l,this._drawCount=c,q4e(n)&&(l=0,c=s.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:u},e),this.updateElements(s,l,c,e)}updateElements(e,n,r,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,s),f=a.axis,p=l.axis,{spanGaps:g,segment:m}=this.options,_=CI(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",y=n+r,x=e.length;let k=n>0&&this.getParsed(n-1);for(let D=0;D<x;++D){const R=e[D],E=b?R:{};if(D<n||D>=y){E.skip=!0;continue}const A=this.getParsed(D),M=rr(A[p]),N=E[f]=a.getPixelForValue(A[f],D),P=E[p]=o||M?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,A,c):A[p],D);E.skip=isNaN(N)||isNaN(P)||M,E.stop=D>0&&Math.abs(A[f]-k[f])>_,m&&(E.parsed=A,E.raw=u.data[D]),h&&(E.options=d||this.resolveDataElementOptions(D,R.active?"active":s)),b||this.updateElement(R,D,E,s),k=A}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,r=n.options&&n.options.borderWidth||0,s=e.data||[];if(!s.length)return r;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(r,o,a)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}xt(q8,"id","line"),xt(q8,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),xt(q8,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class WM extends Up{constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=O4(n._parsed[e].r,r.options.locale);return{label:s[e]||"",value:o}}parseObjectData(e,n,r,s){return eFe.bind(this)(e,n,r,s)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((r,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,r=e.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),a=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),l=(o-a)/e.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(e,n,r,s){const o=s==="reset",a=this.chart,c=a.options.animation,u=this._cachedMeta.rScale,d=u.xCenter,h=u.yCenter,f=u.getIndexAngle(0)-.5*Or;let p=f,g;const m=360/this.countVisibleElements();for(g=0;g<n;++g)p+=this._computeAngle(g,s,m);for(g=n;g<n+r;g++){const _=e[g];let b=p,y=p+this._computeAngle(g,s,m),x=a.getDataVisibility(g)?u.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=y,o&&(c.animateScale&&(x=0),c.animateRotate&&(b=y=f));const k={x:d,y:h,innerRadius:0,outerRadius:x,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(g,_.active?"active":s)};this.updateElement(_,g,k,s)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((r,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(e,n,r){return this.chart.getDataVisibility(e)?Op(this.resolveDataElementOptions(e,n).angle||r):0}}xt(WM,"id","polarArea"),xt(WM,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),xt(WM,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:s}}=e.legend.options;return n.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Wie extends kS{}xt(Wie,"id","pie"),xt(Wie,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class K8 extends Up{getLabelAndValue(e){const n=this._cachedMeta.vScale,r=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(e,n,r,s){return eFe.bind(this)(e,n,r,s)}update(e){const n=this._cachedMeta,r=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(r.points=s,e!=="resize"){const a=this.resolveDatasetElementOptions(e);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(r,void 0,l,e)}this.updateElements(s,0,s.length,e)}updateElements(e,n,r,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let l=n;l<n+r;l++){const c=e[l],u=this.resolveDataElementOptions(l,c.active?"active":s),d=o.getPointPositionForValue(l,this.getParsed(l).r),h=a?o.xCenter:d.x,f=a?o.yCenter:d.y,p={x:h,y:f,angle:d.angle,skip:isNaN(h)||isNaN(f),options:u};this.updateElement(c,l,p,s)}}}xt(K8,"id","radar"),xt(K8,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),xt(K8,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class G8 extends Up{getLabelAndValue(e){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:r[e]||"",value:"("+l+", "+c+")"}}update(e){const n=this._cachedMeta,{data:r=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:a}=U4e(n,r,s);if(this._drawStart=o,this._drawCount=a,q4e(n)&&(o=0,a=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=r;const u=this.resolveDatasetElementOptions(e);u.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:u},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,a,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,r,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,d=this.resolveDataElementOptions(n,s),h=this.getSharedOptions(d),f=this.includeOptions(s,h),p=a.axis,g=l.axis,{spanGaps:m,segment:_}=this.options,b=CI(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||s==="none";let x=n>0&&this.getParsed(n-1);for(let k=n;k<n+r;++k){const D=e[k],R=this.getParsed(k),E=y?D:{},A=rr(R[g]),M=E[p]=a.getPixelForValue(R[p],k),N=E[g]=o||A?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,R,c):R[g],k);E.skip=isNaN(M)||isNaN(N)||A,E.stop=k>0&&Math.abs(R[p]-x[p])>b,_&&(E.parsed=R,E.raw=u.data[k]),f&&(E.options=h||this.resolveDataElementOptions(k,D.active?"active":s)),y||this.updateElement(D,k,E,s),x=R}this.updateSharedOptions(h,s,d)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const r=e.dataset,s=r.options&&r.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}}xt(G8,"id","scatter"),xt(G8,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),xt(G8,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var v$t=Object.freeze({__proto__:null,BarController:H8,BubbleController:U8,DoughnutController:kS,LineController:q8,PieController:Wie,PolarAreaController:WM,RadarController:K8,ScatterController:G8});function xC(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Hce{constructor(e){xt(this,"options");this.options=e||{}}static override(e){Object.assign(Hce.prototype,e)}init(){}formats(){return xC()}parse(){return xC()}format(){return xC()}add(){return xC()}diff(){return xC()}startOf(){return xC()}endOf(){return xC()}}var b$t={_date:Hce};function y$t(i,e,n,r){const{controller:s,data:o,_sorted:a}=i,l=s._cachedMeta.iScale,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(l&&e===l.axis&&e!=="r"&&a&&o.length){const u=l._reversePixels?zjt:av;if(r){if(s._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(e);if(h){const f=u(o,e,n-h),p=u(o,e,n+h);return{lo:f.lo,hi:p.hi}}}}else{const d=u(o,e,n);if(c){const{vScale:h}=s._cachedMeta,{_parsed:f}=i,p=f.slice(0,d.lo+1).reverse().findIndex(m=>!rr(m[h.axis]));d.lo-=Math.max(0,p);const g=f.slice(d.hi).findIndex(m=>!rr(m[h.axis]));d.hi+=Math.max(0,g)}return d}}return{lo:0,hi:o.length-1}}function zV(i,e,n,r,s){const o=i.getSortedVisibleDatasetMetas(),a=n[e];for(let l=0,c=o.length;l<c;++l){const{index:u,data:d}=o[l],{lo:h,hi:f}=y$t(o[l],e,a,s);for(let p=h;p<=f;++p){const g=d[p];g.skip||r(g,u,p)}}}function w$t(i){const e=i.indexOf("x")!==-1,n=i.indexOf("y")!==-1;return function(r,s){const o=e?Math.abs(r.x-s.x):0,a=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function CY(i,e,n,r,s){const o=[];return!s&&!i.isPointInArea(e)||zV(i,n,e,function(l,c,u){!s&&!lv(l,i.chartArea,0)||l.inRange(e.x,e.y,r)&&o.push({element:l,datasetIndex:c,index:u})},!0),o}function C$t(i,e,n,r){let s=[];function o(a,l,c){const{startAngle:u,endAngle:d}=a.getProps(["startAngle","endAngle"],r),{angle:h}=W4e(a,{x:e.x,y:e.y});$O(h,u,d)&&s.push({element:a,datasetIndex:l,index:c})}return zV(i,n,e,o),s}function S$t(i,e,n,r,s,o){let a=[];const l=w$t(n);let c=Number.POSITIVE_INFINITY;function u(d,h,f){const p=d.inRange(e.x,e.y,s);if(r&&!p)return;const g=d.getCenterPoint(s);if(!(!!o||i.isPointInArea(g))&&!p)return;const _=l(e,g);_<c?(a=[{element:d,datasetIndex:h,index:f}],c=_):_===c&&a.push({element:d,datasetIndex:h,index:f})}return zV(i,n,e,u),a}function SY(i,e,n,r,s,o){return!o&&!i.isPointInArea(e)?[]:n==="r"&&!r?C$t(i,e,n,s):S$t(i,e,n,r,s,o)}function SCe(i,e,n,r,s){const o=[],a=n==="x"?"inXRange":"inYRange";let l=!1;return zV(i,n,e,(c,u,d)=>{c[a]&&c[a](e[n],s)&&(o.push({element:c,datasetIndex:u,index:d}),l=l||c.inRange(e.x,e.y,s))}),r&&!l?[]:o}var x$t={modes:{index(i,e,n,r){const s=zC(e,i),o=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?CY(i,s,o,r,a):SY(i,s,o,!1,r,a),c=[];return l.length?(i.getSortedVisibleDatasetMetas().forEach(u=>{const d=l[0].index,h=u.data[d];h&&!h.skip&&c.push({element:h,datasetIndex:u.index,index:d})}),c):[]},dataset(i,e,n,r){const s=zC(e,i),o=n.axis||"xy",a=n.includeInvisible||!1;let l=n.intersect?CY(i,s,o,r,a):SY(i,s,o,!1,r,a);if(l.length>0){const c=l[0].datasetIndex,u=i.getDatasetMeta(c).data;l=[];for(let d=0;d<u.length;++d)l.push({element:u[d],datasetIndex:c,index:d})}return l},point(i,e,n,r){const s=zC(e,i),o=n.axis||"xy",a=n.includeInvisible||!1;return CY(i,s,o,r,a)},nearest(i,e,n,r){const s=zC(e,i),o=n.axis||"xy",a=n.includeInvisible||!1;return SY(i,s,o,n.intersect,r,a)},x(i,e,n,r){const s=zC(e,i);return SCe(i,s,"x",n.intersect,r)},y(i,e,n,r){const s=zC(e,i);return SCe(i,s,"y",n.intersect,r)}}};const dFe=["left","top","right","bottom"];function jA(i,e){return i.filter(n=>n.pos===e)}function xCe(i,e){return i.filter(n=>dFe.indexOf(n.pos)===-1&&n.box.axis===e)}function WA(i,e){return i.sort((n,r)=>{const s=e?r:n,o=e?n:r;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function k$t(i){const e=[];let n,r,s,o,a,l;for(n=0,r=(i||[]).length;n<r;++n)s=i[n],{position:o,options:{stack:a,stackWeight:l=1}}=s,e.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:l});return e}function L$t(i){const e={};for(const n of i){const{stack:r,pos:s,stackWeight:o}=n;if(!r||!dFe.includes(s))continue;const a=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return e}function D$t(i,e){const n=L$t(i),{vBoxMaxWidth:r,hBoxMaxHeight:s}=e;let o,a,l;for(o=0,a=i.length;o<a;++o){l=i[o];const{fullSize:c}=l.box,u=n[l.stack],d=u&&l.stackWeight/u.weight;l.horizontal?(l.width=d?d*r:c&&e.availableWidth,l.height=s):(l.width=r,l.height=d?d*s:c&&e.availableHeight)}return n}function E$t(i){const e=k$t(i),n=WA(e.filter(u=>u.box.fullSize),!0),r=WA(jA(e,"left"),!0),s=WA(jA(e,"right")),o=WA(jA(e,"top"),!0),a=WA(jA(e,"bottom")),l=xCe(e,"x"),c=xCe(e,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:s.concat(c).concat(a).concat(l),chartArea:jA(e,"chartArea"),vertical:r.concat(s).concat(c),horizontal:o.concat(a).concat(l)}}function kCe(i,e,n,r){return Math.max(i[n],e[n])+Math.max(i[r],e[r])}function hFe(i,e){i.top=Math.max(i.top,e.top),i.left=Math.max(i.left,e.left),i.bottom=Math.max(i.bottom,e.bottom),i.right=Math.max(i.right,e.right)}function I$t(i,e,n,r){const{pos:s,box:o}=n,a=i.maxPadding;if(!cr(s)){n.size&&(i[s]-=n.size);const h=r[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?o.height:o.width),n.size=h.size/h.count,i[s]+=n.size}o.getPadding&&hFe(a,o.getPadding());const l=Math.max(0,e.outerWidth-kCe(a,i,"left","right")),c=Math.max(0,e.outerHeight-kCe(a,i,"top","bottom")),u=l!==i.w,d=c!==i.h;return i.w=l,i.h=c,n.horizontal?{same:u,other:d}:{same:d,other:u}}function T$t(i){const e=i.maxPadding;function n(r){const s=Math.max(e[r]-i[r],0);return i[r]+=s,s}i.y+=n("top"),i.x+=n("left"),n("right"),n("bottom")}function R$t(i,e){const n=e.maxPadding;function r(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(e[a],n[a])}),o}return r(i?["left","right"]:["top","bottom"])}function NN(i,e,n,r){const s=[];let o,a,l,c,u,d;for(o=0,a=i.length,u=0;o<a;++o){l=i[o],c=l.box,c.update(l.width||e.w,l.height||e.h,R$t(l.horizontal,e));const{same:h,other:f}=I$t(e,n,l,r);u|=h&&s.length,d=d||f,c.fullSize||s.push(l)}return u&&NN(s,e,n,r)||d}function IB(i,e,n,r,s){i.top=n,i.left=e,i.right=e+r,i.bottom=n+s,i.width=r,i.height=s}function LCe(i,e,n,r){const s=n.padding;let{x:o,y:a}=e;for(const l of i){const c=l.box,u=r[l.stack]||{placed:0,weight:1},d=l.stackWeight/u.weight||1;if(l.horizontal){const h=e.w*d,f=u.size||c.height;WO(u.start)&&(a=u.start),c.fullSize?IB(c,s.left,a,n.outerWidth-s.right-s.left,f):IB(c,e.left+u.placed,a,h,f),u.start=a,u.placed+=h,a=c.bottom}else{const h=e.h*d,f=u.size||c.width;WO(u.start)&&(o=u.start),c.fullSize?IB(c,o,s.top,f,n.outerHeight-s.bottom-s.top):IB(c,o,e.top+u.placed,f,h),u.start=o,u.placed+=h,o=c.right}}e.x=o,e.y=a}var vc={addBox(i,e){i.boxes||(i.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},i.boxes.push(e)},removeBox(i,e){const n=i.boxes?i.boxes.indexOf(e):-1;n!==-1&&i.boxes.splice(n,1)},configure(i,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(i,e,n,r){if(!i)return;const s=Lc(i.options.layout.padding),o=Math.max(e-s.width,0),a=Math.max(n-s.height,0),l=E$t(i.boxes),c=l.vertical,u=l.horizontal;ss(i.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const d=c.reduce((m,_)=>_.box.options&&_.box.options.display===!1?m:m+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},s);hFe(f,Lc(r));const p=Object.assign({maxPadding:f,w:o,h:a,x:s.left,y:s.top},s),g=D$t(c.concat(u),h);NN(l.fullSize,p,h,g),NN(c,p,h,g),NN(u,p,h,g)&&NN(c,p,h,g),T$t(p),LCe(l.leftAndTop,p,h,g),p.x+=p.w,p.y+=p.h,LCe(l.rightAndBottom,p,h,g),i.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},ss(l.chartArea,m=>{const _=m.box;Object.assign(_,i.chartArea),_.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class fFe{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,s){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(e){return!0}updateConfig(e){}}class A$t extends fFe{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const X8="$chartjs",N$t={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},DCe=i=>i===null||i==="";function M$t(i,e){const n=i.style,r=i.getAttribute("height"),s=i.getAttribute("width");if(i[X8]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",DCe(s)){const o=uCe(i,"width");o!==void 0&&(i.width=o)}if(DCe(r))if(i.style.height==="")i.height=i.width/(e||2);else{const o=uCe(i,"height");o!==void 0&&(i.height=o)}return i}const pFe=PWt?{passive:!0}:!1;function P$t(i,e,n){i&&i.addEventListener(e,n,pFe)}function O$t(i,e,n){i&&i.canvas&&i.canvas.removeEventListener(e,n,pFe)}function F$t(i,e){const n=N$t[i.type]||i.type,{x:r,y:s}=zC(i,e);return{type:n,chart:e,native:i,x:r!==void 0?r:null,y:s!==void 0?s:null}}function zj(i,e){for(const n of i)if(n===e||n.contains(e))return!0}function B$t(i,e,n){const r=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||zj(l.addedNodes,r),a=a&&!zj(l.removedNodes,r);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function j$t(i,e,n){const r=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||zj(l.removedNodes,r),a=a&&!zj(l.addedNodes,r);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const VO=new Map;let ECe=0;function gFe(){const i=window.devicePixelRatio;i!==ECe&&(ECe=i,VO.forEach((e,n)=>{n.currentDevicePixelRatio!==i&&e()}))}function W$t(i,e){VO.size||window.addEventListener("resize",gFe),VO.set(i,e)}function $$t(i){VO.delete(i),VO.size||window.removeEventListener("resize",gFe)}function z$t(i,e,n){const r=i.canvas,s=r&&Vce(r);if(!s)return;const o=H4e((l,c)=>{const u=s.clientWidth;n(l,c),u<s.clientWidth&&n()},window),a=new ResizeObserver(l=>{const c=l[0],u=c.contentRect.width,d=c.contentRect.height;u===0&&d===0||o(u,d)});return a.observe(s),W$t(i,o),a}function xY(i,e,n){n&&n.disconnect(),e==="resize"&&$$t(i)}function V$t(i,e,n){const r=i.canvas,s=H4e(o=>{i.ctx!==null&&n(F$t(o,i))},i);return P$t(r,e,s),s}class H$t extends fFe{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(M$t(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[X8])return!1;const r=n[X8].initial;["height","width"].forEach(o=>{const a=r[o];rr(a)?n.removeAttribute(o):n.setAttribute(o,a)});const s=r.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[X8],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),a={attach:B$t,detach:j$t,resize:z$t}[n]||V$t;s[n]=a(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),s=r[n];if(!s)return;({attach:xY,detach:xY,resize:xY}[n]||O$t)(e,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,s){return MWt(e,n,r,s)}isAttached(e){const n=e&&Vce(e);return!!(n&&n.isConnected)}}function U$t(i){return!zce()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?A$t:H$t}var UB;let Gv=(UB=class{constructor(){xt(this,"x");xt(this,"y");xt(this,"active",!1);xt(this,"options");xt(this,"$animations")}tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return CI(this.x)&&CI(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const s={};return e.forEach(o=>{s[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),s}},xt(UB,"defaults",{}),xt(UB,"defaultRoutes"),UB);function q$t(i,e){const n=i.options.ticks,r=K$t(i),s=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?X$t(e):[],a=o.length,l=o[0],c=o[a-1],u=[];if(a>s)return Y$t(e,u,o,a/s),u;const d=G$t(o,e,s);if(a>0){let h,f;const p=a>1?Math.round((c-l)/(a-1)):null;for(TB(e,u,d,rr(p)?0:l-p,l),h=0,f=a-1;h<f;h++)TB(e,u,d,o[h],o[h+1]);return TB(e,u,d,c,rr(p)?e.length:c+p),u}return TB(e,u,d),u}function K$t(i){const e=i.options.offset,n=i._tickSize(),r=i._length/n+(e?0:1),s=i._maxLength/n;return Math.floor(Math.min(r,s))}function G$t(i,e,n){const r=Z$t(i),s=e.length/n;if(!r)return Math.max(s,1);const o=Fjt(r);for(let a=0,l=o.length-1;a<l;a++){const c=o[a];if(c>s)return c}return Math.max(s,1)}function X$t(i){const e=[];let n,r;for(n=0,r=i.length;n<r;n++)i[n].major&&e.push(n);return e}function Y$t(i,e,n,r){let s=0,o=n[0],a;for(r=Math.ceil(r),a=0;a<i.length;a++)a===o&&(e.push(i[a]),s++,o=n[s*r])}function TB(i,e,n,r,s){const o=Li(r,0),a=Math.min(Li(s,i.length),i.length);let l=0,c,u,d;for(n=Math.ceil(n),s&&(c=s-r,n=c/Math.floor(c/n)),d=o;d<0;)l++,d=Math.round(o+l*n);for(u=Math.max(o,0);u<a;u++)u===d&&(e.push(i[u]),l++,d=Math.round(o+l*n))}function Z$t(i){const e=i.length;let n,r;if(e<2)return!1;for(r=i[0],n=1;n<e;++n)if(i[n]-i[n-1]!==r)return!1;return r}const Q$t=i=>i==="left"?"right":i==="right"?"left":i,ICe=(i,e,n)=>e==="top"||e==="left"?i[e]+n:i[e]-n,TCe=(i,e)=>Math.min(e||i,i);function RCe(i,e){const n=[],r=i.length/e,s=i.length;let o=0;for(;o<s;o+=r)n.push(i[Math.floor(o)]);return n}function J$t(i,e,n){const r=i.ticks.length,s=Math.min(e,r-1),o=i._startPixel,a=i._endPixel,l=1e-6;let c=i.getPixelForTick(s),u;if(!(n&&(r===1?u=Math.max(c-o,a-c):e===0?u=(i.getPixelForTick(1)-c)/2:u=(c-i.getPixelForTick(s-1))/2,c+=s<e?u:-u,c<o-l||c>a+l)))return c}function ezt(i,e){ss(i,n=>{const r=n.gc,s=r.length/2;let o;if(s>e){for(o=0;o<s;++o)delete n.data[r[o]];r.splice(0,s)}})}function $A(i){return i.drawTicks?i.tickLength:0}function ACe(i,e){if(!i.display)return 0;const n=qa(i.font,e),r=Lc(i.padding);return(fo(i.text)?i.text.length:1)*n.lineHeight+r.height}function tzt(i,e){return sw(i,{scale:e,type:"scale"})}function nzt(i,e,n){return sw(i,{tick:n,index:e,type:"tick"})}function izt(i,e,n){let r=Oce(i);return(n&&e!=="right"||!n&&e==="right")&&(r=Q$t(r)),r}function rzt(i,e,n,r){const{top:s,left:o,bottom:a,right:l,chart:c}=i,{chartArea:u,scales:d}=c;let h=0,f,p,g;const m=a-s,_=l-o;if(i.isHorizontal()){if(p=uc(r,o,l),cr(n)){const b=Object.keys(n)[0],y=n[b];g=d[b].getPixelForValue(y)+m-e}else n==="center"?g=(u.bottom+u.top)/2+m-e:g=ICe(i,n,e);f=l-o}else{if(cr(n)){const b=Object.keys(n)[0],y=n[b];p=d[b].getPixelForValue(y)-_+e}else n==="center"?p=(u.left+u.right)/2-_+e:p=ICe(i,n,e);g=uc(r,a,s),h=n==="left"?-aa:aa}return{titleX:p,titleY:g,maxWidth:f,rotation:h}}class mk extends Gv{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return e=Vd(e,Number.POSITIVE_INFINITY),n=Vd(n,Number.NEGATIVE_INFINITY),r=Vd(r,Number.POSITIVE_INFINITY),s=Vd(s,Number.NEGATIVE_INFINITY),{min:Vd(e,r),max:Vd(n,s),minDefined:zo(e),maxDefined:zo(n)}}getMinMax(e){let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:n,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,u=l.length;c<u;++c)a=l[c].controller.getMinMax(this,e),s||(n=Math.min(n,a.min)),o||(r=Math.max(r,a.max));return n=o&&n>r?r:n,r=s&&n>r?n:r,{min:Vd(n,Vd(r,n)),max:Vd(r,Vd(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$s(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:s,grace:o,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=hWt(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?RCe(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=q$t(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){$s(this.options.afterUpdate,[this])}beforeSetDimensions(){$s(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){$s(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),$s(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){$s(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,s,o;for(r=0,s=e.length;r<s;r++)o=e[r],o.label=$s(n.callback,[o.value,r,e],this)}afterTickToLabelConversion(){$s(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){$s(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=TCe(this.ticks.length,e.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let a=s,l,c,u;if(!this._isVisible()||!n.display||s>=o||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),h=d.widest.width,f=d.highest.height,p=fl(this.chart.width-h,0,this.maxWidth);l=e.offset?this.maxWidth/r:p/(r-1),h+6>l&&(l=p/(r-(e.offset?.5:1)),c=this.maxHeight-$A(e.grid)-n.padding-ACe(e.title,this.chart.options.font),u=Math.sqrt(h*h+f*f),a=Mce(Math.min(Math.asin(fl((d.highest.height+6)/l,-1,1)),Math.asin(fl(c/u,-1,1))-Math.asin(fl(f/u,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){$s(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$s(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:o}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=ACe(s,n.options.font);if(l?(e.width=this.maxWidth,e.height=$A(o)+c):(e.height=this.maxHeight,e.width=$A(o)+c),r.display&&this.ticks.length){const{first:u,last:d,widest:h,highest:f}=this._getLabelSizes(),p=r.padding*2,g=Op(this.labelRotation),m=Math.cos(g),_=Math.sin(g);if(l){const b=r.mirror?0:_*h.width+m*f.height;e.height=Math.min(this.maxHeight,e.height+b+p)}else{const b=r.mirror?0:m*h.width+_*f.height;e.width=Math.min(this.maxWidth,e.width+b+p)}this._calculatePadding(u,d,_,m)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,r,s){const{ticks:{align:o,padding:a},position:l}=this.options,c=this.labelRotation!==0,u=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;c?u?(f=s*e.width,p=r*n.height):(f=r*e.height,p=s*n.width):o==="start"?p=n.width:o==="end"?f=e.width:o!=="inner"&&(f=e.width/2,p=n.width/2),this.paddingLeft=Math.max((f-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-h+a)*this.width/(this.width-h),0)}else{let d=n.height/2,h=e.height/2;o==="start"?(d=0,h=e.height):o==="end"&&(d=n.height,h=0),this.paddingTop=d+a,this.paddingBottom=h+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){$s(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,r;for(n=0,r=e.length;n<r;n++)rr(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=RCe(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:s,_longestTextCache:o}=this,a=[],l=[],c=Math.floor(n/TCe(n,r));let u=0,d=0,h,f,p,g,m,_,b,y,x,k,D;for(h=0;h<n;h+=c){if(g=e[h].label,m=this._resolveTickFontOptions(h),s.font=_=m.string,b=o[_]=o[_]||{data:{},gc:[]},y=m.lineHeight,x=k=0,!rr(g)&&!fo(g))x=Wj(s,b.data,b.gc,x,g),k=y;else if(fo(g))for(f=0,p=g.length;f<p;++f)D=g[f],!rr(D)&&!fo(D)&&(x=Wj(s,b.data,b.gc,x,D),k+=y);a.push(x),l.push(k),u=Math.max(x,u),d=Math.max(k,d)}ezt(o,n);const R=a.indexOf(u),E=l.indexOf(d),A=M=>({width:a[M]||0,height:l[M]||0});return{first:A(0),last:A(n-1),widest:A(R),highest:A(E),widths:a,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return $jt(this._alignToPixels?SC(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const r=n[e];return r.$context||(r.$context=nzt(this.getContext(),e,r))}return this.$context||(this.$context=tzt(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Op(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=e.autoSkipPadding||0,l=o?o.widest.width+a:0,c=o?o.highest.height+a:0;return this.isHorizontal()?c*r>l*s?l/r:c/s:c*s<l*r?c/r:l/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,s=this.options,{grid:o,position:a,border:l}=s,c=o.offset,u=this.isHorizontal(),h=this.ticks.length+(c?1:0),f=$A(o),p=[],g=l.setContext(this.getContext()),m=g.display?g.width:0,_=m/2,b=function(H){return SC(r,H,m)};let y,x,k,D,R,E,A,M,N,P,O,B;if(a==="top")y=b(this.bottom),E=this.bottom-f,M=y-_,P=b(e.top)+_,B=e.bottom;else if(a==="bottom")y=b(this.top),P=e.top,B=b(e.bottom)-_,E=y+_,M=this.top+f;else if(a==="left")y=b(this.right),R=this.right-f,A=y-_,N=b(e.left)+_,O=e.right;else if(a==="right")y=b(this.left),N=e.left,O=b(e.right)-_,R=y+_,A=this.left+f;else if(n==="x"){if(a==="center")y=b((e.top+e.bottom)/2+.5);else if(cr(a)){const H=Object.keys(a)[0],Y=a[H];y=b(this.chart.scales[H].getPixelForValue(Y))}P=e.top,B=e.bottom,E=y+_,M=E+f}else if(n==="y"){if(a==="center")y=b((e.left+e.right)/2);else if(cr(a)){const H=Object.keys(a)[0],Y=a[H];y=b(this.chart.scales[H].getPixelForValue(Y))}R=y-_,A=R-f,N=e.left,O=e.right}const j=Li(s.ticks.maxTicksLimit,h),z=Math.max(1,Math.ceil(h/j));for(x=0;x<h;x+=z){const H=this.getContext(x),Y=o.setContext(H),X=l.setContext(H),Q=Y.lineWidth,ie=Y.color,K=X.dash||[],ee=X.dashOffset,le=Y.tickWidth,ke=Y.tickColor,xe=Y.tickBorderDash||[],me=Y.tickBorderDashOffset;k=J$t(this,x,c),k!==void 0&&(D=SC(r,k,Q),u?R=A=N=O=D:E=M=P=B=D,p.push({tx1:R,ty1:E,tx2:A,ty2:M,x1:N,y1:P,x2:O,y2:B,width:Q,color:ie,borderDash:K,borderDashOffset:ee,tickWidth:le,tickColor:ke,tickBorderDash:xe,tickBorderDashOffset:me}))}return this._ticksLength=h,this._borderValue=y,p}_computeLabelItems(e){const n=this.axis,r=this.options,{position:s,ticks:o}=r,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:u,padding:d,mirror:h}=o,f=$A(r.grid),p=f+d,g=h?-d:p,m=-Op(this.labelRotation),_=[];let b,y,x,k,D,R,E,A,M,N,P,O,B="middle";if(s==="top")R=this.bottom-g,E=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+g,E=this._getXAxisLabelAlignment();else if(s==="left"){const z=this._getYAxisLabelAlignment(f);E=z.textAlign,D=z.x}else if(s==="right"){const z=this._getYAxisLabelAlignment(f);E=z.textAlign,D=z.x}else if(n==="x"){if(s==="center")R=(e.top+e.bottom)/2+p;else if(cr(s)){const z=Object.keys(s)[0],H=s[z];R=this.chart.scales[z].getPixelForValue(H)+p}E=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")D=(e.left+e.right)/2-p;else if(cr(s)){const z=Object.keys(s)[0],H=s[z];D=this.chart.scales[z].getPixelForValue(H)}E=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(c==="start"?B="top":c==="end"&&(B="bottom"));const j=this._getLabelSizes();for(b=0,y=l.length;b<y;++b){x=l[b],k=x.label;const z=o.setContext(this.getContext(b));A=this.getPixelForTick(b)+o.labelOffset,M=this._resolveTickFontOptions(b),N=M.lineHeight,P=fo(k)?k.length:1;const H=P/2,Y=z.color,X=z.textStrokeColor,Q=z.textStrokeWidth;let ie=E;a?(D=A,E==="inner"&&(b===y-1?ie=this.options.reverse?"left":"right":b===0?ie=this.options.reverse?"right":"left":ie="center"),s==="top"?u==="near"||m!==0?O=-P*N+N/2:u==="center"?O=-j.highest.height/2-H*N+N:O=-j.highest.height+N/2:u==="near"||m!==0?O=N/2:u==="center"?O=j.highest.height/2-H*N:O=j.highest.height-P*N,h&&(O*=-1),m!==0&&!z.showLabelBackdrop&&(D+=N/2*Math.sin(m))):(R=A,O=(1-P)*N/2);let K;if(z.showLabelBackdrop){const ee=Lc(z.backdropPadding),le=j.heights[b],ke=j.widths[b];let xe=O-ee.top,me=0-ee.left;switch(B){case"middle":xe-=le/2;break;case"bottom":xe-=le;break}switch(E){case"center":me-=ke/2;break;case"right":me-=ke;break;case"inner":b===y-1?me-=ke:b>0&&(me-=ke/2);break}K={left:me,top:xe,width:ke+ee.width,height:le+ee.height,color:z.backdropColor}}_.push({label:k,font:M,textOffset:O,options:{rotation:m,color:Y,strokeColor:X,strokeWidth:Q,textAlign:ie,textBaseline:B,translation:[D,R],backdrop:K}})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Op(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),l=e+o,c=a.widest.width;let u,d;return n==="left"?s?(d=this.right+o,r==="near"?u="left":r==="center"?(u="center",d+=c/2):(u="right",d+=c)):(d=this.right-l,r==="near"?u="right":r==="center"?(u="center",d-=c/2):(u="left",d=this.left)):n==="right"?s?(d=this.left+o,r==="near"?u="right":r==="center"?(u="center",d-=c/2):(u="left",d-=c)):(d=this.left+l,r==="near"?u="left":r==="center"?(u="center",d+=c/2):(u="right",d=this.right)):u="right",{textAlign:u,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:r,top:s,width:o,height:a}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,s,o,a),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,a;const l=(c,u,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(o=0,a=s.length;o<a;++o){const c=s[o];n.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:r,grid:s}}=this,o=r.setContext(this.getContext()),a=r.display?o.width:0;if(!a)return;const l=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let u,d,h,f;this.isHorizontal()?(u=SC(e,this.left,a)-a/2,d=SC(e,this.right,l)+l/2,h=f=c):(h=SC(e,this.top,a)-a/2,f=SC(e,this.bottom,l)+l/2,u=d=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(u,h),n.lineTo(d,f),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&jV(r,s);const o=this.getLabelItems(e);for(const a of o){const l=a.options,c=a.font,u=a.label,d=a.textOffset;$x(r,u,0,d,c,l)}s&&WV(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const o=qa(r.font),a=Lc(r.padding),l=r.align;let c=o.lineHeight/2;n==="bottom"||n==="center"||cr(n)?(c+=a.bottom,fo(r.text)&&(c+=o.lineHeight*(r.text.length-1))):c+=a.top;const{titleX:u,titleY:d,maxWidth:h,rotation:f}=rzt(this,c,n,l);$x(e,r.text,0,0,o,{color:r.color,maxWidth:h,rotation:f,textAlign:izt(l,n,s),textBaseline:"middle",translation:[u,d]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,r=Li(e.grid&&e.grid.z,-1),s=Li(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==mk.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let o,a;for(o=0,a=n.length;o<a;++o){const l=n[o];l[r]===this.id&&(!e||l.type===e)&&s.push(l)}return s}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return qa(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class RB{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let r;azt(n)&&(r=this.register(n));const s=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in s||(s[o]=e,szt(e,a,r),this.override&&po.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,s=this.scope;r in n&&delete n[r],s&&r in po[s]&&(delete po[s][r],this.override&&delete Wx[r])}}function szt(i,e,n){const r=jO(Object.create(null),[n?po.get(n):{},po.get(e),i.defaults]);po.set(e,r),i.defaultRoutes&&ozt(e,i.defaultRoutes),i.descriptors&&po.describe(e,i.descriptors)}function ozt(i,e){Object.keys(e).forEach(n=>{const r=n.split("."),s=r.pop(),o=[i].concat(r).join("."),a=e[n].split("."),l=a.pop(),c=a.join(".");po.route(o,s,c,l)})}function azt(i){return"id"in i&&"defaults"in i}class lzt{constructor(){this.controllers=new RB(Up,"datasets",!0),this.elements=new RB(Gv,"elements"),this.plugins=new RB(Object,"plugins"),this.scales=new RB(mk,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,r){[...n].forEach(s=>{const o=r||this._getRegistryForType(s);r||o.isForType(s)||o===this.plugins&&s.id?this._exec(e,o,s):ss(s,a=>{const l=r||this._getRegistryForType(a);this._exec(e,l,a)})})}_exec(e,n,r){const s=Nce(e);$s(r["before"+s],[],r),n[e](r),$s(r["after"+s],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const s=n.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return s}}var Yg=new lzt;class czt{constructor(){this._init=[]}notify(e,n,r,s){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=s?this._descriptors(e).filter(s):this._descriptors(e),a=this._notify(o,e,n,r);return n==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,n,r,s){s=s||{};for(const o of e){const a=o.plugin,l=a[r],c=[n,s,o.options];if($s(l,c,a)===!1&&s.cancelable)return!1}return!0}invalidate(){rr(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const r=e&&e.config,s=Li(r.options&&r.options.plugins,{}),o=uzt(r);return s===!1&&!n?[]:hzt(e,o,s,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,s=(o,a)=>o.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(s(n,r),e,"stop"),this._notify(s(r,n),e,"start")}}function uzt(i){const e={},n=[],r=Object.keys(Yg.plugins.items);for(let o=0;o<r.length;o++)n.push(Yg.getPlugin(r[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];n.indexOf(a)===-1&&(n.push(a),e[a.id]=!0)}return{plugins:n,localIds:e}}function dzt(i,e){return!e&&i===!1?null:i===!0?{}:i}function hzt(i,{plugins:e,localIds:n},r,s){const o=[],a=i.getContext();for(const l of e){const c=l.id,u=dzt(r[c],s);u!==null&&o.push({plugin:l,options:fzt(i.config,{plugin:l,local:n[c]},u,a)})}return o}function fzt(i,{plugin:e,local:n},r,s){const o=i.pluginScopeKeys(e),a=i.getOptionScopes(r,o);return n&&e.defaults&&a.push(e.defaults),i.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $ie(i,e){const n=po.datasets[i]||{};return((e.datasets||{})[i]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function pzt(i,e){let n=i;return i==="_index_"?n=e:i==="_value_"&&(n=e==="x"?"y":"x"),n}function gzt(i,e){return i===e?"_index_":"_value_"}function NCe(i){if(i==="x"||i==="y"||i==="r")return i}function mzt(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function zie(i,...e){if(NCe(i))return i;for(const n of e){const r=n.axis||mzt(n.position)||i.length>1&&NCe(i[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function MCe(i,e,n){if(n[e+"AxisID"]===i)return{axis:e}}function _zt(i,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===i||r.yAxisID===i);if(n.length)return MCe(i,"x",n[0])||MCe(i,"y",n[0])}return{}}function vzt(i,e){const n=Wx[i.type]||{scales:{}},r=e.scales||{},s=$ie(i.type,e),o=Object.create(null);return Object.keys(r).forEach(a=>{const l=r[a];if(!cr(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=zie(a,l,_zt(a,i),po.scales[l.type]),u=gzt(c,s),d=n.scales||{};o[a]=OM(Object.create(null),[{axis:c},l,d[c],d[u]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,c=a.indexAxis||$ie(l,e),d=(Wx[l]||{}).scales||{};Object.keys(d).forEach(h=>{const f=pzt(h,c),p=a[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),OM(o[p],[{axis:f},r[p],d[h]])})}),Object.keys(o).forEach(a=>{const l=o[a];OM(l,[po.scales[l.type],po.scale])}),o}function mFe(i){const e=i.options||(i.options={});e.plugins=Li(e.plugins,{}),e.scales=vzt(i,e)}function _Fe(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function bzt(i){return i=i||{},i.data=_Fe(i.data),mFe(i),i}const PCe=new Map,vFe=new Set;function AB(i,e){let n=PCe.get(i);return n||(n=e(),PCe.set(i,n),vFe.add(n)),n}const zA=(i,e,n)=>{const r=O1(e,n);r!==void 0&&i.add(r)};class yzt{constructor(e){this._config=bzt(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=_Fe(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),mFe(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return AB(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return AB(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return AB(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return AB(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let s=r.get(e);return(!s||n)&&(s=new Map,r.set(e,s)),s}getOptionScopes(e,n,r){const{options:s,type:o}=this,a=this._cachedScopes(e,r),l=a.get(n);if(l)return l;const c=new Set;n.forEach(d=>{e&&(c.add(e),d.forEach(h=>zA(c,e,h))),d.forEach(h=>zA(c,s,h)),d.forEach(h=>zA(c,Wx[o]||{},h)),d.forEach(h=>zA(c,po,h)),d.forEach(h=>zA(c,Bie,h))});const u=Array.from(c);return u.length===0&&u.push(Object.create(null)),vFe.has(n)&&a.set(n,u),u}chartOptionScopes(){const{options:e,type:n}=this;return[e,Wx[n]||{},po.datasets[n]||{},{type:n},po,Bie]}resolveNamedOptions(e,n,r,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:l}=OCe(this._resolverCache,e,s);let c=a;if(Czt(a,n)){o.$shared=!1,r=F1(r)?r():r;const u=this.createResolver(e,r,l);c=SI(a,r,u)}for(const u of n)o[u]=c[u];return o}createResolver(e,n,r=[""],s){const{resolver:o}=OCe(this._resolverCache,e,r);return cr(n)?SI(o,n,void 0,s):o}}function OCe(i,e,n){let r=i.get(e);r||(r=new Map,i.set(e,r));const s=n.join();let o=r.get(s);return o||(o={resolver:jce(e,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},r.set(s,o)),o}const wzt=i=>cr(i)&&Object.getOwnPropertyNames(i).some(e=>F1(i[e]));function Czt(i,e){const{isScriptable:n,isIndexable:r}=Y4e(i);for(const s of e){const o=n(s),a=r(s),l=(a||o)&&i[s];if(o&&(F1(l)||wzt(l))||a&&fo(l))return!0}return!1}var Szt="4.5.0";const xzt=["top","bottom","left","right","chartArea"];function FCe(i,e){return i==="top"||i==="bottom"||xzt.indexOf(i)===-1&&e==="x"}function BCe(i,e){return function(n,r){return n[i]===r[i]?n[e]-r[e]:n[i]-r[i]}}function jCe(i){const e=i.chart,n=e.options.animation;e.notifyPlugins("afterRender"),$s(n&&n.onComplete,[i],e)}function kzt(i){const e=i.chart,n=e.options.animation;$s(n&&n.onProgress,[i],e)}function bFe(i){return zce()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Y8={},WCe=i=>{const e=bFe(i);return Object.values(Y8).filter(n=>n.canvas===e).pop()};function Lzt(i,e,n){const r=Object.keys(i);for(const s of r){const o=+s;if(o>=e){const a=i[s];delete i[s],(n>0||o>e)&&(i[o+n]=a)}}}function Dzt(i,e,n,r){return!n||i.type==="mouseout"?null:r?e:i}class F0{static register(...e){Yg.add(...e),$Ce()}static unregister(...e){Yg.remove(...e),$Ce()}constructor(e,n){const r=this.config=new yzt(n),s=bFe(e),o=WCe(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||U$t(s)),this.platform.updateConfig(r);const l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,u=c&&c.height,d=c&&c.width;if(this.id=Ejt(),this.ctx=l,this.canvas=c,this.width=d,this.height=u,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new czt,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ujt(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Y8[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}C0.listen(this,"complete",jCe),C0.listen(this,"progress",kzt),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:s,_aspectRatio:o}=this;return rr(e)?n&&o?o:s?r/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Yg}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():cCe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return oCe(this.canvas,this.ctx),this}stop(){return C0.stop(this),this}resize(e,n){C0.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,s=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,e,n,o),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,cCe(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),$s(r.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};ss(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,s=Object.keys(r).reduce((a,l)=>(a[l]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const l=n[a],c=zie(a,l),u=c==="r",d=c==="x";return{options:l,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),ss(o,a=>{const l=a.options,c=l.id,u=zie(c,l),d=Li(l.type,a.dtype);(l.position===void 0||FCe(l.position,u)!==FCe(a.dposition))&&(l.position=a.dposition),s[c]=!0;let h=null;if(c in r&&r[c].type===d)h=r[c];else{const f=Yg.getScale(d);h=new f({id:c,type:d,ctx:this.ctx,chart:this}),r[h.id]=h}h.init(l,e)}),ss(s,(a,l)=>{a||delete r[l]}),ss(r,a=>{vc.configure(this,a,a.options),vc.addBox(this,a)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((s,o)=>s.index-o.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(BCe("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,s)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const o=n[r];let a=this.getDatasetMeta(r);const l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=l,a.indexAxis=o.indexAxis||$ie(l,this.options),a.order=o.order||0,a.index=r,a.label=""+o.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const c=Yg.getController(l),{datasetElementType:u,dataElementType:d}=po.datasets[l];Object.assign(c,{dataElementType:Yg.getElement(d),datasetElementType:u&&Yg.getElement(u)}),a.controller=new c(this,r),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){ss(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let u=0,d=this.data.datasets.length;u<d;u++){const{controller:h}=this.getDatasetMeta(u),f=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),s||ss(o,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(BCe("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){ss(this.scales,e=>{vc.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!Zwe(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:o}of n){const a=r==="_removeElements"?-o:o;Lzt(e,s,a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(e.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),s=r(0);for(let o=1;o<n;o++)if(!Zwe(s,r(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vc.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],ss(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,F1(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),s={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(C0.has(this)?this.attached&&!C0.running(this)&&C0.start(this):(this.draw(),jCe({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,r=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];(!e||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,r={meta:e,index:e.index,cancelable:!0},s=aFe(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&jV(n,s),e.controller.draw(),s&&WV(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return lv(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,s){const o=x$t.modes[n];return typeof o=="function"?o(this,e,r,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let s=r.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=sw(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const s=r?"show":"hide",o=this.getDatasetMeta(e),a=o.controller._resolveAnimations(void 0,s);WO(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),a.update(o,{visible:r}),this.update(l=>l.datasetIndex===e?s:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),C0.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),oCe(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Y8[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,r=(o,a)=>{n.addEventListener(this,o,a),e[o]=a},s=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};ss(this.options.events,o=>r(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(c,u)=>{n.addEventListener(this,c,u),e[c]=u},s=(c,u)=>{e[c]&&(n.removeEventListener(this,c,u),delete e[c])},o=(c,u)=>{this.canvas&&this.resize(c,u)};let a;const l=()=>{s("attach",l),this.attached=!0,this.resize(),r("resize",o),r("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),r("attach",l)},n.isAttached(this.canvas)?l():a()}unbindEvents(){ss(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},ss(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const s=r?"set":"remove";let o,a,l,c;for(n==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){a=e[l];const u=a&&this.getDatasetMeta(a.datasetIndex).controller;u&&u[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:o,index:a})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!Fj(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const s=this.options.hover,o=(c,u)=>c.filter(d=>!u.some(h=>d.datasetIndex===h.datasetIndex&&d.index===h.index)),a=o(n,e),l=r?e:o(e,n);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const o=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(o||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:s=[],options:o}=this,a=n,l=this._getActiveElements(e,s,r,a),c=Mjt(e),u=Dzt(e,this._lastEvent,r,c);r&&(this._lastEvent=null,$s(o.onHover,[e,l,this],this),c&&$s(o.onClick,[e,l,this],this));const d=!Fj(l,s);return(d||n)&&(this._active=l,this._updateHoverStyles(l,s,n)),this._lastEvent=u,d}_getActiveElements(e,n,r,s){if(e.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,s)}}xt(F0,"defaults",po),xt(F0,"instances",Y8),xt(F0,"overrides",Wx),xt(F0,"registry",Yg),xt(F0,"version",Szt),xt(F0,"getChart",WCe);function $Ce(){return ss(F0.instances,i=>i._plugins.invalidate())}function Ezt(i,e,n){const{startAngle:r,x:s,y:o,outerRadius:a,innerRadius:l,options:c}=e,{borderWidth:u,borderJoinStyle:d}=c,h=Math.min(u/a,pc(r-n));if(i.beginPath(),i.arc(s,o,a-u/2,r+h/2,n-h/2),l>0){const f=Math.min(u/l,pc(r-n));i.arc(s,o,l+u/2,n-f/2,r+f/2,!0)}else{const f=Math.min(u/2,a*pc(r-n));if(d==="round")i.arc(s,o,f,n-Or/2,r+Or/2,!0);else if(d==="bevel"){const p=2*f*f,g=-p*Math.cos(n+Or/2)+s,m=-p*Math.sin(n+Or/2)+o,_=p*Math.cos(r+Or/2)+s,b=p*Math.sin(r+Or/2)+o;i.lineTo(g,m),i.lineTo(_,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function Izt(i,e,n){const{startAngle:r,pixelMargin:s,x:o,y:a,outerRadius:l,innerRadius:c}=e;let u=s/l;i.beginPath(),i.arc(o,a,l,r-u,n+u),c>s?(u=s/c,i.arc(o,a,c,n+u,r-u,!0)):i.arc(o,a,s,n+aa,r-aa),i.closePath(),i.clip()}function Tzt(i){return Bce(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Rzt(i,e,n,r){const s=Tzt(i.options.borderRadius),o=(n-e)/2,a=Math.min(o,r*e/2),l=c=>{const u=(n-Math.min(o,c))*r/2;return fl(c,0,Math.min(o,u))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:fl(s.innerStart,0,a),innerEnd:fl(s.innerEnd,0,a)}}function TD(i,e,n,r){return{x:n+i*Math.cos(e),y:r+i*Math.sin(e)}}function Vj(i,e,n,r,s,o){const{x:a,y:l,startAngle:c,pixelMargin:u,innerRadius:d}=e,h=Math.max(e.outerRadius+r+n-u,0),f=d>0?d+r+n+u:0;let p=0;const g=s-c;if(r){const z=d>0?d-r:0,H=h>0?h-r:0,Y=(z+H)/2,X=Y!==0?g*Y/(Y+r):g;p=(g-X)/2}const m=Math.max(.001,g*h-n/Or)/h,_=(g-m)/2,b=c+_+p,y=s-_-p,{outerStart:x,outerEnd:k,innerStart:D,innerEnd:R}=Rzt(e,f,h,y-b),E=h-x,A=h-k,M=b+x/E,N=y-k/A,P=f+D,O=f+R,B=b+D/P,j=y-R/O;if(i.beginPath(),o){const z=(M+N)/2;if(i.arc(a,l,h,M,z),i.arc(a,l,h,z,N),k>0){const Q=TD(A,N,a,l);i.arc(Q.x,Q.y,k,N,y+aa)}const H=TD(O,y,a,l);if(i.lineTo(H.x,H.y),R>0){const Q=TD(O,j,a,l);i.arc(Q.x,Q.y,R,y+aa,j+Math.PI)}const Y=(y-R/f+(b+D/f))/2;if(i.arc(a,l,f,y-R/f,Y,!0),i.arc(a,l,f,Y,b+D/f,!0),D>0){const Q=TD(P,B,a,l);i.arc(Q.x,Q.y,D,B+Math.PI,b-aa)}const X=TD(E,b,a,l);if(i.lineTo(X.x,X.y),x>0){const Q=TD(E,M,a,l);i.arc(Q.x,Q.y,x,b-aa,M)}}else{i.moveTo(a,l);const z=Math.cos(M)*h+a,H=Math.sin(M)*h+l;i.lineTo(z,H);const Y=Math.cos(N)*h+a,X=Math.sin(N)*h+l;i.lineTo(Y,X)}i.closePath()}function Azt(i,e,n,r,s){const{fullCircles:o,startAngle:a,circumference:l}=e;let c=e.endAngle;if(o){Vj(i,e,n,r,c,s);for(let u=0;u<o;++u)i.fill();isNaN(l)||(c=a+(l%io||io))}return Vj(i,e,n,r,c,s),i.fill(),c}function Nzt(i,e,n,r,s){const{fullCircles:o,startAngle:a,circumference:l,options:c}=e,{borderWidth:u,borderJoinStyle:d,borderDash:h,borderDashOffset:f,borderRadius:p}=c,g=c.borderAlign==="inner";if(!u)return;i.setLineDash(h||[]),i.lineDashOffset=f,g?(i.lineWidth=u*2,i.lineJoin=d||"round"):(i.lineWidth=u,i.lineJoin=d||"bevel");let m=e.endAngle;if(o){Vj(i,e,n,r,m,s);for(let _=0;_<o;++_)i.stroke();isNaN(l)||(m=a+(l%io||io))}g&&Izt(i,e,m),c.selfJoin&&m-a>=Or&&p===0&&d!=="miter"&&Ezt(i,e,m),o||(Vj(i,e,n,r,m,s),i.stroke())}class MN extends Gv{constructor(n){super();xt(this,"circumference");xt(this,"endAngle");xt(this,"fullCircles");xt(this,"innerRadius");xt(this,"outerRadius");xt(this,"pixelMargin");xt(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,s){const o=this.getProps(["x","y"],s),{angle:a,distance:l}=W4e(o,{x:n,y:r}),{startAngle:c,endAngle:u,innerRadius:d,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),p=(this.options.spacing+this.options.borderWidth)/2,g=Li(f,u-c),m=$O(a,c,u)&&c!==u,_=g>=io||m,b=ov(l,d+p,h+p);return _&&b}getCenterPoint(n){const{x:r,y:s,startAngle:o,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:u,spacing:d}=this.options,h=(o+a)/2,f=(l+c+d+u)/2;return{x:r+Math.cos(h)*f,y:s+Math.sin(h)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:s}=this,o=(r.offset||0)/4,a=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=s>io?Math.floor(s/io):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*o,Math.sin(c)*o);const u=1-Math.sin(Math.min(Or,s||0)),d=o*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Azt(n,this,d,a,l),Nzt(n,this,d,a,l),n.restore()}}xt(MN,"id","arc"),xt(MN,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),xt(MN,"defaultRoutes",{backgroundColor:"backgroundColor"}),xt(MN,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function yFe(i,e,n=e){i.lineCap=Li(n.borderCapStyle,e.borderCapStyle),i.setLineDash(Li(n.borderDash,e.borderDash)),i.lineDashOffset=Li(n.borderDashOffset,e.borderDashOffset),i.lineJoin=Li(n.borderJoinStyle,e.borderJoinStyle),i.lineWidth=Li(n.borderWidth,e.borderWidth),i.strokeStyle=Li(n.borderColor,e.borderColor)}function Mzt(i,e,n){i.lineTo(n.x,n.y)}function Pzt(i){return i.stepped?iWt:i.tension||i.cubicInterpolationMode==="monotone"?rWt:Mzt}function wFe(i,e,n={}){const r=i.length,{start:s=0,end:o=r-1}=n,{start:a,end:l}=e,c=Math.max(s,a),u=Math.min(o,l),d=s<a&&o<a||s>l&&o>l;return{count:r,start:c,loop:e.loop,ilen:u<c&&!d?r+u-c:u-c}}function Ozt(i,e,n,r){const{points:s,options:o}=e,{count:a,start:l,loop:c,ilen:u}=wFe(s,n,r),d=Pzt(o);let{move:h=!0,reverse:f}=r||{},p,g,m;for(p=0;p<=u;++p)g=s[(l+(f?u-p:p))%a],!g.skip&&(h?(i.moveTo(g.x,g.y),h=!1):d(i,m,g,f,o.stepped),m=g);return c&&(g=s[(l+(f?u:0))%a],d(i,m,g,f,o.stepped)),!!c}function Fzt(i,e,n,r){const s=e.points,{count:o,start:a,ilen:l}=wFe(s,n,r),{move:c=!0,reverse:u}=r||{};let d=0,h=0,f,p,g,m,_,b;const y=k=>(a+(u?l-k:k))%o,x=()=>{m!==_&&(i.lineTo(d,_),i.lineTo(d,m),i.lineTo(d,b))};for(c&&(p=s[y(0)],i.moveTo(p.x,p.y)),f=0;f<=l;++f){if(p=s[y(f)],p.skip)continue;const k=p.x,D=p.y,R=k|0;R===g?(D<m?m=D:D>_&&(_=D),d=(h*d+k)/++h):(x(),i.lineTo(k,D),g=R,h=0,m=_=D),b=D}x()}function Vie(i){const e=i.options,n=e.borderDash&&e.borderDash.length;return!i._decimated&&!i._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?Fzt:Ozt}function Bzt(i){return i.stepped?OWt:i.tension||i.cubicInterpolationMode==="monotone"?FWt:VC}function jzt(i,e,n,r){let s=e._path;s||(s=e._path=new Path2D,e.path(s,n,r)&&s.closePath()),yFe(i,e.options),i.stroke(s)}function Wzt(i,e,n,r){const{segments:s,options:o}=e,a=Vie(e);for(const l of s)yFe(i,o,l.style),i.beginPath(),a(i,e,l,{start:n,end:n+r-1})&&i.closePath(),i.stroke()}const $zt=typeof Path2D=="function";function zzt(i,e,n,r){$zt&&!e.options.segment?jzt(i,e,n,r):Wzt(i,e,n,r)}class Ay extends Gv{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const s=r.spanGaps?this._loop:this._fullLoop;EWt(this._points,r,e,s,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=VWt(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,r=e.length;return r&&n[e[r-1].end]}interpolate(e,n){const r=this.options,s=e[n],o=this.points,a=oFe(this,{property:n,start:s,end:s});if(!a.length)return;const l=[],c=Bzt(r);let u,d;for(u=0,d=a.length;u<d;++u){const{start:h,end:f}=a[u],p=o[h],g=o[f];if(p===g){l.push(p);continue}const m=Math.abs((s-p[n])/(g[n]-p[n])),_=c(p,g,m,r.stepped);_[n]=e[n],l.push(_)}return l.length===1?l[0]:l}pathSegment(e,n,r){return Vie(this)(e,this,n,r)}path(e,n,r){const s=this.segments,o=Vie(this);let a=this._loop;n=n||0,r=r||this.points.length-n;for(const l of s)a&=o(e,this,l,{start:n,end:n+r-1});return!!a}draw(e,n,r,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),zzt(e,this,r,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}xt(Ay,"id","line"),xt(Ay,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),xt(Ay,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),xt(Ay,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function zCe(i,e,n,r){const s=i.options,{[n]:o}=i.getProps([n],r);return Math.abs(e-o)<s.radius+s.hitRadius}class Z8 extends Gv{constructor(n){super();xt(this,"parsed");xt(this,"skip");xt(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,s){const o=this.options,{x:a,y:l}=this.getProps(["x","y"],s);return Math.pow(n-a,2)+Math.pow(r-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return zCe(this,n,"x",r)}inYRange(n,r){return zCe(this,n,"y",r)}getCenterPoint(n){const{x:r,y:s}=this.getProps(["x","y"],n);return{x:r,y:s}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const s=r&&n.borderWidth||0;return(r+s)*2}draw(n,r){const s=this.options;this.skip||s.radius<.1||!lv(this,r,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,jie(n,s,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}xt(Z8,"id","point"),xt(Z8,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),xt(Z8,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function CFe(i,e){const{x:n,y:r,base:s,width:o,height:a}=i.getProps(["x","y","base","width","height"],e);let l,c,u,d,h;return i.horizontal?(h=a/2,l=Math.min(n,s),c=Math.max(n,s),u=r-h,d=r+h):(h=o/2,l=n-h,c=n+h,u=Math.min(r,s),d=Math.max(r,s)),{left:l,top:u,right:c,bottom:d}}function Ny(i,e,n,r){return i?0:fl(e,n,r)}function Vzt(i,e,n){const r=i.options.borderWidth,s=i.borderSkipped,o=X4e(r);return{t:Ny(s.top,o.top,0,n),r:Ny(s.right,o.right,0,e),b:Ny(s.bottom,o.bottom,0,n),l:Ny(s.left,o.left,0,e)}}function Hzt(i,e,n){const{enableBorderRadius:r}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=KS(s),a=Math.min(e,n),l=i.borderSkipped,c=r||cr(s);return{topLeft:Ny(!c||l.top||l.left,o.topLeft,0,a),topRight:Ny(!c||l.top||l.right,o.topRight,0,a),bottomLeft:Ny(!c||l.bottom||l.left,o.bottomLeft,0,a),bottomRight:Ny(!c||l.bottom||l.right,o.bottomRight,0,a)}}function Uzt(i){const e=CFe(i),n=e.right-e.left,r=e.bottom-e.top,s=Vzt(i,n/2,r/2),o=Hzt(i,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function kY(i,e,n,r){const s=e===null,o=n===null,l=i&&!(s&&o)&&CFe(i,r);return l&&(s||ov(e,l.left,l.right))&&(o||ov(n,l.top,l.bottom))}function qzt(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Kzt(i,e){i.rect(e.x,e.y,e.w,e.h)}function LY(i,e,n={}){const r=i.x!==n.x?-e:0,s=i.y!==n.y?-e:0,o=(i.x+i.w!==n.x+n.w?e:0)-r,a=(i.y+i.h!==n.y+n.h?e:0)-s;return{x:i.x+r,y:i.y+s,w:i.w+o,h:i.h+a,radius:i.radius}}class Q8 extends Gv{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:r,backgroundColor:s}}=this,{inner:o,outer:a}=Uzt(this),l=qzt(a.radius)?zO:Kzt;e.save(),(a.w!==o.w||a.h!==o.h)&&(e.beginPath(),l(e,LY(a,n,o)),e.clip(),l(e,LY(o,-n,a)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),l(e,LY(o,n)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,n,r){return kY(this,e,n,r)}inXRange(e,n){return kY(this,e,null,n)}inYRange(e,n){return kY(this,null,e,n)}getCenterPoint(e){const{x:n,y:r,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(n+s)/2:n,y:o?r:(r+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}xt(Q8,"id","bar"),xt(Q8,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),xt(Q8,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Gzt=Object.freeze({__proto__:null,ArcElement:MN,BarElement:Q8,LineElement:Ay,PointElement:Z8});const Hie=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],VCe=Hie.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function SFe(i){return Hie[i%Hie.length]}function xFe(i){return VCe[i%VCe.length]}function Xzt(i,e){return i.borderColor=SFe(e),i.backgroundColor=xFe(e),++e}function Yzt(i,e){return i.backgroundColor=i.data.map(()=>SFe(e++)),e}function Zzt(i,e){return i.backgroundColor=i.data.map(()=>xFe(e++)),e}function Qzt(i){let e=0;return(n,r)=>{const s=i.getDatasetMeta(r).controller;s instanceof kS?e=Yzt(n,e):s instanceof WM?e=Zzt(n,e):s&&(e=Xzt(n,e))}}function HCe(i){let e;for(e in i)if(i[e].borderColor||i[e].backgroundColor)return!0;return!1}function Jzt(i){return i&&(i.borderColor||i.backgroundColor)}function eVt(){return po.borderColor!=="rgba(0,0,0,0.1)"||po.backgroundColor!=="rgba(0,0,0,0.1)"}var tVt={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,e,n){if(!n.enabled)return;const{data:{datasets:r},options:s}=i.config,{elements:o}=s,a=HCe(r)||Jzt(s)||o&&HCe(o)||eVt();if(!n.forceOverride&&a)return;const l=Qzt(i);r.forEach(l)}};function nVt(i,e,n,r,s){const o=s.samples||r;if(o>=n)return i.slice(e,e+n);const a=[],l=(n-2)/(o-2);let c=0;const u=e+n-1;let d=e,h,f,p,g,m;for(a[c++]=i[d],h=0;h<o-2;h++){let _=0,b=0,y;const x=Math.floor((h+1)*l)+1+e,k=Math.min(Math.floor((h+2)*l)+1,n)+e,D=k-x;for(y=x;y<k;y++)_+=i[y].x,b+=i[y].y;_/=D,b/=D;const R=Math.floor(h*l)+1+e,E=Math.min(Math.floor((h+1)*l)+1,n)+e,{x:A,y:M}=i[d];for(p=g=-1,y=R;y<E;y++)g=.5*Math.abs((A-_)*(i[y].y-M)-(A-i[y].x)*(b-M)),g>p&&(p=g,f=i[y],m=y);a[c++]=f,d=m}return a[c++]=i[u],a}function iVt(i,e,n,r){let s=0,o=0,a,l,c,u,d,h,f,p,g,m;const _=[],b=e+n-1,y=i[e].x,k=i[b].x-y;for(a=e;a<e+n;++a){l=i[a],c=(l.x-y)/k*r,u=l.y;const D=c|0;if(D===d)u<g?(g=u,h=a):u>m&&(m=u,f=a),s=(o*s+l.x)/++o;else{const R=a-1;if(!rr(h)&&!rr(f)){const E=Math.min(h,f),A=Math.max(h,f);E!==p&&E!==R&&_.push({...i[E],x:s}),A!==p&&A!==R&&_.push({...i[A],x:s})}a>0&&R!==p&&_.push(i[R]),_.push(l),d=D,o=0,g=m=u,h=f=p=a}}return _}function kFe(i){if(i._decimated){const e=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function UCe(i){i.data.datasets.forEach(e=>{kFe(e)})}function rVt(i,e){const n=e.length;let r=0,s;const{iScale:o}=i,{min:a,max:l,minDefined:c,maxDefined:u}=o.getUserBounds();return c&&(r=fl(av(e,o.axis,a).lo,0,n-1)),u?s=fl(av(e,o.axis,l).hi+1,r,n)-r:s=n-r,{start:r,count:s}}var sVt={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,e,n)=>{if(!n.enabled){UCe(i);return}const r=i.width;i.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:l}=s,c=i.getDatasetMeta(o),u=a||s.data;if(AN([l,i.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const d=i.scales[c.xAxisID];if(d.type!=="linear"&&d.type!=="time"||i.options.parsing)return;let{start:h,count:f}=rVt(c,u);const p=n.threshold||4*r;if(f<=p){kFe(s);return}rr(a)&&(s._data=u,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(n.algorithm){case"lttb":g=nVt(u,h,f,r,n);break;case"min-max":g=iVt(u,h,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=g})},destroy(i){UCe(i)}};function oVt(i,e,n){const r=i.segments,s=i.points,o=e.points,a=[];for(const l of r){let{start:c,end:u}=l;u=VV(c,u,s);const d=Uie(n,s[c],s[u],l.loop);if(!e.segments){a.push({source:l,target:d,start:s[c],end:s[u]});continue}const h=oFe(e,d);for(const f of h){const p=Uie(n,o[f.start],o[f.end],f.loop),g=sFe(l,s,p);for(const m of g)a.push({source:m,target:f,start:{[n]:qCe(d,p,"start",Math.max)},end:{[n]:qCe(d,p,"end",Math.min)}})}}return a}function Uie(i,e,n,r){if(r)return;let s=e[i],o=n[i];return i==="angle"&&(s=pc(s),o=pc(o)),{property:i,start:s,end:o}}function aVt(i,e){const{x:n=null,y:r=null}=i||{},s=e.points,o=[];return e.segments.forEach(({start:a,end:l})=>{l=VV(a,l,s);const c=s[a],u=s[l];r!==null?(o.push({x:c.x,y:r}),o.push({x:u.x,y:r})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:u.y}))}),o}function VV(i,e,n){for(;e>i;e--){const r=n[e];if(!isNaN(r.x)&&!isNaN(r.y))break}return e}function qCe(i,e,n,r){return i&&e?r(i[n],e[n]):i?i[n]:e?e[n]:0}function LFe(i,e){let n=[],r=!1;return fo(i)?(r=!0,n=i):n=aVt(i,e),n.length?new Ay({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function KCe(i){return i&&i.fill!==!1}function lVt(i,e,n){let s=i[e].fill;const o=[e];let a;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!zo(s))return s;if(a=i[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function cVt(i,e,n){const r=fVt(i);if(cr(r))return isNaN(r.value)?!1:r;let s=parseFloat(r);return zo(s)&&Math.floor(s)===s?uVt(r[0],e,s,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function uVt(i,e,n,r){return(i==="-"||i==="+")&&(n=e+n),n===e||n<0||n>=r?!1:n}function dVt(i,e){let n=null;return i==="start"?n=e.bottom:i==="end"?n=e.top:cr(i)?n=e.getPixelForValue(i.value):e.getBasePixel&&(n=e.getBasePixel()),n}function hVt(i,e,n){let r;return i==="start"?r=n:i==="end"?r=e.options.reverse?e.min:e.max:cr(i)?r=i.value:r=e.getBaseValue(),r}function fVt(i){const e=i.options,n=e.fill;let r=Li(n&&n.target,n);return r===void 0&&(r=!!e.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function pVt(i){const{scale:e,index:n,line:r}=i,s=[],o=r.segments,a=r.points,l=gVt(e,n);l.push(LFe({x:null,y:e.bottom},r));for(let c=0;c<o.length;c++){const u=o[c];for(let d=u.start;d<=u.end;d++)mVt(s,a[d],l)}return new Ay({points:s,options:{}})}function gVt(i,e){const n=[],r=i.getMatchingVisibleMetas("line");for(let s=0;s<r.length;s++){const o=r[s];if(o.index===e)break;o.hidden||n.unshift(o.dataset)}return n}function mVt(i,e,n){const r=[];for(let s=0;s<n.length;s++){const o=n[s],{first:a,last:l,point:c}=_Vt(o,e,"x");if(!(!c||a&&l)){if(a)r.unshift(c);else if(i.push(c),!l)break}}i.push(...r)}function _Vt(i,e,n){const r=i.interpolate(e,n);if(!r)return{};const s=r[n],o=i.segments,a=i.points;let l=!1,c=!1;for(let u=0;u<o.length;u++){const d=o[u],h=a[d.start][n],f=a[d.end][n];if(ov(s,h,f)){l=s===h,c=s===f;break}}return{first:l,last:c,point:r}}class DFe{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,r){const{x:s,y:o,radius:a}=this;return n=n||{start:0,end:io},e.arc(s,o,a,n.end,n.start,!0),!r.bounds}interpolate(e){const{x:n,y:r,radius:s}=this,o=e.angle;return{x:n+Math.cos(o)*s,y:r+Math.sin(o)*s,angle:o}}}function vVt(i){const{chart:e,fill:n,line:r}=i;if(zo(n))return bVt(e,n);if(n==="stack")return pVt(i);if(n==="shape")return!0;const s=yVt(i);return s instanceof DFe?s:LFe(s,r)}function bVt(i,e){const n=i.getDatasetMeta(e);return n&&i.isDatasetVisible(e)?n.dataset:null}function yVt(i){return(i.scale||{}).getPointPositionForValue?CVt(i):wVt(i)}function wVt(i){const{scale:e={},fill:n}=i,r=dVt(n,e);if(zo(r)){const s=e.isHorizontal();return{x:s?r:null,y:s?null:r}}return null}function CVt(i){const{scale:e,fill:n}=i,r=e.options,s=e.getLabels().length,o=r.reverse?e.max:e.min,a=hVt(n,e,o),l=[];if(r.grid.circular){const c=e.getPointPositionForValue(0,o);return new DFe({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(a)})}for(let c=0;c<s;++c)l.push(e.getPointPositionForValue(c,a));return l}function DY(i,e,n){const r=vVt(e),{chart:s,index:o,line:a,scale:l,axis:c}=e,u=a.options,d=u.fill,h=u.backgroundColor,{above:f=h,below:p=h}=d||{},g=s.getDatasetMeta(o),m=aFe(s,g);r&&a.points.length&&(jV(i,n),SVt(i,{line:a,target:r,above:f,below:p,area:n,scale:l,axis:c,clip:m}),WV(i))}function SVt(i,e){const{line:n,target:r,above:s,below:o,area:a,scale:l,clip:c}=e,u=n._loop?"angle":e.axis;i.save();let d=o;o!==s&&(u==="x"?(GCe(i,r,a.top),EY(i,{line:n,target:r,color:s,scale:l,property:u,clip:c}),i.restore(),i.save(),GCe(i,r,a.bottom)):u==="y"&&(XCe(i,r,a.left),EY(i,{line:n,target:r,color:o,scale:l,property:u,clip:c}),i.restore(),i.save(),XCe(i,r,a.right),d=s)),EY(i,{line:n,target:r,color:d,scale:l,property:u,clip:c}),i.restore()}function GCe(i,e,n){const{segments:r,points:s}=e;let o=!0,a=!1;i.beginPath();for(const l of r){const{start:c,end:u}=l,d=s[c],h=s[VV(c,u,s)];o?(i.moveTo(d.x,d.y),o=!1):(i.lineTo(d.x,n),i.lineTo(d.x,d.y)),a=!!e.pathSegment(i,l,{move:a}),a?i.closePath():i.lineTo(h.x,n)}i.lineTo(e.first().x,n),i.closePath(),i.clip()}function XCe(i,e,n){const{segments:r,points:s}=e;let o=!0,a=!1;i.beginPath();for(const l of r){const{start:c,end:u}=l,d=s[c],h=s[VV(c,u,s)];o?(i.moveTo(d.x,d.y),o=!1):(i.lineTo(n,d.y),i.lineTo(d.x,d.y)),a=!!e.pathSegment(i,l,{move:a}),a?i.closePath():i.lineTo(n,h.y)}i.lineTo(n,e.first().y),i.closePath(),i.clip()}function EY(i,e){const{line:n,target:r,property:s,color:o,scale:a,clip:l}=e,c=oVt(n,r,s);for(const{source:u,target:d,start:h,end:f}of c){const{style:{backgroundColor:p=o}={}}=u,g=r!==!0;i.save(),i.fillStyle=p,xVt(i,a,l,g&&Uie(s,h,f)),i.beginPath();const m=!!n.pathSegment(i,u);let _;if(g){m?i.closePath():YCe(i,r,f,s);const b=!!r.pathSegment(i,d,{move:m,reverse:!0});_=m&&b,_||YCe(i,r,h,s)}i.closePath(),i.fill(_?"evenodd":"nonzero"),i.restore()}}function xVt(i,e,n,r){const s=e.chart.chartArea,{property:o,start:a,end:l}=r||{};if(o==="x"||o==="y"){let c,u,d,h;o==="x"?(c=a,u=s.top,d=l,h=s.bottom):(c=s.left,u=a,d=s.right,h=l),i.beginPath(),n&&(c=Math.max(c,n.left),d=Math.min(d,n.right),u=Math.max(u,n.top),h=Math.min(h,n.bottom)),i.rect(c,u,d-c,h-u),i.clip()}}function YCe(i,e,n,r){const s=e.interpolate(n,r);s&&i.lineTo(s.x,s.y)}var kVt={id:"filler",afterDatasetsUpdate(i,e,n){const r=(i.data.datasets||[]).length,s=[];let o,a,l,c;for(a=0;a<r;++a)o=i.getDatasetMeta(a),l=o.dataset,c=null,l&&l.options&&l instanceof Ay&&(c={visible:i.isDatasetVisible(a),index:a,fill:cVt(l,a,r),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,s.push(c);for(a=0;a<r;++a)c=s[a],!(!c||c.fill===!1)&&(c.fill=lVt(s,a,n.propagate))},beforeDraw(i,e,n){const r=n.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=s.length-1;a>=0;--a){const l=s[a].$filler;l&&(l.line.updateControlPoints(o,l.axis),r&&l.fill&&DY(i.ctx,l,o))}},beforeDatasetsDraw(i,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=i.getSortedVisibleDatasetMetas();for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;KCe(o)&&DY(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,e,n){const r=e.meta.$filler;!KCe(r)||n.drawTime!=="beforeDatasetDraw"||DY(i.ctx,r,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ZCe=(i,e)=>{let{boxHeight:n=e,boxWidth:r=e}=i;return i.usePointStyle&&(n=Math.min(n,e),r=i.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},LVt=(i,e)=>i!==null&&e!==null&&i.datasetIndex===e.datasetIndex&&i.index===e.index;class QCe extends Gv{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=$s(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,s)=>e.sort(r,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const r=e.labels,s=qa(r.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=ZCe(r,o);let u,d;n.font=s.string,this.isHorizontal()?(u=this.maxWidth,d=this._fitRows(a,o,l,c)+10):(d=this.maxHeight,u=this._fitCols(a,s,l,c)+10),this.width=Math.min(u,e.maxWidth||this.maxWidth),this.height=Math.min(d,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,s){const{ctx:o,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],u=this.lineWidths=[0],d=s+l;let h=e;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-d;return this.legendItems.forEach((g,m)=>{const _=r+n/2+o.measureText(g.text).width;(m===0||u[u.length-1]+_+2*l>a)&&(h+=d,u[u.length-(m>0?0:1)]=0,p+=d,f++),c[m]={left:0,top:p,row:f,width:_,height:s},u[u.length-1]+=_+l}),h}_fitCols(e,n,r,s){const{ctx:o,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],u=this.columnSizes=[],d=a-e;let h=l,f=0,p=0,g=0,m=0;return this.legendItems.forEach((_,b)=>{const{itemWidth:y,itemHeight:x}=DVt(r,n,o,_,s);b>0&&p+x+2*l>d&&(h+=f+l,u.push({width:f,height:p}),g+=f+l,m++,f=p=0),c[b]={left:g,top:p,col:m,width:y,height:x},f=Math.max(f,y),p+=x+l}),h+=f,u.push({width:f,height:p}),h}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:o}}=this,a=dE(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=uc(r,this.left+s,this.right-this.lineWidths[l]);for(const u of n)l!==u.row&&(l=u.row,c=uc(r,this.left+s,this.right-this.lineWidths[l])),u.top+=this.top+e+s,u.left=a.leftForLtr(a.x(c),u.width),c+=u.width+s}else{let l=0,c=uc(r,this.top+e+s,this.bottom-this.columnSizes[l].height);for(const u of n)u.col!==l&&(l=u.col,c=uc(r,this.top+e+s,this.bottom-this.columnSizes[l].height)),u.top=c,u.left+=this.left+s,u.left=a.leftForLtr(a.x(u.left),u.width),c+=u.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;jV(e,this),this._draw(),WV(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:s}=this,{align:o,labels:a}=e,l=po.color,c=dE(e.rtl,this.left,this.width),u=qa(a.font),{padding:d}=a,h=u.size,f=h/2;let p;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=u.string;const{boxWidth:g,boxHeight:m,itemHeight:_}=ZCe(a,h),b=function(R,E,A){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;s.save();const M=Li(A.lineWidth,1);if(s.fillStyle=Li(A.fillStyle,l),s.lineCap=Li(A.lineCap,"butt"),s.lineDashOffset=Li(A.lineDashOffset,0),s.lineJoin=Li(A.lineJoin,"miter"),s.lineWidth=M,s.strokeStyle=Li(A.strokeStyle,l),s.setLineDash(Li(A.lineDash,[])),a.usePointStyle){const N={radius:m*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:M},P=c.xPlus(R,g/2),O=E+f;G4e(s,N,P,O,a.pointStyleWidth&&g)}else{const N=E+Math.max((h-m)/2,0),P=c.leftForLtr(R,g),O=KS(A.borderRadius);s.beginPath(),Object.values(O).some(B=>B!==0)?zO(s,{x:P,y:N,w:g,h:m,radius:O}):s.rect(P,N,g,m),s.fill(),M!==0&&s.stroke()}s.restore()},y=function(R,E,A){$x(s,A.text,R,E+_/2,u,{strikethrough:A.hidden,textAlign:c.textAlign(A.textAlign)})},x=this.isHorizontal(),k=this._computeTitleHeight();x?p={x:uc(o,this.left+d,this.right-r[0]),y:this.top+d+k,line:0}:p={x:this.left+d,y:uc(o,this.top+k+d,this.bottom-n[0].height),line:0},nFe(this.ctx,e.textDirection);const D=_+d;this.legendItems.forEach((R,E)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const A=s.measureText(R.text).width,M=c.textAlign(R.textAlign||(R.textAlign=a.textAlign)),N=g+f+A;let P=p.x,O=p.y;c.setWidth(this.width),x?E>0&&P+N+d>this.right&&(O=p.y+=D,p.line++,P=p.x=uc(o,this.left+d,this.right-r[p.line])):E>0&&O+D>this.bottom&&(P=p.x=P+n[p.line].width+d,p.line++,O=p.y=uc(o,this.top+k+d,this.bottom-n[p.line].height));const B=c.x(P);if(b(B,O,R),P=qjt(M,P+g+f,x?P+N:this.right,e.rtl),y(c.x(P),O,R),x)p.x+=N+d;else if(typeof R.text!="string"){const j=u.lineHeight;p.y+=EFe(R,j)+d}else p.y+=D}),iFe(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=qa(n.font),s=Lc(n.padding);if(!n.display)return;const o=dE(e.rtl,this.left,this.width),a=this.ctx,l=n.position,c=r.size/2,u=s.top+c;let d,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+u,h=uc(e.align,h,this.right-f);else{const g=this.columnSizes.reduce((m,_)=>Math.max(m,_.height),0);d=u+uc(e.align,this.top,this.bottom-g-e.labels.padding-this._computeTitleHeight())}const p=uc(l,h,h+f);a.textAlign=o.textAlign(Oce(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=r.string,$x(a,n.text,p,d,r)}_computeTitleHeight(){const e=this.options.title,n=qa(e.font),r=Lc(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,s,o;if(ov(e,this.left,this.right)&&ov(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(s=o[r],ov(e,s.left,s.left+s.width)&&ov(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!TVt(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,o=LVt(s,r);s&&!o&&$s(n.onLeave,[e,s,this],this),this._hoveredItem=r,r&&!o&&$s(n.onHover,[e,r,this],this)}else r&&$s(n.onClick,[e,r,this],this)}}function DVt(i,e,n,r,s){const o=EVt(r,i,e,n),a=IVt(s,r,e.lineHeight);return{itemWidth:o,itemHeight:a}}function EVt(i,e,n,r){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),e+n.size/2+r.measureText(s).width}function IVt(i,e,n){let r=i;return typeof e.text!="string"&&(r=EFe(e,n)),r}function EFe(i,e){const n=i.text?i.text.length:0;return e*n}function TVt(i,e){return!!((i==="mousemove"||i==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(i==="click"||i==="mouseup"))}var RVt={id:"legend",_element:QCe,start(i,e,n){const r=i.legend=new QCe({ctx:i.ctx,options:n,chart:i});vc.configure(i,r,n),vc.addBox(i,r)},stop(i){vc.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,e,n){const r=i.legend;vc.configure(i,r,n),r.options=n},afterUpdate(i){const e=i.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(i,e){e.replay||i.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,e,n){const r=e.datasetIndex,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),e.hidden=!0):(s.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const e=i.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:s,color:o,useBorderRadius:a,borderRadius:l}}=i.legend.options;return i._getSortedDatasetMetas().map(c=>{const u=c.controller.getStyle(n?0:void 0),d=Lc(u.borderWidth);return{text:e[c.index].label,fillStyle:u.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:s||u.textAlign,borderRadius:a&&(l||u.borderRadius),datasetIndex:c.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Uce extends Gv{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const s=fo(r.text)?r.text.length:1;this._padding=Lc(r.padding);const o=s*qa(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:r,bottom:s,right:o,options:a}=this,l=a.align;let c=0,u,d,h;return this.isHorizontal()?(d=uc(l,r,o),h=n+e,u=o-r):(a.position==="left"?(d=r+e,h=uc(l,s,n),c=Or*-.5):(d=o-e,h=uc(l,n,s),c=Or*.5),u=s-n),{titleX:d,titleY:h,maxWidth:u,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const r=qa(n.font),o=r.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:u}=this._drawArgs(o);$x(e,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:u,textAlign:Oce(n.align),textBaseline:"middle",translation:[a,l]})}}function AVt(i,e){const n=new Uce({ctx:i.ctx,options:e,chart:i});vc.configure(i,n,e),vc.addBox(i,n),i.titleBlock=n}var NVt={id:"title",_element:Uce,start(i,e,n){AVt(i,n)},stop(i){const e=i.titleBlock;vc.removeBox(i,e),delete i.titleBlock},beforeUpdate(i,e,n){const r=i.titleBlock;vc.configure(i,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const NB=new WeakMap;var MVt={id:"subtitle",start(i,e,n){const r=new Uce({ctx:i.ctx,options:n,chart:i});vc.configure(i,r,n),vc.addBox(i,r),NB.set(i,r)},stop(i){vc.removeBox(i,NB.get(i)),NB.delete(i)},beforeUpdate(i,e,n){const r=NB.get(i);vc.configure(i,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const PN={average(i){if(!i.length)return!1;let e,n,r=new Set,s=0,o=0;for(e=0,n=i.length;e<n;++e){const l=i[e].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),s+=c.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:s/o}},nearest(i,e){if(!i.length)return!1;let n=e.x,r=e.y,s=Number.POSITIVE_INFINITY,o,a,l;for(o=0,a=i.length;o<a;++o){const c=i[o].element;if(c&&c.hasValue()){const u=c.getCenterPoint(),d=Fie(e,u);d<s&&(s=d,l=c)}}if(l){const c=l.tooltipPosition();n=c.x,r=c.y}return{x:n,y:r}}};function qg(i,e){return e&&(fo(e)?Array.prototype.push.apply(i,e):i.push(e)),i}function S0(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
`)>-1?i.split(`
`):i}function PVt(i,e){const{element:n,datasetIndex:r,index:s}=e,o=i.getDatasetMeta(r).controller,{label:a,value:l}=o.getLabelAndValue(s);return{chart:i,label:a,parsed:o.getParsed(s),raw:i.data.datasets[r].data[s],formattedValue:l,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function JCe(i,e){const n=i.chart.ctx,{body:r,footer:s,title:o}=i,{boxWidth:a,boxHeight:l}=e,c=qa(e.bodyFont),u=qa(e.titleFont),d=qa(e.footerFont),h=o.length,f=s.length,p=r.length,g=Lc(e.padding);let m=g.height,_=0,b=r.reduce((k,D)=>k+D.before.length+D.lines.length+D.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,h&&(m+=h*u.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),b){const k=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;m+=p*k+(b-p)*c.lineHeight+(b-1)*e.bodySpacing}f&&(m+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let y=0;const x=function(k){_=Math.max(_,n.measureText(k).width+y)};return n.save(),n.font=u.string,ss(i.title,x),n.font=c.string,ss(i.beforeBody.concat(i.afterBody),x),y=e.displayColors?a+2+e.boxPadding:0,ss(r,k=>{ss(k.before,x),ss(k.lines,x),ss(k.after,x)}),y=0,n.font=d.string,ss(i.footer,x),n.restore(),_+=g.width,{width:_,height:m}}function OVt(i,e){const{y:n,height:r}=e;return n<r/2?"top":n>i.height-r/2?"bottom":"center"}function FVt(i,e,n,r){const{x:s,width:o}=r,a=n.caretSize+n.caretPadding;if(i==="left"&&s+o+a>e.width||i==="right"&&s-o-a<0)return!0}function BVt(i,e,n,r){const{x:s,width:o}=n,{width:a,chartArea:{left:l,right:c}}=i;let u="center";return r==="center"?u=s<=(l+c)/2?"left":"right":s<=o/2?u="left":s>=a-o/2&&(u="right"),FVt(u,i,e,n)&&(u="center"),u}function eSe(i,e,n){const r=n.yAlign||e.yAlign||OVt(i,n);return{xAlign:n.xAlign||e.xAlign||BVt(i,e,n,r),yAlign:r}}function jVt(i,e){let{x:n,width:r}=i;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function WVt(i,e,n){let{y:r,height:s}=i;return e==="top"?r+=n:e==="bottom"?r-=s+n:r-=s/2,r}function tSe(i,e,n,r){const{caretSize:s,caretPadding:o,cornerRadius:a}=i,{xAlign:l,yAlign:c}=n,u=s+o,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:p}=KS(a);let g=jVt(e,l);const m=WVt(e,c,u);return c==="center"?l==="left"?g+=u:l==="right"&&(g-=u):l==="left"?g-=Math.max(d,f)+s:l==="right"&&(g+=Math.max(h,p)+s),{x:fl(g,0,r.width-e.width),y:fl(m,0,r.height-e.height)}}function MB(i,e,n){const r=Lc(n.padding);return e==="center"?i.x+i.width/2:e==="right"?i.x+i.width-r.right:i.x+r.left}function nSe(i){return qg([],S0(i))}function $Vt(i,e,n){return sw(i,{tooltip:e,tooltipItems:n,type:"tooltip"})}function iSe(i,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?i.override(n):i}const IFe={beforeTitle:f0,title(i){if(i.length>0){const e=i[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:f0,beforeBody:f0,beforeLabel:f0,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let e=i.dataset.label||"";e&&(e+=": ");const n=i.formattedValue;return rr(n)||(e+=n),e},labelColor(i){const n=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const n=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:f0,afterBody:f0,beforeFooter:f0,footer:f0,afterFooter:f0};function Ou(i,e,n,r){const s=i[e].call(n,r);return typeof s>"u"?IFe[e].call(n,r):s}class qie extends Gv{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new lFe(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=$Vt(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,s=Ou(r,"beforeTitle",this,e),o=Ou(r,"title",this,e),a=Ou(r,"afterTitle",this,e);let l=[];return l=qg(l,S0(s)),l=qg(l,S0(o)),l=qg(l,S0(a)),l}getBeforeBody(e,n){return nSe(Ou(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,s=[];return ss(e,o=>{const a={before:[],lines:[],after:[]},l=iSe(r,o);qg(a.before,S0(Ou(l,"beforeLabel",this,o))),qg(a.lines,Ou(l,"label",this,o)),qg(a.after,S0(Ou(l,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(e,n){return nSe(Ou(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,s=Ou(r,"beforeFooter",this,e),o=Ou(r,"footer",this,e),a=Ou(r,"afterFooter",this,e);let l=[];return l=qg(l,S0(s)),l=qg(l,S0(o)),l=qg(l,S0(a)),l}_createItems(e){const n=this._active,r=this.chart.data,s=[],o=[],a=[];let l=[],c,u;for(c=0,u=n.length;c<u;++c)l.push(PVt(this.chart,n[c]));return e.filter&&(l=l.filter((d,h,f)=>e.filter(d,h,f,r))),e.itemSort&&(l=l.sort((d,h)=>e.itemSort(d,h,r))),ss(l,d=>{const h=iSe(e.callbacks,d);s.push(Ou(h,"labelColor",this,d)),o.push(Ou(h,"labelPointStyle",this,d)),a.push(Ou(h,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(e,n){const r=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const l=PN[r.position].call(this,s,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const c=this._size=JCe(this,r),u=Object.assign({},l,c),d=eSe(this.chart,r,u),h=tSe(r,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,s){const o=this.getCaretPosition(e,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(e,n,r){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:l}=r,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:h}=KS(l),{x:f,y:p}=e,{width:g,height:m}=n;let _,b,y,x,k,D;return o==="center"?(k=p+m/2,s==="left"?(_=f,b=_-a,x=k+a,D=k-a):(_=f+g,b=_+a,x=k-a,D=k+a),y=_):(s==="left"?b=f+Math.max(c,d)+a:s==="right"?b=f+g-Math.max(u,h)-a:b=this.caretX,o==="top"?(x=p,k=x-a,_=b-a,y=b+a):(x=p+m,k=x+a,_=b+a,y=b-a),D=x),{x1:_,x2:b,x3:y,y1:x,y2:k,y3:D}}drawTitle(e,n,r){const s=this.title,o=s.length;let a,l,c;if(o){const u=dE(r.rtl,this.x,this.width);for(e.x=MB(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",a=qa(r.titleFont),l=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,c=0;c<o;++c)n.fillText(s[c],u.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,c+1===o&&(e.y+=r.titleMarginBottom-l)}}_drawColorBox(e,n,r,s,o){const a=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:u}=o,d=qa(o.bodyFont),h=MB(this,"left",o),f=s.x(h),p=c<d.lineHeight?(d.lineHeight-c)/2:0,g=n.y+p;if(o.usePointStyle){const m={radius:Math.min(u,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},_=s.leftForLtr(f,u)+u/2,b=g+c/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,jie(e,m,_,b),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,jie(e,m,_,b)}else{e.lineWidth=cr(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const m=s.leftForLtr(f,u),_=s.leftForLtr(s.xPlus(f,1),u-2),b=KS(a.borderRadius);Object.values(b).some(y=>y!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,zO(e,{x:m,y:g,w:u,h:c,radius:b}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),zO(e,{x:_,y:g+1,w:u-2,h:c-2,radius:b}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(m,g,u,c),e.strokeRect(m,g,u,c),e.fillStyle=a.backgroundColor,e.fillRect(_,g+1,u-2,c-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:u,boxPadding:d}=r,h=qa(r.bodyFont);let f=h.lineHeight,p=0;const g=dE(r.rtl,this.x,this.width),m=function(A){n.fillText(A,g.x(e.x+p),e.y+f/2),e.y+=f+o},_=g.textAlign(a);let b,y,x,k,D,R,E;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,e.x=MB(this,_,r),n.fillStyle=r.bodyColor,ss(this.beforeBody,m),p=l&&_!=="right"?a==="center"?u/2+d:u+2+d:0,k=0,R=s.length;k<R;++k){for(b=s[k],y=this.labelTextColors[k],n.fillStyle=y,ss(b.before,m),x=b.lines,l&&x.length&&(this._drawColorBox(n,e,k,g,r),f=Math.max(h.lineHeight,c)),D=0,E=x.length;D<E;++D)m(x[D]),f=h.lineHeight;ss(b.after,m)}p=0,f=h.lineHeight,ss(this.afterBody,m),e.y-=o}drawFooter(e,n,r){const s=this.footer,o=s.length;let a,l;if(o){const c=dE(r.rtl,this.x,this.width);for(e.x=MB(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",a=qa(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,l=0;l<o;++l)n.fillText(s[l],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+r.footerSpacing}}drawBackground(e,n,r,s){const{xAlign:o,yAlign:a}=this,{x:l,y:c}=e,{width:u,height:d}=r,{topLeft:h,topRight:f,bottomLeft:p,bottomRight:g}=KS(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(l+h,c),a==="top"&&this.drawCaret(e,n,r,s),n.lineTo(l+u-f,c),n.quadraticCurveTo(l+u,c,l+u,c+f),a==="center"&&o==="right"&&this.drawCaret(e,n,r,s),n.lineTo(l+u,c+d-g),n.quadraticCurveTo(l+u,c+d,l+u-g,c+d),a==="bottom"&&this.drawCaret(e,n,r,s),n.lineTo(l+p,c+d),n.quadraticCurveTo(l,c+d,l,c+d-p),a==="center"&&o==="left"&&this.drawCaret(e,n,r,s),n.lineTo(l,c+h),n.quadraticCurveTo(l,c,l+h,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){const a=PN[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=JCe(this,e),c=Object.assign({},a,this._size),u=eSe(n,e,c),d=tSe(e,c,u,n);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=Lc(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=r,this.drawBackground(o,e,s,n),nFe(e,n.textDirection),o.y+=a.top,this.drawTitle(o,e,n),this.drawBody(o,e,n),this.drawFooter(o,e,n),iFe(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,s=e.map(({datasetIndex:l,index:c})=>{const u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[c],index:c}}),o=!Fj(r,s),a=this._positionChanged(s,n);(o||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(e,o,n,r),l=this._positionChanged(a,e),c=n||!Fj(a,o)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,r,s){const o=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(e,n){const{caretX:r,caretY:s,options:o}=this,a=PN[o.position].call(this,e,n);return a!==!1&&(r!==a.x||s!==a.y)}}xt(qie,"positioners",PN);var zVt={id:"tooltip",_element:qie,positioners:PN,afterInit(i,e,n){n&&(i.tooltip=new qie({chart:i,options:n}))},beforeUpdate(i,e,n){i.tooltip&&i.tooltip.initialize(n)},reset(i,e,n){i.tooltip&&i.tooltip.initialize(n)},afterDraw(i){const e=i.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(i.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",n)}},afterEvent(i,e){if(i.tooltip){const n=e.replay;i.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,e)=>e.bodyFont.size,boxWidth:(i,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:IFe},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},VVt=Object.freeze({__proto__:null,Colors:tVt,Decimation:sVt,Filler:kVt,Legend:RVt,SubTitle:MVt,Title:NVt,Tooltip:zVt});const HVt=(i,e,n,r)=>(typeof e=="string"?(n=i.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function UVt(i,e,n,r){const s=i.indexOf(e);if(s===-1)return HVt(i,e,n,r);const o=i.lastIndexOf(e);return s!==o?n:s}const qVt=(i,e)=>i===null?null:fl(Math.round(i),0,e);function rSe(i){const e=this.getLabels();return i>=0&&i<e.length?e[i]:i}class Kie extends mk{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(rr(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:UVt(r,e,Li(n,e),this._addedLabels),qVt(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,s=[];let o=this.getLabels();o=e===0&&n===o.length-1?o:o.slice(e,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=e;a<=n;a++)s.push({value:a});return s}getLabelForValue(e){return rSe.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}xt(Kie,"id","category"),xt(Kie,"defaults",{ticks:{callback:rSe}});function KVt(i,e){const n=[],{bounds:s,step:o,min:a,max:l,precision:c,count:u,maxTicks:d,maxDigits:h,includeBounds:f}=i,p=o||1,g=d-1,{min:m,max:_}=e,b=!rr(a),y=!rr(l),x=!rr(u),k=(_-m)/(h+1);let D=Jwe((_-m)/g/p)*p,R,E,A,M;if(D<1e-14&&!b&&!y)return[{value:m},{value:_}];M=Math.ceil(_/D)-Math.floor(m/D),M>g&&(D=Jwe(M*D/g/p)*p),rr(c)||(R=Math.pow(10,c),D=Math.ceil(D*R)/R),s==="ticks"?(E=Math.floor(m/D)*D,A=Math.ceil(_/D)*D):(E=m,A=_),b&&y&&o&&jjt((l-a)/o,D/1e3)?(M=Math.round(Math.min((l-a)/D,d)),D=(l-a)/M,E=a,A=l):x?(E=b?a:E,A=y?l:A,M=u-1,D=(A-E)/M):(M=(A-E)/D,FM(M,Math.round(M),D/1e3)?M=Math.round(M):M=Math.ceil(M));const N=Math.max(eCe(D),eCe(E));R=Math.pow(10,rr(c)?N:c),E=Math.round(E*R)/R,A=Math.round(A*R)/R;let P=0;for(b&&(f&&E!==a?(n.push({value:a}),E<a&&P++,FM(Math.round((E+P*D)*R)/R,a,sSe(a,k,i))&&P++):E<a&&P++);P<M;++P){const O=Math.round((E+P*D)*R)/R;if(y&&O>l)break;n.push({value:O})}return y&&f&&A!==l?n.length&&FM(n[n.length-1].value,l,sSe(l,k,i))?n[n.length-1].value=l:n.push({value:l}):(!y||A===l)&&n.push({value:A}),n}function sSe(i,e,{horizontal:n,minRotation:r}){const s=Op(r),o=(n?Math.sin(s):Math.cos(s))||.001,a=.75*e*(""+i).length;return Math.min(e/o,a)}class Hj extends mk{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return rr(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:o}=this;const a=c=>s=n?s:c,l=c=>o=r?o:c;if(e){const c=jm(s),u=jm(o);c<0&&u<0?l(0):c>0&&u>0&&a(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);l(o+c),e||a(s-c)}this.min=s,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=KVt(s,o);return e.bounds==="ticks"&&j4e(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const s=(r-n)/Math.max(e.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return O4(e,this.chart.options.locale,this.options.ticks.format)}}class Gie extends Hj{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=zo(e)?e:0,this.max=zo(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=Op(this.options.ticks.minRotation),s=(e?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}xt(Gie,"id","linear"),xt(Gie,"defaults",{ticks:{callback:BV.formatters.numeric}});const HO=i=>Math.floor(Ry(i)),kC=(i,e)=>Math.pow(10,HO(i)+e);function oSe(i){return i/Math.pow(10,HO(i))===1}function aSe(i,e,n){const r=Math.pow(10,n),s=Math.floor(i/r);return Math.ceil(e/r)-s}function GVt(i,e){const n=e-i;let r=HO(n);for(;aSe(i,e,r)>10;)r++;for(;aSe(i,e,r)<10;)r--;return Math.min(r,HO(i))}function XVt(i,{min:e,max:n}){e=Vd(i.min,e);const r=[],s=HO(e);let o=GVt(e,n),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),c=s>o?Math.pow(10,s):0,u=Math.round((e-c)*a)/a,d=Math.floor((e-c)/l/10)*l*10;let h=Math.floor((u-d)/Math.pow(10,o)),f=Vd(i.min,Math.round((c+d+h*Math.pow(10,o))*a)/a);for(;f<n;)r.push({value:f,major:oSe(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),f=Math.round((c+d+h*Math.pow(10,o))*a)/a;const p=Vd(i.max,f);return r.push({value:p,major:oSe(p),significand:h}),r}class Xie extends mk{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const r=Hj.prototype.parse.apply(this,[e,n]);if(r===0){this._zero=!0;return}return zo(r)&&r>0?r:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=zo(e)?Math.max(0,e):null,this.max=zo(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!zo(this._userMin)&&(this.min=e===kC(this.min,0)?kC(this.min,-1):kC(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let r=this.min,s=this.max;const o=l=>r=e?r:l,a=l=>s=n?s:l;r===s&&(r<=0?(o(1),a(10)):(o(kC(r,-1)),a(kC(s,1)))),r<=0&&o(kC(s,-1)),s<=0&&a(kC(r,1)),this.min=r,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},r=XVt(n,this);return e.bounds==="ticks"&&j4e(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(e){return e===void 0?"0":O4(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Ry(e),this._valueRange=Ry(this.max)-Ry(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ry(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}xt(Xie,"id","logarithmic"),xt(Xie,"defaults",{ticks:{callback:BV.formatters.logarithmic,major:{enabled:!0}}});function Yie(i){const e=i.ticks;if(e.display&&i.display){const n=Lc(e.backdropPadding);return Li(e.font&&e.font.size,po.font.size)+n.height}return 0}function YVt(i,e,n){return n=fo(n)?n:[n],{w:nWt(i,e.string,n),h:n.length*e.lineHeight}}function lSe(i,e,n,r,s){return i===r||i===s?{start:e-n/2,end:e+n/2}:i<r||i>s?{start:e-n,end:e}:{start:e,end:e+n}}function ZVt(i){const e={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},n=Object.assign({},e),r=[],s=[],o=i._pointLabels.length,a=i.options.pointLabels,l=a.centerPointLabels?Or/o:0;for(let c=0;c<o;c++){const u=a.setContext(i.getPointLabelContext(c));s[c]=u.padding;const d=i.getPointPosition(c,i.drawingArea+s[c],l),h=qa(u.font),f=YVt(i.ctx,h,i._pointLabels[c]);r[c]=f;const p=pc(i.getIndexAngle(c)+l),g=Math.round(Mce(p)),m=lSe(g,d.x,f.w,0,180),_=lSe(g,d.y,f.h,90,270);QVt(n,e,p,m,_)}i.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),i._pointLabelItems=tHt(i,r,s)}function QVt(i,e,n,r,s){const o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,c=0;r.start<e.l?(l=(e.l-r.start)/o,i.l=Math.min(i.l,e.l-l)):r.end>e.r&&(l=(r.end-e.r)/o,i.r=Math.max(i.r,e.r+l)),s.start<e.t?(c=(e.t-s.start)/a,i.t=Math.min(i.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/a,i.b=Math.max(i.b,e.b+c))}function JVt(i,e,n){const r=i.drawingArea,{extra:s,additionalAngle:o,padding:a,size:l}=n,c=i.getPointPosition(e,r+s+a,o),u=Math.round(Mce(pc(c.angle+aa))),d=rHt(c.y,l.h,u),h=nHt(u),f=iHt(c.x,l.w,h);return{visible:!0,x:c.x,y:d,textAlign:h,left:f,top:d,right:f+l.w,bottom:d+l.h}}function eHt(i,e){if(!e)return!0;const{left:n,top:r,right:s,bottom:o}=i;return!(lv({x:n,y:r},e)||lv({x:n,y:o},e)||lv({x:s,y:r},e)||lv({x:s,y:o},e))}function tHt(i,e,n){const r=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:l}=o.pointLabels,c={extra:Yie(o)/2,additionalAngle:a?Or/s:0};let u;for(let d=0;d<s;d++){c.padding=n[d],c.size=e[d];const h=JVt(i,d,c);r.push(h),l==="auto"&&(h.visible=eHt(h,u),h.visible&&(u=h))}return r}function nHt(i){return i===0||i===180?"center":i<180?"left":"right"}function iHt(i,e,n){return n==="right"?i-=e:n==="center"&&(i-=e/2),i}function rHt(i,e,n){return n===90||n===270?i-=e/2:(n>270||n<90)&&(i-=e),i}function sHt(i,e,n){const{left:r,top:s,right:o,bottom:a}=n,{backdropColor:l}=e;if(!rr(l)){const c=KS(e.borderRadius),u=Lc(e.backdropPadding);i.fillStyle=l;const d=r-u.left,h=s-u.top,f=o-r+u.width,p=a-s+u.height;Object.values(c).some(g=>g!==0)?(i.beginPath(),zO(i,{x:d,y:h,w:f,h:p,radius:c}),i.fill()):i.fillRect(d,h,f,p)}}function oHt(i,e){const{ctx:n,options:{pointLabels:r}}=i;for(let s=e-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const a=r.setContext(i.getPointLabelContext(s));sHt(n,a,o);const l=qa(a.font),{x:c,y:u,textAlign:d}=o;$x(n,i._pointLabels[s],c,u+l.lineHeight/2,l,{color:a.color,textAlign:d,textBaseline:"middle"})}}function TFe(i,e,n,r){const{ctx:s}=i;if(n)s.arc(i.xCenter,i.yCenter,e,0,io);else{let o=i.getPointPosition(0,e);s.moveTo(o.x,o.y);for(let a=1;a<r;a++)o=i.getPointPosition(a,e),s.lineTo(o.x,o.y)}}function aHt(i,e,n,r,s){const o=i.ctx,a=e.circular,{color:l,lineWidth:c}=e;!a&&!r||!l||!c||n<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),TFe(i,n,a,r),o.closePath(),o.stroke(),o.restore())}function lHt(i,e,n){return sw(i,{label:n,index:e,type:"pointLabel"})}class ON extends Hj{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Lc(Yie(this.options)/2),n=this.width=this.maxWidth-e.width,r=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+r/2+e.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=zo(e)&&!isNaN(e)?e:0,this.max=zo(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Yie(this.options))}generateTickLabels(e){Hj.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,r)=>{const s=$s(this.options.pointLabels.callback,[n,r],this);return s||s===0?s:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const e=this.options;e.display&&e.pointLabels.display?ZVt(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,r,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((r-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,r,s))}getIndexAngle(e){const n=io/(this._pointLabels.length||1),r=this.options.startAngle||0;return pc(e*n+Op(r))}getDistanceFromCenterForValue(e){if(rr(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(rr(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const r=n[e];return lHt(this.getContext(),e,r)}}getPointPosition(e,n,r=0){const s=this.getIndexAngle(e)-aa+r;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:r,right:s,bottom:o}=this._pointLabelItems[e];return{left:n,top:r,right:s,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const r=this.ctx;r.save(),r.beginPath(),TFe(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:r,grid:s,border:o}=n,a=this._pointLabels.length;let l,c,u;if(n.pointLabels.display&&oHt(this,a),s.display&&this.ticks.forEach((d,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(d.value);const f=this.getContext(h),p=s.setContext(f),g=o.setContext(f);aHt(this,p,c,a,g)}}),r.display){for(e.save(),l=a-1;l>=0;l--){const d=r.setContext(this.getPointLabelContext(l)),{color:h,lineWidth:f}=d;!f||!h||(e.lineWidth=f,e.strokeStyle=h,e.setLineDash(d.borderDash),e.lineDashOffset=d.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),u=this.getPointPosition(l,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(u.x,u.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const s=this.getIndexAngle(0);let o,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const u=r.setContext(this.getContext(c)),d=qa(u.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),u.showLabelBackdrop){e.font=d.string,a=e.measureText(l.label).width,e.fillStyle=u.backdropColor;const h=Lc(u.backdropPadding);e.fillRect(-a/2-h.left,-o-d.size/2-h.top,a+h.width,d.size+h.height)}$x(e,l.label,0,-o,d,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),e.restore()}drawTitle(){}}xt(ON,"id","radialLinear"),xt(ON,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:BV.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),xt(ON,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),xt(ON,"descriptors",{angleLines:{_fallback:"grid"}});const HV={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Xu=Object.keys(HV);function cSe(i,e){return i-e}function uSe(i,e){if(rr(e))return null;const n=i._adapter,{parser:r,round:s,isoWeekday:o}=i._parseOpts;let a=e;return typeof r=="function"&&(a=r(a)),zo(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(CI(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,s)),+a)}function dSe(i,e,n,r){const s=Xu.length;for(let o=Xu.indexOf(i);o<s-1;++o){const a=HV[Xu[o]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-e)/(l*a.size))<=r)return Xu[o]}return Xu[s-1]}function cHt(i,e,n,r,s){for(let o=Xu.length-1;o>=Xu.indexOf(n);o--){const a=Xu[o];if(HV[a].common&&i._adapter.diff(s,r,a)>=e-1)return a}return Xu[n?Xu.indexOf(n):0]}function uHt(i){for(let e=Xu.indexOf(i)+1,n=Xu.length;e<n;++e)if(HV[Xu[e]].common)return Xu[e]}function hSe(i,e,n){if(!n)i[e]=!0;else if(n.length){const{lo:r,hi:s}=Pce(n,e),o=n[r]>=e?n[r]:n[s];i[o]=!0}}function dHt(i,e,n,r){const s=i._adapter,o=+s.startOf(e[0].value,r),a=e[e.length-1].value;let l,c;for(l=o;l<=a;l=+s.add(l,1,r))c=n[l],c>=0&&(e[c].major=!0);return e}function fSe(i,e,n){const r=[],s={},o=e.length;let a,l;for(a=0;a<o;++a)l=e[a],s[l]=a,r.push({value:l,major:!1});return o===0||!n?r:dHt(i,r,s,n)}class UO extends mk{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const r=e.time||(e.time={}),s=this._adapter=new b$t._date(e.adapters.date);s.init(n),OM(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:uSe(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(u){!a&&!isNaN(u.min)&&(s=Math.min(s,u.min)),!l&&!isNaN(u.max)&&(o=Math.max(o,u.max))}(!a||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=zo(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=zo(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,l=Vjt(s,o,a);return this._unit=n.unit||(r.autoSkip?dSe(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):cHt(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:uHt(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),fSe(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,s,o;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?r=o:r=(o-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;n=fl(n,0,a),r=fl(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,a=o.unit||dSe(o.minUnit,n,r,this._getLabelCapacity(n)),l=Li(s.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,u=CI(c)||c===!0,d={};let h=n,f,p;if(u&&(h=+e.startOf(h,"isoWeek",c)),h=+e.startOf(h,u?"day":a),e.diff(r,n,a)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,p=0;f<r;f=+e.add(f,l,a),p++)hSe(d,f,g);return(f===r||s.bounds==="ticks"||p===1)&&hSe(d,f,g),Object.keys(d).sort(cSe).map(m=>+m)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,o=this._unit,a=n||s[o];return this._adapter.format(e,a)}_tickFormatFunction(e,n,r,s){const o=this.options,a=o.ticks.callback;if(a)return $s(a,[e,n,r],this);const l=o.time.displayFormats,c=this._unit,u=this._majorUnit,d=c&&l[c],h=u&&l[u],f=r[n],p=u&&h&&f&&f.major;return this._adapter.format(e,s||(p?h:d))}generateTickLabels(e){let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,s=Op(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:r*o+l*a,h:r*a+l*o}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(e,0,fSe(this,[e],this._majorUnit),s),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)e.push(uSe(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return z4e(e.sort(cSe))}}xt(UO,"id","time"),xt(UO,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function PB(i,e,n){let r=0,s=i.length-1,o,a,l,c;n?(e>=i[r].pos&&e<=i[s].pos&&({lo:r,hi:s}=av(i,"pos",e)),{pos:o,time:l}=i[r],{pos:a,time:c}=i[s]):(e>=i[r].time&&e<=i[s].time&&({lo:r,hi:s}=av(i,"time",e)),{time:o,pos:l}=i[r],{time:a,pos:c}=i[s]);const u=a-o;return u?l+(c-l)*(e-o)/u:l}class Zie extends UO{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=PB(n,this.min),this._tableRange=PB(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,s=[],o=[];let a,l,c,u,d;for(a=0,l=e.length;a<l;++a)u=e[a],u>=n&&u<=r&&s.push(u);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,l=s.length;a<l;++a)d=s[a+1],c=s[a-1],u=s[a],Math.round((d+c)/2)!==u&&o.push({time:u,pos:a/(l-1)});return o}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,o)=>s-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(PB(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return PB(this._table,r*this._tableRange+this._minPos,!0)}}xt(Zie,"id","timeseries"),xt(Zie,"defaults",UO.defaults);var hHt=Object.freeze({__proto__:null,CategoryScale:Kie,LinearScale:Gie,LogarithmicScale:Xie,RadialLinearScale:ON,TimeScale:UO,TimeSeriesScale:Zie});const fHt=[v$t,Gzt,VVt,hHt];F0.register(...fHt);var IY,pSe;function pHt(){if(pSe)return IY;pSe=1;var i=lT(),e=_V(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(o,a){if(i(o))return!1;var l=typeof o;return l=="number"||l=="symbol"||l=="boolean"||o==null||e(o)?!0:r.test(o)||!n.test(o)||a!=null&&o in Object(a)}return IY=s,IY}var TY,gSe;function gHt(){if(gSe)return TY;gSe=1;var i=Sce(),e="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(e);var o=function(){var a=arguments,l=s?s.apply(this,a):a[0],c=o.cache;if(c.has(l))return c.get(l);var u=r.apply(this,a);return o.cache=c.set(l,u)||c,u};return o.cache=new(n.Cache||i),o}return n.Cache=i,TY=n,TY}var RY,mSe;function mHt(){if(mSe)return RY;mSe=1;var i=gHt(),e=500;function n(r){var s=i(r,function(a){return o.size===e&&o.clear(),a}),o=s.cache;return s}return RY=n,RY}var AY,_Se;function _Ht(){if(_Se)return AY;_Se=1;var i=mHt(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=i(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(e,function(a,l,c,u){o.push(c?u.replace(n,"$1"):l||a)}),o});return AY=r,AY}var NY,vSe;function vHt(){if(vSe)return NY;vSe=1;function i(e,n){for(var r=-1,s=e==null?0:e.length,o=Array(s);++r<s;)o[r]=n(e[r],r,e);return o}return NY=i,NY}var MY,bSe;function bHt(){if(bSe)return MY;bSe=1;var i=mV(),e=vHt(),n=lT(),r=_V(),s=i?i.prototype:void 0,o=s?s.toString:void 0;function a(l){if(typeof l=="string")return l;if(n(l))return e(l,a)+"";if(r(l))return o?o.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return MY=a,MY}var PY,ySe;function yHt(){if(ySe)return PY;ySe=1;var i=bHt();function e(n){return n==null?"":i(n)}return PY=e,PY}var OY,wSe;function wHt(){if(wSe)return OY;wSe=1;var i=lT(),e=pHt(),n=_Ht(),r=yHt();function s(o,a){return i(o)?o:e(o,a)?[o]:n(r(o))}return OY=s,OY}var FY,CSe;function CHt(){if(CSe)return FY;CSe=1;var i=_V();function e(n){if(typeof n=="string"||i(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return FY=e,FY}var BY,SSe;function SHt(){if(SSe)return BY;SSe=1;var i=wHt(),e=CHt();function n(r,s){s=i(s,r);for(var o=0,a=s.length;r!=null&&o<a;)r=r[e(s[o++])];return o&&o==a?r:void 0}return BY=n,BY}var jY,xSe;function xHt(){if(xSe)return jY;xSe=1;var i=SHt();function e(n,r,s){var o=n==null?void 0:i(n,r);return o===void 0?s:o}return jY=e,jY}var kHt=xHt();const LHt=ql(kHt),hE=(i,e=0,n=1)=>Kce(Gce(e,i),n),qce=i=>{i._clipped=!1,i._unclipped=i.slice(0);for(let e=0;e<=3;e++)e<3?((i[e]<0||i[e]>255)&&(i._clipped=!0),i[e]=hE(i[e],0,255)):e===3&&(i[e]=hE(i[e],0,1));return i},RFe={};for(let i of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])RFe[`[object ${i}]`]=i.toLowerCase();function Qi(i){return RFe[Object.prototype.toString.call(i)]||"object"}const er=(i,e=null)=>i.length>=3?Array.prototype.slice.call(i):Qi(i[0])=="object"&&e?e.split("").filter(n=>i[0][n]!==void 0).map(n=>i[0][n]):i[0],UV=i=>{if(i.length<2)return null;const e=i.length-1;return Qi(i[e])=="string"?i[e].toLowerCase():null},{PI:qV,min:Kce,max:Gce}=Math,B0=qV*2,WY=qV/3,DHt=qV/180,EHt=180/qV,Ai={format:{},autodetect:[]};let qt=class{constructor(...e){const n=this;if(Qi(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let r=UV(e),s=!1;if(!r){s=!0,Ai.sorted||(Ai.autodetect=Ai.autodetect.sort((o,a)=>a.p-o.p),Ai.sorted=!0);for(let o of Ai.autodetect)if(r=o.test(...e),r)break}if(Ai.format[r]){const o=Ai.format[r].apply(null,s?e:e.slice(0,-1));n._rgb=qce(o)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return Qi(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const IHt="2.6.0",Wi=(...i)=>new Wi.Color(...i);Wi.Color=qt;Wi.version=IHt;const THt=(...i)=>{i=er(i,"cmyk");const[e,n,r,s]=i,o=i.length>4?i[4]:1;return s===1?[0,0,0,o]:[e>=1?0:255*(1-e)*(1-s),n>=1?0:255*(1-n)*(1-s),r>=1?0:255*(1-r)*(1-s),o]},{max:kSe}=Math,RHt=(...i)=>{let[e,n,r]=er(i,"rgb");e=e/255,n=n/255,r=r/255;const s=1-kSe(e,kSe(n,r)),o=s<1?1/(1-s):0,a=(1-e-s)*o,l=(1-n-s)*o,c=(1-r-s)*o;return[a,l,c,s]};qt.prototype.cmyk=function(){return RHt(this._rgb)};Wi.cmyk=(...i)=>new qt(...i,"cmyk");Ai.format.cmyk=THt;Ai.autodetect.push({p:2,test:(...i)=>{if(i=er(i,"cmyk"),Qi(i)==="array"&&i.length===4)return"cmyk"}});const $Y=i=>Math.round(i*100)/100,AHt=(...i)=>{const e=er(i,"hsla");let n=UV(i)||"lsa";return e[0]=$Y(e[0]||0),e[1]=$Y(e[1]*100)+"%",e[2]=$Y(e[2]*100)+"%",n==="hsla"||e.length>3&&e[3]<1?(e[3]=e.length>3?e[3]:1,n="hsla"):e.length=3,`${n}(${e.join(",")})`},AFe=(...i)=>{i=er(i,"rgba");let[e,n,r]=i;e/=255,n/=255,r/=255;const s=Kce(e,n,r),o=Gce(e,n,r),a=(o+s)/2;let l,c;return o===s?(l=0,c=Number.NaN):l=a<.5?(o-s)/(o+s):(o-s)/(2-o-s),e==o?c=(n-r)/(o-s):n==o?c=2+(r-e)/(o-s):r==o&&(c=4+(e-n)/(o-s)),c*=60,c<0&&(c+=360),i.length>3&&i[3]!==void 0?[c,l,a,i[3]]:[c,l,a]},{round:zY}=Math,NHt=(...i)=>{const e=er(i,"rgba");let n=UV(i)||"rgb";return n.substr(0,3)=="hsl"?AHt(AFe(e),n):(e[0]=zY(e[0]),e[1]=zY(e[1]),e[2]=zY(e[2]),(n==="rgba"||e.length>3&&e[3]<1)&&(e[3]=e.length>3?e[3]:1,n="rgba"),`${n}(${e.slice(0,n==="rgb"?3:4).join(",")})`)},{round:VY}=Math,Qie=(...i)=>{i=er(i,"hsl");const[e,n,r]=i;let s,o,a;if(n===0)s=o=a=r*255;else{const l=[0,0,0],c=[0,0,0],u=r<.5?r*(1+n):r+n-r*n,d=2*r-u,h=e/360;l[0]=h+1/3,l[1]=h,l[2]=h-1/3;for(let f=0;f<3;f++)l[f]<0&&(l[f]+=1),l[f]>1&&(l[f]-=1),6*l[f]<1?c[f]=d+(u-d)*6*l[f]:2*l[f]<1?c[f]=u:3*l[f]<2?c[f]=d+(u-d)*(2/3-l[f])*6:c[f]=d;[s,o,a]=[VY(c[0]*255),VY(c[1]*255),VY(c[2]*255)]}return i.length>3?[s,o,a,i[3]]:[s,o,a,1]},NFe=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,MFe=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,PFe=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,OFe=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,FFe=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,BFe=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,{round:LSe}=Math,Xce=i=>{i=i.toLowerCase().trim();let e;if(Ai.format.named)try{return Ai.format.named(i)}catch{}if(e=i.match(NFe)){const n=e.slice(1,4);for(let r=0;r<3;r++)n[r]=+n[r];return n[3]=1,n}if(e=i.match(MFe)){const n=e.slice(1,5);for(let r=0;r<4;r++)n[r]=+n[r];return n}if(e=i.match(PFe)){const n=e.slice(1,4);for(let r=0;r<3;r++)n[r]=LSe(n[r]*2.55);return n[3]=1,n}if(e=i.match(OFe)){const n=e.slice(1,5);for(let r=0;r<3;r++)n[r]=LSe(n[r]*2.55);return n[3]=+n[3],n}if(e=i.match(FFe)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Qie(n);return r[3]=1,r}if(e=i.match(BFe)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Qie(n);return r[3]=+e[4],r}};Xce.test=i=>NFe.test(i)||MFe.test(i)||PFe.test(i)||OFe.test(i)||FFe.test(i)||BFe.test(i);qt.prototype.css=function(i){return NHt(this._rgb,i)};Wi.css=(...i)=>new qt(...i,"css");Ai.format.css=Xce;Ai.autodetect.push({p:5,test:(i,...e)=>{if(!e.length&&Qi(i)==="string"&&Xce.test(i))return"css"}});Ai.format.gl=(...i)=>{const e=er(i,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};Wi.gl=(...i)=>new qt(...i,"gl");qt.prototype.gl=function(){const i=this._rgb;return[i[0]/255,i[1]/255,i[2]/255,i[3]]};const{floor:MHt}=Math,PHt=(...i)=>{i=er(i,"hcg");let[e,n,r]=i,s,o,a;r=r*255;const l=n*255;if(n===0)s=o=a=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const c=MHt(e),u=e-c,d=r*(1-n),h=d+l*(1-u),f=d+l*u,p=d+l;switch(c){case 0:[s,o,a]=[p,f,d];break;case 1:[s,o,a]=[h,p,d];break;case 2:[s,o,a]=[d,p,f];break;case 3:[s,o,a]=[d,h,p];break;case 4:[s,o,a]=[f,d,p];break;case 5:[s,o,a]=[p,d,h];break}}return[s,o,a,i.length>3?i[3]:1]},OHt=(...i)=>{const[e,n,r]=er(i,"rgb"),s=Kce(e,n,r),o=Gce(e,n,r),a=o-s,l=a*100/255,c=s/(255-a)*100;let u;return a===0?u=Number.NaN:(e===o&&(u=(n-r)/a),n===o&&(u=2+(r-e)/a),r===o&&(u=4+(e-n)/a),u*=60,u<0&&(u+=360)),[u,l,c]};qt.prototype.hcg=function(){return OHt(this._rgb)};Wi.hcg=(...i)=>new qt(...i,"hcg");Ai.format.hcg=PHt;Ai.autodetect.push({p:1,test:(...i)=>{if(i=er(i,"hcg"),Qi(i)==="array"&&i.length===3)return"hcg"}});const FHt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,BHt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,jFe=i=>{if(i.match(FHt)){(i.length===4||i.length===7)&&(i=i.substr(1)),i.length===3&&(i=i.split(""),i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]);const e=parseInt(i,16),n=e>>16,r=e>>8&255,s=e&255;return[n,r,s,1]}if(i.match(BHt)){(i.length===5||i.length===9)&&(i=i.substr(1)),i.length===4&&(i=i.split(""),i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]+i[3]+i[3]);const e=parseInt(i,16),n=e>>24&255,r=e>>16&255,s=e>>8&255,o=Math.round((e&255)/255*100)/100;return[n,r,s,o]}throw new Error(`unknown hex color: ${i}`)},{round:OB}=Math,WFe=(...i)=>{let[e,n,r,s]=er(i,"rgba"),o=UV(i)||"auto";s===void 0&&(s=1),o==="auto"&&(o=s<1?"rgba":"rgb"),e=OB(e),n=OB(n),r=OB(r);let l="000000"+(e<<16|n<<8|r).toString(16);l=l.substr(l.length-6);let c="0"+OB(s*255).toString(16);switch(c=c.substr(c.length-2),o.toLowerCase()){case"rgba":return`#${l}${c}`;case"argb":return`#${c}${l}`;default:return`#${l}`}};qt.prototype.hex=function(i){return WFe(this._rgb,i)};Wi.hex=(...i)=>new qt(...i,"hex");Ai.format.hex=jFe;Ai.autodetect.push({p:4,test:(i,...e)=>{if(!e.length&&Qi(i)==="string"&&[3,4,5,6,7,8,9].indexOf(i.length)>=0)return"hex"}});const{cos:RD}=Math,jHt=(...i)=>{i=er(i,"hsi");let[e,n,r]=i,s,o,a;return isNaN(e)&&(e=0),isNaN(n)&&(n=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(a=(1-n)/3,s=(1+n*RD(B0*e)/RD(WY-B0*e))/3,o=1-(a+s)):e<2/3?(e-=1/3,s=(1-n)/3,o=(1+n*RD(B0*e)/RD(WY-B0*e))/3,a=1-(s+o)):(e-=2/3,o=(1-n)/3,a=(1+n*RD(B0*e)/RD(WY-B0*e))/3,s=1-(o+a)),s=hE(r*s*3),o=hE(r*o*3),a=hE(r*a*3),[s*255,o*255,a*255,i.length>3?i[3]:1]},{min:WHt,sqrt:$Ht,acos:zHt}=Math,VHt=(...i)=>{let[e,n,r]=er(i,"rgb");e/=255,n/=255,r/=255;let s;const o=WHt(e,n,r),a=(e+n+r)/3,l=a>0?1-o/a:0;return l===0?s=NaN:(s=(e-n+(e-r))/2,s/=$Ht((e-n)*(e-n)+(e-r)*(n-r)),s=zHt(s),r>n&&(s=B0-s),s/=B0),[s*360,l,a]};qt.prototype.hsi=function(){return VHt(this._rgb)};Wi.hsi=(...i)=>new qt(...i,"hsi");Ai.format.hsi=jHt;Ai.autodetect.push({p:2,test:(...i)=>{if(i=er(i,"hsi"),Qi(i)==="array"&&i.length===3)return"hsi"}});qt.prototype.hsl=function(){return AFe(this._rgb)};Wi.hsl=(...i)=>new qt(...i,"hsl");Ai.format.hsl=Qie;Ai.autodetect.push({p:2,test:(...i)=>{if(i=er(i,"hsl"),Qi(i)==="array"&&i.length===3)return"hsl"}});const{floor:HHt}=Math,UHt=(...i)=>{i=er(i,"hsv");let[e,n,r]=i,s,o,a;if(r*=255,n===0)s=o=a=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const l=HHt(e),c=e-l,u=r*(1-n),d=r*(1-n*c),h=r*(1-n*(1-c));switch(l){case 0:[s,o,a]=[r,h,u];break;case 1:[s,o,a]=[d,r,u];break;case 2:[s,o,a]=[u,r,h];break;case 3:[s,o,a]=[u,d,r];break;case 4:[s,o,a]=[h,u,r];break;case 5:[s,o,a]=[r,u,d];break}}return[s,o,a,i.length>3?i[3]:1]},{min:qHt,max:KHt}=Math,GHt=(...i)=>{i=er(i,"rgb");let[e,n,r]=i;const s=qHt(e,n,r),o=KHt(e,n,r),a=o-s;let l,c,u;return u=o/255,o===0?(l=Number.NaN,c=0):(c=a/o,e===o&&(l=(n-r)/a),n===o&&(l=2+(r-e)/a),r===o&&(l=4+(e-n)/a),l*=60,l<0&&(l+=360)),[l,c,u]};qt.prototype.hsv=function(){return GHt(this._rgb)};Wi.hsv=(...i)=>new qt(...i,"hsv");Ai.format.hsv=UHt;Ai.autodetect.push({p:2,test:(...i)=>{if(i=er(i,"hsv"),Qi(i)==="array"&&i.length===3)return"hsv"}});const ld={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},{pow:XHt}=Math,$Fe=(...i)=>{i=er(i,"lab");const[e,n,r]=i;let s,o,a,l,c,u;return o=(e+16)/116,s=isNaN(n)?o:o+n/500,a=isNaN(r)?o:o-r/200,o=ld.Yn*UY(o),s=ld.Xn*UY(s),a=ld.Zn*UY(a),l=HY(3.2404542*s-1.5371385*o-.4985314*a),c=HY(-.969266*s+1.8760108*o+.041556*a),u=HY(.0556434*s-.2040259*o+1.0572252*a),[l,c,u,i.length>3?i[3]:1]},HY=i=>255*(i<=.00304?12.92*i:1.055*XHt(i,1/2.4)-.055),UY=i=>i>ld.t1?i*i*i:ld.t2*(i-ld.t0),{pow:zFe}=Math,VFe=(...i)=>{const[e,n,r]=er(i,"rgb"),[s,o,a]=YHt(e,n,r),l=116*o-16;return[l<0?0:l,500*(s-o),200*(o-a)]},qY=i=>(i/=255)<=.04045?i/12.92:zFe((i+.055)/1.055,2.4),KY=i=>i>ld.t3?zFe(i,1/3):i/ld.t2+ld.t0,YHt=(i,e,n)=>{i=qY(i),e=qY(e),n=qY(n);const r=KY((.4124564*i+.3575761*e+.1804375*n)/ld.Xn),s=KY((.2126729*i+.7151522*e+.072175*n)/ld.Yn),o=KY((.0193339*i+.119192*e+.9503041*n)/ld.Zn);return[r,s,o]};qt.prototype.lab=function(){return VFe(this._rgb)};Wi.lab=(...i)=>new qt(...i,"lab");Ai.format.lab=$Fe;Ai.autodetect.push({p:2,test:(...i)=>{if(i=er(i,"lab"),Qi(i)==="array"&&i.length===3)return"lab"}});const{sin:ZHt,cos:QHt}=Math,HFe=(...i)=>{let[e,n,r]=er(i,"lch");return isNaN(r)&&(r=0),r=r*DHt,[e,QHt(r)*n,ZHt(r)*n]},UFe=(...i)=>{i=er(i,"lch");const[e,n,r]=i,[s,o,a]=HFe(e,n,r),[l,c,u]=$Fe(s,o,a);return[l,c,u,i.length>3?i[3]:1]},JHt=(...i)=>{const e=er(i,"hcl").reverse();return UFe(...e)},{sqrt:eUt,atan2:tUt,round:nUt}=Math,qFe=(...i)=>{const[e,n,r]=er(i,"lab"),s=eUt(n*n+r*r);let o=(tUt(r,n)*EHt+360)%360;return nUt(s*1e4)===0&&(o=Number.NaN),[e,s,o]},KFe=(...i)=>{const[e,n,r]=er(i,"rgb"),[s,o,a]=VFe(e,n,r);return qFe(s,o,a)};qt.prototype.lch=function(){return KFe(this._rgb)};qt.prototype.hcl=function(){return KFe(this._rgb).reverse()};Wi.lch=(...i)=>new qt(...i,"lch");Wi.hcl=(...i)=>new qt(...i,"hcl");Ai.format.lch=UFe;Ai.format.hcl=JHt;["lch","hcl"].forEach(i=>Ai.autodetect.push({p:2,test:(...e)=>{if(e=er(e,i),Qi(e)==="array"&&e.length===3)return i}}));const kI={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};qt.prototype.name=function(){const i=WFe(this._rgb,"rgb");for(let e of Object.keys(kI))if(kI[e]===i)return e.toLowerCase();return i};Ai.format.named=i=>{if(i=i.toLowerCase(),kI[i])return jFe(kI[i]);throw new Error("unknown color name: "+i)};Ai.autodetect.push({p:5,test:(i,...e)=>{if(!e.length&&Qi(i)==="string"&&kI[i.toLowerCase()])return"named"}});const iUt=i=>{if(Qi(i)=="number"&&i>=0&&i<=16777215){const e=i>>16,n=i>>8&255,r=i&255;return[e,n,r,1]}throw new Error("unknown num color: "+i)},rUt=(...i)=>{const[e,n,r]=er(i,"rgb");return(e<<16)+(n<<8)+r};qt.prototype.num=function(){return rUt(this._rgb)};Wi.num=(...i)=>new qt(...i,"num");Ai.format.num=iUt;Ai.autodetect.push({p:5,test:(...i)=>{if(i.length===1&&Qi(i[0])==="number"&&i[0]>=0&&i[0]<=16777215)return"num"}});const{round:GFe}=Math;qt.prototype.rgb=function(i=!0){return i===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(GFe)};qt.prototype.rgba=function(i=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?i===!1?e:GFe(e):e)};Wi.rgb=(...i)=>new qt(...i,"rgb");Ai.format.rgb=(...i)=>{const e=er(i,"rgba");return e[3]===void 0&&(e[3]=1),e};Ai.autodetect.push({p:3,test:(...i)=>{if(i=er(i,"rgba"),Qi(i)==="array"&&(i.length===3||i.length===4&&Qi(i[3])=="number"&&i[3]>=0&&i[3]<=1))return"rgb"}});const{log:FB}=Math,XFe=i=>{const e=i/100;let n,r,s;return e<66?(n=255,r=e<6?0:-155.25485562709179-.44596950469579133*(r=e-2)+104.49216199393888*FB(r),s=e<20?0:-254.76935184120902+.8274096064007395*(s=e-10)+115.67994401066147*FB(s)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*FB(n),r=325.4494125711974+.07943456536662342*(r=e-50)-28.0852963507957*FB(r),s=255),[n,r,s,1]},{round:sUt}=Math,oUt=(...i)=>{const e=er(i,"rgb"),n=e[0],r=e[2];let s=1e3,o=4e4;const a=.4;let l;for(;o-s>a;){l=(o+s)*.5;const c=XFe(l);c[2]/c[0]>=r/n?o=l:s=l}return sUt(l)};qt.prototype.temp=qt.prototype.kelvin=qt.prototype.temperature=function(){return oUt(this._rgb)};Wi.temp=Wi.kelvin=Wi.temperature=(...i)=>new qt(...i,"temp");Ai.format.temp=Ai.format.kelvin=Ai.format.temperature=XFe;const{pow:J8,sign:aUt}=Math,YFe=(...i)=>{i=er(i,"lab");const[e,n,r]=i,s=J8(e+.3963377774*n+.2158037573*r,3),o=J8(e-.1055613458*n-.0638541728*r,3),a=J8(e-.0894841775*n-1.291485548*r,3);return[255*GY(4.0767416621*s-3.3077115913*o+.2309699292*a),255*GY(-1.2684380046*s+2.6097574011*o-.3413193965*a),255*GY(-.0041960863*s-.7034186147*o+1.707614701*a),i.length>3?i[3]:1]};function GY(i){const e=Math.abs(i);return e>.0031308?(aUt(i)||1)*(1.055*J8(e,1/2.4)-.055):i*12.92}const{cbrt:XY,pow:lUt,sign:cUt}=Math,ZFe=(...i)=>{const[e,n,r]=er(i,"rgb"),[s,o,a]=[YY(e/255),YY(n/255),YY(r/255)],l=XY(.4122214708*s+.5363325363*o+.0514459929*a),c=XY(.2119034982*s+.6806995451*o+.1073969566*a),u=XY(.0883024619*s+.2817188376*o+.6299787005*a);return[.2104542553*l+.793617785*c-.0040720468*u,1.9779984951*l-2.428592205*c+.4505937099*u,.0259040371*l+.7827717662*c-.808675766*u]};function YY(i){const e=Math.abs(i);return e<.04045?i/12.92:(cUt(i)||1)*lUt((e+.055)/1.055,2.4)}qt.prototype.oklab=function(){return ZFe(this._rgb)};Wi.oklab=(...i)=>new qt(...i,"oklab");Ai.format.oklab=YFe;Ai.autodetect.push({p:3,test:(...i)=>{if(i=er(i,"oklab"),Qi(i)==="array"&&i.length===3)return"oklab"}});const uUt=(...i)=>{i=er(i,"lch");const[e,n,r]=i,[s,o,a]=HFe(e,n,r),[l,c,u]=YFe(s,o,a);return[l,c,u,i.length>3?i[3]:1]},dUt=(...i)=>{const[e,n,r]=er(i,"rgb"),[s,o,a]=ZFe(e,n,r);return qFe(s,o,a)};qt.prototype.oklch=function(){return dUt(this._rgb)};Wi.oklch=(...i)=>new qt(...i,"oklch");Ai.format.oklch=uUt;Ai.autodetect.push({p:3,test:(...i)=>{if(i=er(i,"oklch"),Qi(i)==="array"&&i.length===3)return"oklch"}});qt.prototype.alpha=function(i,e=!1){return i!==void 0&&Qi(i)==="number"?e?(this._rgb[3]=i,this):new qt([this._rgb[0],this._rgb[1],this._rgb[2],i],"rgb"):this._rgb[3]};qt.prototype.clipped=function(){return this._rgb._clipped||!1};qt.prototype.darken=function(i=1){const e=this,n=e.lab();return n[0]-=ld.Kn*i,new qt(n,"lab").alpha(e.alpha(),!0)};qt.prototype.brighten=function(i=1){return this.darken(-i)};qt.prototype.darker=qt.prototype.darken;qt.prototype.brighter=qt.prototype.brighten;qt.prototype.get=function(i){const[e,n]=i.split("."),r=this[e]();if(n){const s=e.indexOf(n)-(e.substr(0,2)==="ok"?2:0);if(s>-1)return r[s];throw new Error(`unknown channel ${n} in mode ${e}`)}else return r};const{pow:hUt}=Math,fUt=1e-7,pUt=20;qt.prototype.luminance=function(i,e="rgb"){if(i!==void 0&&Qi(i)==="number"){if(i===0)return new qt([0,0,0,this._rgb[3]],"rgb");if(i===1)return new qt([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=pUt;const s=(a,l)=>{const c=a.interpolate(l,.5,e),u=c.luminance();return Math.abs(i-u)<fUt||!r--?c:u>i?s(a,c):s(c,l)},o=(n>i?s(new qt([0,0,0]),this):s(this,new qt([255,255,255]))).rgb();return new qt([...o,this._rgb[3]])}return gUt(...this._rgb.slice(0,3))};const gUt=(i,e,n)=>(i=ZY(i),e=ZY(e),n=ZY(n),.2126*i+.7152*e+.0722*n),ZY=i=>(i/=255,i<=.03928?i/12.92:hUt((i+.055)/1.055,2.4)),bc={},qO=(i,e,n=.5,...r)=>{let s=r[0]||"lrgb";if(!bc[s]&&!r.length&&(s=Object.keys(bc)[0]),!bc[s])throw new Error(`interpolation mode ${s} is not defined`);return Qi(i)!=="object"&&(i=new qt(i)),Qi(e)!=="object"&&(e=new qt(e)),bc[s](i,e,n).alpha(i.alpha()+n*(e.alpha()-i.alpha()))};qt.prototype.mix=qt.prototype.interpolate=function(i,e=.5,...n){return qO(this,i,e,...n)};qt.prototype.premultiply=function(i=!1){const e=this._rgb,n=e[3];return i?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new qt([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};qt.prototype.saturate=function(i=1){const e=this,n=e.lch();return n[1]+=ld.Kn*i,n[1]<0&&(n[1]=0),new qt(n,"lch").alpha(e.alpha(),!0)};qt.prototype.desaturate=function(i=1){return this.saturate(-i)};qt.prototype.set=function(i,e,n=!1){const[r,s]=i.split("."),o=this[r]();if(s){const a=r.indexOf(s)-(r.substr(0,2)==="ok"?2:0);if(a>-1){if(Qi(e)=="string")switch(e.charAt(0)){case"+":o[a]+=+e;break;case"-":o[a]+=+e;break;case"*":o[a]*=+e.substr(1);break;case"/":o[a]/=+e.substr(1);break;default:o[a]=+e}else if(Qi(e)==="number")o[a]=e;else throw new Error("unsupported value for Color.set");const l=new qt(o,r);return n?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${s} in mode ${r}`)}else return o};qt.prototype.tint=function(i=.5,...e){return qO(this,"white",i,...e)};qt.prototype.shade=function(i=.5,...e){return qO(this,"black",i,...e)};const mUt=(i,e,n)=>{const r=i._rgb,s=e._rgb;return new qt(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"rgb")};bc.rgb=mUt;const{sqrt:QY,pow:AD}=Math,_Ut=(i,e,n)=>{const[r,s,o]=i._rgb,[a,l,c]=e._rgb;return new qt(QY(AD(r,2)*(1-n)+AD(a,2)*n),QY(AD(s,2)*(1-n)+AD(l,2)*n),QY(AD(o,2)*(1-n)+AD(c,2)*n),"rgb")};bc.lrgb=_Ut;const vUt=(i,e,n)=>{const r=i.lab(),s=e.lab();return new qt(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"lab")};bc.lab=vUt;const cT=(i,e,n,r)=>{let s,o;r==="hsl"?(s=i.hsl(),o=e.hsl()):r==="hsv"?(s=i.hsv(),o=e.hsv()):r==="hcg"?(s=i.hcg(),o=e.hcg()):r==="hsi"?(s=i.hsi(),o=e.hsi()):r==="lch"||r==="hcl"?(r="hcl",s=i.hcl(),o=e.hcl()):r==="oklch"&&(s=i.oklch().reverse(),o=e.oklch().reverse());let a,l,c,u,d,h;(r.substr(0,1)==="h"||r==="oklch")&&([a,c,d]=s,[l,u,h]=o);let f,p,g,m;return!isNaN(a)&&!isNaN(l)?(l>a&&l-a>180?m=l-(a+360):l<a&&a-l>180?m=l+360-a:m=l-a,p=a+n*m):isNaN(a)?isNaN(l)?p=Number.NaN:(p=l,(d==1||d==0)&&r!="hsv"&&(f=u)):(p=a,(h==1||h==0)&&r!="hsv"&&(f=c)),f===void 0&&(f=c+n*(u-c)),g=d+n*(h-d),r==="oklch"?new qt([g,f,p],r):new qt([p,f,g],r)},QFe=(i,e,n)=>cT(i,e,n,"lch");bc.lch=QFe;bc.hcl=QFe;const bUt=(i,e,n)=>{const r=i.num(),s=e.num();return new qt(r+n*(s-r),"num")};bc.num=bUt;const yUt=(i,e,n)=>cT(i,e,n,"hcg");bc.hcg=yUt;const wUt=(i,e,n)=>cT(i,e,n,"hsi");bc.hsi=wUt;const CUt=(i,e,n)=>cT(i,e,n,"hsl");bc.hsl=CUt;const SUt=(i,e,n)=>cT(i,e,n,"hsv");bc.hsv=SUt;const xUt=(i,e,n)=>{const r=i.oklab(),s=e.oklab();return new qt(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"oklab")};bc.oklab=xUt;const kUt=(i,e,n)=>cT(i,e,n,"oklch");bc.oklch=kUt;const{pow:JY,sqrt:eZ,PI:tZ,cos:DSe,sin:ESe,atan2:LUt}=Math,DUt=(i,e="lrgb",n=null)=>{const r=i.length;n||(n=Array.from(new Array(r)).map(()=>1));const s=r/n.reduce(function(h,f){return h+f});if(n.forEach((h,f)=>{n[f]*=s}),i=i.map(h=>new qt(h)),e==="lrgb")return EUt(i,n);const o=i.shift(),a=o.get(e),l=[];let c=0,u=0;for(let h=0;h<a.length;h++)if(a[h]=(a[h]||0)*n[0],l.push(isNaN(a[h])?0:n[0]),e.charAt(h)==="h"&&!isNaN(a[h])){const f=a[h]/180*tZ;c+=DSe(f)*n[0],u+=ESe(f)*n[0]}let d=o.alpha()*n[0];i.forEach((h,f)=>{const p=h.get(e);d+=h.alpha()*n[f+1];for(let g=0;g<a.length;g++)if(!isNaN(p[g]))if(l[g]+=n[f+1],e.charAt(g)==="h"){const m=p[g]/180*tZ;c+=DSe(m)*n[f+1],u+=ESe(m)*n[f+1]}else a[g]+=p[g]*n[f+1]});for(let h=0;h<a.length;h++)if(e.charAt(h)==="h"){let f=LUt(u/l[h],c/l[h])/tZ*180;for(;f<0;)f+=360;for(;f>=360;)f-=360;a[h]=f}else a[h]=a[h]/l[h];return d/=r,new qt(a,e).alpha(d>.99999?1:d,!0)},EUt=(i,e)=>{const n=i.length,r=[0,0,0,0];for(let s=0;s<i.length;s++){const o=i[s],a=e[s]/n,l=o._rgb;r[0]+=JY(l[0],2)*a,r[1]+=JY(l[1],2)*a,r[2]+=JY(l[2],2)*a,r[3]+=l[3]*a}return r[0]=eZ(r[0]),r[1]=eZ(r[1]),r[2]=eZ(r[2]),r[3]>.9999999&&(r[3]=1),new qt(qce(r))},{pow:IUt}=Math;function Uj(i){let e="rgb",n=Wi("#ccc"),r=0,s=[0,1],o=[],a=[0,0],l=!1,c=[],u=!1,d=0,h=1,f=!1,p={},g=!0,m=1;const _=function(E){if(E=E||["#fff","#000"],E&&Qi(E)==="string"&&Wi.brewer&&Wi.brewer[E.toLowerCase()]&&(E=Wi.brewer[E.toLowerCase()]),Qi(E)==="array"){E.length===1&&(E=[E[0],E[0]]),E=E.slice(0);for(let A=0;A<E.length;A++)E[A]=Wi(E[A]);o.length=0;for(let A=0;A<E.length;A++)o.push(A/(E.length-1))}return D(),c=E},b=function(E){if(l!=null){const A=l.length-1;let M=0;for(;M<A&&E>=l[M];)M++;return M-1}return 0};let y=E=>E,x=E=>E;const k=function(E,A){let M,N;if(A==null&&(A=!1),isNaN(E)||E===null)return n;A?N=E:l&&l.length>2?N=b(E)/(l.length-2):h!==d?N=(E-d)/(h-d):N=1,N=x(N),A||(N=y(N)),m!==1&&(N=IUt(N,m)),N=a[0]+N*(1-a[0]-a[1]),N=hE(N,0,1);const P=Math.floor(N*1e4);if(g&&p[P])M=p[P];else{if(Qi(c)==="array")for(let O=0;O<o.length;O++){const B=o[O];if(N<=B){M=c[O];break}if(N>=B&&O===o.length-1){M=c[O];break}if(N>B&&N<o[O+1]){N=(N-B)/(o[O+1]-B),M=Wi.interpolate(c[O],c[O+1],N,e);break}}else Qi(c)==="function"&&(M=c(N));g&&(p[P]=M)}return M};var D=()=>p={};_(i);const R=function(E){const A=Wi(k(E));return u&&A[u]?A[u]():A};return R.classes=function(E){if(E!=null){if(Qi(E)==="array")l=E,s=[E[0],E[E.length-1]];else{const A=Wi.analyze(s);E===0?l=[A.min,A.max]:l=Wi.limits(A,"e",E)}return R}return l},R.domain=function(E){if(!arguments.length)return s;d=E[0],h=E[E.length-1],o=[];const A=c.length;if(E.length===A&&d!==h)for(let M of Array.from(E))o.push((M-d)/(h-d));else{for(let M=0;M<A;M++)o.push(M/(A-1));if(E.length>2){const M=E.map((P,O)=>O/(E.length-1)),N=E.map(P=>(P-d)/(h-d));N.every((P,O)=>M[O]===P)||(x=P=>{if(P<=0||P>=1)return P;let O=0;for(;P>=N[O+1];)O++;const B=(P-N[O])/(N[O+1]-N[O]);return M[O]+B*(M[O+1]-M[O])})}}return s=[d,h],R},R.mode=function(E){return arguments.length?(e=E,D(),R):e},R.range=function(E,A){return _(E),R},R.out=function(E){return u=E,R},R.spread=function(E){return arguments.length?(r=E,R):r},R.correctLightness=function(E){return E==null&&(E=!0),f=E,D(),f?y=function(A){const M=k(0,!0).lab()[0],N=k(1,!0).lab()[0],P=M>N;let O=k(A,!0).lab()[0];const B=M+(N-M)*A;let j=O-B,z=0,H=1,Y=20;for(;Math.abs(j)>.01&&Y-- >0;)(function(){return P&&(j*=-1),j<0?(z=A,A+=(H-A)*.5):(H=A,A+=(z-A)*.5),O=k(A,!0).lab()[0],j=O-B})();return A}:y=A=>A,R},R.padding=function(E){return E!=null?(Qi(E)==="number"&&(E=[E,E]),a=E,R):a},R.colors=function(E,A){arguments.length<2&&(A="hex");let M=[];if(arguments.length===0)M=c.slice(0);else if(E===1)M=[R(.5)];else if(E>1){const N=s[0],P=s[1]-N;M=TUt(0,E).map(O=>R(N+O/(E-1)*P))}else{i=[];let N=[];if(l&&l.length>2)for(let P=1,O=l.length,B=1<=O;B?P<O:P>O;B?P++:P--)N.push((l[P-1]+l[P])*.5);else N=s;M=N.map(P=>R(P))}return Wi[A]&&(M=M.map(N=>N[A]())),M},R.cache=function(E){return E!=null?(g=E,R):g},R.gamma=function(E){return E!=null?(m=E,R):m},R.nodata=function(E){return E!=null?(n=Wi(E),R):n},R}function TUt(i,e,n){let r=[],s=i<e,o=e;for(let a=i;s?a<o:a>o;s?a++:a--)r.push(a);return r}const RUt=function(i){let e=[1,1];for(let n=1;n<i;n++){let r=[1];for(let s=1;s<=e.length;s++)r[s]=(e[s]||0)+e[s-1];e=r}return e},AUt=function(i){let e,n,r,s;if(i=i.map(o=>new qt(o)),i.length===2)[n,r]=i.map(o=>o.lab()),e=function(o){const a=[0,1,2].map(l=>n[l]+o*(r[l]-n[l]));return new qt(a,"lab")};else if(i.length===3)[n,r,s]=i.map(o=>o.lab()),e=function(o){const a=[0,1,2].map(l=>(1-o)*(1-o)*n[l]+2*(1-o)*o*r[l]+o*o*s[l]);return new qt(a,"lab")};else if(i.length===4){let o;[n,r,s,o]=i.map(a=>a.lab()),e=function(a){const l=[0,1,2].map(c=>(1-a)*(1-a)*(1-a)*n[c]+3*(1-a)*(1-a)*a*r[c]+3*(1-a)*a*a*s[c]+a*a*a*o[c]);return new qt(l,"lab")}}else if(i.length>=5){let o,a,l;o=i.map(c=>c.lab()),l=i.length-1,a=RUt(l),e=function(c){const u=1-c,d=[0,1,2].map(h=>o.reduce((f,p,g)=>f+a[g]*u**(l-g)*c**g*p[h],0));return new qt(d,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},NUt=i=>{const e=AUt(i);return e.scale=()=>Uj(e),e},eg=(i,e,n)=>{if(!eg[n])throw new Error("unknown blend mode "+n);return eg[n](i,e)},ow=i=>(e,n)=>{const r=Wi(n).rgb(),s=Wi(e).rgb();return Wi.rgb(i(r,s))},aw=i=>(e,n)=>{const r=[];return r[0]=i(e[0],n[0]),r[1]=i(e[1],n[1]),r[2]=i(e[2],n[2]),r},MUt=i=>i,PUt=(i,e)=>i*e/255,OUt=(i,e)=>i>e?e:i,FUt=(i,e)=>i>e?i:e,BUt=(i,e)=>255*(1-(1-i/255)*(1-e/255)),jUt=(i,e)=>e<128?2*i*e/255:255*(1-2*(1-i/255)*(1-e/255)),WUt=(i,e)=>255*(1-(1-e/255)/(i/255)),$Ut=(i,e)=>i===255?255:(i=255*(e/255)/(1-i/255),i>255?255:i);eg.normal=ow(aw(MUt));eg.multiply=ow(aw(PUt));eg.screen=ow(aw(BUt));eg.overlay=ow(aw(jUt));eg.darken=ow(aw(OUt));eg.lighten=ow(aw(FUt));eg.dodge=ow(aw($Ut));eg.burn=ow(aw(WUt));const{pow:zUt,sin:VUt,cos:HUt}=Math;function UUt(i=300,e=-1.5,n=1,r=1,s=[0,1]){let o=0,a;Qi(s)==="array"?a=s[1]-s[0]:(a=0,s=[s,s]);const l=function(c){const u=B0*((i+120)/360+e*c),d=zUt(s[0]+a*c,r),f=(o!==0?n[0]+c*o:n)*d*(1-d)/2,p=HUt(u),g=VUt(u),m=d+f*(-.14861*p+1.78277*g),_=d+f*(-.29227*p-.90649*g),b=d+f*(1.97294*p);return Wi(qce([m*255,_*255,b*255,1]))};return l.start=function(c){return c==null?i:(i=c,l)},l.rotations=function(c){return c==null?e:(e=c,l)},l.gamma=function(c){return c==null?r:(r=c,l)},l.hue=function(c){return c==null?n:(n=c,Qi(n)==="array"?(o=n[1]-n[0],o===0&&(n=n[1])):o=0,l)},l.lightness=function(c){return c==null?s:(Qi(c)==="array"?(s=c,a=c[1]-c[0]):(s=[c,c],a=0),l)},l.scale=()=>Wi.scale(l),l.hue(n),l}const qUt="0123456789abcdef",{floor:KUt,random:GUt}=Math,XUt=()=>{let i="#";for(let e=0;e<6;e++)i+=qUt.charAt(KUt(GUt()*16));return new qt(i,"hex")},{log:ISe,pow:YUt,floor:ZUt,abs:QUt}=Math;function JFe(i,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Qi(i)==="object"&&(i=Object.values(i)),i.forEach(r=>{e&&Qi(r)==="object"&&(r=r[e]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,s)=>e3e(n,r,s),n}function e3e(i,e="equal",n=7){Qi(i)=="array"&&(i=JFe(i));const{min:r,max:s}=i,o=i.values.sort((l,c)=>l-c);if(n===1)return[r,s];const a=[];if(e.substr(0,1)==="c"&&(a.push(r),a.push(s)),e.substr(0,1)==="e"){a.push(r);for(let l=1;l<n;l++)a.push(r+l/n*(s-r));a.push(s)}else if(e.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const l=Math.LOG10E*ISe(r),c=Math.LOG10E*ISe(s);a.push(r);for(let u=1;u<n;u++)a.push(YUt(10,l+u/n*(c-l)));a.push(s)}else if(e.substr(0,1)==="q"){a.push(r);for(let l=1;l<n;l++){const c=(o.length-1)*l/n,u=ZUt(c);if(u===c)a.push(o[u]);else{const d=c-u;a.push(o[u]*(1-d)+o[u+1]*d)}}a.push(s)}else if(e.substr(0,1)==="k"){let l;const c=o.length,u=new Array(c),d=new Array(n);let h=!0,f=0,p=null;p=[],p.push(r);for(let _=1;_<n;_++)p.push(r+_/n*(s-r));for(p.push(s);h;){for(let b=0;b<n;b++)d[b]=0;for(let b=0;b<c;b++){const y=o[b];let x=Number.MAX_VALUE,k;for(let D=0;D<n;D++){const R=QUt(p[D]-y);R<x&&(x=R,k=D),d[k]++,u[b]=k}}const _=new Array(n);for(let b=0;b<n;b++)_[b]=null;for(let b=0;b<c;b++)l=u[b],_[l]===null?_[l]=o[b]:_[l]+=o[b];for(let b=0;b<n;b++)_[b]*=1/d[b];h=!1;for(let b=0;b<n;b++)if(_[b]!==p[b]){h=!0;break}p=_,f++,f>200&&(h=!1)}const g={};for(let _=0;_<n;_++)g[_]=[];for(let _=0;_<c;_++)l=u[_],g[l].push(o[_]);let m=[];for(let _=0;_<n;_++)m.push(g[_][0]),m.push(g[_][g[_].length-1]);m=m.sort((_,b)=>_-b),a.push(m[0]);for(let _=1;_<m.length;_+=2){const b=m[_];!isNaN(b)&&a.indexOf(b)===-1&&a.push(b)}}return a}const JUt=(i,e)=>{i=new qt(i),e=new qt(e);const n=i.luminance(),r=e.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},{sqrt:p0,pow:ya,min:eqt,max:tqt,atan2:TSe,abs:RSe,cos:BB,sin:ASe,exp:nqt,PI:NSe}=Math;function iqt(i,e,n=1,r=1,s=1){var o=function(le){return 360*le/(2*NSe)},a=function(le){return 2*NSe*le/360};i=new qt(i),e=new qt(e);const[l,c,u]=Array.from(i.lab()),[d,h,f]=Array.from(e.lab()),p=(l+d)/2,g=p0(ya(c,2)+ya(u,2)),m=p0(ya(h,2)+ya(f,2)),_=(g+m)/2,b=.5*(1-p0(ya(_,7)/(ya(_,7)+ya(25,7)))),y=c*(1+b),x=h*(1+b),k=p0(ya(y,2)+ya(u,2)),D=p0(ya(x,2)+ya(f,2)),R=(k+D)/2,E=o(TSe(u,y)),A=o(TSe(f,x)),M=E>=0?E:E+360,N=A>=0?A:A+360,P=RSe(M-N)>180?(M+N+360)/2:(M+N)/2,O=1-.17*BB(a(P-30))+.24*BB(a(2*P))+.32*BB(a(3*P+6))-.2*BB(a(4*P-63));let B=N-M;B=RSe(B)<=180?B:N<=M?B+360:B-360,B=2*p0(k*D)*ASe(a(B)/2);const j=d-l,z=D-k,H=1+.015*ya(p-50,2)/p0(20+ya(p-50,2)),Y=1+.045*R,X=1+.015*R*O,Q=30*nqt(-ya((P-275)/25,2)),K=-(2*p0(ya(R,7)/(ya(R,7)+ya(25,7))))*ASe(2*a(Q)),ee=p0(ya(j/(n*H),2)+ya(z/(r*Y),2)+ya(B/(s*X),2)+K*(z/(r*Y))*(B/(s*X)));return tqt(0,eqt(100,ee))}function rqt(i,e,n="lab"){i=new qt(i),e=new qt(e);const r=i.get(n),s=e.get(n);let o=0;for(let a in r){const l=(r[a]||0)-(s[a]||0);o+=l*l}return Math.sqrt(o)}const sqt=(...i)=>{try{return new qt(...i),!0}catch{return!1}},oqt={cool(){return Uj([Wi.hsl(180,1,.9),Wi.hsl(250,.7,.4)])},hot(){return Uj(["#000","#f00","#ff0","#fff"]).mode("rgb")}},e9={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(let i of Object.keys(e9))e9[i.toLowerCase()]=e9[i];Object.assign(Wi,{average:DUt,bezier:NUt,blend:eg,cubehelix:UUt,mix:qO,interpolate:qO,random:XUt,scale:Uj,analyze:JFe,contrast:JUt,deltaE:iqt,distance:rqt,limits:e3e,valid:sqt,scales:oqt,input:Ai,colors:kI,brewer:e9});const aqt=["#EB5353","#F9D923","#36AE7C"],lqt="#36A2EB",nZ=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"];function cqt(i,e){if(e[i])return e[i];const n=Object.keys(e).length%nZ.length;return e[i]=nZ[n],nZ[n]}function uqt(i,e=null){if(!e)return Array.from({length:i.length},()=>lqt);typeof e=="string"&&(e={payload:e});function n(r,s){return s.split(".").reduce((o,a)=>o&&o[a],r)}if(e.payload){const r={};return i.map(s=>{const o=n(s.payload,e.payload);return cqt(o,r)})}if(e.query){const r=i.map(l=>l.score),s=Math.min(...r),o=Math.max(...r),a=Wi.scale(aqt);return r.map(l=>{const c=(l-s)/(o-s);return a(c).hex()})}}function dqt(i){return i.map(()=>3)}const hqt="rgba(255, 0, 0, 0.5)",fqt="rgba(245, 245, 245, 0.8)",Jie="rgba(0, 0, 0, 0)";function MSe(i,e,n,r,s=null){const o={pointHitRadius:1,hoverRadius:7};if(!s)return[{label:"Data",data:e,offsets:Array.from({length:e.length},(l,c)=>c),pointBackgroundColor:[...n],pointBorderColor:Array.from({length:n.length},()=>Jie),...o}];const a={};return i.forEach((l,c)=>{let u=LHt(l.payload,s)+"";u||(u="Unknown"),a[u]||(a[u]={label:u,data:[],offsets:[],pointBackgroundColor:[],pointBorderColor:[],pointRadius:[],...o}),a[u].data.push(e[c]),a[u].offsets.push(c),a[u].pointBackgroundColor.push(n[c]),a[u].pointBorderColor.push(Jie),a[u].pointRadius.push(r[c])}),Object.values(a).sort((l,c)=>l.label.localeCompare(c.label))}const t3e=({requestResult:i,visualizationParams:e,activePoint:n,setActivePoint:r})=>{const{enqueueSnackbar:s}=pu();let o=null;const a=$i();function l(){return a.palette.mode==="light"?hqt:fqt}return $.useEffect(()=>{var k;if(!i.points)return;const c=i.points,u=e==null?void 0:e.color_by,d=c.map(()=>({x:Math.random(),y:Math.random()})),h=uqt(c,u),f=dqt(c),p=typeof u=="string"?u:u==null?void 0:u.payload,g=!!p,m=MSe(c,d,h,f,p),_=D=>{var j,z;if(!((j=D.tooltip)!=null&&j._active)||((z=D.tooltip)==null?void 0:z._active.length)===0)return;const R=D.tooltip._active.length-1,E=D.tooltip._active[R],A=E.datasetIndex,M=E.index,P=D.data.datasets[A].offsets[M],O=c[P];if(O.id===(n==null?void 0:n.id))return o={offset:P,datasetIndex:A,pointIndex:M},O;if(P===(o==null?void 0:o.offset))return O;const B=o;if(o={offset:P,datasetIndex:A,pointIndex:M},B){const H=h[B.offset];D.data.datasets[B.datasetIndex].pointBackgroundColor[B.pointIndex]=H,D.data.datasets[B.datasetIndex].pointBorderColor[B.pointIndex]=Jie}return D.data.datasets[A].pointBackgroundColor[M]=l(),D.data.datasets[A].pointBorderColor[M]=l(),r(O),D.update(),O},b=document.getElementById("myChart"),y=new F0(b,{type:"scatter",data:{datasets:m},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{display:!1},display:!1},y:{display:!1}},interaction:{mode:"nearest",intersect:!1},plugins:{tooltip:{enabled:!0,usePointStyle:!0,position:"nearest",intersect:!0,callbacks:{label:D=>{const R=_(D.chart);return R?`Point ${R.id}`:""}}},legend:{display:g}}}}),x=new Worker(new URL("/dashboard/assets/worker-Dy04AaGm.js",import.meta.url),{type:"module"});return x.onmessage=D=>{if(D.data.error)s(`Visualization Unsuccessful, error: ${D.data.error}`,{variant:"error"});else if(D.data.result&&D.data.result.length>0){const R=D.data.result;MSe(c,R,h,f,p).forEach((A,M)=>{y.data.datasets[M].data=A.data}),y.update()}else s("Visualization Unsuccessful, error: Unexpected Error Occured",{variant:"error"})},((k=i.points)==null?void 0:k.length)>0&&x.postMessage({result:i,params:e}),()=>{y.destroy(),x.terminate()}},[i]),C.jsx(C.Fragment,{children:C.jsx("canvas",{id:"myChart"})})};t3e.propTypes={requestResult:Z.object.isRequired,visualizationParams:Z.object.isRequired,activePoint:Z.object,setActivePoint:Z.func};const n3e=({point:i})=>{const e=$i();return i?C.jsxs(Fv,{elevation:0,sx:{borderRadius:0},children:[C.jsx(Ye,{component:"header",sx:{backgroundColor:Pt(e.palette.action.hover,.08),px:2,py:.5,display:"flex",alignItems:"center",height:48},children:C.jsxs(Je,{variant:"h6",children:["Point ",i.id]})}),Object.keys(i.payload).length>0&&C.jsx(C.Fragment,{children:C.jsx(Ye,{sx:{display:"flex",justifyContent:"center",position:"relative"},children:C.jsx(wce,{data:i.payload,sx:{width:300,height:300,borderRadius:.25,mx:2,my:3,border:`1px solid ${Pt(e.palette.text.primary,.12)}`,"div:has(> &):after":{content:'""',display:"block",position:"absolute",left:0,right:0,bottom:0,borderBottom:`1px solid ${Pt(e.palette.text.primary,.12)}`}}})})}),Object.keys(i.payload).length>0&&C.jsx(Ye,{sx:{flex:1},children:C.jsx(Ye,{sx:{px:2,py:1},children:C.jsx(Dce,{point:i,showImage:!1,onPayloadEdit:()=>{},buttonsToShow:["copy"]})})}),(i==null?void 0:i.vector)&&C.jsxs(Ye,{sx:{borderTop:`1px solid ${Pt(e.palette.text.primary,.12)}`},children:[C.jsx(SE,{}),C.jsx(ex,{sx:{padding:"1rem"},children:(i==null?void 0:i.vector)&&C.jsx(yce,{point:i})})]})]}):C.jsx(l_,{severity:"info",sx:{m:5},children:"Select a point to see its data preview"})};n3e.propTypes={point:Z.object};const i3e=$.memo(n3e);function KO({children:i,value:e,index:n,...r}){return C.jsx(Ye,{role:"tabpanel",hidden:e!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`,...r,children:e===n&&C.jsx(Ye,{sx:{height:"100%"},children:i})})}KO.propTypes={children:Z.node,value:Z.number.isRequired,index:Z.number.isRequired};function pqt(i,e,{limit:n,filter:r=null,using:s=null,color_by:o=null}){if(o!=null&&o.query){const l={query:o.query,limit:n,filter:r,with_vector:s?[s]:!0,with_payload:!0,using:s??null};return i.query(e,l)}const a={limit:n,filter:r,with_vector:s?[s]:!0,with_payload:!0};return i.scroll(e,a)}const gqt=`
// Try me!
{
"limit": 500
}
// Specify request parameters to select data for visualization.
//
// Available parameters:
//
// - 'limit': maximum number of vectors to visualize.
// *Warning*: large values may cause browser to freeze.
//
// - 'filter': filter expression to select vectors for visualization.
// See https://qdrant.tech/documentation/concepts/filtering/
//
// - 'color_by': specify score or payload field to use for coloring points.
// How to use:
//
// "color_by": {
// "payload": "field_name"
// }
//
// - 'using': specify which vector to use for visualization
// if there are multiple.
//
// - 'algorithm': specify algorithm to use for visualization. Available options: 'TSNE', 'UMAP', 'PCA'.
`,mqt={};function _qt(){const i=$i(),{client:e}=Ur(),[n,r]=$.useState(gqt),[s,o]=$.useState(mqt),[a,l]=$.useState({}),{enqueueSnackbar:c}=pu(),u=z1(),d=V1(),[h,f]=$.useState(0),p=$.useRef(null),{height:g}=kse(),[m,_]=$.useState(null),[b,y]=$.useState(0),x=(R,E)=>{y(E)};$.useEffect(()=>{var R;f(g-((R=p.current)==null?void 0:R.offsetTop))},[g,p]),$.useEffect(()=>{m!=null&&b!==1&&y(1)},[m]);const k=async(R,E)=>{l(R);try{const A=await pqt(e,E,R);o(A)}catch(A){c(`Request error: ${A.message}`,{variant:"error"})}},D=R=>({description:"Filter request",type:"object",properties:{limit:{description:"Page size. Default: 10",type:"integer",format:"uint",minimum:1,nullable:!0},filter:{description:"Look only for points which satisfies this conditions. If not provided - all points.",anyOf:[{$ref:"#/components/schemas/Filter"},{nullable:!0}]},using:{description:"Specify which vector to use for visualization",type:"string",enum:R},color_by:{description:"Color points by this field",anyOf:[{type:"string"},{description:"field name",type:"object",properties:{payload:{description:"Name of the field to use for coloring",type:"string"}}},{description:"query",type:"object",properties:{query:{$ref:"#/components/schemas/QueryInterface"}}},{nullable:!0}]},algorithm:{description:"Algorithm to use for visualization",type:"string",enum:["TSNE","UMAP","PCA"],default:"TSNE"}}});return C.jsx(C.Fragment,{children:C.jsx(Ye,{component:"main",children:C.jsx(ln,{container:!0,children:C.jsx(ln,{size:12,children:C.jsxs(UW,{direction:"horizontal",children:[C.jsx(ix,{style:{display:"flex"},children:C.jsxs(Ye,{width:"100%",children:[C.jsx(Ye,{children:C.jsxs(du,{variant:"heading",sx:{display:"flex",alignItems:"center",p:1,borderRadius:0,borderBottom:`1px solid ${i.palette.divider}`},children:[C.jsx(ua,{title:"Back to collection",children:C.jsx(Ga,{sx:{mr:3},size:"small",onClick:()=>u(`/collections/${d.collectionName}`),children:C.jsx(hV,{})})}),C.jsx(Je,{variant:"h6",children:d.collectionName})]})}),C.jsx(Ye,{ref:p,height:h,width:"100%",children:C.jsx(t3e,{requestResult:s,visualizationParams:a,activePoint:m,setActivePoint:_})})]})}),C.jsx(qW,{style:{width:"10px",background:i.palette.background.paperElevation2},children:C.jsx(Ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"⋮"})}),C.jsx(ix,{children:C.jsxs(Ye,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[C.jsx(Ye,{sx:{borderBottom:1,borderColor:"divider",backgroundColor:i.palette.background.paper},children:C.jsxs(ose,{value:b,onChange:x,"aria-label":"visualization tabs",children:[C.jsx(mp,{label:"Code"}),C.jsx(mp,{label:"Data Panel"})]})}),C.jsx(KO,{value:b,index:0,style:{flex:1,overflow:"hidden"},children:C.jsx(MV,{code:n,onChange:r,onChangeResult:k,customRequestSchema:D})}),C.jsx(KO,{value:b,index:1,style:{flex:1,overflow:"hidden"},children:C.jsx(Ye,{sx:{height:"100%",overflowY:"scroll"},children:C.jsx(i3e,{point:m})})})]})})]})})})})})}const vqt=ye(({...i})=>C.jsx(Fv,{elevation:0,...i}))(({theme:i})=>({display:"flex",width:"100%",height:"100%",border:`1px solid ${Pt(i.palette.divider,.12)}`,background:i.palette.background.paperElevation1,borderRadius:"0.5rem",boxShadow:"none",textDecoration:"none","&:hover":{boxShadow:i.shadows[8]}})),bqt=ye(GHe)(({theme:i})=>({display:"flex",flexDirection:"column",justifyContent:"space-between",flexGrow:1,"&:hover":{...i.palette.mode==="light"&&{"& .MuiCardActionArea-focusHighlight":{opacity:0}}}})),yqt=ye(ex)({width:"100%",padding:"1.5rem",display:"flex",flexGrow:1,"&.side":{flexDirection:"row",alignItems:"center",gap:"0.75rem"},"&.top":{flexDirection:"column",alignItems:"flex-start"}}),wqt=ye(Ye)({border:"1px solid rgba(0, 0, 0, 0.12)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,".side &":{padding:"1rem",border:"1px solid rgba(0, 0, 0, 0.12)",borderRadius:"8px"},".top &":{border:"none",marginBottom:"0.5rem"}}),Cqt=ye(Ye)`
display: flex;
flex-direction: column;
gap: 0.375rem; // 6px
flex: 1;
min-width: 0;
`,Sqt=ye(Je)`
font-weight: 500;
font-size: 1rem;
line-height: 1.5;
`,xqt=ye(Je)`
font-weight: 400;
font-size: 0.875rem; // 14px
line-height: 1.5;
color: ${({theme:i})=>i.palette.text.secondary};
`,kqt=ye(QHe)({width:"100%",padding:"0 1.5rem 1.5rem 1.25rem"}),Lqt=ye(i=>C.jsx(Ci,{variant:"text",...i}))(({theme:i})=>({display:"inline-flex",alignItems:"center",gap:"4px",color:i.palette.text.primary,fontSize:"0.8125rem",textDecoration:"none",fontWeight:500,paddingLeft:"4px",paddingRight:0,"&.add-margin-left":{marginLeft:"4.375rem"},"&:hover":{"& svg":{color:i.palette.primary.main}}})),zx=({icon:i,iconVariant:e,title:n,description:r,iconColor:s,linkText:o,href:a,showCta:l=!0,sx:c})=>{const u=$i(),d=s||u.palette.info.main,h=e||"side",f=(m,_)=>(!m||m==="side")&&_,p=!!a&&a.startsWith("http"),g=()=>{p||window.scrollTo(0,0)};return C.jsx(vqt,{component:lh,to:a,target:p?"_blank":void 0,sx:{...c},onClick:g,children:C.jsxs(bqt,{children:[C.jsxs(yqt,{className:h,children:[C.jsx(wqt,{children:C.jsx(i,{size:"20px",color:d})}),C.jsxs(Cqt,{children:[C.jsx(Sqt,{component:"h3",children:n}),C.jsx(xqt,{component:"p",children:r})]})]}),l&&a&&C.jsx(kqt,{children:C.jsxs(Lqt,{component:"span",className:f(e,l)?"add-margin-left":"",children:[o||"Learn More"," ",C.jsx(Uet,{size:"16px"})]})})]})})};zx.propTypes={icon:Z.elementType.isRequired,title:Z.string.isRequired,description:Z.string.isRequired,iconColor:Z.string,iconVariant:Z.string,linkText:Z.string,href:Z.string.isRequired,showCta:Z.bool,sx:Z.object};const PSe={vectorSearch:{title:"Vector Search",tutorials:[{icon:att,title:"Filtering - Beginner",description:"Filter search results using basic payload conditions.",href:"/tutorial/filteringbeginner"},{icon:Btt,title:"Filtering - Advanced",description:"Try advanced filtering based on nested payload conditions.",href:"/tutorial/filteringadvanced"},{icon:Ttt,title:"Filtering - Full Text",description:"Search for substrings, tokens, or phrases within text fields.",href:"/tutorial/filteringfulltext"},{icon:Xtt,title:"Multivector Search",description:"Work with data represented by ColBERT multivectors.",href:"/tutorial/multivectors"},{icon:ctt,title:"Sparse Vector Search",description:"Use sparse vectors to get specific search results.",href:"/tutorial/sparsevectors"},{icon:Mtt,title:"Hybrid Search",description:"Combine dense and sparse vectors for more accurate search results.",href:"/tutorial/hybridsearch"}]},multitenancy:{title:"Setup Guide",tutorials:[{icon:wtt,title:"Multitenancy",description:"Manage multiple users within a single collection.",href:"/tutorial/multitenancy"}]}},Yce=({sections:i=["filtering","vectorSearch","multitenancy"],showTitle:e=!0})=>{const n=i.reduce((r,s)=>{const o=PSe[s];return o?[...r,...o.tutorials]:r},[]);return e?C.jsx(C.Fragment,{children:i.map(r=>{const s=PSe[r];return s?C.jsxs(Ye,{component:"section",children:[C.jsx(Je,{component:"h2",variant:"h6",mb:"1rem",children:s.title}),C.jsx(ln,{container:!0,spacing:2,sx:{"& > .MuiGrid-root":{display:"flex"}},children:s.tutorials.map(o=>C.jsx(ln,{size:{xs:12,md:6,lg:3},children:C.jsx(zx,{icon:o.icon,iconVariant:"top",title:o.title,description:o.description,href:o.href})},o.href))})]},r):null})}):C.jsx(ln,{container:!0,spacing:2,sx:{"& > .MuiGrid-root":{display:"flex"}},children:n.map(r=>C.jsx(ln,{size:{xs:12,md:6,lg:3},children:C.jsx(zx,{icon:r.icon,iconVariant:"top",title:r.title,description:r.description,href:r.href})},r.href))})};Yce.propTypes={sections:Z.arrayOf(Z.string),showTitle:Z.bool};const Dqt=()=>{const{isRestricted:i}=Ur();return i?C.jsx(Ye,{sx:{p:5,width:"100%"},children:C.jsx(ln,{size:12,children:C.jsx(l_,{severity:"warning",children:"Access Denied: Because of the serverless mode, tutorial will not work here properly. Please contact your administrator."})})}):C.jsxs(Ye,{component:"main",sx:{display:"flex",flexDirection:"column",gap:"40px",p:5,margin:"auto",maxWidth:"1120px"},children:[C.jsx(Ye,{component:"header",children:C.jsx(Je,{component:"h1",variant:"h4",sx:{color:"text.primary",fontSize:"2rem",fontStyle:"normal",fontWeight:"600",lineHeight:"125%",letterSpacing:"-0.5px",mb:"1rem"},children:"Welcome to Qdrant!"})}),C.jsxs(Ye,{component:"section",children:[C.jsx(Je,{component:"h2",variant:"h6",mb:"1rem",children:"Connect to your Project or Start with Samples 11"}),C.jsxs(ln,{container:!0,spacing:2,children:[C.jsx(ln,{size:{xs:12,md:6},children:C.jsx(zx,{icon:ent,title:"Quickstart",description:"Create a collection, upsert vectors, and run a search.",href:"/tutorial/quickstart",showCta:!1,sx:{flexGrow:1}})}),C.jsx(ln,{size:{xs:12,md:6},children:C.jsx(zx,{icon:_se,title:"Load Sample Data",description:"Follow this tutorial to import a remote snapshot and explore vector search with real data in just a few steps.",href:"/datasets",showCta:!1,sx:{flexGrow:1}})})]})]}),C.jsx(Yce,{sections:["filtering","vectorSearch","multitenancy"]})]})},r3e=({code:i,onRun:e,loading:n})=>C.jsx(Ci,{variant:"contained",endIcon:n?C.jsx(c5,{size:24,color:"inherit"}):C.jsx(MMt,{sx:{fontSize:18}}),onClick:()=>e(i),disabled:n,"data-testid":"code-block-run",sx:{height:"2rem",lineHeight:"2rem",fontSize:"0.8125rem"},children:n?"Running...":"Run"});r3e.propTypes={code:Z.string.isRequired,onRun:Z.func.isRequired,loading:Z.bool};const Zce=({codeStr:i,language:e,withRunButton:n,onRun:r,title:s,editable:o=!0,loading:a})=>{const[l,c]=$.useState(i),u=$i();$.useEffect(()=>{c(i)},[i]);const d=h=>{c(()=>h)};return C.jsxs(Ye,{sx:{background:u.palette.background.code,borderRadius:"0.5rem",border:"1px solid",borderColor:u.palette.divider,my:3},"data-testid":"code-block",children:[C.jsxs(Ye,{display:"flex",alignItems:"center",px:2,py:1,sx:{background:u.palette.mode==="light"?u.palette.action.hover:Pt(u.palette.primary.main,.05)},children:[n&&r&&C.jsx(Ye,{sx:{flexGrow:"1"},children:C.jsx(r3e,{code:l,onRun:r,loading:a})}),s&&C.jsx(Ye,{children:s}),C.jsx(Ye,{sx:{flexGrow:"1"}}),C.jsx(p_,{text:l})]}),C.jsx(Ye,{sx:{px:2,pb:1},children:C.jsx(FV,{value:l,language:e,onChange:n&&o?d:void 0,readOnly:!n||!o,"data-testid":"code-block-editor"})})]})};Zce.propTypes={codeStr:Z.string.isRequired,language:Z.string,withRunButton:Z.bool,onRun:Z.func,title:Z.string,editable:Z.bool,loading:Z.bool,withOutput:Z.bool};const s3e=({code:i})=>{const{formattedCode:e}=EPe(i);return C.jsx(FV,{value:e,language:"json",readOnly:!0})};s3e.propTypes={code:Z.string.isRequired};const o3e=({children:i})=>{const e=$i(),n=i.props.className||"",r=i.props.children.trim(),s=n.replace(/language-/,""),o=i.props.withRunButton&&ls.parse(i.props.withRunButton),[a,l]=nn.useState("{}"),[c,u]=nn.useState(!1),d=nn.useRef(null);nn.useEffect(()=>{a&&a!=="{}"&&d.current&&d.current.scrollIntoView({behavior:"smooth",block:"center"})},[a]);const h=f=>{u(!0),l("{}"),nQ(f,!1).then(p=>{l(()=>ls.stringify(p)),u(!1)}).catch(p=>{l(()=>ls.stringify(p)),u(!1)})};return C.jsxs(C.Fragment,{children:[C.jsx(Zce,{codeStr:r,language:s,withRunButton:o,onRun:h,loading:c}),a&&a!=="{}"&&C.jsxs(Ye,{ref:d,sx:{mt:2},children:[C.jsx(Je,{variant:"subtitle1",mb:2,children:"Result"}),C.jsx(Ye,{sx:{borderRadius:"0.5rem",overflow:"hidden",border:`1px solid ${e.palette.divider}`},children:C.jsx(s3e,{code:a})})]})]})};o3e.propTypes={children:Z.shape({props:Z.shape({className:Z.string,children:Z.string.isRequired,withRunButton:Z.string})})};const Eqt=i=>C.jsx(Je,{component:"code",variant:"code",sx:{background:"transparent",borderRadius:1,p:.3,color:LDe[500]},...i}),a3e=i=>i.href.includes("http")?C.jsx(XM,{target:"_blank",...i}):C.jsx(XM,{...i});a3e.propTypes={href:Z.string};const Iqt={h1:i=>C.jsx(Je,{component:"h1",variant:"h4",mb:3,...i}),h2:i=>C.jsx(Je,{component:"h2",variant:"h5",mt:5,mb:2,...i}),h3:i=>C.jsx(Je,{component:"h3",variant:"h6",mt:2,...i}),h4:i=>C.jsx(Je,{component:"h4",variant:"subtitle1",mt:2,...i}),p:i=>C.jsx(Je,{component:"p",variant:"body1",mb:2,...i}),a:i=>C.jsx(a3e,{...i}),img:i=>C.jsx("img",{width:"100%",...i,alt:i.alt||"image"}),pre:i=>C.jsx(o3e,{...i}),em:i=>C.jsx(Je,{component:"em",variant:"body1",...i}),code:i=>C.jsx(Eqt,{...i}),Alert:i=>C.jsx(l_,{...i})},Tqt="Quickstart";function OSe(i){const e=Object.assign({h1:"h1",p:"p",strong:"strong",h2:"h2",code:"code",pre:"pre"},i.components),{Alert:n}=e;return n||Aqt("Alert"),C.jsxs(C.Fragment,{children:[C.jsx(e.h1,{children:"Quickstart: Vector Search for Beginners"}),`
`,C.jsx(e.p,{children:"Qdrant is designed to find the approximate nearest data points in your dataset. In this quickstart guide, you'll create a simple database to track space colonies and perform a search for the nearest colony based on its vector representation."}),`
`,C.jsxs(n,{severity:"info",children:["Click ",C.jsx(e.strong,{children:"RUN"})," to send the API request. The response will appear on the right.",C.jsx("br",{}),"You can also edit any code block and rerun the request to see different results."]}),`
`,C.jsx(e.h2,{children:"Step 1: Create a collection"}),`
`,C.jsxs(e.p,{children:["First, we’ll create a collection called ",C.jsx(e.code,{children:"star_charts"})," to store the colony data. Each location will be represented by a vector of four dimensions, and we'll use the Dot product as the distance metric for similarity search."]}),`
`,C.jsx(e.p,{children:"Run this command to create the collection:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/star_charts
{
"vectors": {
"size": 4,
"distance": "Dot"
}
}
`})}),`
`,C.jsx(e.h2,{children:"Step 2: Load data into the collection"}),`
`,C.jsx(e.p,{children:"Now that the collection is set up, let’s add some data. Each location will have a vector and additional information (payload), such as its name."}),`
`,C.jsx(e.p,{children:"Run this request to add the data:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/star_charts/points
{
"points": [
{
"id": 1,
"vector": [0.05, 0.61, 0.76, 0.74],
"payload": {
"colony": "Mars"
}
},
{
"id": 2,
"vector": [0.19, 0.81, 0.75, 0.11],
"payload": {
"colony": "Jupiter"
}
},
{
"id": 3,
"vector": [0.36, 0.55, 0.47, 0.94],
"payload": {
"colony": "Venus"
}
},
{
"id": 4,
"vector": [0.18, 0.01, 0.85, 0.80],
"payload": {
"colony": "Moon"
}
},
{
"id": 5,
"vector": [0.24, 0.18, 0.22, 0.44],
"payload": {
"colony": "Pluto"
}
}
]
}
`})}),`
`,C.jsx(e.h2,{children:"Step 3: Run a search query"}),`
`,C.jsx(e.p,{children:"Now, let’s search for the three nearest colonies to a specific vector representing a spatial location. This query will return the colonies along with their payload information."}),`
`,C.jsx(e.p,{children:"Run the query below to find the nearest colonies:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST collections/star_charts/points/search
{
"vector": [0.2, 0.1, 0.9, 0.7],
"limit": 3,
"with_payload": true
}
`})}),`
`,C.jsx(e.h2,{children:"Conclusion"}),`
`,C.jsx(e.p,{children:"Congratulations! 🎉 You’ve just completed a vector search across galactic coordinates! You've successfully added spatial data into a collection and performed searches to find the nearest locations based on their vector representation."}),`
`,C.jsx(e.h2,{children:"Next steps"}),`
`,C.jsx(e.p,{children:"In the next section, you’ll explore creating complex filter conditions to refine your searches further for interstellar exploration!"})]})}function Rqt(i={}){const{wrapper:e}=i.components||{};return e?C.jsx(e,Object.assign({},i,{children:C.jsx(OSe,i)})):OSe(i)}function Aqt(i,e){throw new Error("Expected component `"+i+"` to be defined: you likely forgot to import, pass, or provide it.")}const Nqt=Object.freeze(Object.defineProperty({__proto__:null,default:Rqt,title:Tqt},Symbol.toStringTag,{value:"Module"})),Mqt="Basic Filtering";function FSe(i){const e=Object.assign({h1:"h1",h2:"h2",p:"p",code:"code",pre:"pre",strong:"strong",h3:"h3",em:"em"},i.components);return C.jsxs(C.Fragment,{children:[C.jsx(e.h1,{children:"Basic Filtering - Clauses and Conditions"}),`
`,C.jsx(e.h2,{children:"Step 1: Create a Collection"}),`
`,C.jsxs(e.p,{children:["First, create a collection called ",C.jsx(e.code,{children:"terraforming"}),". Each point will have vectors of size 4, and the distance metric is set to ",C.jsx(e.code,{children:"Dot"}),":"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/terraforming
{
"vectors": {
"size": 4,
"distance": "Dot"
}
}
`})}),`
`,C.jsx(e.h2,{children:"Step 2: Add Points with Vectors and Payloads"}),`
`,C.jsxs(e.p,{children:["Now, add points to the collection. Each point includes an ",C.jsx(e.code,{children:"id"}),", ",C.jsx(e.code,{children:"vector"})," and a ",C.jsx(e.code,{children:"payload"})," with various attributes like ",C.jsx(e.code,{children:"land type"}),", ",C.jsx(e.code,{children:"color"}),", ",C.jsx(e.code,{children:"life presence"}),", and ",C.jsx(e.code,{children:"humidity"}),":"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/terraforming/points
{
"points": [
{
"id": 1,
"vector": [0.1, 0.2, 0.3, 0.4],
"payload": {"land": "forest", "color": "green", "life": true, "humidity": 40}
},
{
"id": 2,
"vector": [0.2, 0.3, 0.4, 0.5],
"payload": {"land": "lake", "color": "blue", "life": true, "humidity": 100}
},
{
"id": 3,
"vector": [0.3, 0.4, 0.5, 0.6],
"payload": {"land": "steppe", "color": "green", "life": false, "humidity": 25}
},
{
"id": 4,
"vector": [0.4, 0.5, 0.6, 0.7],
"payload": {"land": "desert", "color": "red", "life": false, "humidity": 5}
},
{
"id": 5,
"vector": [0.5, 0.6, 0.7, 0.8],
"payload": {"land": "marsh", "color": "black", "life": true, "humidity": 90}
},
{
"id": 6,
"vector": [0.6, 0.7, 0.8, 0.9],
"payload": {"land": "cavern", "color": "black", "life": false, "humidity": 15}
}
]
}
`})}),`
`,C.jsx(e.h2,{children:"Step 3: Index the fields before filtering"}),`
`,C.jsxs(e.p,{children:[C.jsx(e.strong,{children:"Note:"})," You should always index a field before filtering. If you use filtering before you create an index, Qdrant will search through the entire dataset in an unstructured way. Your search performance will be very slow."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/terraforming/index
{
"field_name": "life",
"field_schema": "bool"
}
`})}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/terraforming/index
{
"field_name": "color",
"field_schema": "keyword"
}
`})}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/terraforming/index
{
"field_name": "humidity",
"field_schema": {
"type": "integer",
"range": true
}
}
`})}),`
`,C.jsx(e.h2,{children:"Step 4: Filtering examples"}),`
`,C.jsx(e.h3,{children:"Filter by exact match"}),`
`,C.jsxs(e.p,{children:["Finally, this query retrieves points where the ",C.jsx(e.code,{children:"color"})," is ",C.jsx(e.code,{children:'"black"'}),", using a straightforward ",C.jsx(e.code,{children:"match"})," condition:"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST collections/terraforming/points/scroll
{
"filter": {
"must": [
{
"key": "color",
"match": {
"value": "black"
}
}
]
},
"limit": 3,
"with_payload": true
}
`})}),`
`,C.jsxs(e.h3,{children:["Combined filter by ",C.jsx(e.code,{children:"must"})," clause"]}),`
`,C.jsxs(e.p,{children:["In this example, the query returns points where ",C.jsx(e.code,{children:"life"})," is ",C.jsx(e.code,{children:"true"})," and ",C.jsx(e.code,{children:"color"})," is ",C.jsx(e.code,{children:'"green"'}),". These must conditions both need to be met for a point to be returned."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST collections/terraforming/points/scroll
{
"filter": {
"must": [
{ "key": "life", "match": { "value": true } },
{ "key": "color", "match": { "value": "green" } }
]
},
"limit": 3,
"with_payload": true
}
`})}),`
`,C.jsxs(e.h3,{children:["Filter by ",C.jsx(e.code,{children:"should"})," clause"]}),`
`,C.jsxs(e.p,{children:["Here, you are filtering for points where ",C.jsx(e.code,{children:"life"})," is ",C.jsx(e.code,{children:"false"})," and ",C.jsx(e.code,{children:"color"})," is ",C.jsx(e.code,{children:'"black"'}),". These conditions act as ",C.jsx(e.em,{children:"should"})," clauses, meaning points meeting either or both criteria will be returned:"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST collections/terraforming/points/scroll
{
"filter": {
"should": [
{
"key": "life",
"match": { "value": false }
}, {
"key": "color",
"match": { "value": "black" }
}
]
}
}
`})}),`
`,C.jsxs(e.h3,{children:["Filter by ",C.jsx(e.code,{children:"must_not"})," clause"]}),`
`,C.jsxs(e.p,{children:["This query filters out any points where ",C.jsx(e.code,{children:"life"})," is ",C.jsx(e.code,{children:"false"}),". Points matching this condition are excluded from the results."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST collections/terraforming/points/scroll
{
"filter": {
"must_not": [
{
"key": "life",
"match": { "value": false }
}
]
},
"limit": 3,
"with_payload": true
}
`})}),`
`,C.jsxs(e.h3,{children:["Filter by ",C.jsx(e.code,{children:"range"})," condition"]}),`
`,C.jsxs(e.p,{children:["This query filters points based on a range of ",C.jsx(e.code,{children:"humidity"}),". Here, the ",C.jsx(e.code,{children:"humidity"})," value must be exactly 40:"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST collections/terraforming/points/scroll
{
"filter": {
"must": [
{
"key": "humidity",
"range": {
"gte": 40,
"lte": 40
}
}
]
},
"limit": 3,
"with_payload": true
}
`})})]})}function Pqt(i={}){const{wrapper:e}=i.components||{};return e?C.jsx(e,Object.assign({},i,{children:C.jsx(FSe,i)})):FSe(i)}const Oqt=Object.freeze(Object.defineProperty({__proto__:null,default:Pqt,title:Mqt},Symbol.toStringTag,{value:"Module"})),Fqt="Advanced Filtering";function BSe(i){const e=Object.assign({h1:"h1",h2:"h2",p:"p",code:"code",pre:"pre",strong:"strong",ul:"ul",li:"li",h3:"h3"},i.components);return C.jsxs(C.Fragment,{children:[C.jsx(e.h1,{children:"Advanced Filtering - Nested Filters"}),`
`,C.jsx(e.h2,{children:"Step 1: Create a Collection"}),`
`,C.jsxs(e.p,{children:["Start by creating a collection named ",C.jsx(e.code,{children:"dinosaurs"})," with a vector size of 4 and the distance metric set to ",C.jsx(e.code,{children:"Dot"}),":"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/dinosaurs
{
"vectors": {
"size": 4,
"distance": "Dot"
}
}
`})}),`
`,C.jsx(e.h2,{children:"Step 2: Add Vectors with Payloads"}),`
`,C.jsxs(e.p,{children:["You can now add points to the collection. Each point contains an ",C.jsx(e.code,{children:"id"}),", ",C.jsx(e.code,{children:"vector"})," and a ",C.jsx(e.code,{children:"payload"})," with additional information such as the dinosaur species and diet preferences. For example:"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/dinosaurs/points
{
"points": [
{
"id": 1,
"vector": [0.1, 0.2, 0.3, 0.4],
"payload": {
"dinosaur": "t-rex",
"diet": [
{ "food": "leaves", "likes": false },
{ "food": "meat", "likes": true }
]
}
},
{
"id": 2,
"vector": [0.2, 0.3, 0.4, 0.5],
"payload": {
"dinosaur": "diplodocus",
"diet": [
{ "food": "leaves", "likes": true },
{ "food": "meat", "likes": false }
]
}
}
]
}
`})}),`
`,C.jsx(e.h2,{children:"Step 3: Index the fields before filtering"}),`
`,C.jsxs(e.p,{children:[C.jsx(e.strong,{children:"Note:"})," You should always index a field before filtering. If you use filtering before you create an index, Qdrant will search through the entire dataset in an unstructured way. Your search performance will be very slow."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/dinosaurs/index
{
"field_name": "diet[].food",
"field_schema": "keyword"
}
`})}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/dinosaurs/index
{
"field_name": "diet[].likes",
"field_schema": "bool"
}
`})}),`
`,C.jsxs(e.h2,{children:["Step 4: Basic Filtering with ",C.jsx(e.code,{children:"match"})]}),`
`,C.jsx(e.p,{children:"You can filter points by specific payload values. For instance, the query below matches points where:"}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:["The ",C.jsx(e.code,{children:"diet[].food"}),' contains "meat".']}),`
`,C.jsxs(e.li,{children:["The ",C.jsx(e.code,{children:"diet[].likes"})," is set to ",C.jsx(e.code,{children:"true"}),"."]}),`
`]}),`
`,C.jsx(e.p,{children:"Both points match these conditions, as:"}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsx(e.li,{children:"The “t-rex” eats meat and likes it."}),`
`,C.jsx(e.li,{children:"The “diplodocus” eats meat but doesn't like it."}),`
`]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/dinosaurs/points/scroll
{
"filter": {
"must": [
{
"key": "diet[].food",
"match": {
"value": "meat"
}
},
{
"key": "diet[].likes",
"match": {
"value": true
}
}
]
}
}
`})}),`
`,C.jsxs(e.p,{children:[`However, if you want to retrieve only the points where both conditions are true for the same element within the array (e.g., the "t-rex" with ID 1), you'll need to use a `,C.jsx(e.strong,{children:"nested filter"}),"."]}),`
`,C.jsx(e.h2,{children:"Step 5: Advanced Filtering with Nested Object Filters"}),`
`,C.jsxs(e.p,{children:["To apply the filter at the array element level, you use the ",C.jsx(e.code,{children:"nested"})," filter condition. This ensures that the ",C.jsx(e.code,{children:"food"})," and ",C.jsx(e.code,{children:"likes"})," values are evaluated together within each array element:"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/dinosaurs/points/scroll
{
"filter": {
"must": [
{
"nested": {
"key": "diet",
"filter": {
"must": [
{
"key": "food",
"match": {
"value": "meat"
}
},
{
"key": "likes",
"match": {
"value": true
}
}
]
}
}
}
]
}
}
`})}),`
`,C.jsx(e.p,{children:'With this filter, only the "t-rex" (ID 1) is returned, because its array element satisfies both conditions.'}),`
`,C.jsx(e.h3,{children:"Explanation"}),`
`,C.jsx(e.p,{children:"Nested filters treat each array element as a separate object, applying the filter independently to each element. The parent document (in this case, the dinosaur point) matches the filter if any one array element meets all conditions."}),`
`,C.jsxs(e.h2,{children:["Step 6: Combining ",C.jsx(e.code,{children:"has_id"})," with Nested Filters"]}),`
`,C.jsxs(e.p,{children:["Note that ",C.jsx(e.code,{children:"has_id"})," cannot be used inside a nested filter. If you need to filter by ID as well, include the ",C.jsx(e.code,{children:"has_id"})," condition as a separate clause, like this:"]}),`
`,C.jsxs(e.p,{children:[`You won't get a different answer. You can see that this filter matches the "t-rex" (ID 1) by combining the `,C.jsx(e.code,{children:"nested"})," diet filter with an explicit ID match."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/dinosaurs/points/scroll
{
"filter": {
"must": [
{
"nested": {
"key": "diet",
"filter": {
"must": [
{
"key": "food",
"match": {
"value": "meat"
}
},
{
"key": "likes",
"match": {
"value": true
}
}
]
}
}
},
{
"has_id": [1]
}
]
}
}
`})})]})}function Bqt(i={}){const{wrapper:e}=i.components||{};return e?C.jsx(e,Object.assign({},i,{children:C.jsx(BSe,i)})):BSe(i)}const jqt=Object.freeze(Object.defineProperty({__proto__:null,default:Bqt,title:Fqt},Symbol.toStringTag,{value:"Module"})),Wqt="Full Text Filtering";function jSe(i){const e=Object.assign({h1:"h1",p:"p",strong:"strong",h2:"h2",code:"code",pre:"pre",h3:"h3"},i.components);return C.jsxs(C.Fragment,{children:[C.jsx(e.h1,{children:"Full Text Filtering"}),`
`,C.jsxs(e.p,{children:["Here's a step-by-step tutorial on ",C.jsx(e.strong,{children:"Full Text Filtering in Qdrant"})," using a collection of planetary data with description fields:"]}),`
`,C.jsx(e.h2,{children:"Step 1: Create a collection"}),`
`,C.jsxs(e.p,{children:["We first create a collection named ",C.jsx(e.code,{children:"star_charts"})," with vectors of size 4 and dot product distance for similarity."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/star_charts
{
"vectors": {
"size": 4,
"distance": "Dot"
}
}
`})}),`
`,C.jsx(e.h2,{children:"Step 2: Add data with descriptions in payload"}),`
`,C.jsx(e.p,{children:"Next, we add data to the collection. Each entry includes an id, vector and a payload containing details about various celestial bodies, such as colony information, whether the body supports life and a description."}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/star_charts/points
{
"points": [
{
"id": 1,
"vector": [0.05, 0.61, 0.76, 0.74],
"payload": {
"colony": "Mars",
"supports_life": true,
"description": "The red planet, Mars, has a cold desert climate and may have once had conditions suitable for life."
}
},
{
"id": 2,
"vector": [0.19, 0.81, 0.75, 0.11],
"payload": {
"colony": "Jupiter",
"supports_life": false,
"description": "Jupiter is the largest planet in the solar system, known for its Great Red Spot and hostile gas environment."
}
},
{
"id": 3,
"vector": [0.36, 0.55, 0.47, 0.94],
"payload": {
"colony": "Venus",
"supports_life": false,
"description": "Venus, Earth’s twin in size, has an extremely thick atmosphere and surface temperatures hot enough to melt lead."
}
},
{
"id": 4,
"vector": [0.18, 0.01, 0.85, 0.80],
"payload": {
"colony": "Moon",
"supports_life": true,
"description": "Earth’s Moon, long visited by astronauts, is a barren, airless world but could host colonies in its underground caves."
}
},
{
"id": 5,
"vector": [0.24, 0.18, 0.22, 0.44],
"payload": {
"colony": "Pluto",
"supports_life": false,
"description": "Once considered the ninth planet, Pluto is a small icy world at the edge of the solar system."
}
}
]
}
`})}),`
`,C.jsx(e.h3,{children:"Step 3: Try filtering with exact phrase (substring match)"}),`
`,C.jsx(e.p,{children:`Now, let's try to filter the descriptions to find entries that contain the exact phrase "host colonies."
Qdrant supports text filtering by default using exact matches, but note that this will not tokenize the text.`}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/star_charts/points/scroll
{
"filter": {
"must": [
{
"key": "description",
"match": {
"text": "host colonies"
}
}
]
},
"limit": 2,
"with_payload": true
}
`})}),`
`,C.jsx(e.p,{children:"You’ll notice this filter works, but if you change the phrase slightly, it won’t return results, since substring matching in unindexed text isn’t flexible enough for variations."}),`
`,C.jsxs(e.p,{children:[C.jsx(e.strong,{children:"Note"}),": If your cluster is running on Qdrant Cloud, this query fails. On Qdrant Cloud, collections are configured to run in strict mode by default, which prevents querying unindexed fields. You'll learn how to index a field for text filtering next."]}),`
`,C.jsx(e.h3,{children:"Step 4: Index the description field"}),`
`,C.jsxs(e.p,{children:["To make filtering more powerful and flexible, we’ll index the ",C.jsx(e.code,{children:"description"}),' field. This will tokenize the text, allowing for more complex queries such as filtering for phrases like "cave colonies." We use a ',C.jsx(e.code,{children:"word"})," tokenizer, and only tokens that are between 5 and 20 characters will be indexed."]}),`
`,C.jsxs(e.p,{children:[C.jsx(e.strong,{children:"Note:"})," You should always index a field before filtering. If you use filtering before you create an index (like in Step 3), Qdrant will search through the entire dataset in an unstructured way. Your search performance will be very slow."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/star_charts/index
{
"field_name": "description",
"field_schema": {
"type": "text",
"tokenizer": "word",
"lowercase": true
}
}
`})}),`
`,C.jsx(e.h3,{children:"Step 5: Try the filter again"}),`
`,C.jsx(e.p,{children:`After indexing, you can now run the filter again, but this time not searching for a phrase.
Now you will filter for all tokens "caves" AND "colonies" from the descriptions.`}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/star_charts/points/scroll
{
"filter": {
"must": [
{
"key": "description",
"match": {
"text": "caves colonies"
}
}
]
},
"limit": 2,
"with_payload": true
}
`})}),`
`,C.jsx(e.h2,{children:"Summary"}),`
`,C.jsx(e.p,{children:"Full text filtering on an unindexed field performs a substring match by default, or results in an error on collections running in strict mode (the default on Qdrant Cloud). It's a best practice to index the field first. This enables more advanced full text queries, such as queries that ignore the word sequence completely."})]})}function $qt(i={}){const{wrapper:e}=i.components||{};return e?C.jsx(e,Object.assign({},i,{children:C.jsx(jSe,i)})):jSe(i)}const zqt=Object.freeze(Object.defineProperty({__proto__:null,default:$qt,title:Wqt},Symbol.toStringTag,{value:"Module"})),Vqt="Multivector Search";function WSe(i){const e=Object.assign({h1:"h1",p:"p",h2:"h2",pre:"pre",code:"code"},i.components);return C.jsxs(C.Fragment,{children:[C.jsx(e.h1,{children:"Search with ColBERT Multivectors"}),`
`,C.jsx(e.p,{children:"In Qdrant, multivectors allow you to store and search multiple vectors for each point in your collection. Additionally, you can store payloads, which are key-value pairs containing metadata about each point. This tutorial will show you how to create a collection, insert points with multivectors and payloads, and perform a search."}),`
`,C.jsx(e.h2,{children:"Step 1: Create a collection with multivectors"}),`
`,C.jsx(e.p,{children:"To use multivectors, you need to configure your collection to store multiple vectors per point. The collection’s configuration specifies the vector size, distance metric, and multivector settings, such as the comparator function."}),`
`,C.jsx(e.p,{children:"Run the following request to create a collection with multivectors:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/multivector_collection
{
"vectors": {
"size": 4,
"distance": "Dot",
"multivector_config": {
"comparator": "max_sim"
}
}
}
`})}),`
`,C.jsx(e.h2,{children:"Step 2: Insert points with multivectors and payloads"}),`
`,C.jsx(e.p,{children:"Now that the collection is set up, you can insert points where each point contains multiple vectors and a payload. Payloads store additional metadata, such as the planet name and its type."}),`
`,C.jsx(e.p,{children:"Run the following request to insert points with multivectors and payloads:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/multivector_collection/points
{
"points": [
{
"id": 1,
"vector": [
[-0.013, 0.020, -0.007, -0.111],
[-0.030, -0.015, 0.021, 0.072],
[0.041, -0.004, 0.032, 0.062]
],
"payload": {
"name": "Mars",
"type": "terrestrial"
}
},
{
"id": 2,
"vector": [
[0.011, -0.050, 0.007, 0.101],
[0.031, 0.014, -0.032, 0.012]
],
"payload": {
"name": "Jupiter",
"type": "gas giant"
}
},
{
"id": 3,
"vector": [
[0.041, 0.034, -0.012, -0.022],
[0.040, -0.095, 0.021, 0.032],
[-0.030, 0.025, 0.011, 0.082],
[0.021, -0.044, 0.032, -0.032]
],
"payload": {
"name": "Venus",
"type": "terrestrial"
}
},
{
"id": 4,
"vector": [
[-0.015, 0.020, 0.045, -0.131],
[0.041, -0.024, -0.032, 0.072]
],
"payload": {
"name": "Neptune",
"type": "ice giant"
}
}
]
}
`})}),`
`,C.jsx(e.h2,{children:"Step 3: Query the collection"}),`
`,C.jsxs(e.p,{children:["To perform a search with multivectors, you can pass multiple query vectors. Qdrant will compare the query vectors against the multivectors and return the most similar results based on the comparator defined for the collection (",C.jsx(e.code,{children:"max_sim"}),"). You can also request the payloads to be returned along with the search results."]}),`
`,C.jsx(e.p,{children:"Run the following request to search with multivectors and retrieve the payloads:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST collections/multivector_collection/points/query
{
"query": [
[-0.015, 0.020, 0.045, -0.131],
[0.030, -0.005, 0.001, 0.022],
[0.041, -0.024, -0.032, 0.072]
],
"with_payload": true
}
`})})]})}function Hqt(i={}){const{wrapper:e}=i.components||{};return e?C.jsx(e,Object.assign({},i,{children:C.jsx(WSe,i)})):WSe(i)}const Uqt=Object.freeze(Object.defineProperty({__proto__:null,default:Hqt,title:Vqt},Symbol.toStringTag,{value:"Module"})),qqt="Sparse Vectors";function $Se(i){const e=Object.assign({h1:"h1",p:"p",h2:"h2",code:"code",pre:"pre",h3:"h3",ul:"ul",li:"li",strong:"strong",hr:"hr"},i.components);return C.jsxs(C.Fragment,{children:[C.jsx(e.h1,{children:"Sparse Vector Search"}),`
`,C.jsx(e.p,{children:"In this tutorial, you'll learn how to create a collection with sparse vectors in Qdrant, insert points with sparse vectors, and query them based on specific indices and values. Sparse vectors allow you to efficiently store and search data with only certain dimensions being non-zero, which is particularly useful in applications like text embeddings or handling sparse data."}),`
`,C.jsx(e.h2,{children:"Step 1: Create a collection with sparse vectors"}),`
`,C.jsxs(e.p,{children:["The first step is to create a collection that can handle sparse vectors. Unlike dense vectors that represent full feature spaces, sparse vectors only store non-zero values in select positions, making them more efficient. We’ll create a collection called ",C.jsx(e.code,{children:"sparse_charts"})," where each point will have sparse vectors to represent keywords or other features."]}),`
`,C.jsx(e.p,{children:"Run the following request to create the collection:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/sparse_charts
{
"sparse_vectors": {
"keywords": {}
}
}
`})}),`
`,C.jsx(e.h3,{children:"Explanation:"}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:C.jsx(e.code,{children:"sparse_vectors"})}),': Defines that the collection supports sparse vectors, in this case, indexed by "keywords." This can represent keyword-based features where only certain indices (positions) have non-zero values.']}),`
`]}),`
`,C.jsx(e.hr,{}),`
`,C.jsx(e.h2,{children:"Step 2: Insert data points with sparse vectors"}),`
`,C.jsx(e.p,{children:"Once the collection is ready, you can insert points with sparse vectors. Each point will include:"}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:[C.jsx(e.code,{children:"indices"}),": The positions of non-zero values in the vector space."]}),`
`,C.jsxs(e.li,{children:[C.jsx(e.code,{children:"values"}),": The corresponding values at those positions, representing the importance or weight of each keyword or feature."]}),`
`]}),`
`,C.jsx(e.p,{children:"Run the following request to insert the points:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/sparse_charts/points
{
"points": [
{
"id": 1,
"vector": {
"keywords": {
"indices": [1, 42],
"values": [0.22, 0.8]
}
}
},
{
"id": 2,
"vector": {
"keywords": {
"indices": [2, 35],
"values": [0.15, 0.65]
}
}
},
{
"id": 3,
"vector": {
"keywords": {
"indices": [10, 42],
"values": [0.3, 0.5]
}
}
},
{
"id": 4,
"vector": {
"keywords": {
"indices": [0, 3],
"values": [0.4, 0.3]
}
}
},
{
"id": 5,
"vector": {
"keywords": {
"indices": [2, 4],
"values": [0.9, 0.8]
}
}
}
]
}
`})}),`
`,C.jsx(e.h3,{children:"Explanation:"}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsx(e.li,{children:"Each point is represented by its sparse vector, defined with specific keyword indices and values."}),`
`,C.jsxs(e.li,{children:["For example, ",C.jsx(e.strong,{children:"Point 1"})," has sparse vector values of ",C.jsx(e.code,{children:"0.22"})," and ",C.jsx(e.code,{children:"0.8"})," at positions ",C.jsx(e.code,{children:"1"})," and ",C.jsx(e.code,{children:"42"}),", respectively. These could represent the relative importance of keywords associated with those positions."]}),`
`]}),`
`,C.jsx(e.hr,{}),`
`,C.jsx(e.h2,{children:"Run a query with specific indices and values"}),`
`,C.jsxs(e.p,{children:["This query searches for points that have non-zero values at the positions ",C.jsx(e.code,{children:"[1, 42]"})," and specific values ",C.jsx(e.code,{children:"[0.22, 0.8]"}),". This is a targeted query and expects a close match to these indices and values."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/sparse_charts/points/query
{
"query": {
"indices": [1, 42],
"values": [0.22, 0.8]
},
"using": "keywords"
}
`})}),`
`,C.jsxs(e.p,{children:[C.jsx(e.strong,{children:"Expected result:"})," ",C.jsx(e.strong,{children:"Point 1"})," would be the best match since its sparse vector includes these indices that maximize the measure of similarity. In this case, this is the dot product calculation."]}),`
`,C.jsx(e.hr,{}),`
`,C.jsx(e.h2,{children:"Breaking down the scoring mechanism"}),`
`,C.jsxs(e.p,{children:["This query searches for points with non-zero values at positions ",C.jsx(e.code,{children:"[0, 2, 4]"})," and values ",C.jsx(e.code,{children:"[0.4, 0.9, 0.8]"}),". It’s a broader search that might return multiple matches with overlapping indices and similar values."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/sparse_charts/points/query
{
"query": {
"indices": [0, 2, 4],
"values": [0.4, 0.9, 0.8]
},
"using": "keywords"
}
`})}),`
`,C.jsx(e.hr,{}),`
`,C.jsx(e.h2,{children:"How we got this result:"}),`
`,C.jsxs(e.p,{children:["Let's assume the sparse vectors of ",C.jsx(e.strong,{children:"Point 4"})," and ",C.jsx(e.strong,{children:"Point 5"})," are as follows:"]}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:"Point 4"}),": ",C.jsx(e.code,{children:"[0.4, 0, 0, 0, 0]"})," (Matches query at index 0 with value 0.4)"]}),`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:"Point 5"}),": ",C.jsx(e.code,{children:"[0, 0, 0.9, 0, 0.8]"})," (Matches query at indices 2 and 4 with values 0.9 and 0.8)"]}),`
`]}),`
`,C.jsx(e.p,{children:"The dot product would look something like:"}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:[`
`,C.jsxs(e.p,{children:[C.jsx(e.strong,{children:"Dot product for Point 4"}),":"]}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:["Query: ",C.jsx(e.code,{children:"[0.4, 0, 0.9, 0, 0.8]"})]}),`
`,C.jsxs(e.li,{children:["Point 4: ",C.jsx(e.code,{children:"[0.4, 0, 0, 0, 0]"})]}),`
`,C.jsx(e.li,{children:"Dot product: ( 0.4 * 0.4 = 0.16 )"}),`
`]}),`
`]}),`
`,C.jsxs(e.li,{children:[`
`,C.jsxs(e.p,{children:[C.jsx(e.strong,{children:"Dot product for Point 5"}),":"]}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:["Query: ",C.jsx(e.code,{children:"[0.4, 0, 0.9, 0, 0.8]"})]}),`
`,C.jsxs(e.li,{children:["Point 5: ",C.jsx(e.code,{children:"[0, 0, 0.9, 0, 0.8]"})]}),`
`,C.jsx(e.li,{children:"Dot product: ( 0.9 * 0.9 + 0.8 * 0.8 = 0.81 + 0.64 = 1.45 )"}),`
`]}),`
`]}),`
`]}),`
`,C.jsxs(e.p,{children:["Since ",C.jsx(e.strong,{children:"Point 5"})," has a higher dot product score, it would be considered a better match than ",C.jsx(e.strong,{children:"Point 4"}),"."]})]})}function Kqt(i={}){const{wrapper:e}=i.components||{};return e?C.jsx(e,Object.assign({},i,{children:C.jsx($Se,i)})):$Se(i)}const Gqt=Object.freeze(Object.defineProperty({__proto__:null,default:Kqt,title:qqt},Symbol.toStringTag,{value:"Module"})),Xqt="Hybrid Search";function zSe(i){const e=Object.assign({h1:"h1",p:"p",code:"code",h2:"h2",pre:"pre",h3:"h3",ul:"ul",li:"li",strong:"strong",hr:"hr",ol:"ol"},i.components);return C.jsxs(C.Fragment,{children:[C.jsx(e.h1,{children:"Hybrid Search with Sparse and Dense Vectors"}),`
`,C.jsxs(e.p,{children:[`In this tutorial, we will continue to explore hybrid search in Qdrant, focusing on both sparse and dense vectors.
This time, we will work with a collection related to `,C.jsx(e.code,{children:"terraforming_plans"}),", and each data point will have a brief description of its content in the ",C.jsx(e.code,{children:"payload"}),"."]}),`
`,C.jsx(e.h2,{children:"Step 1: Create a collection with sparse vectors"}),`
`,C.jsxs(e.p,{children:["We'll start by creating a collection named ",C.jsx(e.code,{children:"terraforming_plans"}),". This collection will support both dense vectors for semantic similarity and sparse vectors for keyword-based search."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/terraforming_plans
{
"vectors": {
"size": 4,
"distance": "Cosine"
},
"sparse_vectors": {
"keywords": { }
}
}
`})}),`
`,C.jsx(e.h3,{children:"Explanation:"}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:C.jsx(e.code,{children:"vectors"})}),": Configures the dense vector space with 4 dimensions, using cosine similarity for distance measurement."]}),`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:C.jsx(e.code,{children:"sparse_vectors"})}),": Configures the collection to support sparse vectors for keyword-based indexing."]}),`
`]}),`
`,C.jsx(e.hr,{}),`
`,C.jsx(e.h2,{children:"Step 2: Insert data points with descriptions"}),`
`,C.jsxs(e.p,{children:["Now, we'll insert three data points into the ",C.jsx(e.code,{children:"terraforming_plans"})," collection, each related to a different celestial body (Mars, Jupiter, and Venus). Each point will have both a dense and sparse vector, along with a ",C.jsx(e.code,{children:"description"})," in the ",C.jsx(e.code,{children:"payload"}),"."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/terraforming_plans/points
{
"points": [
{
"id": 1,
"vector": {
"": [0.02, 0.4, 0.5, 0.9], // Dense vector
"keywords": {
"indices": [1, 42], // Sparse for "rocky" and "Mars"
"values": [0.22, 0.8] // Weights for these keywords
}
},
"payload": {
"description": "Plans about Mars colonization."
}
},
{
"id": 2,
"vector": {
"": [0.3, 0.1, 0.6, 0.4],
"keywords": {
"indices": [2, 35], // Sparse for "gas giant" and "icy"
"values": [0.15, 0.65] // Weights for these keywords
}
},
"payload": {
"description": "Study on Jupiter gas composition."
}
},
{
"id": 3,
"vector": {
"": [0.7, 0.5, 0.3, 0.8],
"keywords": {
"indices": [10, 42], // Sparse for "Venus" and "rocky"
"values": [0.3, 0.5] // Weights for these keywords
}
},
"payload": {
"description": "Venus geological terrain analysis."
}
}
]
}
`})}),`
`,C.jsx(e.h3,{children:"Explanation:"}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:"Dense vector"}),": Represents the semantic features of the data point in a numerical form."]}),`
`,C.jsxs(e.li,{children:[C.jsxs(e.strong,{children:["Sparse vector (",C.jsx(e.code,{children:"keywords"}),")"]}),": Represents the keyword features, with ",C.jsx(e.code,{children:"indices"})," mapped to specific keywords and ",C.jsx(e.code,{children:"values"})," representing their relevance."]}),`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:C.jsx(e.code,{children:"payload"})}),": Provides a short description of the data point's content, making it easier to understand what each vector represents."]}),`
`]}),`
`,C.jsx(e.hr,{}),`
`,C.jsx(e.h2,{children:"Step 3: Perform a hybrid search"}),`
`,C.jsxs(e.p,{children:["Next, perform a hybrid search on the ",C.jsx(e.code,{children:"terraforming_plans"})," collection, combining both keyword-based (sparse) and semantic (dense) search using Reciprocal Rank Fusion (RRF)."]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/terraforming_plans/points/query
{
"prefetch": [
{
"query": {
"indices": [1, 42],
"values": [0.22, 0.8]
},
"using": "keywords",
"limit": 20
},
{
"query": [0.01, 0.45, 0.67, 0.89],
"using": "",
"limit": 20
}
],
"query": { "fusion": "rrf" }, // Reciprocal rank fusion
"limit": 10,
"with_payload": true
}
`})}),`
`,C.jsx(e.h3,{children:"Explanation:"}),`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:C.jsx(e.code,{children:"prefetch"})}),": Contains two subqueries:",`
`,C.jsxs(e.ul,{children:[`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:"Keyword-based query"}),": Uses the sparse vector (keywords) to search by keyword relevance."]}),`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:"Dense vector query"}),": Uses the dense vector for semantic similarity search."]}),`
`]}),`
`]}),`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:C.jsx(e.code,{children:"fusion: rrf"})}),": Combines the results from both queries using Reciprocal Rank Fusion (RRF), giving priority to points ranked highly in both searches."]}),`
`,C.jsxs(e.li,{children:[C.jsx(e.strong,{children:C.jsx(e.code,{children:"limit"})}),": Limits the number of results to the top 10."]}),`
`]}),`
`,C.jsx(e.hr,{}),`
`,C.jsx(e.h2,{children:"Summary"}),`
`,C.jsx(e.p,{children:"In this tutorial, we:"}),`
`,C.jsxs(e.ol,{children:[`
`,C.jsxs(e.li,{children:["Created a Qdrant collection called ",C.jsx(e.code,{children:"terraforming_plans"})," that supports hybrid search using both dense and sparse vectors."]}),`
`,C.jsx(e.li,{children:"Inserted data points with both dense and sparse vectors, as well as descriptions in the payload."}),`
`,C.jsx(e.li,{children:"Performed a hybrid search combining keyword relevance and dense vector similarity using Reciprocal Rank Fusion."}),`
`]}),`
`,C.jsx(e.p,{children:"This approach allows for effective hybrid search, combining textual and semantic search capabilities, which can be highly useful in applications involving complex search requirements."})]})}function Yqt(i={}){const{wrapper:e}=i.components||{};return e?C.jsx(e,Object.assign({},i,{children:C.jsx(zSe,i)})):zSe(i)}const Zqt=Object.freeze(Object.defineProperty({__proto__:null,default:Yqt,title:Xqt},Symbol.toStringTag,{value:"Module"})),Qqt="Multitenancy";function VSe(i){const e=Object.assign({h1:"h1",p:"p",h2:"h2",strong:"strong",pre:"pre",code:"code"},i.components);return C.jsxs(C.Fragment,{children:[C.jsx(e.h1,{children:"Separate User Data in Multitenant Setups"}),`
`,C.jsx(e.p,{children:"In this tutorial, we will cover how to implement multitenancy in Qdrant. Multitenancy allows you to host multiple tenants or clients within a single instance of Qdrant, ensuring data isolation and access control between tenants. This feature is essential for use cases where you need to serve different clients while maintaining separation of their data."}),`
`,C.jsx(e.h2,{children:"Step 1: Create a collection"}),`
`,C.jsxs(e.p,{children:["Imagine you are running a recommendation service where different departments (tenants) store their data in Qdrant. By using ",C.jsx(e.strong,{children:"payload-based multitenancy"}),", you can keep all tenants’ data in a single collection but filter the data based on a unique tenant identifier."]}),`
`,C.jsx(e.p,{children:"Run the following request to create a shared collection for all tenants:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT collections/central_library
{
"vectors": {
"size": 4,
"distance": "Dot"
}
}
`})}),`
`,C.jsx(e.h2,{children:"Step 2: Build a tenant index"}),`
`,C.jsx(e.p,{children:"Qdrant supports efficient indexing based on the tenant's identifier to optimize multitenant searches. By enabling tenant indexing, you can structure data on disk for faster tenant-specific searches, improving performance and reducing disk reads."}),`
`,C.jsxs(e.p,{children:["Run the following request to enable indexing for the tenant identifier (",C.jsx(e.code,{children:"group_id"}),"):"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/central_library/index
{
"field_name": "group_id",
"field_schema": {
"type": "keyword",
"is_tenant": true
}
}
`})}),`
`,C.jsx(e.h2,{children:"Step 3: Load vectors for tenants"}),`
`,C.jsxs(e.p,{children:["Next, you will load data into the shared collection. Each data point is tagged with a tenant-specific identifier in the payload. This identifier (",C.jsx(e.code,{children:"group_id"}),") ensures that tenants' data remains isolated even when stored in the same collection."]}),`
`,C.jsx(e.p,{children:"Run the following request to insert data points:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/central_library/points
{
"points": [
{
"id": 1,
"vector": [0.1, 0.2, 0.3, 0.4],
"payload": {
"group_id": "user_1",
"station": "Communications",
"message_log": "Contact with colony headquarters."
}
},
{
"id": 2,
"vector": [0.5, 0.6, 0.7, 0.8],
"payload": {
"group_id": "user_2",
"station": "Security",
"message_log": "Monitor intruder alert system."
}
},
{
"id": 3,
"vector": [0.9, 1.0, 1.1, 1.2],
"payload": {
"group_id": "user_3",
"station": "Engineering",
"message_log": "Repair warp core malfunction."
}
}
]
}
`})}),`
`,C.jsx(e.h2,{children:"Step 4: Perform a filtered query"}),`
`,C.jsxs(e.p,{children:["When querying the shared collection, use the ",C.jsx(e.code,{children:"group_id"})," payload field to ensure tenants can only access their own data. The filter in this query ensures that only points belonging to the specified ",C.jsx(e.code,{children:"group_id"})," are returned."]}),`
`,C.jsxs(e.p,{children:["Run the following request to search for data specific to ",C.jsx(e.code,{children:"user_1"}),":"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/central_library/points/query
{
"query": [0.2, 0.1, 0.9, 0.7],
"filter": {
"must": [
{
"key": "group_id",
"match": {
"value": "user_1"
}
}
]
},
"limit": 2,
"with_payload": true
}
`})}),`
`,C.jsx(e.h2,{children:"Step 5: Add more data"}),`
`,C.jsxs(e.p,{children:["If needed, you can add more data points for multiple tenants. This example shows how to expand the collection with new points tagged with different ",C.jsx(e.code,{children:"group_id"})," values:"]}),`
`,C.jsxs("details",{open:!0,children:[C.jsx("summary",{children:"Add more data"}),C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/central_library/points
{
"points": [
{
"id": 4,
"vector": [0.89, 0.95, 1.03, 0.99],
"payload": {
"group_id": "user_4",
"station": "Medical",
"message_log": "Prepare medical supplies."
}
},
{
"id": 5,
"vector": [0.82, 0.87, 0.83, 0.88],
"payload": {
"group_id": "user_5",
"station": "Operations",
"message_log": "Schedule maintenance for the day."
}
},
{
"id": 6,
"vector": [0.91, 1.05, 0.96, 0.90],
"payload": {
"group_id": "user_1",
"station": "Communications",
"message_log": "Dispatch signal to rescue team."
}
},
{
"id": 7,
"vector": [0.78, 0.86, 0.84, 0.81],
"payload": {
"group_id": "user_2",
"station": "Security",
"message_log": "Check perimeter for breaches."
}
},
{
"id": 8,
"vector": [1.04, 0.97, 1.01, 0.93],
"payload": {
"group_id": "user_3",
"station": "Engineering",
"message_log": "Run diagnostics on the shield generator."
}
}
]
}
`})})]}),`
`,C.jsx(e.h2,{children:"Step 6: Group query results"}),`
`,C.jsxs(e.p,{children:["You can group query results by specific fields, such as ",C.jsx(e.code,{children:"group_id"}),", to get an overview of each tenant's data. This query groups results by ",C.jsx(e.code,{children:"group_id"})," and limits the number of groups and the number of points per group."]}),`
`,C.jsxs(e.p,{children:["Run the following request to group the results by ",C.jsx(e.code,{children:"group_id"}),":"]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/central_library/points/query/groups
{
"query": [0.01, 0.45, 0.6, 0.88],
"group_by": "group_id",
"limit": 5,
"group_size": 5,
"with_payload": true
}
`})})]})}function Jqt(i={}){const{wrapper:e}=i.components||{};return e?C.jsx(e,Object.assign({},i,{children:C.jsx(VSe,i)})):VSe(i)}const eKt=Object.freeze(Object.defineProperty({__proto__:null,default:Jqt,title:Qqt},Symbol.toStringTag,{value:"Module"})),tKt="Load Content";function HSe(i){const e=Object.assign({h1:"h1",p:"p",h2:"h2",code:"code",pre:"pre",h3:"h3",a:"a"},i.components);return C.jsxs(C.Fragment,{children:[C.jsx(e.h1,{children:"Load Data into a Collection from a Remote Snapshot"}),`
`,C.jsx(e.p,{children:"In this tutorial, we will guide you through loading data into a Qdrant collection from a remote snapshot."}),`
`,C.jsx(e.h2,{children:"Step 1: Import a snapshot to a collection"}),`
`,C.jsxs(e.p,{children:["To start, create the collection ",C.jsx(e.code,{children:"midjourney"}),` and load vector data into it.
The collection will take on the parameters of the snapshot, with vector size of 512, and similarity measured using the Cosine distance.`]}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`PUT /collections/midjourney/snapshots/recover
{
"location": "http://snapshots.qdrant.io/midlib.snapshot"
}
`})}),`
`,C.jsxs(e.p,{children:["Wait a few moments while the vectors from the snapshot are added to the ",C.jsx(e.code,{children:"midjourney"})," collection."]}),`
`,C.jsx(e.h2,{children:"Step 2: Verify the data upload"}),`
`,C.jsx(e.p,{children:"After the data has been imported, it's important to verify that it has been successfully uploaded. You can do this by checking the number of vectors (or points) in the collection."}),`
`,C.jsx(e.p,{children:"Run the following request to get the vector count:"}),`
`,C.jsx(e.pre,{children:C.jsx(e.code,{className:"language-json",withRunButton:"true",children:`POST /collections/midjourney/points/count
`})}),`
`,C.jsx(e.p,{children:"The collection should contain 5,417 data points."}),`
`,C.jsx(e.h3,{children:"Step 3: Open the collection UI"}),`
`,C.jsxs(e.p,{children:["You can also ",C.jsx(e.a,{href:"/dashboard#/collections/midjourney/",children:"inspect your collection"})," to review the uploaded data."]})]})}function nKt(i={}){const{wrapper:e}=i.components||{};return e?C.jsx(e,Object.assign({},i,{children:C.jsx(HSe,i)})):HSe(i)}const iKt=Object.freeze(Object.defineProperty({__proto__:null,default:nKt,title:tKt},Symbol.toStringTag,{value:"Module"})),l3e=[["quickstart",Nqt],["loadcontent",iKt],["filteringbeginner",Oqt],["filteringadvanced",jqt],["filteringfulltext",zqt],["multivectors",Uqt],["sparsevectors",Gqt],["hybridsearch",Zqt],["multitenancy",eKt]],rKt=()=>{const{pageSlug:i}=V1(),e=[...l3e.map(a=>a[0])];let n=e.indexOf(i);const r=z1(),s=()=>{n>0?(n=n-1,r(`/tutorial/${e[n]}`)):(n=0,r("/tutorial")),window.scrollTo(0,0)},o=()=>{n<e.length-1&&(n=n+1,r(`/tutorial/${e[n]}`)),window.scrollTo(0,0)};return C.jsx(Ye,{my:5,children:C.jsxs(ln,{container:!0,mt:4,spacing:1,justifyContent:"space-between",children:[C.jsx(ln,{children:n>=0&&C.jsx(Ci,{sx:{alignItems:"flex-start"},onClick:s,startIcon:C.jsx(hV,{}),children:"Previous"})}),C.jsx(ln,{children:n<e.length-1&&C.jsx(Ci,{sx:{alignItems:"flex-start"},onClick:o,endIcon:C.jsx(TMt,{}),children:"Next"})})]})})},c3e=({pageSlug:i})=>{const e=Wv(),n=nn.useRef(null);$.useEffect(()=>{window.Prism=bt,(async()=>await zt(()=>import("./prism-json-xwnKirkR.js"),[]))()},[]),$.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[e]);let r;try{r=l3e.find(s=>s[0]===i)[1].default}catch(s){console.error(s)}return C.jsxs(Ye,{sx:{maxWidth:"840px",margin:"auto"},children:[C.jsx(r,{components:Iqt}),C.jsx(rKt,{pageSlug:i})]})};c3e.propTypes={pageSlug:Z.string};const sKt=()=>{const{pageSlug:i}=V1(),{isRestricted:e}=Ur();return e?C.jsx(Ye,{sx:{p:5,width:"100%"},children:C.jsx(ln,{size:12,children:C.jsx(l_,{severity:"warning",children:"Access Denied: Because of the serverless mode, tutorial will not work here properly. Please contact your administrator."})})}):C.jsx(iT,{children:C.jsx(c3e,{pageSlug:i})})},u3e=({headers:i})=>C.jsx(C4,{children:C.jsx(ng,{children:i.map((e,n)=>C.jsx(Yc,{align:n===0?"left":n===i.length-1?"right":"center",dangerouslySetInnerHTML:{__html:e}},e))})});u3e.propTypes={headers:Z.array.isRequired};const d3e=({open:i,onClose:e,content:n,actionHandler:r,fileName:s,setImporting:o,importing:a})=>{const[l,c]=$.useState(""),[u,d]=$.useState(!1),h=()=>{if(!l){d(!0);return}r(s,l,o,a),f(),c("")},f=()=>{c(""),d(!1),e()},p=g=>{g.target.value&&u&&d(!1),c(g.target.value)};return C.jsxs(Vm,{open:i,onClose:f,fullWidth:!0,slotProps:{transition:{onEntered:()=>{const g=document.getElementById("collection-name-input");g&&g.focus()}}},children:[C.jsx(Ye,{sx:{display:"flex",p:3},children:C.jsxs("div",{children:[C.jsx(Je,{variant:"h5",children:"Import Dataset"}),C.jsx(Je,{color:"textSecondary",sx:{mt:2},variant:"body1",children:n})]})}),C.jsx(Ep,{sx:{mx:3,mb:3},id:"collection-name-input",variant:"outlined",placeholder:"Collection Name",value:l,error:u,helperText:u?"Collection name is required":"",onChange:p,onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),h())}}),C.jsxs(Ye,{sx:{display:"flex",justifyContent:"flex-end",px:3,py:3},children:[C.jsx(Ci,{sx:{mr:1},variant:"outlined",color:"inherit",onClick:f,children:"Cancel"}),C.jsx(Ci,{variant:"contained",onClick:h,disabled:!l,children:"Import Dataset"})]})]})};d3e.propTypes={open:Z.bool.isRequired,onClose:Z.func.isRequired,content:Z.string.isRequired,actionHandler:Z.func.isRequired,fileName:Z.string.isRequired,setImporting:Z.func.isRequired,importing:Z.bool.isRequired};const h3e=({dataset:i,importDataset:e})=>{const n=$i(),[r,s]=$.useState(!1),[o,a]=$.useState(!1);return C.jsxs(fk,{align:"center",children:[C.jsx(ki,{width:"50%",children:C.jsx(ua,{title:"Import Dataset",arrow:!0,placement:"top",children:C.jsxs(Ye,{sx:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",cursor:r?"default":"pointer",textDecorationThickness:"1px",textUnderlineOffset:"2px","&:hover":{textDecoration:r?"none":"underline",textDecorationThickness:"1px","& .MuiSvgIcon-root":{color:r?n.palette.divider:n.palette.primary.dark}}},onClick:()=>a(!0),children:[C.jsxs(Ye,{sx:{position:"relative"},children:[C.jsx(Ye,{sx:{display:"flex",alignItems:"center",backgroundColor:Pt(n.palette.secondary.main,.16),borderRadius:"0.5rem",padding:"0.5rem",marginRight:"0.5rem",textDecorationThickness:"1px",textUnderlineOffset:"2px","&:hover":{textDecorationThickness:"1px"}},children:C.jsx(CDe,{size:16,color:r?n.palette.divider:n.palette.secondary.main})}),r&&C.jsx(c5,{size:16,color:n.palette.secondary.main,sx:{position:"absolute",top:"50%",left:"50%",marginTop:"-8px",marginLeft:"-12px"}})]}),C.jsxs(Ye,{children:[C.jsx(Je,{variant:"body1",children:i.name}),C.jsx(Je,{variant:"body2",color:"textSecondary",children:i.description})]})]})})}),C.jsx(ki,{align:"center",children:d5e(i.size)}),C.jsx(ki,{align:"center",children:C.jsx(Qle,{collectionConfigParams:i,collectionName:i.name})}),C.jsx(ki,{align:"center",children:i.vectorCount}),C.jsx(ki,{align:"center",children:C.jsx(ua,{title:"Import Dataset",arrow:!0,placement:"top",children:C.jsx(Ci,{variant:"outlined",size:"small",startIcon:C.jsx(Ktt,{size:18}),onClick:()=>a(!0),disabled:r,children:"Import"})})}),C.jsx(d3e,{open:o,onClose:()=>a(!1),content:`Enter collection name for ${i.fileName}`,fileName:i.fileName,actionHandler:e,setImporting:s,importing:r})]},i.name)};h3e.propTypes={dataset:Z.shape({name:Z.string,vectors:Z.object,description:Z.string,vectorCount:Z.number,fileName:Z.string,size:Z.number}),importDataset:Z.func};const oKt=()=>{const i=Wv(),{isRestricted:e}=Ur(),n=i.pathname;return{isAccessDenied:e&&xet(n)}};function aKt(){const[i,e]=$.useState([]),{client:n}=Ur(),[r,s]=$.useState(!1),{enqueueSnackbar:o,closeSnackbar:a}=pu(),l=as("error",a),{version:c}=NDe(),{isAccessDenied:u}=oKt();$.useEffect(()=>{(async()=>{s(!0);try{const m=(await(await fetch("https://snapshots.qdrant.io/manifest-v1.16.0.json")).json()).filter(_=>_.version===void 0?!0:c==="???"||c===null?!1:c.includes("dev")?!0:IDe(c,_.version)>=0).map(_=>({name:_.name,fileName:_.file_name,size:_.size,vectors:_.vectors,vectorCount:_.vector_count,description:_.description}));e(m)}catch(p){o(p.message,l)}s(!1)})()},[]);const d=async(f,p,g,m)=>{if(u){o("Access denied: You do not have permission to import datasets",l);return}if(m){o("Importing in progress",l);return}else if(p){g(!0);try{await n.recoverSnapshot(p,{location:`https://snapshots.qdrant.io/${f}`}),o("Snapshot successfully imported",as("success",a,2e3))}catch(_){o(_.message,l)}finally{g(!1)}}else{o("Collection name is required",l);return}},h=i.map(f=>C.jsx(h3e,{dataset:f,importDataset:d,disabled:u},f.name));return C.jsx(C.Fragment,{children:C.jsx(iT,{children:C.jsxs(ln,{container:!0,maxWidth:"xl",width:"100%",spacing:3,children:[C.jsx(ln,{size:12,children:C.jsx(Je,{variant:"h4",children:"Datasets"})}),u&&C.jsx(ln,{size:12,children:C.jsx(l_,{severity:"warning",children:"You do not have permission to import datasets. Please contact your administrator."})}),r&&C.jsx("div",{children:"Loading..."}),!r&&(i==null?void 0:i.length)===0&&C.jsx("div",{children:"No datasets found"}),!r&&(i==null?void 0:i.length)>0&&C.jsx(ln,{size:12,children:C.jsx(w4,{children:C.jsxs(Bv,{"aria-label":"Datasets table",children:[C.jsx(u3e,{headers:["Name","Datasets&nbsp;size","Vectors Config","Vectors count","Actions"]}),C.jsx(S4,{children:h})]})})})]})})})}function lKt({validationCollection:i,matches:e,setTokenValidatior:n}){const r={collection:i,matches:Object.keys(e).map(s=>({key:s,value:e[s]}))};n(r)}const f3e=({setTokenValidatior:i})=>{const[e,n]=$.useState(!1),[r,s]=$.useState(!1),[o,a]=$.useState(null),[l,c]=$.useState([]),u=()=>{n(!1),s(!1)},[d,h]=$.useState({}),{client:f}=Ur(),[p,g]=$.useState(""),[m,_]=$.useState(""),b=()=>{r?(n(!1),i({}),s(!1)):(n(!0),s(!0))};return $.useEffect(()=>{(async()=>{c((await f.getCollections()).collections)})()},[e]),C.jsxs(Ye,{children:[C.jsx(ua,{title:"Configures validation of the token based on record stored in the collection",placement:"right",children:C.jsx(Qre,{control:C.jsx(b9,{checked:r,onChange:b}),label:"Token Validator",sx:{gap:.75}})}),C.jsxs(Vm,{fullWidth:!0,open:e,onClose:u,children:[C.jsx(tx,{children:"Token Validator"}),C.jsxs(a1,{component:"form",role:"form",children:[C.jsx(Ye,{sx:{display:"flex",gap:2,mb:2,mt:1},children:C.jsx(Ye,{sx:{display:"flex",width:"100%",flexDirection:"column",gap:1.5},role:"group",children:C.jsx(Ep,{select:!0,fullWidth:!0,id:"collection-select",value:(o==null?void 0:o.name)||"",onChange:y=>{a(y.target.value?l.find(x=>x.name===y.target.value):null)},slotProps:{select:{displayEmpty:!0,renderValue:y=>y||C.jsx(Ye,{sx:{color:"text.secondary"},children:"Select Collection"})}},children:l.map(y=>C.jsx(hf,{value:y.name,children:y.name},y.name))})})}),C.jsx(Ye,{sx:{mt:4,mb:2},children:C.jsx(Je,{variant:"h6",color:o!=null&&o.name?"textPrimary":"textSecondary",children:"Set Matches"})}),Object.keys(d).map(y=>C.jsxs(Ye,{sx:{display:"flex",gap:2,mb:2,"& > :not(:last-of-type)":{width:"40%"}},children:[C.jsx(Ep,{disabled:!0,label:"Key",value:y}),C.jsx(Ep,{disabled:!0,label:"Value",value:d[y]}),C.jsx(Ga,{"aria-label":"delete",size:"large",onClick:()=>{const x={...d};delete x[y],h(x)},children:C.jsx(_tt,{})})]},y)),C.jsxs(Ye,{sx:{display:"flex",gap:2},children:[C.jsx(Ep,{label:"Key",value:p,onChange:y=>g(y.target.value)}),C.jsx(Ep,{label:"Value",value:m,onChange:y=>_(y.target.value)}),C.jsx(Ga,{"aria-label":"delete",size:"large",onClick:()=>{h(y=>({...y,[p]:m})),g(""),_("")},disabled:!p||!m,children:C.jsx(ktt,{})})]})]}),C.jsxs(CE,{sx:{p:3},children:[C.jsx(Ci,{variant:"outlined",color:"inherit",onClick:u,children:"Cancel"}),C.jsx(Ci,{variant:"contained",onClick:()=>{lKt({validationCollection:o==null?void 0:o.name,matches:d,setTokenValidatior:i}),n(!1)},disabled:!(o!=null&&o.name)||Object.keys(d).length===0,children:"Save"})]})]})]})};f3e.propTypes={setTokenValidatior:Z.func.isRequired};const p3e=({collection:i,globalAccess:e,manageAccess:n,onChange:r})=>{const[s,o]=nn.useState(""),a=(l,c)=>{o(c),r(i,c)};return nn.useEffect(()=>{o(n?"rw":e?"r":"")},[e,n]),C.jsxs(fk,{children:[C.jsx(ki,{children:i}),C.jsx(ki,{align:"center",children:C.jsx(b9,{size:"small",checked:s==="r"||s==="rw",onChange:l=>a(l,s==="r"||s==="rw"?"":"r"),disabled:e||n})}),C.jsx(ki,{align:"center",children:C.jsx(b9,{size:"small",checked:s==="rw",onChange:l=>a(l,(()=>{if(s==="rw")return"r";if(s===""||s==="r")return"rw"})()),disabled:e||n})})]})};p3e.propTypes={collection:Z.string.isRequired,globalAccess:Z.bool.isRequired,manageAccess:Z.bool.isRequired,onChange:Z.func.isRequired};const g3e=({globalAccess:i,manageAccess:e,collections:n,setConfiguredCollections:r})=>C.jsx(w4,{children:C.jsxs(Bv,{"aria-label":"Access per Collection",children:[C.jsx(C4,{children:C.jsxs(ng,{children:[C.jsx(Yc,{width:"33%",sx:{py:2},children:"Collection Name"}),C.jsx(Yc,{width:"33%",align:"center",sx:{py:2},children:"Read"}),C.jsx(Yc,{width:"33%",align:"center",sx:{py:2},children:"Write"})]})}),C.jsx(S4,{children:n.map(s=>C.jsx(p3e,{collection:s,globalAccess:i,manageAccess:e,onChange:(o,a)=>{r(l=>l.find(u=>u.collection===o)?a===""?l.filter(u=>u.collection!==o):l.map(u=>u.collection===o?{...u,access:a}:u):a===""?l:[...l,{collection:o,access:a}])}},s))})]})});g3e.propTypes={globalAccess:Z.bool.isRequired,manageAccess:Z.bool.isRequired,collections:Z.arrayOf(Z.string).isRequired,setConfiguredCollections:Z.func.isRequired};const cKt=ye(WHe)(({theme:i})=>({borderRadius:"0.5rem",border:`1px solid ${i.palette.divider}`,"& .MuiButton-root":{padding:"0.75rem 2.5rem",borderLeft:"none",borderTop:"none",borderBottom:"none",borderRight:"none","&.MuiButton-outlined":{color:i.palette.text.primary,"&:hover":{backgroundColor:Pt(i.palette.primary.main,.04)}},"&.MuiButton-contained":{color:i.palette.primary.main,backgroundColor:Pt(i.palette.primary.main,.08),"&:hover":{backgroundColor:Pt(i.palette.primary.main,.12)}}}})),m3e=({expiration:i,setExpiration:e})=>{const n=r=>{e(r.target.value)};return C.jsxs(Ye,{sx:{display:"flex",flexDirection:"column",gap:1.5},role:"group",children:[C.jsx(RW,{htmlFor:"expiration-select",sx:{color:"text.primary",fontWeight:500},children:"Expiration"}),C.jsxs(Ep,{select:!0,fullWidth:!0,id:"expiration-select",value:i,onChange:n,slots:{input:TI},sx:{"& .MuiSelect-outlined":{py:1.5}},children:[C.jsx(hf,{value:1,children:"1 day"}),C.jsx(hf,{value:7,children:"7 days"}),C.jsx(hf,{value:30,children:"30 days"}),C.jsx(hf,{value:90,children:"90 days"}),C.jsx(hf,{value:0,children:"Never"})]})]})};m3e.propTypes={expiration:Z.number.isRequired,setExpiration:Z.func.isRequired};function _3e({expiration:i,setExpiration:e,globalAccess:n,setGlobalAccess:r,manageAccess:s,setManageAccess:o,collections:a,setConfiguredCollections:l,setTokenValidatior:c}){return C.jsxs(Ye,{sx:{display:"flex",flexDirection:"column",gap:4},role:"form",children:[C.jsxs(Ye,{sx:{display:"flex",flexDirection:"column",gap:2,py:1},children:[C.jsxs(cKt,{fullWidth:!0,variant:"outlined","aria-label":"Access Level",children:[C.jsx(Ci,{variant:!n&&!s?"contained":"outlined",onClick:()=>{o(!1),r(!1)},children:"Collection Access"}),C.jsx(Ci,{variant:n&&!s?"contained":"outlined",onClick:()=>{o(!1),r(!0),l([])},children:"Global Access"}),C.jsx(Ci,{variant:s?"contained":"outlined",onClick:()=>{o(!0),r(!0),l([])},children:"Managed Access"})]}),s&&C.jsxs(Je,{variant:"body2",color:"text.secondary",children:[C.jsx("strong",{children:"Managed Access:"})," Full access to all data stored in Qdrant. This level of access allows you to read and write data to all collections, as well as create and delete collections, modify collection settings, etc."]}),n&&!s&&C.jsxs(Je,{variant:"body2",color:"text.secondary",children:[C.jsx("strong",{children:"Global Access:"})," Allows read-only access to all data stored in Qdrant."]}),!n&&!s&&C.jsxs(Je,{variant:"body2",color:"text.secondary",children:[C.jsx("strong",{children:"Collection Access:"}),"This access level allows to configure access level for specific collections."]})]}),a.length>0&&C.jsx(g3e,{globalAccess:n,collections:a,setConfiguredCollections:l,manageAccess:s}),C.jsx(f3e,{setTokenValidatior:c}),C.jsx(m3e,{expiration:i,setExpiration:e})]})}_3e.propTypes={expiration:Z.number.isRequired,setExpiration:Z.func.isRequired,globalAccess:Z.bool.isRequired,setGlobalAccess:Z.func.isRequired,manageAccess:Z.bool.isRequired,setManageAccess:Z.func.isRequired,collections:Z.array.isRequired,setConfiguredCollections:Z.func.isRequired,setTokenValidatior:Z.func.isRequired};const Qce=crypto,v3e=i=>i instanceof CryptoKey,I2=new TextEncoder,ere=new TextDecoder;function uKt(...i){const e=i.reduce((s,{length:o})=>s+o,0),n=new Uint8Array(e);let r=0;for(const s of i)n.set(s,r),r+=s.length;return n}const dKt=i=>{let e=i;typeof e=="string"&&(e=I2.encode(e));const n=32768,r=[];for(let s=0;s<e.length;s+=n)r.push(String.fromCharCode.apply(null,e.subarray(s,s+n)));return btoa(r.join(""))},iZ=i=>dKt(i).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),hKt=i=>{const e=atob(i),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},Jce=i=>{let e=i;e instanceof Uint8Array&&(e=ere.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return hKt(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class gu extends Error{constructor(e,n){var r;super(e,n),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(r=Error.captureStackTrace)==null||r.call(Error,this,this.constructor)}}gu.code="ERR_JOSE_GENERIC";class fKt extends gu{constructor(e,n,r="unspecified",s="unspecified"){super(e,{cause:{claim:r,reason:s,payload:n}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=r,this.reason=s,this.payload=n}}fKt.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class pKt extends gu{constructor(e,n,r="unspecified",s="unspecified"){super(e,{cause:{claim:r,reason:s,payload:n}}),this.code="ERR_JWT_EXPIRED",this.claim=r,this.reason=s,this.payload=n}}pKt.code="ERR_JWT_EXPIRED";class gKt extends gu{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}gKt.code="ERR_JOSE_ALG_NOT_ALLOWED";class LS extends gu{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}}LS.code="ERR_JOSE_NOT_SUPPORTED";class mKt extends gu{constructor(e="decryption operation failed",n){super(e,n),this.code="ERR_JWE_DECRYPTION_FAILED"}}mKt.code="ERR_JWE_DECRYPTION_FAILED";class _Kt extends gu{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}}_Kt.code="ERR_JWE_INVALID";class XD extends gu{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}}XD.code="ERR_JWS_INVALID";class b3e extends gu{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}b3e.code="ERR_JWT_INVALID";class vKt extends gu{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}}vKt.code="ERR_JWK_INVALID";class bKt extends gu{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}}bKt.code="ERR_JWKS_INVALID";class yKt extends gu{constructor(e="no applicable key found in the JSON Web Key Set",n){super(e,n),this.code="ERR_JWKS_NO_MATCHING_KEY"}}yKt.code="ERR_JWKS_NO_MATCHING_KEY";class wKt extends gu{constructor(e="multiple matching keys found in the JSON Web Key Set",n){super(e,n),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}wKt.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class CKt extends gu{constructor(e="request timed out",n){super(e,n),this.code="ERR_JWKS_TIMEOUT"}}CKt.code="ERR_JWKS_TIMEOUT";class SKt extends gu{constructor(e="signature verification failed",n){super(e,n),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}SKt.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function zg(i,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${i}`)}function VA(i,e){return i.name===e}function rZ(i){return parseInt(i.name.slice(4),10)}function xKt(i){switch(i){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function kKt(i,e){if(e.length&&!e.some(n=>i.usages.includes(n))){let n="CryptoKey does not support this operation, its usages must include ";if(e.length>2){const r=e.pop();n+=`one of ${e.join(", ")}, or ${r}.`}else e.length===2?n+=`one of ${e[0]} or ${e[1]}.`:n+=`${e[0]}.`;throw new TypeError(n)}}function LKt(i,e,...n){switch(e){case"HS256":case"HS384":case"HS512":{if(!VA(i.algorithm,"HMAC"))throw zg("HMAC");const r=parseInt(e.slice(2),10);if(rZ(i.algorithm.hash)!==r)throw zg(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!VA(i.algorithm,"RSASSA-PKCS1-v1_5"))throw zg("RSASSA-PKCS1-v1_5");const r=parseInt(e.slice(2),10);if(rZ(i.algorithm.hash)!==r)throw zg(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!VA(i.algorithm,"RSA-PSS"))throw zg("RSA-PSS");const r=parseInt(e.slice(2),10);if(rZ(i.algorithm.hash)!==r)throw zg(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":{if(i.algorithm.name!=="Ed25519"&&i.algorithm.name!=="Ed448")throw zg("Ed25519 or Ed448");break}case"Ed25519":{if(!VA(i.algorithm,"Ed25519"))throw zg("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!VA(i.algorithm,"ECDSA"))throw zg("ECDSA");const r=xKt(e);if(i.algorithm.namedCurve!==r)throw zg(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}kKt(i,n)}function y3e(i,e,...n){var r;if(n=n.filter(Boolean),n.length>2){const s=n.pop();i+=`one of type ${n.join(", ")}, or ${s}.`}else n.length===2?i+=`one of type ${n[0]} or ${n[1]}.`:i+=`of type ${n[0]}.`;return e==null?i+=` Received ${e}`:typeof e=="function"&&e.name?i+=` Received function ${e.name}`:typeof e=="object"&&e!=null&&(r=e.constructor)!=null&&r.name&&(i+=` Received an instance of ${e.constructor.name}`),i}const USe=(i,...e)=>y3e("Key must be ",i,...e);function w3e(i,e,...n){return y3e(`Key for the ${i} algorithm must be `,e,...n)}const C3e=i=>v3e(i)?!0:(i==null?void 0:i[Symbol.toStringTag])==="KeyObject",qj=["CryptoKey"],DKt=(...i)=>{const e=i.filter(Boolean);if(e.length===0||e.length===1)return!0;let n;for(const r of e){const s=Object.keys(r);if(!n||n.size===0){n=new Set(s);continue}for(const o of s){if(n.has(o))return!1;n.add(o)}}return!0};function EKt(i){return typeof i=="object"&&i!==null}function S3e(i){if(!EKt(i)||Object.prototype.toString.call(i)!=="[object Object]")return!1;if(Object.getPrototypeOf(i)===null)return!0;let e=i;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}const IKt=(i,e)=>{if(i.startsWith("RS")||i.startsWith("PS")){const{modulusLength:n}=e.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${i} requires key modulusLength to be 2048 bits or larger`)}};function F4(i){return S3e(i)&&typeof i.kty=="string"}function TKt(i){return i.kty!=="oct"&&typeof i.d=="string"}function RKt(i){return i.kty!=="oct"&&typeof i.d>"u"}function AKt(i){return F4(i)&&i.kty==="oct"&&typeof i.k=="string"}function NKt(i){let e,n;switch(i.kty){case"RSA":{switch(i.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${i.alg.slice(-3)}`},n=i.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${i.alg.slice(-3)}`},n=i.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":e={name:"RSA-OAEP",hash:`SHA-${parseInt(i.alg.slice(-3),10)||1}`},n=i.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new LS('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(i.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"},n=i.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"},n=i.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"},n=i.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:"ECDH",namedCurve:i.crv},n=i.d?["deriveBits"]:[];break;default:throw new LS('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(i.alg){case"Ed25519":e={name:"Ed25519"},n=i.d?["sign"]:["verify"];break;case"EdDSA":e={name:i.crv},n=i.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:i.crv},n=i.d?["deriveBits"]:[];break;default:throw new LS('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new LS('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:n}}const MKt=async i=>{if(!i.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:e,keyUsages:n}=NKt(i),r=[e,i.ext??!1,i.key_ops??n],s={...i};return delete s.alg,delete s.use,Qce.subtle.importKey("jwk",s,...r)},x3e=i=>Jce(i);let ND,MD;const k3e=i=>(i==null?void 0:i[Symbol.toStringTag])==="KeyObject",Kj=async(i,e,n,r,s=!1)=>{let o=i.get(e);if(o!=null&&o[r])return o[r];const a=await MKt({...n,alg:r});return s&&Object.freeze(e),o?o[r]=a:i.set(e,{[r]:a}),a},PKt=(i,e)=>{if(k3e(i)){let n=i.export({format:"jwk"});return delete n.d,delete n.dp,delete n.dq,delete n.p,delete n.q,delete n.qi,n.k?x3e(n.k):(MD||(MD=new WeakMap),Kj(MD,i,n,e))}return F4(i)?i.k?Jce(i.k):(MD||(MD=new WeakMap),Kj(MD,i,i,e,!0)):i},OKt=(i,e)=>{if(k3e(i)){let n=i.export({format:"jwk"});return n.k?x3e(n.k):(ND||(ND=new WeakMap),Kj(ND,i,n,e))}return F4(i)?i.k?Jce(i.k):(ND||(ND=new WeakMap),Kj(ND,i,i,e,!0)):i},FKt={normalizePublicKey:PKt,normalizePrivateKey:OKt},YD=i=>i==null?void 0:i[Symbol.toStringTag],tre=(i,e,n)=>{var r,s;if(e.use!==void 0&&e.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(e.key_ops!==void 0&&((s=(r=e.key_ops).includes)==null?void 0:s.call(r,n))!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`);if(e.alg!==void 0&&e.alg!==i)throw new TypeError(`Invalid key for this operation, when present its alg must be ${i}`);return!0},BKt=(i,e,n,r)=>{if(!(e instanceof Uint8Array)){if(r&&F4(e)){if(AKt(e)&&tre(i,e,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!C3e(e))throw new TypeError(w3e(i,e,...qj,"Uint8Array",r?"JSON Web Key":null));if(e.type!=="secret")throw new TypeError(`${YD(e)} instances for symmetric algorithms must be of type "secret"`)}},jKt=(i,e,n,r)=>{if(r&&F4(e))switch(n){case"sign":if(TKt(e)&&tre(i,e,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(RKt(e)&&tre(i,e,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!C3e(e))throw new TypeError(w3e(i,e,...qj,r?"JSON Web Key":null));if(e.type==="secret")throw new TypeError(`${YD(e)} instances for asymmetric algorithms must not be of type "secret"`);if(n==="sign"&&e.type==="public")throw new TypeError(`${YD(e)} instances for asymmetric algorithm signing must be of type "private"`);if(n==="decrypt"&&e.type==="public")throw new TypeError(`${YD(e)} instances for asymmetric algorithm decryption must be of type "private"`);if(e.algorithm&&n==="verify"&&e.type==="private")throw new TypeError(`${YD(e)} instances for asymmetric algorithm verifying must be of type "public"`);if(e.algorithm&&n==="encrypt"&&e.type==="private")throw new TypeError(`${YD(e)} instances for asymmetric algorithm encryption must be of type "public"`)};function L3e(i,e,n,r){e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?BKt(e,n,r,i):jKt(e,n,r,i)}L3e.bind(void 0,!1);const WKt=L3e.bind(void 0,!0);function $Kt(i,e,n,r,s){if(s.crit!==void 0&&(r==null?void 0:r.crit)===void 0)throw new i('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(a=>typeof a!="string"||a.length===0))throw new i('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;n!==void 0?o=new Map([...Object.entries(n),...e.entries()]):o=e;for(const a of r.crit){if(!o.has(a))throw new LS(`Extension Header Parameter "${a}" is not recognized`);if(s[a]===void 0)throw new i(`Extension Header Parameter "${a}" is missing`);if(o.get(a)&&r[a]===void 0)throw new i(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(r.crit)}function zKt(i,e){const n=`SHA-${i.slice(-3)}`;switch(i){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:i.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:e.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:e.name};default:throw new LS(`alg ${i} is not supported either by JOSE or your javascript runtime`)}}async function VKt(i,e,n){if(e=await FKt.normalizePrivateKey(e,i),v3e(e))return LKt(e,i,n),e;if(e instanceof Uint8Array){if(!i.startsWith("HS"))throw new TypeError(USe(e,...qj));return Qce.subtle.importKey("raw",e,{hash:`SHA-${i.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(USe(e,...qj,"Uint8Array","JSON Web Key"))}const LC=i=>Math.floor(i.getTime()/1e3),D3e=60,E3e=D3e*60,eue=E3e*24,HKt=eue*7,UKt=eue*365.25,qKt=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,sZ=i=>{const e=qKt.exec(i);if(!e||e[4]&&e[1])throw new TypeError("Invalid time period format");const n=parseFloat(e[2]),r=e[3].toLowerCase();let s;switch(r){case"sec":case"secs":case"second":case"seconds":case"s":s=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":s=Math.round(n*D3e);break;case"hour":case"hours":case"hr":case"hrs":case"h":s=Math.round(n*E3e);break;case"day":case"days":case"d":s=Math.round(n*eue);break;case"week":case"weeks":case"w":s=Math.round(n*HKt);break;default:s=Math.round(n*UKt);break}return e[1]==="-"||e[4]==="ago"?-s:s},KKt=async(i,e,n)=>{const r=await VKt(i,e,"sign");IKt(i,r);const s=await Qce.subtle.sign(zKt(i,r.algorithm),r,n);return new Uint8Array(s)};class GKt{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,n){if(!this._protectedHeader&&!this._unprotectedHeader)throw new XD("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!DKt(this._protectedHeader,this._unprotectedHeader))throw new XD("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader},s=$Kt(XD,new Map([["b64",!0]]),n==null?void 0:n.crit,this._protectedHeader,r);let o=!0;if(s.has("b64")&&(o=this._protectedHeader.b64,typeof o!="boolean"))throw new XD('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:a}=r;if(typeof a!="string"||!a)throw new XD('JWS "alg" (Algorithm) Header Parameter missing or invalid');WKt(a,e,"sign");let l=this._payload;o&&(l=I2.encode(iZ(l)));let c;this._protectedHeader?c=I2.encode(iZ(JSON.stringify(this._protectedHeader))):c=I2.encode("");const u=uKt(c,I2.encode("."),l),d=await KKt(a,e,u),h={signature:iZ(d),payload:""};return o&&(h.payload=ere.decode(l)),this._unprotectedHeader&&(h.header=this._unprotectedHeader),this._protectedHeader&&(h.protected=ere.decode(c)),h}}class XKt{constructor(e){this._flattened=new GKt(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,n){const r=await this._flattened.sign(e,n);if(r.payload===void 0)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}function DC(i,e){if(!Number.isFinite(e))throw new TypeError(`Invalid ${i} input`);return e}class YKt{constructor(e={}){if(!S3e(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return typeof e=="number"?this._payload={...this._payload,nbf:DC("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:DC("setNotBefore",LC(e))}:this._payload={...this._payload,nbf:LC(new Date)+sZ(e)},this}setExpirationTime(e){return typeof e=="number"?this._payload={...this._payload,exp:DC("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:DC("setExpirationTime",LC(e))}:this._payload={...this._payload,exp:LC(new Date)+sZ(e)},this}setIssuedAt(e){return typeof e>"u"?this._payload={...this._payload,iat:LC(new Date)}:e instanceof Date?this._payload={...this._payload,iat:DC("setIssuedAt",LC(e))}:typeof e=="string"?this._payload={...this._payload,iat:DC("setIssuedAt",LC(new Date)+sZ(e))}:this._payload={...this._payload,iat:DC("setIssuedAt",e)},this}}class ZKt extends YKt{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,n){var s;const r=new XKt(I2.encode(JSON.stringify(this._payload)));if(r.setProtectedHeader(this._protectedHeader),Array.isArray((s=this._protectedHeader)==null?void 0:s.crit)&&this._protectedHeader.crit.includes("b64")&&this._protectedHeader.b64===!1)throw new b3e("JWTs MUST NOT use unencoded payload");return r.sign(e,n)}}function I3e({jwt:i,token:e,sx:n}){const[r,s]=nn.useState(!1),o=()=>{s(a=>!a)};return C.jsxs(Ye,{sx:{display:"flex",flexDirection:"column",gap:4,my:-2,...n},children:[C.jsx(Zce,{codeStr:JSON.stringify(e,null,2),language:"json",editable:!1,title:"JWT Token Payload"}),C.jsx(ua,{title:"Use this JWT token as an API key to get restricted access to the Qdrant API",children:C.jsxs(Ye,{sx:{display:"flex",flexDirection:"column"},role:"group",children:[C.jsx(RW,{htmlFor:"jwt-token-output",sx:{pb:.625},children:"JWT Token"}),C.jsx(TI,{id:"jwt-token-output",placeholder:"JWT Token",variant:"outlined",fullWidth:!0,value:r?i:"•".repeat(i.length),disabled:!0,endAdornment:C.jsxs(TW,{position:"end",children:[C.jsx(Ga,{onClick:o,children:r?C.jsx(VLe,{}):C.jsx(zLe,{})}),C.jsx(p_,{text:i,tooltip:"Copy JWT to clipboard",successMessage:"JWT copied to clipboard"})]})})]})})]})}I3e.propTypes={jwt:Z.string.isRequired,token:Z.object.isRequired,sx:Z.object};async function QKt(i,e,n){const r=await new ZKt(e).setProtectedHeader({alg:"HS256"}).sign(new TextEncoder().encode(i));n(r)}function JKt(i,e,n,r,s){const o={};return i?o.access=e?"m":"r":o.access=r,n&&(o.exp=Math.floor(Date.now()/1e3)+n*86400),s&&s.collection&&s.matches.length>0&&(o.value_exists=s),o}function eGt(){const{client:i,isRestricted:e}=Ur(),[n,r]=$.useState(null),[s,o]=$.useState(!0),[a,l]=$.useState(!1),[c,u]=$.useState(0),[d,h]=$.useState([]),[f,p]=$.useState([]),[g,m]=$.useState({}),[_,b]=$.useState(""),[y,x]=$.useState(""),k=JKt(s,a,c,f,g);return $.useEffect(()=>{_&&k&&QKt(_,k,x)},[k,_]),$.useEffect(()=>{i.getCollections().then(R=>{h(R.collections.map(E=>E.name))});const D=i.getApiKey();D||r("Please provide API key"),b(D)},[]),e?C.jsx(Ye,{sx:{p:5,width:"100%"},children:C.jsx(ln,{size:12,children:C.jsx(l_,{severity:"warning",children:"Access Denied: Because of the serverless mode, jwt tools will not work correctly. Please contact your administrator."})})}):C.jsxs(iT,{children:[n&&C.jsx(g4,{message:n}),C.jsxs(Ye,{sx:{pb:12,width:"100%",maxWidth:"900px",display:"flex",flexDirection:"column",gap:4},children:[C.jsx(Je,{variant:"h4",children:"Generate Access Token"}),C.jsx(_3e,{expiration:c,setExpiration:u,globalAccess:s,setGlobalAccess:o,manageAccess:a,setManageAccess:l,collections:d,setConfiguredCollections:p,setTokenValidatior:m}),C.jsx(I3e,{jwt:y,token:k})]})]})}const tGt=async(i,{collectionName:e,initNode:n,limit:r,filter:s,using:o,sampleLinks:a,tree:l=!1})=>{let c=[],u=[];if(a){const h=new Set;for(const f of a)u.push({source:f.a,target:f.b,score:f.score}),h.add(f.a),h.add(f.b);l&&(u=oGt(u,!0)),c=await iGt(i,{collectionName:e,pointIds:Array.from(h)})}else if(n)n.clicked=!0,c=await T3e(i,{collectionName:e,pointId:n.id,limit:r,filter:s,using:o}),u=c.map(h=>({source:n.id,target:h.id,score:h.score})),c=[n,...c];else return{nodes:[],links:[]};return{nodes:c,links:u}},T3e=async(i,{collectionName:e,pointId:n,limit:r,filter:s,using:o})=>{const{points:a}=await i.query(e,{query:n,limit:r,with_payload:!0,with_vector:!1,filter:s,using:o});return a},nGt=async(i,{collectionName:e,filter:n})=>{const{points:r}=await i.scroll(e,{limit:1,with_payload:!0,with_vector:!1,filter:n});return r.length?r[0]:null},iGt=async(i,{collectionName:e,pointIds:n})=>await i.retrieve(e,{ids:n,with_payload:!0,with_vector:!1}),rGt=async(i,{collectionName:e,filter:n,sample:r,using:s,limit:o})=>(await i.searchMatrixPairs(e,{filter:n,sample:r,using:s,limit:o})).pairs,sGt=(i,e)=>{const n=new Set(i.map(r=>r.id));return e.filter(r=>!n.has(r.id))},oGt=(i,e=!0)=>{let n=[];e?n=i.sort((c,u)=>u.score-c.score):n=i.sort((c,u)=>c.score-u.score);const r=(c,u)=>c[u]===u?u:r(c,c[u]),s=(c,u,d,h)=>{const f=r(c,d),p=r(c,h);u[f]<u[p]?c[f]=p:u[f]>u[p]?c[p]=f:(c[p]=f,u[f]++)},o={},a={},l=[];return i.forEach(c=>{o[c.source]=c.source,o[c.target]=c.target,a[c.source]=0,a[c.target]=0}),n.forEach(c=>{const u=r(o,c.source),d=r(o,c.target);u!==d&&(l.push(c),s(o,a,u,d))}),l};var nre="http://www.w3.org/1999/xhtml";const qSe={svg:"http://www.w3.org/2000/svg",xhtml:nre,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function KV(i){var e=i+="",n=e.indexOf(":");return n>=0&&(e=i.slice(0,n))!=="xmlns"&&(i=i.slice(n+1)),qSe.hasOwnProperty(e)?{space:qSe[e],local:i}:i}function aGt(i){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===nre&&e.documentElement.namespaceURI===nre?e.createElement(i):e.createElementNS(n,i)}}function lGt(i){return function(){return this.ownerDocument.createElementNS(i.space,i.local)}}function R3e(i){var e=KV(i);return(e.local?lGt:aGt)(e)}function cGt(){}function tue(i){return i==null?cGt:function(){return this.querySelector(i)}}function uGt(i){typeof i!="function"&&(i=tue(i));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s<n;++s)for(var o=e[s],a=o.length,l=r[s]=new Array(a),c,u,d=0;d<a;++d)(c=o[d])&&(u=i.call(c,c.__data__,d,o))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new Ch(r,this._parents)}function dGt(i){return i==null?[]:Array.isArray(i)?i:Array.from(i)}function hGt(){return[]}function A3e(i){return i==null?hGt:function(){return this.querySelectorAll(i)}}function fGt(i){return function(){return dGt(i.apply(this,arguments))}}function pGt(i){typeof i=="function"?i=fGt(i):i=A3e(i);for(var e=this._groups,n=e.length,r=[],s=[],o=0;o<n;++o)for(var a=e[o],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(r.push(i.call(c,c.__data__,u,a)),s.push(c));return new Ch(r,s)}function N3e(i){return function(){return this.matches(i)}}function M3e(i){return function(e){return e.matches(i)}}var gGt=Array.prototype.find;function mGt(i){return function(){return gGt.call(this.children,i)}}function _Gt(){return this.firstElementChild}function vGt(i){return this.select(i==null?_Gt:mGt(typeof i=="function"?i:M3e(i)))}var bGt=Array.prototype.filter;function yGt(){return Array.from(this.children)}function wGt(i){return function(){return bGt.call(this.children,i)}}function CGt(i){return this.selectAll(i==null?yGt:wGt(typeof i=="function"?i:M3e(i)))}function SGt(i){typeof i!="function"&&(i=N3e(i));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s<n;++s)for(var o=e[s],a=o.length,l=r[s]=[],c,u=0;u<a;++u)(c=o[u])&&i.call(c,c.__data__,u,o)&&l.push(c);return new Ch(r,this._parents)}function P3e(i){return new Array(i.length)}function xGt(){return new Ch(this._enter||this._groups.map(P3e),this._parents)}function Gj(i,e){this.ownerDocument=i.ownerDocument,this.namespaceURI=i.namespaceURI,this._next=null,this._parent=i,this.__data__=e}Gj.prototype={constructor:Gj,appendChild:function(i){return this._parent.insertBefore(i,this._next)},insertBefore:function(i,e){return this._parent.insertBefore(i,e)},querySelector:function(i){return this._parent.querySelector(i)},querySelectorAll:function(i){return this._parent.querySelectorAll(i)}};function kGt(i){return function(){return i}}function LGt(i,e,n,r,s,o){for(var a=0,l,c=e.length,u=o.length;a<u;++a)(l=e[a])?(l.__data__=o[a],r[a]=l):n[a]=new Gj(i,o[a]);for(;a<c;++a)(l=e[a])&&(s[a]=l)}function DGt(i,e,n,r,s,o,a){var l,c,u=new Map,d=e.length,h=o.length,f=new Array(d),p;for(l=0;l<d;++l)(c=e[l])&&(f[l]=p=a.call(c,c.__data__,l,e)+"",u.has(p)?s[l]=c:u.set(p,c));for(l=0;l<h;++l)p=a.call(i,o[l],l,o)+"",(c=u.get(p))?(r[l]=c,c.__data__=o[l],u.delete(p)):n[l]=new Gj(i,o[l]);for(l=0;l<d;++l)(c=e[l])&&u.get(f[l])===c&&(s[l]=c)}function EGt(i){return i.__data__}function IGt(i,e){if(!arguments.length)return Array.from(this,EGt);var n=e?DGt:LGt,r=this._parents,s=this._groups;typeof i!="function"&&(i=kGt(i));for(var o=s.length,a=new Array(o),l=new Array(o),c=new Array(o),u=0;u<o;++u){var d=r[u],h=s[u],f=h.length,p=TGt(i.call(d,d&&d.__data__,u,r)),g=p.length,m=l[u]=new Array(g),_=a[u]=new Array(g),b=c[u]=new Array(f);n(d,h,m,_,b,p,e);for(var y=0,x=0,k,D;y<g;++y)if(k=m[y]){for(y>=x&&(x=y+1);!(D=_[x])&&++x<g;);k._next=D||null}}return a=new Ch(a,r),a._enter=l,a._exit=c,a}function TGt(i){return typeof i=="object"&&"length"in i?i:Array.from(i)}function RGt(){return new Ch(this._exit||this._groups.map(P3e),this._parents)}function AGt(i,e,n){var r=this.enter(),s=this,o=this.exit();return typeof i=="function"?(r=i(r),r&&(r=r.selection())):r=r.append(i+""),e!=null&&(s=e(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function NGt(i){for(var e=i.selection?i.selection():i,n=this._groups,r=e._groups,s=n.length,o=r.length,a=Math.min(s,o),l=new Array(s),c=0;c<a;++c)for(var u=n[c],d=r[c],h=u.length,f=l[c]=new Array(h),p,g=0;g<h;++g)(p=u[g]||d[g])&&(f[g]=p);for(;c<s;++c)l[c]=n[c];return new Ch(l,this._parents)}function MGt(){for(var i=this._groups,e=-1,n=i.length;++e<n;)for(var r=i[e],s=r.length-1,o=r[s],a;--s>=0;)(a=r[s])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function PGt(i){i||(i=OGt);function e(h,f){return h&&f?i(h.__data__,f.__data__):!h-!f}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var a=n[o],l=a.length,c=s[o]=new Array(l),u,d=0;d<l;++d)(u=a[d])&&(c[d]=u);c.sort(e)}return new Ch(s,this._parents).order()}function OGt(i,e){return i<e?-1:i>e?1:i>=e?0:NaN}function FGt(){var i=arguments[0];return arguments[0]=this,i.apply(null,arguments),this}function BGt(){return Array.from(this)}function jGt(){for(var i=this._groups,e=0,n=i.length;e<n;++e)for(var r=i[e],s=0,o=r.length;s<o;++s){var a=r[s];if(a)return a}return null}function WGt(){let i=0;for(const e of this)++i;return i}function $Gt(){return!this.node()}function zGt(i){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var s=e[n],o=0,a=s.length,l;o<a;++o)(l=s[o])&&i.call(l,l.__data__,o,s);return this}function VGt(i){return function(){this.removeAttribute(i)}}function HGt(i){return function(){this.removeAttributeNS(i.space,i.local)}}function UGt(i,e){return function(){this.setAttribute(i,e)}}function qGt(i,e){return function(){this.setAttributeNS(i.space,i.local,e)}}function KGt(i,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(i):this.setAttribute(i,n)}}function GGt(i,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(i.space,i.local):this.setAttributeNS(i.space,i.local,n)}}function XGt(i,e){var n=KV(i);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?HGt:VGt:typeof e=="function"?n.local?GGt:KGt:n.local?qGt:UGt)(n,e))}function O3e(i){return i.ownerDocument&&i.ownerDocument.defaultView||i.document&&i||i.defaultView}function YGt(i){return function(){this.style.removeProperty(i)}}function ZGt(i,e,n){return function(){this.style.setProperty(i,e,n)}}function QGt(i,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(i):this.style.setProperty(i,r,n)}}function JGt(i,e,n){return arguments.length>1?this.each((e==null?YGt:typeof e=="function"?QGt:ZGt)(i,e,n??"")):LI(this.node(),i)}function LI(i,e){return i.style.getPropertyValue(e)||O3e(i).getComputedStyle(i,null).getPropertyValue(e)}function eXt(i){return function(){delete this[i]}}function tXt(i,e){return function(){this[i]=e}}function nXt(i,e){return function(){var n=e.apply(this,arguments);n==null?delete this[i]:this[i]=n}}function iXt(i,e){return arguments.length>1?this.each((e==null?eXt:typeof e=="function"?nXt:tXt)(i,e)):this.node()[i]}function F3e(i){return i.trim().split(/^|\s+/)}function nue(i){return i.classList||new B3e(i)}function B3e(i){this._node=i,this._names=F3e(i.getAttribute("class")||"")}B3e.prototype={add:function(i){var e=this._names.indexOf(i);e<0&&(this._names.push(i),this._node.setAttribute("class",this._names.join(" ")))},remove:function(i){var e=this._names.indexOf(i);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(i){return this._names.indexOf(i)>=0}};function j3e(i,e){for(var n=nue(i),r=-1,s=e.length;++r<s;)n.add(e[r])}function W3e(i,e){for(var n=nue(i),r=-1,s=e.length;++r<s;)n.remove(e[r])}function rXt(i){return function(){j3e(this,i)}}function sXt(i){return function(){W3e(this,i)}}function oXt(i,e){return function(){(e.apply(this,arguments)?j3e:W3e)(this,i)}}function aXt(i,e){var n=F3e(i+"");if(arguments.length<2){for(var r=nue(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof e=="function"?oXt:e?rXt:sXt)(n,e))}function lXt(){this.textContent=""}function cXt(i){return function(){this.textContent=i}}function uXt(i){return function(){var e=i.apply(this,arguments);this.textContent=e??""}}function dXt(i){return arguments.length?this.each(i==null?lXt:(typeof i=="function"?uXt:cXt)(i)):this.node().textContent}function hXt(){this.innerHTML=""}function fXt(i){return function(){this.innerHTML=i}}function pXt(i){return function(){var e=i.apply(this,arguments);this.innerHTML=e??""}}function gXt(i){return arguments.length?this.each(i==null?hXt:(typeof i=="function"?pXt:fXt)(i)):this.node().innerHTML}function mXt(){this.nextSibling&&this.parentNode.appendChild(this)}function _Xt(){return this.each(mXt)}function vXt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function bXt(){return this.each(vXt)}function yXt(i){var e=typeof i=="function"?i:R3e(i);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function wXt(){return null}function CXt(i,e){var n=typeof i=="function"?i:R3e(i),r=e==null?wXt:typeof e=="function"?e:tue(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function SXt(){var i=this.parentNode;i&&i.removeChild(this)}function xXt(){return this.each(SXt)}function kXt(){var i=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(i,this.nextSibling):i}function LXt(){var i=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(i,this.nextSibling):i}function DXt(i){return this.select(i?LXt:kXt)}function EXt(i){return arguments.length?this.property("__data__",i):this.node().__data__}function IXt(i){return function(e){i.call(this,e,this.__data__)}}function TXt(i){return i.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function RXt(i){return function(){var e=this.__on;if(e){for(var n=0,r=-1,s=e.length,o;n<s;++n)o=e[n],(!i.type||o.type===i.type)&&o.name===i.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function AXt(i,e,n){return function(){var r=this.__on,s,o=IXt(e);if(r){for(var a=0,l=r.length;a<l;++a)if((s=r[a]).type===i.type&&s.name===i.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=e;return}}this.addEventListener(i.type,o,n),s={type:i.type,name:i.name,value:e,listener:o,options:n},r?r.push(s):this.__on=[s]}}function NXt(i,e,n){var r=TXt(i+""),s,o=r.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(s=0,d=l[c];s<o;++s)if((a=r[s]).type===d.type&&a.name===d.name)return d.value}return}for(l=e?AXt:RXt,s=0;s<o;++s)this.each(l(r[s],e,n));return this}function $3e(i,e,n){var r=O3e(i),s=r.CustomEvent;typeof s=="function"?s=new s(e,n):(s=r.document.createEvent("Event"),n?(s.initEvent(e,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(e,!1,!1)),i.dispatchEvent(s)}function MXt(i,e){return function(){return $3e(this,i,e)}}function PXt(i,e){return function(){return $3e(this,i,e.apply(this,arguments))}}function OXt(i,e){return this.each((typeof e=="function"?PXt:MXt)(i,e))}function*FXt(){for(var i=this._groups,e=0,n=i.length;e<n;++e)for(var r=i[e],s=0,o=r.length,a;s<o;++s)(a=r[s])&&(yield a)}var z3e=[null];function Ch(i,e){this._groups=i,this._parents=e}function B4(){return new Ch([[document.documentElement]],z3e)}function BXt(){return this}Ch.prototype=B4.prototype={constructor:Ch,select:uGt,selectAll:pGt,selectChild:vGt,selectChildren:CGt,filter:SGt,data:IGt,enter:xGt,exit:RGt,join:AGt,merge:NGt,selection:BXt,order:MGt,sort:PGt,call:FGt,nodes:BGt,node:jGt,size:WGt,empty:$Gt,each:zGt,attr:XGt,style:JGt,property:iXt,classed:aXt,text:dXt,html:gXt,raise:_Xt,lower:bXt,append:yXt,insert:CXt,remove:xXt,clone:DXt,datum:EXt,on:NXt,dispatch:OXt,[Symbol.iterator]:FXt};function ff(i){return typeof i=="string"?new Ch([[document.querySelector(i)]],[document.documentElement]):new Ch([[i]],z3e)}function jXt(i){let e;for(;e=i.sourceEvent;)i=e;return i}function Jg(i,e){if(i=jXt(i),e===void 0&&(e=i.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=i.clientX,r.y=i.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var s=e.getBoundingClientRect();return[i.clientX-s.left-e.clientLeft,i.clientY-s.top-e.clientTop]}}return[i.pageX,i.pageY]}var WXt={value:()=>{}};function j4(){for(var i=0,e=arguments.length,n={},r;i<e;++i){if(!(r=arguments[i]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new t9(n)}function t9(i){this._=i}function $Xt(i,e){return i.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}t9.prototype=j4.prototype={constructor:t9,on:function(i,e){var n=this._,r=$Xt(i+"",n),s,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((s=(i=r[o]).type)&&(s=zXt(n[s],i.name)))return s;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(s=(i=r[o]).type)n[s]=KSe(n[s],i.name,e);else if(e==null)for(s in n)n[s]=KSe(n[s],i.name,null);return this},copy:function(){var i={},e=this._;for(var n in e)i[n]=e[n].slice();return new t9(i)},call:function(i,e){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(o=this._[i],r=0,s=o.length;r<s;++r)o[r].value.apply(e,n)},apply:function(i,e,n){if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(var r=this._[i],s=0,o=r.length;s<o;++s)r[s].value.apply(e,n)}};function zXt(i,e){for(var n=0,r=i.length,s;n<r;++n)if((s=i[n]).name===e)return s.value}function KSe(i,e,n){for(var r=0,s=i.length;r<s;++r)if(i[r].name===e){i[r]=WXt,i=i.slice(0,r).concat(i.slice(r+1));break}return n!=null&&i.push({name:e,value:n}),i}const VXt={passive:!1},GO={capture:!0,passive:!1};function oZ(i){i.stopImmediatePropagation()}function fE(i){i.preventDefault(),i.stopImmediatePropagation()}function V3e(i){var e=i.document.documentElement,n=ff(i).on("dragstart.drag",fE,GO);"onselectstart"in e?n.on("selectstart.drag",fE,GO):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function H3e(i,e){var n=i.document.documentElement,r=ff(i).on("dragstart.drag",null);e&&(r.on("click.drag",fE,GO),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const jB=i=>()=>i;function ire(i,{sourceEvent:e,subject:n,target:r,identifier:s,active:o,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}ire.prototype.on=function(){var i=this._.on.apply(this._,arguments);return i===this._?this:i};function HXt(i){return!i.ctrlKey&&!i.button}function UXt(){return this.parentNode}function qXt(i,e){return e??{x:i.x,y:i.y}}function KXt(){return navigator.maxTouchPoints||"ontouchstart"in this}function GXt(){var i=HXt,e=UXt,n=qXt,r=KXt,s={},o=j4("start","drag","end"),a=0,l,c,u,d,h=0;function f(k){k.on("mousedown.drag",p).filter(r).on("touchstart.drag",_).on("touchmove.drag",b,VXt).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(k,D){if(!(d||!i.call(this,k,D))){var R=x(this,e.call(this,k,D),k,D,"mouse");R&&(ff(k.view).on("mousemove.drag",g,GO).on("mouseup.drag",m,GO),V3e(k.view),oZ(k),u=!1,l=k.clientX,c=k.clientY,R("start",k))}}function g(k){if(fE(k),!u){var D=k.clientX-l,R=k.clientY-c;u=D*D+R*R>h}s.mouse("drag",k)}function m(k){ff(k.view).on("mousemove.drag mouseup.drag",null),H3e(k.view,u),fE(k),s.mouse("end",k)}function _(k,D){if(i.call(this,k,D)){var R=k.changedTouches,E=e.call(this,k,D),A=R.length,M,N;for(M=0;M<A;++M)(N=x(this,E,k,D,R[M].identifier,R[M]))&&(oZ(k),N("start",k,R[M]))}}function b(k){var D=k.changedTouches,R=D.length,E,A;for(E=0;E<R;++E)(A=s[D[E].identifier])&&(fE(k),A("drag",k,D[E]))}function y(k){var D=k.changedTouches,R=D.length,E,A;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),E=0;E<R;++E)(A=s[D[E].identifier])&&(oZ(k),A("end",k,D[E]))}function x(k,D,R,E,A,M){var N=o.copy(),P=Jg(M||R,D),O,B,j;if((j=n.call(k,new ire("beforestart",{sourceEvent:R,target:f,identifier:A,active:a,x:P[0],y:P[1],dx:0,dy:0,dispatch:N}),E))!=null)return O=j.x-P[0]||0,B=j.y-P[1]||0,function z(H,Y,X){var Q=P,ie;switch(H){case"start":s[A]=z,ie=a++;break;case"end":delete s[A],--a;case"drag":P=Jg(X||Y,D),ie=a;break}N.call(H,k,new ire(H,{sourceEvent:Y,subject:j,target:f,identifier:A,active:ie,x:P[0]+O,y:P[1]+B,dx:P[0]-Q[0],dy:P[1]-Q[1],dispatch:N}),E)}}return f.filter=function(k){return arguments.length?(i=typeof k=="function"?k:jB(!!k),f):i},f.container=function(k){return arguments.length?(e=typeof k=="function"?k:jB(k),f):e},f.subject=function(k){return arguments.length?(n=typeof k=="function"?k:jB(k),f):n},f.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:jB(!!k),f):r},f.on=function(){var k=o.on.apply(o,arguments);return k===o?f:k},f.clickDistance=function(k){return arguments.length?(h=(k=+k)*k,f):Math.sqrt(h)},f}function iue(i,e,n){i.prototype=e.prototype=n,n.constructor=i}function U3e(i,e){var n=Object.create(i.prototype);for(var r in e)n[r]=e[r];return n}function W4(){}var XO=.7,Xj=1/XO,pE="\\s*([+-]?\\d+)\\s*",YO="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",XXt=/^#([0-9a-f]{3,8})$/,YXt=new RegExp(`^rgb\\(${pE},${pE},${pE}\\)$`),ZXt=new RegExp(`^rgb\\(${Wm},${Wm},${Wm}\\)$`),QXt=new RegExp(`^rgba\\(${pE},${pE},${pE},${YO}\\)$`),JXt=new RegExp(`^rgba\\(${Wm},${Wm},${Wm},${YO}\\)$`),eYt=new RegExp(`^hsl\\(${YO},${Wm},${Wm}\\)$`),tYt=new RegExp(`^hsla\\(${YO},${Wm},${Wm},${YO}\\)$`),GSe={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};iue(W4,ZO,{copy(i){return Object.assign(new this.constructor,this,i)},displayable(){return this.rgb().displayable()},hex:XSe,formatHex:XSe,formatHex8:nYt,formatHsl:iYt,formatRgb:YSe,toString:YSe});function XSe(){return this.rgb().formatHex()}function nYt(){return this.rgb().formatHex8()}function iYt(){return q3e(this).formatHsl()}function YSe(){return this.rgb().formatRgb()}function ZO(i){var e,n;return i=(i+"").trim().toLowerCase(),(e=XXt.exec(i))?(n=e[1].length,e=parseInt(e[1],16),n===6?ZSe(e):n===3?new td(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?WB(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?WB(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=YXt.exec(i))?new td(e[1],e[2],e[3],1):(e=ZXt.exec(i))?new td(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=QXt.exec(i))?WB(e[1],e[2],e[3],e[4]):(e=JXt.exec(i))?WB(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=eYt.exec(i))?exe(e[1],e[2]/100,e[3]/100,1):(e=tYt.exec(i))?exe(e[1],e[2]/100,e[3]/100,e[4]):GSe.hasOwnProperty(i)?ZSe(GSe[i]):i==="transparent"?new td(NaN,NaN,NaN,0):null}function ZSe(i){return new td(i>>16&255,i>>8&255,i&255,1)}function WB(i,e,n,r){return r<=0&&(i=e=n=NaN),new td(i,e,n,r)}function rYt(i){return i instanceof W4||(i=ZO(i)),i?(i=i.rgb(),new td(i.r,i.g,i.b,i.opacity)):new td}function rre(i,e,n,r){return arguments.length===1?rYt(i):new td(i,e,n,r??1)}function td(i,e,n,r){this.r=+i,this.g=+e,this.b=+n,this.opacity=+r}iue(td,rre,U3e(W4,{brighter(i){return i=i==null?Xj:Math.pow(Xj,i),new td(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?XO:Math.pow(XO,i),new td(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new td(XS(this.r),XS(this.g),XS(this.b),Yj(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QSe,formatHex:QSe,formatHex8:sYt,formatRgb:JSe,toString:JSe}));function QSe(){return`#${DS(this.r)}${DS(this.g)}${DS(this.b)}`}function sYt(){return`#${DS(this.r)}${DS(this.g)}${DS(this.b)}${DS((isNaN(this.opacity)?1:this.opacity)*255)}`}function JSe(){const i=Yj(this.opacity);return`${i===1?"rgb(":"rgba("}${XS(this.r)}, ${XS(this.g)}, ${XS(this.b)}${i===1?")":`, ${i})`}`}function Yj(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function XS(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function DS(i){return i=XS(i),(i<16?"0":"")+i.toString(16)}function exe(i,e,n,r){return r<=0?i=e=n=NaN:n<=0||n>=1?i=e=NaN:e<=0&&(i=NaN),new Ap(i,e,n,r)}function q3e(i){if(i instanceof Ap)return new Ap(i.h,i.s,i.l,i.opacity);if(i instanceof W4||(i=ZO(i)),!i)return new Ap;if(i instanceof Ap)return i;i=i.rgb();var e=i.r/255,n=i.g/255,r=i.b/255,s=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,l=o-s,c=(o+s)/2;return l?(e===o?a=(n-r)/l+(n<r)*6:n===o?a=(r-e)/l+2:a=(e-n)/l+4,l/=c<.5?o+s:2-o-s,a*=60):l=c>0&&c<1?0:a,new Ap(a,l,c,i.opacity)}function oYt(i,e,n,r){return arguments.length===1?q3e(i):new Ap(i,e,n,r??1)}function Ap(i,e,n,r){this.h=+i,this.s=+e,this.l=+n,this.opacity=+r}iue(Ap,oYt,U3e(W4,{brighter(i){return i=i==null?Xj:Math.pow(Xj,i),new Ap(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?XO:Math.pow(XO,i),new Ap(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,e=isNaN(i)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,s=2*n-r;return new td(aZ(i>=240?i-240:i+120,s,r),aZ(i,s,r),aZ(i<120?i+240:i-120,s,r),this.opacity)},clamp(){return new Ap(txe(this.h),$B(this.s),$B(this.l),Yj(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=Yj(this.opacity);return`${i===1?"hsl(":"hsla("}${txe(this.h)}, ${$B(this.s)*100}%, ${$B(this.l)*100}%${i===1?")":`, ${i})`}`}}));function txe(i){return i=(i||0)%360,i<0?i+360:i}function $B(i){return Math.max(0,Math.min(1,i||0))}function aZ(i,e,n){return(i<60?e+(n-e)*i/60:i<180?n:i<240?e+(n-e)*(240-i)/60:e)*255}const K3e=i=>()=>i;function aYt(i,e){return function(n){return i+n*e}}function lYt(i,e,n){return i=Math.pow(i,n),e=Math.pow(e,n)-i,n=1/n,function(r){return Math.pow(i+r*e,n)}}function cYt(i){return(i=+i)==1?G3e:function(e,n){return n-e?lYt(e,n,i):K3e(isNaN(e)?n:e)}}function G3e(i,e){var n=e-i;return n?aYt(i,n):K3e(isNaN(i)?e:i)}const nxe=function i(e){var n=cYt(e);function r(s,o){var a=n((s=rre(s)).r,(o=rre(o)).r),l=n(s.g,o.g),c=n(s.b,o.b),u=G3e(s.opacity,o.opacity);return function(d){return s.r=a(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=i,r}(1);function ry(i,e){return i=+i,e=+e,function(n){return i*(1-n)+e*n}}var sre=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lZ=new RegExp(sre.source,"g");function uYt(i){return function(){return i}}function dYt(i){return function(e){return i(e)+""}}function hYt(i,e){var n=sre.lastIndex=lZ.lastIndex=0,r,s,o,a=-1,l=[],c=[];for(i=i+"",e=e+"";(r=sre.exec(i))&&(s=lZ.exec(e));)(o=s.index)>n&&(o=e.slice(n,o),l[a]?l[a]+=o:l[++a]=o),(r=r[0])===(s=s[0])?l[a]?l[a]+=s:l[++a]=s:(l[++a]=null,c.push({i:a,x:ry(r,s)})),n=lZ.lastIndex;return n<e.length&&(o=e.slice(n),l[a]?l[a]+=o:l[++a]=o),l.length<2?c[0]?dYt(c[0].x):uYt(e):(e=c.length,function(u){for(var d=0,h;d<e;++d)l[(h=c[d]).i]=h.x(u);return l.join("")})}var ixe=180/Math.PI,ore={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function X3e(i,e,n,r,s,o){var a,l,c;return(a=Math.sqrt(i*i+e*e))&&(i/=a,e/=a),(c=i*n+e*r)&&(n-=i*c,r-=e*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),i*r<e*n&&(i=-i,e=-e,c=-c,a=-a),{translateX:s,translateY:o,rotate:Math.atan2(e,i)*ixe,skewX:Math.atan(c)*ixe,scaleX:a,scaleY:l}}var zB;function fYt(i){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(i+"");return e.isIdentity?ore:X3e(e.a,e.b,e.c,e.d,e.e,e.f)}function pYt(i){return i==null||(zB||(zB=document.createElementNS("http://www.w3.org/2000/svg","g")),zB.setAttribute("transform",i),!(i=zB.transform.baseVal.consolidate()))?ore:(i=i.matrix,X3e(i.a,i.b,i.c,i.d,i.e,i.f))}function Y3e(i,e,n,r){function s(u){return u.length?u.pop()+" ":""}function o(u,d,h,f,p,g){if(u!==h||d!==f){var m=p.push("translate(",null,e,null,n);g.push({i:m-4,x:ry(u,h)},{i:m-2,x:ry(d,f)})}else(h||f)&&p.push("translate("+h+e+f+n)}function a(u,d,h,f){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),f.push({i:h.push(s(h)+"rotate(",null,r)-2,x:ry(u,d)})):d&&h.push(s(h)+"rotate("+d+r)}function l(u,d,h,f){u!==d?f.push({i:h.push(s(h)+"skewX(",null,r)-2,x:ry(u,d)}):d&&h.push(s(h)+"skewX("+d+r)}function c(u,d,h,f,p,g){if(u!==h||d!==f){var m=p.push(s(p)+"scale(",null,",",null,")");g.push({i:m-4,x:ry(u,h)},{i:m-2,x:ry(d,f)})}else(h!==1||f!==1)&&p.push(s(p)+"scale("+h+","+f+")")}return function(u,d){var h=[],f=[];return u=i(u),d=i(d),o(u.translateX,u.translateY,d.translateX,d.translateY,h,f),a(u.rotate,d.rotate,h,f),l(u.skewX,d.skewX,h,f),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,h,f),u=d=null,function(p){for(var g=-1,m=f.length,_;++g<m;)h[(_=f[g]).i]=_.x(p);return h.join("")}}}var gYt=Y3e(fYt,"px, ","px)","deg)"),mYt=Y3e(pYt,", ",")",")"),_Yt=1e-12;function rxe(i){return((i=Math.exp(i))+1/i)/2}function vYt(i){return((i=Math.exp(i))-1/i)/2}function bYt(i){return((i=Math.exp(2*i))-1)/(i+1)}const yYt=function i(e,n,r){function s(o,a){var l=o[0],c=o[1],u=o[2],d=a[0],h=a[1],f=a[2],p=d-l,g=h-c,m=p*p+g*g,_,b;if(m<_Yt)b=Math.log(f/u)/e,_=function(E){return[l+E*p,c+E*g,u*Math.exp(e*E*b)]};else{var y=Math.sqrt(m),x=(f*f-u*u+r*m)/(2*u*n*y),k=(f*f-u*u-r*m)/(2*f*n*y),D=Math.log(Math.sqrt(x*x+1)-x),R=Math.log(Math.sqrt(k*k+1)-k);b=(R-D)/e,_=function(E){var A=E*b,M=rxe(D),N=u/(n*y)*(M*bYt(e*A+D)-vYt(D));return[l+N*p,c+N*g,u*M/rxe(e*A+D)]}}return _.duration=b*1e3*e/Math.SQRT2,_}return s.rho=function(o){var a=Math.max(.001,+o),l=a*a,c=l*l;return i(a,l,c)},s}(Math.SQRT2,2,4);var DI=0,FN=0,HA=0,Z3e=1e3,Zj,BN,Qj=0,Vx=0,GV=0,QO=typeof performance=="object"&&performance.now?performance:Date,Q3e=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(i){setTimeout(i,17)};function rue(){return Vx||(Q3e(wYt),Vx=QO.now()+GV)}function wYt(){Vx=0}function Jj(){this._call=this._time=this._next=null}Jj.prototype=sue.prototype={constructor:Jj,restart:function(i,e,n){if(typeof i!="function")throw new TypeError("callback is not a function");n=(n==null?rue():+n)+(e==null?0:+e),!this._next&&BN!==this&&(BN?BN._next=this:Zj=this,BN=this),this._call=i,this._time=n,are()},stop:function(){this._call&&(this._call=null,this._time=1/0,are())}};function sue(i,e,n){var r=new Jj;return r.restart(i,e,n),r}function CYt(){rue(),++DI;for(var i=Zj,e;i;)(e=Vx-i._time)>=0&&i._call.call(void 0,e),i=i._next;--DI}function sxe(){Vx=(Qj=QO.now())+GV,DI=FN=0;try{CYt()}finally{DI=0,xYt(),Vx=0}}function SYt(){var i=QO.now(),e=i-Qj;e>Z3e&&(GV-=e,Qj=i)}function xYt(){for(var i,e=Zj,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),i=e,e=e._next):(n=e._next,e._next=null,e=i?i._next=n:Zj=n);BN=i,are(r)}function are(i){if(!DI){FN&&(FN=clearTimeout(FN));var e=i-Vx;e>24?(i<1/0&&(FN=setTimeout(sxe,i-QO.now()-GV)),HA&&(HA=clearInterval(HA))):(HA||(Qj=QO.now(),HA=setInterval(SYt,Z3e)),DI=1,Q3e(sxe))}}function oxe(i,e,n){var r=new Jj;return e=e==null?0:+e,r.restart(s=>{r.stop(),i(s+e)},e,n),r}var kYt=j4("start","end","cancel","interrupt"),LYt=[],J3e=0,axe=1,lre=2,n9=3,lxe=4,cre=5,i9=6;function XV(i,e,n,r,s,o){var a=i.__transition;if(!a)i.__transition={};else if(n in a)return;DYt(i,n,{name:e,index:r,group:s,on:kYt,tween:LYt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:J3e})}function oue(i,e){var n=ug(i,e);if(n.state>J3e)throw new Error("too late; already scheduled");return n}function g_(i,e){var n=ug(i,e);if(n.state>n9)throw new Error("too late; already running");return n}function ug(i,e){var n=i.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function DYt(i,e,n){var r=i.__transition,s;r[e]=n,n.timer=sue(o,0,n.time);function o(u){n.state=axe,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,h,f,p;if(n.state!==axe)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===n9)return oxe(a);p.state===lxe?(p.state=i9,p.timer.stop(),p.on.call("interrupt",i,i.__data__,p.index,p.group),delete r[d]):+d<e&&(p.state=i9,p.timer.stop(),p.on.call("cancel",i,i.__data__,p.index,p.group),delete r[d])}if(oxe(function(){n.state===n9&&(n.state=lxe,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=lre,n.on.call("start",i,i.__data__,n.index,n.group),n.state===lre){for(n.state=n9,s=new Array(f=n.tween.length),d=0,h=-1;d<f;++d)(p=n.tween[d].value.call(i,i.__data__,n.index,n.group))&&(s[++h]=p);s.length=h+1}}function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=cre,1),h=-1,f=s.length;++h<f;)s[h].call(i,d);n.state===cre&&(n.on.call("end",i,i.__data__,n.index,n.group),c())}function c(){n.state=i9,n.timer.stop(),delete r[e];for(var u in r)return;delete i.__transition}}function r9(i,e){var n=i.__transition,r,s,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}s=r.state>lre&&r.state<cre,r.state=i9,r.timer.stop(),r.on.call(s?"interrupt":"cancel",i,i.__data__,r.index,r.group),delete n[a]}o&&delete i.__transition}}function EYt(i){return this.each(function(){r9(this,i)})}function IYt(i,e){var n,r;return function(){var s=g_(this,i),o=s.tween;if(o!==n){r=n=o;for(var a=0,l=r.length;a<l;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}s.tween=r}}function TYt(i,e,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=g_(this,i),a=o.tween;if(a!==r){s=(r=a).slice();for(var l={name:e,value:n},c=0,u=s.length;c<u;++c)if(s[c].name===e){s[c]=l;break}c===u&&s.push(l)}o.tween=s}}function RYt(i,e){var n=this._id;if(i+="",arguments.length<2){for(var r=ug(this.node(),n).tween,s=0,o=r.length,a;s<o;++s)if((a=r[s]).name===i)return a.value;return null}return this.each((e==null?IYt:TYt)(n,i,e))}function aue(i,e,n){var r=i._id;return i.each(function(){var s=g_(this,r);(s.value||(s.value={}))[e]=n.apply(this,arguments)}),function(s){return ug(s,r).value[e]}}function e6e(i,e){var n;return(typeof e=="number"?ry:e instanceof ZO?nxe:(n=ZO(e))?(e=n,nxe):hYt)(i,e)}function AYt(i){return function(){this.removeAttribute(i)}}function NYt(i){return function(){this.removeAttributeNS(i.space,i.local)}}function MYt(i,e,n){var r,s=n+"",o;return function(){var a=this.getAttribute(i);return a===s?null:a===r?o:o=e(r=a,n)}}function PYt(i,e,n){var r,s=n+"",o;return function(){var a=this.getAttributeNS(i.space,i.local);return a===s?null:a===r?o:o=e(r=a,n)}}function OYt(i,e,n){var r,s,o;return function(){var a,l=n(this),c;return l==null?void this.removeAttribute(i):(a=this.getAttribute(i),c=l+"",a===c?null:a===r&&c===s?o:(s=c,o=e(r=a,l)))}}function FYt(i,e,n){var r,s,o;return function(){var a,l=n(this),c;return l==null?void this.removeAttributeNS(i.space,i.local):(a=this.getAttributeNS(i.space,i.local),c=l+"",a===c?null:a===r&&c===s?o:(s=c,o=e(r=a,l)))}}function BYt(i,e){var n=KV(i),r=n==="transform"?mYt:e6e;return this.attrTween(i,typeof e=="function"?(n.local?FYt:OYt)(n,r,aue(this,"attr."+i,e)):e==null?(n.local?NYt:AYt)(n):(n.local?PYt:MYt)(n,r,e))}function jYt(i,e){return function(n){this.setAttribute(i,e.call(this,n))}}function WYt(i,e){return function(n){this.setAttributeNS(i.space,i.local,e.call(this,n))}}function $Yt(i,e){var n,r;function s(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&WYt(i,o)),n}return s._value=e,s}function zYt(i,e){var n,r;function s(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&jYt(i,o)),n}return s._value=e,s}function VYt(i,e){var n="attr."+i;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=KV(i);return this.tween(n,(r.local?$Yt:zYt)(r,e))}function HYt(i,e){return function(){oue(this,i).delay=+e.apply(this,arguments)}}function UYt(i,e){return e=+e,function(){oue(this,i).delay=e}}function qYt(i){var e=this._id;return arguments.length?this.each((typeof i=="function"?HYt:UYt)(e,i)):ug(this.node(),e).delay}function KYt(i,e){return function(){g_(this,i).duration=+e.apply(this,arguments)}}function GYt(i,e){return e=+e,function(){g_(this,i).duration=e}}function XYt(i){var e=this._id;return arguments.length?this.each((typeof i=="function"?KYt:GYt)(e,i)):ug(this.node(),e).duration}function YYt(i,e){if(typeof e!="function")throw new Error;return function(){g_(this,i).ease=e}}function ZYt(i){var e=this._id;return arguments.length?this.each(YYt(e,i)):ug(this.node(),e).ease}function QYt(i,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;g_(this,i).ease=n}}function JYt(i){if(typeof i!="function")throw new Error;return this.each(QYt(this._id,i))}function eZt(i){typeof i!="function"&&(i=N3e(i));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s<n;++s)for(var o=e[s],a=o.length,l=r[s]=[],c,u=0;u<a;++u)(c=o[u])&&i.call(c,c.__data__,u,o)&&l.push(c);return new Nv(r,this._parents,this._name,this._id)}function tZt(i){if(i._id!==this._id)throw new Error;for(var e=this._groups,n=i._groups,r=e.length,s=n.length,o=Math.min(r,s),a=new Array(r),l=0;l<o;++l)for(var c=e[l],u=n[l],d=c.length,h=a[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<r;++l)a[l]=e[l];return new Nv(a,this._parents,this._name,this._id)}function nZt(i){return(i+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function iZt(i,e,n){var r,s,o=nZt(e)?oue:g_;return function(){var a=o(this,i),l=a.on;l!==r&&(s=(r=l).copy()).on(e,n),a.on=s}}function rZt(i,e){var n=this._id;return arguments.length<2?ug(this.node(),n).on.on(i):this.each(iZt(n,i,e))}function sZt(i){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==i)return;e&&e.removeChild(this)}}function oZt(){return this.on("end.remove",sZt(this._id))}function aZt(i){var e=this._name,n=this._id;typeof i!="function"&&(i=tue(i));for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a)for(var l=r[a],c=l.length,u=o[a]=new Array(c),d,h,f=0;f<c;++f)(d=l[f])&&(h=i.call(d,d.__data__,f,l))&&("__data__"in d&&(h.__data__=d.__data__),u[f]=h,XV(u[f],e,n,f,u,ug(d,n)));return new Nv(o,this._parents,e,n)}function lZt(i){var e=this._name,n=this._id;typeof i!="function"&&(i=A3e(i));for(var r=this._groups,s=r.length,o=[],a=[],l=0;l<s;++l)for(var c=r[l],u=c.length,d,h=0;h<u;++h)if(d=c[h]){for(var f=i.call(d,d.__data__,h,c),p,g=ug(d,n),m=0,_=f.length;m<_;++m)(p=f[m])&&XV(p,e,n,m,f,g);o.push(f),a.push(d)}return new Nv(o,a,e,n)}var cZt=B4.prototype.constructor;function uZt(){return new cZt(this._groups,this._parents)}function dZt(i,e){var n,r,s;return function(){var o=LI(this,i),a=(this.style.removeProperty(i),LI(this,i));return o===a?null:o===n&&a===r?s:s=e(n=o,r=a)}}function t6e(i){return function(){this.style.removeProperty(i)}}function hZt(i,e,n){var r,s=n+"",o;return function(){var a=LI(this,i);return a===s?null:a===r?o:o=e(r=a,n)}}function fZt(i,e,n){var r,s,o;return function(){var a=LI(this,i),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(i),LI(this,i))),a===c?null:a===r&&c===s?o:(s=c,o=e(r=a,l))}}function pZt(i,e){var n,r,s,o="style."+e,a="end."+o,l;return function(){var c=g_(this,i),u=c.on,d=c.value[o]==null?l||(l=t6e(e)):void 0;(u!==n||s!==d)&&(r=(n=u).copy()).on(a,s=d),c.on=r}}function gZt(i,e,n){var r=(i+="")=="transform"?gYt:e6e;return e==null?this.styleTween(i,dZt(i,r)).on("end.style."+i,t6e(i)):typeof e=="function"?this.styleTween(i,fZt(i,r,aue(this,"style."+i,e))).each(pZt(this._id,i)):this.styleTween(i,hZt(i,r,e),n).on("end.style."+i,null)}function mZt(i,e,n){return function(r){this.style.setProperty(i,e.call(this,r),n)}}function _Zt(i,e,n){var r,s;function o(){var a=e.apply(this,arguments);return a!==s&&(r=(s=a)&&mZt(i,a,n)),r}return o._value=e,o}function vZt(i,e,n){var r="style."+(i+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,_Zt(i,e,n??""))}function bZt(i){return function(){this.textContent=i}}function yZt(i){return function(){var e=i(this);this.textContent=e??""}}function wZt(i){return this.tween("text",typeof i=="function"?yZt(aue(this,"text",i)):bZt(i==null?"":i+""))}function CZt(i){return function(e){this.textContent=i.call(this,e)}}function SZt(i){var e,n;function r(){var s=i.apply(this,arguments);return s!==n&&(e=(n=s)&&CZt(s)),e}return r._value=i,r}function xZt(i){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(i==null)return this.tween(e,null);if(typeof i!="function")throw new Error;return this.tween(e,SZt(i))}function kZt(){for(var i=this._name,e=this._id,n=n6e(),r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var d=ug(c,e);XV(c,i,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Nv(r,this._parents,i,n)}function LZt(){var i,e,n=this,r=n._id,s=n.size();return new Promise(function(o,a){var l={value:a},c={value:function(){--s===0&&o()}};n.each(function(){var u=g_(this,r),d=u.on;d!==i&&(e=(i=d).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),u.on=e}),s===0&&o()})}var DZt=0;function Nv(i,e,n,r){this._groups=i,this._parents=e,this._name=n,this._id=r}function n6e(){return++DZt}var g0=B4.prototype;Nv.prototype={constructor:Nv,select:aZt,selectAll:lZt,selectChild:g0.selectChild,selectChildren:g0.selectChildren,filter:eZt,merge:tZt,selection:uZt,transition:kZt,call:g0.call,nodes:g0.nodes,node:g0.node,size:g0.size,empty:g0.empty,each:g0.each,on:rZt,attr:BYt,attrTween:VYt,style:gZt,styleTween:vZt,text:wZt,textTween:xZt,remove:oZt,tween:RYt,delay:qYt,duration:XYt,ease:ZYt,easeVarying:JYt,end:LZt,[Symbol.iterator]:g0[Symbol.iterator]};function EZt(i){return((i*=2)<=1?i*i*i:(i-=2)*i*i+2)/2}var IZt={time:null,delay:0,duration:250,ease:EZt};function TZt(i,e){for(var n;!(n=i.__transition)||!(n=n[e]);)if(!(i=i.parentNode))throw new Error(`transition ${e} not found`);return n}function RZt(i){var e,n;i instanceof Nv?(e=i._id,i=i._name):(e=n6e(),(n=IZt).time=rue(),i=i==null?null:i+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],l=a.length,c,u=0;u<l;++u)(c=a[u])&&XV(c,i,e,u,a,n||TZt(c,e));return new Nv(r,this._parents,i,e)}B4.prototype.interrupt=EYt;B4.prototype.transition=RZt;const VB=i=>()=>i;function AZt(i,{sourceEvent:e,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function cv(i,e,n){this.k=i,this.x=e,this.y=n}cv.prototype={constructor:cv,scale:function(i){return i===1?this:new cv(this.k*i,this.x,this.y)},translate:function(i,e){return i===0&e===0?this:new cv(this.k,this.x+this.k*i,this.y+this.k*e)},apply:function(i){return[i[0]*this.k+this.x,i[1]*this.k+this.y]},applyX:function(i){return i*this.k+this.x},applyY:function(i){return i*this.k+this.y},invert:function(i){return[(i[0]-this.x)/this.k,(i[1]-this.y)/this.k]},invertX:function(i){return(i-this.x)/this.k},invertY:function(i){return(i-this.y)/this.k},rescaleX:function(i){return i.copy().domain(i.range().map(this.invertX,this).map(i.invert,i))},rescaleY:function(i){return i.copy().domain(i.range().map(this.invertY,this).map(i.invert,i))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var lue=new cv(1,0,0);Zg.prototype=cv.prototype;function Zg(i){for(;!i.__zoom;)if(!(i=i.parentNode))return lue;return i.__zoom}function cZ(i){i.stopImmediatePropagation()}function UA(i){i.preventDefault(),i.stopImmediatePropagation()}function NZt(i){return(!i.ctrlKey||i.type==="wheel")&&!i.button}function MZt(){var i=this;return i instanceof SVGElement?(i=i.ownerSVGElement||i,i.hasAttribute("viewBox")?(i=i.viewBox.baseVal,[[i.x,i.y],[i.x+i.width,i.y+i.height]]):[[0,0],[i.width.baseVal.value,i.height.baseVal.value]]):[[0,0],[i.clientWidth,i.clientHeight]]}function cxe(){return this.__zoom||lue}function PZt(i){return-i.deltaY*(i.deltaMode===1?.05:i.deltaMode?1:.002)*(i.ctrlKey?10:1)}function OZt(){return navigator.maxTouchPoints||"ontouchstart"in this}function FZt(i,e,n){var r=i.invertX(e[0][0])-n[0][0],s=i.invertX(e[1][0])-n[1][0],o=i.invertY(e[0][1])-n[0][1],a=i.invertY(e[1][1])-n[1][1];return i.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function BZt(){var i=NZt,e=MZt,n=FZt,r=PZt,s=OZt,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=yYt,u=j4("start","zoom","end"),d,h,f,p=500,g=150,m=0,_=10;function b(j){j.property("__zoom",cxe).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",N).filter(s).on("touchstart.zoom",P).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(j,z,H,Y){var X=j.selection?j.selection():j;X.property("__zoom",cxe),j!==X?D(j,z,H,Y):X.interrupt().each(function(){R(this,arguments).event(Y).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},b.scaleBy=function(j,z,H,Y){b.scaleTo(j,function(){var X=this.__zoom.k,Q=typeof z=="function"?z.apply(this,arguments):z;return X*Q},H,Y)},b.scaleTo=function(j,z,H,Y){b.transform(j,function(){var X=e.apply(this,arguments),Q=this.__zoom,ie=H==null?k(X):typeof H=="function"?H.apply(this,arguments):H,K=Q.invert(ie),ee=typeof z=="function"?z.apply(this,arguments):z;return n(x(y(Q,ee),ie,K),X,a)},H,Y)},b.translateBy=function(j,z,H,Y){b.transform(j,function(){return n(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof H=="function"?H.apply(this,arguments):H),e.apply(this,arguments),a)},null,Y)},b.translateTo=function(j,z,H,Y,X){b.transform(j,function(){var Q=e.apply(this,arguments),ie=this.__zoom,K=Y==null?k(Q):typeof Y=="function"?Y.apply(this,arguments):Y;return n(lue.translate(K[0],K[1]).scale(ie.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof H=="function"?-H.apply(this,arguments):-H),Q,a)},Y,X)};function y(j,z){return z=Math.max(o[0],Math.min(o[1],z)),z===j.k?j:new cv(z,j.x,j.y)}function x(j,z,H){var Y=z[0]-H[0]*j.k,X=z[1]-H[1]*j.k;return Y===j.x&&X===j.y?j:new cv(j.k,Y,X)}function k(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function D(j,z,H,Y){j.on("start.zoom",function(){R(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(Y).end()}).tween("zoom",function(){var X=this,Q=arguments,ie=R(X,Q).event(Y),K=e.apply(X,Q),ee=H==null?k(K):typeof H=="function"?H.apply(X,Q):H,le=Math.max(K[1][0]-K[0][0],K[1][1]-K[0][1]),ke=X.__zoom,xe=typeof z=="function"?z.apply(X,Q):z,me=c(ke.invert(ee).concat(le/ke.k),xe.invert(ee).concat(le/xe.k));return function(Ee){if(Ee===1)Ee=xe;else{var je=me(Ee),qe=le/je[2];Ee=new cv(qe,ee[0]-je[0]*qe,ee[1]-je[1]*qe)}ie.zoom(null,Ee)}})}function R(j,z,H){return!H&&j.__zooming||new E(j,z)}function E(j,z){this.that=j,this.args=z,this.active=0,this.sourceEvent=null,this.extent=e.apply(j,z),this.taps=0}E.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,z){return this.mouse&&j!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var z=ff(this.that).datum();u.call(j,this.that,new AZt(j,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),z)}};function A(j,...z){if(!i.apply(this,arguments))return;var H=R(this,z).event(j),Y=this.__zoom,X=Math.max(o[0],Math.min(o[1],Y.k*Math.pow(2,r.apply(this,arguments)))),Q=Jg(j);if(H.wheel)(H.mouse[0][0]!==Q[0]||H.mouse[0][1]!==Q[1])&&(H.mouse[1]=Y.invert(H.mouse[0]=Q)),clearTimeout(H.wheel);else{if(Y.k===X)return;H.mouse=[Q,Y.invert(Q)],r9(this),H.start()}UA(j),H.wheel=setTimeout(ie,g),H.zoom("mouse",n(x(y(Y,X),H.mouse[0],H.mouse[1]),H.extent,a));function ie(){H.wheel=null,H.end()}}function M(j,...z){if(f||!i.apply(this,arguments))return;var H=j.currentTarget,Y=R(this,z,!0).event(j),X=ff(j.view).on("mousemove.zoom",ee,!0).on("mouseup.zoom",le,!0),Q=Jg(j,H),ie=j.clientX,K=j.clientY;V3e(j.view),cZ(j),Y.mouse=[Q,this.__zoom.invert(Q)],r9(this),Y.start();function ee(ke){if(UA(ke),!Y.moved){var xe=ke.clientX-ie,me=ke.clientY-K;Y.moved=xe*xe+me*me>m}Y.event(ke).zoom("mouse",n(x(Y.that.__zoom,Y.mouse[0]=Jg(ke,H),Y.mouse[1]),Y.extent,a))}function le(ke){X.on("mousemove.zoom mouseup.zoom",null),H3e(ke.view,Y.moved),UA(ke),Y.event(ke).end()}}function N(j,...z){if(i.apply(this,arguments)){var H=this.__zoom,Y=Jg(j.changedTouches?j.changedTouches[0]:j,this),X=H.invert(Y),Q=H.k*(j.shiftKey?.5:2),ie=n(x(y(H,Q),Y,X),e.apply(this,z),a);UA(j),l>0?ff(this).transition().duration(l).call(D,ie,Y,j):ff(this).call(b.transform,ie,Y,j)}}function P(j,...z){if(i.apply(this,arguments)){var H=j.touches,Y=H.length,X=R(this,z,j.changedTouches.length===Y).event(j),Q,ie,K,ee;for(cZ(j),ie=0;ie<Y;++ie)K=H[ie],ee=Jg(K,this),ee=[ee,this.__zoom.invert(ee),K.identifier],X.touch0?!X.touch1&&X.touch0[2]!==ee[2]&&(X.touch1=ee,X.taps=0):(X.touch0=ee,Q=!0,X.taps=1+!!d);d&&(d=clearTimeout(d)),Q&&(X.taps<2&&(h=ee[0],d=setTimeout(function(){d=null},p)),r9(this),X.start())}}function O(j,...z){if(this.__zooming){var H=R(this,z).event(j),Y=j.changedTouches,X=Y.length,Q,ie,K,ee;for(UA(j),Q=0;Q<X;++Q)ie=Y[Q],K=Jg(ie,this),H.touch0&&H.touch0[2]===ie.identifier?H.touch0[0]=K:H.touch1&&H.touch1[2]===ie.identifier&&(H.touch1[0]=K);if(ie=H.that.__zoom,H.touch1){var le=H.touch0[0],ke=H.touch0[1],xe=H.touch1[0],me=H.touch1[1],Ee=(Ee=xe[0]-le[0])*Ee+(Ee=xe[1]-le[1])*Ee,je=(je=me[0]-ke[0])*je+(je=me[1]-ke[1])*je;ie=y(ie,Math.sqrt(Ee/je)),K=[(le[0]+xe[0])/2,(le[1]+xe[1])/2],ee=[(ke[0]+me[0])/2,(ke[1]+me[1])/2]}else if(H.touch0)K=H.touch0[0],ee=H.touch0[1];else return;H.zoom("touch",n(x(ie,K,ee),H.extent,a))}}function B(j,...z){if(this.__zooming){var H=R(this,z).event(j),Y=j.changedTouches,X=Y.length,Q,ie;for(cZ(j),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),Q=0;Q<X;++Q)ie=Y[Q],H.touch0&&H.touch0[2]===ie.identifier?delete H.touch0:H.touch1&&H.touch1[2]===ie.identifier&&delete H.touch1;if(H.touch1&&!H.touch0&&(H.touch0=H.touch1,delete H.touch1),H.touch0)H.touch0[1]=this.__zoom.invert(H.touch0[0]);else if(H.end(),H.taps===2&&(ie=Jg(ie,this),Math.hypot(h[0]-ie[0],h[1]-ie[1])<_)){var K=ff(this).on("dblclick.zoom");K&&K.apply(this,arguments)}}}return b.wheelDelta=function(j){return arguments.length?(r=typeof j=="function"?j:VB(+j),b):r},b.filter=function(j){return arguments.length?(i=typeof j=="function"?j:VB(!!j),b):i},b.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:VB(!!j),b):s},b.extent=function(j){return arguments.length?(e=typeof j=="function"?j:VB([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),b):e},b.scaleExtent=function(j){return arguments.length?(o[0]=+j[0],o[1]=+j[1],b):[o[0],o[1]]},b.translateExtent=function(j){return arguments.length?(a[0][0]=+j[0][0],a[1][0]=+j[1][0],a[0][1]=+j[0][1],a[1][1]=+j[1][1],b):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},b.constrain=function(j){return arguments.length?(n=j,b):n},b.duration=function(j){return arguments.length?(l=+j,b):l},b.interpolate=function(j){return arguments.length?(c=j,b):c},b.on=function(){var j=u.on.apply(u,arguments);return j===u?b:j},b.clickDistance=function(j){return arguments.length?(m=(j=+j)*j,b):Math.sqrt(m)},b.tapDistance=function(j){return arguments.length?(_=+j,b):_},b}class uxe extends Map{constructor(e,n=$Zt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,s]of e)this.set(r,s)}get(e){return super.get(dxe(this,e))}has(e){return super.has(dxe(this,e))}set(e,n){return super.set(jZt(this,e),n)}delete(e){return super.delete(WZt(this,e))}}function dxe({_intern:i,_key:e},n){const r=e(n);return i.has(r)?i.get(r):n}function jZt({_intern:i,_key:e},n){const r=e(n);return i.has(r)?i.get(r):(i.set(r,n),n)}function WZt({_intern:i,_key:e},n){const r=e(n);return i.has(r)&&(n=i.get(r),i.delete(r)),n}function $Zt(i){return i!==null&&typeof i=="object"?i.valueOf():i}function hxe(i,e){let n;if(e===void 0)for(const r of i)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let s of i)(s=e(s,++r,i))!=null&&(n<s||n===void 0&&s>=s)&&(n=s)}return n}function fxe(i,e){let n;if(e===void 0)for(const r of i)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let s of i)(s=e(s,++r,i))!=null&&(n>s||n===void 0&&s>=s)&&(n=s)}return n}function zZt(i,e){let n=0;for(let r of i)(r=+r)&&(n+=r);return n}var VZt=typeof global=="object"&&global&&global.Object===Object&&global,HZt=typeof self=="object"&&self&&self.Object===Object&&self,i6e=VZt||HZt||Function("return this")(),eW=i6e.Symbol,r6e=Object.prototype,UZt=r6e.hasOwnProperty,qZt=r6e.toString,qA=eW?eW.toStringTag:void 0;function KZt(i){var e=UZt.call(i,qA),n=i[qA];try{i[qA]=void 0;var r=!0}catch{}var s=qZt.call(i);return r&&(e?i[qA]=n:delete i[qA]),s}var GZt=Object.prototype,XZt=GZt.toString;function YZt(i){return XZt.call(i)}var ZZt="[object Null]",QZt="[object Undefined]",pxe=eW?eW.toStringTag:void 0;function JZt(i){return i==null?i===void 0?QZt:ZZt:pxe&&pxe in Object(i)?KZt(i):YZt(i)}function eQt(i){return i!=null&&typeof i=="object"}var tQt="[object Symbol]";function nQt(i){return typeof i=="symbol"||eQt(i)&&JZt(i)==tQt}var iQt=/\s/;function rQt(i){for(var e=i.length;e--&&iQt.test(i.charAt(e)););return e}var sQt=/^\s+/;function oQt(i){return i&&i.slice(0,rQt(i)+1).replace(sQt,"")}function tW(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}var gxe=NaN,aQt=/^[-+]0x[0-9a-f]+$/i,lQt=/^0b[01]+$/i,cQt=/^0o[0-7]+$/i,uQt=parseInt;function mxe(i){if(typeof i=="number")return i;if(nQt(i))return gxe;if(tW(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=tW(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=oQt(i);var n=lQt.test(i);return n||cQt.test(i)?uQt(i.slice(2),n?2:8):aQt.test(i)?gxe:+i}var uZ=function(){return i6e.Date.now()},dQt="Expected a function",hQt=Math.max,fQt=Math.min;function s6e(i,e,n){var r,s,o,a,l,c,u=0,d=!1,h=!1,f=!0;if(typeof i!="function")throw new TypeError(dQt);e=mxe(e)||0,tW(n)&&(d=!!n.leading,h="maxWait"in n,o=h?hQt(mxe(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f);function p(R){var E=r,A=s;return r=s=void 0,u=R,a=i.apply(A,E),a}function g(R){return u=R,l=setTimeout(b,e),d?p(R):a}function m(R){var E=R-c,A=R-u,M=e-E;return h?fQt(M,o-A):M}function _(R){var E=R-c,A=R-u;return c===void 0||E>=e||E<0||h&&A>=o}function b(){var R=uZ();if(_(R))return y(R);l=setTimeout(b,m(R))}function y(R){return l=void 0,f&&r?p(R):(r=s=void 0,a)}function x(){l!==void 0&&clearTimeout(l),u=0,r=c=s=l=void 0}function k(){return l===void 0?a:y(uZ())}function D(){var R=uZ(),E=_(R);if(r=arguments,s=this,c=R,E){if(l===void 0)return g(c);if(h)return clearTimeout(l),l=setTimeout(b,e),p(c)}return l===void 0&&(l=setTimeout(b,e)),a}return D.cancel=x,D.flush=k,D}var pQt="Expected a function";function gQt(i,e,n){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(pQt);return tW(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),s6e(i,e,{leading:r,maxWait:e,trailing:s})}var YS=Object.freeze({Linear:Object.freeze({None:function(i){return i},In:function(i){return i},Out:function(i){return i},InOut:function(i){return i}}),Quadratic:Object.freeze({In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}}),Cubic:Object.freeze({In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}}),Quartic:Object.freeze({In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}}),Quintic:Object.freeze({In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}}),Sinusoidal:Object.freeze({In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}}),Exponential:Object.freeze({In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}}),Circular:Object.freeze({In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}}),Elastic:Object.freeze({In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(i){var e=1.70158;return i===1?1:i*i*((e+1)*i-e)},Out:function(i){var e=1.70158;return i===0?0:--i*i*((e+1)*i+e)+1},InOut:function(i){var e=2.5949095;return(i*=2)<1?.5*(i*i*((e+1)*i-e)):.5*((i-=2)*i*((e+1)*i+e)+2)}}),Bounce:Object.freeze({In:function(i){return 1-YS.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?YS.Bounce.In(i*2)*.5:YS.Bounce.Out(i*2-1)*.5+.5}}),generatePow:function(i){return i===void 0&&(i=4),i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(e){return Math.pow(e,i)},Out:function(e){return 1-Math.pow(1-e,i)},InOut:function(e){return e<.5?Math.pow(e*2,i)/2:(1-Math.pow(2-e*2,i))/2+.5}}}}),jN=function(){return performance.now()},o6e=function(){function i(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return i.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},i.prototype.removeAll=function(){this._tweens={}},i.prototype.add=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var s=0,o=n;s<o.length;s++){var a=o[s];(e=a._group)===null||e===void 0||e.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},i.prototype.remove=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r=0,s=e;r<s.length;r++){var o=s[r];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},i.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},i.prototype.update=function(e,n){e===void 0&&(e=jN()),n===void 0&&(n=!0);var r=Object.keys(this._tweens);if(r.length!==0)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<r.length;s++){var o=this._tweens[r[s]],a=!n;o&&o.update(e,a)===!1&&!n&&this.remove(o)}r=Object.keys(this._tweensAddedDuringUpdate)}},i}(),ure={Linear:function(i,e){var n=i.length-1,r=n*e,s=Math.floor(r),o=ure.Utils.Linear;return e<0?o(i[0],i[1],r):e>1?o(i[n],i[n-1],n-r):o(i[s],i[s+1>n?n:s+1],r-s)},Utils:{Linear:function(i,e,n){return(e-i)*n+i}}},a6e=function(){function i(){}return i.nextId=function(){return i._nextId++},i._nextId=0,i}(),dre=new o6e,_xe=function(){function i(e,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=YS.Linear.None,this._interpolationFunction=ure.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=a6e.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=dre,dre.add(this))}return i.prototype.getId=function(){return this._id},i.prototype.isPlaying=function(){return this._isPlaying},i.prototype.isPaused=function(){return this._isPaused},i.prototype.getDuration=function(){return this._duration},i.prototype.to=function(e,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},i.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},i.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},i.prototype.start=function(e,n){if(e===void 0&&(e=jN()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},i.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},i.prototype._setupProperties=function(e,n,r,s,o){for(var a in r){var l=e[a],c=Array.isArray(l),u=c?"array":typeof l,d=!c&&Array.isArray(r[a]);if(!(u==="undefined"||u==="function")){if(d){var h=r[a];if(h.length===0)continue;for(var f=[l],p=0,g=h.length;p<g;p+=1){var m=this._handleRelativeValue(l,h[p]);if(isNaN(m)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}f.push(m)}d&&(r[a]=f)}if((u==="object"||c)&&l&&!d){n[a]=c?[]:{};var _=l;for(var b in _)n[a][b]=_[b];s[a]=c?[]:{};var h=r[a];if(!this._isDynamic){var y={};for(var b in h)y[b]=h[b];r[a]=h=y}this._setupProperties(_,n[a],h,s[a],o)}else(typeof n[a]>"u"||o)&&(n[a]=l),c||(n[a]*=1),d?s[a]=r[a].slice().reverse():s[a]=n[a]||0}}},i.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},i.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},i.prototype.pause=function(e){return e===void 0&&(e=jN()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},i.prototype.resume=function(e){return e===void 0&&(e=jN()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},i.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this},i.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},i.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},i.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},i.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},i.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},i.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},i.prototype.easing=function(e){return e===void 0&&(e=YS.Linear.None),this._easingFunction=e,this},i.prototype.interpolation=function(e){return e===void 0&&(e=ure.Linear),this._interpolationFunction=e,this},i.prototype.chain=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._chainedTweens=e,this},i.prototype.onStart=function(e){return this._onStartCallback=e,this},i.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},i.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},i.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},i.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},i.prototype.onStop=function(e){return this._onStopCallback=e,this},i.prototype.update=function(e,n){var r=this,s;if(e===void 0&&(e=jN()),n===void 0&&(n=i.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,l=this._duration+((s=this._repeatDelayTime)!==null&&s!==void 0?s:this._delayTime),c=this._duration+this._repeat*l,u=function(){if(r._duration===0||a>c)return 1;var m=Math.trunc(a/l),_=a-m*l,b=Math.min(_/r._duration,1);return b===0&&a===r._duration?1:b},d=u(),h=this._easingFunction(d);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,d),this._duration===0||a>=this._duration)if(this._repeat>0){var f=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=f);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*f,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,g=this._chainedTweens.length;p<g;p++)this._chainedTweens[p].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},i.prototype._updateProperties=function(e,n,r,s){for(var o in r)if(n[o]!==void 0){var a=n[o]||0,l=r[o],c=Array.isArray(e[o]),u=Array.isArray(l),d=!c&&u;d?e[o]=this._interpolationFunction(l,s):typeof l=="object"&&l?this._updateProperties(e[o],a,l,s):(l=this._handleRelativeValue(a,l),typeof l=="number"&&(e[o]=a+(l-a)*s))}},i.prototype._handleRelativeValue=function(e,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?e+parseFloat(n):parseFloat(n)},i.prototype._swapEndStartRepeatValues=function(e){var n=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=n},i.autoStartOnUpdate=!1,i}();a6e.nextId;var o_=dre;o_.getAll.bind(o_);o_.removeAll.bind(o_);o_.add.bind(o_);o_.remove.bind(o_);o_.update.bind(o_);function vxe(i,e){(e==null||e>i.length)&&(e=i.length);for(var n=0,r=Array(e);n<e;n++)r[n]=i[n];return r}function mQt(i){if(Array.isArray(i))return i}function _Qt(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function vQt(i,e,n){return Object.defineProperty(i,"prototype",{writable:!1}),i}function bQt(i,e){var n=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(n!=null){var r,s,o,a,l=[],c=!0,u=!1;try{if(o=(n=n.call(i)).next,e!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw s}}return l}}function yQt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wQt(i,e){return mQt(i)||bQt(i,e)||CQt(i,e)||yQt()}function CQt(i,e){if(i){if(typeof i=="string")return vxe(i,e);var n={}.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vxe(i,e):void 0}}var SQt=vQt(function i(e,n){var r=n.default,s=r===void 0?null:r,o=n.triggerUpdate,a=o===void 0?!0:o,l=n.onChange,c=l===void 0?function(u,d){}:l;_Qt(this,i),this.name=e,this.defaultVal=s,this.triggerUpdate=a,this.onChange=c});function cue(i){var e=i.stateInit,n=e===void 0?function(){return{}}:e,r=i.props,s=r===void 0?{}:r,o=i.methods,a=o===void 0?{}:o,l=i.aliases,c=l===void 0?{}:l,u=i.init,d=u===void 0?function(){}:u,h=i.update,f=h===void 0?function(){}:h,p=Object.keys(s).map(function(g){return new SQt(g,s[g])});return function g(){for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];var y=!!(this instanceof g&&this.constructor),x=y?_.shift():void 0,k=_[0],D=k===void 0?{}:k,R=Object.assign({},n instanceof Function?n(D):n,{initialised:!1}),E={};function A(P){return M(P,D),N(),A}var M=function(O,B){d.call(A,O,R,B),R.initialised=!0},N=s6e(function(){R.initialised&&(f.call(A,R,E),E={})},1);return p.forEach(function(P){A[P.name]=O(P);function O(B){var j=B.name,z=B.triggerUpdate,H=z===void 0?!1:z,Y=B.onChange,X=Y===void 0?function(K,ee){}:Y,Q=B.defaultVal,ie=Q===void 0?null:Q;return function(K){var ee=R[j];if(!arguments.length)return ee;var le=K===void 0?ie:K;return R[j]=le,X.call(A,le,R,ee),!E.hasOwnProperty(j)&&(E[j]=ee),H&&N(),A}}}),Object.keys(a).forEach(function(P){A[P]=function(){for(var O,B=arguments.length,j=new Array(B),z=0;z<B;z++)j[z]=arguments[z];return(O=a[P]).call.apply(O,[A,R].concat(j))}}),Object.entries(c).forEach(function(P){var O=wQt(P,2),B=O[0],j=O[1];return A[B]=A[j]}),A.resetProps=function(){return p.forEach(function(P){A[P.name](P.defaultVal)}),A},A.resetProps(),R._rerender=N,y&&x&&A(x),A}}var rs=function(i){return typeof i=="function"?i:typeof i=="string"?function(e){return e[i]}:function(e){return i}};function nW(i){"@babel/helpers - typeof";return nW=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nW(i)}var xQt=/^\s+/,kQt=/\s+$/;function $n(i,e){if(i=i||"",e=e||{},i instanceof $n)return i;if(!(this instanceof $n))return new $n(i,e);var n=LQt(i);this._originalInput=i,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}$n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),n,r,s,o,a,l;return n=e.r/255,r=e.g/255,s=e.b/255,n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),s<=.03928?l=s/12.92:l=Math.pow((s+.055)/1.055,2.4),.2126*o+.7152*a+.0722*l},setAlpha:function(e){return this._a=l6e(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=yxe(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=yxe(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),s=Math.round(e.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+s+"%)":"hsva("+n+", "+r+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=bxe(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=bxe(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),s=Math.round(e.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+s+"%)":"hsla("+n+", "+r+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return wxe(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return TQt(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(uo(this._r,255)*100)+"%",g:Math.round(uo(this._g,255)*100)+"%",b:Math.round(uo(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(uo(this._r,255)*100)+"%, "+Math.round(uo(this._g,255)*100)+"%, "+Math.round(uo(this._b,255)*100)+"%)":"rgba("+Math.round(uo(this._r,255)*100)+"%, "+Math.round(uo(this._g,255)*100)+"%, "+Math.round(uo(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:zQt[wxe(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var n="#"+Cxe(this._r,this._g,this._b,this._a),r=n,s=this._gradientType?"GradientType = 1, ":"";if(e){var o=$n(e);r="#"+Cxe(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+n+",endColorstr="+r+")"},toString:function(e){var n=!!e;e=e||this._format;var r=!1,s=this._a<1&&this._a>=0,o=!n&&s&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return $n(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(MQt,arguments)},brighten:function(){return this._applyModification(PQt,arguments)},darken:function(){return this._applyModification(OQt,arguments)},desaturate:function(){return this._applyModification(RQt,arguments)},saturate:function(){return this._applyModification(AQt,arguments)},greyscale:function(){return this._applyModification(NQt,arguments)},spin:function(){return this._applyModification(FQt,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(WQt,arguments)},complement:function(){return this._applyCombination(BQt,arguments)},monochromatic:function(){return this._applyCombination($Qt,arguments)},splitcomplement:function(){return this._applyCombination(jQt,arguments)},triad:function(){return this._applyCombination(Sxe,[3])},tetrad:function(){return this._applyCombination(Sxe,[4])}};$n.fromRatio=function(i,e){if(nW(i)=="object"){var n={};for(var r in i)i.hasOwnProperty(r)&&(r==="a"?n[r]=i[r]:n[r]=WN(i[r]));i=n}return $n(i,e)};function LQt(i){var e={r:0,g:0,b:0},n=1,r=null,s=null,o=null,a=!1,l=!1;return typeof i=="string"&&(i=qQt(i)),nW(i)=="object"&&(m0(i.r)&&m0(i.g)&&m0(i.b)?(e=DQt(i.r,i.g,i.b),a=!0,l=String(i.r).substr(-1)==="%"?"prgb":"rgb"):m0(i.h)&&m0(i.s)&&m0(i.v)?(r=WN(i.s),s=WN(i.v),e=IQt(i.h,r,s),a=!0,l="hsv"):m0(i.h)&&m0(i.s)&&m0(i.l)&&(r=WN(i.s),o=WN(i.l),e=EQt(i.h,r,o),a=!0,l="hsl"),i.hasOwnProperty("a")&&(n=i.a)),n=l6e(n),{ok:a,format:i.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function DQt(i,e,n){return{r:uo(i,255)*255,g:uo(e,255)*255,b:uo(n,255)*255}}function bxe(i,e,n){i=uo(i,255),e=uo(e,255),n=uo(n,255);var r=Math.max(i,e,n),s=Math.min(i,e,n),o,a,l=(r+s)/2;if(r==s)o=a=0;else{var c=r-s;switch(a=l>.5?c/(2-r-s):c/(r+s),r){case i:o=(e-n)/c+(e<n?6:0);break;case e:o=(n-i)/c+2;break;case n:o=(i-e)/c+4;break}o/=6}return{h:o,s:a,l}}function EQt(i,e,n){var r,s,o;i=uo(i,360),e=uo(e,100),n=uo(n,100);function a(u,d,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?u+(d-u)*6*h:h<1/2?d:h<2/3?u+(d-u)*(2/3-h)*6:u}if(e===0)r=s=o=n;else{var l=n<.5?n*(1+e):n+e-n*e,c=2*n-l;r=a(c,l,i+1/3),s=a(c,l,i),o=a(c,l,i-1/3)}return{r:r*255,g:s*255,b:o*255}}function yxe(i,e,n){i=uo(i,255),e=uo(e,255),n=uo(n,255);var r=Math.max(i,e,n),s=Math.min(i,e,n),o,a,l=r,c=r-s;if(a=r===0?0:c/r,r==s)o=0;else{switch(r){case i:o=(e-n)/c+(e<n?6:0);break;case e:o=(n-i)/c+2;break;case n:o=(i-e)/c+4;break}o/=6}return{h:o,s:a,v:l}}function IQt(i,e,n){i=uo(i,360)*6,e=uo(e,100),n=uo(n,100);var r=Math.floor(i),s=i-r,o=n*(1-e),a=n*(1-s*e),l=n*(1-(1-s)*e),c=r%6,u=[n,a,o,o,l,n][c],d=[l,n,n,a,o,o][c],h=[o,o,l,n,n,a][c];return{r:u*255,g:d*255,b:h*255}}function wxe(i,e,n,r){var s=[Fp(Math.round(i).toString(16)),Fp(Math.round(e).toString(16)),Fp(Math.round(n).toString(16))];return r&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function TQt(i,e,n,r,s){var o=[Fp(Math.round(i).toString(16)),Fp(Math.round(e).toString(16)),Fp(Math.round(n).toString(16)),Fp(c6e(r))];return s&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function Cxe(i,e,n,r){var s=[Fp(c6e(r)),Fp(Math.round(i).toString(16)),Fp(Math.round(e).toString(16)),Fp(Math.round(n).toString(16))];return s.join("")}$n.equals=function(i,e){return!i||!e?!1:$n(i).toRgbString()==$n(e).toRgbString()};$n.random=function(){return $n.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function RQt(i,e){e=e===0?0:e||10;var n=$n(i).toHsl();return n.s-=e/100,n.s=YV(n.s),$n(n)}function AQt(i,e){e=e===0?0:e||10;var n=$n(i).toHsl();return n.s+=e/100,n.s=YV(n.s),$n(n)}function NQt(i){return $n(i).desaturate(100)}function MQt(i,e){e=e===0?0:e||10;var n=$n(i).toHsl();return n.l+=e/100,n.l=YV(n.l),$n(n)}function PQt(i,e){e=e===0?0:e||10;var n=$n(i).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),$n(n)}function OQt(i,e){e=e===0?0:e||10;var n=$n(i).toHsl();return n.l-=e/100,n.l=YV(n.l),$n(n)}function FQt(i,e){var n=$n(i).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,$n(n)}function BQt(i){var e=$n(i).toHsl();return e.h=(e.h+180)%360,$n(e)}function Sxe(i,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=$n(i).toHsl(),r=[$n(i)],s=360/e,o=1;o<e;o++)r.push($n({h:(n.h+o*s)%360,s:n.s,l:n.l}));return r}function jQt(i){var e=$n(i).toHsl(),n=e.h;return[$n(i),$n({h:(n+72)%360,s:e.s,l:e.l}),$n({h:(n+216)%360,s:e.s,l:e.l})]}function WQt(i,e,n){e=e||6,n=n||30;var r=$n(i).toHsl(),s=360/n,o=[$n(i)];for(r.h=(r.h-(s*e>>1)+720)%360;--e;)r.h=(r.h+s)%360,o.push($n(r));return o}function $Qt(i,e){e=e||6;for(var n=$n(i).toHsv(),r=n.h,s=n.s,o=n.v,a=[],l=1/e;e--;)a.push($n({h:r,s,v:o})),o=(o+l)%1;return a}$n.mix=function(i,e,n){n=n===0?0:n||50;var r=$n(i).toRgb(),s=$n(e).toRgb(),o=n/100,a={r:(s.r-r.r)*o+r.r,g:(s.g-r.g)*o+r.g,b:(s.b-r.b)*o+r.b,a:(s.a-r.a)*o+r.a};return $n(a)};$n.readability=function(i,e){var n=$n(i),r=$n(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};$n.isReadable=function(i,e,n){var r=$n.readability(i,e),s,o;switch(o=!1,s=KQt(n),s.level+s.size){case"AAsmall":case"AAAlarge":o=r>=4.5;break;case"AAlarge":o=r>=3;break;case"AAAsmall":o=r>=7;break}return o};$n.mostReadable=function(i,e,n){var r=null,s=0,o,a,l,c;n=n||{},a=n.includeFallbackColors,l=n.level,c=n.size;for(var u=0;u<e.length;u++)o=$n.readability(i,e[u]),o>s&&(s=o,r=$n(e[u]));return $n.isReadable(i,r,{level:l,size:c})||!a?r:(n.includeFallbackColors=!1,$n.mostReadable(i,["#fff","#000"],n))};var hre=$n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},zQt=$n.hexNames=VQt(hre);function VQt(i){var e={};for(var n in i)i.hasOwnProperty(n)&&(e[i[n]]=n);return e}function l6e(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function uo(i,e){HQt(i)&&(i="100%");var n=UQt(i);return i=Math.min(e,Math.max(0,parseFloat(i))),n&&(i=parseInt(i*e,10)/100),Math.abs(i-e)<1e-6?1:i%e/parseFloat(e)}function YV(i){return Math.min(1,Math.max(0,i))}function jd(i){return parseInt(i,16)}function HQt(i){return typeof i=="string"&&i.indexOf(".")!=-1&&parseFloat(i)===1}function UQt(i){return typeof i=="string"&&i.indexOf("%")!=-1}function Fp(i){return i.length==1?"0"+i:""+i}function WN(i){return i<=1&&(i=i*100+"%"),i}function c6e(i){return Math.round(parseFloat(i)*255).toString(16)}function xxe(i){return jd(i)/255}var hp=function(){var i="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+i+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",s="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+s),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+s),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+s),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function m0(i){return!!hp.CSS_UNIT.exec(i)}function qQt(i){i=i.replace(xQt,"").replace(kQt,"").toLowerCase();var e=!1;if(hre[i])i=hre[i],e=!0;else if(i=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=hp.rgb.exec(i))?{r:n[1],g:n[2],b:n[3]}:(n=hp.rgba.exec(i))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=hp.hsl.exec(i))?{h:n[1],s:n[2],l:n[3]}:(n=hp.hsla.exec(i))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=hp.hsv.exec(i))?{h:n[1],s:n[2],v:n[3]}:(n=hp.hsva.exec(i))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=hp.hex8.exec(i))?{r:jd(n[1]),g:jd(n[2]),b:jd(n[3]),a:xxe(n[4]),format:e?"name":"hex8"}:(n=hp.hex6.exec(i))?{r:jd(n[1]),g:jd(n[2]),b:jd(n[3]),format:e?"name":"hex"}:(n=hp.hex4.exec(i))?{r:jd(n[1]+""+n[1]),g:jd(n[2]+""+n[2]),b:jd(n[3]+""+n[3]),a:xxe(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=hp.hex3.exec(i))?{r:jd(n[1]+""+n[1]),g:jd(n[2]+""+n[2]),b:jd(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function KQt(i){var e,n;return i=i||{level:"AA",size:"small"},e=(i.level||"AA").toUpperCase(),n=(i.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}function fre(i,e){(e==null||e>i.length)&&(e=i.length);for(var n=0,r=Array(e);n<e;n++)r[n]=i[n];return r}function GQt(i){if(Array.isArray(i))return fre(i)}function u6e(i,e,n){if(typeof i=="function"?i===e:i.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function XQt(i,e){if(e.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YQt(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Gh(i,e){return i.get(u6e(i,e))}function kxe(i,e,n){XQt(i,e),e.set(i,n)}function Lxe(i,e,n){return i.set(u6e(i,e),n),n}function ZQt(i,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,iJt(r.key),r)}}function QQt(i,e,n){return e&&ZQt(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function JQt(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function eJt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tJt(i){return GQt(i)||JQt(i)||rJt(i)||eJt()}function nJt(i,e){if(typeof i!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var r=n.call(i,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}function iJt(i){var e=nJt(i,"string");return typeof e=="symbol"?e:e+""}function rJt(i,e){if(i){if(typeof i=="string")return fre(i,e);var n={}.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fre(i,e):void 0}}var sJt=123,oJt=function(e){return"#".concat(Math.min(e,Math.pow(2,24)).toString(16).padStart(6,"0"))},d6e=function(e,n,r){return(e<<16)+(n<<8)+r},aJt=function(e){var n=$n(e).toRgb(),r=n.r,s=n.g,o=n.b;return d6e(r,s,o)},Dxe=function(e,n){return e*sJt%Math.pow(2,n)},EC=new WeakMap,_0=new WeakMap,lJt=function(){function i(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;YQt(this,i),kxe(this,EC,void 0),kxe(this,_0,void 0),Lxe(_0,this,e),this.reset()}return QQt(i,[{key:"reset",value:function(){Lxe(EC,this,["__reserved for background__"])}},{key:"register",value:function(n){if(Gh(EC,this).length>=Math.pow(2,24-Gh(_0,this)))return null;var r=Gh(EC,this).length,s=Dxe(r,Gh(_0,this)),o=oJt(r+(s<<24-Gh(_0,this)));return Gh(EC,this).push(n),o}},{key:"lookup",value:function(n){if(!n)return null;var r=typeof n=="string"?aJt(n):d6e.apply(void 0,tJt(n));if(!r)return null;var s=r&Math.pow(2,24-Gh(_0,this))-1,o=r>>24-Gh(_0,this)&Math.pow(2,Gh(_0,this))-1;return Dxe(s,Gh(_0,this))!==o||s>=Gh(EC,this).length?null:Gh(EC,this)[s]}}])}();function Exe(i,e){(e==null||e>i.length)&&(e=i.length);for(var n=0,r=Array(e);n<e;n++)r[n]=i[n];return r}function cJt(i){if(Array.isArray(i))return i}function uJt(i,e,n){return(e=mJt(e))in i?Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[e]=n,i}function dJt(i,e){var n=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(n!=null){var r,s,o,a,l=[],c=!0,u=!1;try{if(o=(n=n.call(i)).next,e!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw s}}return l}}function hJt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ixe(i,e){var n=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),n.push.apply(n,r)}return n}function fJt(i){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ixe(Object(n),!0).forEach(function(r){uJt(i,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):Ixe(Object(n)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(n,r))})}return i}function pJt(i,e){return cJt(i)||dJt(i,e)||_Jt(i,e)||hJt()}function gJt(i,e){if(typeof i!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var r=n.call(i,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function mJt(i){var e=gJt(i,"string");return typeof e=="symbol"?e:e+""}function iW(i){"@babel/helpers - typeof";return iW=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iW(i)}function _Jt(i,e){if(i){if(typeof i=="string")return Exe(i,e);var n={}.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Exe(i,e):void 0}}var pre=function(e){if(iW(e)!=="object")return e;var n=gOe(e);if(n.props){var r;n.props=fJt({},n.props),n!=null&&(r=n.props)!==null&&r!==void 0&&r.children&&(n.props.children=Array.isArray(n.props.children)?n.props.children.map(pre):pre(n.props.children))}return n},vJt=function(e){return iOe(gOe(e))},bJt=function(e,n){delete n.__k,pOe(pre(e),n)};function yJt(i,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",n==="top"&&r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s),s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i))}}var wJt=`.float-tooltip-kap {
position: absolute;
width: max-content; /* prevent shrinking near right edge */
max-width: max(50%, 150px);
padding: 3px 5px;
border-radius: 3px;
font: 12px sans-serif;
color: #eee;
background: rgba(0,0,0,0.6);
pointer-events: none;
}
`;yJt(wJt);var CJt=cue({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=r.style,o=s===void 0?{}:s,a=!!e&&iW(e)==="object"&&!!e.node&&typeof e.node=="function",l=ff(a?e.node():e);l.style("position")==="static"&&l.style("position","relative"),n.tooltipEl=l.append("div").attr("class","float-tooltip-kap"),Object.entries(o).forEach(function(u){var d=pJt(u,2),h=d[0],f=d[1];return n.tooltipEl.style(h,f)}),n.tooltipEl.style("left","-10000px").style("display","none");var c="tooltip-".concat(Math.round(Math.random()*1e12));n.mouseInside=!1,l.on("mousemove.".concat(c),function(u){n.mouseInside=!0;var d=Jg(u),h=l.node(),f=h.offsetWidth,p=h.offsetHeight,g=[n.offsetX===null||n.offsetX===void 0?"-".concat(d[0]/f*100,"%"):typeof n.offsetX=="number"?"calc(-50% + ".concat(n.offsetX,"px)"):n.offsetX,n.offsetY===null||n.offsetY===void 0?p>130&&p-d[1]<100?"calc(-100% - 6px)":"21px":typeof n.offsetY=="number"?n.offsetY<0?"calc(-100% - ".concat(Math.abs(n.offsetY),"px)"):"".concat(n.offsetY,"px"):n.offsetY];n.tooltipEl.style("left",d[0]+"px").style("top",d[1]+"px").style("transform","translate(".concat(g.join(","),")")),n.content&&n.tooltipEl.style("display","inline")}),l.on("mouseover.".concat(c),function(){n.mouseInside=!0,n.content&&n.tooltipEl.style("display","inline")}),l.on("mouseout.".concat(c),function(){n.mouseInside=!1,n.tooltipEl.style("display","none")})},update:function(e){e.tooltipEl.style("display",e.content&&e.mouseInside?"inline":"none"),e.content?e.content instanceof HTMLElement?(e.tooltipEl.text(""),e.tooltipEl.append(function(){return e.content})):typeof e.content=="string"?e.tooltipEl.html(e.content):vJt(e.content)?(e.tooltipEl.text(""),bJt(e.content,e.tooltipEl.node())):(e.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",e.content,e.content.toString())):e.tooltipEl.text("")}});function SJt(i,e,n){var r,s=1;i==null&&(i=0),e==null&&(e=0),n==null&&(n=0);function o(){var a,l=r.length,c,u=0,d=0,h=0;for(a=0;a<l;++a)c=r[a],u+=c.x||0,d+=c.y||0,h+=c.z||0;for(u=(u/l-i)*s,d=(d/l-e)*s,h=(h/l-n)*s,a=0;a<l;++a)c=r[a],u&&(c.x-=u),d&&(c.y-=d),h&&(c.z-=h)}return o.initialize=function(a){r=a},o.x=function(a){return arguments.length?(i=+a,o):i},o.y=function(a){return arguments.length?(e=+a,o):e},o.z=function(a){return arguments.length?(n=+a,o):n},o.strength=function(a){return arguments.length?(s=+a,o):s},o}function xJt(i){const e=+this._x.call(null,i);return h6e(this.cover(e),e,i)}function h6e(i,e,n){if(isNaN(e))return i;var r,s=i._root,o={data:n},a=i._x0,l=i._x1,c,u,d,h,f;if(!s)return i._root=o,i;for(;s.length;)if((d=e>=(c=(a+l)/2))?a=c:l=c,r=s,!(s=s[h=+d]))return r[h]=o,i;if(u=+i._x.call(null,s.data),e===u)return o.next=s,r?r[h]=o:i._root=o,i;do r=r?r[h]=new Array(2):i._root=new Array(2),(d=e>=(c=(a+l)/2))?a=c:l=c;while((h=+d)==(f=+(u>=c)));return r[f]=s,r[h]=o,i}function kJt(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,n=new Float64Array(e);let r=1/0,s=-1/0;for(let o=0,a;o<e;++o)isNaN(a=+this._x.call(null,i[o]))||(n[o]=a,a<r&&(r=a),a>s&&(s=a));if(r>s)return this;this.cover(r).cover(s);for(let o=0;o<e;++o)h6e(this,n[o],i[o]);return this}function LJt(i){if(isNaN(i=+i))return this;var e=this._x0,n=this._x1;if(isNaN(e))n=(e=Math.floor(i))+1;else{for(var r=n-e||1,s=this._root,o,a;e>i||i>=n;)switch(a=+(i<e),o=new Array(2),o[a]=s,s=o,r*=2,a){case 0:n=e+r;break;case 1:e=n-r;break}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._x1=n,this}function DJt(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function EJt(i){return arguments.length?this.cover(+i[0][0]).cover(+i[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function xv(i,e,n){this.node=i,this.x0=e,this.x1=n}function IJt(i,e){var n,r=this._x0,s,o,a=this._x1,l=[],c=this._root,u,d;for(c&&l.push(new xv(c,r,a)),e==null?e=1/0:(r=i-e,a=i+e);u=l.pop();)if(!(!(c=u.node)||(s=u.x0)>a||(o=u.x1)<r))if(c.length){var h=(s+o)/2;l.push(new xv(c[1],h,o),new xv(c[0],s,h)),(d=+(i>=h))&&(u=l[l.length-1],l[l.length-1]=l[l.length-1-d],l[l.length-1-d]=u)}else{var f=Math.abs(i-+this._x.call(null,c.data));f<e&&(e=f,r=i-f,a=i+f,n=c.data)}return n}function TJt(i){if(isNaN(c=+this._x.call(null,i)))return this;var e,n=this._root,r,s,o,a=this._x0,l=this._x1,c,u,d,h,f;if(!n)return this;if(n.length)for(;;){if((d=c>=(u=(a+l)/2))?a=u:l=u,e=n,!(n=n[h=+d]))return this;if(!n.length)break;e[h+1&1]&&(r=e,f=h)}for(;n.data!==i;)if(s=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,s?(o?s.next=o:delete s.next,this):e?(o?e[h]=o:delete e[h],(n=e[0]||e[1])&&n===(e[1]||e[0])&&!n.length&&(r?r[f]=n:this._root=n),this):(this._root=o,this)}function RJt(i){for(var e=0,n=i.length;e<n;++e)this.remove(i[e]);return this}function AJt(){return this._root}function NJt(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function MJt(i){var e=[],n,r=this._root,s,o,a;for(r&&e.push(new xv(r,this._x0,this._x1));n=e.pop();)if(!i(r=n.node,o=n.x0,a=n.x1)&&r.length){var l=(o+a)/2;(s=r[1])&&e.push(new xv(s,l,a)),(s=r[0])&&e.push(new xv(s,o,l))}return this}function PJt(i){var e=[],n=[],r;for(this._root&&e.push(new xv(this._root,this._x0,this._x1));r=e.pop();){var s=r.node;if(s.length){var o,a=r.x0,l=r.x1,c=(a+l)/2;(o=s[0])&&e.push(new xv(o,a,c)),(o=s[1])&&e.push(new xv(o,c,l))}n.push(r)}for(;r=n.pop();)i(r.node,r.x0,r.x1);return this}function OJt(i){return i[0]}function FJt(i){return arguments.length?(this._x=i,this):this._x}function f6e(i,e){var n=new uue(e??OJt,NaN,NaN);return i==null?n:n.addAll(i)}function uue(i,e,n){this._x=i,this._x0=e,this._x1=n,this._root=void 0}function Txe(i){for(var e={data:i.data},n=e;i=i.next;)n=n.next={data:i.data};return e}var wd=f6e.prototype=uue.prototype;wd.copy=function(){var i=new uue(this._x,this._x0,this._x1),e=this._root,n,r;if(!e)return i;if(!e.length)return i._root=Txe(e),i;for(n=[{source:e,target:i._root=new Array(2)}];e=n.pop();)for(var s=0;s<2;++s)(r=e.source[s])&&(r.length?n.push({source:r,target:e.target[s]=new Array(2)}):e.target[s]=Txe(r));return i};wd.add=xJt;wd.addAll=kJt;wd.cover=LJt;wd.data=DJt;wd.extent=EJt;wd.find=IJt;wd.remove=TJt;wd.removeAll=RJt;wd.root=AJt;wd.size=NJt;wd.visit=MJt;wd.visitAfter=PJt;wd.x=FJt;function BJt(i){const e=+this._x.call(null,i),n=+this._y.call(null,i);return p6e(this.cover(e,n),e,n,i)}function p6e(i,e,n,r){if(isNaN(e)||isNaN(n))return i;var s,o=i._root,a={data:r},l=i._x0,c=i._y0,u=i._x1,d=i._y1,h,f,p,g,m,_,b,y;if(!o)return i._root=a,i;for(;o.length;)if((m=e>=(h=(l+u)/2))?l=h:u=h,(_=n>=(f=(c+d)/2))?c=f:d=f,s=o,!(o=o[b=_<<1|m]))return s[b]=a,i;if(p=+i._x.call(null,o.data),g=+i._y.call(null,o.data),e===p&&n===g)return a.next=o,s?s[b]=a:i._root=a,i;do s=s?s[b]=new Array(4):i._root=new Array(4),(m=e>=(h=(l+u)/2))?l=h:u=h,(_=n>=(f=(c+d)/2))?c=f:d=f;while((b=_<<1|m)===(y=(g>=f)<<1|p>=h));return s[y]=o,s[b]=a,i}function jJt(i){var e,n,r=i.length,s,o,a=new Array(r),l=new Array(r),c=1/0,u=1/0,d=-1/0,h=-1/0;for(n=0;n<r;++n)isNaN(s=+this._x.call(null,e=i[n]))||isNaN(o=+this._y.call(null,e))||(a[n]=s,l[n]=o,s<c&&(c=s),s>d&&(d=s),o<u&&(u=o),o>h&&(h=o));if(c>d||u>h)return this;for(this.cover(c,u).cover(d,h),n=0;n<r;++n)p6e(this,a[n],l[n],i[n]);return this}function WJt(i,e){if(isNaN(i=+i)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,s=this._x1,o=this._y1;if(isNaN(n))s=(n=Math.floor(i))+1,o=(r=Math.floor(e))+1;else{for(var a=s-n||1,l=this._root,c,u;n>i||i>=s||r>e||e>=o;)switch(u=(e<r)<<1|i<n,c=new Array(4),c[u]=l,l=c,a*=2,u){case 0:s=n+a,o=r+a;break;case 1:n=s-a,o=r+a;break;case 2:s=n+a,r=o-a;break;case 3:n=s-a,r=o-a;break}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=s,this._y1=o,this}function $Jt(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function zJt(i){return arguments.length?this.cover(+i[0][0],+i[0][1]).cover(+i[1][0],+i[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function eu(i,e,n,r,s){this.node=i,this.x0=e,this.y0=n,this.x1=r,this.y1=s}function VJt(i,e,n){var r,s=this._x0,o=this._y0,a,l,c,u,d=this._x1,h=this._y1,f=[],p=this._root,g,m;for(p&&f.push(new eu(p,s,o,d,h)),n==null?n=1/0:(s=i-n,o=e-n,d=i+n,h=e+n,n*=n);g=f.pop();)if(!(!(p=g.node)||(a=g.x0)>d||(l=g.y0)>h||(c=g.x1)<s||(u=g.y1)<o))if(p.length){var _=(a+c)/2,b=(l+u)/2;f.push(new eu(p[3],_,b,c,u),new eu(p[2],a,b,_,u),new eu(p[1],_,l,c,b),new eu(p[0],a,l,_,b)),(m=(e>=b)<<1|i>=_)&&(g=f[f.length-1],f[f.length-1]=f[f.length-1-m],f[f.length-1-m]=g)}else{var y=i-+this._x.call(null,p.data),x=e-+this._y.call(null,p.data),k=y*y+x*x;if(k<n){var D=Math.sqrt(n=k);s=i-D,o=e-D,d=i+D,h=e+D,r=p.data}}return r}function HJt(i){if(isNaN(d=+this._x.call(null,i))||isNaN(h=+this._y.call(null,i)))return this;var e,n=this._root,r,s,o,a=this._x0,l=this._y0,c=this._x1,u=this._y1,d,h,f,p,g,m,_,b;if(!n)return this;if(n.length)for(;;){if((g=d>=(f=(a+c)/2))?a=f:c=f,(m=h>=(p=(l+u)/2))?l=p:u=p,e=n,!(n=n[_=m<<1|g]))return this;if(!n.length)break;(e[_+1&3]||e[_+2&3]||e[_+3&3])&&(r=e,b=_)}for(;n.data!==i;)if(s=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,s?(o?s.next=o:delete s.next,this):e?(o?e[_]=o:delete e[_],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[b]=n:this._root=n),this):(this._root=o,this)}function UJt(i){for(var e=0,n=i.length;e<n;++e)this.remove(i[e]);return this}function qJt(){return this._root}function KJt(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function GJt(i){var e=[],n,r=this._root,s,o,a,l,c;for(r&&e.push(new eu(r,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!i(r=n.node,o=n.x0,a=n.y0,l=n.x1,c=n.y1)&&r.length){var u=(o+l)/2,d=(a+c)/2;(s=r[3])&&e.push(new eu(s,u,d,l,c)),(s=r[2])&&e.push(new eu(s,o,d,u,c)),(s=r[1])&&e.push(new eu(s,u,a,l,d)),(s=r[0])&&e.push(new eu(s,o,a,u,d))}return this}function XJt(i){var e=[],n=[],r;for(this._root&&e.push(new eu(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var s=r.node;if(s.length){var o,a=r.x0,l=r.y0,c=r.x1,u=r.y1,d=(a+c)/2,h=(l+u)/2;(o=s[0])&&e.push(new eu(o,a,l,d,h)),(o=s[1])&&e.push(new eu(o,d,l,c,h)),(o=s[2])&&e.push(new eu(o,a,h,d,u)),(o=s[3])&&e.push(new eu(o,d,h,c,u))}n.push(r)}for(;r=n.pop();)i(r.node,r.x0,r.y0,r.x1,r.y1);return this}function YJt(i){return i[0]}function ZJt(i){return arguments.length?(this._x=i,this):this._x}function QJt(i){return i[1]}function JJt(i){return arguments.length?(this._y=i,this):this._y}function g6e(i,e,n){var r=new due(e??YJt,n??QJt,NaN,NaN,NaN,NaN);return i==null?r:r.addAll(i)}function due(i,e,n,r,s,o){this._x=i,this._y=e,this._x0=n,this._y0=r,this._x1=s,this._y1=o,this._root=void 0}function Rxe(i){for(var e={data:i.data},n=e;i=i.next;)n=n.next={data:i.data};return e}var mu=g6e.prototype=due.prototype;mu.copy=function(){var i=new due(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,r;if(!e)return i;if(!e.length)return i._root=Rxe(e),i;for(n=[{source:e,target:i._root=new Array(4)}];e=n.pop();)for(var s=0;s<4;++s)(r=e.source[s])&&(r.length?n.push({source:r,target:e.target[s]=new Array(4)}):e.target[s]=Rxe(r));return i};mu.add=BJt;mu.addAll=jJt;mu.cover=WJt;mu.data=$Jt;mu.extent=zJt;mu.find=VJt;mu.remove=HJt;mu.removeAll=UJt;mu.root=qJt;mu.size=KJt;mu.visit=GJt;mu.visitAfter=XJt;mu.x=ZJt;mu.y=JJt;function een(i){const e=+this._x.call(null,i),n=+this._y.call(null,i),r=+this._z.call(null,i);return m6e(this.cover(e,n,r),e,n,r,i)}function m6e(i,e,n,r,s){if(isNaN(e)||isNaN(n)||isNaN(r))return i;var o,a=i._root,l={data:s},c=i._x0,u=i._y0,d=i._z0,h=i._x1,f=i._y1,p=i._z1,g,m,_,b,y,x,k,D,R,E,A;if(!a)return i._root=l,i;for(;a.length;)if((k=e>=(g=(c+h)/2))?c=g:h=g,(D=n>=(m=(u+f)/2))?u=m:f=m,(R=r>=(_=(d+p)/2))?d=_:p=_,o=a,!(a=a[E=R<<2|D<<1|k]))return o[E]=l,i;if(b=+i._x.call(null,a.data),y=+i._y.call(null,a.data),x=+i._z.call(null,a.data),e===b&&n===y&&r===x)return l.next=a,o?o[E]=l:i._root=l,i;do o=o?o[E]=new Array(8):i._root=new Array(8),(k=e>=(g=(c+h)/2))?c=g:h=g,(D=n>=(m=(u+f)/2))?u=m:f=m,(R=r>=(_=(d+p)/2))?d=_:p=_;while((E=R<<2|D<<1|k)===(A=(x>=_)<<2|(y>=m)<<1|b>=g));return o[A]=a,o[E]=l,i}function ten(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,n=new Float64Array(e),r=new Float64Array(e),s=new Float64Array(e);let o=1/0,a=1/0,l=1/0,c=-1/0,u=-1/0,d=-1/0;for(let h=0,f,p,g,m;h<e;++h)isNaN(p=+this._x.call(null,f=i[h]))||isNaN(g=+this._y.call(null,f))||isNaN(m=+this._z.call(null,f))||(n[h]=p,r[h]=g,s[h]=m,p<o&&(o=p),p>c&&(c=p),g<a&&(a=g),g>u&&(u=g),m<l&&(l=m),m>d&&(d=m));if(o>c||a>u||l>d)return this;this.cover(o,a,l).cover(c,u,d);for(let h=0;h<e;++h)m6e(this,n[h],r[h],s[h],i[h]);return this}function nen(i,e,n){if(isNaN(i=+i)||isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,s=this._y0,o=this._z0,a=this._x1,l=this._y1,c=this._z1;if(isNaN(r))a=(r=Math.floor(i))+1,l=(s=Math.floor(e))+1,c=(o=Math.floor(n))+1;else{for(var u=a-r||1,d=this._root,h,f;r>i||i>=a||s>e||e>=l||o>n||n>=c;)switch(f=(n<o)<<2|(e<s)<<1|i<r,h=new Array(8),h[f]=d,d=h,u*=2,f){case 0:a=r+u,l=s+u,c=o+u;break;case 1:r=a-u,l=s+u,c=o+u;break;case 2:a=r+u,s=l-u,c=o+u;break;case 3:r=a-u,s=l-u,c=o+u;break;case 4:a=r+u,l=s+u,o=c-u;break;case 5:r=a-u,l=s+u,o=c-u;break;case 6:a=r+u,s=l-u,o=c-u;break;case 7:r=a-u,s=l-u,o=c-u;break}this._root&&this._root.length&&(this._root=d)}return this._x0=r,this._y0=s,this._z0=o,this._x1=a,this._y1=l,this._z1=c,this}function ien(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function ren(i){return arguments.length?this.cover(+i[0][0],+i[0][1],+i[0][2]).cover(+i[1][0],+i[1][1],+i[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function Ts(i,e,n,r,s,o,a){this.node=i,this.x0=e,this.y0=n,this.z0=r,this.x1=s,this.y1=o,this.z1=a}function sen(i,e,n,r){var s,o=this._x0,a=this._y0,l=this._z0,c,u,d,h,f,p,g=this._x1,m=this._y1,_=this._z1,b=[],y=this._root,x,k;for(y&&b.push(new Ts(y,o,a,l,g,m,_)),r==null?r=1/0:(o=i-r,a=e-r,l=n-r,g=i+r,m=e+r,_=n+r,r*=r);x=b.pop();)if(!(!(y=x.node)||(c=x.x0)>g||(u=x.y0)>m||(d=x.z0)>_||(h=x.x1)<o||(f=x.y1)<a||(p=x.z1)<l))if(y.length){var D=(c+h)/2,R=(u+f)/2,E=(d+p)/2;b.push(new Ts(y[7],D,R,E,h,f,p),new Ts(y[6],c,R,E,D,f,p),new Ts(y[5],D,u,E,h,R,p),new Ts(y[4],c,u,E,D,R,p),new Ts(y[3],D,R,d,h,f,E),new Ts(y[2],c,R,d,D,f,E),new Ts(y[1],D,u,d,h,R,E),new Ts(y[0],c,u,d,D,R,E)),(k=(n>=E)<<2|(e>=R)<<1|i>=D)&&(x=b[b.length-1],b[b.length-1]=b[b.length-1-k],b[b.length-1-k]=x)}else{var A=i-+this._x.call(null,y.data),M=e-+this._y.call(null,y.data),N=n-+this._z.call(null,y.data),P=A*A+M*M+N*N;if(P<r){var O=Math.sqrt(r=P);o=i-O,a=e-O,l=n-O,g=i+O,m=e+O,_=n+O,s=y.data}}return s}const oen=(i,e,n,r,s,o)=>Math.sqrt((i-r)**2+(e-s)**2+(n-o)**2);function aen(i,e,n,r){const s=[],o=i-r,a=e-r,l=n-r,c=i+r,u=e+r,d=n+r;return this.visit((h,f,p,g,m,_,b)=>{if(!h.length)do{const y=h.data;oen(i,e,n,this._x(y),this._y(y),this._z(y))<=r&&s.push(y)}while(h=h.next);return f>c||p>u||g>d||m<o||_<a||b<l}),s}function len(i){if(isNaN(f=+this._x.call(null,i))||isNaN(p=+this._y.call(null,i))||isNaN(g=+this._z.call(null,i)))return this;var e,n=this._root,r,s,o,a=this._x0,l=this._y0,c=this._z0,u=this._x1,d=this._y1,h=this._z1,f,p,g,m,_,b,y,x,k,D,R;if(!n)return this;if(n.length)for(;;){if((y=f>=(m=(a+u)/2))?a=m:u=m,(x=p>=(_=(l+d)/2))?l=_:d=_,(k=g>=(b=(c+h)/2))?c=b:h=b,e=n,!(n=n[D=k<<2|x<<1|y]))return this;if(!n.length)break;(e[D+1&7]||e[D+2&7]||e[D+3&7]||e[D+4&7]||e[D+5&7]||e[D+6&7]||e[D+7&7])&&(r=e,R=D)}for(;n.data!==i;)if(s=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,s?(o?s.next=o:delete s.next,this):e?(o?e[D]=o:delete e[D],(n=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&n===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[R]=n:this._root=n),this):(this._root=o,this)}function cen(i){for(var e=0,n=i.length;e<n;++e)this.remove(i[e]);return this}function uen(){return this._root}function den(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function hen(i){var e=[],n,r=this._root,s,o,a,l,c,u,d;for(r&&e.push(new Ts(r,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));n=e.pop();)if(!i(r=n.node,o=n.x0,a=n.y0,l=n.z0,c=n.x1,u=n.y1,d=n.z1)&&r.length){var h=(o+c)/2,f=(a+u)/2,p=(l+d)/2;(s=r[7])&&e.push(new Ts(s,h,f,p,c,u,d)),(s=r[6])&&e.push(new Ts(s,o,f,p,h,u,d)),(s=r[5])&&e.push(new Ts(s,h,a,p,c,f,d)),(s=r[4])&&e.push(new Ts(s,o,a,p,h,f,d)),(s=r[3])&&e.push(new Ts(s,h,f,l,c,u,p)),(s=r[2])&&e.push(new Ts(s,o,f,l,h,u,p)),(s=r[1])&&e.push(new Ts(s,h,a,l,c,f,p)),(s=r[0])&&e.push(new Ts(s,o,a,l,h,f,p))}return this}function fen(i){var e=[],n=[],r;for(this._root&&e.push(new Ts(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=e.pop();){var s=r.node;if(s.length){var o,a=r.x0,l=r.y0,c=r.z0,u=r.x1,d=r.y1,h=r.z1,f=(a+u)/2,p=(l+d)/2,g=(c+h)/2;(o=s[0])&&e.push(new Ts(o,a,l,c,f,p,g)),(o=s[1])&&e.push(new Ts(o,f,l,c,u,p,g)),(o=s[2])&&e.push(new Ts(o,a,p,c,f,d,g)),(o=s[3])&&e.push(new Ts(o,f,p,c,u,d,g)),(o=s[4])&&e.push(new Ts(o,a,l,g,f,p,h)),(o=s[5])&&e.push(new Ts(o,f,l,g,u,p,h)),(o=s[6])&&e.push(new Ts(o,a,p,g,f,d,h)),(o=s[7])&&e.push(new Ts(o,f,p,g,u,d,h))}n.push(r)}for(;r=n.pop();)i(r.node,r.x0,r.y0,r.z0,r.x1,r.y1,r.z1);return this}function pen(i){return i[0]}function gen(i){return arguments.length?(this._x=i,this):this._x}function men(i){return i[1]}function _en(i){return arguments.length?(this._y=i,this):this._y}function ven(i){return i[2]}function ben(i){return arguments.length?(this._z=i,this):this._z}function _6e(i,e,n,r){var s=new hue(e??pen,n??men,r??ven,NaN,NaN,NaN,NaN,NaN,NaN);return i==null?s:s.addAll(i)}function hue(i,e,n,r,s,o,a,l,c){this._x=i,this._y=e,this._z=n,this._x0=r,this._y0=s,this._z0=o,this._x1=a,this._y1=l,this._z1=c,this._root=void 0}function Axe(i){for(var e={data:i.data},n=e;i=i.next;)n=n.next={data:i.data};return e}var Yl=_6e.prototype=hue.prototype;Yl.copy=function(){var i=new hue(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,n,r;if(!e)return i;if(!e.length)return i._root=Axe(e),i;for(n=[{source:e,target:i._root=new Array(8)}];e=n.pop();)for(var s=0;s<8;++s)(r=e.source[s])&&(r.length?n.push({source:r,target:e.target[s]=new Array(8)}):e.target[s]=Axe(r));return i};Yl.add=een;Yl.addAll=ten;Yl.cover=nen;Yl.data=ien;Yl.extent=ren;Yl.find=sen;Yl.findAllWithinRadius=aen;Yl.remove=len;Yl.removeAll=cen;Yl.root=uen;Yl.size=den;Yl.visit=hen;Yl.visitAfter=fen;Yl.x=gen;Yl.y=_en;Yl.z=ben;function uv(i){return function(){return i}}function j0(i){return(i()-.5)*1e-6}function yen(i){return i.index}function Nxe(i,e){var n=i.get(e);if(!n)throw new Error("node not found: "+e);return n}function wen(i){var e=yen,n=f,r,s=uv(30),o,a,l,c,u,d,h=1;i==null&&(i=[]);function f(b){return 1/Math.min(c[b.source.index],c[b.target.index])}function p(b){for(var y=0,x=i.length;y<h;++y)for(var k=0,D,R,E,A=0,M=0,N=0,P,O;k<x;++k)D=i[k],R=D.source,E=D.target,A=E.x+E.vx-R.x-R.vx||j0(d),l>1&&(M=E.y+E.vy-R.y-R.vy||j0(d)),l>2&&(N=E.z+E.vz-R.z-R.vz||j0(d)),P=Math.sqrt(A*A+M*M+N*N),P=(P-o[k])/P*b*r[k],A*=P,M*=P,N*=P,E.vx-=A*(O=u[k]),l>1&&(E.vy-=M*O),l>2&&(E.vz-=N*O),R.vx+=A*(O=1-O),l>1&&(R.vy+=M*O),l>2&&(R.vz+=N*O)}function g(){if(a){var b,y=a.length,x=i.length,k=new Map(a.map((R,E)=>[e(R,E,a),R])),D;for(b=0,c=new Array(y);b<x;++b)D=i[b],D.index=b,typeof D.source!="object"&&(D.source=Nxe(k,D.source)),typeof D.target!="object"&&(D.target=Nxe(k,D.target)),c[D.source.index]=(c[D.source.index]||0)+1,c[D.target.index]=(c[D.target.index]||0)+1;for(b=0,u=new Array(x);b<x;++b)D=i[b],u[b]=c[D.source.index]/(c[D.source.index]+c[D.target.index]);r=new Array(x),m(),o=new Array(x),_()}}function m(){if(a)for(var b=0,y=i.length;b<y;++b)r[b]=+n(i[b],b,i)}function _(){if(a)for(var b=0,y=i.length;b<y;++b)o[b]=+s(i[b],b,i)}return p.initialize=function(b,...y){a=b,d=y.find(x=>typeof x=="function")||Math.random,l=y.find(x=>[1,2,3].includes(x))||2,g()},p.links=function(b){return arguments.length?(i=b,g(),p):i},p.id=function(b){return arguments.length?(e=b,p):e},p.iterations=function(b){return arguments.length?(h=+b,p):h},p.strength=function(b){return arguments.length?(n=typeof b=="function"?b:uv(+b),m(),p):n},p.distance=function(b){return arguments.length?(s=typeof b=="function"?b:uv(+b),_(),p):s},p}const Cen=1664525,Sen=1013904223,Mxe=4294967296;function xen(){let i=1;return()=>(i=(Cen*i+Sen)%Mxe)/Mxe}var Pxe=3;function dZ(i){return i.x}function Oxe(i){return i.y}function ken(i){return i.z}var Len=10,Den=Math.PI*(3-Math.sqrt(5)),Een=Math.PI*20/(9+Math.sqrt(221));function Ien(i,e){e=e||2;var n=Math.min(Pxe,Math.max(1,Math.round(e))),r,s=1,o=.001,a=1-Math.pow(o,1/300),l=0,c=.6,u=new Map,d=sue(p),h=j4("tick","end"),f=xen();i==null&&(i=[]);function p(){g(),h.call("tick",r),s<o&&(d.stop(),h.call("end",r))}function g(b){var y,x=i.length,k;b===void 0&&(b=1);for(var D=0;D<b;++D)for(s+=(l-s)*a,u.forEach(function(R){R(s)}),y=0;y<x;++y)k=i[y],k.fx==null?k.x+=k.vx*=c:(k.x=k.fx,k.vx=0),n>1&&(k.fy==null?k.y+=k.vy*=c:(k.y=k.fy,k.vy=0)),n>2&&(k.fz==null?k.z+=k.vz*=c:(k.z=k.fz,k.vz=0));return r}function m(){for(var b=0,y=i.length,x;b<y;++b){if(x=i[b],x.index=b,x.fx!=null&&(x.x=x.fx),x.fy!=null&&(x.y=x.fy),x.fz!=null&&(x.z=x.fz),isNaN(x.x)||n>1&&isNaN(x.y)||n>2&&isNaN(x.z)){var k=Len*(n>2?Math.cbrt(.5+b):n>1?Math.sqrt(.5+b):b),D=b*Den,R=b*Een;n===1?x.x=k:n===2?(x.x=k*Math.cos(D),x.y=k*Math.sin(D)):(x.x=k*Math.sin(D)*Math.cos(R),x.y=k*Math.cos(D),x.z=k*Math.sin(D)*Math.sin(R))}(isNaN(x.vx)||n>1&&isNaN(x.vy)||n>2&&isNaN(x.vz))&&(x.vx=0,n>1&&(x.vy=0),n>2&&(x.vz=0))}}function _(b){return b.initialize&&b.initialize(i,f,n),b}return m(),r={tick:g,restart:function(){return d.restart(p),r},stop:function(){return d.stop(),r},numDimensions:function(b){return arguments.length?(n=Math.min(Pxe,Math.max(1,Math.round(b))),u.forEach(_),r):n},nodes:function(b){return arguments.length?(i=b,m(),u.forEach(_),r):i},alpha:function(b){return arguments.length?(s=+b,r):s},alphaMin:function(b){return arguments.length?(o=+b,r):o},alphaDecay:function(b){return arguments.length?(a=+b,r):+a},alphaTarget:function(b){return arguments.length?(l=+b,r):l},velocityDecay:function(b){return arguments.length?(c=1-b,r):1-c},randomSource:function(b){return arguments.length?(f=b,u.forEach(_),r):f},force:function(b,y){return arguments.length>1?(y==null?u.delete(b):u.set(b,_(y)),r):u.get(b)},find:function(){var b=Array.prototype.slice.call(arguments),y=b.shift()||0,x=(n>1?b.shift():null)||0,k=(n>2?b.shift():null)||0,D=b.shift()||1/0,R=0,E=i.length,A,M,N,P,O,B;for(D*=D,R=0;R<E;++R)O=i[R],A=y-O.x,M=x-(O.y||0),N=k-(O.z||0),P=A*A+M*M+N*N,P<D&&(B=O,D=P);return B},on:function(b,y){return arguments.length>1?(h.on(b,y),r):h.on(b)}}}function Ten(){var i,e,n,r,s,o=uv(-30),a,l=1,c=1/0,u=.81;function d(g){var m,_=i.length,b=(e===1?f6e(i,dZ):e===2?g6e(i,dZ,Oxe):e===3?_6e(i,dZ,Oxe,ken):null).visitAfter(f);for(s=g,m=0;m<_;++m)n=i[m],b.visit(p)}function h(){if(i){var g,m=i.length,_;for(a=new Array(m),g=0;g<m;++g)_=i[g],a[_.index]=+o(_,g,i)}}function f(g){var m=0,_,b,y=0,x,k,D,R,E=g.length;if(E){for(x=k=D=R=0;R<E;++R)(_=g[R])&&(b=Math.abs(_.value))&&(m+=_.value,y+=b,x+=b*(_.x||0),k+=b*(_.y||0),D+=b*(_.z||0));m*=Math.sqrt(4/E),g.x=x/y,e>1&&(g.y=k/y),e>2&&(g.z=D/y)}else{_=g,_.x=_.data.x,e>1&&(_.y=_.data.y),e>2&&(_.z=_.data.z);do m+=a[_.data.index];while(_=_.next)}g.value=m}function p(g,m,_,b,y){if(!g.value)return!0;var x=[_,b,y][e-1],k=g.x-n.x,D=e>1?g.y-n.y:0,R=e>2?g.z-n.z:0,E=x-m,A=k*k+D*D+R*R;if(E*E/u<A)return A<c&&(k===0&&(k=j0(r),A+=k*k),e>1&&D===0&&(D=j0(r),A+=D*D),e>2&&R===0&&(R=j0(r),A+=R*R),A<l&&(A=Math.sqrt(l*A)),n.vx+=k*g.value*s/A,e>1&&(n.vy+=D*g.value*s/A),e>2&&(n.vz+=R*g.value*s/A)),!0;if(g.length||A>=c)return;(g.data!==n||g.next)&&(k===0&&(k=j0(r),A+=k*k),e>1&&D===0&&(D=j0(r),A+=D*D),e>2&&R===0&&(R=j0(r),A+=R*R),A<l&&(A=Math.sqrt(l*A)));do g.data!==n&&(E=a[g.data.index]*s/A,n.vx+=k*E,e>1&&(n.vy+=D*E),e>2&&(n.vz+=R*E));while(g=g.next)}return d.initialize=function(g,...m){i=g,r=m.find(_=>typeof _=="function")||Math.random,e=m.find(_=>[1,2,3].includes(_))||2,h()},d.strength=function(g){return arguments.length?(o=typeof g=="function"?g:uv(+g),h(),d):o},d.distanceMin=function(g){return arguments.length?(l=g*g,d):Math.sqrt(l)},d.distanceMax=function(g){return arguments.length?(c=g*g,d):Math.sqrt(c)},d.theta=function(g){return arguments.length?(u=g*g,d):Math.sqrt(u)},d}function Ren(i,e,n,r){var s,o,a=uv(.1),l,c;typeof i!="function"&&(i=uv(+i)),e==null&&(e=0),n==null&&(n=0),r==null&&(r=0);function u(h){for(var f=0,p=s.length;f<p;++f){var g=s[f],m=g.x-e||1e-6,_=(g.y||0)-n||1e-6,b=(g.z||0)-r||1e-6,y=Math.sqrt(m*m+_*_+b*b),x=(c[f]-y)*l[f]*h/y;g.vx+=m*x,o>1&&(g.vy+=_*x),o>2&&(g.vz+=b*x)}}function d(){if(s){var h,f=s.length;for(l=new Array(f),c=new Array(f),h=0;h<f;++h)c[h]=+i(s[h],h,s),l[h]=isNaN(c[h])?0:+a(s[h],h,s)}}return u.initialize=function(h,...f){s=h,o=f.find(p=>[1,2,3].includes(p))||2,d()},u.strength=function(h){return arguments.length?(a=typeof h=="function"?h:uv(+h),d(),u):a},u.radius=function(h){return arguments.length?(i=typeof h=="function"?h:uv(+h),d(),u):i},u.x=function(h){return arguments.length?(e=+h,u):e},u.y=function(h){return arguments.length?(n=+h,u):n},u.z=function(h){return arguments.length?(r=+h,u):r},u}const{abs:KA,cos:v0,sin:PD,acos:Aen,atan2:GA,sqrt:Vb,pow:Jh}=Math;function XA(i){return i<0?-Jh(-i,1/3):Jh(i,1/3)}const v6e=Math.PI,HB=2*v6e,Hb=v6e/2,Nen=1e-6,hZ=Number.MAX_SAFE_INTEGER||9007199254740991,fZ=Number.MIN_SAFE_INTEGER||-9007199254740991,Men={x:0,y:0,z:0},Kt={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(i,e){const n=e(i);let r=n.x*n.x+n.y*n.y;return typeof n.z<"u"&&(r+=n.z*n.z),Vb(r)},compute:function(i,e,n){if(i===0)return e[0].t=0,e[0];const r=e.length-1;if(i===1)return e[r].t=1,e[r];const s=1-i;let o=e;if(r===0)return e[0].t=i,e[0];if(r===1){const l={x:s*o[0].x+i*o[1].x,y:s*o[0].y+i*o[1].y,t:i};return n&&(l.z=s*o[0].z+i*o[1].z),l}if(r<4){let l=s*s,c=i*i,u,d,h,f=0;r===2?(o=[o[0],o[1],o[2],Men],u=l,d=s*i*2,h=c):r===3&&(u=l*s,d=l*i*3,h=s*c*3,f=i*c);const p={x:u*o[0].x+d*o[1].x+h*o[2].x+f*o[3].x,y:u*o[0].y+d*o[1].y+h*o[2].y+f*o[3].y,t:i};return n&&(p.z=u*o[0].z+d*o[1].z+h*o[2].z+f*o[3].z),p}const a=JSON.parse(JSON.stringify(e));for(;a.length>1;){for(let l=0;l<a.length-1;l++)a[l]={x:a[l].x+(a[l+1].x-a[l].x)*i,y:a[l].y+(a[l+1].y-a[l].y)*i},typeof a[l].z<"u"&&(a[l].z=a[l].z+(a[l+1].z-a[l].z)*i);a.splice(a.length-1,1)}return a[0].t=i,a[0]},computeWithRatios:function(i,e,n,r){const s=1-i,o=n,a=e;let l=o[0],c=o[1],u=o[2],d=o[3],h;if(l*=s,c*=i,a.length===2)return h=l+c,{x:(l*a[0].x+c*a[1].x)/h,y:(l*a[0].y+c*a[1].y)/h,z:r?(l*a[0].z+c*a[1].z)/h:!1,t:i};if(l*=s,c*=2*s,u*=i*i,a.length===3)return h=l+c+u,{x:(l*a[0].x+c*a[1].x+u*a[2].x)/h,y:(l*a[0].y+c*a[1].y+u*a[2].y)/h,z:r?(l*a[0].z+c*a[1].z+u*a[2].z)/h:!1,t:i};if(l*=s,c*=1.5*s,u*=3*s,d*=i*i*i,a.length===4)return h=l+c+u+d,{x:(l*a[0].x+c*a[1].x+u*a[2].x+d*a[3].x)/h,y:(l*a[0].y+c*a[1].y+u*a[2].y+d*a[3].y)/h,z:r?(l*a[0].z+c*a[1].z+u*a[2].z+d*a[3].z)/h:!1,t:i}},derive:function(i,e){const n=[];for(let r=i,s=r.length,o=s-1;s>1;s--,o--){const a=[];for(let l=0,c;l<o;l++)c={x:o*(r[l+1].x-r[l].x),y:o*(r[l+1].y-r[l].y)},e&&(c.z=o*(r[l+1].z-r[l].z)),a.push(c);n.push(a),r=a}return n},between:function(i,e,n){return e<=i&&i<=n||Kt.approximately(i,e)||Kt.approximately(i,n)},approximately:function(i,e,n){return KA(i-e)<=(n||Nen)},length:function(i){const n=Kt.Tvalues.length;let r=0;for(let s=0,o;s<n;s++)o=.5*Kt.Tvalues[s]+.5,r+=Kt.Cvalues[s]*Kt.arcfn(o,i);return .5*r},map:function(i,e,n,r,s){const o=n-e,a=s-r,l=i-e,c=l/o;return r+a*c},lerp:function(i,e,n){const r={x:e.x+i*(n.x-e.x),y:e.y+i*(n.y-e.y)};return e.z!==void 0&&n.z!==void 0&&(r.z=e.z+i*(n.z-e.z)),r},pointToString:function(i){let e=i.x+"/"+i.y;return typeof i.z<"u"&&(e+="/"+i.z),e},pointsToString:function(i){return"["+i.map(Kt.pointToString).join(", ")+"]"},copy:function(i){return JSON.parse(JSON.stringify(i))},angle:function(i,e,n){const r=e.x-i.x,s=e.y-i.y,o=n.x-i.x,a=n.y-i.y,l=r*a-s*o,c=r*o+s*a;return GA(l,c)},round:function(i,e){const n=""+i,r=n.indexOf(".");return parseFloat(n.substring(0,r+1+e))},dist:function(i,e){const n=i.x-e.x,r=i.y-e.y;return Vb(n*n+r*r)},closest:function(i,e){let n=Jh(2,63),r,s;return i.forEach(function(o,a){s=Kt.dist(e,o),s<n&&(n=s,r=a)}),{mdist:n,mpos:r}},abcratio:function(i,e){if(e!==2&&e!==3)return!1;if(typeof i>"u")i=.5;else if(i===0||i===1)return i;const n=Jh(i,e)+Jh(1-i,e),r=n-1;return KA(r/n)},projectionratio:function(i,e){if(e!==2&&e!==3)return!1;if(typeof i>"u")i=.5;else if(i===0||i===1)return i;const n=Jh(1-i,e),r=Jh(i,e)+n;return n/r},lli8:function(i,e,n,r,s,o,a,l){const c=(i*r-e*n)*(s-a)-(i-n)*(s*l-o*a),u=(i*r-e*n)*(o-l)-(e-r)*(s*l-o*a),d=(i-n)*(o-l)-(e-r)*(s-a);return d==0?!1:{x:c/d,y:u/d}},lli4:function(i,e,n,r){const s=i.x,o=i.y,a=e.x,l=e.y,c=n.x,u=n.y,d=r.x,h=r.y;return Kt.lli8(s,o,a,l,c,u,d,h)},lli:function(i,e){return Kt.lli4(i,i.c,e,e.c)},makeline:function(i,e){return new Js(i.x,i.y,(i.x+e.x)/2,(i.y+e.y)/2,e.x,e.y)},findbbox:function(i){let e=hZ,n=hZ,r=fZ,s=fZ;return i.forEach(function(o){const a=o.bbox();e>a.x.min&&(e=a.x.min),n>a.y.min&&(n=a.y.min),r<a.x.max&&(r=a.x.max),s<a.y.max&&(s=a.y.max)}),{x:{min:e,mid:(e+r)/2,max:r,size:r-e},y:{min:n,mid:(n+s)/2,max:s,size:s-n}}},shapeintersections:function(i,e,n,r,s){if(!Kt.bboxoverlap(e,r))return[];const o=[],a=[i.startcap,i.forward,i.back,i.endcap],l=[n.startcap,n.forward,n.back,n.endcap];return a.forEach(function(c){c.virtual||l.forEach(function(u){if(u.virtual)return;const d=c.intersects(u,s);d.length>0&&(d.c1=c,d.c2=u,d.s1=i,d.s2=n,o.push(d))})}),o},makeshape:function(i,e,n){const r=e.points.length,s=i.points.length,o=Kt.makeline(e.points[r-1],i.points[0]),a=Kt.makeline(i.points[s-1],e.points[0]),l={startcap:o,forward:i,back:e,endcap:a,bbox:Kt.findbbox([o,i,e,a])};return l.intersections=function(c){return Kt.shapeintersections(l,l.bbox,c,c.bbox,n)},l},getminmax:function(i,e,n){if(!n)return{min:0,max:0};let r=hZ,s=fZ,o,a;n.indexOf(0)===-1&&(n=[0].concat(n)),n.indexOf(1)===-1&&n.push(1);for(let l=0,c=n.length;l<c;l++)o=n[l],a=i.get(o),a[e]<r&&(r=a[e]),a[e]>s&&(s=a[e]);return{min:r,mid:(r+s)/2,max:s,size:s-r}},align:function(i,e){const n=e.p1.x,r=e.p1.y,s=-GA(e.p2.y-r,e.p2.x-n),o=function(a){return{x:(a.x-n)*v0(s)-(a.y-r)*PD(s),y:(a.x-n)*PD(s)+(a.y-r)*v0(s)}};return i.map(o)},roots:function(i,e){e=e||{p1:{x:0,y:0},p2:{x:1,y:0}};const n=i.length-1,r=Kt.align(i,e),s=function(E){return 0<=E&&E<=1};if(n===2){const E=r[0].y,A=r[1].y,M=r[2].y,N=E-2*A+M;if(N!==0){const P=-Vb(A*A-E*M),O=-E+A,B=-(P+O)/N,j=-(-P+O)/N;return[B,j].filter(s)}else if(A!==M&&N===0)return[(2*A-M)/(2*A-2*M)].filter(s);return[]}const o=r[0].y,a=r[1].y,l=r[2].y,c=r[3].y;let u=-o+3*a-3*l+c,d=3*o-6*a+3*l,h=-3*o+3*a,f=o;if(Kt.approximately(u,0)){if(Kt.approximately(d,0))return Kt.approximately(h,0)?[]:[-f/h].filter(s);const E=Vb(h*h-4*d*f),A=2*d;return[(E-h)/A,(-h-E)/A].filter(s)}d/=u,h/=u,f/=u;const p=(3*h-d*d)/3,g=p/3,m=(2*d*d*d-9*d*h+27*f)/27,_=m/2,b=_*_+g*g*g;let y,x,k,D,R;if(b<0){const E=-p/3,A=E*E*E,M=Vb(A),N=-m/(2*M),P=N<-1?-1:N>1?1:N,O=Aen(P),B=XA(M),j=2*B;return k=j*v0(O/3)-d/3,D=j*v0((O+HB)/3)-d/3,R=j*v0((O+2*HB)/3)-d/3,[k,D,R].filter(s)}else{if(b===0)return y=_<0?XA(-_):-XA(_),k=2*y-d/3,D=-y-d/3,[k,D].filter(s);{const E=Vb(b);return y=XA(-_+E),x=XA(_+E),[y-x-d/3].filter(s)}}},droots:function(i){if(i.length===3){const e=i[0],n=i[1],r=i[2],s=e-2*n+r;if(s!==0){const o=-Vb(n*n-e*r),a=-e+n,l=-(o+a)/s,c=-(-o+a)/s;return[l,c]}else if(n!==r&&s===0)return[(2*n-r)/(2*(n-r))];return[]}if(i.length===2){const e=i[0],n=i[1];return e!==n?[e/(e-n)]:[]}return[]},curvature:function(i,e,n,r,s){let o,a,l,c,u=0,d=0;const h=Kt.compute(i,e),f=Kt.compute(i,n),p=h.x*h.x+h.y*h.y;if(r?(o=Vb(Jh(h.y*f.z-f.y*h.z,2)+Jh(h.z*f.x-f.z*h.x,2)+Jh(h.x*f.y-f.x*h.y,2)),a=Jh(p+h.z*h.z,3/2)):(o=h.x*f.y-h.y*f.x,a=Jh(p,3/2)),o===0||a===0)return{k:0,r:0};if(u=o/a,d=a/o,!s){const g=Kt.curvature(i-.001,e,n,r,!0).k,m=Kt.curvature(i+.001,e,n,r,!0).k;c=(m-u+(u-g))/2,l=(KA(m-u)+KA(u-g))/2}return{k:u,r:d,dk:c,adk:l}},inflections:function(i){if(i.length<4)return[];const e=Kt.align(i,{p1:i[0],p2:i.slice(-1)[0]}),n=e[2].x*e[1].y,r=e[3].x*e[1].y,s=e[1].x*e[2].y,o=e[3].x*e[2].y,a=18*(-3*n+2*r+3*s-o),l=18*(3*n-r-3*s),c=18*(s-n);if(Kt.approximately(a,0)){if(!Kt.approximately(l,0)){let f=-c/l;if(0<=f&&f<=1)return[f]}return[]}const u=2*a;if(Kt.approximately(u,0))return[];const d=l*l-4*a*c;if(d<0)return[];const h=Math.sqrt(d);return[(h-l)/u,-(l+h)/u].filter(function(f){return 0<=f&&f<=1})},bboxoverlap:function(i,e){const n=["x","y"],r=n.length;for(let s=0,o,a,l,c;s<r;s++)if(o=n[s],a=i[o].mid,l=e[o].mid,c=(i[o].size+e[o].size)/2,KA(a-l)>=c)return!1;return!0},expandbox:function(i,e){e.x.min<i.x.min&&(i.x.min=e.x.min),e.y.min<i.y.min&&(i.y.min=e.y.min),e.z&&e.z.min<i.z.min&&(i.z.min=e.z.min),e.x.max>i.x.max&&(i.x.max=e.x.max),e.y.max>i.y.max&&(i.y.max=e.y.max),e.z&&e.z.max>i.z.max&&(i.z.max=e.z.max),i.x.mid=(i.x.min+i.x.max)/2,i.y.mid=(i.y.min+i.y.max)/2,i.z&&(i.z.mid=(i.z.min+i.z.max)/2),i.x.size=i.x.max-i.x.min,i.y.size=i.y.max-i.y.min,i.z&&(i.z.size=i.z.max-i.z.min)},pairiteration:function(i,e,n){const r=i.bbox(),s=e.bbox(),o=1e5,a=n||.5;if(r.x.size+r.y.size<a&&s.x.size+s.y.size<a)return[(o*(i._t1+i._t2)/2|0)/o+"/"+(o*(e._t1+e._t2)/2|0)/o];let l=i.split(.5),c=e.split(.5),u=[{left:l.left,right:c.left},{left:l.left,right:c.right},{left:l.right,right:c.right},{left:l.right,right:c.left}];u=u.filter(function(h){return Kt.bboxoverlap(h.left.bbox(),h.right.bbox())});let d=[];return u.length===0||(u.forEach(function(h){d=d.concat(Kt.pairiteration(h.left,h.right,a))}),d=d.filter(function(h,f){return d.indexOf(h)===f})),d},getccenter:function(i,e,n){const r=e.x-i.x,s=e.y-i.y,o=n.x-e.x,a=n.y-e.y,l=r*v0(Hb)-s*PD(Hb),c=r*PD(Hb)+s*v0(Hb),u=o*v0(Hb)-a*PD(Hb),d=o*PD(Hb)+a*v0(Hb),h=(i.x+e.x)/2,f=(i.y+e.y)/2,p=(e.x+n.x)/2,g=(e.y+n.y)/2,m=h+l,_=f+c,b=p+u,y=g+d,x=Kt.lli8(h,f,m,_,p,g,b,y),k=Kt.dist(x,i);let D=GA(i.y-x.y,i.x-x.x),R=GA(e.y-x.y,e.x-x.x),E=GA(n.y-x.y,n.x-x.x),A;return D<E?((D>R||R>E)&&(D+=HB),D>E&&(A=E,E=D,D=A)):E<R&&R<D?(A=E,E=D,D=A):E+=HB,x.s=D,x.e=E,x.r=k,x},numberSort:function(i,e){return i-e}};class $M{constructor(e){this.curves=[],this._3d=!1,e&&(this.curves=e,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(e){return Kt.pointsToString(e.points)}).join(", ")+"]"}addCurve(e){this.curves.push(e),this._3d=this._3d||e._3d}length(){return this.curves.map(function(e){return e.length()}).reduce(function(e,n){return e+n})}curve(e){return this.curves[e]}bbox(){const e=this.curves;for(var n=e[0].bbox(),r=1;r<e.length;r++)Kt.expandbox(n,e[r].bbox());return n}offset(e){const n=[];return this.curves.forEach(function(r){n.push(...r.offset(e))}),new $M(n)}}const{abs:YA,min:Fxe,max:Bxe,cos:Pen,sin:Oen,acos:Fen,sqrt:ZA}=Math,Ben=Math.PI;class Js{constructor(e){let n=e&&e.forEach?e:Array.from(arguments).slice(),r=!1;if(typeof n[0]=="object"){r=n.length;const p=[];n.forEach(function(g){["x","y","z"].forEach(function(m){typeof g[m]<"u"&&p.push(g[m])})}),n=p}let s=!1;const o=n.length;if(r){if(r>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");s=!0}}else if(o!==6&&o!==8&&o!==9&&o!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const a=this._3d=!s&&(o===9||o===12)||e&&e[0]&&typeof e[0].z<"u",l=this.points=[];for(let p=0,g=a?3:2;p<o;p+=g){var c={x:n[p],y:n[p+1]};a&&(c.z=n[p+2]),l.push(c)}const u=this.order=l.length-1,d=this.dims=["x","y"];a&&d.push("z"),this.dimlen=d.length;const h=Kt.align(l,{p1:l[0],p2:l[u]}),f=Kt.dist(l[0],l[u]);this._linear=h.reduce((p,g)=>p+YA(g.y),0)<f/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(e,n,r,s){if(typeof s>"u"&&(s=.5),s===0)return new Js(n,n,r);if(s===1)return new Js(e,n,n);const o=Js.getABC(2,e,n,r,s);return new Js(e,o.A,r)}static cubicFromPoints(e,n,r,s,o){typeof s>"u"&&(s=.5);const a=Js.getABC(3,e,n,r,s);typeof o>"u"&&(o=Kt.dist(n,a.C));const l=o*(1-s)/s,c=Kt.dist(e,r),u=(r.x-e.x)/c,d=(r.y-e.y)/c,h=o*u,f=o*d,p=l*u,g=l*d,m={x:n.x-h,y:n.y-f},_={x:n.x+p,y:n.y+g},b=a.A,y={x:b.x+(m.x-b.x)/(1-s),y:b.y+(m.y-b.y)/(1-s)},x={x:b.x+(_.x-b.x)/s,y:b.y+(_.y-b.y)/s},k={x:e.x+(y.x-e.x)/s,y:e.y+(y.y-e.y)/s},D={x:r.x+(x.x-r.x)/(1-s),y:r.y+(x.y-r.y)/(1-s)};return new Js(e,k,D,r)}static getUtils(){return Kt}getUtils(){return Js.getUtils()}static get PolyBezier(){return $M}valueOf(){return this.toString()}toString(){return Kt.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const e=this.points,n=e[0].x,r=e[0].y,s=["M",n,r,this.order===2?"Q":"C"];for(let o=1,a=e.length;o<a;o++)s.push(e[o].x),s.push(e[o].y);return s.join(" ")}setRatios(e){if(e.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=e,this._lut=[]}verify(){const e=this.coordDigest();e!==this._print&&(this._print=e,this.update())}coordDigest(){return this.points.map(function(e,n){return""+n+e.x+e.y+(e.z?e.z:0)}).join("")}update(){this._lut=[],this.dpoints=Kt.derive(this.points,this._3d),this.computedirection()}computedirection(){const e=this.points,n=Kt.angle(e[0],e[this.order],e[1]);this.clockwise=n>0}length(){return Kt.length(this.derivative.bind(this))}static getABC(e=2,n,r,s,o=.5){const a=Kt.projectionratio(o,e),l=1-a,c={x:a*n.x+l*s.x,y:a*n.y+l*s.y},u=Kt.abcratio(o,e);return{A:{x:r.x+(r.x-c.x)/u,y:r.y+(r.y-c.y)/u},B:r,C:c,S:n,E:s}}getABC(e,n){n=n||this.get(e);let r=this.points[0],s=this.points[this.order];return Js.getABC(this.order,r,n,s,e)}getLUT(e){if(this.verify(),e=e||100,this._lut.length===e+1)return this._lut;this._lut=[],e++,this._lut=[];for(let n=0,r,s;n<e;n++)s=n/(e-1),r=this.compute(s),r.t=s,this._lut.push(r);return this._lut}on(e,n){n=n||5;const r=this.getLUT(),s=[];for(let o=0,a,l=0;o<r.length;o++)a=r[o],Kt.dist(a,e)<n&&(s.push(a),l+=o/r.length);return s.length?t/=s.length:!1}project(e){const n=this.getLUT(),r=n.length-1,s=Kt.closest(n,e),o=s.mpos,a=(o-1)/r,l=(o+1)/r,c=.1/r;let u=s.mdist,d=a,h=d,f;u+=1;for(let p;d<l+c;d+=c)f=this.compute(d),p=Kt.dist(e,f),p<u&&(u=p,h=d);return h=h<0?0:h>1?1:h,f=this.compute(h),f.t=h,f.d=u,f}get(e){return this.compute(e)}point(e){return this.points[e]}compute(e){return this.ratios?Kt.computeWithRatios(e,this.points,this.ratios,this._3d):Kt.compute(e,this.points,this._3d,this.ratios)}raise(){const e=this.points,n=[e[0]],r=e.length;for(let s=1,o,a;s<r;s++)o=e[s],a=e[s-1],n[s]={x:(r-s)/r*o.x+s/r*a.x,y:(r-s)/r*o.y+s/r*a.y};return n[r]=e[r-1],new Js(n)}derivative(e){return Kt.compute(e,this.dpoints[0],this._3d)}dderivative(e){return Kt.compute(e,this.dpoints[1],this._3d)}align(){let e=this.points;return new Js(Kt.align(e,{p1:e[0],p2:e[e.length-1]}))}curvature(e){return Kt.curvature(e,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return Kt.inflections(this.points)}normal(e){return this._3d?this.__normal3(e):this.__normal2(e)}__normal2(e){const n=this.derivative(e),r=ZA(n.x*n.x+n.y*n.y);return{t:e,x:-n.y/r,y:n.x/r}}__normal3(e){const n=this.derivative(e),r=this.derivative(e+.01),s=ZA(n.x*n.x+n.y*n.y+n.z*n.z),o=ZA(r.x*r.x+r.y*r.y+r.z*r.z);n.x/=s,n.y/=s,n.z/=s,r.x/=o,r.y/=o,r.z/=o;const a={x:r.y*n.z-r.z*n.y,y:r.z*n.x-r.x*n.z,z:r.x*n.y-r.y*n.x},l=ZA(a.x*a.x+a.y*a.y+a.z*a.z);a.x/=l,a.y/=l,a.z/=l;const c=[a.x*a.x,a.x*a.y-a.z,a.x*a.z+a.y,a.x*a.y+a.z,a.y*a.y,a.y*a.z-a.x,a.x*a.z-a.y,a.y*a.z+a.x,a.z*a.z];return{t:e,x:c[0]*n.x+c[1]*n.y+c[2]*n.z,y:c[3]*n.x+c[4]*n.y+c[5]*n.z,z:c[6]*n.x+c[7]*n.y+c[8]*n.z}}hull(e){let n=this.points,r=[],s=[],o=0;for(s[o++]=n[0],s[o++]=n[1],s[o++]=n[2],this.order===3&&(s[o++]=n[3]);n.length>1;){r=[];for(let a=0,l,c=n.length-1;a<c;a++)l=Kt.lerp(e,n[a],n[a+1]),s[o++]=l,r.push(l);n=r}return s}split(e,n){if(e===0&&n)return this.split(n).left;if(n===1)return this.split(e).right;const r=this.hull(e),s={left:this.order===2?new Js([r[0],r[3],r[5]]):new Js([r[0],r[4],r[7],r[9]]),right:this.order===2?new Js([r[5],r[4],r[2]]):new Js([r[9],r[8],r[6],r[3]]),span:r};return s.left._t1=Kt.map(0,0,1,this._t1,this._t2),s.left._t2=Kt.map(e,0,1,this._t1,this._t2),s.right._t1=Kt.map(e,0,1,this._t1,this._t2),s.right._t2=Kt.map(1,0,1,this._t1,this._t2),n?(n=Kt.map(n,e,1,0,1),s.right.split(n).left):s}extrema(){const e={};let n=[];return this.dims.forEach((function(r){let s=function(a){return a[r]},o=this.dpoints[0].map(s);e[r]=Kt.droots(o),this.order===3&&(o=this.dpoints[1].map(s),e[r]=e[r].concat(Kt.droots(o))),e[r]=e[r].filter(function(a){return a>=0&&a<=1}),n=n.concat(e[r].sort(Kt.numberSort))}).bind(this)),e.values=n.sort(Kt.numberSort).filter(function(r,s){return n.indexOf(r)===s}),e}bbox(){const e=this.extrema(),n={};return this.dims.forEach((function(r){n[r]=Kt.getminmax(this,r,e[r])}).bind(this)),n}overlaps(e){const n=this.bbox(),r=e.bbox();return Kt.bboxoverlap(n,r)}offset(e,n){if(typeof n<"u"){const r=this.get(e),s=this.normal(e),o={c:r,n:s,x:r.x+s.x*n,y:r.y+s.y*n};return this._3d&&(o.z=r.z+s.z*n),o}if(this._linear){const r=this.normal(0),s=this.points.map(function(o){const a={x:o.x+e*r.x,y:o.y+e*r.y};return o.z&&r.z&&(a.z=o.z+e*r.z),a});return[new Js(s)]}return this.reduce().map(function(r){return r._linear?r.offset(e)[0]:r.scale(e)})}simple(){if(this.order===3){const s=Kt.angle(this.points[0],this.points[3],this.points[1]),o=Kt.angle(this.points[0],this.points[3],this.points[2]);if(s>0&&o<0||s<0&&o>0)return!1}const e=this.normal(0),n=this.normal(1);let r=e.x*n.x+e.y*n.y;return this._3d&&(r+=e.z*n.z),YA(Fen(r))<Ben/3}reduce(){let e,n=0,r=0,s=.01,o,a=[],l=[],c=this.extrema().values;for(c.indexOf(0)===-1&&(c=[0].concat(c)),c.indexOf(1)===-1&&c.push(1),n=c[0],e=1;e<c.length;e++)r=c[e],o=this.split(n,r),o._t1=n,o._t2=r,a.push(o),n=r;return a.forEach(function(u){for(n=0,r=0;r<=1;)for(r=n+s;r<=1+s;r+=s)if(o=u.split(n,r),!o.simple()){if(r-=s,YA(n-r)<s)return[];o=u.split(n,r),o._t1=Kt.map(n,0,1,u._t1,u._t2),o._t2=Kt.map(r,0,1,u._t1,u._t2),l.push(o),n=r;break}n<1&&(o=u.split(n,1),o._t1=Kt.map(n,0,1,u._t1,u._t2),o._t2=u._t2,l.push(o))}),l}translate(e,n,r){r=typeof r=="number"?r:n;const s=this.order;let o=this.points.map((a,l)=>(1-l/s)*n+l/s*r);return new Js(this.points.map((a,l)=>({x:a.x+e.x*o[l],y:a.y+e.y*o[l]})))}scale(e){const n=this.order;let r=!1;if(typeof e=="function"&&(r=e),r&&n===2)return this.raise().scale(r);const s=this.clockwise,o=this.points;if(this._linear)return this.translate(this.normal(0),r?r(0):e,r?r(1):e);const a=r?r(0):e,l=r?r(1):e,c=[this.offset(0,10),this.offset(1,10)],u=[],d=Kt.lli4(c[0],c[0].c,c[1],c[1].c);if(!d)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(h){const f=u[h*n]=Kt.copy(o[h*n]);f.x+=(h?l:a)*c[h].n.x,f.y+=(h?l:a)*c[h].n.y}),r?([0,1].forEach(function(h){if(!(n===2&&h)){var f=o[h+1],p={x:f.x-d.x,y:f.y-d.y},g=r?r((h+1)/n):e;r&&!s&&(g=-g);var m=ZA(p.x*p.x+p.y*p.y);p.x/=m,p.y/=m,u[h+1]={x:f.x+g*p.x,y:f.y+g*p.y}}}),new Js(u)):([0,1].forEach(h=>{if(n===2&&h)return;const f=u[h*n],p=this.derivative(h),g={x:f.x+p.x,y:f.y+p.y};u[h+1]=Kt.lli4(f,g,d,o[h+1])}),new Js(u))}outline(e,n,r,s){if(n=n===void 0?e:n,this._linear){const D=this.normal(0),R=this.points[0],E=this.points[this.points.length-1];let A,M,N;r===void 0&&(r=e,s=n),A={x:R.x+D.x*e,y:R.y+D.y*e},N={x:E.x+D.x*r,y:E.y+D.y*r},M={x:(A.x+N.x)/2,y:(A.y+N.y)/2};const P=[A,M,N];A={x:R.x-D.x*n,y:R.y-D.y*n},N={x:E.x-D.x*s,y:E.y-D.y*s},M={x:(A.x+N.x)/2,y:(A.y+N.y)/2};const O=[N,M,A],B=Kt.makeline(O[2],P[0]),j=Kt.makeline(P[2],O[0]),z=[B,new Js(P),j,new Js(O)];return new $M(z)}const o=this.reduce(),a=o.length,l=[];let c=[],u,d=0,h=this.length();const f=typeof r<"u"&&typeof s<"u";function p(D,R,E,A,M){return function(N){const P=A/E,O=(A+M)/E,B=R-D;return Kt.map(N,0,1,D+P*B,D+O*B)}}o.forEach(function(D){const R=D.length();f?(l.push(D.scale(p(e,r,h,d,R))),c.push(D.scale(p(-n,-s,h,d,R)))):(l.push(D.scale(e)),c.push(D.scale(-n))),d+=R}),c=c.map(function(D){return u=D.points,u[3]?D.points=[u[3],u[2],u[1],u[0]]:D.points=[u[2],u[1],u[0]],D}).reverse();const g=l[0].points[0],m=l[a-1].points[l[a-1].points.length-1],_=c[a-1].points[c[a-1].points.length-1],b=c[0].points[0],y=Kt.makeline(_,g),x=Kt.makeline(m,b),k=[y].concat(l).concat([x]).concat(c);return new $M(k)}outlineshapes(e,n,r){n=n||e;const s=this.outline(e,n).curves,o=[];for(let a=1,l=s.length;a<l/2;a++){const c=Kt.makeshape(s[a],s[l-a],r);c.startcap.virtual=a>1,c.endcap.virtual=a<l/2-1,o.push(c)}return o}intersects(e,n){return e?e.p1&&e.p2?this.lineIntersects(e):(e instanceof Js&&(e=e.reduce()),this.curveintersects(this.reduce(),e,n)):this.selfintersects(n)}lineIntersects(e){const n=Fxe(e.p1.x,e.p2.x),r=Fxe(e.p1.y,e.p2.y),s=Bxe(e.p1.x,e.p2.x),o=Bxe(e.p1.y,e.p2.y);return Kt.roots(this.points,e).filter(a=>{var l=this.get(a);return Kt.between(l.x,n,s)&&Kt.between(l.y,r,o)})}selfintersects(e){const n=this.reduce(),r=n.length-2,s=[];for(let o=0,a,l,c;o<r;o++)l=n.slice(o,o+1),c=n.slice(o+2),a=this.curveintersects(l,c,e),s.push(...a);return s}curveintersects(e,n,r){const s=[];e.forEach(function(a){n.forEach(function(l){a.overlaps(l)&&s.push({left:a,right:l})})});let o=[];return s.forEach(function(a){const l=Kt.pairiteration(a.left,a.right,r);l.length>0&&(o=o.concat(l))}),o}arcs(e){return e=e||.5,this._iterate(e,[])}_error(e,n,r,s){const o=(s-r)/4,a=this.get(r+o),l=this.get(s-o),c=Kt.dist(e,n),u=Kt.dist(e,a),d=Kt.dist(e,l);return YA(u-c)+YA(d-c)}_iterate(e,n){let r=0,s=1,o;do{o=0,s=1;let a=this.get(r),l,c,u,d,h=!1,f=!1,p,g=s,m=1;do if(f=h,d=u,g=(r+s)/2,l=this.get(g),c=this.get(s),u=Kt.getccenter(a,l,c),u.interval={start:r,end:s},h=this._error(u,a,r,s)<=e,p=f&&!h,p||(m=s),h){if(s>=1){if(u.interval.end=m=1,d=u,s>1){let b={x:u.x+u.r*Pen(u.e),y:u.y+u.r*Oen(u.e)};u.e+=Kt.angle({x:u.x,y:u.y},b,this.get(1))}break}s=s+(s-r)/2}else s=g;while(!p&&o++<100);if(o>=100)break;d=d||u,n.push(d),r=m}while(s<1);return n}}function gre(i,e){(e==null||e>i.length)&&(e=i.length);for(var n=0,r=Array(e);n<e;n++)r[n]=i[n];return r}function jen(i){if(Array.isArray(i))return i}function Wen(i){if(Array.isArray(i))return gre(i)}function $en(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function zen(i,e){var n=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(n!=null){var r,s,o,a,l=[],c=!0,u=!1;try{if(o=(n=n.call(i)).next,e!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw s}}return l}}function Ven(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hen(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uen(i,e){if(i==null)return{};var n,r,s=qen(i,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(r=0;r<o.length;r++)n=o[r],e.includes(n)||{}.propertyIsEnumerable.call(i,n)&&(s[n]=i[n])}return s}function qen(i,e){if(i==null)return{};var n={};for(var r in i)if({}.hasOwnProperty.call(i,r)){if(e.includes(r))continue;n[r]=i[r]}return n}function Ken(i,e){return jen(i)||zen(i,e)||b6e(i,e)||Ven()}function Gen(i){return Wen(i)||$en(i)||b6e(i)||Hen()}function Xen(i,e){if(typeof i!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var r=n.call(i,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}function Yen(i){var e=Xen(i,"string");return typeof e=="symbol"?e:e+""}function b6e(i,e){if(i){if(typeof i=="string")return gre(i,e);var n={}.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gre(i,e):void 0}}var Zen=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=(e instanceof Array?e.length?e:[void 0]:[e]).map(function(l){return{keyAccessor:l,isProp:!(l instanceof Function)}}),o=i.reduce(function(l,c){var u=l,d=c;return s.forEach(function(h,f){var p=h.keyAccessor,g=h.isProp,m;if(g){var _=d,b=_[p],y=Uen(_,[p].map(Yen));m=b,d=y}else m=p(d,f);f+1<s.length?(u.hasOwnProperty(m)||(u[m]={}),u=u[m]):n?(u.hasOwnProperty(m)||(u[m]=[]),u[m].push(d)):u[m]=d}),l},{});n instanceof Function&&function l(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;u===s.length?Object.keys(c).forEach(function(d){return c[d]=n(c[d])}):Object.values(c).forEach(function(d){return l(d,u+1)})}(o);var a=o;return r&&(a=[],function l(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];u.length===s.length?a.push({keys:u,vals:c}):Object.entries(c).forEach(function(d){var h=Ken(d,2),f=h[0],p=h[1];return l(p,[].concat(Gen(u),[f]))})}(o),e instanceof Array&&e.length===0&&a.length===1&&(a[0].keys=[])),a};function Qen(i,e){switch(arguments.length){case 0:break;case 1:this.range(i);break;default:this.range(e).domain(i);break}return this}const jxe=Symbol("implicit");function y6e(){var i=new uxe,e=[],n=[],r=jxe;function s(o){let a=i.get(o);if(a===void 0){if(r!==jxe)return r;i.set(o,a=e.push(o)-1)}return n[a%n.length]}return s.domain=function(o){if(!arguments.length)return e.slice();e=[],i=new uxe;for(const a of o)i.has(a)||i.set(a,e.push(a)-1);return s},s.range=function(o){return arguments.length?(n=Array.from(o),s):n.slice()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return y6e(e,n).unknown(r)},Qen.apply(s,arguments),s}function Jen(i){for(var e=i.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+i.slice(r*6,++r*6);return n}const etn=Jen("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function ttn(i,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",n==="top"&&r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s),s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i))}}var ntn=`.force-graph-container canvas {
display: block;
user-select: none;
outline: none;
-webkit-tap-highlight-color: transparent;
}
.force-graph-container .clickable {
cursor: pointer;
}
.force-graph-container .grabbable {
cursor: move;
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
}
.force-graph-container .grabbable:active {
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}
`;ttn(ntn);function mre(i,e){(e==null||e>i.length)&&(e=i.length);for(var n=0,r=Array(e);n<e;n++)r[n]=i[n];return r}function itn(i){if(Array.isArray(i))return i}function rtn(i){if(Array.isArray(i))return mre(i)}function Wxe(i,e,n){if(w6e())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var s=new(i.bind.apply(i,r));return s}function JO(i,e,n){return(e=utn(e))in i?Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[e]=n,i}function w6e(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w6e=function(){return!!i})()}function stn(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function otn(i,e){var n=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(n!=null){var r,s,o,a,l=[],c=!0,u=!1;try{if(o=(n=n.call(i)).next,e!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw s}}return l}}function atn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ltn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $xe(i,e){var n=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),n.push.apply(n,r)}return n}function OD(i){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$xe(Object(n),!0).forEach(function(r){JO(i,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):$xe(Object(n)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(n,r))})}return i}function zM(i,e){return itn(i)||otn(i,e)||C6e(i,e)||atn()}function pf(i){return rtn(i)||stn(i)||C6e(i)||ltn()}function ctn(i,e){if(typeof i!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var r=n.call(i,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function utn(i){var e=ctn(i,"string");return typeof e=="symbol"?e:e+""}function _re(i){"@babel/helpers - typeof";return _re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_re(i)}function C6e(i,e){if(i){if(typeof i=="string")return mre(i,e);var n={}.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mre(i,e):void 0}}var dtn=y6e(etn);function zxe(i,e,n){!e||typeof n!="string"||i.filter(function(r){return!r[n]}).forEach(function(r){r[n]=dtn(e(r))})}function htn(i,e){var n=i.nodes,r=i.links,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.nodeFilter,a=o===void 0?function(){return!0}:o,l=s.onLoopError,c=l===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:l,u={};n.forEach(function(p){return u[e(p)]={data:p,out:[],depth:-1,skip:!a(p)}}),r.forEach(function(p){var g=p.source,m=p.target,_=k(g),b=k(m);if(!u.hasOwnProperty(_))throw"Missing source node with id: ".concat(_);if(!u.hasOwnProperty(b))throw"Missing target node with id: ".concat(b);var y=u[_],x=u[b];y.out.push(x);function k(D){return _re(D)==="object"?e(D):D}});var d=[];f(Object.values(u));var h=Object.assign.apply(Object,[{}].concat(pf(Object.entries(u).filter(function(p){var g=zM(p,2),m=g[1];return!m.skip}).map(function(p){var g=zM(p,2),m=g[0],_=g[1];return JO({},m,_.depth)}))));return h;function f(p){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,_=function(){var k=p[b];if(g.indexOf(k)!==-1){var D=[].concat(pf(g.slice(g.indexOf(k))),[k]).map(function(R){return e(R.data)});return d.some(function(R){return R.length===D.length&&R.every(function(E,A){return E===D[A]})})||(d.push(D),c(D)),1}m>k.depth&&(k.depth=m,f(k.out,[].concat(pf(g),[k]),m+(k.skip?0:1)))},b=0,y=p.length;b<y;b++)_()}}var ftn=2,oc=function(e,n){return n.onNeedsRedraw&&n.onNeedsRedraw()},Vxe=function(e,n){if(!n.isShadow){var r=rs(n.linkDirectionalParticles);n.graphData.links.forEach(function(s){var o=Math.round(Math.abs(r(s)));o?s.__photons=pf(Array(o)).map(function(){return{}}):delete s.__photons})}},rW=cue({props:{graphData:{default:{nodes:[],links:[]},onChange:function(e,n){n.engineRunning=!1,Vxe(e,n)}},dagMode:{onChange:function(e,n){!e&&(n.graphData.nodes||[]).forEach(function(r){return r.fx=r.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(e){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:oc},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:oc},nodeColor:{default:"color",triggerUpdate:!1,onChange:oc},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:oc},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:oc},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:oc},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:oc},linkColor:{default:"color",triggerUpdate:!1,onChange:oc},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:oc},linkWidth:{default:1,triggerUpdate:!1,onChange:oc},linkCurvature:{default:0,triggerUpdate:!1,onChange:oc},linkCanvasObject:{triggerUpdate:!1,onChange:oc},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:oc},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:oc},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:oc},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:oc},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:Vxe},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(e,n){n.forceLayout.alphaDecay(e)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(e,n){n.forceLayout.alphaTarget(e)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(e,n){n.forceLayout.velocityDecay(e)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(e,n,r){return r===void 0?e.forceLayout.force(n):(e.forceLayout.force(n,r),this)},d3ReheatSimulation:function(e){return e.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(e){return e.cntTicks=0,e.startTickTime=new Date,e.engineRunning=!0,this},isEngineRunning:function(e){return!!e.engineRunning},tickFrame:function(e){return!e.isShadow&&n(),s(),!e.isShadow&&o(),!e.isShadow&&a(),r(),this;function n(){e.engineRunning&&(++e.cntTicks>e.cooldownTicks||new Date-e.startTickTime>e.cooldownTime||e.d3AlphaMin>0&&e.forceLayout.alpha()<e.d3AlphaMin?(e.engineRunning=!1,e.onEngineStop()):(e.forceLayout.tick(),e.onEngineTick()))}function r(){var l=rs(e.nodeVisibility),c=rs(e.nodeVal),u=rs(e.nodeColor),d=rs(e.nodeCanvasObjectMode),h=e.ctx,f=e.isShadow/e.globalScale,p=e.graphData.nodes.filter(l);h.save(),p.forEach(function(g){var m=d(g);if(e.nodeCanvasObject&&(m==="before"||m==="replace")&&(e.nodeCanvasObject(g,h,e.globalScale),m==="replace")){h.restore();return}var _=Math.sqrt(Math.max(0,c(g)||1))*e.nodeRelSize+f;h.beginPath(),h.arc(g.x,g.y,_,0,2*Math.PI,!1),h.fillStyle=u(g)||"rgba(31, 120, 180, 0.92)",h.fill(),e.nodeCanvasObject&&m==="after"&&e.nodeCanvasObject(g,e.ctx,e.globalScale)}),h.restore()}function s(){var l=rs(e.linkVisibility),c=rs(e.linkColor),u=rs(e.linkWidth),d=rs(e.linkLineDash),h=rs(e.linkCurvature),f=rs(e.linkCanvasObjectMode),p=e.ctx,g=e.isShadow*2,m=e.graphData.links.filter(l);m.forEach(R);var _=[],b=[],y=m;if(e.linkCanvasObject){var x=[],k=[];m.forEach(function(E){return({before:_,after:b,replace:x}[f(E)]||k).push(E)}),y=[].concat(pf(_),b,k),_=_.concat(x)}p.save(),_.forEach(function(E){return e.linkCanvasObject(E,p,e.globalScale)}),p.restore();var D=Zen(y,[c,u,d]);p.save(),Object.entries(D).forEach(function(E){var A=zM(E,2),M=A[0],N=A[1],P=!M||M==="undefined"?"rgba(0,0,0,0.15)":M;Object.entries(N).forEach(function(O){var B=zM(O,2),j=B[0],z=B[1],H=(j||1)/e.globalScale+g;Object.entries(z).forEach(function(Y){var X=zM(Y,2);X[0];var Q=X[1],ie=d(Q[0]);p.beginPath(),Q.forEach(function(K){var ee=K.source,le=K.target;if(!(!ee||!le||!ee.hasOwnProperty("x")||!le.hasOwnProperty("x"))){p.moveTo(ee.x,ee.y);var ke=K.__controlPoints;ke?p[ke.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(p,pf(ke).concat([le.x,le.y])):p.lineTo(le.x,le.y)}}),p.strokeStyle=P,p.lineWidth=H,p.setLineDash(ie||[]),p.stroke()})})}),p.restore(),p.save(),b.forEach(function(E){return e.linkCanvasObject(E,p,e.globalScale)}),p.restore();function R(E){var A=h(E);if(!A){E.__controlPoints=null;return}var M=E.source,N=E.target;if(!(!M||!N||!M.hasOwnProperty("x")||!N.hasOwnProperty("x"))){var P=Math.sqrt(Math.pow(N.x-M.x,2)+Math.pow(N.y-M.y,2));if(P>0){var O=Math.atan2(N.y-M.y,N.x-M.x),B=P*A,j={x:(M.x+N.x)/2+B*Math.cos(O-Math.PI/2),y:(M.y+N.y)/2+B*Math.sin(O-Math.PI/2)};E.__controlPoints=[j.x,j.y]}else{var z=A*70;E.__controlPoints=[N.x,N.y-z,N.x+z,N.y]}}}}function o(){var l=1.6,c=.2,u=rs(e.linkDirectionalArrowLength),d=rs(e.linkDirectionalArrowRelPos),h=rs(e.linkVisibility),f=rs(e.linkDirectionalArrowColor||e.linkColor),p=rs(e.nodeVal),g=e.ctx;g.save(),e.graphData.links.filter(h).forEach(function(m){var _=u(m);if(!(!_||_<0)){var b=m.source,y=m.target;if(!(!b||!y||!b.hasOwnProperty("x")||!y.hasOwnProperty("x"))){var x=Math.sqrt(Math.max(0,p(b)||1))*e.nodeRelSize,k=Math.sqrt(Math.max(0,p(y)||1))*e.nodeRelSize,D=Math.min(1,Math.max(0,d(m))),R=f(m)||"rgba(0,0,0,0.28)",E=_/l/2,A=m.__controlPoints&&Wxe(Js,[b.x,b.y].concat(pf(m.__controlPoints),[y.x,y.y])),M=A?function(H){return A.get(H)}:function(H){return{x:b.x+(y.x-b.x)*H||0,y:b.y+(y.y-b.y)*H||0}},N=A?A.length():Math.sqrt(Math.pow(y.x-b.x,2)+Math.pow(y.y-b.y,2)),P=x+_+(N-x-k-_)*D,O=M(P/N),B=M((P-_)/N),j=M((P-_*(1-c))/N),z=Math.atan2(O.y-B.y,O.x-B.x)-Math.PI/2;g.beginPath(),g.moveTo(O.x,O.y),g.lineTo(B.x+E*Math.cos(z),B.y+E*Math.sin(z)),g.lineTo(j.x,j.y),g.lineTo(B.x-E*Math.cos(z),B.y-E*Math.sin(z)),g.fillStyle=R,g.fill()}}}),g.restore()}function a(){var l=rs(e.linkDirectionalParticles),c=rs(e.linkDirectionalParticleSpeed),u=rs(e.linkDirectionalParticleOffset),d=rs(e.linkDirectionalParticleWidth),h=rs(e.linkVisibility),f=rs(e.linkDirectionalParticleColor||e.linkColor),p=e.ctx;p.save(),e.graphData.links.filter(h).forEach(function(g){var m=l(g);if(!(!g.hasOwnProperty("__photons")||!g.__photons.length)){var _=g.source,b=g.target;if(!(!_||!b||!_.hasOwnProperty("x")||!b.hasOwnProperty("x"))){var y=c(g),x=Math.abs(u(g)),k=g.__photons||[],D=Math.max(0,d(g)/2)/Math.sqrt(e.globalScale),R=f(g)||"rgba(0,0,0,0.28)";p.fillStyle=R;var E=g.__controlPoints?Wxe(Js,[_.x,_.y].concat(pf(g.__controlPoints),[b.x,b.y])):null,A=0,M=!1;k.forEach(function(N){var P=!!N.__singleHop;if(N.hasOwnProperty("__progressRatio")||(N.__progressRatio=P?0:(A+x)/m),!P&&A++,N.__progressRatio+=y,N.__progressRatio>=1)if(!P)N.__progressRatio=N.__progressRatio%1;else{M=!0;return}var O=N.__progressRatio,B=E?E.get(O):{x:_.x+(b.x-_.x)*O||0,y:_.y+(b.y-_.y)*O||0};e.linkDirectionalParticleCanvasObject?e.linkDirectionalParticleCanvasObject(B.x,B.y,g,p,e.globalScale):(p.beginPath(),p.arc(B.x,B.y,D,0,2*Math.PI,!1),p.fill())}),M&&(g.__photons=g.__photons.filter(function(N){return!N.__singleHop||N.__progressRatio<=1}))}}}),p.restore()}},emitParticle:function(e,n){return n&&(!n.__photons&&(n.__photons=[]),n.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:Ien().force("link",wen()).force("charge",Ten()).force("center",SJt()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(e,n){n.ctx=e},update:function(e,n){e.engineRunning=!1,e.onUpdate(),e.nodeAutoColorBy!==null&&zxe(e.graphData.nodes,rs(e.nodeAutoColorBy),e.nodeColor),e.linkAutoColorBy!==null&&zxe(e.graphData.links,rs(e.linkAutoColorBy),e.linkColor),e.graphData.links.forEach(function(f){f.source=f[e.linkSource],f.target=f[e.linkTarget]}),e.forceLayout.stop().alpha(1).nodes(e.graphData.nodes);var r=e.forceLayout.force("link");r&&r.id(function(f){return f[e.nodeId]}).links(e.graphData.links);var s=e.dagMode&&htn(e.graphData,function(f){return f[e.nodeId]},{nodeFilter:e.dagNodeFilter,onLoopError:e.onDagError||void 0}),o=Math.max.apply(Math,pf(Object.values(s||[]))),a=e.dagLevelDistance||e.graphData.nodes.length/(o||1)*ftn*(["radialin","radialout"].indexOf(e.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(n.dagMode)){var l=["lr","rl"].includes(n.dagMode)?"fx":"fy";e.graphData.nodes.filter(e.dagNodeFilter).forEach(function(f){return delete f[l]})}if(["lr","rl","td","bu"].includes(e.dagMode)){var c=["rl","bu"].includes(e.dagMode),u=function(p){return(s[p[e.nodeId]]-o/2)*a*(c?-1:1)},d=["lr","rl"].includes(e.dagMode)?"fx":"fy";e.graphData.nodes.filter(e.dagNodeFilter).forEach(function(f){return f[d]=u(f)})}e.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(e.dagMode)!==-1?Ren(function(f){var p=s[f[e.nodeId]]||-1;return(e.dagMode==="radialin"?o-p:p)*a}).strength(function(f){return e.dagNodeFilter(f)?1:0}):null);for(var h=0;h<e.warmupTicks&&!(e.d3AlphaMin>0&&e.forceLayout.alpha()<e.d3AlphaMin);h++)e.forceLayout.tick();this.resetCountdown(),e.onFinishUpdate()}});function S6e(i,e){var n=i instanceof Array?i:[i],r=new e;return r._destructor&&r._destructor(),{linkProp:function(o){return{default:r[o](),onChange:function(l,c){n.forEach(function(u){return c[u][o](l)})},triggerUpdate:!1}},linkMethod:function(o){return function(a){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];var d=[];return n.forEach(function(h){var f=a[h],p=f[o].apply(f,c);p!==f&&d.push(p)}),d.length?d[0]:this}}}}var ptn=800,gtn=4,mtn=5,x6e=S6e("forceGraph",rW),_tn=S6e(["forceGraph","shadowGraph"],rW),vtn=Object.assign.apply(Object,pf(["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(function(i){return JO({},i,x6e.linkProp(i))})).concat(pf(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(i){return JO({},i,_tn.linkProp(i))})))),btn=Object.assign.apply(Object,pf(["d3Force","d3ReheatSimulation","emitParticle"].map(function(i){return JO({},i,x6e.linkMethod(i))})));function pZ(i){if(i.canvas){var e=i.canvas.width,n=i.canvas.height;e===300&&n===150&&(e=n=0);var r=window.devicePixelRatio;e/=r,n/=r,[i.canvas,i.shadowCanvas].forEach(function(o){o.style.width="".concat(i.width,"px"),o.style.height="".concat(i.height,"px"),o.width=i.width*r,o.height=i.height*r,!e&&!n&&o.getContext("2d").scale(r,r)});var s=Zg(i.canvas).k;i.zoom.translateBy(i.zoom.__baseElem,(i.width-e)/2/s,(i.height-n)/2/s),i.needsRedraw=!0}}function k6e(i){var e=window.devicePixelRatio;i.setTransform(e,0,0,e,0,0)}function Hxe(i,e,n){i.save(),k6e(i),i.clearRect(0,0,e,n),i.restore()}var ytn=cue({props:OD({width:{default:window.innerWidth,onChange:function(e,n){return pZ(n)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(e,n){return pZ(n)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(e,n){[e.nodes,e.links].every(function(s){return(s||[]).every(function(o){return!o.hasOwnProperty("__indexColor")})})&&n.colorTracker.reset(),[{type:"Node",objs:e.nodes},{type:"Link",objs:e.links}].forEach(r),n.forceGraph.graphData(e),n.shadowGraph.graphData(e);function r(s){var o=s.type,a=s.objs;a.filter(function(l){if(!l.hasOwnProperty("__indexColor"))return!0;var c=n.colorTracker.lookup(l.__indexColor);return!c||!c.hasOwnProperty("d")||c.d!==l}).forEach(function(l){l.__indexColor=n.colorTracker.register({type:o,d:l})})}},triggerUpdate:!1},backgroundColor:{onChange:function(e,n){n.canvas&&e&&(n.canvas.style.background=e)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(e,n){n.shadowGraph.nodeCanvasObject(e?function(r,s,o){return e(r,r.__indexColor,s,o)}:null),n.flushShadowCanvas&&n.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(e,n){n.shadowGraph.linkCanvasObject(e?function(r,s,o){return e(r,r.__indexColor,s,o)}:null),n.flushShadowCanvas&&n.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(e,n){n.zoom.scaleExtent([e,n.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(e,n){n.zoom.scaleExtent([n.zoom.scaleExtent()[0],e])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(e,n){n.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},vtn),aliases:{stopAnimation:"pauseAnimation"},methods:OD({graph2ScreenCoords:function(e,n,r){var s=Zg(e.canvas);return{x:n*s.k+s.x,y:r*s.k+s.y}},screen2GraphCoords:function(e,n,r){var s=Zg(e.canvas);return{x:(n-s.x)/s.k,y:(r-s.y)/s.k}},centerAt:function(e,n,r,s){if(!e.canvas)return null;if(n!==void 0||r!==void 0){var o=Object.assign({},n!==void 0?{x:n}:{},r!==void 0?{y:r}:{});return s?e.tweenGroup.add(new _xe(a()).to(o,s).easing(YS.Quadratic.Out).onUpdate(l).start()):l(o),this}return a();function a(){var c=Zg(e.canvas);return{x:(e.width/2-c.x)/c.k,y:(e.height/2-c.y)/c.k}}function l(c){var u=c.x,d=c.y;e.zoom.translateTo(e.zoom.__baseElem,u===void 0?a().x:u,d===void 0?a().y:d),e.needsRedraw=!0}},zoom:function(e,n,r){if(!e.canvas)return null;if(n!==void 0)return r?e.tweenGroup.add(new _xe({k:s()}).to({k:n},r).easing(YS.Quadratic.Out).onUpdate(function(a){var l=a.k;return o(l)}).start()):o(n),this;return s();function s(){return Zg(e.canvas).k}function o(a){e.zoom.scaleTo(e.zoom.__baseElem,a),e.needsRedraw=!0}},zoomToFit:function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,s=arguments.length,o=new Array(s>3?s-3:0),a=3;a<s;a++)o[a-3]=arguments[a];var l=this.getGraphBbox.apply(this,o);if(l){var c={x:(l.x[0]+l.x[1])/2,y:(l.y[0]+l.y[1])/2},u=Math.max(1e-12,Math.min(1e12,(e.width-r*2)/(l.x[1]-l.x[0]),(e.height-r*2)/(l.y[1]-l.y[0])));this.centerAt(c.x,c.y,n),this.zoom(u,n)}return this},getGraphBbox:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},r=rs(e.nodeVal),s=function(l){return Math.sqrt(Math.max(0,r(l)||1))*e.nodeRelSize},o=e.graphData.nodes.filter(n).map(function(a){return{x:a.x,y:a.y,r:s(a)}});return o.length?{x:[fxe(o,function(a){return a.x-a.r}),hxe(o,function(a){return a.x+a.r})],y:[fxe(o,function(a){return a.y-a.r}),hxe(o,function(a){return a.y+a.r})]}:null},pauseAnimation:function(e){return e.animationFrameRequestId&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),this},resumeAnimation:function(e){return e.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},btn),stateInit:function(){return{lastSetZoom:1,zoom:BZt(),forceGraph:new rW,shadowGraph:new rW().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new lJt,tweenGroup:new o6e}},init:function(e,n){var r=this;e.innerHTML="";var s=document.createElement("div");s.classList.add("force-graph-container"),s.style.position="relative",e.appendChild(s),n.canvas=document.createElement("canvas"),n.backgroundColor&&(n.canvas.style.background=n.backgroundColor),s.appendChild(n.canvas),n.shadowCanvas=document.createElement("canvas");var o=n.canvas.getContext("2d"),a=n.shadowCanvas.getContext("2d",{willReadFrequently:!0}),l={x:-1e12,y:-1e12},c=function(){var h=null,f=window.devicePixelRatio,p=l.x>0&&l.y>0?a.getImageData(l.x*f,l.y*f,1,1):null;return p&&(h=n.colorTracker.lookup(p.data)),h};ff(n.canvas).call(GXt().subject(function(){if(!n.enableNodeDrag)return null;var d=c();return d&&d.type==="Node"?d.d:null}).on("start",function(d){var h=d.subject;h.__initialDragPos={x:h.x,y:h.y,fx:h.fx,fy:h.fy},d.active||(h.fx=h.x,h.fy=h.y),n.canvas.classList.add("grabbable")}).on("drag",function(d){var h=d.subject,f=h.__initialDragPos,p=d,g=Zg(n.canvas).k,m={x:f.x+(p.x-f.x)/g-h.x,y:f.y+(p.y-f.y)/g-h.y};["x","y"].forEach(function(_){return h["f".concat(_)]=h[_]=f[_]+(p[_]-f[_])/g}),!(!h.__dragged&&mtn>=Math.sqrt(zZt(["x","y"].map(function(_){return Math.pow(d[_]-f[_],2)}))))&&(n.forceGraph.d3AlphaTarget(.3).resetCountdown(),n.isPointerDragging=!0,h.__dragged=!0,n.onNodeDrag(h,m))}).on("end",function(d){var h=d.subject,f=h.__initialDragPos,p={x:h.x-f.x,y:h.y-f.y};f.fx===void 0&&(h.fx=void 0),f.fy===void 0&&(h.fy=void 0),delete h.__initialDragPos,n.forceGraph.d3AlphaTarget()&&n.forceGraph.d3AlphaTarget(0).resetCountdown(),n.canvas.classList.remove("grabbable"),n.isPointerDragging=!1,h.__dragged&&(delete h.__dragged,n.onNodeDragEnd(h,p))})),n.zoom(n.zoom.__baseElem=ff(n.canvas)),n.zoom.__baseElem.on("dblclick.zoom",null),n.zoom.filter(function(d){return!d.button&&n.enableZoomPanInteraction&&(d.type!=="wheel"||rs(n.enableZoomInteraction)(d))&&(d.type==="wheel"||rs(n.enablePanInteraction)(d))}).on("zoom",function(d){var h=d.transform;[o,a].forEach(function(f){k6e(f),f.translate(h.x,h.y),f.scale(h.k,h.k)}),n.isPointerDragging=!0,n.onZoom&&n.onZoom(OD(OD({},h),r.centerAt())),n.needsRedraw=!0}).on("end",function(d){n.isPointerDragging=!1,n.onZoomEnd&&n.onZoomEnd(OD(OD({},d.transform),r.centerAt()))}),pZ(n),n.forceGraph.onNeedsRedraw(function(){return n.needsRedraw=!0}).onFinishUpdate(function(){Zg(n.canvas).k===n.lastSetZoom&&n.graphData.nodes.length&&(n.zoom.scaleTo(n.zoom.__baseElem,n.lastSetZoom=gtn/Math.cbrt(n.graphData.nodes.length)),n.needsRedraw=!0)}),n.tooltip=new CJt(s),["pointermove","pointerdown"].forEach(function(d){return s.addEventListener(d,function(h){d==="pointerdown"&&(n.isPointerPressed=!0,n.pointerDownEvent=h),!n.isPointerDragging&&h.type==="pointermove"&&n.onBackgroundClick&&(h.pressure>0||n.isPointerPressed)&&(h.pointerType==="mouse"||h.movementX===void 0||[h.movementX,h.movementY].some(function(g){return Math.abs(g)>1}))&&(n.isPointerDragging=!0);var f=p(s);l.x=h.pageX-f.left,l.y=h.pageY-f.top;function p(g){var m=g.getBoundingClientRect(),_=window.pageXOffset||document.documentElement.scrollLeft,b=window.pageYOffset||document.documentElement.scrollTop;return{top:m.top+b,left:m.left+_}}},{passive:!0})}),s.addEventListener("pointerup",function(d){if(n.isPointerPressed){if(n.isPointerPressed=!1,n.isPointerDragging){n.isPointerDragging=!1;return}var h=[d,n.pointerDownEvent];requestAnimationFrame(function(){if(d.button===0)if(n.hoverObj){var f=n["on".concat(n.hoverObj.type,"Click")];f&&f.apply(void 0,[n.hoverObj.d].concat(h))}else n.onBackgroundClick&&n.onBackgroundClick.apply(n,h);if(d.button===2)if(n.hoverObj){var p=n["on".concat(n.hoverObj.type,"RightClick")];p&&p.apply(void 0,[n.hoverObj.d].concat(h))}else n.onBackgroundRightClick&&n.onBackgroundRightClick.apply(n,h)})}},{passive:!0}),s.addEventListener("contextmenu",function(d){return!n.onBackgroundRightClick&&!n.onNodeRightClick&&!n.onLinkRightClick?!0:(d.preventDefault(),!1)}),n.forceGraph(o),n.shadowGraph(a);var u=gQt(function(){Hxe(a,n.width,n.height),n.shadowGraph.linkWidth(function(h){return rs(n.linkWidth)(h)+n.linkHoverPrecision});var d=Zg(n.canvas);n.shadowGraph.globalScale(d.k).tickFrame()},ptn);n.flushShadowCanvas=u.flush,(this._animationCycle=function d(){var h=!n.autoPauseRedraw||!!n.needsRedraw||n.forceGraph.isEngineRunning()||n.graphData.links.some(function(x){return x.__photons&&x.__photons.length});if(n.needsRedraw=!1,n.enablePointerInteraction){var f=n.isPointerDragging?null:c();if(f!==n.hoverObj){var p=n.hoverObj,g=p?p.type:null,m=f?f.type:null;if(g&&g!==m){var _=n["on".concat(g,"Hover")];_&&_(null,p.d)}if(m){var b=n["on".concat(m,"Hover")];b&&b(f.d,g===m?p.d:null)}n.tooltip.content(f&&rs(n["".concat(f.type.toLowerCase(),"Label")])(f.d)||null),n.canvas.classList[f&&n["on".concat(m,"Click")]||!f&&n.onBackgroundClick?"add":"remove"]("clickable"),n.hoverObj=f}h&&u()}if(h){Hxe(o,n.width,n.height);var y=Zg(n.canvas).k;n.onRenderFramePre&&n.onRenderFramePre(o,y),n.forceGraph.globalScale(y).tickFrame(),n.onRenderFramePost&&n.onRenderFramePost(o,y)}n.tweenGroup.update(),n.animationFrameRequestId=requestAnimationFrame(d)})()},update:function(e){}});const L6e=({initNode:i,options:e,onDataDisplay:n,wrapperRef:r,sampleLinks:s})=>{const o=$.useRef(null),{client:a}=Ur(),{enqueueSnackbar:l}=pu(),c=4;let u=null;const d=async h=>{h.clicked=!0;const{nodes:f,links:p}=o.current.graphData(),g=h.id;let m=[];try{m=await T3e(a,{collectionName:e.collectionName,pointId:g,limit:e.limit,filter:e.filter,using:e.using})}catch(_){l(_.message,{variant:"error"});return}o.current.graphData({nodes:[...f,...sGt(f,m)],links:[...p,...m.map(_=>({source:g,target:_.id}))]})};return $.useEffect(()=>{const h=document.getElementById("graph");o.current=ytn()(h).nodeColor(f=>f.clicked?"#e94":"#2cb").onNodeHover(f=>{if(!f){h.style.cursor="default";return}f.aa=1,h.style.cursor="pointer",u=f,n(f)}).autoPauseRedraw(!1).nodeCanvasObjectMode(f=>(f==null?void 0:f.id)===(u==null?void 0:u.id)?"before":void 0).nodeCanvasObject((f,p)=>{f&&(p.beginPath(),p.arc(f.x,f.y,c*1.4,0,2*Math.PI,!1),p.fillStyle=f.id===(u==null?void 0:u.id)?"#817":"transparent",p.fill())}).linkLabel("score").linkColor(()=>"#a6a6a6"),o.current.d3Force("charge").strength(-10)},[i,e]),$.useEffect(()=>{if(!r)return;const h=gV.debounce((f,p)=>{o.current.width(f).height(p)},500);return o.current.width(r==null?void 0:r.clientWidth).height(r==null?void 0:r.clientHeight),hfe(h).observe(r),()=>{hfe(h).unobserve(r)}},[r,i,e]),$.useEffect(()=>{(async()=>{const f=await tGt(a,{...e,initNode:i,sampleLinks:s});if(o.current&&e){const p=f.nodes[0];n(p),u=p,o.current.graphData(f).linkDirectionalArrowLength(3).onNodeClick(d)}})().catch(f=>{console.error(f),f.getActualType?l(JSON.stringify(f.getActualType()),{variant:"error"}):l(f.message,{variant:"error"})})},[i,e,s]),C.jsx("div",{id:"graph"})};L6e.propTypes={initNode:Z.object,options:Z.object.isRequired,onDataDisplay:Z.func.isRequired,wrapperRef:Z.object,sampleLinks:Z.array};const D6e=`
// Parameters for expansion request:
//
// Available parameters:
//
// - 'limit': number of records to use on each step.
// - 'sample': bootstrap graph with sample data from collection.
//
// - 'filter': filter expression to select vectors for visualization.
// See https://qdrant.tech/documentation/concepts/filtering/
//
// - 'using': specify which vector to use for visualization
// if there are multiple.
//
// - 'tree': if true, will use show spanning tree instead of full graph.
`,wtn=`
// Try me!
{
"limit": 5
}
`,Ctn=wtn+D6e;function Stn(){const i=$i(),e=z1(),n=V1(),r=Wv(),{newInitNode:s,vectorName:o}=r.state||{},[a,l]=$.useState(null),[c,u]=$.useState(null),[d,h]=$.useState({limit:5,filter:null,using:null,collectionName:n.collectionName}),[f,p]=$.useState(0),g=$.useRef(null),{height:m}=kse(),{enqueueSnackbar:_}=pu(),{client:b}=Ur(),[y,x]=$.useState(Ctn),[k,D]=$.useState(null),[R,E]=$.useState(0),A=(O,B)=>{E(B)};$.useEffect(()=>{var O;p(m-((O=g.current)==null?void 0:O.offsetTop))},[m,g]);const M=$.useCallback(O=>{D(O)},[]);$.useEffect(()=>{if(s){delete s.vector,l(s);const O=o?{limit:5,using:o}:{limit:5};x(JSON.stringify(O,null,2)+D6e),O.collectionName=n.collectionName,h(O)}},[s,o]);const N=async(O,B)=>{try{if(O.sample){const j=await rGt(b,{collectionName:B,...O});u(j),l(null)}else{const j=await nGt(b,{collectionName:B,filter:O==null?void 0:O.filter});l(j)}h({collectionName:B,...O})}catch(j){_(j.message,{variant:"error"})}},P=O=>({description:"Filter request",type:"object",properties:{limit:{description:"Page size. Default: 10",type:"integer",format:"uint",minimum:1,nullable:!0},filter:{description:"Look only for points which satisfies this conditions. If not provided - all points.",anyOf:[{$ref:"#/components/schemas/Filter"},{nullable:!0}]},using:{description:"Vector field name",type:"string",enum:O},sample:{description:"Bootstrap graph with sample data from collection",type:"integer",nullable:!0},tree:{description:"Show spanning tree instead of full graph",type:"boolean",nullable:!0}}});return $.useEffect(()=>{k!=null&&R!==1&&E(1)},[k]),C.jsx(C.Fragment,{children:C.jsx(Ye,{component:"main",children:C.jsx(ln,{container:!0,children:C.jsx(ln,{size:12,children:C.jsxs(UW,{direction:"horizontal",autoSaveId:"persistence",children:[C.jsx(ix,{defaultSize:50,children:C.jsxs(Ye,{width:"100%",children:[C.jsx(Ye,{children:C.jsxs(du,{variant:"heading",sx:{display:"flex",alignItems:"center",p:1,borderRadius:0},children:[C.jsx(ua,{title:"Back to collection",children:C.jsx(Ga,{sx:{mr:3},size:"small",onClick:()=>e(`/collections/${n.collectionName}`),children:C.jsx(hV,{})})}),C.jsx(Je,{variant:"h6",children:n.collectionName})]})}),C.jsx(Ye,{ref:g,height:f,width:"100%",children:C.jsx(L6e,{options:d,initNode:a,onDataDisplay:M,wrapperRef:g.current,sampleLinks:c})})]})}),C.jsx(qW,{style:{width:"10px",background:Pt(i.palette.primary.main,.05)},children:C.jsx(Ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"⋮"})}),C.jsx(ix,{children:C.jsxs(Ye,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[C.jsx(Ye,{sx:{borderBottom:1,borderColor:"divider",backgroundColor:i.palette.background.paper},children:C.jsxs(ose,{value:R,onChange:A,"aria-label":"graph visualization tabs",children:[C.jsx(mp,{label:"Code"}),C.jsx(mp,{label:"Data Panel"})]})}),C.jsx(KO,{value:R,index:0,style:{flex:1,overflow:"hidden"},children:C.jsx(MV,{code:y,onChange:x,onChangeResult:N,customRequestSchema:P})}),C.jsx(KO,{value:R,index:1,style:{flex:1,overflow:"hidden"},children:C.jsx(Ye,{sx:{height:"100%",overflowY:"scroll"},children:C.jsx(i3e,{point:k})})})]})})]})})})})})}const xtn=ye(l_)(({theme:i})=>({background:`${Pt(i.palette.primary.main,.12)} !important`,borderRadius:"0.5rem",padding:"1rem",display:"flex",alignItems:"flex-start",gap:"1rem","& .MuiAlert-icon":{width:"1.875rem",height:"1.875rem",margin:0},"& .MuiAlert-message":{flex:1,padding:0,margin:0},"& .MuiAlert-action":{padding:0,margin:0}})),ktn=ye(Je)`
font-size: 1rem;
line-height: 1.5;
color: ${({theme:i})=>i.palette.text.primary};
`,Ltn=ye(Ga)`
width: 1.875rem;
height: 1.875rem;
padding: 0.3125rem;
border-radius: 50%;
&:hover {
background-color: ${({theme:i})=>i.palette.action.hover};
}
`,E6e=({children:i,icon:e,onClose:n,show:r=!0})=>{const s=$i();if(!r)return null;const o=C.jsx(Wtt,{size:20,color:s.palette.primary.main}),a=e||o;return C.jsx(xtn,{icon:a,action:C.jsx(Ltn,{onClick:n,size:"small",children:C.jsx(kDe,{size:20})}),children:C.jsx(ktn,{component:"div",children:i})})};E6e.propTypes={children:Z.node.isRequired,icon:Z.node,onClose:Z.func.isRequired,show:Z.bool};const Dtn=ye(Ye)(({theme:i})=>({backgroundColor:i.palette.background.paper,borderRadius:8,position:"relative",border:`1px solid ${Pt(i.palette.divider,.12)}`,overflow:"hidden"})),Etn=ye(Ye)({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`radial-gradient(circle at 0% 150%, ${Bue[500]} 0%, transparent 40%),radial-gradient(circle at 100% 0%, ${Bue[500]} 0%, transparent 40%)`,opacity:.6,filter:"blur(8.3125rem)",pointerEvents:"none",zIndex:1}),Itn=ye(Ye)(({theme:i})=>({display:"flex",flexWrap:"wrap",[i.breakpoints.up("md")]:{flexWrap:"nowrap"}})),Ttn=ye(Ye)(({theme:i})=>({width:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"1.5rem",flexGrow:1,alignItems:"flex-start",[i.breakpoints.up("md")]:{maxWidth:"64%"}})),Rtn=ye(Ye)(({theme:i})=>({width:"100%",display:"flex",flexDirection:"column",[i.breakpoints.up("md")]:{maxWidth:"30rem"}})),Atn=ye(Ye)(({theme:i})=>({height:"100%",zIndex:3,flexShrink:0,display:"flex",alignSelf:"flex-end",paddingRight:"1.5rem",[i.breakpoints.up("md")]:{maxWidth:"25rem"}})),I6e=({title:i,description:e,buttonText:n,linkTo:r,imgSrc:s})=>{const o=$i(),a=r.startsWith("http:"),l=()=>{a||window.scrollTo(0,0)};return C.jsxs(Dtn,{children:[C.jsx(Etn,{}),C.jsxs(Itn,{children:[C.jsxs(Ttn,{children:[C.jsxs(Rtn,{children:[C.jsx(Je,{variant:"h5",sx:{color:o.palette.text.primary,fontSize:"1.5rem",fontWeight:600,lineHeight:1.3,margin:0},children:i}),C.jsx(Je,{variant:"body1",sx:{color:o.palette.text.secondary,margin:0},children:e})]}),C.jsx(Ci,{variant:"contained",component:lh,to:r,target:a?"_blank":void 0,onClick:l,sx:{mt:2},children:n})]}),C.jsx(Atn,{children:C.jsx("img",{src:s,alt:i,style:{width:"100%",height:"auto"}})})]})]})};I6e.propTypes={title:Z.string.isRequired,description:Z.string.isRequired,buttonText:Z.string.isRequired,linkTo:Z.string.isRequired,imgSrc:Z.string.isRequired};const Ntn=()=>{const[i,e]=$.useState(!0),{banner:n}=jDe(),r=()=>{e(!1)},s=()=>!n||!i?null:C.jsx(E6e,{show:i,onClose:r,children:C.jsxs(Je,{children:[n.message,"  ",n.link&&C.jsx(XM,{target:"_blank",href:n.link,children:n.link_text})]})});return C.jsxs(Ye,{component:"main",sx:{display:"flex",flexDirection:"column",gap:"40px",p:5,margin:"auto",maxWidth:"1120px"},children:[s(),C.jsxs(Ye,{component:"header",children:[C.jsx(Je,{component:"h1",variant:"h4",sx:{color:"text.primary",fontFeatureSettings:"'ss01' on, 'ss05' on, 'ss06' on, 'liga' off, 'clig' off",fontSize:"2rem",fontStyle:"normal",fontWeight:"600",lineHeight:"125%",letterSpacing:"-0.5px",mb:"1rem"},children:"Welcome to Qdrant!"}),C.jsx(I6e,{title:"Get started with vector search in Qdrant",description:"Start building your app by creating a collection and inserting your vectors.",buttonText:"View Quickstart",linkTo:"/tutorial/quickstart",imgSrc:bse("/assets/console.svg")})]}),C.jsxs(Ye,{component:"section",children:[C.jsx(Je,{component:"h2",variant:"h6",mb:"1rem",children:"Connect to your Project or Start with Samples"}),C.jsxs(ln,{container:!0,spacing:2,children:[C.jsx(ln,{size:{xs:12,md:6},children:C.jsx(zx,{icon:Ztt,title:"API Reference",description:"Explore Qdrant's REST API and SDKs to connect, query, and manage your vector data with ease.",href:"https://api.qdrant.tech/",showCta:!1})}),C.jsx(ln,{size:{xs:12,md:6},children:C.jsx(zx,{icon:_se,title:"Load Sample Data",description:"Follow this tutorial to import a remote snapshot and explore vector search with real data in just a few steps.",href:"/datasets",showCta:!1})})]})]}),C.jsxs(Ye,{component:"section",children:[C.jsx(Je,{component:"h2",variant:"h6",mb:"1rem",children:"Interactive Tutorials"}),C.jsx(Yce,{sections:["vectorSearch","multitenancy"],showTitle:!1})]})]})},Mtn=()=>{const{client:i}=Ur(),e=z1(),[n,r]=$.useState(!1);return $.useEffect(()=>{r(!0),i.getCollections().then(s=>{r(!1),s.collections.length>0?e("/collections"):e("/welcome")}).catch(s=>{console.error(s)})},[i]),C.jsx(C.Fragment,{children:n?C.jsx(AW,{}):null})},Ptn=()=>[{path:"/",element:C.jsx(knt,{}),children:[{path:"/",element:C.jsx(Mtn,{})},{path:"/welcome",element:C.jsx(Ntn,{})},{path:"/console",element:C.jsx(yPt,{})},{path:"/datasets",element:C.jsx(aKt,{})},{path:"/collections",element:C.jsx($4t,{})},{path:"/collections/:collectionName",element:C.jsx(sjt,{})},{path:"/collections/:collectionName/visualize",element:C.jsx(_qt,{})},{path:"/collections/:collectionName/graph",element:C.jsx(Stn,{})},{path:"/tutorial",element:C.jsx(Dqt,{})},{path:"/tutorial/:pageSlug",element:C.jsx(sKt,{})},{path:"/jwt",element:C.jsx(eGt,{})}]}];function Otn(i){nn.useEffect(()=>{const e=document.title;return document.title=i,()=>{document.title=e}})}const Ftn=ye("main")(({theme:i})=>({height:"100vh",scrollBehavior:"smooth",scrollbarWidth:"thin","& *::-webkit-scrollbar":{width:"6px",height:"6px"},"& *::-webkit-scrollbar-track":{background:i.palette.background.default},"& *::-webkit-scrollbar-thumb":{background:i.palette.nativeScrollbarBg,borderRadius:"6px"}}));function Btn(){const i=FW("(prefers-color-scheme: dark)"),e=localStorage.getItem("qdrant-web-ui-theme"),n=["dark","light"].includes(e)?e:i?"dark":"light",r=GZe(Ptn());return Otn("UI | Qdrant "),C.jsxs(EDe,{initialMode:n,children:[C.jsx(cLe,{}),C.jsx(Ftn,{children:r})]})}const jtn=mZe.createRoot(document.getElementById("root"));jtn.render(C.jsx(nn.StrictMode,{children:C.jsx(mQe,{children:C.jsx(Iet,{children:C.jsx(pPt,{anchorOrigin:{vertical:"top",horizontal:"center"},style:{flexWrap:"nowrap"},action:i=>C.jsx(Ci,{variant:"outlined",color:"inherit",onClick:()=>{Xd(i)},children:"Dismiss"}),children:C.jsx(Btn,{})})})})}));export{Z5 as m,UAe as t};