Files
leonpan-pc/_internal/editor/min/vs/editor.api-i0YVFWkl.js

901 lines
3.5 MiB
JavaScript
Raw Normal View History

2025-11-02 19:17:20 +08:00
define("vs/editor.api-i0YVFWkl",["exports"],(function(Io){"use strict";var Od,Fd,ac,_C,yp,Lp,Su,tl,yu,xp,yC,kp,zd,Dp,Ep,Np,Tp,ku,Rp,Mp,Pp,Ud,Iu,LC,Du,$d,Eu,kC,Ap,Op,Nu,Tu,Ru,Fp,Wp,Bp,Hp,Vp,jd,zp,Up,$p,jp,qp,Kp,Gp,Pu,Au,Zp,Yp,EC,NC,fc,Xp,Ou,Qp,Jp,il,Fu,em,tm,im,TC,nm,qd,Wu,sm,om,lm,RC,MC,Bu,zu,cm,dm,hm,um,fm,OC,$u,FC,gm,WC,BC,ju,pm,HC,mm,_m,bm,nl,pc,sl,Gd,vm,wm,Sm,ym,Lm;function IB(){return globalThis._VSCODE_NLS_MESSAGES}function VT(){return globalThis._VSCODE_NLS_LANGUAGE}const Ete=VT()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function qS(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),Ete&&(t=""+t.replace(/[aouei]/g,"$&$&")+""),t}function p(o,e,...t){return qS(typeof o=="number"?DB(o,e):e,t)}function DB(o,e){const t=IB()?.[o];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${o} !!!`)}return t}function H(o,e,...t){let i;typeof o=="number"?i=DB(o,e):i=e;const n=qS(i,t);return{value:n,original:e===i?n:qS(e,t)}}function Nte(o,e){const t=o;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const bt=window,YE=class YE{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}};YE.INSTANCE=new YE;let zT=YE;function EB(o,e,t){typeof e=="string"&&(e=o.matchMedia(e)),e.addEventListener("change",t)}function UT(o){return zT.INSTANCE.getZoomFactor(o)}const Im=navigator.userAgent,Fs=Im.indexOf("Firefox")>=0,KS=Im.indexOf("AppleWebKit")>=0,GC=Im.indexOf("Chrome")>=0,qu=!GC&&Im.indexOf("Safari")>=0,NB=!GC&&!qu&&KS;Im.indexOf("Electron/")>=0;const TB=Im.indexOf("Android")>=0;let $T=!1;if(typeof bt.matchMedia=="function"){const o=bt.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=bt.matchMedia("(display-mode: fullscreen)");$T=o.matches,EB(bt,o,({matches:t})=>{$T&&e.matches||($T=t)})}class Tte{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Dm.isErrorNoTelemetry(e)?new Dm(e.message+`
`+e.stack):new Error(e.message+`
`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const jT=new Tte;function GS(o){jT.onUnexpectedError(o)}function Ee(o){Do(o)||jT.onUnexpectedError(o)}function Di(o){Do(o)||jT.onUnexpectedExternalError(o)}function qT(o){if(o instanceof Error){const{name:e,message:t,cause:i}=o,n=o.stacktrace||o.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:Dm.isErrorNoTelemetry(o),cause:i?qT(i):void 0,code:o.code}}return o}const ZS="Canceled";function Do(o){return o instanceof cr?!0:o instanceof Error&&o.name===ZS&&o.message===ZS}class cr extends Error{constructor(){super(ZS),this.name=this.message}}function Rte(){const o=new Error(ZS);return o.name=o.message,o}function dr(o){return o?new Error(`Illegal argument: ${o}`):new Error("Illegal argument")}function YS(o){return o?new Error(`Illegal state: ${o}`):new Error("Illegal state")}class Mte extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Dm extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Dm)return e;const t=new Dm;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Ce extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ce.prototype)}}function KT(o,e){if(!o)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function ZC(o,e="Unreachable"){throw new Error(e)}function YC(o,e="unexpected state"){if(!o)throw typeof e=="string"?new Ce(`Assertion Failed: ${e}`):e}function RB(o,e="Soft Assertion Failed"){o||Ee(new Ce(e))}function Xd(o){if(!o()){debugger;o(),Ee(new Ce("Assertion Failed"))}}function XC(o,e){let t=0;for(;t<o.length-1;){const i=o[t],n=o[t+1];if(!e(i,n))return!1;t++}return!0}function ji(o){return typeof o=="string"}function nn(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function Pte(o){const e=Object.getPrototypeOf(Uint8Array);return typeof o=="object"&&o instanceof e}function bc(o){return typeof o=="number"&&!isNaN(o)}function GT(o){return!!o&&typeof o[Symbol.iterator]=="function"}function MB(o){return o===!0||o===!1}function Qn(o){return typeof o>"u"}function sn(o){return!hr(o)}function hr(o){return Qn(o)||o===null}function it(o,e){if(!o)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Qd(o){return YC(o!=null,"Argument is `undefined` or `null`."),o}function Ku(o){return typeof o=="function"}function Ate(o,e){const t=Math.min(o.length,e.length);for(let i=0;i<t;i++)Ote(o[i],e[i])}function Ote(o,e){if(ji(e)){if(typeof o!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(Ku(e)){try{if(o instanceof e)return}catch{}if(!hr(o)&&o.constructor===e||e.length===1&&e.call(void 0,o)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function l5e(o){return o}const Gu="en";let QC=!1,JC=!1,e1=!1,PB=!1,ZT=!1,YT=!1,AB=!1,XS,QS=Gu,OB=Gu,Fte,Cc;const vc=globalThis;let Eo;typeof vc.vscode<"u"&&typeof vc.vscode.process<"u"?Eo=vc.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Eo=process);const Wte=typeof Eo?.versions?.electron=="string"&&Eo?.type==="renderer";if(typeof Eo=="object"){QC=Eo.platform==="win32",JC=Eo.platform==="darwin",e1=Eo.platform==="linux",e1&&Eo.env.SNAP&&Eo.env.SNAP_REVISION,Eo.env.CI||Eo.env.BUILD_ARTIFACTSTAGINGDIRECTORY||Eo.env.GITHUB_WORKSPACE,XS=Gu,QS=Gu;const o=Eo.env.VSCODE_NLS_CONFIG;if(o)try{const e=JSON.parse(o);XS=e.userLocale,OB=e.osLocale,QS=e.resolvedLanguage||Gu,Fte=e.languagePack?.translationsConfigFile}catch{}PB=!0}else typeof navigator=="object"&&!Wte?(Cc=navigator.userAgent,QC=Cc.indexOf("Windows")>=0,JC=Cc.indexOf("Macintosh")>=0,YT=(Cc.indexOf("Macintosh")>=0||Cc.indexOf("iPad")>=0||Cc.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.
`).slice(2).join(`
`))}}class aie extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class lie extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class lR{constructor(e){this.value=e}}const cie=2;let P=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new rR(e?.onListenerError??Ee,this._options?.leakWarningThreshold??rie):void 0,this._perfMon=this._options?._profName?new oR(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);const l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new lie(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||Ee)(c),A.None}if(this._disposed)return A.None;t&&(e=e.bind(t));const n=new lR(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=aR.create(),s=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof lR?(this._deliveryQueue??=new $B,this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const r=ue(()=>{s?.(),this._removeListener(n)});return i instanceof U?i.add(r):Array.isArray(i)&&i.push(r),r},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const n=this._deliveryQueue.current===this;if(this._size*cie<=t.length){let s=0;for(let r=0;r<t.length;r++)t[r]?t[s++]=t[r]:n&&s<this._deliveryQueue.end&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=s}}_deliver(e,t){if(!e)return;const i=this._options?.onListenerError||Ee;if(!i){e.value(t);return}try{e.value(t)}catch(n){i(n)}}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof lR)this._deliver(this._listeners,e);else{const t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}};const die=()=>new $B;class $B{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Qu extends P{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Jn,this._mergeFn=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 jB extends Qu{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super
`),n=Lne(i[t+1]);if(n)return new jR(n.fileName,n.line,n.column,n.id)}constructor(e,t,i,n){this.fileName=e,this.line=t,this.column=i,this.id=n}}function Lne(o){const e=o.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:o};const t=o.match(/at ([^\(\)]*):(\d+):(\d+)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:o}}let qR;function xne(o){qR=o}let A6;function kne(o){A6=o}class O6{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t,i=Gi.ofCaller()){const n=t===void 0?void 0:e,s=t===void 0?e:t;return qR({owner:n,debugName:()=>{const r=OR(s);if(r!==void 0)return r;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(!n)return`${this.debugName} (mapped)`},debugReferenceFn:s},r=>s(this.read(r),r),i)}flatten(){return qR({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(A6(this,t)),this}}class Am extends O6{constructor(e){super(),this._observers=new Set,Wn()?.handleObservableCreated(this,e)}addObserver(e){const t=this._observers.size;this._observers.add(e),t===0&&this.onFirstObserverAdded(),t!==this._observers.size&&Wn()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){const t=this._observers.delete(e);t&&this._observers.size===0&&this.onLastObserverRemoved(),t&&Wn()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}debugGetObservers(){return this._observers}}function Le(o,e,t=Gi.ofCaller()){let i;return typeof o=="string"?i=new xn(void 0,o,void 0):i=new xn(o,void 0,void 0),new p1(i,e,Ro,t)}class p1 extends Am{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._value=t,Wn()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new Pm(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),Wn()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:i,didChange:!0,hadValue:!0});for(const r of this._observers)t.updateObserver(r,this),r.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}function KR(o,e,t=Gi.ofCaller()){let i;return typeof o=="string"?i=new xn(void 0,o,void 0):i=new xn(o,void 0,void 0),new Ine(i,e,Ro,t)}class Ine extends p1{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}class Dne extends Am{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this._deltas){Wn()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const t of this._observers)t.handleChange(this,e)}this._deltas.length=0}else{Wn()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(const e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();const e=[...this._observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeOb
| 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,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=p(1668,`Expected: {0}
Received: '{1}'.`,e,L1.getLexeme(t)),s=t.offset,r=L1.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:r,additionalInfo:i}),ac._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},ac._parseError=new Error,ac);const oB=class oB{static false(){return ms.INSTANCE}static true(){return Vs.INSTANCE}static has(e){return ff.create(e)}static equals(e,t){return Hm.create(e,t)}static notEquals(e,t){return Py.create(e,t)}static regex(e,t){return k1.create(e,t)}static in(e,t){return Ry.create(e,t)}static notIn(e,t){return My.create(e,t)}static not(e){return gf.create(e)}static and(...e){return pf.create(e,null,!0)}static or(...e){return Ac.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}};oB._parser=new Tse({regexParsingWithErrorRecovery:!1});let K=oB;function Rse(o,e){const t=o?o.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function x1(o,e){return o.cmp(e)}const tN=class tN{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 Vs.INSTANCE}};tN.INSTANCE=new tN;let ms=tN;const iN=class iN{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 ms.INSTANCE}};iN.INSTANCE=new iN;let Vs=iN;class ff{static create(e,t=null){const i=Hn.get(e);return typeof i=="boolean"?i?Vs.INSTANCE:ms.INSTANCE:new ff(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:CH(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Hn.get(this.key);return typeof e=="boolean"?e?Vs.INSTANCE:ms.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=gf.create(this.key,this)),this.negated}}class Hm{static create(e,t,i=null){if(typeof t=="boolean")return t?ff.create(e,i):gf.create(e,i);const n=Hn.get(e);return typeof n=="boolean"?t===(n?"true":"false")?Vs.INSTANCE:ms.INSTANCE:new Hm(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:mf(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=Hn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Vs.INSTANCE:ms.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=Py.create(this.key,this.value,this)),this.negated}}class Ry{static create(e,t){return new Ry(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:mf(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 t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?Sse.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=My.create(this.key,this.valueKey)),this.negated}}class My{static create(e,t){return new My(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=Ry.create(e,t)}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}'`
`+e(r,i+1):n+=`${r}
`;return n};return e(this._data,0)}}function lh(o){return o===47||o===92}function IH(o){return o.replace(/[\\/]/g,Pi.sep)}function $se(o){return o.indexOf("/")===-1&&(o=IH(o)),/^[a-zA-Z]:(\/|$)/.test(o)&&(o="/"+o),o}function DH(o,e=Pi.sep){if(!o)return"";const t=o.length,i=o.charCodeAt(0);if(lh(i)){if(lh(o.charCodeAt(1))&&!lh(o.charCodeAt(2))){let s=3;const r=s;for(;s<t&&!lh(o.charCodeAt(s));s++);if(r!==s&&!lh(o.charCodeAt(s+1))){for(s+=1;s<t;s++)if(lh(o.charCodeAt(s)))return o.slice(0,s+1).replace(/[\\/]/g,e)}}return e}else if(EH(i)&&o.charCodeAt(1)===58)return lh(o.charCodeAt(2))?o.slice(0,2)+e:o.slice(0,2);let n=o.indexOf("://");if(n!==-1){for(n+=3;n<t;n++)if(lh(o.charCodeAt(n)))return o.slice(0,n+1)}return""}function f2(o,e,t,i=_a){if(o===e)return!0;if(!o||!e||e.length>o.length)return!1;if(t){if(!_R(o,e))return!1;if(e.length===o.length)return!0;let s=e.length;return e.charAt(e.length-1)===i&&s--,o.charAt(s)===i}return e.charAt(e.length-1)!==i&&(e+=i),o.indexOf(e)===0}function EH(o){return o>=65&&o<=90||o>=97&&o<=122}function jse(o,e=gn){return e?EH(o.charCodeAt(0))&&o.charCodeAt(1)===58:!1}function hl(o){return hy(o,!0)}class qse{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:a1(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===we.file)return f2(hl(e),hl(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(RH(e.authority,t.authority))return f2(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return be.joinPath(e,...t)}basenameOrAuthority(e){return vr(e)||e.authority}basename(e){return Pi.basename(e.path)}extname(e){return Pi.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===we.file?t=be.file(d6(hl(e))).path:(t=Pi.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===we.file?t=be.file(c6(hl(e))).path:t=Pi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!RH(e.authority,t.authority))return;if(e.scheme===we.file){const s=Kie(hl(e),hl(t));return gn?IH(s):s}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let s=0;for(const r=Math.min(i.length,n.length);s<r&&!(i.charCodeAt(s)!==n.charCodeAt(s)&&i.charAt(s).toLowerCase()!==n.charAt(s).toLowerCase());s++);i=n.substr(0,s)+i.substr(s)}return Pi.relative(i,n)}resolvePath(e,t){if(e.scheme===we.file){const i=be.file(qie(hl(e),t));return e.with({authority:i.authority,path:i.path})}return t=$se(t),e.with({path:Pi.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]==="/"}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&Nm(e,t)}hasTrailingPathSeparator(e,t=_a){if(e.scheme===we.file){const i=hl(e);return i.length>DH(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=_a){return MH(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=_a){let i=!1;if(e.scheme===we.file){const n=hl(e);i=n!==void 0&&n.length===DH(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=n.length===1&&n.charCodeAt(n.length-1)===47}return!i&&!MH(e,t)?e.with({path:e.path+"/"}):e}}const $t=new qse(()=>!1),ch=$t.isEqual.bind($t);$t.isEqualOrParent.bind($t),$t.getComparisonKey.bind($t);const Kse=$t.basenameOrAuthority.bind($t),vr=$t.basename.bind($t),Gse=$t.extname.bind($t),zy=$t.dirname.bind($t),NH=$t.joinPath.bind($t),Zse=$t.normalizePath.bind($t),Yse=$t.relativePath.bind($t),TH=$t.resolvePath.bind($t);$t.isAbsolutePath.bind($t);const RH=$t.isEqualAuthority.bind($t),MH=$t.ha
* '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}}}}]},o.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"},o.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case o.RawDirection.Left:n=0;break;case o.RawDirection.Right:n=1;break;case o.RawDirection.Up:n=2;break;case o.RawDirection.Down:n=3;break;case o.RawDirection.PrevBlankLine:n=4;break;case o.RawDirection.NextBlankLine:n=5;break;case o.RawDirection.WrappedLineStart:n=6;break;case o.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case o.RawDirection.WrappedLineColumnCenter:n=8;break;case o.RawDirection.WrappedLineEnd:n=9;break;case o.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case o.RawDirection.ViewPortTop:n=11;break;case o.RawDirection.ViewPortBottom:n=13;break;case o.RawDirection.ViewPortCenter:n=12;break;case o.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let s=0;switch(i.by){case o.RawUnit.Line:s=1;break;case o.RawUnit.WrappedLine:s=2;break;case o.RawUnit.Character:s=3;break;case o.RawUnit.HalfLine:s=4;break}return{direction:n,unit:s,select:!!i.select,value:i.value||1}}o.parse=t})(Qy||(Qy={}));var Ai;(function(o){o[o.None=0]="None",o[o.Indent=1]="Indent",o[o.IndentOutdent=2]="IndentOutdent",o[o.Outdent=3]="Outdent"})(Ai||(Ai={}));class w2{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 t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){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,t){if(e.getTokenCount()===0)return!0;const i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const n=String.fromCharCode(i);if(!this.open.includes(n)&&!this.close.includes(n))return n}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 woe{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)N1(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),N1(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),N1(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),N1(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&N1(this.autoClosingPairsCloseSingleChar,t.close,t)}}function N1(o,e,t){o.has(e)?o.get(e).pu
`,mC.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
`;let L2=mC,x2;function ZH(){return x2||(x2=new TextDecoder("UTF-16LE")),x2}let k2;function Loe(){return k2||(k2=new TextDecoder("UTF-16BE")),k2}let I2;function YH(){return I2||(I2=HB()?ZH():Loe()),I2}function xoe(o,e,t){const i=new Uint16Array(o.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?koe(o,e,t):ZH().decode(i)}function koe(o,e,t){const i=[];let n=0;for(let s=0;s<t;s++){const r=rne(o,e);e+=2,i[n++]=String.fromCharCode(r)}return i.join("")}class uh{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 YH().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 t=this._capacity-this._bufferLength;t<=1&&(t===0||zi(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class eL{constructor(e,t,i,n,s,r){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=s,this.reversedRegex=r,this._openSet=eL._toSet(this.open),this._closeSet=eL._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}function Ioe(o){const e=o.length;o=o.map(r=>[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r<e;r++)t[r]=r;const i=(r,a)=>{const[l,c]=r,[d,h]=a;return l===d||l===h||c===d||c===h},n=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d<e;d++)t[d]===c&&(t[d]=l)};for(let r=0;r<e;r++){const a=o[r];for(let l=r+1;l<e;l++){const c=o[l];i(a,c)&&n(t[r],t[l])}}const s=[];for(let r=0;r<e;r++){const a=[],l=[];for(let c=0;c<e;c++)if(t[c]===r){const[d,h]=o[c];a.push(d),l.push(h)}a.length>0&&s.push({open:a,close:l})}return s}class Doe{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Ioe(t);this.brackets=i.map((n,s)=>new eL(e,s,n.open,n.close,Eoe(n.open,n.close,i,s),Noe(n.open,n.close,i,s))),this.forwardRegex=Toe(this.brackets),this.reversedRegex=Roe(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const s of n.open)this.textIsBracket[s]=n,this.textIsOpenBracket[s]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,s.length);for(const s of n.close)this.textIsBracket[s]=n,this.textIsOpenBracket[s]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,s.length)}}}function XH(o,e,t,i){for(let n=0,s=e.length;n<s;n++){if(n===t)continue;const r=e[n];for(const a of r.open)a.indexOf(o)>=0&&i.push(a);for(const a of r.close)a.indexOf(o)>=0&&i.push(a)}}function QH(o,e){return o.length-e.length}function tL(o){if(o.length<=1)return o;const e=[],t=new Set;for(const i of o)t.has(i)||(e.push(i),t.add(i));return e}function Eoe(o,e,t,i){let n=[];n=n.concat(o),n=n.concat(e);for(let s=0,r=n.length;s<r;s++)XH(n[s],t,i,n);return n=tL(n),n.sort(QH),n.reverse(),R1(n)}function Noe(o,e,t,i){let n=[];n=n.concat(o),n=n.concat(e);for(let s=0,r=n.length;s<r;s++)XH(n[s],t,i,n);return n=tL(n),n.sort(QH),n.reverse(),R1(n.map(D2))}function Toe(o){let e=[];for(const t of o){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=tL(e),R1(e)}function Roe(o){let e=[];for(const t of o){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=tL(e),R1(e.map(D2))}function Moe(o){const e=/^[\w ]+$/.test(o);return o=
`},"[yaml]":{"editor.insertSpaces":!0,"editor.tabSize":2}}}]);class Koe{constructor(e,t){this.languageId=e;const i=t.brackets?aV(t.brackets):[],n=new gR(a=>{const l=new Set;return{info:new Goe(this,a,l),closing:l}}),s=new gR(a=>{const l=new Set,c=new Set;return{info:new Zoe(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=n.get(a),d=s.get(l);c.closing.add(d.info),d.opening.add(c.info)}const r=t.colorizedBracketPairs?aV(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of r){const c=n.get(a),d=s.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...n.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...s.cachedValues].map(([a,l])=>[a,l.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)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return R1(t,e)}}function aV(o){return o.filter(([e,t])=>e!==""&&t!=="")}class lV{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Goe extends lV{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Zoe extends lV{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,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 Yoe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},cV=function(o,e){return function(t,i){e(t,i,o)}};class N2{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Jt=We("languageConfigurationService");let T2=class extends A{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new ere),this.onDidChangeEmitter=this._register(new P),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(R2));this._register(this.configurationService.onDidChangeConfiguration(n=>{const s=n.change.keys.some(a=>i.has(a)),r=n.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(s)this.configurations.clear(),this.onDidChangeEmitter.fire(new N2(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new N2(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new N2(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Xoe(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};T2=Yoe([cV(0,Me),cV(1,Mt)],T2);function Xoe(o,e,t,i){let n=e.getLanguageConfiguration(o);if(!n){if(!i.isRegisteredLanguageId(o))return new Zm(o,{});n=new Zm(o,{})}const s=Qoe(n.languageId,t),r=uV([n.underlyingConfig,s]);return new Zm(n.languageId,r)}const R2={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Qoe(o,e){const t=e.getValue(R2.brackets,{overrideIdentifier:o}),i=e.getValue(R2.colorizedBracketPairs,{overrideIdentifier:o});return{brackets:dV(t),colorizedBracketPairs:dV(i)}}function dV(o){if(Array.isArray(o))return o.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],
`){const r=[];for(let a=0,l=i.length;a<l;a++)r[a]=this._enter(e,t,!1,i[a]);return new _s(4,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}static _enter(e,t,i,n){if(e.autoIndent===0)return Lf(n,`
`,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),c=It(l).substring(0,n.startColumn-1);return Lf(n,`
`+e.normalizeIndentation(c),i)}const s=Ym(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===Ai.None)return Lf(n,`
`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Ai.Indent)return Lf(n,`
`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Ai.IndentOutdent){const l=e.normalizeIndentation(s.indentation),c=e.normalizeIndentation(s.indentation+s.appendText),d=`
`+c+`
`+l;return i?new $y(n,d,!0):new jy(n,d,-1,c.length-l.length,!0)}else if(s.indentAction===Ai.Outdent){const l=dL(e,s.indentation);return Lf(n,`
`+e.normalizeIndentation(l+s.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=It(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=lre(e.autoIndent,t,n,{unshiftIndent:c=>dL(e,c),shiftIndent:c=>U2(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,h=t.getLineContent(n.endLineNumber),u=es(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new $y(n,`
`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return d<=u+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new jy(n,`
`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return Lf(n,`
`+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){let a=i[s].positionLineNumber;if(a===1)n[s]=new $y(new k(1,1,1,1),`
`);else{a--;const l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new k(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s].positionLineNumber,l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new k(a,l,a,l))}return n}static lineBreakInsert(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++)n[s]=this._enter(e,t,!0,i[s]);return n}}class _re{static getEdits(e,t,i,n,s,r){const a=this._distributePasteToCursors(e,i,n,s,r);return a?(i=i.sort(k.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,s)}static _distributePasteToCursors(e,t,i,n,s){if(n||t.length===1)return null;if(s&&s.length===t.length)return s;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substring(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substring(0,i.length-1));const r=ro(i);if(r.length===t.length)return r}return null}static _distributedPaste(e,t,i,n){const s=[];for(let r=0,a=i.length;r<a;r++){const c=e.overtypeOnPaste&&e.inputMode==="overtype"?m2:Dn;s[r]=new c(i[r],n[r])}return new _s(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,s){const r=[];for(let a=0,l=i.length;a<l;a++){const c=i[a],d=c.getPosition();if(s&&!c.isEmpty()&&(s=!1),s&&n.indexOf(`
`)!==n.length-1&&(s=!1),s){const h=new k(d.lineNumber,1,d.lineNumber,1);r[a]=new _2(h,n,c,!0)}else{const u=e.overtypeOnPaste&&e.inputMode==="overtype"?m2:Dn;r[a]=new u(c,n)}}return new _s(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class bre{static getEdits(e,t,i,n,s,r,a,l){const c=n.map(d=>this._compositionType(i,d,s,r,a,l));return new _s(4,c,{shouldPushStackElementBefore:cL(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+s),d=new k(a.lineNumber,l,a.lineNumber,c);return new jy(d,i,0,r)}}class Cre{static getEdits(e,t,i){const n=[];for(let r=0,a=t.length;r<a;r++)n[r]=new Dn(t[r],i);const s=z2(i,e);return new _s(s,n,{shouldPushStackElementBefore:cL(e,s),shouldPushStackElementAfter:!1})}}class vre{static getCommands(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let c=this._goodIndentForLine(e,t,a.startLineNumber);c=c||" ";const d=e.normalizeIndentation(c);if(!l.startsWith(d)){n[s]=new Dn(new k(a.startLineNumber,1,a.startLineNumber,l.length+1),d,!0);continue}}n[s]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){const l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){n[s]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}n[s]=new Lr(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static _goodIndentForLine(e,t,i){let n=null,s="";const r=M1(e.autoIndent,t,i,!1,e.languageConfigurationService);if(r)n=r.action,s=r.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Kr(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=Ym(e.autoIndent,t,new k(a,l,a,l),e.languageConfigurationService);c&&(s=c.indentation+c.appendText)}return n&&(n===Ai.Indent&&(s=U2(e,s)),n===Ai.Outdent&&(s=dL(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;d<c;d++)s+=" "}else s=" ";return new Dn(i,s,n)}}class V2 extends jy{constructor(e,t,i,n,s,r){super(e,t,i,n),this._openCharacter=s,this._closeCharacter=r,this.closeCharacterRange=null,this.enclosingRange=null}_computeCursorStateWithRange(e,t,i){return this.closeCharacterRange=new k(t.startLineNumber,t.endColumn-this._closeCharacter.length,t.endLineNumber,t.endColumn),this.enclosingRange=new k(t.startLineNumber,t.endColumn-this._openCharacter.length-this._closeCharacter.length,t.endLineNumber,t.endColumn),super.computeCursorState(e,i)}}class wre extends V2{constructor(e,t,i,n){const s=(i?t:"")+n,r=0,a=-n.length;super(e,s,r,a,t,n)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this._computeCursorStateWithRange(e,n,t)}}class Sre extends V2{constructor(e,t,i,n){const s=i+n,r=0,a=i.length;super(t,s,r,a,i,n),this._autoIndentationEdit=e,this._autoClosingEdit={range:t,text:s}}getEditOperations(e,t){t.addTrackedEditOperation(this._autoIndentationEdit.range,this._autoIndentationEdit.text),t.addTrackedEditOperation(this._autoClosingEdit.range,this._autoClosingEdit.text)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length!==2)throw new Error("There should be two inverse edit operations!");const n=i[0].range,s=i[1].range,r=n.plusRange(s);return this._computeCursorStateWithRange(e,r,t)}}function z2(o,e){return o===" "?e===5||e===6?6:5:4}function cL(o,e){return CV(o)&&!CV(e)?!0:o===5?!1:bV(o)!==bV(e)}function bV(o){return o===6||o===5?"space":o}function CV(o){return o===4||o===5||o===6}function vV(o,e,t,i,n){if(o.autoClosingOvertype==="never"||!o.autoClosingPairs.autoClosingPairsCloseSingleChar.has(n))return!1;for(let s=0,r=t.length;s<r;s++){const a=t[s
- 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.`)},0,150)}compute(e,t,i){return e.fontInfo.lineHeight}}class Jre extends Zt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(81,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p(273,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"string",enum:["none","mouseover","scroll"],enumDescriptions:[p(274,"The minimap is always shown."),p(275,"The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap."),p(276,"The minimap is only shown when the editor is scrolled")],default:e.autohide,description:p(277,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p(278,"The minimap has the same size as the editor contents (and might scroll)."),p(279,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p(280,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p(281,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p(282,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p(283,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:p(284,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p(285,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p(286,"Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:p(287,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:p(288,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.markSectionHeaderRegex":{type:"string",default:e.markSectionHeaderRegex,description:p(289,"Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:p(290,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:p(291,"Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;let i=this.defaultValue.markSectionHeaderRegex;const n=e.markSectionHeaderRegex;if(typeof n=="string")try{new RegExp(n,"d"),i=n}catch{}return{enabled:_e(t.enabled,this.defaultValue.enabled),autohide:Ot(t.autohide,this.defaultValue.autohide,["none","mouseover","scroll"]),size:Ot(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Ot(t.side,this.defaultValue.side,["right","left"]),showSlider:Ot(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:_e(t.renderCharacters,this.d
`)}}const bL=new Vae;ei.add(MV.ColorContribution,bL);function N(o,e,t,i,n){return bL.registerColor(o,e,t,i,n)}function zae(o,e){switch(o.op){case 0:return Dr(o.value,e)?.darken(o.factor);case 1:return Dr(o.value,e)?.lighten(o.factor);case 2:return Dr(o.value,e)?.transparent(o.factor);case 7:{const t=Dr(o.color,e)||$.transparent,i=Dr(o.with,e)||$.transparent;return t.mix(i,o.ratio)}case 3:{const t=Dr(o.background,e);return t?Dr(o.value,e)?.makeOpaque(t):Dr(o.value,e)}case 4:for(const t of o.values){const i=Dr(t,e);if(i)return i}return;case 6:return Dr(e.defines(o.if)?o.then:o.else,e);case 5:{const t=Dr(o.value,e);if(!t)return;const i=Dr(o.background,e);return i?t.isDarkerThan(i)?$.getLighterColor(t,i,o.factor).transparent(o.transparency):$.getDarkerColor(t,i,o.factor).transparent(o.transparency):t.transparent(o.factor*o.transparency)}default:throw ZC()}}function $s(o,e){return{op:0,value:o,factor:e}}function Ea(o,e){return{op:1,value:o,factor:e}}function Ne(o,e){return{op:2,value:o,factor:e}}function H1(...o){return{op:4,values:o}}function Uae(o,e,t){return{op:6,if:o,then:e,else:t}}function PV(o,e,t,i){return{op:5,value:o,background:e,factor:t,transparency:i}}function Dr(o,e){if(o!==null){if(typeof o=="string")return o[0]==="#"?$.fromHex(o):e.getColor(o);if(o instanceof $)return o;if(typeof o=="object")return zae(o,e)}}const AV="vscode://schemas/workbench-colors",OV=ei.as(nL.JSONContribution);OV.registerSchema(AV,bL.getColorSchema());const FV=new wt(()=>OV.notifySchemaChanged(AV),200);bL.onDidChangeSchema(()=>{FV.isScheduled()||FV.schedule()});const Ue=N("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},p(1756,"Overall foreground color. This color is only used if not overridden by a component."));N("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},p(1757,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),N("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},p(1758,"Overall foreground color for error messages. This color is only used if not overridden by a component."));const WV=N("descriptionForeground",{light:"#717171",dark:Ne(Ue,.7),hcDark:Ne(Ue,.7),hcLight:Ne(Ue,.7)},p(1759,"Foreground color for description text providing additional information, for example for a label.")),CL=N("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},p(1760,"The default color for icons in the workbench.")),_l=N("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},p(1761,"Overall border color for focused elements. This color is only used if not overridden by a component.")),Ze=N("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},p(1762,"An extra border around elements to separate them from others for greater contrast.")),jt=N("contrastActiveBorder",{light:null,dark:null,hcDark:_l,hcLight:_l},p(1763,"An extra border around active elements to separate them from others for greater contrast."));N("selection.background",null,p(1764,"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."));const $ae=N("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p(1765,"Foreground color for links in text."));N("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p(1766,"Foreground color for links in text when clicked on and on mouse hover.")),N("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:$.black,hcLight:"#292929"},p(1767,"Color for text separators.")),N("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},p(1768,"Foreground color for preformatted text segments.")),N("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},p(1769,"Background color for preformatted text segments.")),N("textBlockQuote.background",{light:"#f2f
${a}: ${r};`}return i+=`
}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Ece(o){return o.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class Tf extends A{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 t=!1;for(let i=0,n=e.length;i<n;i++){const s=e[i];switch(s.type){case 0:this.onCompositionStart(s)&&(t=!0);break;case 1:this.onCompositionEnd(s)&&(t=!0);break;case 2:this.onConfigurationChanged(s)&&(t=!0);break;case 3:this.onCursorStateChanged(s)&&(t=!0);break;case 4:this.onDecorationsChanged(s)&&(t=!0);break;case 5:this.onFlushed(s)&&(t=!0);break;case 6:this.onFocusChanged(s)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(s)&&(t=!0);break;case 8:this.onLineMappingChanged(s)&&(t=!0);break;case 9:this.onLinesChanged(s)&&(t=!0);break;case 10:this.onLinesDeleted(s)&&(t=!0);break;case 11:this.onLinesInserted(s)&&(t=!0);break;case 12:this.onRevealRangeRequest(s)&&(t=!0);break;case 13:this.onScrollChanged(s)&&(t=!0);break;case 15:this.onTokensChanged(s)&&(t=!0);break;case 14:this.onThemeChanged(s)&&(t=!0);break;case 16:this.onTokensColorsChanged(s)&&(t=!0);break;case 17:this.onZonesChanged(s)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(s)}}t&&(this._shouldRender=!0)}}class vs extends Tf{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class Na{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=i[n-r-1];return s}}class Nce{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._viewLayout.getLineHeightForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class Tce extends Nce{constructor(e,t,i,n){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i,this._viewLinesGpu=n}linesVisibleRangesForRange(e,t){const i=this._viewLines.linesVisibleRangesForRange(e,t);if(!this._viewLinesGpu)return i??null;const n=this._viewLinesGpu.linesVisibleRangesForRange(e,t);return i?n?i.concat(n).sort((s,r)=>s.lineNumber-r.lineNumber):i:n}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)??this._viewLinesGpu?.visibleRangeForPosition(e)??null}}class lz{constructor(e,t,i,n){this
</span></span>`):e.appendString("<span><span></span></span>"),new yM(new vl(0,0),0)}return Vce(Ace(o),e)}class Mce{constructor(e,t,i){this.characterMapping=e,this.html=t,this.containsForeignElements=i}}function FL(o){const e=new uh(1e4),t=h_(o,e);return new Mce(t.characterMapping,e.build(),t.containsForeignElements)}class Pce{constructor(e,t,i,n,s,r,a,l,c,d,h,u,f,g,m){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=s,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.renderSpaceCharCode=f,this.renderWhitespace=g,this.renderControlCharacters=m}}function Ace(o){const e=o.lineContent;let t,i,n;o.stopRenderingLineAfter!==-1&&o.stopRenderingLineAfter<e.length?(t=!0,i=e.length-o.stopRenderingLineAfter,n=o.stopRenderingLineAfter):(t=!1,i=0,n=e.length);let s=Oce(e,o.containsRTL,o.lineTokens,o.fauxIndentLength,n);o.renderControlCharacters&&!o.isBasicASCII&&(s=Wce(e,s)),(o.renderWhitespace===4||o.renderWhitespace===1||o.renderWhitespace===2&&o.selectionsOnLine||o.renderWhitespace===3&&!o.continuesWithWrappedLine)&&(s=Bce(o,e,n,s));let r=0;if(o.lineDecorations.length>0){for(let a=0,l=o.lineDecorations.length;a<l;a++){const c=o.lineDecorations[a];c.type===3||c.type===1?r|=1:c.type===2&&(r|=2)}s=Hce(e,n,s,o.lineDecorations)}return o.containsRTL||(s=Fce(e,s,!o.isBasicASCII||o.fontLigatures)),new Pce(o.useMonospaceOptimizations,o.canUseHalfwidthRightwardsArrow,e,n,t,i,s,r,o.fauxIndentLength,o.tabSize,o.startVisibleColumn,o.spaceWidth,o.renderSpaceCharCode,o.renderWhitespace,o.renderControlCharacters)}function Oce(o,e,t,i,n){const s=[];let r=0;i>0&&(s[r++]=new un(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l<c;l++){const d=t.getEndOffset(l);if(d<=i)continue;const h=t.getClassName(l);if(d>=n){const f=e?Tm(o.substring(a,n)):!1;s[r++]=new un(n,h,0,f);break}const u=e?Tm(o.substring(a,d)):!1;s[r++]=new un(d,h,0,u),a=d}return s}function Fce(o,e,t){let i=0;const n=[];let s=0;if(t)for(let r=0,a=e.length;r<a;r++){const l=e[r],c=l.endIndex;if(i+50<c){const d=l.type,h=l.metadata,u=l.containsRTL;let f=-1,g=i;for(let m=i;m<c;m++)o.charCodeAt(m)===32&&(f=m),f!==-1&&m-g>=50&&(n[s++]=new un(f+1,d,h,u),g=f+1,f=-1);g!==c&&(n[s++]=new un(c,d,h,u))}else n[s++]=l;i=c}else for(let r=0,a=e.length;r<a;r++){const l=e[r],c=l.endIndex,d=c-i;if(d>50){const h=l.type,u=l.metadata,f=l.containsRTL,g=Math.ceil(d/50);for(let m=1;m<g;m++){const _=i+m*50;n[s++]=new un(_,h,u,f)}n[s++]=new un(c,h,u,f)}else n[s++]=l;i=c}return n}function uz(o){return o<32?o!==9:o===127||o>=8234&&o<=8238||o>=8294&&o<=8297||o>=8206&&o<=8207||o===1564}function Wce(o,e){const t=[];let i=new un(0,"",0,!1),n=0;for(const s of e){const r=s.endIndex;for(;n<r;n++){const a=o.charCodeAt(n);uz(a)&&(n>i.endIndex&&(i=new un(n,s.type,s.metadata,s.containsRTL),t.push(i)),i=new un(n+1,"mtkcontrol",s.metadata,!1),t.push(i))}n>i.endIndex&&(i=new un(r,s.type,s.metadata,s.containsRTL),t.push(i))}return t}function Bce(o,e,t,i){const n=o.continuesWithWrappedLine,s=o.fauxIndentLength,r=o.tabSize,a=o.startVisibleColumn,l=o.useMonospaceOptimizations,c=o.selectionsOnLine,d=o.renderWhitespace===1,h=o.renderWhitespace===3,u=o.renderSpaceWidth!==o.spaceWidth,f=[];let g=0,m=0,_=i[m].type,b=i[m].containsRTL,C=i[m].endIndex;const w=i.length;let v=!1,S=es(e),L;S===-1?(v=!0,S=t,L=t):L=Kr(e);let x=!1,I=0,D=c&&c[I],R=a%r;for(let O=s;O<t;O++){const B=e.charCodeAt(O);D&&D.endExclusive<=O&&(I++,D=c&&c[I]);let V;if(O<S||O>L)V=!0;else if(B===9)V=!0;else if(B===32)if(d)if(x)V=!0;else{const z=O+1<t?e.charCodeAt(O+1):0;V=z===32||z===9}else V=!0;else V=!1;if(V&&c&&(V=!!D&&D.start<=O&&O<D.endExclusive),V&&h&&(V=v||O>L),V&&b&&O>=S&&O<=L&&(V=!1),x){if(!V||!l&&R>=r){if(u){const z=g>0?f[g-1].endIndex:s;for(let ee=z+1;ee<=O;ee++)f[g++]=new un(ee,"mtkw",1,!1)}else f[g++]=new un(O,"mtkw",1,!1);R=R%r}}else(O===C||V&&O>s)&&(f[g++]=new un(O,_,0,b),R=R%r);for(B===9?R=r:th(B)?R+=2:R++,x=V;O===C&&(m++,m<w);)_=i[m].type,b=i[m].containsRTL,C=i[m].endIndex}let F=!1;if(x)if(n&&d){con
target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?ti.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Nn.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Nn.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return Nn.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return Nn.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return Nn.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return Nn.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Nn.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Nn.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Nn.createOverlayWidget(this.target,this._getMouseColumn(),e)}}const mz={isAfterLines:!0};function Pf(o){return{isAfterLines:!1,horizontalDistanceToText:o}}class rs{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=Na.collect(t,this._viewHelper.viewDomNode);return!!(ws.isChildOfContentWidgets(i)||ws.isChildOfOverflowingContentWidgets(i)||ws.isChildOfOverlayWidgets(i)||ws.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,n,s){const r=new g_(this._context,this._viewHelper,e),a=new Yce(r,t,i,n,s);try{const l=rs._createMouseTarget(r,a);if(l.type===6&&r.stickyTabStops&&l.position!==null){const c=rs._snapToSoftTabBoundary(l.position,r.viewModel),d=k.fromPositions(c,c).plusRange(l.range);return a.fulfillContentText(c,d,l.detail)}return l}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t){if(t.target===null)return t.fulfillUnknown();const i=t;let n=null;return!ws.isChildOfOverflowGuard(t.targetPath)&&!ws.isChildOfOverflowingContentWidgets(t.targetPath)&&!ws.isChildOfOverflowingOverlayWidgets(t.targetPath)&&(n=n||t.fulfillUnknown()),n=n||rs._hitTestContentWidget(e,i),n=n||rs._hitTestOverlayWidget(e,i),n=n||rs._hitTestMinimap(e,i),n=n||rs._hitTestScrollbarSlider(e,i),n=n||rs._hitTestViewZone(e,i),n=n||rs._hitTestMargin(e,i),n=n||rs._hitTestViewCursor(e,i),n=n||rs._hitTestTextArea(e,i),n=n||rs._hitTestViewLines(e,i),n=n||rs._hitTestScrollbar(e,i),n||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(ws.isChildOfContentWidgets(t.targetPath)||ws.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(ws.isChildOfOverlayWidgets(t.targetPath)||ws.isChildOfOverflowingOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const n of i)if(t.target===n.domNode)return t.fulfillContentText(n.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,s=t.mouseVerticalOffset;for(const r of i){if(n<r.contentLeft||n>r.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=s&&s<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return ws.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillConten
`),null]:[e,t]},setTextData(o,e,t,i){o.setData(_i.text,e),typeof t=="string"&&o.setData("text/html",t),o.setData("vscode-editor-data",JSON.stringify(i))}},Sp=class Sp{constructor(e,t,i,n,s){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=s}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),s=e.getSelectionEnd();let r;if(t){const a=i.substring(0,n),l=t.value.substring(0,t.selectionStart);a===l&&(r=t.newlineCountBeforeSelection)}return new Sp(i,n,s,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new Sp(this.value,this.value.length,this.value.length,null,void 0)}isWrittenToTextArea(e,t){const i=this.value===e.getValue();return t?this.selectionStart===e.getSelectionStart()&&this.selectionEnd===e.getSelectionEnd()&&i:i}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,n,-1)}if(e>=this.selectionEnd){const n=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,n,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,s=-1;for(;(s=t.indexOf(`
`,s+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(Gr(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(Lc(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);const r=t.value.substring(n,t.value.length-s),a=e.selectionStart-n,l=e.selectionEnd-n,c=t.selectionStart-n,d=t.selectionEnd-n;if(c===d){const u=e.selectionStart-n;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=l-a;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(Gr(e.value,t.value),e.selectionEnd),n=Math.min(Lc(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-r.length}}static fromScreenReaderContentState(e){return new Sp(e.value,e.selectionStart,e.selectionEnd,e.selection,e.newlineCountBeforeSelection)}};Sp.EMPTY=new Sp("",0,0,null,void 0);let as=Sp;const Of=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);const o=new Uint8Array(16),e=[];for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(o),o[6]=o[6]&15|64,o[8]=o[8]&63|128;let i=0,n="";return n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n}})();function Lz(o){return`${o}-${Of()}`}var mde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xz=function(o,e){return function(t,i){e(t,i,o)}},zL;(function(o){o.Tap="-monaco-textarea-synthetic-tap"})(zL||(zL={}));class _de{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let NM=class extends A{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,s,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=s,this._logService=r,this._onFocus=this._register(new P),this.onFocus=this._onFocus.event,this._onBlur=this._register(new P),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new P),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new P),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new P),this.onCut=this._onCut.event,this._onPaste=this._register(new P),this.onPaste=this._onPaste.event,this._onType=this._register(new P),this.onType=this._onType.event,this._onCompositionStart=this._register(new P),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new P),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new P),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new P),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new ct),this._asyncTriggerCut=this._register(new wt(()=>this._onCut.fire(),0)),this._textAreaState=as.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.write
`):t.text,n),e.preventDefault(),e.clipboardData&&Af.setTextData(e.clipboardData,t.text,t.html,n),this._logService.trace("TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ",i," with text.length: ",t.text.length)}};NM=mde([xz(4,bn),xz(5,Rt)],NM);class bde extends A{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new P),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new gt(this._actual,"keydown")).event,this.onKeyPress=this._register(new gt(this._actual,"keypress")).event,this.onKeyUp=this._register(new gt(this._actual,"keyup")).event,this.onCompositionStart=this._register(new gt(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new gt(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new gt(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new gt(this._actual,"beforeinput")).event,this.onInput=this._register(new gt(this._actual,"input")).event,this.onCut=this._register(new gt(this._actual,"cut")).event,this.onCopy=this._register(new gt(this._actual,"copy")).event,this.onPaste=this._register(new gt(this._actual,"paste")).event,this.onFocus=this._register(new gt(this._actual,"focus")).event,this.onBlur=this._register(new gt(this._actual,"blur")).event,this._register(this.onKeyDown(()=>_h.onKeyDown())),this._register(this.onBeforeInput(()=>_h.onBeforeInput())),this._register(this.onInput(()=>_h.onInput())),this._register(this.onKeyUp(()=>_h.onKeyUp())),this._register(W(this._actual,zL.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=ah(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Ui()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}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,t,i){const n=this._actual;let s=null;const r=ah(n);r?s=r.activeElement:s=Ui();const a=me(s),l=s===n,c=n.selectionStart,d=n.selectionEnd;if(l&&c===t&&d===i){Fs&&a.parent!==a&&n.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),Fs&&a.parent!==a&&n.focus();return}try{const h=ose(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),rse(n,h)}catch{}}}class Cde extends IM{constructor(e,t,i){super(e,t,i),this._register($n.addTarget(this.viewHelper.linesContentDomNode)),this._register(W(this.viewHelper.linesContentDomNode,Pt.Tap,s=>this.onTap(s))),this._register(W(this.viewHelper.linesContentDomNode,Pt.Change,s=>this.onChange(s))),this._register(W(this.viewHelper.linesContentDomNode,Pt.Contextmenu,s=>this._onContextMenu(new Hc(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(W(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const r=s.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new kce(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(s,r)=>this._onMouseDown(s,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGestu
`)}}class wue{constructor(e,t,i){this._canvas=e,this._textureIndex=t,this._slabs=[],this._activeSlabsByDims=new Vy,this._unusedRects=[],this._openRegionsByHeight=new Map,this._openRegionsByWidth=new Map,this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=Vf(this._canvas.getContext("2d",{willReadFrequently:!0})),this._slabW=Math.min(i?.slabW??64<<Math.max(Math.floor(ft().devicePixelRatio)-1,0),this._canvas.width),this._slabH=Math.min(i?.slabH??this._slabW,this._canvas.height),this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}allocate(e){const t=e.boundingBox.right-e.boundingBox.left+1,i=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||i>this._canvas.height)throw new Ce("Glyph is too large for the atlas page");if(t>this._slabW||i>this._slabH){if(this._allocatedGlyphs.size>0)return;let c=this._canvas.width;for(;t<c/2&&i<c/2;)c/=2;this._slabW=c,this._slabH=c,this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}const n={w:t,h:i};let s=this._activeSlabsByDims.get(n.w,n.h);if(s){const c=Math.floor(this._slabW/s.entryW)*Math.floor(this._slabH/s.entryH);s.count>=c&&(s=void 0)}let r,a;if(!s)if(t<i){const c=this._openRegionsByWidth.get(t);if(c?.length)for(let d=c.length-1;d>=0;d--){const h=c[d];if(h.w>=t&&h.h>=i){r=h.x,a=h.y,t<h.w&&this._unusedRects.push({x:h.x+t,y:h.y,w:h.w-t,h:i}),h.y+=i,h.h-=i,h.h===0&&(d===c.length-1?c.pop():this._unusedRects.splice(d,1));break}}}else{const c=this._openRegionsByHeight.get(i);if(c?.length)for(let d=c.length-1;d>=0;d--){const h=c[d];if(h.w>=t&&h.h>=i){r=h.x,a=h.y,i<h.h&&this._unusedRects.push({x:h.x,y:h.y+i,w:t,h:h.h-i}),h.x+=t,h.w-=t,h.h===0&&(d===c.length-1?c.pop():this._unusedRects.splice(d,1));break}}}if(r===void 0||a===void 0){if(!s){if(this._slabs.length>=this._slabsPerRow*this._slabsPerColumn)return;s={x:Math.floor(this._slabs.length%this._slabsPerRow)*this._slabW,y:Math.floor(this._slabs.length/this._slabsPerRow)*this._slabH,entryW:n.w,entryH:n.h,count:0};const d=this._slabW%s.entryW,h=this._slabH%s.entryH;d&&dU(this._openRegionsByWidth,d,{x:s.x+this._slabW-d,w:d,y:s.y,h:this._slabH-(h??0)}),h&&dU(this._openRegionsByHeight,h,{x:s.x,w:this._slabW,y:s.y+this._slabH-h,h}),this._slabs.push(s),this._activeSlabsByDims.set(s,n.w,n.h)}const c=Math.floor(this._slabW/s.entryW);r=s.x+Math.floor(s.count%c)*s.entryW,a=s.y+Math.floor(s.count/c)*s.entryH,s.count++}this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,r,a,t,i);const l={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:r,y:a,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._allocatedGlyphs.add(l),l}getUsagePreview(){const e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=Vf(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);let s=0,r=0,a=0;const l=64<<Math.floor(ft().devicePixelRatio)-1,c=l;for(const h of this._slabs){let u=0,f=0;for(let _=0;_<h.count;_++)u+h.entryW>l&&(u=0,f+=h.entryH),n.fillStyle="#FF0000",n.fillRect(h.x+u,h.y+f,h.entryW,h.entryH),s+=h.entryW*h.entryH,u+=h.entryW;const g=Math.floor(l/h.entryW),m=Math.floor(c/h.entryH);h.entryW*g*h.entryH*m}for(const h of this._allocatedGlyphs)r+=h.w*h.h,n.fillStyle="#4040FF",n.fillRect(h.x,h.y,h.w,h.h);const d=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(const h of d)n.fillStyle="#FF000088",n.fillRect(h.x,h.y,h.w,h.h),a+=h.w*h.h;return n.globalAlpha=.5,n.drawImage(this._canvas,0,0),n.globalAlpha=1,i.convertToBlob()}getStats(){const e=this._canvas.width,t=this._canvas.height;let i=0,n=0,s=0,r=0,a=0;const l=e*t,c=64<<Math.floor(ft().devicePixelRatio)-1,d=c;for(const g of this._slabs){let m=0,_=0;for(let v=0;v<g.count;v++)m+g.entryW>c&&(m=0,_+=g.entryH),i+=g.entryW*g.entryH,m+=g.entryW;const b=Math.floor(c/g.entryW),C=Math.floor(d/g.entryH),w=g.entryW*b*g.entryH*C
`)}}function dU(o,e,t){let i=o.get(e);i||(i=[],o.set(e,i)),i.push(t)}var Sue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hU=function(o,e){return function(t,i){e(t,i,o)}},QM;let Ra=(yp=class extends A{get version(){return this._version}get usedArea(){return this._usedArea}get source(){return this._canvas}get glyphs(){return this._glyphInOrderSet.values()}constructor(e,t,i,n,s){switch(super(),this._logService=n,this._version=0,this._usedArea={left:0,top:0,right:0,bottom:0},this._glyphMap=new Vy,this._glyphInOrderSet=new Set,this._canvas=new OffscreenCanvas(t,t),this._colorMap=s.getColorTheme().tokenColorMap,i){case"shelf":this._allocator=new vue(this._canvas,e);break;case"slab":this._allocator=new wue(this._canvas,e);break;default:this._allocator=i(this._canvas,e);break}this._register(ue(()=>{this._canvas.width=1,this._canvas.height=1}))}getGlyph(e,t,i,n){return this._glyphMap.get(t,i,n,e.cacheKey)??this._createGlyph(e,t,i,n)}_createGlyph(e,t,i,n){if(this._glyphInOrderSet.size>=QM.maximumGlyphCount)return;const s=e.rasterizeGlyph(t,i,n,this._colorMap),r=this._allocator.allocate(s);if(r!==void 0)return this._glyphMap.set(r,t,i,n,e.cacheKey),this._glyphInOrderSet.add(r),this._version++,this._usedArea.right=Math.max(this._usedArea.right,r.x+r.w-1),this._usedArea.bottom=Math.max(this._usedArea.bottom,r.y+r.h-1),this._logService.getLevel()===Qi.Trace&&this._logService.trace("New glyph",{chars:t,tokenMetadata:i,decorationStyleSetId:n,rasterizedGlyph:s,glyph:r}),r}getUsagePreview(){return this._allocator.getUsagePreview()}getStats(){return this._allocator.getStats()}},QM=yp,yp.maximumGlyphCount=5e3,yp);Ra=QM=Sue([hU(3,Rt),hU(4,li)],Ra);var yue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uU=function(o,e){return function(t,i){e(t,i,o)}},sx;let xh=(Lp=class extends A{get pages(){return this._pages}constructor(e,t,i,n,s){super(),this._maxTextureSize=e,this._decorationStyleCache=i,this._themeService=n,this._instantiationService=s,this._warmUpTask=this._register(new ct),this._warmedUpRasterizers=new Set,this._pages=[],this._glyphPageIndex=new Vy,this._onDidDeleteGlyphs=this._register(new P),this.onDidDeleteGlyphs=this._onDidDeleteGlyphs.event,this._allocatorType=t?.allocatorType??"slab",this._register(ie.runAndSubscribe(this._themeService.onDidColorThemeChange,()=>{this._colorMap&&this.clear(),this._colorMap=this._themeService.getColorTheme().tokenColorMap}));const r=Math.max(1,Math.floor(ft().devicePixelRatio));this.pageSize=Math.min(1024*r,this._maxTextureSize),this._initFirstPage(),this._register(ue(()=>pt(this._pages)))}_initFirstPage(){const e=this._instantiationService.createInstance(Ra,0,this.pageSize,this._allocatorType);this._pages.push(e);const t=new gv(1,"",1,this._decorationStyleCache);e.getGlyph(t,"",0,0),t.dispose()}clear(){for(const e of this._pages)e.dispose();this._pages.length=0,this._glyphPageIndex.clear(),this._warmedUpRasterizers.clear(),this._warmUpTask.clear(),this._initFirstPage(),this._onDidDeleteGlyphs.fire()}getGlyph(e,t,i,n,s){return i&=-2048,i|=Math.floor(s%1*10),this._warmedUpRasterizers.has(e.id)||(this._warmUpAtlas(e),this._warmedUpRasterizers.add(e.id)),this._tryGetGlyph(this._glyphPageIndex.get(t,i,n,e.cacheKey)??0,e,t,i,n)}_tryGetGlyph(e,t,i,n,s){return this._glyphPageIndex.set(e,i,n,s,t.cacheKey),this._pages[e].getGlyph(t,i,n,s)??(e+1<this._pages.length?this._tryGetGlyph(e+1,t,i,n,s):void 0)??this._getGlyphFromNewPage(t,i,n,s)}_getGlyphFromNewPage(e,t,i,n){if(this._pages.length>=sx.maximumPageCount)throw new Error(`Attempt to create a texture atlas p
struct Vertex {
@location(0) position: vec2f,
};
struct LayoutInfo {
canvasDims: vec2f,
viewportOffset: vec2f,
viewportDims: vec2f,
}
struct ScrollOffset {
offset: vec2f,
}
struct Shape {
position: vec2f,
size: vec2f,
color: vec4f,
};
struct VSOutput {
@builtin(position) position: vec4f,
@location(1) color: vec4f,
};
// Uniforms
@group(0) @binding(1) var<uniform> layoutInfo: LayoutInfo;
// Storage buffers
@group(0) @binding(0) var<storage, read> shapes: array<Shape>;
@group(0) @binding(2) var<uniform> scrollOffset: ScrollOffset;
@vertex fn vs(
vert: Vertex,
@builtin(instance_index) instanceIndex: u32,
@builtin(vertex_index) vertexIndex : u32
) -> VSOutput {
let shape = shapes[instanceIndex];
var vsOut: VSOutput;
vsOut.position = vec4f(
(
// Top left corner
vec2f(-1, 1) +
// Convert pixel position to clipspace
vec2f( 2, -2) / layoutInfo.canvasDims *
// Shape position and size
(layoutInfo.viewportOffset - scrollOffset.offset + shape.position + vert.position * shape.size)
),
0.0,
1.0
);
vsOut.color = shape.color;
return vsOut;
}
@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
return vsOut.color;
}
`;class Nue extends Tf{constructor(e,t,i,n,s,r){super(),this._context=e,this._contentLeft=t,this._devicePixelRatio=i,this._canvas=n,this._ctx=s,this._shapeBindBuffer=this._register(new ct),this._initialized=!1,this._shapeCollection=this._register(kue([{name:"x"},{name:"y"},{name:"width"},{name:"height"},{name:"red"},{name:"green"},{name:"blue"},{name:"alpha"}],32)),this._context.addEventHandler(this),this._initWebgpu(r)}async _initWebgpu(e){if(this._device=await e,this._store.isDisposed)return;const t=navigator.gpu.getPreferredCanvasFormat();this._ctx.configure({device:this._device,format:t,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco rectangle renderer render pass",colorAttachments:[this._renderPassColorAttachment]};let i;{const a=new Float32Array(6),l=(c=this._canvas.width,d=this._canvas.height)=>(a[0]=c,a[1]=d,a[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*ft().devicePixelRatio),a[3]=0,a[4]=a[0]-a[2],a[5]=a[1]-a[3],a);i=this._register(qs.createBuffer(this._device,{label:"Monaco rectangle renderer uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>l())).object,this._register(cU(this._canvas,ft(),(c,d)=>{this._device.queue.writeBuffer(i,0,l(c,d))}))}const n=2;this._scrollOffsetBindBuffer=this._register(qs.createBuffer(this._device,{label:"Monaco rectangle renderer scroll offset buffer",size:n*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(n);const s=()=>qs.createBuffer(this._device,{label:"Monaco rectangle renderer shape buffer",size:this._shapeCollection.buffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});this._shapeBindBuffer.value=s(),this._register(ie.runAndSubscribe(this._shapeCollection.onDidChangeBuffer,()=>{this._shapeBindBuffer.value=s(),this._pipeline&&this._updateBindGroup(this._pipeline,i)})),this._vertexBuffer=this._register(qs.createBuffer(this._device,{label:"Monaco rectangle renderer vertex buffer",size:Hf.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},Hf)).object;const r=this._device.createShaderModule({label:"Monaco rectangle renderer shader module",code:Eue});this._pipeline=this._device.createRenderPipeline({label:"Monaco rectangle renderer render pipeline",layout:"auto",vertex:{module:r,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:r,targets:[{format:t,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._updateBindGroup(this._pipeline,i),this._initialized=!0}_updateBindGroup(e,t){this._bindGroup=this._device.createBindGroup({label:"Monaco rectangle renderer bind group",layout:e.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._shapeBindBuffer.value.object}},{binding:1,resource:{buffer:t}},{binding:2,resource:{buffer:this._scrollOffsetBindBuffer}}]})}register(e,t,i,n,s,r,a,l){return this._shapeCollection.createEntry({x:e,y:t,width:i,height:n,red:s,green:r,blue:a,alpha:l})}onScrollChanged(e){if(this._device){const t=ft().devicePixelRatio;this._scrollOffsetValueBuffer[0]=this._context.viewLayout.getCurrentScrollLeft()*t,this._scrollOffsetValueBuffer[1]=this._context.viewLayout.getCurrentScrollTop()*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer)}return!0}_update(){if(!this._device)return;const e=this._shapeCollection;e.dirtyTracker.isDirty&&(this._device.queue.writeBuffer(this._shapeBindBuffer.value.object,0,e.buffer,e.dirtyTracker.dataOffset,e.dirtyTracker.dirtySize*e.view.BYTES_PER_ELEMENT),e.dirtyTracker.clear())}draw(e){if(!this._initialized)return;this._update();const t=this._device.createCommandEncoder({label:"Monaco rectangle renderer command encoder"});this._renderPassColorAttachment.view=this._ctx.getCurrentTexture().createView();const i=t.beginRenderPass(this._renderPassDesc
struct GlyphInfo {
position: vec2f,
size: vec2f,
origin: vec2f,
};
struct Vertex {
@location(0) position: vec2f,
};
struct Cell {
position: vec2f,
unused1: vec2f,
glyphIndex: f32,
textureIndex: f32
};
struct LayoutInfo {
canvasDims: vec2f,
viewportOffset: vec2f,
viewportDims: vec2f,
}
struct ScrollOffset {
offset: vec2f
}
struct VSOutput {
@builtin(position) position: vec4f,
@location(1) layerIndex: f32,
@location(0) texcoord: vec2f,
};
// Uniforms
@group(0) @binding(4) var<uniform> layoutInfo: LayoutInfo;
@group(0) @binding(5) var<uniform> atlasDims: vec2f;
@group(0) @binding(6) var<uniform> scrollOffset: ScrollOffset;
// Storage buffers
@group(0) @binding(0) var<storage, read> glyphInfo: array<array<GlyphInfo, ${Ra.maximumGlyphCount}>, ${xh.maximumPageCount}>;
@group(0) @binding(1) var<storage, read> cells: array<Cell>;
@vertex fn vs(
vert: Vertex,
@builtin(instance_index) instanceIndex: u32,
@builtin(vertex_index) vertexIndex : u32
) -> VSOutput {
let cell = cells[instanceIndex];
var glyph = glyphInfo[u32(cell.textureIndex)][u32(cell.glyphIndex)];
var vsOut: VSOutput;
// Multiple vert.position by 2,-2 to get it into clipspace which ranged from -1 to 1
vsOut.position = vec4f(
// Make everything relative to top left instead of center
vec2f(-1, 1) +
((vert.position * vec2f(2, -2)) / layoutInfo.canvasDims) * glyph.size +
((cell.position * vec2f(2, -2)) / layoutInfo.canvasDims) +
((glyph.origin * vec2f(2, -2)) / layoutInfo.canvasDims) +
(((layoutInfo.viewportOffset - scrollOffset.offset * vec2(1, -1)) * 2) / layoutInfo.canvasDims),
0.0,
1.0
);
vsOut.layerIndex = cell.textureIndex;
// Textures are flipped from natural direction on the y-axis, so flip it back
vsOut.texcoord = vert.position;
vsOut.texcoord = (
// Glyph offset (0-1)
(glyph.position / atlasDims) +
// Glyph coordinate (0-1)
(vsOut.texcoord * (glyph.size / atlasDims))
);
return vsOut;
}
@group(0) @binding(2) var ourSampler: sampler;
@group(0) @binding(3) var ourTexture: texture_2d_array<f32>;
@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
return textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex));
}
`,cc=class cc extends gU{get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="viewport",this.wgsl=pU,this._cellBindBufferLineCapacity=63,this._activeDoubleBufferIndex=0,this._visibleObjectCount=0,this._scrollInitialized=!1,this._onDidChangeBindGroupEntries=this._register(new P),this.onDidChangeBindGroupEntries=this._onDidChangeBindGroupEntries.event,this._rebuildCellBuffer(this._cellBindBufferLineCapacity);const s=2;this._scrollOffsetBindBuffer=this._register(qs.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:s*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(s)}_rebuildCellBuffer(e){this._cellBindBuffer?.destroy();const t=(Math.floor(e/32)+1)*32,i=t*cc.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(qs.createBuffer(this._device,{label:"Monaco full file cell buffer",size:i,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(i),new ArrayBuffer(i)],this._cellBindBufferLineCapacity=t,this._onDidChangeBindGroupEntries.fire()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onTokensChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLinesChanged(e){return!0}onScrollChanged(e){const t=ft().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return!0}onLineMappingChanged(e){return!0}onZonesChanged(e){return!0}reset(){for(const e of[0,1]){const t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}}update(e,t){let i="",n,s=0,r=0,a=0,l=0,c=0,d=0,h,u=0,f=0,g=0,m=0,_,b,C,w,v,S=0,L=0,x;const I=ft().devicePixelRatio;let D;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0),this._cellBindBufferLineCapacity<e.endLineNumber-e.startLineNumber+1&&this._rebuildCellBuffer(e.endLineNumber-e.startLineNumber+1);const R=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);R.fill(0);const F=cc.maxSupportedColumns*6;for(r=e.startLineNumber;r<=e.endLineNumber;r++)if(this._viewGpuContext.canRender(t,e,r)){w=e.getViewLineRenderingData(r),d=0,D=ox(w,t),s=t.spaceWidth*I,l=0,x=w.tokens,f=w.minColumn-1,g=0;for(let B=0,V=x.getCount();B<V;B++)if(g=x.getEndOffset(B),!(g<=f)){for(m=x.getMetadata(B),a=f;a<g&&!(a>cc.maxSupportedColumns);a++){if(n=D.getSegmentAtIndex(a),n===void 0)continue;i=n,w.isBasicASCII&&t.useMonospaceOptimizations||(s=this.glyphRasterizer.getTextMetrics(i).width),b=void 0,_=void 0,C=void 0;for(v of w.inlineDecorations){if(r<v.range.startLineNumber||r>v.range.endLineNumber||r===v.range.startLineNumber&&a<v.range.startColumn-1||r===v.range.endLineNumber&&a>=v.range.endColumn-1)continue;const ee=ls.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,v.inlineClassName);for(const se of ee)for(const oe of se.style){const fe=se.styleMap.get(oe)?.toString()??"";switch(oe){case"color":{const Ie=$.Format.CSS.parse(fe);if(!Ie)throw new Ce("Invalid color format "+fe);b=Ie.toNumber32Bit();break}case"font-weight":{Fue(fe)>=400?_=!0:_=!1;break}case"opacity":{C=Wue(fe);break}default:throw new Ce("Unexpected inline decoration style")}}}if(i===" "||i===" "){if(u=((r-1)*cc.maxSupportedColumns+a)*6,R.fill(0,u,u+6),i===" "){const ee=a+d;d=ti.nextRenderTabStop(a+d,w.tabSize),l+=s*(d-ee),d-=a+1}else l+=s;continue}const z=ls.decorationStyleCache.getOrCreateEntry(b,_,C);h=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,i,m,z,l),c=Math.round(e.relativeVerticalOffset[r-e.startLineNumber]*I+Math.floor((e.lineHeight*I-(h.fontBoundingBoxAscent+h
`,t+1),t===-1)break;e++}while(!0);return e}var Uue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vU=function(o,e){return function(t,i){e(t,i,o)}};class $ue{constructor(e,t,i,n,s){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=s,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new M(this.modelLineNumber,this.distanceToModelLineStart+1),i=new M(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),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 sP=Fs;let oP=class extends _U{constructor(e,t,i,n,s,r){super(e),this._keybindingService=s,this._instantiationService=r,this._primaryCursorPosition=new M(1,1),this._primaryCursorVisibleRange=null,this._viewController=i,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const a=this._context.configuration.options,l=a.get(165);this._setAccessibilityOptions(a),this._contentLeft=l.contentLeft,this._contentWidth=l.contentWidth,this._contentHeight=l.height,this._fontInfo=a.get(59),this._emptySelectionClipboard=a.get(45),this._copyWithSyntaxHighlighting=a.get(31),this._visibleTextArea=null,this._selections=[new ce(1,1,1,1)],this._modelSelections=[new ce(1,1,1,1)],this._lastRenderPosition=null,this.textArea=lt(document.createElement("textarea")),Na.write(this.textArea,7),this.textArea.setClassName(`inputarea ${w_}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:c}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${c*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",nP(a,this._keybindingService)),this.textArea.setAttribute("aria-required",a.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(a.get(140))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",p(60,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",a.get(104)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=lt(document.createElement("div")),this.textAreaCover.setPosition("absolute"),t.appendChild(this.textArea),t.appendChild(this.textAreaCover);const d=new bU,h={getDataToCopy:()=>yz(this._context.viewModel,this._modelSelections,this._emptySelectionClipboard,this._copyWithSyntaxHighlighting),getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const g=this._selections[0];if(ze&&g.isEmpty()){const _=g.getStartPosition();let b=this._getWordBeforePosition(_);if(b.length===0&&(b=this._getCharacterBeforePosition(_)),b.length>0)return new as(b,b.length,b.length,k.fromPositions(_),0)}if(ze&&!g.isEmpty()&&this._context.viewModel.getValueLengthInRange(g,0)<500){const _=this._context.viewModel.
`),S=w.substring(v+1),L=S.lastIndexOf(" "),x=S.length-L-1,I=m.getStartPosition(),D=Math.min(I.column-1,x),R=I.column-1-D,F=S.substring(0,S.length-D),{tabSize:O}=this._context.viewModel.model.getOptions(),B=jue(this.textArea.domNode.ownerDocument,F,this._fontInfo,O);return{distanceToModelLineStart:R,widthOfHiddenTextBefore:B}})(),{distanceToModelLineEnd:C}=(()=>{const w=g.value.substring(Math.max(g.selectionStart,g.selectionEnd)),v=w.indexOf(`
`),S=v===-1?w:w.substring(0,v),L=S.indexOf(" "),x=L===-1?S.length:S.length-L-1,I=m.getEndPosition(),D=Math.min(this._context.viewModel.model.getLineMaxColumn(I.lineNumber)-I.column,x);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(I.lineNumber)-I.column-D}})();this._context.viewModel.revealRange("keyboard",!0,k.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new $ue(this._context,m.startLineNumber,_,b,C),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${w_} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(f=>{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 ${w_}`),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(Ll.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}get domNode(){return this.textArea}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose(),this.textArea.domNode.remove(),this.textAreaCover.domNode.remove()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=Sr(t,[]);let s=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(s||a);){if(s&&r<=1&&(s=!1),s){const d=i.charCodeAt(r-2);n.get(d)!==0?s=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);n.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Sr(this._context.configuration.options.get(148),[]);let n=e.column,s=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!zi(i.charCodeAt(0)))return i}return""}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Da.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(165).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const s=e.get(59);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*s.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=sP?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(59),this._emptySelectionClipboard=t.get(45),this._copyWithSyntaxHighlighting=t.get(31),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${n*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",nP(t,this._keybindingService)),this.textArea.setAttribute("aria-required",t.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(140))),(e.hasChanged(41)||e.hasChanged(104))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeN
`;this.value=i}equals(e){return this.value===e.value}static get NULL(){const e={getLineContent:()=>"",getLineCount:()=>1,getLineMaxColumn:()=>1,getValueInRange:()=>"",getValueLengthInRange:()=>0,modifyPosition:(t,i)=>t};return new _v(e,[])}}class Jue{constructor(){}_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t,i){const n=t*i,s=n+1,r=Math.min(n+i,e.getLineCount());return new Que(s,r)}fromEditorSelection(e,t,i){const n=this._getPageOfLine(t.startLineNumber,i),s=this._getRangeForPage(e,n,i),r=this._getPageOfLine(t.endLineNumber,i),a=this._getRangeForPage(e,r,i),l=[{startLine:s.startLine,endLine:s.endLine}];return n+1<r&&l.push({startLine:a.startLine,endLine:a.endLine}),new _v(e,l)}}class efe{constructor(e){this.replacements=e;let t=-1;for(const i of e){if(!(i.replaceRange.start>=t))throw new Ce(`Edits must be disjoint and sorted. Found ${i} after ${t}`);t=i.replaceRange.endExclusive}}toString(){return`[${this.replacements.map(t=>t.toString()).join(", ")}]`}normalize(){const e=[];let t;for(const i of this.replacements)if(!(i.getNewLength()===0&&i.replaceRange.length===0)){if(t&&t.replaceRange.endExclusive===i.replaceRange.start){const n=t.tryJoinTouching(i);if(n){t=n;continue}}t&&e.push(t),t=i}return t&&e.push(t),this._createNew(e)}compose(e){const t=this.normalize(),i=e.normalize();if(t.isEmpty())return i;if(i.isEmpty())return t;const n=[...t.replacements],s=[];let r=0;for(const a of i.replacements){for(;;){const h=n[0];if(!h||h.replaceRange.start+r+h.getNewLength()>=a.replaceRange.start)break;n.shift(),s.push(h),r+=h.getNewLength()-h.replaceRange.length}const l=r;let c,d;for(;;){const h=n[0];if(!h||h.replaceRange.start+r>a.replaceRange.endExclusive)break;c||(c=h),d=h,n.shift(),r+=h.getNewLength()-h.replaceRange.length}if(!c)s.push(a.delta(-r));else{const h=Math.min(c.replaceRange.start,a.replaceRange.start-l),u=a.replaceRange.start-(c.replaceRange.start+l);if(u>0){const _=c.slice(pe.emptyAt(h),new pe(0,u));s.push(_)}if(!d)throw new Ce("Invariant violation: lastIntersecting is undefined");const f=d.replaceRange.endExclusive+r-a.replaceRange.endExclusive;if(f>0){const _=d.slice(pe.ofStartAndLength(d.replaceRange.endExclusive,0),new pe(d.getNewLength()-f,d.getNewLength()));n.unshift(_),r-=_.getNewLength()-_.replaceRange.length}const g=new pe(h,a.replaceRange.endExclusive-r),m=a.slice(g,new pe(0,a.getNewLength()));s.push(m)}}for(;;){const a=n.shift();if(!a)break;s.push(a)}return this._createNew(s).normalize()}getNewRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(pe.ofStartAndLength(i.replaceRange.start+t,i.getNewLength())),t+=i.getLengthDelta();return e}isEmpty(){return this.replacements.length===0}}class tfe{constructor(e){this.replaceRange=e}delta(e){return this.slice(this.replaceRange.delta(e),new pe(0,this.getNewLength()))}getLengthDelta(){return this.getNewLength()-this.replaceRange.length}toString(){return`{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new pe(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}}class ife extends efe{apply(e){const t=[];let i=0;for(const n of this.replacements)t.push(e.substring(i,n.replaceRange.start)),t.push(n.newText),i=n.replaceRange.endExclusive;return t.push(e.substring(i)),t.join("")}}class nfe extends tfe{constructor(e,t){super(e),this.newText=t}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){const t=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),i=Gr(t,this.newText),n=Math.min(t.length-i,this.newText.length-i,Lc(t,this.newText)),s=new pe(this.replaceRange.start+i,this.replaceRange.endExclusive-n),r=this.newText.substring(i,this.newText.length-n);return new Cn(s,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){con
`?(t++,i=0):i++;return new el(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return e.lineCount===0?new el(this.lineCount,this.columnCount+e.columnCount):new el(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new k(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new k(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new k(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return ke.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new M(e.lineNumber,e.column+this.columnCount):new M(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};el.zero=new el(0,0);let $i=el;class SU{getOffsetRange(e){return new pe(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return k.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new Uf.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new Uf.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const t=e.replacements.map(i=>this.getTextReplacement(i));return new Uf.deps.TextEdit(t)}}const rB=class rB{static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};rB._deps=void 0;let Uf=rB;function sfe(o){Uf._deps=o}class rx extends SU{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)e.charAt(t)===`
`&&(this.lineStartOffsetByLineIdx.push(t+1),t>0&&e.charAt(t-1)==="\r"?this.lineEndOffsetByLineIdx.push(t-1):this.lineEndOffsetByLineIdx.push(t));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const t=this._validatePosition(e);return this.lineStartOffsetByLineIdx[t.lineNumber-1]+t.column-1}_validatePosition(e){if(e.lineNumber<1)return new M(1,1);const t=this.textLength.lineCount+1;if(e.lineNumber>t){const n=this.getLineLength(t);return new M(t,n+1)}if(e.column<1)return new M(e.lineNumber,1);const i=this.getLineLength(e.lineNumber);return e.column-1>i?new M(e.lineNumber,i+1):e}getPosition(e){const t=C_(this.lineStartOffsetByLineIdx,s=>s<=e),i=t+1,n=e-this.lineStartOffsetByLineIdx[t]+1;return new M(i,n)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new Uf.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class cP{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new M(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new k(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new rx(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new k(e,1,e,Number.MAX_SAFE_INTEGER))}}class ofe extends cP{constructor(e,t){YC(t>=1),super(),this._getLineContent=e,this._lineCount=t}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let t=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let i=e.startLineNumber+1;i<e.endLineNumber;i++)t+=`
`+this._getLineContent(i);return t+=`
`+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),t}getLineLength(e){return this._getLineContent(e).length}get length(){const e=this._getLineContent(this._lineCount);return new $i(this._lineCount-1,e.length)}}class ax extends ofe{constructor(e){super(t=>e[t-1],e.length)}}class kh extends cP{constructor(e){super(),this.value=e,this._t=new rx(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}class mo{static fromStringEdit(e,t){const i=e.replacements.map(n=>Oi.fromStringReplacement(n,t));return new mo(i)}static fromParallelReplacementsUnsorted(e){const t=e.slice().sort(kn(i=>i.range,k.compareRangesUsingStarts));return new mo(t)}constructor(e){this.replacements=e,Xd(()=>XC(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}mapPosition(e){let t=0,i=0,n=0;for(const s of this.replacements){const r=s.range.getStartPosition();if(e.isBeforeOrEqual(r))break;const a=s.range.getEndPosition(),l=$i.ofText(s.text);if(e.isBefore(a)){const c=new M(r.lineNumber+t,r.column+(r.lineNumber+t===i?n:0)),d=l.addToPosition(c);return lx(c,d)}r.lineNumber+t!==i&&(n=0),t+=l.lineCount-(s.range.endLineNumber-s.range.startLineNumber),l.lineCount===0?a.lineNumber!==r.lineNumber?n+=l.columnCount-(a.column-1):n+=l.columnCount-(a.column-r.column):n=l.columnCount,i=a.lineNumber+t}return new M(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){function t(r){return r instanceof M?r:r.getStartPosition()}function i(r){return r instanceof M?r:r.getEndPosition()}const n=t(this.mapPosition(e.getStartPosition())),s=i(this.mapPosition(e.getEndPosition()));return lx(n,s)}apply(e){let t="",i=new M(1,1);for(const s of this.replacements){const r=s.range,a=r.getStartPosition(),l=r.getEndPosition(),c=lx(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=s.text,i=l}const n=lx(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new kh(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const s of this.replacements){const r=$i.ofText(s.text),a=M.lift({lineNumber:s.range.startLineNumber+i,column:s.range.startColumn+(s.range.startLineNumber===t?n:0)}),l=r.createRange(a);e.push(l),i=l.endLineNumber-s.range.endLineNumber,n=l.endColumn-s.range.endColumn,t=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Ce;if(this.replacements.length===1)return this.replacements[0];const t=this.replacements[0].range.getStartPosition(),i=this.replacements[this.replacements.length-1].range.getEndPosition();let n="";for(let s=0;s<this.replacements.length;s++){const r=this.replacements[s];if(n+=r.text,s<this.replacements.length-1){const a=this.replacements[s+1],l=k.fromPositions(r.range.getEndPosition(),a.range.getStartPosition()),c=e.getValueOfRange(l);n+=c}}return new Oi(k.fromPositions(t,i),n)}toString(e){return e===void 0?this.replacements.map(t=>t.toString()).join(`
`):typeof e=="string"?this.toString(new kh(e)):this.replacements.length===0?"":this.replacements.map(t=>{const n=e.getValueOfRange(t.range),s=k.fromPositions(new M(Math.max(1,t.range.startLineNumber-1),1),t.range.getStartPosition());let r=e.getValueOfRange(s);r.length>10&&(r="..."+r.substring(r.length-10));const a=k.fromPositions(t.range.getEndPosition(),new M(t.range.endLineNumber+1,1));let l=e.getValueOfRange(a);l.length>10&&(l=l.substring(0,10)+"...");let c=n;if(c.length>10){const h=Math.floor(5);c=c.substring(0,h)+"..."+c.substring(c.length-h)}let d=t.text;if(d.length>10){const h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}return c.length===0?`${r}${d}${l}`:`${r}${c}${d}${l}`}).join(`
`)}}class Oi{static joinReplacements(e,t){if(e.length===0)throw new Ce;if(e.length===1)return e[0];const i=e[0].range.getStartPosition(),n=e[e.length-1].range.getEndPosition();let s="";for(let r=0;r<e.length;r++){const a=e[r];if(s+=a.text,r<e.length-1){const l=e[r+1],c=k.fromPositions(a.range.getEndPosition(),l.range.getStartPosition()),d=t.getValueOfRange(c);s+=d}}return new Oi(k.fromPositions(i,n),s)}static fromStringReplacement(e,t){return new Oi(t.getTransformer().getRange(e.replaceRange),e.newText)}static delete(e){return new Oi(e,"")}constructor(e,t){this.range=e,this.text=t}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(e,t){return e.range.equalsRange(t.range)&&e.text===t.text}equals(e){return Oi.equals(this,e)}removeCommonPrefixAndSuffix(e){return this.removeCommonPrefix(e).removeCommonSuffix(e)}removeCommonPrefix(e){const t=e.getValueOfRange(this.range).replaceAll(`\r
`,`
`),i=this.text.replaceAll(`\r
`,`
`),n=Gr(t,i),s=$i.ofText(t.substring(0,n)).addToPosition(this.range.getStartPosition()),r=i.substring(n),a=k.fromPositions(s,this.range.getEndPosition());return new Oi(a,r)}removeCommonSuffix(e){const t=e.getValueOfRange(this.range).replaceAll(`\r
`,`
`),i=this.text.replaceAll(`\r
`,`
`),n=Lc(t,i),s=$i.ofText(t.substring(0,t.length-n)).addToPosition(this.range.getStartPosition()),r=i.substring(0,i.length-n),a=k.fromPositions(this.range.getStartPosition(),s);return new Oi(a,r)}toString(){const e=this.range.getStartPosition(),t=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${t.lineNumber},${t.column}): "${this.text}"`}}function lx(o,e){if(o.lineNumber===e.lineNumber&&o.column===Number.MAX_SAFE_INTEGER)return k.fromPositions(e,e);if(!o.isBeforeOrEqual(e))throw new Ce("start must be before end");return new k(o.lineNumber,o.column,e.lineNumber,e.column)}sfe({StringEdit:qc,StringReplacement:Cn,TextReplacement:Oi,TextEdit:mo,TextLength:$i});var rfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},afe=function(o,e){return function(t,i){e(t,i,o)}};let dP=class extends A{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new ct),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._strategy=new bU,this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=this._domNode.domNode,i=ft().document.activeElement;if(!i||i!==t)return;if(this._accessibilityService.isScreenReaderOptimized()){this._state=this._getScreenReaderContentState(e),t.textContent!==this._state.value&&(this._setIgnoreSelectionChangeTime("setValue"),t.textContent=this._state.value);const s=ft().document.getSelection();if(!s)return;const r=this._getScreenReaderRange(this._state.selectionStart,this._state.selectionEnd);if(!r)return;this._setIgnoreSelectionChangeTime("setRange"),s.setBaseAndExtent(r.anchorNode,r.anchorOffset,r.focusNode,r.focusOffset)}else this._state=void 0,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){if(!this._state)return;const t=this._context.viewModel.viewLayout,i=this._state.startPositionWithinEditor.lineNumber,n=t.getVerticalOffsetForLineNumber(i),s=t.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=s-n}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return W(this._domNode.domNode.ownerDocument,"selectionchange",()=>{const t=this._accessibilityService.isScreenReaderOptimized();if(!this._state||!t||!Ll.enabled||!(ft().document.activeElement===this._domNode.domNode))return;const s=ft().document.getSelection();if(!s||s.rangeCount===0)return;const a=s.getRangeAt(0),l=Date.now(),c=l-e;if(e=l,c<5)return;const d=l-this._ignoreSelectionChangeTime;this._ignoreSelectionChangeTime=0,!(d<100)&&this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context,this._state,s.direction,a))})}_getScreenReaderContentState(e){const t=this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize,this._accessibilityService.getAccessibilitySupport()===0),i=this._context.viewModel.model.getPositionAt(1/0);let n=t.value;return i.column===1&&e.getEndPosition().equals(i)&&(n+=`
`),t.value=n,t}_getScreenReaderRange(e,t){const i=this._domNode.domNode.firstChild;if(!i)return;const n=new globalThis.Range;return n.setStart(i,e),n.setEnd(i,t),{anchorNode:i,anchorOffset:e,focusNode:i,focusOffset:t}}_getEditorSelectionFromDomRange(e,t,i,n){const s=e.viewModel,r=s.model,l=s.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor),c=r.getOffsetAt(l);let d=n.startOffset+c,h=n.endOffset+c;if(r.getEndOfLineSequence()===1){const b=t.value,C=new rx(b),w=C.getPosition(n.startOffset),v=C.getPosition(n.endOffset);d+=w.lineNumber-1,h+=v.lineNumber-1}const f=r.getPositionAt(d),g=r.getPositionAt(h),m=i==="forward"?f:g,_=i==="forward"?g:f;return ce.fromPositions(m,_)}};dP=rfe([afe(3,bn)],dP);var lfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yU=function(o,e){return function(t,i){e(t,i,o)}};let hP=class extends A{constructor(e,t,i,n,s){super(),this._domNode=e,this._context=t,this._viewController=i,this._keybindingService=n,this._accessibilityService=s,this._contentLeft=1,this._contentWidth=1,this._contentHeight=1,this._divWidth=1,this._primarySelection=new ce(1,1,1,1),this._primaryCursorVisibleRange=null,this._state=this._register(new ct),this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes()}onWillPaste(){this._state.value?.onWillPaste()}onWillCut(){this._state.value?.onWillCut()}handleFocusChange(e){this._state.value?.onFocusChange(e),this.writeScreenReaderContent()}onConfigurationChanged(e){this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes(),e.hasChanged(2)&&this.writeScreenReaderContent()}_instantiateScreenReaderContent(){const e=this._context.configuration.options.get(107);this._renderRichContent!==e&&(this._renderRichContent=e,this._state.value=this._createScreenReaderContent(e))}_createScreenReaderContent(e){return e?new lP(this._domNode,this._context,this._viewController,this._accessibilityService):new dP(this._domNode,this._context,this._viewController,this._accessibilityService)}_updateConfigurationSettings(){const e=this._context.configuration.options,t=e.get(165),i=t.wrappingColumn;this._contentLeft=t.contentLeft,this._contentWidth=t.contentWidth,this._contentHeight=t.height,this._fontInfo=e.get(59),this._divWidth=Math.round(i*this._fontInfo.typicalHalfwidthCharacterWidth),this._state.value?.onConfigurationChanged(e)}_updateDomAttributes(){const e=this._context.configuration.options;this._domNode.domNode.setAttribute("role","textbox"),this._domNode.domNode.setAttribute("aria-required",e.get(9)?"true":"false"),this._domNode.domNode.setAttribute("aria-multiline","true"),this._domNode.domNode.setAttribute("aria-autocomplete",e.get(104)?"none":"both"),this._domNode.domNode.setAttribute("aria-roledescription",p(55,"editor")),this._domNode.domNode.setAttribute("aria-label",nP(e,this._keybindingService));const t=this._context.viewModel.model.getOptions().tabSize,i=e.get(59).spaceWidth;this._domNode.domNode.style.tabSize=`${t*i}px`;const n=e.get(154),s=n==="inherit"?e.get(153):n,r=s==="inherit"?e.get(149):s;this._domNode.domNode.style.textWrap=r==="off"?"nowrap":"wrap"}onCursorStateChanged(e){this._primarySelection=e.selections[0]??new ce(1,1,1,1)}prepareRender(e){this.writeScreenReaderContent(),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primarySelection.getPosition())}render(e){if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._context.viewLayout.getCurrentScrollLeft(),i=this._contentLeft+this._primaryCursorVisibleRange.left-t;if(i<this._contentLeft||i>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const n=this._context.viewLayout.getCurrentScrollTop(),s=this._primarySelection.positionLineNumber,r=this._context.viewLayout.getVerticalOffse
`,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0})})),this._register(W(this.domNode.domNode,"paste",h=>{if(this.logService.trace("NativeEditContext#paste"),h.preventDefault(),!h.clipboardData)return;let[u,f]=Af.getTextData(h.clipboardData);if(this.logService.trace("NativeEditContext#paste with id : ",f?.id," with text.length: ",u.length),!u)return;f=f||wl.INSTANCE.get(u);let g=!1,m=null,_=null;f&&(g=this._context.configuration.options.get(45)&&!!f.isFromEmptySelection,m=typeof f.multicursorText<"u"?f.multicursorText:null,_=f.mode),this.logService.trace("NativeEditContext#paste (before viewController.paste)"),this._viewController.paste(u,g,m,_)})),this._register(mv(this._editContext,"textformatupdate",h=>this._handleTextFormatUpdate(h))),this._register(mv(this._editContext,"characterboundsupdate",h=>this._updateCharacterBounds(h)));let c;this._register(mv(this._editContext,"textupdate",h=>{const u=h.text;if(u.length===1){const f=u.charCodeAt(0);if(zi(f)){c=u;return}if(eh(f)&&c){const g={text:c+u,selectionEnd:h.selectionEnd,selectionStart:h.selectionStart,updateRangeStart:h.updateRangeStart-1,updateRangeEnd:h.updateRangeEnd-1};c=void 0,this._emitTypeEvent(this._viewController,g);return}}this._emitTypeEvent(this._viewController,h)})),this._register(mv(this._editContext,"compositionstart",h=>{this._updateEditContext(),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(mv(this._editContext,"compositionend",h=>{this._updateEditContext(),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}));let d=!1;this._register(Ll.onDidChange(()=>{Ll.enabled&&d&&(this._focusTracker.resume(),this.domNode.focus(),d=!1),!Ll.enabled&&this.isFocused()&&(this._focusTracker.pause(),this._imeTextArea.focus(),d=!0)})),this._register(fP.register(e,this))}dispose(){this.domNode.domNode.editContext=void 0,this.domNode.domNode.blur(),this.domNode.domNode.remove(),this._imeTextArea.domNode.remove(),super.dispose()}setAriaOptions(e){this._screenReaderSupport.setAriaOptions(e)}getLastRenderData(){return this._primarySelection.getPosition()}prepareRender(e){this._screenReaderSupport.prepareRender(e),this._updateSelectionAndControlBounds(e)}render(e){this._screenReaderSupport.render(e)}onCursorStateChanged(e){return this._primarySelection=e.modelSelections[0]??new ce(1,1,1,1),this._screenReaderSupport.onCursorStateChanged(e),this._updateEditContext(),!0}onConfigurationChanged(e){return this._screenReaderSupport.onConfigurationChanged(e),this._updateDomAttributes(),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.fromLineNumber+e.count-1),!0}onLinesDeleted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}onLinesInserted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}_updateEditContextOnLineChange(e,t){this._editContextPrimarySelection.endLineNumber<e||this._editContextPrimarySelection.startLineNumber>t||this._updateEditContext()}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}onWillPaste(){this.logService.trace("NativeEditContext#onWillPaste"),this._onWillPaste()}_onWillPaste(){this._screenReaderSupport.onWillPaste()}onWillCopy(){this.logService.trace("NativeEditContext#onWillCopy"),this.logService.trace("NativeEditContext#isFocused : ",this.domNode.domNode===Ui())}writeScreenReaderContent(){this._screenReaderSupport.writeScreenReaderContent()}isFocused(){return this._focusTracker.isFocused}focus(){this._focusTracker.focus(),this.refreshFocusState()}refreshFocusState(){this._focusTracker.refreshFocusState()}setEditContextOnDomNode(){const e=me(this.domNode.domNode),t=b1(e);this._targetWindowId!==t&&(this.domNode.domNode.editContext=this._editContext,this._targetWindowId=t)}_onKeyUp(e){this._viewController.emitKeyUp(new St(e))}_onKeyDown(e){const t=new St(e);t.keyCode===114&&t.stopPropagation(),this._viewController.emitKeyDown(t)}_updateDomAttributes
`):r.text,l),e.preventDefault(),e.clipboardData&&Af.setTextData(e.clipboardData,r.text,r.html,l),this.logService.trace("NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ",a," with text.length: ",r.text.length)}};cx=dfe([LU(5,ge),LU(6,Rt)],cx);class hfe extends vs{constructor(e,t){super(e),this._viewGpuContext=t,this._gpuShapes=[],this._register(Se(i=>this._updateEntries(i)))}onConfigurationChanged(e){return this._updateEntries(void 0),!0}prepareRender(e){}render(e){}_updateEntries(e){const t=this._context.configuration.options,i=t.get(116),n=t.get(59).typicalHalfwidthCharacterWidth,s=this._viewGpuContext.devicePixelRatio.read(e);for(let r=0,a=i.length;r<a;r++){const l=i[r],c=this._gpuShapes[r],d=l.color?$.fromHex(l.color):this._context.theme.getColor(Gde)??$.white,h=[l.column*n*s,0,Math.max(1,Math.ceil(s)),Number.MAX_SAFE_INTEGER,d.rgba.r/255,d.rgba.g/255,d.rgba.b/255,d.rgba.a];c?c.setRaw(h):this._gpuShapes[r]=this._viewGpuContext.rectangleRenderer.register(...h)}for(;this._gpuShapes.length>i.length;)this._gpuShapes.splice(-1,1)[0].dispose()}}const gN=class gN extends Lh{constructor(e,t){super(),this._viewGpuContext=t,this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onCursorStateChanged(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}onDecorationsChanged(e){return!0}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.viewportData,s=new GL(this._context.configuration,this._context.theme.type),r=[];for(let a=t;a<=i;a++){const l=a-t,c=this._viewGpuContext.canRenderDetailed(s,n,a);r[l]=c.length?`<div class="${gN.CLASS_NAME}" title="Cannot render on GPU: ${c.join(", ")}"></div>`:""}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};gN.CLASS_NAME="gpu-mark";let gP=gN;var ufe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ffe=function(o,e){return function(t,i){e(t,i,o)}};let pP=class extends Tf{constructor(e,t,i,n,s,r,a,l,c){super(),this._instantiationService=c,this._shouldRecomputeGlyphMarginLanes=!1,this._ownerID=t,this._widgetFocusTracker=this._register(new gfe(e,l)),this._register(this._widgetFocusTracker.onChange(()=>{this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus())})),this._selections=[new ce(1,1,1,1)],this._renderAnimationFrame=null,this._overflowGuardContainer=lt(document.createElement("div")),Na.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._viewController=new Sde(n,r,a,i),this._context=new uue(n,s,r),this._context.addEventHandler(this),this._viewParts=[],this._editContextEnabled=this._context.configuration.options.get(170),this._accessibilitySupport=this._context.configuration.options.get(2),this._editContext=this._instantiateEditContext(),this._viewParts.push(this._editContext),this._linesContent=lt(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=lt(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._context.configuration.options.get(46)==="on"&&(this._viewGpuContext=this._instantiationService.createInstance(ls,this._context)),this._scrollbar=new Che(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new BM(this._context,this._viewGpuContext,this._linesContent),
`,"gi"):null,s=[];let r,a=0,l=0,c=0,d=0;const h=[];for(let g=0;g<60;g++)h.push(new Eh(Ti(0,g),0,-1,_o.getEmpty(),new qf(Ti(0,g))));const u=[];for(let g=0;g<60;g++)u.push(new Eh(Ti(1,g),0,-1,_o.getEmpty(),new qf(Ti(1,g))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const g=r.index,m=r[0];if(m===`
`)a++,l=g+1;else{if(c!==g){let _;if(d===a){const b=g-c;if(b<h.length)_=h[b];else{const C=Ti(0,b);_=new Eh(C,0,-1,_o.getEmpty(),new qf(C))}}else{const b=a-d,C=g-l;if(b===1&&C<u.length)_=u[C];else{const w=Ti(b,C);_=new Eh(w,0,-1,_o.getEmpty(),new qf(w))}}s.push(_)}s.push(t.getToken(m)),c=g+m.length,d=a}}const f=e.length;if(c!==f){const g=d===a?Ti(0,f-c):Ti(a-d,f-l);s.push(new Eh(g,0,-1,_o.getEmpty(),new qf(g)))}this.length=Ti(a,f-l),this.tokens=s}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new Mte}}class yP{static createFromLanguage(e,t){function i(s){return t.getKey(`${s.languageId}:::${s.bracketText}`)}const n=new Map;for(const s of e.bracketsNew.openingBrackets){const r=Ti(0,s.bracketText.length),a=i(s),l=_o.getEmpty().add(a,PU);n.set(s.bracketText,new Eh(r,1,a,l,gx.create(r,s,l)))}for(const s of e.bracketsNew.closingBrackets){const r=Ti(0,s.bracketText.length);let a=_o.getEmpty();const l=s.getOpeningBrackets();for(const c of l)a=a.add(i(c),PU);n.set(s.bracketText,new Eh(r,2,i(l[0]),a,gx.create(r,s,a)))}return new yP(n)}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(t=>Bfe(t)).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[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Bfe(o){let e=oo(o);return/^[\w ]+/.test(o)&&(e=`\\b${e}`),/[\w ]+$/.test(o)&&(e=`${e}\\b`),e}class FU{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=yP.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Hfe(o){if(o.length===0)return null;if(o.length===1)return o[0];let e=0;function t(){if(e>=o.length)return null;const r=e,a=o[r].listHeight;for(e++;e<o.length&&o[e].listHeight===a;)e++;return e-r>=2?WU(r===0&&e===o.length?o:o.slice(r,e),!1):o[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())BU(i,n)<=BU(n,r)?(i=LP(i,n),n=r):n=LP(n,r);return LP(i,n)}function WU(o,e=!1){if(o.length===0)return null;if(o.length===1)return o[0];let t=o.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const s=n<<1;o[n]=xl.create23(o[s],o[s+1],s+3===t?o[s+2]:null,e)}t=i}return xl.create23(o[0],o[1],t>=3?o[2]:null,e)}function BU(o,e){return Math.abs(o.listHeight-e.listHeight)}function LP(o,e){return o.listHeight===e.listHeight?xl.create23(o,e,null,!1):o.listHeight>e.listHeight?Vfe(o,e):zfe(e,o)}function Vfe(o,e){o=o.toMutable();let t=o;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=xl.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?xl.create23(o,n,null,!1):o}function zfe(o,e){o=o.toMutable();let t=o;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=xl.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?xl.create23(n,o,null,!1):o}class Ufe{constructor(e){this.lastOffset=ys,this.nextNodes=[e],this.offsets=[ys],this.idxs=[]}readLongestNodeAt(e,t){if(D_(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=xv(this.nextNodes);if(!i)return;const n=xv(this.offsets);if(D_(e,n))return;if(D_(n,e))if(ui(n,i.length)<=e)this.nextNodeA
`?0:1}function Zc(o){return o?o instanceof KU||o instanceof Qfe:!1}class TP{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Zc(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Zc(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Zc(i)&&i.canAppend(this._model))return i;const n=new KU(p(781,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],NP(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n,s=jn.unknown({name:"pushEditOperation"})){const r=this._getOrCreateEditStackElement(e,n),a=this._model.applyEdits(t,!0,s),l=TP._computeCursorState(i,a),c=a.map((d,h)=>({index:h,textChange:d.textChange}));return c.sort((d,h)=>d.textChange.oldPosition===h.textChange.oldPosition?d.index-h.index:d.textChange.oldPosition-h.textChange.oldPosition),r.append(this._model,c.map(d=>d.textChange),NP(this._model),this._model.getAlternativeVersionId(),l),l}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Ee(i),null}}}class Jfe{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function ege(o,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let s;for(s=0;s<e&&s<i;s++){const u=o.charCodeAt(s),f=t.charCodeAt(s);if(u!==f)break}let r=0,a=0;for(let u=s;u<e;u++)o.charCodeAt(u)===32?r++:a++;let l=0,c=0;for(let u=s;u<i;u++)t.charCodeAt(u)===32?l++:c++;if(r>0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),h=Math.abs(r-l);if(d===0){n.spacesDiff=h,h>0&&0<=l-1&&l-1<o.length&&l<t.length&&t.charCodeAt(l)!==32&&o.charCodeAt(l-1)===32&&o.charCodeAt(o.length-1)===44&&(n.looksLikeAlignment=!0);return}if(h%d===0){n.spacesDiff=h/d;return}}function GU(o,e,t){const i=Math.min(o.getLineCount(),1e4);let n=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],c=8,d=[0,0,0,0,0,0,0,0,0],h=new Jfe;for(let g=1;g<=i;g++){const m=o.getLineLength(g),_=o.getLineContent(g),b=m<=65536;let C=!1,w=0,v=0,S=0;for(let x=0,I=m;x<I;x++){const D=b?_.charCodeAt(x):o.getLineCharCode(g,x);if(D===9)S++;else if(D===32)v++;else{C=!0,w=x;break}}if(!C||(S>0?n++:v>1&&s++,ege(r,a,_,w,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const L=h.spacesDiff;L<=c&&d[L]++,r=_,a=w}let u=t;n!==s&&(u=n<s);let f=e;if(u){let g=u?0:.1*i;l.forEach(m=>{const _=d[m];_>g&&(g=_,f=m)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}function Gs(o){return(o.metadata&1)>>>0}function qt(o,e){o.metadata=o.metadata&254|e<<0}function Rn(o){return(o.metadata&2)>>>1===1}function Ft(o,e){o.metadata=o.metadata&253|(e?1:0)<<1}function ZU(o){return(o.metadata&4)>>>2===1}function YU(o,e){o.metadata=o.metadata&251|(e?1:0)<<2}function XU(o){return(o.metadata&64)>>>6===1}function QU(o,e){o.metadata=o.metadata&191|(e?1:0)<<6}function JU(o){return(o.metadata&128)>>>7===1}function e$(o,e){o.metadata=o.metadata&127|(e?1:0)<<7}function tge(o){return(o.metadata&24)>>>3}function t$(o,e){o.metadata=o.metadata&231|e<<3}function ige(o){return(o.metadata&32)>>>5===1}function i$(o,e){o.metadata=o.metadata&223|(e?1:0)<<5}class n${constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,qt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,YU(this,!1),QU(this,!1),t$(this,1),i$(this,!1),e$(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Ft(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;YU(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),QU(this,this.options.glyphMarginClassName!==null),t$(this,this.options.stickiness),i$(this,this.options.collapseOnR
`)>=0;let t=null;try{t=JB(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Coe(t,this.wordSeparators?Sr(this.wordSeparators,[]):null,i?this.searchString:null)}}function c$(o){if(!o||o.length===0)return!1;for(let e=0,t=o.length;e<t;e++){const i=o.charCodeAt(e);if(i===10)return!0;if(i===92){if(e++,e>=t)break;const n=o.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function Gf(o,e,t){if(!t)return new E1(o,null);const i=[];for(let n=0,s=e.length;n<s;n++)i[n]=e[n];return new E1(o,i)}class d${constructor(e){const t=[];let i=0;for(let n=0,s=e.length;n<s;n++)e.charCodeAt(n)===10&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(n===-1||e<=t[0])return 0;for(;i<n;){const s=i+((n-i)/2>>0);t[s]>=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class vx{static findMatches(e,t,i,n,s){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new M_(r.wordSeparators,r.regex),n,s):this._doFindMatchesLineByLine(e,i,r,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(s),a=t+s+l):a=t+s;let c;if(n){const f=n.findLineFeedCountBeforeOffset(s+r.length)-l;c=a+r.length+f}else c=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(c);return new k(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,s){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r
`?new d$(a):null,c=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(c[d++]=Gf(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,n),d>=s)return c;return c}static _doFindMatchesLineByLine(e,t,i,n,s){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,s),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,s);for(let c=t.startLineNumber+1;c<t.endLineNumber&&a<s;c++)a=this._findMatchesInLine(i,e.getLineContent(c),c,0,a,r,n,s);if(a<s){const c=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,c,t.endLineNumber,0,a,r,n,s)}return r}static _findMatchesInLine(e,t,i,n,s,r,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const u=e.simpleSearch,f=u.length,g=t.length;let m=-f;for(;(m=t.indexOf(u,m+f))!==-1;)if((!c||BP(c,t,g,m,f))&&(r[s++]=new E1(new k(i,m+1+n,i,m+1+f+n),null),s>=l))return s;return s}const d=new M_(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[s++]=Gf(new k(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),s>=l))return s;while(h);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new M_(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new M(t.lineNumber,1),r=e.getOffsetAt(s),a=e.getLineCount(),l=e.getValueInRange(new k(s.lineNumber,s.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r
`?new d$(l):null;i.reset(t.column-1);const d=i.next(l);return d?Gf(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new M(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let c=1;c<=s;c++){const d=(r+c-1)%s,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const r=e.next(t);return r?Gf(new k(i,r.index+1,i,r.index+1+r[0].length),r,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new M_(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new k(1,1,t.lineNumber,t.column),i,n,10*gge);if(s.length>0)return s[s.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new M(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,n);if(l)return l;for(let c=1;c<=s;c++){const d=(s+r-c-1)%s,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let s=null,r;for(e.reset(0);r=e.next(t);)s=Gf(new k(i,r.index+1,i,r.index+1+r[0].length),r,n);return s}}function pge(o,e,t,i,n){if(i===0)return!0;const s=e.charCodeAt(i-1);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i);if(o.get(r)!==0)return!0}return!1}function mge(o,e,t,i,n){if(i+n===t)return!0;const s=e.charCodeAt(i+n);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(o.get(r)!==0)return!0}return!1}function BP(o,e,t,i,n){return pge(o,e,t,i,n)&&mge(o,e,t,i,n)}class M_{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const n=i.index,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){ry(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||BP(this._wordSeparators,e,t,n,s))return i}while(i);return null}}const Xc=65535;function h$(o){let e;return o[o.length-1]<65536?e=new Uint16Array(o.length):e=new Uint32Array(o.length),e.set(o,0),e}class _ge{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function Qc(o,e=!0){const t=[0];let i=1;for(let n=0,s=o.length;n<s;n++){const r=o.charCodeAt(n);r===13?n+1<s&&o.charCodeAt(n+1)===10?(t[i++]=n+2,n++):t[i++]=n+1:r===10&&(t[i++]=n+1)}return e?h$(t):t}function bge(o,e){o.length=0,o[0]=0;let t=1,i=0,n=0,s=0,r=!0;for(let l=0,c=e.length;l<c;l++){const d=e.charCodeAt(l);d===13?l+1<c&&e.charCodeAt(l+1)===10?(s++,o[t++]=l+2,l++):(i++,o[t++]=l+1):d===10?(n++,o[t++]=l+1):r&&d!==9&&(d<32||d>126)&&(r=!1)}const a=new _ge(h$(o),i,n,s,r);return o.length=0,a}class bo{constructor(e,t,i,n,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=s}}class Zf{constructor(e,t){this.buffer=e,this.lineStarts=t}}class Cge{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Oe&&e.iterate(e.root,i=>(i!==Oe&&this._pieces.push(i.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._pi
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,s-1)===13){const m=this.positionInBuffer(n,s-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,c);else this.deleteNodeTail(n,c);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let f=n;for(let g=0;g<u.length;g++)f=this.rbInsertRight(f,u[g]);this.deleteNodes(d)}else this.insertContentToNodeRight(t,n)}else{const n=this.createNewPieces(t);let s=this.rbInsertLeft(null,n[0]);for(let r=1;r<n.length;r++)s=this.rbInsertRight(s,n[r])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===Oe)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),s=i.node,r=n.node;if(s===r){const u=this.positionInBuffer(s,i.remainder),f=this.positionInBuffer(s,n.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){const g=s.next();Cx(this,s),this.validateCRLFWithPrevNode(g),this.computeBufferMetadata();return}this.deleteNodeHead(s,f),this._searchCache.validate(e),this.validateCRLFWithPrevNode(s),this.computeBufferMetadata();return}if(i.nodeStartOffset+s.piece.length===e+t){this.deleteNodeTail(s,u),this.validateCRLFWithNextNode(s),this.computeBufferMetadata();return}this.shrinkNode(s,u,f),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(s,i.remainder);this.deleteNodeTail(s,l),this._searchCache.validate(e),s.piece.length===0&&a.push(s);const c=this.positionInBuffer(r,n.remainder);this.deleteNodeHead(r,c),r.piece.length===0&&a.push(r);const d=s.next();for(let u=d;u!==Oe&&u!==r;u=u.next())a.push(u);const h=s.piece.length===0?s.prev():s;this.deleteNodes(a),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const r=t.piece,a={line:r.start.line+1,column:0},l=new bo(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=l,e+=`
`,Yc(this,t,-1,-1),t.piece.length===0&&i.push(t)}const n=this.createNewPieces(e);let s=this.rbInsertLeft(t,n[n.length-1]);for(let r=n.length-2;r>=0;r--)s=this.rbInsertLeft(s,n[r]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let r=1;r<i.length;r++)s=this.rbInsertRight(s,i[r]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,s=e.piece.bufferIndex,r=this._buffers[s].lineStarts,l=r[n.start.line]+n.start.column+t;let c=n.start.line,d=n.end.line,h=0,u=0,f=0;for(;c<=d&&(h=c+(d-c)/2|0,f=r[h],h!==d);)if(u=r[h+1],l<f)d=h-1;else if(l>=u)c=h+1;else break;return i?(i.line=h,i.column=l-f,null):{line:h,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],r=n[i.line]+i.column;if(s>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)Cx(this,e[t])}createNewPieces(e){if(e.length>Xc){const d=[];for(;e.length>Xc;){const u=e.charCodeAt(Xc-1);let f;u===13||u>=55296&&u<=56319?(f=e.substring(0,Xc-1),e=e.substring(Xc-1)):(f=e.substring(0,Xc),e=e.substring(Xc));const g=Qc(f);d.push(new bo(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new Zf(f,g))}const h=Qc(e);return d.push(new bo(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 Zf(e,h)),d}let t=this._buffers[0].buffer.length;const i=Qc(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let d=0;d<i.length;d++)i[d]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let d=0;d<i.length;d++)i[d]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const s=this._buffers[0].buffer.length,r=this._buffers[0].lineStarts.length-1,a=s-this._buffers[0].lineStarts[r],l={line:r,column:a},c=new bo(0,n,l,this.getLineFeedCnt(0,n,l),s-t);return this._lastChangeBufferPos=l,[c]}getLineRawContent(e,t=0){let i=this.root,n="";const s=this._searchCache.get2(e);if(s){i=s.node;const r=this.getAccumulatedValue(i,e-s.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(s.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=a.substring(l+r,l+i.piece.length);else{const c=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return a.substring(l+r,l+c-t)}}else{let r=0;const a=e;for(;i!==Oe;)if(i.left!==Oe&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+l,h+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Oe;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Oe;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this.
`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=Qc(t,!1);for(let f=0;f<s.length;f++)s[f]+=n;if(i){const f=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-f}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(s.slice(1));const r=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[r],l={line:r,column:a},c=e.piece.length+t.length,d=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,l),u=h-d;e.piece=new bo(e.piece.bufferIndex,e.piece.start,l,h,c),this._lastChangeBufferPos=l,Yc(this,e,t.length,u)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==Oe;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const s={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(s),s}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==Oe;)if(i.left!==Oe&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Oe;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:r}}else if(i.piece.length>=t-1){const s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Oe||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;return n===i.length-1||i[n+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Oe||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:s={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new bo(e.piece.bufferIndex,e.piece.start,s,a,r),Yc(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new bo(t.piece.bufferIndex,l,t.piece.end,d,c),Yc(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r
`);this.rbInsertRight(e,h[0]);for(let u=0;u<i.length;u++)Cx(this,i[u])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+=`
`,i.piece.length===1)Cx(this,i);else{const n=i.piece,s={line:n.start.line+1,column:0},r=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,s,n.end);i.piece=new bo(n.bufferIndex,s,n.end,a,r),Yc(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===Oe)return t(Oe);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===Oe)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),s=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,s)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new PP(t,1);if(i.left=Oe,i.right=Oe,i.parent=Oe,i.size_left=0,i.lf_left=0,this.root===Oe)this.root=i,i.color=0;else if(e.right===Oe)e.right=i,i.parent=e;else{const s=AP(e.right);s.left=i,i.parent=s}return l$(this,i),i}rbInsertLeft(e,t){const i=new PP(t,1);if(i.left=Oe,i.right=Oe,i.parent=Oe,i.size_left=0,i.lf_left=0,this.root===Oe)this.root=i,i.color=0;else if(e.left===Oe)e.left=i,i.parent=e;else{const n=a$(e.left);n.right=i,i.parent=n}return l$(this,i),i}}class P_ extends A{constructor(e,t,i,n,s,r,a){super(),this._onDidChangeContent=this._register(new P),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._pieceTree=new wge(e,i,a)}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,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),s=this.getPositionAt(i);return new k(n.lineNumber,n.column,s.lineNumber,s.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let s=0;const r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){const l=r.length-a.length,c=e.endLineNumber-e.startLineNumber;s=l*c}return n-i+s}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,s=e.endLineNumber;for(let r=n;r<=s;r++){const a=this.getLineContent(r),l=r===n?e.startColumn-1:0,c=r===s?e.endColumn-1:a.length;for(let d=l;d<c;d++)zi(a.charCodeAt(d))?(i=i+1,d=d+1):i=i+1}return i+=this._getEndOfLine(t).length*(s-n),i}return this.getValueLengthInRange(e,t)}getNearestChunk(e){return this._pieceTree.getNearestChunk(e)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=es(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Kr(this.getLineContent(e));return t===-1?0:t+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,t,i){let n=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let m=0;m<e.length;m++){const _=e[m];a&&_._isTracked&&(a=!1);const b=_.range;if(_.text){let L=!0;r||(L=!c1(_.text),r=L),!n&&L&&(n=Tm(_.text)),!s&&L&&(s=n6(_.text))}let C="",w=0,v=0,S=0;if(_.text){let L;[w,v,S,L]=Dh(_.text);const x=this.getEOL();L===0||L===(x===`\r
`?2:1)?C=_.text:C=_.text.replace(/\r\n|\r|\n/g,x)}l[m]={sortIndex:m,identifier:_.identifier||null,range:b,rangeOffset:this.getOffsetAt(b.startLineNumber,b.startColumn),rangeLength:this.getValueLengthInRange(b),text:C,eolCount:w,firstLineLength:v,lastLineLength:S,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(P_._sortOpsAscending);let c=!1;for(let m=0,_=l.length-1;m<_;m++){const b=l[m].range.getEndPosition(),C=l[m+1].range.getStartPosition();if(C.isBeforeOrEqual(b)){if(C.isBefore(b))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const d=i||t?P_._getInverseEditRanges(l):[],h=[];if(t)for(let m=0;m<l.length;m++){const _=l[m],b=d[m];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let C=b.startLineNumber;C<=b.endLineNumber;C++){let w="";C===b.startLineNumber&&(w=this.getLineContent(_.range.startLineNumber),es(w)!==-1)||h.push({lineNumber:C,oldContent:w})}}let u=null;if(i){let m=0;u=[];for(let _=0;_<l.length;_++){const b=l[_],C=d[_],w=this.getValueInRange(b.range),v=b.rangeOffset+m;m+=b.text.length-w.length,u[_]={sortIndex:b.sortIndex,identifier:b.identifier,range:C,text:w,textChange:new Tn(b.rangeOffset,w,v,b.text)}}c||u.sort((_,b)=>_.sortIndex-b.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let g=null;if(t&&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 C=h[m].oldContent,w=this.getLineContent(b);w.length===0||w===C||es(w)!==-1||g.push(b)}}return this._onDidChangeContent.fire(),new voe(u,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new k(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f<g;f++){const m=e[f],_=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new k(r,a,_.startLineNumber,_.startColumn))),m.text.length>0&&l.push(m.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,h,u]=Dh(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(P_._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],s=n.range.startLineNumber,r=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(s===a&&r===l&&n.text.length===0)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const c=new k(s,r,a,l);t.push({range:c,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,s=null;for(let r=0,a=e.length;r<a;r++){const l=e[r];let c,d;s?s.range.endLineNumber===l.range.startLineNumber?(c=i,d=n+(l.range.startColumn-s.range.endColumn)):(c=i+(l.range.startLineNumber-s.range.endLineNumber),d=l.range.startColumn):(c=l.range.startLineNumber,d=l.range.startColumn);let h;if(l.text.length>0){const u=l.eolCount+1;u===1?h=new k(c,d,c,d+l.firstLineLength):h=new k(c,d,c+u-1,l.lastLineLength+1)}else h=new k(c,d,c,d);i=h.endLineNumber,n=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){const i=k.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=k.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class Sge{constructor(e,t,i,n,s,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this.
`:`\r
`:i>t/2?`\r
`:`
`}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r
`&&(this._cr>0||this._lf>0)||t===`
`&&(this._cr>0||this._crlf>0)))for(let s=0,r=i.length;s<r;s++){const a=i[s].buffer.replace(/\r\n|\r|\n/g,t),l=Qc(a);i[s]=new Zf(a,l)}const n=new P_(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class u${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&&yR(e)&&(this.BOM=Tie,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===13||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=bge(this._tmpLineStarts,e);this.chunks.push(new Zf(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Tm(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=n6(e)))}finish(e=!0){return this._finish(),new Sge(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 t=Qc(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class yge{constructor(){this._onDidChangeVisibleRanges=new P,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set,this._viewsChanged=_r(this),this.visibleLineRanges=In({owner:this,equalsFn:f1(UR())},e=>(this._viewsChanged.read(e),ke.joinMany([...this._views].map(i=>i.state.read(e)?.visibleLineRanges??[]))))}attachView(){const e=new xge(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),this._viewsChanged.trigger(void 0),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0}),this._viewsChanged.trigger(void 0)}}class Lge{constructor(e,t){this.visibleLineRanges=e,this.stabilized=t}equals(e){return this===e?!0:!(!Ut(this.visibleLineRanges,e.visibleLineRanges,(t,i)=>t.equals(i))||this.stabilized!==e.stabilized)}}class xge{get state(){return this._state}constructor(e){this.handleStateChange=e,this._state=m1({owner:this,equalsFn:rf((t,i)=>t.equals(i))},void 0)}setVisibleLines(e,t){const i=e.map(s=>new ke(s.startLineNumber,s.endLineNumber+1)),n=new Lge(i,t);this._state.set(n,void 0,void 0),this.handleStateChange(n)}}class kge extends A{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new wt(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ut(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class f$ extends A{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t){super(),this._languageIdCodec=e,this._textModel=t,this._onDidChangeTokens=this._register(new P),this.onDidChangeTokens=this._onDidChangeTokens.event}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}}function Ige(o,e){const t=o.gotoNextSibling(),i=e.gotoNextSibling();if(t!==i)throw new Error("Trees are out of sync");return t&&i}function g$(o,e){const t=o.gotoParent(),i=e.gotoParent();if(t!==i)throw new Error("Trees are out of sync");return t&&i}function Dge(o,e,t){const i=o.gotoFirstChild(),n=e.gotoFirstChild();if(i!==n)throw new Error("Trees are out of sync");if(t===0)return i&&n;for(let s=1;s<=t;s++)
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=A.None}_assertNotDisposed(){if(this._isDisposed)throw new Ce("Model is disposed!")}getTextBuffer(){return this._assertNotDisposed(),this._buffer}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new $f(e,t)))}setValue(e,t=jn.setValue()){if(this._assertNotDisposed(),e==null)throw dr();const{textBuffer:i,disposable:n}=k$(e,this._options.defaultEOL);this._setValueFromTextBuffer(i,n,t)}_createContentChanged2(e,t,i,n,s,r,a,l,c,d){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:r,isRedoing:a,isFlush:l,detailedReasons:[d],detailedReasonsChangeLengths:[1]}}_setValueFromTextBuffer(e,t,i){this._assertNotDisposed();const n=this.getFullModelRange(),s=this.getValueLengthInRange(n),r=this.getLineCount(),a=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new I$,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new I_([new pfe],this._versionId,!1,!1),this._createContentChanged2(new k(1,1,r,a),0,s,new M(r,a),this.getValue(),!1,!1,!0,!1,i))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
`:`
`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new I_([new vfe],this._versionId,!1,!1),this._createContentChanged2(new k(1,1,s,r),0,n,new M(s,r),this.getValue(),!1,!1,!1,!0,jn.eolChange()))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const s=t[i],r=s.range,a=s.cachedAbsoluteStart-s.start,l=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),c=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);s.cachedAbsoluteStart=l,s.cachedAbsoluteEnd=c,s.cachedVersionId=e,s.start=l-a,s.end=c-a,Th(s)}}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,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const s=this._buffer.getLineLength(n);s>=spe?t+=s:e+=s}return t>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 t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new Xy({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=GU(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),g2(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 t=this.findMatches(i6.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.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 t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();cons
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ce("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ce("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ce("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(s<1)s=1,r=1;else if(s>t)s=t,r=this.getLineMaxColumn(s);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(s);r>=h&&(r=h)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(c);d>=h&&(d=h)}return i===s&&n===r&&a===c&&l===d&&e instanceof k&&!(e instanceof ce)?e:new k(s,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(zi(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new M(1,1);if(n>r)return new M(r,this.getLineMaxColumn(r));if(s<=1)return new M(n,1);const a=this.getLineMaxColumn(n);if(s>=a)return new M(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,s-2);if(zi(l))return new M(n,s-1)}return new M(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof M&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}isValidRange(e){return this._isValidRange(e,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,r,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,c=zi(a),d=zi(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof k&&!(e instanceof ce)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const c=r>1?this._buffer.getLineCharCode(s,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=zi(c),u=zi(d);return!h&&!u?new k(s,r,a,l):s===a&&r===l?new k(s,r-1,a,l-1):h&&u?new k(s,r-1,a,l+1):h?new k(s,r-1,a,l):new k(s,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new k(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,r,a=npe){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>k.isIRange(h))&&(l=t.map(h=>this.validateRange(h)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const c=[];c.push(l.reduce((h,u)=>k.areIntersecting(h,u)?h.plusRange(u):(c.push(h),u)));let d;if(!i&&e.indexOf(`
`)<0){const u=new Kf(e,i,n,s).parseSearchRequest();if(!u)return[];d=f=>this.findMatchesLineByLine(f,u,r,a)}else d=h=>vx.findMatches(this,new Kf(e,i,n,s),h,r,a);return c.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
`)<0){const c=new Kf(e,i,n,s).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let h=new k(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,c,r,1);return vx.findNextMatch(this,new Kf(e,i,n,s),a,r),u.length>0||(h=new k(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,c,r,1),u.length>0)?u[0]:null}return vx.findNextMatch(this,new Kf(e,i,n,s),a,r)}findPreviousMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);return vx.findPreviousMatch(this,new Kf(e,i,n,s),a,r)}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 v2?e:new v2(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n,s){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n,s)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n,s){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const r=t.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 d=e[l];let h=!1;for(let u=0,f=r.length;u<f;u++){const g=r[u].range,m=g.startLineNumber>d.endLineNumber,_=d.startLineNumber>g.endLineNumber;if(!m&&!_){h=!0;break}}if(!h){a=!1;break}}if(a)for(let l=0,c=this._trimAutoWhitespaceLines.length;l<c;l++){const d=this._trimAutoWhitespaceLines[l],h=this.getLineMaxColumn(d);let u=!0;for(let f=0,g=r.length;f<g;f++){const m=r[f].range,_=r[f].text;if(!(d<m.startLineNumber||d>m.endLineNumber)&&!(d===m.startLineNumber&&m.startColumn===h&&m.isEmpty()&&_&&_.length>0&&_.charAt(0)===`
`)&&!(d===m.startLineNumber&&m.startColumn===1&&m.isEmpty()&&_&&_.length>0&&_.charAt(_.length-1)===`
`)){u=!1;break}}if(u){const f=new k(d,1,d,h);t.push(new v2(null,f,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n,s)}_applyUndo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new k(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new k(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t,i){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t??!1,i??jn.applyEdits())}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t,i){const n=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),a=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,a.length!==0){for(let d=0,h=a.length;d<h;d++){const u=a[d];this._decorationsTree.acceptReplace(u.rangeOffset,u.rangeLength,u.text.length,u.forceMoveMarkers)}const l=[];this._increaseVersionId();let c=n;for(let d=0,h=a.length;d<h;d++){const u=a[d],[f]=Dh(u.text);this._onDidChangeDecorations.fire();const g=u.range.startLineNumber,m=u.range.endLineNumber,_=m-g,b=f,C=Math.min(_,b),w=b-_,v=r-c-w+g,S=v,L=v+b,x=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new M(S,1)),this.getOffsetAt(new M(L,this.getLineMaxColumn(L))),0),I=Ma.fromDecorations(x),D=new Ec(I);for(let R=C;R>=0;R--){const F=g+R,O=v+R;D.takeFromEndWhile(V=>V.lineNumber>O);const B=D.takeFromEndWhile(V=>V.lineNumber===O);l.push(new IU(F,this.getLineContent(O),B))}if(C<_){const R=g+C;l.push(new bfe(R+1,m))}if(C<b){const R=new Ec(I),F=g+C,O=b-C,B=r-c-O+F+1,V=[],z=[];for(let ee=0;ee<O;ee++){const se=B+ee;z[ee]=this.getLineContent(se),R.takeWhile(oe=>oe.lineNumber<se),V[ee]=R.takeWhile(oe=>oe.lineNumber===se)}l.push(new Cfe(F+1,g+b,z,V))}c+=w}this._emitContentChangedEvent(new I_(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,detailedReasons:[i],detailedReasonsChangeLengths:[a.length]})}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,t,i){if(e&&e.size>0){const s=Array.from(e).map(r=>new IU(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new DU(s))}if(t&&t.size>0){const s=Array.from(t).map(r=>new mfe(r.ownerId,r.decorationId,r.lineNumber,r.lineHeight));this._onDidChangeLineHeight.fire(new EU(s))}if(i&&i.size>0){const s=Array.from(i).map(r=>new _fe(r.ownerId,r.lineNumber));this._onDidChangeFont.fire(new NU(s))}}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(s,r)=>this._deltaDecorationsImpl(e,[],[{range:s,options:r}])[0],changeDecoration:(s,r)=>{this._changeDecorationImpl(e,s,r)},changeDe
`)>=0)return null;const r=s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=s.text.length-r[2].length-1,h=s.text.lastIndexOf(c,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,n,s){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(i)),r&&(i[0]._isTracked=!0);const a=[],l=[],c=this._model.pushEditOperations(this.getSelections(),i,d=>{if(r)for(let u=0,f=r.length;u<f;u++){const[g,m]=r[u],_=d[u],b=_.range.startLineNumber,C=_.range.startColumn-1+g,w=_.range.startColumn-1+m;a.push(new k(b,w+1,b,w+2)),l.push(new k(b,C+1,b,w+2))}const h=n(d);return h&&(this._isHandling=!0),h},void 0,s);c&&(this._isHandling=!1,this.setSelections(e,t,c,0)),a.length>0&&this._pushAutoClosedAction(a,l)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=Fv.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Ee(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return W$.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new Wv(this._model,this.getSelections())}endComposition(e,t){const i=jn.cursor({kind:"compositionEnd",detailedSource:t}),n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(gh.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()),i)},e,t)}type(e,t,i){const n=jn.cursor({kind:"type",detailedSource:i});this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let r=0;for(;r<s;){const a=vR(t,r),l=t.substr(r,a);this._executeEditOperation(gh.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),l),n),r+=a}}else this._executeEditOperation(gh.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t),n)},e,i)}compositionType(e,t,i,n,s,r){const a=jn.cursor({kind:"compositionType",detailedSource:r});if(t.length===0&&i===0&&n===0){if(s!==0){const l=this.getSelections().map(c=>{const d=c.getPosition();return new ce(d.lineNumber,d.column+s,d.lineNumber,d.column+s)});this.setSelections(e,r,l,0)}return}this._executeEdit(()=>{this._executeEditOperation(gh.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s),a)},e,r)}paste(e,t,i,n,s){const r=jn.cursor({kind:"paste",detailedSource:s});this._executeEdit(()=>{this._executeEditOperation(gh.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]),r)},e,s,4)}cut(e,t){const i=jn.cursor({kind:"cut",detailedSource:t});this._executeEdit(()=>{this._executeEditOperation(wf.cut(this.context.cursorConfig,this._model,this.getSelections()),i)},e,t)}executeCommand(e,t,i){const n=jn.cursor({kind:"executeCommand",detailedSource:i});this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new _s(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}executeCommands(e,t,i){const n=jn.cursor({kind:"executeCommands",detailedSource:i});this._executeEdit(()=>{this._executeEditOperation(new _s(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}}class Fv{static from(e,t){return new Fv(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;r
`:this.model.getEOL();e=e.slice(0),e.sort(k.compareRangesUsingStarts);let s=!1,r=!1;for(const l of e)l.isEmpty()?s=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d<l.length;d++)d>0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+n);return c}if(s&&t){const l=[];let c=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==c&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(d,i?2:0)),c=h}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Fo||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new k(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const s=this._configuration.options.get(59),r=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===bs.fontFamily;let c;return l?c=bs.fontFamily:(c=s.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${bs.fontFamily}`),{mode:i,html:`<div style="color: ${r[1]};background-color: ${r[2]};font-family: ${c};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,r)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=s;c++){const d=this.model.tokenization.getLineTokens(c),h=d.getLineContent(),u=c===i?n-1:0,f=c===s?r-1:h.length;h===""?l+="<br>":l+=qpe(h,d.inflate(),t,u,f,a,gn)}return l}_getColorMap(){const e=di.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=$.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}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,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new Mpe);return}this._withViewEventsCollector(e)}executeEdits(e,t,i,n){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,s){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new k(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new Ov(e,
`?i=1:e&&e.lineEnding&&e.lineEnding===`\r
`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const n=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),this.hasModel()?n&&this.focus():(this._editorTextFocus.setValue(!1),this._editorWidgetFocus.setValue(!1)),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(s),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}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,t,i,n){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?ng._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?ng._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return-1;const i=this._modelData.model.getLineMaxColumn(e);return ng._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}getLineHeightForPosition(e){if(!this._modelData)return-1;const t=this._modelData.viewModel,i=t.coordinatesConverter,n=M.lift(e);if(i.modelPositionIsVisible(n)){const s=i.convertModelPositionToViewPosition(n);return t.viewLayout.getLineHeightForLineNumber(s.lineNumber)}return 0}setHiddenAreas(e,t,i){this._modelData?.viewModel.setHiddenAreas(e.map(n=>k.lift(n)),t,i)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return ti.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!M.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!k.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new k(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewpor
`){return this._parts.join(e)}}function Nme(o){const e=Tme(o);if(e&&e.length>0)return new Uint32Array(e)}let $o=0;const Ah=new Uint32Array(10);function Tme(o){if($o=0,Tl(o,uA,4352),$o>0||(Tl(o,fA,4449),$o>0)||(Tl(o,gA,4520),$o>0)||(Tl(o,rg,12593),$o))return Ah.subarray(0,$o);if(o>=44032&&o<=55203){const e=o-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),s=t%28-1;if(i<uA.length?Tl(i,uA,0):4352+i-12593<rg.length&&Tl(4352+i,rg,12593),n<fA.length?Tl(n,fA,0):4449+n-12593<rg.length&&Tl(4449+n-12593,rg,12593),s>=0&&(s<gA.length?Tl(s,gA,0):4520+s-12593<rg.length&&Tl(4520+s-12593,rg,12593)),$o>0)return Ah.subarray(0,$o)}}function Tl(o,e,t){o>=t&&o<t+e.length&&Rme(e[o-t])}function Rme(o){o!==0&&(Ah[$o++]=o&255,o>>8&&(Ah[$o++]=o>>8&255),o>>16&&(Ah[$o++]=o>>16&255))}const uA=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),fA=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),gA=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),rg=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function pA(...o){return function(e,t){for(let i=0,n=o.length;i<n;i++){const s=o[i](e,t);if(s)return s}return null}}J$.bind(void 0,!1);const Hv=J$.bind(void 0,!0);function J$(o,e,t){if(!t||t.length<e.length)return null;let i;return o?i=_R(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function ej(o,e){const t=e.toLowerCase().indexOf(o.toLowerCase());return t===-1?null:[{start:t,end:t+o.length}]}function tj(o,e){return mA(o.toLowerCase(),e.toLowerCase(),0,0)}function mA(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]===e[i]){let n=null;return(n=mA(o,e,t+1,i+1))?vA({start:i,end:i+1},n):null}return mA(o,e,t,i+1)}function _A(o){return 97<=o&&o<=122}function Fx(o){return 65<=o&&o<=90}function bA(o){return 48<=o&&o<=57}function ij(o){return o===32||o===9||o===10||o===13}const nj=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(o=>nj.add(o.charCodeAt(0)));function Wx(o){return ij(o)||nj.has(o)}function sj(o,e){return o===e||Wx(o)&&Wx(e)}const CA=new Map;function oj(o){if(CA.has(o))return CA.get(o);let e;const t=Nme(o);return t&&(e=t),CA.set(o,e),e}function rj(o){return _A(o)||Fx(o)||bA(o)}function vA(o,e){return e.length===0?e=[o]:o.end===e[0].start?e[0].start=o.start:e.unshift(o),e}function aj(o,e){for(let t=e;t<o.length;t++){const i=o.charCodeAt(t);if(Fx(i)||bA(i)||t>0&&!rj(o.charCodeAt(t-1)))return t}return o.length}function wA(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]!==e[i].toLowerCase())return null;{let n=null,s=i+1;for(n=wA(o,e,t+1,i+1);!n&&(s=aj(e,s))<e.length;)n=wA(o,e,t+1,s),s++;return n===null?null:vA({start:i,end:i+1},n)}}function Mme(o){let e=0,t=0,i=0,n=0,s=0;for(let d=0;d<o.length;d++)s=o.charCodeAt(d),Fx(s)&&e++,_A(s)&&t++,rj(s)&&i++,bA(s)&&n++;const r=e/o.length,a=t/o.length,l=i/o.length,c=n/o.length;return{upperPercent:r,lowerPercent:a,alphaPercent:l,numericPercent:c}}function Pme(o){const{upperPercent:e,lowerPercent:t}=o;return t===0&&e>.6}function Ame(o){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=o;return t>.2&&e<.8&&i>.6&&n<.2}function Ome(o){let e=0,t=0,i=0,n=0;for(let s=0;s<o.length;s++)i=o.charCodeAt(s),Fx(i)&&e++,_A(i)&&t++,ij(i)&&n++;return(e===0||t===0)&&n===0?o.length<=30:e<=5}function lj(o,e){if(!e||(e=e.trim(),e.length===0)||!Ome(o))return null;e.length>60&&(e=e.substring(0,60));const t=Mme(e);if(!Ame(t)){if(!Pme(t))return null;e=e.toLowerCase()}let i=null,n=0;for(o=o.toLowerCase();n<e.length&&(i=wA(o,e,0,n))===null;)n=aj(e,n+1);return i}function Fme(o,e,t=!1){if(!e||e.length===0)return null;let i=null,n=0;for(o=o.toLowerCase(),e=e.toLowerCase();n<e.length&&(i=SA(o,e,0,n,t),i===null);)n=cj(e,n+1);return i}function SA(o,e,t,i,n){let s=0;if(t===
`:`
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`
${i_e(t,e)}
`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(oo(t),"g");return e.replace(i,(n,s)=>e.charAt(s-1)!=="\\"?`\\${n}`:n)}}function B_(o){return Rl(o)?!o.value:Array.isArray(o)?o.every(B_):!0}function Rl(o){return o instanceof qn?!0:o&&typeof o=="object"?typeof o.value=="string"&&(typeof o.isTrusted=="boolean"||typeof o.isTrusted=="object"||o.isTrusted===void 0)&&(typeof o.supportThemeIcons=="boolean"||o.supportThemeIcons===void 0):!1}function e_e(o,e){return o===e?!0:!o||!e?!1:o.value===e.value&&o.isTrusted===e.isTrusted&&o.supportThemeIcons===e.supportThemeIcons&&o.supportHtml===e.supportHtml&&(o.baseUri===e.baseUri||!!o.baseUri&&!!e.baseUri&&ch(be.from(o.baseUri),be.from(e.baseUri)))}function t_e(o){return o.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function i_e(o,e){const t=o.match(/^`+/gm)?.reduce((n,s)=>n.length>s.length?n:s).length??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,o,`${"`".repeat(i)}`].join(`
`)}function zx(o){return o.replace(/"/g,"&quot;")}function DA(o){return o&&o.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function n_e(o){const e=[],t=o.split("|").map(n=>n.trim());o=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),s=/width=(\d+)/.exec(i),r=n?n[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:o,dimensions:e}}function mj(o,...e){return be.from({scheme:we.command,path:o,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}class EA{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const NA=new EA("id#");function TA(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let dg=TA();function _j(o){dg=o}const bj=/[&<>"']/,s_e=new RegExp(bj.source,"g"),Cj=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,o_e=new RegExp(Cj.source,"g"),r_e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vj=o=>r_e[o];function Mr(o,e){if(e){if(bj.test(o))return o.replace(s_e,vj)}else if(Cj.test(o))return o.replace(o_e,vj);return o}const a_e=/(^|[^\[])\^/g;function ki(o,e){let t=typeof o=="string"?o:o.source;e=e||"";const i={replace:(n,s)=>{let r=typeof s=="string"?s:s.source;return r=r.replace(a_e,"$1"),t=t.replace(n,r),i},getRegex:()=>new RegExp(t,e)};return i}function wj(o){try{o=encodeURI(o).replace(/%25/g,"%")}catch{return null}return o}const $v={exec:()=>null};function Sj(o,e){const t=o.replace(/\|/g,(s,r,a)=>{let l=!1,c=r;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=t.split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function jv(o,e,t){const i=o.length;if(i===0)return"";let n=0;for(;n<i&&o.charAt(i-n-1)===e;)n++;return o.slice(0,i-n)}function l_e(o,e){if(o.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<o.length;i++)if(o[i]==="\\")i++;else if(o[i]===e[0])t++;else if(o[i]===e[1]&&(t--,t<0))return i;return-1}function yj(o,e,t,i){const n=e.href,s=e.title?Mr(e.title):null,r=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){i.state.inLink=!0;const a={type:"link",raw:t,href:n,title:s,text:r,tokens:i.inlineTokens(r)};return i.state.inLink=!1,a}return{type:"image",raw:t,href:n,title:s,text:Mr(r)}}function c_e(o,e){const t=o.match(/^(\s+)(?:```)/);if(t===null)return e;const i=t[1];return e.split(`
`).map(n=>{const s=n.match(/^\s+/);if(s===null)return n;const[r]=s;return r.length>=i.length?n.slice(i.length):n}).join(`
`)}class Ux{options;rules;lexer;constructor(e){this.options=e||dg}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:jv(i,`
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const i=t[0],n=c_e(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){const n=jv(i,"#");(this.options.pedantic||!n||/ $/.test(n))&&(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:jv(t[0],`
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let i=jv(t[0],`
`).split(`
`),n="",s="";const r=[];for(;i.length>0;){let a=!1;const l=[];let c;for(c=0;c<i.length;c++)if(/^ {0,3}>/.test(i[c]))l.push(i[c]),a=!0;else if(!a)l.push(i[c]);else break;i=i.slice(c);const d=l.join(`
`),h=d.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
$1`).replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}
${d}`:d,s=s?`${s}
${h}`:h;const u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,r,!0),this.lexer.state.top=u,i.length===0)break;const f=r[r.length-1];if(f?.type==="code")break;if(f?.type==="blockquote"){const g=f,m=g.raw+`
`+i.join(`
`),_=this.blockquote(m);r[r.length-1]=_,n=n.substring(0,n.length-g.raw.length)+_.raw,s=s.substring(0,s.length-g.text.length)+_.text;break}else if(f?.type==="list"){const g=f,m=g.raw+`
`+i.join(`
`),_=this.list(m);r[r.length-1]=_,n=n.substring(0,n.length-f.raw.length)+_.raw,s=s.substring(0,s.length-g.raw.length)+_.raw,i=m.substring(r[r.length-1].raw.length).split(`
`);continue}}return{type:"blockquote",raw:n,tokens:r,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim();const n=i.length>1,s={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");const r=new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`);let a=!1;for(;e;){let l=!1,c="",d="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let h=t[2].split(`
`,1)[0].replace(/^\t+/,b=>" ".repeat(3*b.length)),u=e.split(`
`,1)[0],f=!h.trim(),g=0;if(this.options.pedantic?(g=2,d=h.trimStart()):f?g=t[1].length+1:(g=t[2].search(/[^ ]/),g=g>4?1:g,d=h.slice(g),g+=t[1].length),f&&/^ *$/.test(u)&&(c+=u+`
`,e=e.substring(u.length+1),l=!0),!l){const b=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),C=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),v=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;e;){const S=e.split(`
`,1)[0];if(u=S,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(u)||v.test(u)||b.test(u)||C.test(e))break;if(u.search(/[^ ]/)>=g||!u.trim())d+=`
`+u.slice(g);else{if(f||h.search(/[^ ]/)>=4||w.test(h)||v.test(h)||C.test(h))break;d+=`
`+u}!f&&!u.trim()&&(f=!0),c+=S+`
`,e=e.substring(S.length+1),h=u.slice(g)}}s.loose||(a?s.loose=!0:/\n *\n *$/.test(c)&&(a=!0));let m=null,_;this.options.gfm&&(m=/^\[[ xX]\] /.exec(d),m&&(_=m[0]!=="[ ] ",d=d.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:c,task:!!m,checked:_,loose:!1,text:d,tokens:[]}),s.raw+=c}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const c=s.items[l].tokens.filter(h=>h.type==="space"),d=c.length>0&&c.some(h=>/\n.*\n/.test(h.raw));s.loose=d}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const i=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:i,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const i=Sj(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(i.length===n.length){for(const a of n)/^ *-+: *$/.test(a)?r.align.push("right"):/^ *:-+: *$/.test(a)?r.align.push("center"):/^ *:-+ *$/.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<i.length;a++)r.header.push({text:i[a],tokens:this.lexer.inline(i[a]),header:!0,align:r.align[a]});for(const a of s)r.rows.push(Sj(a,r.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[c]})));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const i=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Mr(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const i=t[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;const r=jv(i.slice(0,-1),"\\");if((i.length-r.length)%2===0)return}else{const r=l_e(t[2],"()");if(r>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);r&&(n=r[1],s=r[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(this.options.pedantic&&!/>$/.test(i)?n=n.slice(1):n=n.slice(1,-1)),yj(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){const n=(i[2]||i[1]).replace(/\s+/g," "),s=t[n.toLowerCase()];if(!s){const r=i[0].charAt(0);return{type:"text",raw:r,text:r}}return yj(i,s,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))return;if(!(n[1]||n[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const r=[...n[0]].length-1;let a,l,c=r,d=0;const h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+r);(n=h.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){c+=l;continue}else if((n[5]||n[6])&&r%3&&!((r+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);const u=[...n[0]][0].length,f=e.slice(0,r+n.index+u+l);if(Math.min(r,l)%2){const m=f.slice(1,-1);return{type:"em",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}const g=f.slice(2,-2);return{type:"strong",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," ");const n=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return n&&s&&(i=i.substring(1,i.length-1)),i=Mr(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let i,n;return t[2]==="@"?(i=Mr(t[1]),n="mailto:"+i):(i=Mr(t[1]),n=i),{type:"link",raw:t[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let i,n;if(t[2]==="@")i=Mr(t[0]),n="mailto:"+i;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);i=Mr(t[0]),t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let i;return this.lexer.state.inRawBlock?i=t[0]:i=Mr(t[0]),{type:"text",raw:t[0],text:i}}}}const d_e=/^(?: *(?:\n|$))+/,h_e=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,u_e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qv=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,f_e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Lj=/(?:[*+-]|\d{1,9}[.)])/,xj=
]`).replace("lheading",xj).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Dj=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,v_e=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ej=/^( {2,}|\\)\n(?!\s*$)/,w_e=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Kv="\\p{P}\\p{S}",S_e=ki(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Kv).getRegex(),y_e=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,L_e=ki(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Kv).getRegex(),x_e=ki("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Kv).getRegex(),k_e=ki("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Kv).getRegex(),I_e=ki(/\\([punct])/,"gu").replace(/punct/g,Kv).getRegex(),D_e=ki(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),E_e=ki(PA).replace("(?:-->|$)","-->").getRegex(),N_e=ki("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",E_e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jx=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,T_e=ki(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",jx).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nj=ki(/^!?\[(label)\]\[(ref)\]/).replace("label",jx).replace("ref",MA).getRegex(),Tj=ki(/^!?\[(ref)\](?:\[\])?/).replace("ref",MA).getRegex(),R_e=ki("reflink|nolink(?!\\()","g").replace("reflink",Nj).replace("nolink",Tj).getRegex(),OA={_backpedal:$v,anyPunctuation:I_e,autolink:D_e,blockSkip:y_e,br:Ej,code:v_e,del:$v,emStrongLDelim:L_e,emStrongRDelimAst:x_e,emStrongRDelimUnd:k_e,escape:Dj,link:T_e,nolink:Tj,punctuation:S_e,reflink:Nj,reflinkSearch:R_e,tag:N_e,text:w_e,url:$v},M_e={...OA,link:ki(/^!?\[(label)\]\((.*?)\)/).replace("label",jx).getRegex(),reflink:ki(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jx).getRegex()},FA={...OA,escape:ki(Dj).replace("])","~|])").getRegex(),url:ki(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_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.!#$%&'*+\/=?_`{\|}~-]+@)))/},P_e={...FA,br:ki(Ej).replace("{2,}","*").getRegex(),text:ki(FA.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qx={normal:AA,gfm:b_e,pedantic:C_e},Gv={normal:OA,gfm:FA,breaks:P_e,pedantic:M_e};class Ml{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||dg,this.options.tokenizer=this.options.tokenizer||new Ux,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:qx.normal,inline:Gv.normal};this.options.pedantic?(t.block=qx.pedantic,t.inline=Gv.pedantic):this.options.gfm&&(t.bl
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const i=this.inlineQueue[t];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let n,s,r;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=`
`+n.raw,s.text+=`
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=`
`+n.raw,s.text+=`
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(r=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=e.slice(1);let c;this.options.extensions.startBlock.forEach(d=>{c=d.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(r=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r))){s=t[t.length-1],i&&s?.type==="paragraph"?(s.raw+=`
`+n.raw,s.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&s.type==="text"?(s.raw+=`
`+n.raw,s.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let i,n,s,r=e,a,l,c;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(i=d.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,r,c)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e))){e=e.substring(i.raw.length),t.push(i);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const h=e.slice(1);let u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(d=Math.min(d,u))}),d<1/0&&d>=0&&(s=e.substring(0,d+1))}if(i=this.tokenizer.inlineText(s)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(c=i.raw.slice(-1)),l=!0,n=t[t.length-1],n&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}class Zv{options;parser;constructor(e){this.options=e||dg}space(e){return""}code({text:e,lang:t,escaped:i}){const n=(t||"").match(/^\S*/)?.[0],s=e.replace(/\n$/,"")+`
`;return n?'<pre><code class="language-'+Mr(n)+'">'+(i?s:Mr(s,!0))+`</code></pre>
`:"<pre><code>"+(i?s:Mr(s,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){const t=e.ordered,i=e.start;let n="";for(let a=0;a<e.items.length;a++){const l=e.items[a];n+=this.listitem(l)}const s=t?"ol":"ul",r=t&&i!==1?' start="'+i+'"':"";return"<"+s+r+`>
`+n+"</"+s+`>
`}listitem(e){let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" "}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t="",i="";for(let s=0;s<e.header.length;s++)i+=this.tablecell(e.header[s]);t+=this.tablerow({text:i});let n="";for(let s=0;s<e.rows.length;s++){const r=e.rows[s];i="";for(let a=0;a<r.length;a++)i+=this.tablecell(r[a]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
<thead>
`+t+`</thead>
`+n+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){const t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:i}){const n=this.parser.parseInline(i),s=wj(e);if(s===null)return n;e=s;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image({href:e,title:t,text:i}){const n=wj(e);if(n===null)return i;e=n;let s=`<img src="${e}" alt="${i}"`;return t&&(s+=` title="${t}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class WA{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class Pl{options;renderer;textRenderer;constructor(e){this.options=e||dg,this.options.renderer=this.options.renderer||new Zv,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new WA}static parse(e,t){return new Pl(t).parse(e)}static parseInline(e,t){return new Pl(t).parseInline(e)}parse(e,t=!0){let i="";for(let n=0;n<e.length;n++){const s=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){i+=l||"";continue}}const r=s;switch(r.type){case"space":{i+=this.renderer.space(r);continue}case"hr":{i+=this.renderer.hr(r);continue}case"heading":{i+=this.renderer.heading(r);continue}case"code":{i+=this.renderer.code(r);continue}case"table":{i+=this.renderer.table(r);continue}case"blockquote":{i+=this.renderer.blockquote(r);continue}case"list":{i+=this.renderer.list(r);continue}case"html":{i+=this.renderer.html(r);continue}case"paragraph":{i+=this.renderer.paragraph(r);continue}case"text":{let a=r,l=this.renderer.text(a);for(;n+1<e.length&&e[n+1].type==="text";)a=e[++n],l+=`
`+this.renderer.text(a);t?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l}]}):i+=l;continue}default:{const a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}parseInline(e,t){t=t||this.renderer;let i="";for(let n=0;n<e.length;n++){const s=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=a||"";continue}}const r=s;switch(r.type){case"escape":{i+=t.text(r);break}case"html":{i+=t.html(r);break}case"link":{i+=t.link(r);break}case"image":{i+=t.image(r);break}case"strong":{i+=t.strong(r);break}case"em":{i+=t.em(r);break}case"codespan":{i+=t.codespan(r);break}case"br":{i+=t.br(r);break}case"del":{i+=t.del(r);break}case"text":{i+=t.text(r);break}default:{const a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}}class Kx{options;constructor(e){this.options=e||dg}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class Rj{defaults=TA();options=this.setOptions;parse=this.parseMarkdown(Ml.lex,Pl.parse);parseInline=this.parseMarkdown(Ml.lexInline,Pl.parseInline);Parser=Pl;Renderer=Zv;TextRenderer=WA;Lexer=Ml;Tokenizer=Ux;Hooks=Kx;constructor(...e){this.use(...e)}walkTokens(e,t){let i=[];for(const n of e)switch(i=i.concat(t.call(this,n)),n.type){case"table":{const s=n;for(const r of s.header)i=i.concat(this.walkTokens(r.tokens,t));for(const r of s.rows)for(const a of r)i=i.concat(this.walkTokens(a.tokens,t));break}case"list":{const s=n;i=i.concat(this.walkTokens(s.items,t));break}default:{const s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(r=>{const a=s[r].flat(1/0);i=i.concat(this.walkTokens(a,t))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{const n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const r=t.renderers[s.name];r?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=r.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[s.level];r?r.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),i.renderer){const s=this.defaults.renderer||new Zv(this.defaults);for(const r in i.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const a=r,l=i.renderer[a],c=s[a];s[a]=(...d)=>{let h=l.apply(s,d);return h===!1&&(h=c.apply(s,d)),h||""}}n.renderer=s}if(i.tokenizer){const s=this.defaults.tokenizer||new Ux(this.defaults);for(const r in i.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const a=r,l=i.tokenizer[a],c=s[a];s[a]=(...d)=>{let h=l.apply(s,d);return h===!1&&(h=c.apply(s,d)),h}}n.tokenizer=s}if(i.hooks){const s=this.defaults.hooks||new Kx;for(const r in i.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(r==="options")continue;const a=r,l=i.hooks[a],c=s[a];Kx.passThroughHooks.has(r)?s[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(s,d)).then(u=>c.call(s,u));const h=l.call(s,d);return c.call(s,h)}:s[a]=(...d)=>{let
Please report this to https://github.com/markedjs/marked.`,e){const n="<p>An error occurred:</p><pre>"+Mr(i.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(i);throw i}}}const hg=new Rj;function wi(o,e){return hg.parse(o,e)}wi.options=wi.setOptions=function(o){return hg.setOptions(o),wi.defaults=hg.defaults,_j(wi.defaults),wi},wi.getDefaults=TA,wi.defaults=dg,wi.use=function(...o){return hg.use(...o),wi.defaults=hg.defaults,_j(wi.defaults),wi},wi.walkTokens=function(o,e){return hg.walkTokens(o,e)},wi.parseInline=hg.parseInline,wi.Parser=Pl,wi.parser=Pl.parse,wi.Renderer=Zv,wi.TextRenderer=WA,wi.Lexer=Ml,wi.lexer=Ml.lex,wi.Tokenizer=Ux,wi.Hooks=Kx,wi.parse=wi,wi.options,wi.setOptions,wi.use,wi.walkTokens,wi.parseInline;const A_e=wi;Pl.parse;const Yv=Ml.lex;function O_e(o){return JSON.stringify(o,F_e)}function BA(o){let e=JSON.parse(o);return e=HA(e),e}function F_e(o,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function HA(o,e=0){if(!o||e>200)return o;if(typeof o=="object"){switch(o.$mid){case 1:return be.revive(o);case 2:return new RegExp(o.source,o.flags);case 17:return new Date(o.source)}if(o instanceof sh||o instanceof Uint8Array)return o;if(Array.isArray(o))for(let t=0;t<o.length;++t)o[t]=HA(o[t],e+1);else for(const t in o)Object.hasOwnProperty.call(o,t)&&(o[t]=HA(o[t],e+1))}return o}/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:Mj,setPrototypeOf:Pj,isFrozen:W_e,getPrototypeOf:B_e,getOwnPropertyDescriptor:H_e}=Object;let{freeze:vo,seal:ea,create:Aj}=Object,{apply:VA,construct:zA}=typeof Reflect<"u"&&Reflect;vo||(vo=function(e){return e}),ea||(ea=function(e){return e}),VA||(VA=function(e,t,i){return e.apply(t,i)}),zA||(zA=function(e,t){return new e(...t)});const Gx=Pr(Array.prototype.forEach),Oj=Pr(Array.prototype.pop),Xv=Pr(Array.prototype.push),Zx=Pr(String.prototype.toLowerCase),UA=Pr(String.prototype.toString),Fj=Pr(String.prototype.match),Qv=Pr(String.prototype.replace),V_e=Pr(String.prototype.indexOf),z_e=Pr(String.prototype.trim),Oa=Pr(Object.prototype.hasOwnProperty),wo=Pr(RegExp.prototype.test),Jv=U_e(TypeError);function Pr(o){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return VA(o,e,i)}}function U_e(o){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return zA(o,t)}}function Nt(o,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zx;Pj&&Pj(o,null);let i=e.length;for(;i--;){let n=e[i];if(typeof n=="string"){const s=t(n);s!==n&&(W_e(e)||(e[i]=s),n=s)}o[n]=!0}return o}function $_e(o){for(let e=0;e<o.length;e++)Oa(o,e)||(o[e]=null);return o}function ug(o){const e=Aj(null);for(const[t,i]of Mj(o))Oa(o,t)&&(Array.isArray(i)?e[t]=$_e(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=ug(i):e[t]=i);return e}function ew(o,e){for(;o!==null;){const i=H_e(o,e);if(i){if(i.get)return Pr(i.get);if(typeof i.value=="function")return Pr(i.value)}o=B_e(o)}function t(){return null}return t}const Wj=vo(["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"]),$A=vo(["svg","a","altglyph","altglyphdef","altglyphit
`+lr),zC&&Gx([O,B,V],_c=>{lr=Qv(lr,_c," ")}),v&&FT?v.createHTML(lr):lr},e.setConfig=function(){let Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};LB(Ge),bB=!0},e.clearConfig=function(){KC=null,bB=!1},e.isValidAttribute=function(Ge,G,ye){KC||LB({});const $e=fs(Ge),Wi=fs(G);return yte($e,Wi,ye)},e.addHook=function(Ge,G){typeof G=="function"&&(F[Ge]=F[Ge]||[],Xv(F[Ge],G))},e.removeHook=function(Ge){if(F[Ge])return Oj(F[Ge])},e.removeHooks=function(Ge){F[Ge]&&(F[Ge]=[])},e.removeAllHooks=function(){F={}},e}var H_=jj();const qj=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","s","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]),Kj=Object.freeze(["href","target","src","alt","title","for","name","role","tabindex","x-dispatch","required","checked","placeholder","type","start","width","height","align"]),GA="vscode-relative-path";function Gj(o,e){if(e.override==="*")return!0;try{const t=new URL(o,GA+"://");return!!(e.override.includes(t.protocol.replace(/:$/,""))||e.allowRelativePaths&&t.protocol===GA+":"&&!o.trim().toLowerCase().startsWith(GA))}catch{return!1}}function nbe(o,e){H_.addHook("afterSanitizeAttributes",t=>{for(const i of["href","src"])if(t.hasAttribute(i)){const n=t.getAttribute(i);i==="href"?!n.startsWith("#")&&!Gj(n,o)&&t.removeAttribute(i):Gj(n,e)||t.removeAttribute(i)}})}const sbe=Object.freeze({ALLOWED_TAGS:[...qj],ALLOWED_ATTR:[...Kj],ALLOW_UNKNOWN_PROTOCOLS:!0});function obe(o,e){return Zj(o,e,"trusted")}function Zj(o,e,t){try{const i={...sbe};e?.allowedTags&&(e.allowedTags.override&&(i.ALLOWED_TAGS=[...e.allowedTags.override]),e.allowedTags.augment&&(i.ALLOWED_TAGS=[...i.ALLOWED_TAGS??[],...e.allowedTags.augment]));let n=[...Kj];e?.allowedAttributes&&(e.allowedAttributes.override&&(n=[...e.allowedAttributes.override]),e.allowedAttributes.augment&&(n=[...n,...e.allowedAttributes.augment])),n=n.map(a=>typeof a=="string"?a.toLowerCase():{attributeName:a.attributeName.toLowerCase(),shouldKeep:a.shouldKeep});const s=new Set(n.map(a=>typeof a=="string"?a:a.attributeName)),r=new Map;for(const a of n)typeof a=="string"?r.delete(a):r.set(a.attributeName,a);return i.ALLOWED_ATTR=Array.from(s),nbe({override:e?.allowedLinkProtocols?.override??[we.http,we.https],allowRelativePaths:e?.allowRelativeLinkPaths??!1},{override:e?.allowedMediaProtocols?.override??[we.http,we.https],allowRelativePaths:e?.allowRelativeMediaPaths??!1}),e?.replaceWithPlaintext&&H_.addHook("uponSanitizeElement",abe),r.size&&H_.addHook("uponSanitizeAttribute",(a,l)=>{const c=r.get(l.attrName);if(c){const d=c.shouldKeep(a,l);typeof d=="string"?(l.keepAttr=!0,l.attrValue=d):l.keepAttr=d}else l.keepAttr=s.has(l.attrName)}),t==="dom"?H_.sanitize(o,{...i,RETURN_DOM_FRAGMENT:!0}):H_.sanitize(o,{...i,RETURN_TRUSTED_TYPE:!0})}finally{H_.removeAllHooks()}}const rbe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function abe(o,e,t){if(!e.allowedTags[e.tagName]&&e.tagName!=="body"){const i=Yj(o);o.nodeType===Node.COMMENT_NODE?o.parentElement?.insertBefore(i,o):o.parentElement?.replaceChild(i,o)}}function Yj(o){let e,t;if(o.nodeType===Node.COMMENT_NODE)e=`<!--${o.textContent}-->`;else{const r=o.tagName.toLowerCase(),a=rbe.includes(r),l=o.attributes.length?" "+Array.from(o.attributes).map(c=>`${c.name}="${c.value}"`).join(" "):"";e=`<${r}${l}>`,a||(t=`</${r}>`)}const i=document.createDocumentFragment(),n=o.ownerDocument.createTextNode(e);for(i.appendChild(n);o.firstChild;)i.appendChild(o.firstChild);const s=t?o.ownerDocument.createTextNode(t):void 0;return s&&i.appendChild(s),i}function Xj(o,e,t){const i=Zj(e,t,"dom");Yi(o,i)}const lbe=new RegExp(`(\\\\)?\\$\\((${ve.iconNameExpression}(?:${ve.iconModifierExpression})?)\\)`,"g");function F
`,o.html=e=>"",o.heading=function({tokens:e}){return this.parser.parseInline(e)+`
`},o.hr=()=>"",o.list=function({items:e}){return e.map(t=>this.listitem(t)).join(`
`)+`
`},o.listitem=({text:e})=>e+`
`,o.paragraph=function({tokens:e}){return this.parser.parseInline(e)+`
`},o.table=function({header:e,rows:t}){return e.map(i=>this.tablecell(i)).join(" ")+`
`+t.map(i=>i.map(n=>this.tablecell(n)).join(" ")).join(`
`)+`
`},o.tablerow=({text:e})=>e,o.tablecell=function({tokens:e}){return this.parser.parseInline(e)},o.strong=({text:e})=>e,o.em=({text:e})=>e,o.codespan=({text:e})=>qr(e),o.br=e=>`
`,o.del=({text:e})=>e,o.image=e=>"",o.text=({text:e})=>e,o.link=({text:e})=>e,o}const bbe=new Ln(iq);new Ln(()=>{const o=iq();return o.code=({text:e})=>`
\`\`\`
${qr(e)}
\`\`\`
`,o});function nw(o){let e="";return o.forEach(t=>{e+=t.raw}),e}function nq(o){if(o.tokens)for(let e=o.tokens.length-1;e>=0;e--){const t=o.tokens[e];if(t.type==="text"){const i=t.raw.split(`
`),n=i[i.length-1];if(n.includes("`"))return kbe(o);if(n.includes("**"))return Rbe(o);if(n.match(/\*\w/))return Ibe(o);if(n.match(/(^|\s)__\w/))return Mbe(o);if(n.match(/(^|\s)_\w/))return Dbe(o);if(Cbe(n)||vbe(n)&&o.tokens.slice(0,e).some(s=>s.type==="text"&&s.raw.match(/\[[^\]]*$/))){const s=o.tokens.slice(e+1);return s[0]?.type==="link"&&s[1]?.type==="text"&&s[1].raw.match(/^ *"[^"]*$/)||n.match(/^[^"]* +"[^"]*$/)?Nbe(o):Ebe(o)}else if(n.match(/(^|\s)\[\w*[^\]]*$/))return Tbe(o)}}}function Cbe(o){return!!o.match(/(^|\s)\[.*\]\(\w*/)}function vbe(o){return!!o.match(/^[^\[]*\]\([^\)]*$/)}function wbe(o){const e=o.items[o.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0,i=c=>{const h=c.items.at(-1)?.tokens.at(-1);return h?.type==="heading"||h?.type==="list"&&i(h)};let n;if(t?.type==="text"&&!("inRawBlock"in e))n=nq(t);else if(i(o)){const c=Yv(o.raw.trim()+" &nbsp;")[0];return c.type!=="list"?void 0:c}if(!n||n.type!=="paragraph")return;const s=nw(o.items.slice(0,-1)),r=e.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!r)return;const a=r+nw(e.tokens.slice(0,-1))+n.raw,l=Yv(s+a)[0];if(l.type==="list")return l}function Sbe(o,e){if(o.raw.match(/-\s*$/))return Yv(e+" &nbsp;")}const ybe=3;function Lbe(o){for(let e=0;e<ybe;e++){const t=xbe(o);if(t)o=t;else break}return o}function xbe(o){let e,t;for(e=0;e<o.length;e++){const n=o[e];if(n.type==="paragraph"&&n.raw.match(/(\n|^)\|/)){t=Pbe(o.slice(e));break}}const i=o.at(-1);if(!t&&i?.type==="list"){const n=wbe(i);n&&(t=[n],e=o.length-1)}if(!t&&i?.type==="paragraph"){const n=nq(i);n&&(t=[n],e=o.length-1)}if(t){const n=[...o.slice(0,e),...t];return n.links=o.links,n}if(i?.type==="heading"){const n=Sbe(i,nw(o));if(n)return n}return null}function kbe(o){return Wh(o,"`")}function Ibe(o){return Wh(o,"*")}function Dbe(o){return Wh(o,"_")}function Ebe(o){return Wh(o,")",!1)}function Nbe(o){return Wh(o,'")',!1)}function Tbe(o){return Wh(o,"](https://microsoft.com)",!1)}function Rbe(o){return Wh(o,"**")}function Mbe(o){return Wh(o,"__")}function Wh(o,e,t=!0){const i=nw(Array.isArray(o)?o:[o]),n=t?i.trimEnd():i;return Yv(n+e)[0]}function Pbe(o){const e=nw(o),t=e.split(`
`);let i,n=!1;for(let s=0;s<t.length;s++){const r=t[s].trim();if(typeof i>"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(s!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const s=n?t.slice(0,-1).join(`
`):e,r=!!s.match(/\|\s*$/),a=s+(r?"":"|")+`
|${" --- |".repeat(i)}`;return Yv(a)}}let sq={showInstantHover:()=>{},showDelayedHover:()=>{},setupDelayedHover:()=>A.None,setupDelayedHoverAtMouse:()=>A.None,hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>({dispose:()=>{},show:()=>{},hide:()=>{},update:()=>{}}),showManagedHover:()=>{}};function Abe(o){sq=o}function ta(){return sq}class Obe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function ks(o,e,t){return Math.min(Math.max(o,e),t)}class oq{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 Fbe{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 t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}class fg extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}var Kn;(function(o){function e(s,r){if(s.start>=r.end||r.start>=s.end)return{start:0,end:0};const a=Math.max(s.start,r.start),l=Math.min(s.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}o.intersect=e;function t(s){return s.end-s.start<=0}o.isEmpty=t;function i(s,r){return!t(e(s,r))}o.intersects=i;function n(s,r){const a=[],l={start:s.start,end:Math.min(r.start,s.end)},c={start:Math.max(r.end,s.start),end:s.end};return t(l)||a.push(l),t(c)||a.push(c),a}o.relativeComplement=n})(Kn||(Kn={}));function rq(o,e){const t=[];for(const i of e){if(o.start>=i.range.end)continue;if(o.end<i.range.start)break;const n=Kn.intersect(o,i.range);Kn.isEmpty(n)||t.push({range:n,size:i.size})}return t}function XA({start:o,end:e},t){return{start:o+t,end:e+t}}function Wbe(o){const e=[];let t=null;for(const i of o){const n=i.range.start,s=i.range.end,r=i.size;if(t&&r===t.size){t.range.end=s;continue}t={range:{start:n,end:s},size:r},e.push(t)}return e}function Bbe(...o){return Wbe(o.reduce((e,t)=>e.concat(t),[]))}class Hbe{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,t,i=[]){const n=i.length-t,s=rq({start:0,end:e},this.groups),r=rq({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:XA(l.range,n),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=Bbe(s,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.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 t=0,i=this._paddingTop;for(const n of this.groups){const s=n.range.end-n.range.start,r=i+s*n.size;if(e<r)return t+Math.floor((e-i)/n.size);t+=s,i=r}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const s=n.range.end-n.range.start,r=i+s;if(e<r)return this._paddingTop+t+(e-i)*n.size;t+=s*n.size,i=r}return-1}}class Vbe{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const n=Q(".monaco-list-row"),r=this.getRenderer(e).renderTemplate(n);t={domNode:n,templateId:e,templateData:r}}return{row:t,isReusingConnectedDomNode:i}}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 t of this.transactionNodesPendingRemoval)this.doRemoveNode(t);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t
.monaco-drag-image${t},
.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
`),e.listFocusAndSelectionForeground&&i.push(`
.monaco-drag-image${t},
.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
`),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=od(e.listFocusAndSelectionOutline,od(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(`
.monaco-drag-image${t},
.monaco-list${t}:focus .monaco-list-row.focused,
.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
`);const s=od(e.listSelectionOutline,e.listInactiveFocusOutline??"");s&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${s}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(`
.monaco-list${t}.drop-target,
.monaco-list${t} .monaco-list-rows.drop-target,
.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }
`),e.listDropBetweenBackground&&(i.push(`
.monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,
.monaco-list${t} .monaco-list-row.drop-target-before::before {
content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;
background-color: ${e.listDropBetweenBackground};
}`),i.push(`
.monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,
.monaco-list${t} .monaco-list-row.drop-target-after::after {
content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;
background-color: ${e.listDropBetweenBackground};
}`)),e.tableColumnsBorder&&i.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&&i.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=i.join(`
`)}}const iCe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:$.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:$.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:$.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,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},nCe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function sCe(o,e){const t=o.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&o[n]===e-(t-n);)i.push(o[n--]);for(i.reverse(),n=t;n<o.length&&o[n]===e+(n-t);)i.push(o[n++]);return i}function JA(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){t.push(o[i]),i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):t.push(e[n++]);return t}function oCe(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):n++;return t}const fq=(o,e)=>o-e;class rCe{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(const r of this.renderers)r.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){let s=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class aCe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new U}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),s=n&&typeof n!="string"?n:Et(n);i.disposables.add(Se(a=>{this.setAriaLabel(a.readObservable(s),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class lCe{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,n,s){return this.dnd.onDragOver(e,t,i,n,s)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,s){this.dnd.drop(e,t,i,n,s)}dispose(){this.dnd.dispose()}}class jo{get onDidChangeFocus(){return ie.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return ie.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(){ret
`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=od(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.textContent="",!(!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,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),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 t=me(this.selectElement),i=mi(this.selectElement),n=me(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-dc.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,f=h+s+u,g=Math.floor((r-s-u)/this.getHeight()),m=Math.floor((a-s-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.top<dc.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||g<1&&m<1?!1:(g<dc.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&m>g&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),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.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.append
`)}}const mg=new LCe;ei.add(wCe.IconContribution,mg);function Wt(o,e,t,i){return mg.registerIcon(o,e,t,i)}function Sq(){return mg}function xCe(){const o=mH();for(const e in o){const t="\\"+o[e].toString(16);mg.registerIcon(e,{fontCharacter:t})}}xCe();const yq="vscode://schemas/icons",Lq=ei.as(nL.JSONContribution);Lq.registerSchema(yq,mg.getIconSchema());const xq=new wt(()=>Lq.notifySchemaChanged(yq),200);mg.onDidChange(()=>{xq.isScheduled()||xq.schedule()});const kq=Wt("widget-close",Y.close,p(2009,"Icon for the close action in widgets."));Wt("goto-previous-location",Y.arrowUp,p(2010,"Icon for goto previous editor location.")),Wt("goto-next-location",Y.arrowDown,p(2011,"Icon for goto next editor location.")),ve.modify(Y.sync,"spin"),ve.modify(Y.loading,"spin");var nO=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sO=function(o,e){return function(t,i){e(t,i,o)}};const kCe=Wt("diff-review-insert",Y.add,p(94,"Icon for 'Insert' in accessible diff viewer.")),ICe=Wt("diff-review-remove",Y.remove,p(95,"Icon for 'Remove' in accessible diff viewer.")),DCe=Wt("diff-review-close",Y.close,p(96,"Icon for 'Close' in accessible diff viewer."));let _g=(yC=class extends A{constructor(e,t,i,n,s,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=s,this._height=r,this._diffs=a,this._models=l,this._instantiationService=c,this._state=j(this,d=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const u=d.store.add(this._instantiationService.createInstance(oO,this._diffs,this._models,this._setVisible,this._canClose)),f=d.store.add(this._instantiationService.createInstance(rO,this._parentNode,u,this._width,this._height,this._models));return{model:u,view:f}}).recomputeInitiallyAndOnChange(this._store)}next(){Dt(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){Dt(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){Dt(e=>{this._setVisible(!1,e)})}},yC._ttPolicy=Sl("diffReview",{createHTML:e=>e}),yC);_g=nO([sO(8,ge)],_g);let oO=class extends A{constructor(e,t,i,n,s){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=s,this._groups=Le(this,[]),this._currentGroupIdx=Le(this,0),this._currentElementIdx=Le(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>this.currentGroup.read(a)?.lines[r]),this._register(Se(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=ECe(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Dt(c=>{const d=this._models.getModifiedPosition();if(d){const h=l.findIndex(u=>d?.lineNumber<u.range.modified.endLineNumberExclusive);h!==-1&&this._currentGroupIdx.set(h,c)}this._groups.set(l,c)})})),this._register(Se(r=>{const a=this.currentElement.read(r);a?.type===Ds.Deleted?this._accessibilitySignalService.playSignal(xs.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===Ds.Added&&this._accessibilitySignalService.playSignal(xs.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Se(r=>{const a=this.currentElement.read(r);if(a&&a.type!==Ds.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(k.fromPositions(new M(l,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||lf(t,n=>{this._currentGroupIdx.set(pe.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),n),this._currentElementIdx.set(0,n)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroup
`);this.histogram[a]=(this.histogram[a]||0)+1}this.totalCount=n}computeSimilarity(e){let t=0;const i=Math.max(this.histogram.length,e.histogram.length);for(let n=0;n<i;n++)t+=Math.abs((this.histogram[n]??0)-(e.histogram[n]??0));return 1-t/(this.totalCount+e.totalCount)}};DS.chrKeys=new Map;let nk=DS;class zCe{compute(e,t,i=dw.instance,n){if(e.length===0||t.length===0)return ld.trivial(e,t);const s=new hO(e.length,t.length),r=new hO(e.length,t.length),a=new hO(e.length,t.length);for(let g=0;g<e.length;g++)for(let m=0;m<t.length;m++){if(!i.isValid())return ld.trivialTimedOut(e,t);const _=g===0?0:s.get(g-1,m),b=m===0?0:s.get(g,m-1);let C;e.getElement(g)===t.getElement(m)?(g===0||m===0?C=0:C=s.get(g-1,m-1),g>0&&m>0&&r.get(g-1,m-1)===3&&(C+=a.get(g-1,m-1)),C+=n?n(g,m):1):C=-1;const w=Math.max(_,b,C);if(w===C){const v=g>0&&m>0?a.get(g-1,m-1):0;a.set(g,m,v+1),r.set(g,m,3)}else w===_?(a.set(g,m,0),r.set(g,m,1)):w===b&&(a.set(g,m,0),r.set(g,m,2));s.set(g,m,w)}const l=[];let c=e.length,d=t.length;function h(g,m){(g+1!==c||m+1!==d)&&l.push(new Ji(new pe(g+1,c),new pe(m+1,d))),c=g,d=m}let u=e.length-1,f=t.length-1;for(;u>=0&&f>=0;)r.get(u,f)===3?(h(u,f),u--,f--):r.get(u,f)===1?u--:f--;return h(-1,-1),l.reverse(),new ld(l,!1)}}class Oq{compute(e,t,i=dw.instance){if(e.length===0||t.length===0)return ld.trivial(e,t);const n=e,s=t;function r(m,_){for(;m<n.length&&_<s.length&&n.getElement(m)===s.getElement(_);)m++,_++;return m}let a=0;const l=new UCe;l.set(0,r(0,0));const c=new $Ce;c.set(0,l.get(0)===0?null:new Fq(null,0,0,l.get(0)));let d=0;e:for(;;){if(a++,!i.isValid())return ld.trivialTimedOut(n,s);const m=-Math.min(a,s.length+a%2),_=Math.min(a,n.length+a%2);for(d=m;d<=_;d+=2){const b=d===_?-1:l.get(d+1),C=d===m?-1:l.get(d-1)+1,w=Math.min(Math.max(b,C),n.length),v=w-d;if(w>n.length||v>s.length)continue;const S=r(w,v);l.set(d,S);const L=w===b?c.get(d+1):c.get(d-1);if(c.set(d,S!==w?new Fq(L,w,v,S-w):L),l.get(d)===n.length&&l.get(d)-d===s.length)break e}}let h=c.get(d);const u=[];let f=n.length,g=s.length;for(;;){const m=h?h.x+h.length:0,_=h?h.y+h.length:0;if((m!==f||_!==g)&&u.push(new Ji(new pe(m,f),new pe(_,g))),!h)break;f=h.x,g=h.y,h=h.prev}return u.reverse(),new ld(u,!1)}}class Fq{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class UCe{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,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class $Ce{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class sk{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let n=this.range.startLineNumber;n<=this.range.endLineNumber;n++){let s=e[n-1],r=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(r=this.range.startColumn-1,s=s.substring(r)),this.lineStartOffsets.push(r);let a=0;if(!i){const c=s.trimStart();a=s.length-c.length,s=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const l=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-r-a,s.length):s.length;for(let c=0;c<l;c++)this.elements.push(s.charCodeAt(c));n<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new pe(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(t=>String.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=H
`).length>=15&&KCe(h,f=>f.length>=2)>=2}),r=XCe(o,r),r}function KCe(o,e){let t=0;for(const i of o)e(i)&&t++;return t}function GCe(o,e,t,i){const n=[],s=o.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new nk(l.original,e,l)),r=new Set(o.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new nk(l.modified,t,l))),a=new Set;for(const l of s){let c=-1,d;for(const h of r){const u=l.computeSimilarity(h);u>c&&(c=u,d=h)}if(c>.9&&d&&(r.delete(d),n.push(new ds(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function ZCe(o,e,t,i,n,s){const r=[],a=new kH;for(const u of o)for(let f=u.original.startLineNumber;f<u.original.endLineNumberExclusive-2;f++){const g=`${e[f-1]}:${e[f+1-1]}:${e[f+2-1]}`;a.add(g,{range:new ke(f,f+3)})}const l=[];o.sort(kn(u=>u.modified.startLineNumber,lo));for(const u of o){let f=[];for(let g=u.modified.startLineNumber;g<u.modified.endLineNumberExclusive-2;g++){const m=`${t[g-1]}:${t[g+1-1]}:${t[g+2-1]}`,_=new ke(g,g+3),b=[];a.forEach(m,({range:C})=>{for(const v of f)if(v.originalLineRange.endLineNumberExclusive+1===C.endLineNumberExclusive&&v.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){v.originalLineRange=new ke(v.originalLineRange.startLineNumber,C.endLineNumberExclusive),v.modifiedLineRange=new ke(v.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),b.push(v);return}const w={modifiedLineRange:_,originalLineRange:C};l.push(w),b.push(w)}),f=b}if(!s.isValid())return[]}l.sort(R6(kn(u=>u.modifiedLineRange.length,lo)));const c=new Tr,d=new Tr;for(const u of l){const f=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,g=c.subtractFrom(u.modifiedLineRange),m=d.subtractFrom(u.originalLineRange).getWithDelta(f),_=g.getIntersection(m);for(const b of _.ranges){if(b.length<3)continue;const C=b,w=b.delta(-f);r.push(new ds(w,C)),c.addRange(C),d.addRange(w)}}r.sort(kn(u=>u.original.startLineNumber,lo));const h=new jL(o);for(let u=0;u<r.length;u++){const f=r[u],g=h.findLastMonotonous(L=>L.original.startLineNumber<=f.original.startLineNumber),m=b_(o,L=>L.modified.startLineNumber<=f.modified.startLineNumber),_=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),b=h.findLastMonotonous(L=>L.original.startLineNumber<f.original.endLineNumberExclusive),C=b_(o,L=>L.modified.startLineNumber<f.modified.endLineNumberExclusive),w=Math.max(b.original.endLineNumberExclusive-f.original.endLineNumberExclusive,C.modified.endLineNumberExclusive-f.modified.endLineNumberExclusive);let v;for(v=0;v<_;v++){const L=f.original.startLineNumber-v-1,x=f.modified.startLineNumber-v-1;if(L>i.length||x>n.length||c.contains(x)||d.contains(L)||!Vq(i[L-1],n[x-1],s))break}v>0&&(d.addRange(new ke(f.original.startLineNumber-v,f.original.startLineNumber)),c.addRange(new ke(f.modified.startLineNumber-v,f.modified.startLineNumber)));let S;for(S=0;S<w;S++){const L=f.original.endLineNumberExclusive+S,x=f.modified.endLineNumberExclusive+S;if(L>i.length||x>n.length||c.contains(x)||d.contains(L)||!Vq(i[L-1],n[x-1],s))break}S>0&&(d.addRange(new ke(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+S)),c.addRange(new ke(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+S))),(v>0||S>0)&&(r[u]=new ds(new ke(f.original.startLineNumber-v,f.original.endLineNumberExclusive+S),new ke(f.modified.startLineNumber-v,f.modified.endLineNumberExclusive+S)))}return r}function Vq(o,e,t){if(o.trim()===e.trim())return!0;if(o.length>300&&e.length>300)return!1;const n=new Oq().compute(new sk([o],new k(1,1,1,o.length),!1),new sk([e],new k(1,1,1,e.length),!1),t);let s=0;const r=Ji.invert(n.diffs,o.length);for(const d of r)d.seq1Range.forEach(h=>{uO(o.charCodeAt(h))||s++});function a(d){let h=0;for(let u=0;u<o.length;u++)uO(d.charCodeAt(u))||h++;return h}const l=a(o.length>e.length?o:e);return s/l>.6&&l>10}function YCe(o){if(o.length===0)return o;o.sort(kn(t=>t.original.startLineNumber,lo));const e=[o[0]];for(let t=1;t<o.length;t++){co
`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}};function Kq(o){let e=0;for(;e<o.length&&(o.charCodeAt(e)===32||o.charCodeAt(e)===9);)e++;return e}class n1e{constructor(){this.dynamicProgrammingDiffing=new zCe,this.myersDiffingAlgorithm=new Oq}computeDiff(e,t,i){if(e.length<=1&&Ut(e,t,(x,I)=>x===I))return new ik([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new ik([new qo(new ke(1,e.length+1),new ke(1,t.length+1),[new Is(new k(1,1,e.length,e[e.length-1].length+1),new k(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?dw.instance:new VCe(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,r=new Map;function a(x){let I=r.get(x);return I===void 0&&(I=r.size,r.set(x,I)),I}const l=e.map(x=>a(x.trim())),c=t.map(x=>a(x.trim())),d=new qq(l,e),h=new qq(c,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,n,(x,I)=>e[x]===t[I]?t[I].length===0?.1:1+Math.log(1+t[I].length):.99):this.myersDiffingAlgorithm.compute(d,h,n);let f=u.diffs,g=u.hitTimeout;f=zq(d,h,f),f=t1e(d,h,f);const m=[],_=x=>{if(s)for(let I=0;I<x;I++){const D=b+I,R=C+I;if(e[D]!==t[R]){const F=this.refineDiff(e,t,new Ji(new pe(D,D+1),new pe(R,R+1)),n,s,i);for(const O of F.mappings)m.push(O);F.hitTimeout&&(g=!0)}}};let b=0,C=0;for(const x of f){Xd(()=>x.seq1Range.start-b===x.seq2Range.start-C);const I=x.seq1Range.start-b;_(I),b=x.seq1Range.endExclusive,C=x.seq2Range.endExclusive;const D=this.refineDiff(e,t,x,n,s,i);D.hitTimeout&&(g=!0);for(const R of D.mappings)m.push(R)}_(e.length-b);const w=new ax(e),v=new ax(t),S=tk(m,w,v);let L=[];return i.computeMoves&&(L=this.computeMoves(S,e,t,l,c,n,s,i)),Xd(()=>{function x(D,R){if(D.lineNumber<1||D.lineNumber>R.length)return!1;const F=R[D.lineNumber-1];return!(D.column<1||D.column>F.length+1)}function I(D,R){return!(D.startLineNumber<1||D.startLineNumber>R.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>R.length+1)}for(const D of S){if(!D.innerChanges)return!1;for(const R of D.innerChanges)if(!(x(R.modifiedRange.getStartPosition(),t)&&x(R.modifiedRange.getEndPosition(),t)&&x(R.originalRange.getStartPosition(),e)&&x(R.originalRange.getEndPosition(),e)))return!1;if(!I(D.modified,t)||!I(D.original,e))return!1}return!0}),new ik(S,L,g)}computeMoves(e,t,i,n,s,r,a,l){return qCe(e,t,i,n,s,r).map(h=>{const u=this.refineDiff(t,i,new Ji(h.original.toOffsetRange(),h.modified.toOffsetRange()),r,a,l),f=tk(u.mappings,new ax(t),new ax(i),!0);return new Aq(h,f)})}refineDiff(e,t,i,n,s,r){const l=s1e(i).toRangeMapping2(e,t),c=new sk(e,l.originalRange,s),d=new sk(t,l.modifiedRange,s),h=c.length+d.length<500?this.dynamicProgrammingDiffing.compute(c,d,n):this.myersDiffingAlgorithm.compute(c,d,n);let u=h.diffs;return u=zq(c,d,u),u=jq(c,d,u,(g,m)=>g.findWordContaining(m)),r.extendToSubwords&&(u=jq(c,d,u,(g,m)=>g.findSubWordContaining(m),!0)),u=JCe(c,d,u),u=i1e(c,d,u),{mappings:u.map(g=>new Is(c.translateRange(g.seq1Range),d.translateRange(g.seq2Range))),hitTimeout:h.hitTimeout}}}function s1e(o){return new ds(new ke(o.seq1Range.start+1,o.seq1Range.endExclusive+1),new ke(o.seq2Range.start+1,o.seq2Range.endExclusive+1))}var o1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},r1e=function(o,e){return function(t,i){e(t,i,o)}};let fO=class extends A{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=Le(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Le(this,void 0),this.diff=this._diff,this._unchangedRegions=Le(this,void 0),this.unchangedRegions=j(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(Dt(l=>{for(const c of this._unchangedRegions.read(void 0)?.regions||[])c.collapseAll(l)}),[])),this.movedT
`:`\r
`),await this._clipboardService.writeText(w)})),i.getOption(104)||_.push(new Mo("diff.inline.revertChange",p(115,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),_},autoSelectFirstItem:!0})};this._register(Si(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;const{top:m,height:_}=mi(this._diffActions),b=Math.floor(d/3);g.preventDefault(),f(g.posx,m+_+b)})),this._register(i.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(i.onMouseDown(g=>{g.event.leftButton&&(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),f(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:n}=mi(e),s=t-n,r=Math.floor(s/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;c<this._viewLineCounts.length;c++)if(l+=this._viewLineCounts[c],r<l)return c}return r}}const Zq=Sl("diffEditorWidget",{createHTML:o=>o});function hw(o,e,t,i,n=!1){dn(i,e.fontInfo);const s=t.length>0,r=new uh(1e4);let a=0,l=0;const c=[];for(let f=0;f<o.lineTokens.length;f++){const g=f+1,m=o.lineTokens[f],_=o.lineBreakData[f],b=os.filter(t,g,1,Number.MAX_SAFE_INTEGER);if(_){let C=0;for(const w of _.breakOffsets){const v=m.sliceAndInflate(C,w,0);a=Math.max(a,Yq(l,v,os.extractWrapped(b,C,w),s,o.mightContainNonBasicASCII,o.mightContainRTL,e,r,n)),l++,C=w}c.push(_.breakOffsets.length)}else c.push(1),a=Math.max(a,Yq(l,m,b,s,o.mightContainNonBasicASCII,o.mightContainRTL,e,r,n)),l++}a+=e.scrollBeyondLastColumn;const d=r.build(),h=Zq?Zq.createHTML(d):d;i.innerHTML=h;const u=a*e.typicalHalfwidthCharacterWidth;return{heightInLines:l,minWidthInPx:u,viewLineCounts:c}}class uw{constructor(e,t=e.map(s=>null),i=!0,n=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class dd{static fromEditor(e){const t=e.getOptions(),i=t.get(59),n=t.get(165);return new dd(e.getModel()?.getOptions().tabSize||0,i,t.get(40),i.typicalHalfwidthCharacterWidth,t.get(118),t.get(75),n.decorationsWidth,t.get(133),t.get(113),t.get(108),t.get(60),t.get(117).verticalScrollbarSize)}constructor(e,t,i,n,s,r,a,l,c,d,h,u,f=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=h,this.verticalScrollbarSize=u,this.setWidth=f}withSetWidth(e){return new dd(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,e)}withScrollBeyondLastColumn(e){return new dd(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,e,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}function Yq(o,e,t,i,n,s,r,a,l){a.appendString('<div class="view-line'),!l&&!i&&a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(o*r.lineHeight)),r.setWidth?a.appendString('px;width:1000000px;">'):a.appendString('px;">');const c=e.getLineContent(),d=Vo.isBasicASCII(c,n),h=Vo.containsRTL(c,d,s),u=h_(new Vc(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,d,h,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Fc.OFF,null,null,r.verticalScrollbarSize),a);retu
[{1}] {2}`,n,xO.modifierLabels[so].altKey,l)}return n}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:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&P1e(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(ve.isThemeIcon(n)){const s=ve.asClassNameArray(n);i.classList.add(...s),this._itemClassDispose.value=ue(()=>{i.classList.remove(...s)})}else i.style.backgroundImage=Rf(this._themeService.getColorTheme().type)?Nl(n.dark):Nl(n.light),i.classList.add("icon"),this._itemClassDispose.value=jr(ue(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Uh=fk([Ns(2,ot),Ns(3,hi),Ns(4,xe),Ns(5,li),Ns(6,Ko),Ns(7,bn)],Uh);class EO extends Uh{render(e){this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",this._options?.useComma??!1)}updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=EO._symbolPrintEnter(e);this._options?.conversational?this.label.textContent=p(1632,"{1} to {0}",this._action.label,t):this.label.textContent=p(1633,"{0} ({1})",this._action.label,t)}}static _symbolPrintEnter(e){return e.getLabel()?.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let NO=class extends lk{constructor(e,t,i,n,s){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(ve.isThemeIcon(e.item.icon)?ve.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,r),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),it(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!ve.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=Rf(this._themeService.getColorTheme().type)?Nl(i.dark):Nl(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};NO=fk([Ns(2,ot),Ns(3,Ko),Ns(4,li)],NO);let TO=class extends Fa{constructor(e,t,i,n,s,r,a,l){super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=r,this._instaService=a,this._storageService=l,this._defaultActionDisposables=this._register(new U),this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c;const d=t?.persistLastActionId?l.get(this._storageKey,1):void 0;d&&(c=e.actions.find(u=>d===u.id)),c||(c=e.actions[0]),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(Uh,c,{keybinding:this._getDefaultActionKeybindingLabel(c)}));const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??this._register(new hf)};this._dropdown=this._register(new lk(e,e.actions,this._contextMenuService,h)),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof Po&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultActionDisposables.clear(),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(Uh,e,{keybinding:this._getDefaultActionKeybindingLabel(e)})),this._defaultAction.actionRunner=this._defaultActionDisposables.add(new class extends hf{async runAction(t,i){await t.run(void 0)}}),this._container&&this._defaultAction.render(Dy(this._container,Q(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel(
`),split:o=>o.split(`\r
`),parse:o=>xk.split(o).filter(e=>!e.startsWith("#"))}),hc=class hc{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+hc.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new hc((this.value?[this.value,...e]:e).join(hc.sep))}};hc.sep=".",hc.None=new hc("@@none@@"),hc.Empty=new hc("");let si=hc;const Eve={ctrlCmd:!1,alt:!1};var Sw;(function(o){o[o.Blur=1]="Blur",o[o.Gesture=2]="Gesture",o[o.Other=3]="Other"})(Sw||(Sw={}));var Ha;(function(o){o[o.NONE=0]="NONE",o[o.FIRST=1]="FIRST",o[o.SECOND=2]="SECOND",o[o.LAST=3]="LAST"})(Ha||(Ha={}));var Bt;(function(o){o[o.First=1]="First",o[o.Second=2]="Second",o[o.Last=3]="Last",o[o.Next=4]="Next",o[o.Previous=5]="Previous",o[o.NextPage=6]="NextPage",o[o.PreviousPage=7]="PreviousPage",o[o.NextSeparator=8]="NextSeparator",o[o.PreviousSeparator=9]="PreviousSeparator"})(Bt||(Bt={}));var kk;(function(o){o[o.Title=1]="Title",o[o.Inline=2]="Inline"})(kk||(kk={}));const Zn=We("quickInputService"),kK={EDITORS:"CodeEditors",FILES:"CodeFiles"};class Nve{}const Tve={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ei.add(Tve.DragAndDropContribution,new Nve);const NS=class NS{constructor(){}static getInstance(){return NS.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};NS.INSTANCE=new NS;let $O=NS;function IK(o){if(ma&&typeof globalThis.vscode?.webUtils?.getPathForFile=="function")return globalThis.vscode.webUtils.getPathForFile(o)}function DK(o){const e=new yK;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,UO(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,Rve(n))}}return e}function Rve(o){const e=IK(o),t=e?be.parse(e):void 0;return Dve(o.name,t,async()=>new Uint8Array(await o.arrayBuffer()))}const Mve=Object.freeze([kK.EDITORS,kK.FILES,og.RESOURCES,og.INTERNAL_URI_LIST]);function EK(o,e=!1){const t=DK(o),i=t.get(og.INTERNAL_URI_LIST);if(i)t.replace(_i.uriList,i);else if(e||!t.has(_i.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=IK(r);try{a?n.push(be.file(a).toString()):n.push(be.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(_i.uriList,UO(xk.create(n)))}for(const n of Mve)t.delete(n);return t}const yw=We("IWorkspaceEditService");class jO{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(jh.is(t))return jh.lift(t);if(J_.is(t))return J_.lift(t);throw new Error("Unsupported edit")})}}class jh extends jO{static is(e){return e instanceof jh?!0:nn(e)&&be.isUri(e.resource)&&nn(e.textEdit)}static lift(e){return e instanceof jh?e:new jh(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class J_ extends jO{static is(e){return e instanceof J_?!0:nn(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof J_?e:new J_(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const qO=We("IEditorCancelService"),NK=new ae("cancellableOperation",!1,p(934,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));je(qO,class{constructor(){this._tokens=new WeakMap}add(o,e){let t=this._tokens.get(o);t||(t=o.invokeWithinContext(n=>{const s=NK.bindTo(n.get(xe)),r=new Jn;return{key:s,tokens:r}}),this._tokens.set(o,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(o){const e=this._tokens.get(o);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class Pve extends Xt{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(qO).add(e,this))}dispose(){this._unregister(),super.dispose()}}re(new class extends Bi{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:NK})}runEditorCommand(o,e){o.get(qO).cancel(e)}});let TK=c
`):o}function zK(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?p(30,"A system error occurred ({0})",o.message):o.message||p(31,"An unknown error occurred. Please consult the log for more details.")}function Rk(o=null,e=!1){if(!o)return p(32,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=wa(o),i=Rk(t[0],e);return t.length>1?p(33,"{0} ({1} errors in total)",i,t.length):i}if(ji(o))return o;if(o.detail){const t=o.detail;if(t.error)return r4(t.error,e);if(t.exception)return r4(t.exception,e)}return o.stack?r4(o,e):o.message?o.message:p(34,"An unknown error occurred. Please consult the log for more details.")}const Mk=Q,iwe={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class nb extends A{constructor(e,t,i){super(),this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const n=this.options.keybindingLabelForeground;this.domNode=Z(e,Mk(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.hover=this._register(ta().setupManagedHover(Zs("mouse"),this.domNode,"")),this.didEverRender=!1,e.appendChild(this.domNode)}set(e,t){this.didEverRender&&this.keybinding===e&&nb.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){const e=this.keybinding.getChords();e[0]&&this.renderChord(this.domNode,e[0],this.matches?this.matches.firstPart:null);for(let i=1;i<e.length;i++)Z(this.domNode,Mk("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,e[i],this.matches?this.matches.chordPart:null);const t=this.options.disableTitle??!1?void 0:this.keybinding.getAriaLabel()||void 0;this.hover.update(t),this.domNode.setAttribute("aria-label",t||"")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){pn(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const n=xO.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,!!i?.ctrlKey,n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,!!i?.shiftKey,n.separator),t.altKey&&this.renderKey(e,n.altKey,!!i?.altKey,n.separator),t.metaKey&&this.renderKey(e,n.metaKey,!!i?.metaKey,n.separator);const s=t.keyLabel;s&&this.renderKey(e,s,!!i?.keyCode,"")}renderKey(e,t,i,n){Z(e,this.createKeyElement(t,i?".highlight":"")),n&&Z(e,Mk("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){Z(e,this.createKeyElement(p(15,"Unbound")))}createKeyElement(e,t=""){const i=Mk("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.options.keybindingLabelBackground&&(i.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(i.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(i.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(i.style.boxShadow=`inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),i}static areSame(e,t){return e===t||!e&&!t?!0:!!e&&!!t&&fo(e.firstPart,t.firstPart)&&fo(e.chordPart,t.chordPart)}}const Hl=We("layoutService");var UK=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Pk=function(o,e){return function(t,i){e(t,i,o)}};const $K="acceptSelectedCodeAction",jK="previewSelectedCodeAction";class nwe{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??e.label??""}disposeTempla
{1}`,a.title,Rk(b)))}finally{d.dispose()}if(s.isCancellationRequested)return;const u=BK(r.uri,e,h),f=e[0],g=r.deltaDecorations([],[{range:f,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let m,_;try{m=await this._bulkEditService.apply(u,{editor:this._editor,token:s}),_=r.getDecorationRange(g[0])}catch(b){return c(b,p(933,`Error applying edit '{0}':
{1}`,a.title,Rk(b)))}finally{r.deltaDecorations(g,[])}s.isCancellationRequested||i&&m.isApplied&&t.allEdits.length>1&&this.show(_??f,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(h4,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};Ok=KK([sb(5,ge),sb(6,yw),sb(7,hi)],Ok);var lwe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},md=function(o,e){return function(t,i){e(t,i,o)}},na;const GK="editor.changePasteType",cwe="editor.pasteAs.preferences",u4=new ae("pasteWidgetVisible",!1,p(912,"Whether the paste widget is showing")),f4="application/vnd.code.copymetadata";let _d=(Mp=class extends A{static get(e){return e.getContribution(na.ID)}constructor(e,t,i,n,s,r,a,l,c,d){super(),this._logService=i,this._bulkEditService=n,this._clipboardService=s,this._commandService=r,this._configService=a,this._languageFeaturesService=l,this._quickInputService=c,this._progressService=d,this._editor=e;const h=e.getContainerDomNode();this._register(W(h,"copy",u=>this.handleCopy(u))),this._register(W(h,"cut",u=>this.handleCopy(u))),this._register(W(h,"paste",u=>this.handlePaste(u),!0)),this._pasteProgressManager=this._register(new Ik("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(Ok,"pasteIntoEditor",e,u4,{id:GK,label:p(913,"Show paste options...")},()=>na._configureDefaultAction?[na._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace("CopyPasteController.pasteAs"),this._editor.focus();try{this._logService.trace("Before calling editor.action.clipboardPasteAction"),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand("editor.action.clipboardPasteAction")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){let t=null;if(e.clipboardData){const[_,b]=Af.getTextData(e.clipboardData);t=(b||wl.INSTANCE.get(_))?.id||null,this._logService.trace("CopyPasteController#handleCopy for id : ",t," with text.length : ",_.length)}else this._logService.trace("CopyPasteController#handleCopy");if(!this._editor.hasTextFocus()||(this._clipboardService.clearInternalState?.(),!e.clipboardData||!this.isPasteAsEnabled()))return;const i=this._editor.getModel(),n=this._editor.getSelections();if(!i||!n?.length)return;const s=this._editor.getOption(45);let r=n;const a=n.length===1&&n[0].isEmpty();if(a){if(!s)return;r=[new k(r[0].startLineNumber,1,r[0].startLineNumber,1+i.getLineLength(r[0].startLineNumber))]}const l=this._editor._getViewModel()?.getPlainTextToCopy(n,s,gn),d={multicursorText:Array.isArray(l)?l:null,pasteOnNewLine:a,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter(_=>!!_.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const u=DK(e.clipboardData),f=h.flatMap(_=>_.copyMimeTypes??[]),g=t??Of();this.setCopyMetadata(e.clipboardData,{id:g,providerCopyMimeTypes:f,defaultPastePayload:d});const m=h.map(_=>({providerMimeTypes:_.copyMimeTypes,operation:Vi(b=>_.prepareDocumentPaste(i,r,u,b).catch(C=>{console.error(C)}))}));na._currentCopyOperation?.operations.forEach(_=>_.operation.cancel()),na._currentCopyOperation={handle:g,operations:m}}async handlePaste(e){if(e.clipboardData){const[c,d]=Af.getTextData(e.clipboardData),h=d||wl.INSTANCE.get(c);this._logService.trace("CopyPasteController#handlePaste for id : ",h?.id)}else this._logService.trace("CopyPasteController#handleP
top: ${this.virtualDelegate.headerRowHeight+1}px;
height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
}`),this.styleElement.textContent=t.join(`
`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}};PN.InstanceCount=0;let Z4=PN;const oZ={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class Gh extends go{get onChange(){return this._onChange.event}get onKeyDown(){return this._onKeyDown.event}constructor(e){super(),this._onChange=this._register(new P),this._onKeyDown=this._register(new P),this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...ve.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(ta().setupManagedHover(e.hoverDelegate??Zs("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...t),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,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(this.enabled){if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)}})}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()}setIcon(e){this._icon&&this.domNode.classList.remove(...ve.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...ve.asClassNameArray(this._icon))}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)),this.domNode.classList.remove("disabled")}disable(){this.domNode.setAttribute("aria-disabled",String(!0)),this.domNode.classList.add("disabled")}setTitle(e){this._hover.update(e),this.domNode.setAttribute("aria-label",e)}}const cB=class cB extends go{constructor(e,t,i){super(),this.checkbox=e,this.domNode=t,this.styles=i,this._onChange=this._register(new P),this.onChange=this._onChange.event,this.applyStyles()}get enabled(){return this.checkbox.enabled}enable(){this.checkbox.enable(),this.applyStyles(!0)}disable(){this.checkbox.disable(),this.applyStyles(!1)}setTitle(e){this.checkbox.setTitle(e)}applyStyles(e=this.enabled){this.domNode.style.color=(e?this.styles.checkboxForeground:this.styles.checkboxDisabledForeground)||"",this.domNode.style.backgroundColor=(e?this.styles.checkboxBackground:this.styles.checkboxDisabledBackground)||"",this.domNode.style.borderColor=(e?this.styles.checkboxBorder:this.styles.checkboxDisabledBackground)||"";const t=this.styles.size||18;this.domNode.style.width=this.domNode.style.height=this.domNode.style.fontSize=`${t}px`,this.domNode.style.fontSize=`${t-2}px`}};cB.CLASS_NAME="monaco-checkbox";let Hw=cB;class rZ extends Hw{constructor(e,t,i){const n=new Gh({title:e,isChecked:t,icon:Y.check,actionClassName:Hw.CLASS_NAME,hoverDelegate:i.hoverDelegate,...oZ});super(n,n.domNode,i),this._register(n),this._register(this.checkbox.onChange(s=>{this.applyStyles(),this._onChange.fire(s)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}applyStyles(e){this.checkbox.checked?this.checkbox.
`)n.type===2&&(n=s.pop()),n.children.push({type:8});else if(n.type!==2){const c={type:2,content:a};n.children.push(c),s.push(n),n=c}else n.content+=a}return n.type===2&&(n=s.pop()),t}function ySe(o,e){return Y4(o)!==0}function Y4(o,e){switch(o){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return 0;default:return 0}}class LSe{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}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 xSe{constructor(e=new Set,t=10){this._history=e,this._limit=t,this._onChange(),this._history.onDidChange&&(this._disposable=this._history.onDidChange(()=>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 LSe(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;if(e.length>this._limit){const t=e.slice(e.length-this._limit);this._history.replace?this._history.replace(t):this._history=new Set(t)}}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0)}}const ub=Q;let kSe=class extends go{get onDidChange(){return this._onDidChange.event}get onDidHeightChange(){return this._onDidHeightChange.event}constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this.hover=this._register(new ct),this._onDidChange=this._register(new P),this._onDidHeightChange=this._register(new P),this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Z(e,ub(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",s=Z(this.element,ub(".ibwrapper"));if(this.input=Z(s,ub(n+".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=Z(s,ub("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new vz(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Z(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(l=>this.input.scrollTop=l.scrollTop));const r=this._register(new gt(e.ownerDocument,"selectionchange")),a=ie.filter(r.event,()=>e.ownerDocument.getSelection()?.anchorNode===s);this._register(a(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),thi
`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=Mc(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=Mc(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=Mc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=Mc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=Mc(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=Mc(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}setupModel(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidSpliceRenderedNodes(({start:s,deleteCount:r,elements:a})=>this.view.splice(s,r,a)));const t=ie.forEach(e.onDidSpliceModel,s=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(s),this.selection.onDidModelSplice(s)})},this.modelDisposables);t(()=>null,null,this.modelDisposables);const i=this.modelDisposables.add(new P),n=this.modelDisposables.add(new fr(0));this.modelDisposables.add(ie.any(t,this.focus.onDidChange,this.selection.onDidChange)(()=>{n.trigger(()=>{const s=new Set;for(const r of this.focus.getNodes())s.add(r);for(const r of this.selection.getNodes())s.add(r);i.fire([...s.values()])})})),this.onDidChangeActiveNodesRelay.input=i.event,this.onDidChangeModelRelay.input=ie.signal(e.onDidSpliceModel),this.onDidChangeCollapseStateRelay.input=e.onDidChangeCollapseState,this.onDidChangeRenderNodeCountRelay.input=e.onDidChangeRenderNodeCount,this.onDidSpliceModelRelay.input=e.onDidSpliceModel}dispose(){pt(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose(),this.modelDisposables.dispose()}}class n5{constructor(e,
`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class jw{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 classNames(e){this.disposed||fo(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class qw extends A{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new jw(Z(e,Q(".monaco-icon-label")))),this.labelContainer=Z(this.domNode.element,Q(".monaco-icon-label-container")),this.nameContainer=Z(this.labelContainer,Q("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new Sye(this.nameContainer,!!t.supportIcons)):this.nameNode=new vye(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??Zs("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],s=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let l;!a||!ai(a)?(l=Q(".monaco-icon-label-iconpath"),this.domNode.element.prepend(l)):l=a,l.style.backgroundImage=Nl(i?.iconPath),l.style.backgroundRepeat="no-repeat",l.style.backgroundPosition="center",l.style.backgroundSize="contain"}else a&&a.remove();if(this.domNode.classNames=n,this.domNode.element.setAttribute("aria-label",r),this.labelContainer.classList.value="",this.labelContainer.classList.add(...s),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof Xh?(l.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(l.element,i?.descriptionTitle)):(l.textContent=t&&i?.labelEscapeNewLines?Xh.escapeNewLines(t,[]):t||"",this.setupHover(l.element,i?.descriptionTitle||""),l.empty=!t)}if(i?.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=i?.suffix??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}let n=e;if(this.creationOptions?.hoverTargetOverride){if(!Zi(e,this.creationOptions.hoverTargetOverride))throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");n=this.creationOptions.hoverTargetOverride}const s=ta().setupManagedHover(this.hoverDelegate,n,t);s&&this.customHovers.set(e,s)}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new jw(lse(this.nameContainer,Q("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new jw(Z(e.element,Q("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new jw(Z(this.labelContainer,Q("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new Xh(Z(e.element,Q("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new jw(Z(e.element,Q("span.label-description"))))}return this.descriptionNode}}class vye{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&fo(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=Z(this.container,Q("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e
`)))}onDragOver(){return!1}drop(){}dispose(){this.disposables.dispose()}};N5=jZ([Ug(0,zg)],N5);let T5=class extends sI{constructor(e,t,i,n,s,r,a,l,c){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=s,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._keybindingService=c,this._disposeOnNewModel=new U,this._callOnDispose=new U,this._onDidSelectReference=new P,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new dt(0,0),this._isClosing=!1,this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}get isClosing(){return this._isClosing}dispose(){this._isClosing=!0,this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),pt(this._preview),pt(this._previewNotAvailableMessage),pt(this._tree),pt(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(oSe)||$.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(sSe)||$.transparent,primaryHeadingColor:e.getColor(tZ),secondaryHeadingColor:e.getColor(iZ)})}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=Z(e,Q("div.messages")),gs(this._messageContainer),this._splitView=new sZ(e,{orientation:1}),this._previewContainer=Z(e,Q("div.preview.inline"));const t={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(Cd,this._previewContainer,t,{},this.editor),gs(this._previewContainer),this._previewNotAvailableMessage=this._instantiationService.createInstance(Jf,p(1079,"no preview available"),Fo,Jf.DEFAULT_CREATION_OPTIONS,null),this._treeContainer=Z(e,Q("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new kye,keyboardNavigationLabelProvider:this._instantiationService.createInstance(I5),identityProvider:new Lye,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:rSe},dnd:this._instantiationService.createInstance(N5)};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(Si(this._treeContainer,"keydown",s=>{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Dye,"ReferencesWidget",this._treeContainer,new yye,[this._instantiationService.createInstance(kI),this._instantiationService.createInstance(II)],this._instantiationService.createInstance(k5),i),this._splitView.addView({onDidChange:ie.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},oI.Distribute),this._splitView.addView({onDidChange:ie.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},oI.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(s,r)=>{s instanceof Sd&&(r==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:r,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(s=>{s.sideBySide
`),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=Ld._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new ce(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];r.ignore||i.push(fi.delete(new k(t+n,r.commentStrOffset+1,t+n,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let s=0,r=e.length;s<r;s++){const a=e[s];a.ignore||i.push(fi.insert(new M(t+s,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let s=1073741824,r,a;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let h=0;for(let u=0,f=t[l].commentStrOffset;h<s&&u<f;u++)h=Ld.nextVisibleColumn(h,n,d.charCodeAt(u)===9,1);h<s&&(s=h)}s=Math.floor(s/n)*n;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let h=0;for(r=0,a=t[l].commentStrOffset;h<s&&r<a;r++)h=Ld.nextVisibleColumn(h,n,d.charCodeAt(r)===9,1);h>s?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class J5 extends le{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Jt);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(29),l=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));l.sort((d,h)=>k.compareRangesUsingStarts(d.selection,h.selection));let c=l[0];for(let d=1;d<l.length;d++){const h=l[d];c.selection.endLineNumber===h.selection.startLineNumber&&(c.index<h.index?h.ignoreFirstLine=!0:(c.ignoreFirstLine=!0,c=h))}for(const d of l)s.push(new Ld(i,d.selection,r.indentSize,this._type,a.insertSpace,a.ignoreEmptyLines,d.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Zye extends J5{constructor(){super(0,{id:"editor.action.commentLine",label:H(892,"Toggle Line Comment"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:de.MenubarEditMenu,group:"5_insert",title:p(890,"&&Toggle Line Comment"),order:1}})}}class Yye extends J5{constructor(){super(1,{id:"editor.action.addCommentLine",label:H(893,"Add Line Comment"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2081),weight:100}})}}class Xye extends J5{constructor(){super(2,{id:"editor.action.removeCommentLine",label:H(894,"Remove Line Comment"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2099),weight:100}})}}class Qye extends le{constructor(){super({id:"editor.action.blockComment",label:H(895,"Toggle Block Comment"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:de.MenubarEditMenu,group:"5_insert",title:p(891,"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(Jt);if(!t.hasModel())return;const n=t.getOption(29),s=[],r=t.getSelections();for(const a of r)s.push(new Jh(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}ne(Zye),ne(Yye),ne(Xye),ne(Qye);var Jye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gg=function(o,e){return function(t,i){e(t,i,o)}},eF;let e
If there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.`)}}},{type:"object",required:["preferences"],properties:{preferences:{type:"array",description:p(909,`List of preferred paste edit kind to try applying.
The first edit matching the preferences will be applied.`),items:{type:"string"}}}}]},Kp)),ne(class extends le{constructor(){super({id:"editor.action.pasteAsText",label:H(911,"Paste as Text"),precondition:T.writable})}run(o,e){return _d.get(e)?.pasteAs({providerId:Lg.id})}});class oLe{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class sY{constructor(e){this.identifier=e}}const oY=We("treeViewsDndService");je(oY,oLe,1);var rLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},AI=function(o,e){return function(t,i){e(t,i,o)}},xd;const aLe="editor.dropIntoEditor.preferences",rY="editor.changeDropType",nF=new ae("dropWidgetVisible",!1,p(929,"Whether the drop widget is showing"));let Sb=(Gp=class extends A{static get(e){return e.getContribution(xd.ID)}constructor(e,t,i,n,s){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=$O.getInstance(),this._dropProgressManager=this._register(t.createInstance(Ik,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(Ok,"dropIntoEditor",e,nF,{id:rY,label:p(930,"Show drop options...")},()=>xd._configureDefaultAction?[xd._configureDefaultAction]:[])),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){if(!i.dataTransfer||!e.hasModel())return;xd._currentDropOperation?.cancel(),e.focus(),e.setPosition(t);const n=Vi(async s=>{const r=new U,a=r.add(new ud(e,1,void 0,s));try{const l=await this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const d=this._languageFeaturesService.documentDropEditProvider.ordered(c).filter(u=>u.dropMimeTypes?u.dropMimeTypes.some(f=>l.matches(f)):!0),h=r.add(await this.getDropEdits(d,c,t,l,a.token));if(a.token.isCancellationRequested)return;if(h.edits.length){const u=this.getInitialActiveEditIndex(c,h.edits),f=e.getOption(43).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([k.fromPositions(t)],{activeEditIndex:u,allEdits:h.edits},f,async g=>g,s)}}finally{r.dispose(),xd._currentDropOperation===n&&(xd._currentDropOperation=void 0)}});this._dropProgressManager.showWhile(t,p(931,"Running drop handlers. Click to cancel"),n,{cancel:()=>n.cancel()}),xd._currentDropOperation=n}async getDropEdits(e,t,i,n,s){const r=new U,a=await Em(Promise.all(e.map(async c=>{try{const d=await c.provideDocumentDropEdits(t,i,n,s);return d&&r.add(d),d?.edits.map(h=>({...h,providerId:c.id}))}catch(d){Do(d)||console.error(d),console.error(d)}})),s),l=wa(a??[]).flat();return{edits:HK(l),dispose:()=>r.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(aLe,{resource:e.uri});for(const n of Array.isArray(i)?i:[]){const s=new si(n),r=t.findIndex(a=>a.kind&&s.contains(a.kind));if(r>=0)return r}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new yK;const t=EK(e.dataTransfer);if(this.treeItemsTransfer.hasData(sY.prototype)){const i=this.treeItemsTransfer.getData(sY.prototype);if(Array.isArray(i))for(const n of i){const s=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(s)for(const[r,a]of s)t.replace(r,a)}}return t}},xd=Gp,Gp.ID="editor.contrib.dropIntoEditorController",Gp);Sb=xd=rLe([AI(1,ge),AI(2,Me),AI(3,he),AI(4,oY)],Sb),Qe(Sb.ID,Sb,2),cb(i4),re(new class extends Bi{constructor(){super({id:rY,precondition:nF,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e,t){Sb.get(e)?.changeDropType()}}),re(new class extends Bi{constructor(){supe
`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(s===36){if(i++,i>=n)break;const r=o.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1<n){const l=o.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const kd=new ae("findWidgetVisible",!1);kd.toNegated();const OI=new ae("findInputFocussed",!1),oF=new ae("replaceInputFocussed",!1),FI={primary:545,mac:{primary:2593}},WI={primary:565,mac:{primary:2613}},BI={primary:560,mac:{primary:2608}},HI={primary:554,mac:{primary:2602}},VI={primary:558,mac:{primary:2606}},Vt={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"},eu=19999,uLe=240;class t0{constructor(e,t){this._toDispose=new U,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new No,this._decorations=new sF(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new wt(()=>{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,pt(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)},uLe)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new k(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,eu);this._decorations.set(n,i);const s=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(s);if(r===0&&n.length>0){const a=sv(n.map(l=>l.range),l=>k.compareRangesUsingStarts(l,s)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decoratio
`),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 wY(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return SY(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(vY|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{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 wY(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return SY(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){const i=this._codeEditor.getOption(50).history,n=this._codeEditor.getOption(50).replaceHistory;this._findInput=this._register(new cF(null,this._contextViewProvider,{width:FLe,label:LLe,placeholder:xLe,appendCaseSensitiveLabel:this._keybindingLabelFor(Vt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Vt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Vt.ToggleRegexCommand),validation:u=>{if(u.length===0||!this._findInput.getRegex())return null;try{return new RegExp(u,"gu"),null}catch(f){return{content:f.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>mY(this._keybindingService),inputBoxStyles:uk,toggleStyles:hk,history:i==="workspace"?this._findWidgetSearchHistory:new Set([])},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(u=>{u.equals(3)&&!this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0),this._onFindInputKeyDown(u)})),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||!this._codeEditor.getOption(50).findOnType||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(u=>{u.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),u.preventDefault())})),this._register(this._findInput.onRegexKeyDown(u=>{u.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),u.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(u=>{this._tryUpdateHeight()&&this._showViewZone()})),Ws&&this._register(this._findInput.onMouseDown(u=>this._onFindInputMouseDown(u))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const s=this._register(W_());this._prevBtn=this._register(new Lb({label:kLe+this._keybindingLabelFor(Vt.PreviousMatchFindAction),icon:wLe,hoverDelegate:s,onTrigger:()=>{Qd(this._codeEditor.getAction(Vt.PreviousMatchFindAction)).run().then(void 0,Ee)}},this._hoverService)),this._nextBtn=this._register(new Lb({label:ILe+this._keybindingLabelFor(Vt.NextMatchFindAction),icon:SLe,hoverDelegate:s,onTrigger:()=>{Qd(this._codeEditor.getAction(Vt.NextMatchFindAction)).run().then(void 0,Ee)}},this._hoverService));const r=document.createElement("div");r.className="find-part",r.appendChild(this._findInput.domNode);const a=document.createElement("div");a.className="find-actions",r.appendChild(a),a.appendChild(this._matchesCount),a.appendChild(this._prevBtn.domNode),a.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Gh({icon:bLe,title:DLe+this._keybindingLabelFor(Vt.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:s,inputActiveOptionBackground:J(U1),inputActiveOptionBorder:J(IL),inputActiveOptionForeground:J(DL)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let u=this._codeEditor.getSelections();u=u.map(f=>(f.endColumn===1&&f.endL
* '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:PY,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,t,i,n){const s=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?DY(t,!1,s,r):xb(t,!1,s,r)}}class Sxe extends Pn{constructor(){super({id:"editor.unfoldRecursively",label:H(978,"Unfold Recursively"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2142),weight:100}})}invoke(e,t,i,n){xb(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class yxe extends Pn{constructor(){super({id:"editor.fold",label:H(979,"Fold"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{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:PY,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?txe(t,!0,s):a==="up"?DY(t,!0,r||1,s):xb(t,!0,r||1,s)}}class Lxe extends Pn{constructor(){super({id:"editor.toggleFold",label:H(980,"Toggle Fold"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);CF(t,1,n)}}class xxe extends Pn{constructor(){super({id:"editor.foldRecursively",label:H(981,"Fold Recursively"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);xb(t,!0,Number.MAX_VALUE,n)}}class kxe extends Pn{constructor(){super({id:"editor.toggleFoldRecursively",label:H(982,"Toggle Fold Recursively"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,3114),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);CF(t,Number.MAX_VALUE,n)}}class Ixe extends Pn{constructor(){super({id:"editor.foldAllBlockComments",label:H(983,"Fold All Block Comments"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2138),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())wF(t,$c.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+oo(a.blockCommentStartToken));vF(t,l,!0)}}}}class Dxe extends Pn{constructor(){super({id:"editor.foldAllMarkerRegions",label:H(984,"Fold All Regions"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())wF(t,$c.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);vF(t,l,!0)}}}}class Exe extends Pn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:H(985,"Unfold All Regions"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())wF(t,$c.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);vF(t,l,!1)}}}}class Nxe extends Pn{constructor(){super({id:"editor.foldAllExcept",label:H(986,"Fold All Except Selected"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2136),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);EY(t,!0,n)}}class Txe extends Pn{constructor(){super({id:"editor.unfoldAllExcept",label:H(987,"Unfold All Except Selected"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2134),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);EY(t,!1,n)}}class Rxe extends Pn{constructor(){super({id:"editor.foldAll",label:H(988,"Fold All"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2069),weight:100}})}invoke(e,t,i){xb(t,!0)}}class Mxe extends Pn{constructor(){super({id:"editor.unfoldAll",label:H(989,"Unfold All"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2088),weight:100}})}invoke(e,t,i){xb(t,!1)}}const DC=class DC extends Pn{getFoldingLevel(){return parseInt(this.id.substr(DC.ID_PREFIX.length))}invoke(e,t,i){ixe(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};DC.ID_PREFIX="editor.foldLevel",DC.ID=e=>DC.ID_PREFIX+e;let KI=DC;class Pxe extends Pn{constructor(){super({id:"editor.gotoParentFold",label:H(990,"Go to Parent Fold"),precondition:vn,kbOpts:{kbExpr:T.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s=nxe(n[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class Axe extends Pn{constructor(){super({id:"editor.gotoPreviousFold",label:H(991,"Go to Previous Folding Range"),
`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class rD{constructor(e,t,i,n=[]){this.column=e,this.text=t,this.preview=i,this._inlineDecorations=n,this.lines=ro(this.text).map((s,r)=>({line:s,lineDecorations:os.filter(this._inlineDecorations,r+1,1,s.length+1)}))}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t.line===e.lines[i].line&&os.equalsArr(t.lineDecorations,e.lines[i].lineDecorations))}}class MF{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new rD(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=ro(this.text)}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((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function iX(o,e){return Ut(o,e,nX)}function nX(o,e){return o===e?!0:!o||!e?!1:o instanceof h0&&e instanceof h0||o instanceof MF&&e instanceof MF?o.equals(e):!1}function Dd(o,e,t){const i=t?o.range.intersectRanges(t):o.range;if(!i)return o;const n=o.text.replaceAll(`\r
`,`
`),s=e.getValueInRange(i,1),r=Gr(s,n),a=$i.ofText(s.substring(0,r)).addToPosition(o.range.getStartPosition()),l=n.substring(r),c=k.fromPositions(a,o.range.getEndPosition());return new Oi(c,l)}function sX(o,e){return o.text.startsWith(e.text)&&Eke(o.range,e.range)}function Eke(o,e){return e.getStartPosition().equals(o.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(o.getEndPosition())}function oX(o,e,t,i,n=0){let s=Dd(o,e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const r=e.getLineContent(s.range.startLineNumber),a=It(r).length;if(s.range.startColumn-1<=a){const g=It(s.text).length,m=r.substring(s.range.startColumn-1,a),[_,b]=[s.range.getStartPosition(),s.range.getEndPosition()],C=_.column+m.length<=b.column?_.delta(0,m.length):b,w=k.fromPositions(C,b),v=s.text.startsWith(m)?s.text.substring(m.length):s.text.substring(g);s=new Oi(w,v)}const c=e.getValueInRange(s.range),d=Nke(c,s.text);if(!d)return;const h=s.range.startLineNumber,u=new Array;if(t==="prefix"){const g=d.filter(m=>m.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=s.text.length-n;for(const g of d){const m=s.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===s.range.startLineNumber&&m<i.column||g.originalLength>0)return;if(g.modifiedLength===0)continue;const _=g.modifiedStart+g.modifiedLength,b=Math.max(g.modifiedStart,Math.min(_,f)),C=s.text.substring(g.modifiedStart,b),w=s.text.substring(b,Math.max(g.modifiedStart,_));C.length>0&&u.push(new rD(m,C,!1)),w.length>0&&u.push(new rD(m,w,!0))}return new h0(h,u)}let aD;function Nke(o,e){if(aD?.originalValue===o&&aD?.newValue===e)return aD?.changes;{let t=aX(o,e,!0);if(t){const i=rX(t);if(i>0){const n=aX(o,e,!1);n&&rX(n)<i&&(t=n)}}return aD={originalValue:o,newValue:e,changes:t},t}}function rX(o){let e=0;for(const t of o)e+=t.originalLength;return e}function aX(o,e,t){if(o.length>5e3||e.length>5e3)return;function i(c){let d=0;for(let h=0,u=c.length;h<u;h++){const f=c.charCodeAt(h);f>d&&(d=f)}return d}const n=Math.max(i(o),i(e));function s(c){if(c<0)throw new Error("unexpected");return n+c+1}function r(c){let d=0,h=0;const u=new Int32Array(c.length);for(let f=0,g=c.length;f<g;f++)if(t&&c[f]==="("){const m=h*100+d;u[f]=s(2*m),d++}else if(t&&c[f]===")"){d=Math.max(d-1,0);const m=h*100+d;u[f]=s(2*m+1),d===0&&h++}else u[f]=c.charCodeAt(f);return u}const a=r(o),l=r(e);return new jl({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}function Tke(o,e){let t,i=!1;const n=new F6(new xn(o,void 0,e.update),(s,r)=>{i||(t=e.initial instanceof Function?e.initial():e.initial,i=!0);const a=e.update(s,t,r);return t=a,a},e.changeTracker,()=>{i&&(e.disposeFinal?.(t),i=!1)},e.equalityComparer??Ro,(s,r,a)=>{if(!i)throw new Ce("Can only set when there is a listener! This is to prevent leaks.");lf(r,l=>{t=s,n.setValue(s,l,a)})},Gi.ofCaller());return n}var Rke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lX=function(o,e){return function(t,i){e(t,i,o)}};class Mke{constructor(e,t){this._baseService=e,this._intercept=t}publicLog2(e,t){this._intercept(e,t),this._baseService.publicLog2(e,t)}}let PF=class extends Mke{constructor(e,t){super(e,(i,n)=>{let s=!0;n&&AF in n&&(s=!!n[AF]),s&&t.getDataChannel("editTelemetry").sendData({eventName:i,data:n})})}};PF=Rke([lX(0,Vn),lX(1,TF)],PF);const AF=Symbol("shouldForwardToChannel");function Pke(o){return{[AF]:o}}function Ake(o){if(!o)return!1;const e=o.toLowerCase();return e==="github.copilot"||e==="github.copilot-chat"}function Oke(o){const e=o.map(i=>new Cn(pe.ofStartAndLength(i.rangeOffset,i.rangeLength),i.text));return e.reverse(),new qc(e)}function Fke(o,e){o.publicLog2("inlineCompletion.endOfLife",e)}const Wke=3;class Bke{computeDiff(e,t,i){const s=new zke(e,t,{maxComputationTime:i.maxComputationTimeMs
`)))this._editor.revealPosition(n);else{const r=new k(i.startLineNumber-1,1,i.endLineNumber+1,1);this._editor.revealRange(r,1)}this._editor.focus()})}async handleInlineSuggestionShown(e,t,i){await e.reportInlineEditShown(this._commandService,t,i)}};KF=dIe([Yg(7,ge),Yg(8,Tt),Yg(9,Jt),Yg(10,bn),Yg(11,he),Yg(12,et),Yg(13,hD)],KF);var Ed;(function(o){o[o.Undo=0]="Undo",o[o.Redo=1]="Redo",o[o.AcceptWord=2]="AcceptWord",o[o.Other=3]="Other"})(Ed||(Ed={}));function GF(o,e,t){if(e.length===1)return[];const i=new wg(o),n=i.getTransformer(),s=n.getOffset(e[0]),r=e.slice(1).map(u=>n.getOffset(u));t=t.removeCommonPrefixAndSuffix(i);const a=n.getStringReplacement(t),l=a.replaceRange.start-s,c=a.replaceRange.join(pe.emptyAt(s)),d=i.getValueOfOffsetRange(c);return r.map(u=>{const f=u+l,g=f+a.replaceRange.length,m=new pe(f,g),_=m.join(pe.emptyAt(u));if(i.getValueOfOffsetRange(_)!==d)return;const C=new Cn(m,a.newText);return n.getTextReplacement(C)}).filter(sn)}class hIe extends A{constructor(e,t,i){super(),i&&this._register({dispose:()=>i()}),this._register(ni(e).setDecorations(Et(t.map(r=>({range:r,options:{description:"animation",className:"edits-fadeout-decoration",zIndex:1}})))));const n=new xke(1,0,1e3,Ike),s=new Dke(n);this._register(Se(r=>{const a=s.getValue(r);e.getContainerDomNode().style.setProperty("--animation-opacity",a.toString()),n.isFinished()&&this.dispose()}))}}var uIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vX=function(o,e){return function(t,i){e(t,i,o)}},_0;class ZF{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let s=0;s<i.length;s++){const{score:r,completion:a}=i[s];if(r[0]!==n)break;if(a.preselect)return s}return 0}}class wX extends ZF{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class fIe extends ZF{constructor(){super("recentlyUsed"),this._cache=new dl(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const s=i[0].score[0];let r=-1,a=-1,l=-1;for(let c=0;c<i.length&&i[c].score[0]===s;c++){const d=`${e.getLanguageId()}/${i[c].textLabel}`,h=this._cache.peek(d);if(h&&h.touch>l&&h.type===i[c].completion.kind&&h.insertText===i[c].completion.insertText&&(l=h.touch,a=c),i[c].completion.preselect&&r===-1)return r=c}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:S_.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class gIe extends ZF{constructor(){super("recentlyUsedByPrefix"),this._trie=eb.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${n}`;this._trie.set(s,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const s=`${e.getLanguageId()}/${n}`;let r=this._trie.get(s);if(r||(r=this._trie.findSubstr(s)),r)for(let a=0;a<i.length;a++){const{kind:l,insertText:c}=i[a].completion;if(l===r.type&&c===r.insertText)return a}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:S_.fromString(i.type),this._trie.set(t,i)}}}let YF=(Ou=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new U,this._persistSoon=new wt(
`,s+=`prefix: ${e.word??"(no prefix)"}
`,s+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
`,s+=`distance: ${e.distance} (localityBonus-setting)
`,s+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
`,s+=`commit_chars: ${e.completion.commitCharacters?.join("")}
`,n=new qn().appendCodeblock("empty",s),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!i3(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const s=i.length>1e5?`${i.substr(0,1e5)}`:i;this._type.textContent=s,this._type.title=s,uo(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(s))}else pn(this._type),this._type.title="",gs(this._type),this.domNode.classList.add("no-type");if(pn(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),pn(this._docs);const s=this._markdownRenderer.render(n,{asyncRenderCallback:()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}});this._docs.appendChild(s.element),this._renderDisposeable.add(s)}this.domNode.classList.toggle("detail-and-doc",!!i&&!!n),this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=s=>{s.preventDefault(),s.stopPropagation()},this._close.onclick=s=>{s.preventDefault(),s.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 isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new dt(e,t);dt.equals(i,this._size)||(this._size=i,ese(this.domNode,e,t)),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}focus(){this.domNode.focus()}};n3=LIe([xIe(1,ge)],n3);class kIe{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new U,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new B4,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,s=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=n.width-a.dimension.width,l=!0),a.north&&(s=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+s,left:i.left+r})}a.done&&(i=void 0,n=void 0,s=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??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 this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),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,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=rh(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),r=new dt(220,2*s.lineHeight),a=e.top,l=(function(){const S=n.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),L=-s.borderWidth+e.left+e.width,x=new dt(S,n.height-e.top-s.borderHeight-s.verticalPadding),I=x.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:L,fit:S-t.width,maxSizeTop:x,maxSizeBottom:I,minSize:r.with(Math.min(S,r.width))}})(),c=(functi
`)&&d&&!x&&"diff-range-empty"),inlineClassName:x?L3("strike-through","inlineCompletions"):null,zIndex:1}})}if(L.modified.contains(I.modifiedRange.startLineNumber)&&u.push({range:I.modifiedRange,options:I.modifiedRange.isEmpty()&&d&&!x&&c?C:b}),x){const D=a.getValueOfRange(I.modifiedRange),R=D.length>3?[{text:D.slice(0,1),extraClasses:["start"],offsetRange:new pe(I.modifiedRange.startColumn-1,I.modifiedRange.startColumn)},{text:D.slice(1,-1),extraClasses:[],offsetRange:new pe(I.modifiedRange.startColumn,I.modifiedRange.endColumn-2)},{text:D.slice(-1),extraClasses:["end"],offsetRange:new pe(I.modifiedRange.endColumn-2,I.modifiedRange.endColumn-1)}]:[{text:D,extraClasses:["start","end"],offsetRange:new pe(I.modifiedRange.startColumn-1,I.modifiedRange.endColumn)}];this._tokenizationFinished.read(s);const F=this._modifiedTextModel.tokenization.getLineTokens(I.modifiedRange.startLineNumber);for(const{text:O,extraClasses:B,offsetRange:V}of R)h.push({range:k.fromPositions(I.originalRange.getEndPosition()),options:{description:"inserted-text",before:{tokens:F.getTokensInRange(V),content:O,inlineClassName:L3("inlineCompletions-char-insert",I.modifiedRange.isSingleLine()&&r.mode==="insertionInline"&&"single-line-inline",...B),cursorStops:yr.None,attachedData:new B3(this)},zIndex:2,showIfCollapsed:!0}})}}}if(r.isInDiffEditor)for(const L of r.diff)L.original.isEmpty||h.push({range:L.original.toExclusiveRange(),options:w});return{originalDecorations:h,modifiedDecorations:u}}),this._register(ni(this._originalEditor).setDecorations(this._decorations.map(s=>s?.originalDecorations??[])));const n=this._state.map(s=>s?.modifiedCodeEditor);this._register(Bn((s,r)=>{const a=n.read(s);a&&r.add(ni(a).setDecorations(this._decorations.map(l=>l?.modifiedDecorations??[])))})),this._register(this._originalEditor.onMouseUp(s=>{if(s.target.type!==6)return;const r=s.target.detail.injectedText?.options.attachedData;r instanceof B3&&r.owner===this&&this._onDidClick.fire(s.event)}))}}class B3{constructor(e){this.owner=e}}function jDe(o){return o.innerChanges?o.innerChanges.every(e=>ok(e.modifiedRange)&&ok(e.originalRange)):!1}let qDe=0;function KDe(o){return rt(o.onDidChangeTokens,()=>qDe++)}var GDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ZDe=function(o,e){return function(t,i){e(t,i,o)}};let H3=class extends A{constructor(e,t,i,n,s,r){super(),this._editor=e,this._host=t,this._model=i,this._ghostTextIndicator=n,this._focusIsInMenu=s,this._instantiationService=r,this._editorObs=ni(this._editor),this._tabAction=j(d=>this._model.read(d)?.tabAction.read(d)??Xn.Inactive),this._constructorDone=Le(this,!1),this._uiState=j(this,d=>{const h=this._model.read(d);if(!h||!this._constructorDone.read(d))return;const u=h.inlineEdit;let f=Is.fromEdit(u.edit),g=u.edit.apply(u.originalText),m=tk(f,u.originalText,new kh(g)),_=this.determineRenderState(h,d,m,new kh(g));if(!_){h.abort(`unable to determine view: tried to render ${this._previousView?.view}`);return}if(_.kind===xt.SideBySide){const C=bDe(g,u.modifiedLineRange,l.getOptions().tabSize);g=C.applyToString(g),f=gDe(f,C),m=tk(f,u.originalText,new kh(g))}return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()),this._previewTextModel.getValue()!==g&&this._previewTextModel.setValue(g),h.showCollapsed.read(d)&&!this._indicator.read(d)?.isHoverVisible.read(d)&&(_={kind:xt.Collapsed,viewData:_.viewData}),h.handleInlineEditShown(_.kind,_.viewData),{state:_,diff:m,edit:u,newText:g,newTextLineCount:u.modifiedLineRange.length,isInDiffEditor:h.isInDiffEditor}}),this._previewTextModel=this._register(this._instantiationService.createInstance(Jf,"",this._editor.getModel().getLanguageId(),{...Jf.DEFAULT_CREATION_OPTIONS,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},null)),this._indicatorCyclicD
.monaco-editor .ghost-text-decoration,
.monaco-editor .ghost-text-decoration-preview,
.monaco-editor .ghost-text {
font-family: ${this._fontFamily.read(s)};
}`))),this._register(new O4(this._editor,this._model,this._instantiationService))}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.get().ownsViewZone(e)??!1}};U3=iEe([nEe(3,ge)],U3);var sEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Md=function(o,e){return function(t,i){e(t,i,o)}},Xa;let Ms=(qd=class extends A{static getInFocusedEditorOrParent(e){const t=YG(e);return t?Xa.get(t):null}static get(e){return eke(e.getContribution(Xa.ID))}constructor(e,t,i,n,s,r,a,l,c,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=s,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this._accessibilityService=d,this._editorObs=ni(this.editor),this._positions=j(this,g=>this._editorObs.selections.read(g)?.map(m=>m.getEndPosition())??[new M(1,1)]),this._suggestWidgetAdapter=this._register(new zIe(this._editorObs,g=>this.model.get()?.handleSuggestAccepted(g),()=>this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit())),this._enabledInConfig=rt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).enabled),this._isScreenReaderEnabled=rt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=rt(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=j(this,g=>this._enabledInConfig.read(g)&&(!this._isScreenReaderEnabled.read(g)||!this._editorDictationInProgress.read(g))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._focusIsInMenu=Le(this,!1),this._focusIsInEditorOrMenu=j(this,g=>{const m=this._editorObs.isFocused.read(g),_=this._focusIsInMenu.read(g);return m||_}),this._cursorIsInIndentation=j(this,g=>{const m=this._editorObs.cursorPosition.read(g);if(m===null)return!1;const _=this._editorObs.model.read(g);if(!_)return!1;this._editorObs.versionId.read(g);const b=_.getLineIndentColumn(m.lineNumber);return m.column<=b}),this.model=mr(this,g=>{if(this._editorObs.isReadonly.read(g))return;const m=this._editorObs.model.read(g);return m?this._instantiationService.createInstance(KF,m,this._suggestWidgetAdapter.selectedItem,this._editorObs.versionId,this._positions,this._debounceValue,this._enabled,this.editor):void 0}).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=_r(this),this._hideInlineEditOnSelectionChange=this._editorObs.getOption(71).map(g=>!0),this._view=this._register(this._instantiationService.createInstance(U3,this.editor,this.model,this._focusIsInMenu)),Xa._instances.add(this),this._register(ue(()=>Xa._instances.delete(this))),this._register(Se(g=>{const m=this.model.read(g);if(!m)return;const _=m.state.read(g);if(!_||!this._focusIsInEditorOrMenu.read(void 0))return;const b=_.kind==="inlineEdit"?_.nextEditUri:void 0;for(const C of Xa._instances)C!==this&&(b&&ch(b,C.editor.getModel()?.uri)?C.model.read(void 0)?.trigger():C.reject())})),this._register(Se(g=>{const m=this.model.read(g),_=this.editor.getModel()?.uri;!m||!_||g.store.add(m.onDidAccept(()=>{for(const b of Xa._instances){if(b===this)continue;const C=b.model.read(void 0)?.state.read(void 0);C?.kind==="inlineEdit"&&ch(C.nextEditUri,_)&&b.model.read(void 0)?.stop("automatic")}}))})),this._register(Sa(this._editorObs.onDidType,(g,m)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(Sa(this._editorObs.onDidPaste,(g,m)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(this._commandService.onDidExecuteCommand(g=>{if(new Set([Jm.Tab.id,Jm.D
`),c=`${r.documentValue}
// <json>
${l}
// </json>
`;return await i.writeText(c),{reproCase:c}}}var fEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},T0=function(o,e){return function(t,i){e(t,i,o)}};class gEe{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let G3=class{constructor(e,t,i,n,s,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=s,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Ms.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new Mw(1e3,this,k.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}if(i.type===7&&t.shouldShowHoverAt(i.range))return new Mw(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range))return new Mw(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===9&&i.element){const n=v0.getWarningWidgetContext(i.element);if(n&&t.shouldShowHoverAt(n.range))return new Mw(1e3,this,n.range,e.event.posx,e.event.posy,!1)}return null}computeSync(e,t){if(this._editor.getOption(71).showToolbar!=="onHover")return[];const i=Ms.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new gEe(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new U,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(12)&&i.add(this.renderScreenReaderText(e,n));const s=n.controller.model.get(),r=document.createElement("div");e.fragment.appendChild(r),i.add(Bn((l,c)=>{const d=c.add(this._instantiationService.createInstance(hb.hot.read(l),this._editor,!1,Et(null),s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.activeCommands,s.warning,()=>{e.onContentsChanged()}));r.replaceChildren(d.getDomNode())})),s.triggerExplicitly();const a={hoverPart:n,hoverElement:r,dispose(){i.dispose()}};return new Mg([a])}renderScreenReaderText(e,t){const i=new U,n=Q,s=n("div.hover-row.markdown-hover"),r=Z(s,n("div.hover-contents",{"aria-live":"assertive"})),a=new fd({editor:this._editor},this._languageService,this._openerService),l=c=>{const d=p(1197,"Suggestion:"),h=i.add(a.render(new qn().appendText(d).appendCodeblock("text",c),{asyncRenderCallback:()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}}));r.replaceChildren(h.element)};return i.add(Se(c=>{const d=t.controller.model.read(c)?.primaryGhostText.read(c);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(h))}else Yi(r)})),e.fragment.appendChild(s),i}};G3=fEe([T0(1,Mt),T0(2,Js),T0(3,bn),T0(4,ge),T0(5,Vn)],G3);class pEe{}Qe(Ms.ID,tke(Ms.hot),3),ne(oEe),ne(rEe),re(new aEe),ne($3),ne(j3),ne(lEe),ne(cEe),ne(dEe),ne(q3),ne(DD),ne(hEe),mt(K3),ne(uEe),mt($F),mt(jF),Pg.register(G3),YI.register(new pEe);var mEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Z3=function(o,e){return function(t,i){e(t,i,o)}},R0;let M0=(Wu=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new U,this.toUnhookForKeyboard=new U,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new tI(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseM
`))});break;case"saveTextureAtlas":i.invokeFunction(async r=>{const a=r.get(pd),l=r.get(yX),c=a.getWorkspace().folders;if(c.length>0){const d=ls.atlas,h=[];for(const[u,f]of d.pages.entries())h.push(l.writeFile(be.joinPath(c[0].uri,`textureAtlasPage${u}_actual.png`),sh.wrap(new Uint8Array(await(await f.source.convertToBlob()).arrayBuffer()))),l.writeFile(be.joinPath(c[0].uri,`textureAtlasPage${u}_usage.png`),sh.wrap(new Uint8Array(await(await f.getUsagePreview()).arrayBuffer()))));await Promise.all(h)}});break;case"drawGlyph":i.invokeFunction(async r=>{const a=r.get(Me),l=r.get(yX),c=r.get(Zn),h=r.get(pd).getWorkspace().folders;if(h.length===0)return;const u=ls.atlas,f=a.getValue("editor.fontFamily"),g=a.getValue("editor.fontSize"),m=new gv(g,f,ft().devicePixelRatio,ls.decorationStyleCache);let _=await c.input({prompt:"Enter a character to draw (prefix with 0x for code point))"});if(!_)return;const b=_.match(/0x(?<codePoint>[0-9a-f]+)/i)?.groups?.codePoint;b!==void 0&&(_=String.fromCodePoint(parseInt(b,16)));const C=0,v=u.getGlyph(m,_,C,0,0);if(!v)return;const S=u.pages[v.pageIndex].source.getContext("2d")?.getImageData(v.x,v.y,v.w,v.h);if(!S)return;const L=new OffscreenCanvas(S.width,S.height);Vf(L.getContext("2d")).putImageData(S,0,0);const I=await L.convertToBlob({type:"image/png"}),D=be.joinPath(h[0].uri,`glyph_${_}_${C}_${g}px_${f.replaceAll(/[,\\\/\.'\s]/g,"_")}.png`);await l.writeFile(D,sh.wrap(new Uint8Array(await I.arrayBuffer())))});break}}}ne(IEe);var Qa;(function(o){o.NoAutoFocus="noAutoFocus",o.FocusIfVisible="focusIfVisible",o.AutoFocusImmediately="autoFocusImmediately"})(Qa||(Qa={}));class DEe extends le{constructor(){super({id:xG,label:H(1102,"Show or Focus Hover"),metadata:{description:H(1103,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Qa.NoAutoFocus,Qa.FocusIfVisible,Qa.AutoFocusImmediately],enumDescriptions:[p(1099,"The hover will not automatically take focus."),p(1100,"The hover will take focus only if it is already visible."),p(1101,"The hover will automatically take focus when it appears.")],default:Qa.FocusIfVisible}}}}]},precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=Yn.get(t);if(!n)return;const s=i?.focus;let r=Qa.FocusIfVisible;Object.values(Qa).includes(s)?r=s:typeof s=="boolean"&&s&&(r=Qa.AutoFocusImmediately);const a=c=>{const d=t.getPosition(),h=new k(d.lineNumber,d.column,d.lineNumber,d.column);n.showContentHover(h,1,2,c)},l=t.getOption(2)===2;n.isHoverVisible?r!==Qa.NoAutoFocus?n.focus():a(l):a(l||r===Qa.AutoFocusImmediately)}}class EEe extends le{constructor(){super({id:n0e,label:H(1104,"Show Definition Preview Hover"),precondition:void 0,metadata:{description:H(1105,"Show the definition preview hover in the editor.")}})}run(e,t){const i=Yn.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new k(n.lineNumber,n.column,n.lineNumber,n.column),r=M0.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,2,!0)})}}class NEe extends le{constructor(){super({id:s0e,label:H(1106,"Hide Hover"),alias:"Hide Content Hover",precondition:void 0})}run(e,t){Yn.get(t)?.hideContentHover()}}class TEe extends le{constructor(){super({id:o0e,label:H(1107,"Scroll Up Hover"),precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:16,weight:100},metadata:{description:H(1108,"Scroll up the editor hover.")}})}run(e,t){const i=Yn.get(t);i&&i.scrollUp()}}class REe extends le{constructor(){super({id:r0e,label:H(1109,"Scroll Down Hover"),precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:18,weight:100},metadata:{description:H(1110,"Scroll down the editor hover.")}})}run(e,t){const i=Yn.get(t);i&&i.scrollDown()}}class MEe extends le{constructor(){super({id:a0e,label:H(1111,"Scroll Left Hover"),precondition:T.hoverF
`);s===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new k(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
`):this._isCopyingDown?t.addEditOperation(new k(i.startLineNumber,1,i.startLineNumber,1),s+`
`):t.addEditOperation(new k(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),`
`+s),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let n=i.startLineNumber,s=i.startColumn,r=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,s=1),this._endLineNumberDelta!==0&&(r=r+this._endLineNumberDelta,a=1),i=ce.createWithDirection(n,s,r,a,this._selectionDirection)}return i}}var pNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mNe=function(o,e){return function(t,i){e(t,i,o)}};let p7=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),n=(h,u)=>e.getLanguageIdAtPosition(h,u),s=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===s){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumber<r.endLineNumber&&r.endColumn===1&&(this._moveEndPositionDown=!0,r=r.setEndPosition(r.endLineNumber-1,e.getLineMaxColumn(r.endLineNumber-1)));const{tabSize:a,indentSize:l,insertSpaces:c}=e.getOptions(),d=this.buildIndentConverter(a,l,c);if(r.startLineNumber===r.endLineNumber&&e.getLineMaxColumn(r.startLineNumber)===1){const h=r.startLineNumber,u=this._isMovingDown?h+1:h-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new k(1,1,1,1),null):(t.addEditOperation(new k(h,1,h,1),e.getLineContent(u)),t.addEditOperation(new k(u,1,u,e.getLineMaxColumn(u)),null)),r=new ce(u,1,u,1)}else{let h,u;if(this._isMovingDown){h=r.endLineNumber+1,u=e.getLineContent(h),t.addEditOperation(new k(h-1,e.getLineMaxColumn(h-1),h,e.getLineMaxColumn(h)),null);let f=u;if(this.shouldAutoIndent(e,r)){const g=this.matchEnterRule(e,d,a,h,r.startLineNumber-1);if(g!==null){const _=It(e.getLineContent(h)),b=g+xo(_,a);f=O0(b,a,c)+this.trimStart(u)}else{const _={tokenization:{getLineTokens:C=>C===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(C),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:C=>C===r.startLineNumber?e.getLineContent(h):e.getLineContent(C)},b=P1(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(b!==null){const C=It(e.getLineContent(h)),w=xo(b,a),v=xo(C,a);w!==v&&(f=O0(w,a,c)+this.trimStart(u))}}t.addEditOperation(new k(r.startLineNumber,1,r.startLineNumber,1),f+`
`);const m=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,f);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,m);else{const _={tokenization:{getLineTokens:C=>C===r.startLineNumber?e.tokenization.getLineTokens(h):C>=r.startLineNumber+1&&C<=r.endLineNumber+1?e.tokenization.getLineTokens(C-1):e.tokenization.getLineTokens(C),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:C=>C===r.startLineNumber?f:C>=r.startLineNumber+1&&C<=r.endLineNumber+1?e.getLineContent(C-1):e.getLineContent(C)},b=P1(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(b!==null){const C=It(e.getLineContent(r.startLineNumber)),w=xo(b,a),v=xo(C,a);if(w!==v){const S=w-v;this.getIndentEditsOfMovingBlock(e,t,r,a,c,S)}}}}else t.addEditOperation(new k(r.startLineNumber,1,r.startLineNumber,1),f+`
`)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new k(h,1,h+1,1),null),t.addEditOperation(new k(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),`
`+u),this.shouldAutoIndent(e,r)){const f={tokenization:{getLineTokens:m=>m===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(m),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:m=>m===h?e.getLineContent(r.startLineNumber):e.getLineContent(m)},g=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,g);else{const m=P1(this._autoIndent,f,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(m!==null){const _=It(e.getLineContent(r.startLineNumber)),b=xo(m,a),C=xo(_,a);if(b!==C){const w=b-C;this.getIndentEditsOfMovingBlock(e,t,r,a,c,w)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:n=>Lr.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>Lr.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let r=s.indentation;s.indentAction===Ai.None||s.indentAction===Ai.Indent?r=s.indentation+s.appendText:s.indentAction===Ai.IndentOutdent?r=s.indentation:s.indentAction===Ai.Outdent&&(r=t.unshiftIndent(s.indentation)+s.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=It(e.getLineContent(n));let c=It(r);const d=mV(e,n,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const h=xo(c,i),u=xo(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,s,r){if(Kr(r)>=0){const a=e.getLineMaxColumn(s),l=Ym(this._autoIndent,e,new k(s,a,s,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(Kr(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Ym(this._autoIndent,e,new k(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}}matchEnterRule(e,t,i,n,s,r){let a=s;for(;a>=1;){let d;if(a===s&&r!==void 0?d=r:d=e.getLineContent(a),Kr(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Ym(this._autoIndent,e,new k(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,n,s,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=It(l),h=xo(c,n)+r,u=O0(h,n,s);u!==c&&(t.addEditOperation(new k(a,1,a,c.length+1),u),a===i.endLineNumber&&i.endColumn<=c.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};p7=pNe([mNe(3,Jt)],p7);const hB=class hB{constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=_Ne(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;const n=mQ(e,t,i);if(!n)return!1;for(let s=0,r=n.before.length;s<r;s++)if(n.before[s]!==n.after[s])return!0;return!1}};hB._COLLATOR=Sf.Collator();let F0=hB;function mQ(o,e,t){const i=e.startLineNumber;let n=e.endLineNumber;if(e.endColumn===1&&n--,i>=n)return null;const s=[];for(let a=i;a<=n;a++)s.push(o.getLineContent(a));let r=s.slice(0);return r.sort(F0._COLLATOR.value.compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:s,after:r}}function _Ne(o,e,t){const i=mQ(o,e,t);return i?fi.replace(new k(i.startLineNumber,1,i.endLineNumber,o.getLineMaxColumn(i.endLineNumber)),i.after.join(`
`)):null}class _Q extends le{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>k.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;r<i.length;r++){const a=i[r];n.selection.endLineNumber===a.selection.startLineNumber&&(n.index<a.index?a.ignore=!0:(n.ignore=!0,n=a))}const s=[];for(const r of i)s.push(new pQ(r.selection,this.down,r.ignore));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class bNe extends _Q{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:H(1239,"Copy Line Up"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:de.MenubarSelectionMenu,group:"2_line",title:p(1234,"&&Copy Line Up"),order:1}})}}class CNe extends _Q{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:H(1240,"Copy Line Down"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:de.MenubarSelectionMenu,group:"2_line",title:p(1235,"Co&&py Line Down"),order:2}})}}class vNe extends le{constructor(){super({id:"editor.action.duplicateSelection",label:H(1241,"Duplicate Selection"),precondition:T.writable,menuOpts:{menuId:de.MenubarSelectionMenu,group:"2_line",title:p(1236,"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],s=t.getSelections(),r=t.getModel();for(const a of s)if(a.isEmpty())n.push(new pQ(a,!0));else{const l=new ce(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new goe(l,r.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class bQ extends le{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(Jt),n=[],s=t.getSelections()||[],r=t.getOption(16);for(const a of s)n.push(new p7(a,this.down,r,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class wNe extends bQ{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:H(1242,"Move Line Up"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:de.MenubarSelectionMenu,group:"2_line",title:p(1237,"Mo&&ve Line Up"),order:3}})}}class SNe extends bQ{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:H(1243,"Move Line Down"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:de.MenubarSelectionMenu,group:"2_line",title:p(1238,"Move &&Line Down"),order:4}})}}class CQ extends le{constructor(e,t){super(t),this.descending=e}run(e,t){if(!t.hasModel())return;const i=t.getModel();let n=t.getSelections();n.length===1&&n[0].isEmpty()&&(n=[new ce(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);for(const r of n)if(!F0.canRun(t.getModel(),r,this.descending))return;const s=[];for(let r=0,a=n.length;r<a;r++)s[r]=new F0(n[r],this.descending);t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class yNe extends CQ{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:H(1244,"Sort Lines Ascending"),precondition:T.writable})}}class LNe extends CQ{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:H(1245,"Sort Lines Descending"),precondition:T.writable})}}class xNe extends le{constructor(){super({id:"editor.action.removeDuplicateLines",label:H(1246,"Delete Duplicate Lines"),precondition:T.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;const n=[],s=[];let r=0,a=!0,l=t.getSelections();l.length===1&&l[0].isEmpty()&&(l=[new ce(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))],a=!1);for(const c of l){const d=new Set,h=[];for(let m=c.startLineNumber;m<=c.endLineNumber;m++){const _=i.getLineContent(m);d.has(_)||(h.push(_),d.add(_))}const u=new ce(c.startLineNumber,1,c.endLineNumber,i.getLineMaxColumn(c.endLineNumber)),f=c.startLineNumber-r,g=new ce(f,1,f+h.length-1,h[h.length-1].length);n.push(fi.replace(u,h.
`))),s.push(g),r+=c.endLineNumber-c.startLineNumber+1-h.length}t.pushUndoStop(),t.executeEdits(this.id,n,a?s:void 0),t.pushUndoStop()}}class kNe extends le{constructor(){super({id:"editor.action.reverseLines",label:H(1247,"Reverse lines"),precondition:T.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections();let s=n;s.length===1&&s[0].isEmpty()&&(s=[new ce(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);const r=[],a=[];for(let l=0;l<s.length;l++){const c=s[l],d=n[l];let h=c.endLineNumber;c.startLineNumber<c.endLineNumber&&c.endColumn===1&&h--;let u=new k(c.startLineNumber,1,h,i.getLineMaxColumn(h));h===i.getLineCount()&&i.getLineContent(u.endLineNumber)===""&&(u=u.setEndPosition(u.endLineNumber-1,i.getLineMaxColumn(u.endLineNumber-1)));const f=[];for(let b=u.endLineNumber;b>=u.startLineNumber;b--)f.push(i.getLineContent(b));const g=fi.replace(u,f.join(`
`));r.push(g);const m=function(b){return b<=u.endLineNumber?u.endLineNumber-b+u.startLineNumber:b},_=function(b){if(b.isEmpty())return new ce(m(b.positionLineNumber),b.positionColumn,m(b.positionLineNumber),b.positionColumn);{const C=m(b.selectionStartLineNumber),w=m(b.positionLineNumber),v=b.selectionStartColumn,S=b.positionColumn;return new ce(C,v,w,S)}};a.push(_(d))}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}}const rT=class rT extends le{constructor(){super({id:rT.ID,label:H(1248,"Trim Trailing Whitespace"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:Ei(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(d=>new M(d.positionLineNumber,d.positionColumn)));const s=t.getSelection();if(s===null)return;const r=e.get(Me),a=t.getModel(),l=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),c=new fNe(s,n,l);t.pushUndoStop(),t.executeCommands(this.id,[c]),t.pushUndoStop()}};rT.ID="editor.action.trimTrailingWhitespace";let m7=rT;class INe extends le{constructor(){super({id:"editor.action.deleteLines",label:H(1249,"Delete Line"),precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s=0;const r=[],a=[];for(let l=0,c=i.length;l<c;l++){const d=i[l];let h=d.startLineNumber,u=d.endLineNumber,f=1,g=n.getLineMaxColumn(u);u<n.getLineCount()?(u+=1,g=1):h>1&&(h-=1,f=n.getLineMaxColumn(h)),r.push(fi.replace(new ce(h,f,u,g),"")),a.push(new ce(h-s,d.positionColumn,h-s,d.positionColumn)),s+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(s=>{let r=s.endLineNumber;return s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(r-=1),{startLineNumber:s.startLineNumber,selectionStartColumn:s.selectionStartColumn,endLineNumber:r,positionColumn:s.positionColumn}});t.sort((s,r)=>s.startLineNumber===r.startLineNumber?s.endLineNumber-r.endLineNumber:s.startLineNumber-r.startLineNumber);const i=[];let n=t[0];for(let s=1;s<t.length;s++)n.endLineNumber+1>=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}class DNe extends le{constructor(){super({id:"editor.action.indentLines",label:H(1250,"Indent Line"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,gh.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class ENe extends le{constructor(){super({id:"editor.action.outdentLines",label:H(1251,"Outdent Line"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2140,weight:100}})}run(e,t){Jm.Outdent.runEditorCommand(e,t,null)}}class NNe extends le{constructor(){super({id:"editor.action.insertLineBefore",label:H(1252,"Insert Line Above"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,lL.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class TNe extends le{constructor(){super({id:"editor.action.insertLineAfter",label:H(1253,"Insert Line Below"),precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,lL.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class vQ extends le{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let l=0,c=n.length-1;l<c;l++){const d=n[l],h=n[l+1];k.intersectRanges(d,h)===null?s.push(d):n[l+1]=k.plusRange(d,h)}s.push(n[n.length-1]);const r=this._getEndCursorState(i,s),a=s.map(l=>fi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class RNe extends vQ{constructor(){super({id:"deleteAllLeft",label:H
`);return new V0(e,t,n,c,s,r,d)}constructor(e,t,i,n,s,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new qD(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new qD(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new ce(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new qD(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new qD(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new ce(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}}const lT=class lT extends A{static get(e){return e.getContribution(lT.ID)}constructor(e){super(),this._sessionDispose=this._register(new U),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=V0.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.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,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new ce(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_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 t=this._editor.getSelections();if(t.length>
`):void 0}:{range:k.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(`
`)};const r=await s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(p(1365,"No result.")),n);return r}}async function OTe(o,e,t,i){const n=new E7(e,t,o),s=await n.resolveRenameLocation(He.None);return s?.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,He.None)}let hu=(fm=class{static get(e){return e.getContribution(D7.ID)}constructor(e,t,i,n,s,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new U,this._cts=new Xt,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(k7,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Xt,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new E7(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new ud(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const g=i.resolveRenameLocation(n.token);this._progressService.showWhile(g,250),s=await g,e("resolved rename location")}catch(g){g instanceof cr?e("resolve rename location cancelled",JSON.stringify(g,null," ")):(e("resolve rename location failed",g instanceof Error?g:JSON.stringify(g,null," ")),(typeof g=="string"||Rl(g))&&So.get(this.editor)?.showMessage(g||p(1366,"An unknown error occurred while resolving rename location"),t));return}finally{n.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),So.get(this.editor)?.showMessage(s.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new ud(this.editor,5,s.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async g=>[g,await g.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(g,m)=>{let _=c.slice();return g===lv.Automatic&&(_=_.filter(([b,C])=>C)),_.map(([b])=>b.provideNewSymbolNames(a,s.range,g,m))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(s.range,s.text,h,l.length>0?d:void 0,r);if(e("received response from rename input field"),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const f=Em(i.provideRenameEdits(u.newName,r.token),r.token).then(async g=>{if(!g){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(g.rejectReason){e(`returning early - rejected with reason: ${g.rejectReason}`),this._notificationService.info(g.rejectReason);return}this.editor.setSelection(k.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(g,{editor:this.editor,showPreview:u.wantsPreview,label:p(1367,"Renaming '{0}' to '{1}'",s?.text,u.newName),code:"undoredo.rename",quotableLabel:p(1368,"Renaming {0} to {1}",s?.text,u.newName),respectAutoSaveConfig:!0,reason:jn.rename()}).then(m=>{e("edits applied"),m.ariaSummary&&ps(p(1369,"Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,u.newName,m.ariaSummary))}).catch(m=>{e(`error when applying edits ${JSON.stringify(m,null," ")}`),this._notificationService.error(p(1370,"Rename failed to apply edits")),this._logService.error(m)})},g=>{e("error when providing rename edi
`||o===" "}var gRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jQ=function(o,e){return function(t,i){e(t,i,o)}};let j7=class extends A{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,t,i={},n,s){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Z(e,Q("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Zs("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new gt(this.el,"click")),a=this._register(new gt(this.el,"keypress")),l=ie.chain(a.event,h=>h.map(u=>new St(u)).filter(u=>u.keyCode===3)),c=this._register(new gt(this.el,Pt.Tap)).event;this._register($n.addTarget(this.el));const d=ie.any(r.event,l,c);this._register(d(h=>{this.enabled&&(st.stop(h,!0),i?.opener?i.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};j7=gRe([jQ(3,Qs),jQ(4,Js)],j7);var qQ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},KQ=function(o,e){return function(t,i){e(t,i,o)}};const pRe=26;let q7=class extends A{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(K7))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,pRe)}};q7=qQ([KQ(1,ge)],q7);let K7=class extends A{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(fd,{}),this.element=Q("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 t=Q("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){pn(this.element)}show(e){pn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Z(this.element,Q("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(Q(`div${ve.asCSSSelector(e.icon)}`));const n=Z(this.element,Q("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Z(this.element,Q("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(j7,this.messageActionsContainer,{...r,tabIndex:-1},{}));const s=Z(this.element,Q("div.action-container"));this.actionBar=this._register(new Ys(s)),this.actionBar.push(this._register(new Mo("banner.close",p(1518,"Close Banner"),ve.asClassName(kq),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};K7=qQ([KQ(0,ge)],K7);const GQ=We("workspaceTrustManagementService");var G7=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.
`)}const sMe={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:{[xi]:"#FFFFFE",[bl]:"#000000",[zV]:"#E5EBF1",[tv]:"#D3D3D3",[iv]:"#939393",[iM]:"#ADD6FF4D"}},oMe={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:{[xi]:"#1E1E1E",[bl]:"#D4D4D4",
`)}}}class TJ{getIcon(e){const t=Sq();let i=e.defaults;for(;ve.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const Pd="vs",Qb="vs-dark",ap="hc-black",lp="hc-light",RJ=ei.as(MV.ColorContribution),cMe=ei.as(Nz.ThemingContribution);class MJ{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(CE(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),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 t in this.themeData.colors)e.set(t,$.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=M9(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,$.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=RJ.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Pd:return Er.LIGHT;case ap:return Er.HIGH_CONTRAST_DARK;case lp:return Er.HIGH_CONTRAST_LIGHT;default:return Er.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=M9(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const s={token:""};i&&(s.foreground=i),n&&(s.background=n),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=NJ.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=zn.getForeground(s),a=zn.getFontStyle(s);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}get tokenColorMap(){return[]}}function CE(o){return o===Pd||o===Qb||o===ap||o===lp}function M9(o){switch(o){case Pd:return sMe;case Qb:return oMe;case ap:return rMe;case lp:return aMe}}function vE(o){const e=M9(o);return new MJ(o,e)}class dMe extends A{constructor(){super(),this._onColorThemeChange=this._register(new P),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new P),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new TJ,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Pd,vE(Pd)),this._knownThemes.set(Qb,vE(Qb)),this._knownThemes.set(ap,vE(ap)),this._knownThemes.set(lp,vE(lp));const e=this._register(lMe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Pd),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),EB(bt,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return ky(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Ir(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),A.None}_registerShadowDomContainer(e){const t=Ir(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!CE(t.base)&&!CE(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new MJ(e,t)),CE(e)&&this._knownThemes.forEach(i=>{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Pd),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=bt.matchMedia("(forced-colors: active)").matches;if(e!==Ta(this._theme.type)){let t;Rf(this._theme.type)?t=e?ap:Qb:t=e?lp:Pd,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};cMe.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of RJ.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${eM(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(`
`)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(nMe(s)),i.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"),this._themeCSS=e.join(`
`),this._updateCSS(),di.setColorMap(s),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}}class hMe extends le{constructor(){super({id:"editor.action.toggleHighContrast",label:f9.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(ir),n=i.getColorTheme();Ta(n.type)?(i.setTheme(this._originalThemeName||(Rf(n.type)?Qb:Pd)),this._originalThemeName=null):(i.setTheme(Rf(n.type)?ap:lp),this._originalThemeName=n.themeName)}}ne(hMe);var P9;(function(o){o[o.Unknown=0]="Unknown",o[o.Disabled=1]="Disabled",o[o.Enabled=2]="Enabled"})(P9||(P9={}));var A9;(function(o){o[o.Invoke=1]="Invoke",o[o.Auto=2]="Auto"})(A9||(A9={}));var O9;(function(o){o[o.None=0]="None",o[o.KeepWhitespace=1]="KeepWhitespace",o[o.InsertAsSnippet=4]="InsertAsSnippet"})(O9||(O9={}));var F9;(function(o){o[o.Method=0]="Method",o[o.Function=1]="Function",o[o.Constructor=2]="Constructor",o[o.Field=3]="Field",o[o.Variable=4]="Variable",o[o.Class=5]="Class",o[o.Struct=6]="Struct",o[o.Interface=7]="Interface",o[o.Module=8]="Module",o[o.Property=9]="Property",o[o.Event=10]="Event",o[o.Operator=11]="Operator",o[o.Unit=12]="Unit",o[o.Value=13]="Value",o[o.Constant=14]="Constant",o[o.Enum=15]="Enum",o[o.EnumMember=16]="EnumMember",o[o.Keyword=17]="Keyword",o[o.Text=18]="Text",o[o.Color=19]="Color",o[o.File=20]="File",o[o.Reference=21]="Reference",o[o.Customcolor=22]="Customcolor",o[o.Folder=23]="Folder",o[o.TypeParameter=24]="TypeParameter",o[o.User=25]="User",o[o.Issue=26]="Issue",o[o.Tool=27]="Tool",o[o.Snippet=28]="Snippet"})(F9||(F9={}));var W9;(function(o){o[o.Deprecated=1]="Deprecated"})(W9||(W9={}));var B9;(function(o){o[o.Invoke=0]="Invoke",o[o.TriggerCharacter=1]="TriggerCharacter",o[o.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(B9||(B9={}));var H9;(function(o){o[o.EXACT=0]="EXACT",o[o.ABOVE=1]="ABOVE",o[o.BELOW=2]="BELOW"})(H9||(H9={}));var V9;(function(o){o[o.NotSet=0]="NotSet",o[o.ContentFlush=1]="ContentFlush",o[o.RecoverFromMarkers=2]="RecoverFromMarkers",o[o.Explicit=3]="Explicit",o[o.Paste=4]="Paste",o[o.Undo=5]="Undo",o[o.Redo=6]="Redo"})(V9||(V9={}));var z9;(function(o){o[o.LF=1]="LF",o[o.CRLF=2]="CRLF"})(z9||(z9={}));var U9;(function(o){o[o.Text=0]="Text",o[o.Read=1]="Read",o[o.Write=2]="Write"})(U9||(U9={}));var $9;(function(o){o[o.None=0]="None",o[o.Keep=1]="Keep",o[o.Brackets=2]="Brackets",o[o.Advanced=3]="Advanced",o[o.Full=4]="Full"})($9||($9={}));var j9;(function(o){o[o.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",o[o.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",o[o.accessibilitySupport=2]="accessibilitySupport",o[o.accessibilityPageSize=3]="accessibilityPageSize",o[o.allowOverflow=4]="allowOverflow",o[o.allowVariableLineHeights=5]="allowVariableLineHeights",o[o.allowVariableFonts=6]="allowVariableFonts",o[o.allowVariableFontsInAccessibilityMode=7]="allowVariableFontsInAccessibilityMode",o[o.ariaLabel=8]="ariaLabel",o[o.ariaRequired=9]="ariaRequired",o[o.autoClosingBrackets=10]="autoClosingBrackets",o[o.autoClosingComments=11]="autoClosingComments",o[o.screenReaderAnnounceInlineSuggestion=12]="screenReaderAnnounceInlineSuggestion",o[o.autoClosingDelete=13]="autoClosingDelete",o[o.autoClosingOvertype=14]="autoClosingOvertype",o[o.autoClosingQuotes=15]="autoClosingQuotes",o[o.autoIndent=16]="autoIndent",o[o.autoIndentOnPaste=17]="autoIndentOnPaste",o[o.autoIndentOnPasteWithinString=18]="autoIndentOnPasteWithinString",o[o.automaticLayout=19]="automaticLayout",o[o.autoSurround=20]="autoSurround",o[o.bracketPairColorization=21]="bracketPairColorization",o[o.guides=22]="guides",o[o.codeLens=23]="codeLens",o[o.codeLensFontFamily=24]="codeLensFontFamily",o[o.codeLensFontSize=25]="codeLensFontSize",o[o.colorDecorators=26]="colorDecorators",o[o.colorDecoratorsLimit=27]="colorDecoratorsLimit",o[o.columnSelection=28]="columnSelection",o[o.comments=29]="comments",o[o.contextmenu=30]="contextmen
`);s.lastIndex=0;let d;for(;(d=s.exec(c))!==null;){const h=c.substring(0,d.index),u=(h.match(/\n/g)||[]).length,f=r+u,g=d[0].split(`
`),m=g.length,_=f+m-1,b=h.lastIndexOf(`
`)+1,C=d.index-b+1,w=g[g.length-1],v=m===1?C+d[0].length:w.length+1,S={startLineNumber:f,startColumn:C,endLineNumber:_,endColumn:v},L=(d.groups??{}).label??"",x=((d.groups??{}).separator??"")!=="",I={range:S,text:L,hasSeparatorLine:x,shouldBeInComments:!0};(I.text||I.hasSeparatorLine)&&(t.length===0||t[t.length-1].range.endLineNumber<I.range.startLineNumber)&&t.push(I),s.lastIndex=d.index+d[0].length}}return t}function BMe(o){o=o.trim();const e=o.startsWith("-");return o=o.replace(PMe,""),{text:o,hasSeparatorLine:e}}class HMe{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,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 t=e.changes;for(const i of t)this._acceptDeleteRange(i.range),this._acceptInsertText(new M(i.range.startLineNumber,i.range.startColumn),i.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n<t;n++)i[n]=this._lines[n].length+e;this._lineStarts=new sme(i)}}_setLineText(e,t){this._lines[e]=t,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,t){if(t.length===0)return;const i=ro(t);if(i.length===1){this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));return}i[i.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)+i[0]);const n=new Uint32Array(i.length-1);for(let s=1;s<i.length;s++)this._lines.splice(e.lineNumber+s-1,0,i[s]),n[s-1]=i[s].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}}const $J=60*1e3;class VMe extends A{constructor(e,t,i=!1){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const n=new uR;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round($J/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)pt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t=!1){for(const i of e){const n=i.toString();this._syncedModels[n]||this._beginModelSync(i,t),this._syncedModels[n]&&(this._syncedModelsLastUsedTime[n]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>$J&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.$acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const s=new U;s.add(i.onDidChangeContent(r=>{this._proxy.$acceptModelChanged(n.toString(),r)})),s.add(i.onWillDispose(()=>{this._stopModelSync(n)})),s.add(ue(()=>{this._proxy.$acceptRemovedModel(n)})),this._syncedModels[n]=s}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],pt(t)}}class zMe{const
`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,h=0,u=null,f=!0;for(;f||h<l;){const g=h,m=d.depth,_=u?u.groups.length:0,b=d.state;let C=null,w=null,v=null,S=null,L=null;if(u){C=u.matches;const D=u.groups.shift();w=D.matched,v=D.action,S=u.rule,u.groups.length===0&&(u=null)}else{if(!f&&h>=l)break;f=!1;let D=this._lexer.tokenizer[b];if(!D&&(D=yE(this._lexer,b),!D))throw Gt(this._lexer,"tokenizer state is not defined: "+b);const R=a.substr(h);for(const F of D)if((h===0||!F.matchOnlyAtLineStart)&&(C=R.match(F.resolveRegex(b)),C)){w=C[0],v=F.action;break}}if(C||(C=[""],w=""),v||(h<l&&(C=[a.charAt(h)],w=C[0]),v=this._lexer.defaultToken),w===null)break;for(h+=w.length;ZMe(v)&&KJ(v)&&v.test;)v=v.test(w,C,b,h===l);let x=null;if(typeof v=="string"||Array.isArray(v))x=v;else if(v.group)x=v.group;else if(v.token!==null&&v.token!==void 0){if(v.tokenSubst?x=_u(this._lexer,v.token,w,C,b):x=v.token,v.nextEmbedded)if(v.nextEmbedded==="@pop"){if(!c)throw Gt(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw Gt(this._lexer,"cannot enter embedded language from within an embedded language");L=_u(this._lexer,v.nextEmbedded,w,C,b)}if(v.goBack&&(h=Math.max(0,h-v.goBack)),v.switchTo&&typeof v.switchTo=="string"){let D=_u(this._lexer,v.switchTo,w,C,b);if(D[0]==="@"&&(D=D.substr(1)),yE(this._lexer,D))d=d.switchTo(D);else throw Gt(this._lexer,"trying to switch to a state '"+D+"' that is undefined in rule: "+this._safeRuleName(S))}else{if(v.transform&&typeof v.transform=="function")throw Gt(this._lexer,"action.transform not supported");if(v.next)if(v.next==="@push"){if(d.depth>=this._lexer.maxStack)throw Gt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(b)}else if(v.next==="@pop"){if(d.depth<=1)throw Gt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(v.next==="@popall")d=d.popall();else{let D=_u(this._lexer,v.next,w,C,b);if(D[0]==="@"&&(D=D.substr(1)),yE(this._lexer,D))d=d.push(D);else throw Gt(this._lexer,"trying to set a next state '"+D+"' that is undefined in rule: "+this._safeRuleName(S))}}v.log&&typeof v.log=="string"&&YMe(this._lexer,this._lexer.languageId+": "+_u(this._lexer,v.log,w,C,b))}if(x===null)throw Gt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const I=D=>{const R=this._languageService.getLanguageIdByLanguageName(D)||this._languageService.getLanguageIdByMimeType(D)||D,F=this._getNestedEmbeddedLanguageData(R);if(h<l){const O=e.substr(h);return this._nestedTokenize(O,t,bu.create(d,F),n+h,s)}else return bu.create(d,F)};if(Array.isArray(x)){if(u&&u.groups.length>0)throw Gt(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(C.length!==x.length+1)throw Gt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let D=0;for(let R=1;R<C.length;R++)D+=C[R].length;if(D!==w.length)throw Gt(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(S));u={rule:S,matches:C,groups:[]};for(let R=0;R<x.length;R++)u.groups[R]={action:x[R],matched:C[R+1]};h-=w.length;continue}else{if(x==="@rematch"&&(h-=w.length,w="",C=null,x="",L!==null))return I(L);if(w.length===0){if(l===0||m!==d.depth||b!==d.state||(u?u.groups.length:0)!==_)continue;throw Gt(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(S))}let D=null;if(qJ(x)&&x.indexOf("@brackets")===0){const R=x.substr(9),F=iPe(this._lexer,w);if(!F)throw Gt(this._lexer,"@brackets token returned but no bracket defined as: "+w);D=GJ(F.token+R)}else{const R=x===""?"":x+this._lexer.tokenPostfix;D=GJ(R)}g<r&&s.emit(g+n,D)}if(L!==null)return I(L)}return bu.create(d,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new tC(e,A_);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),di.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=di.get(e);return t?new tC(e,t.getInitialState()):new tC(e,A_)}};lS=W8=JMe([ePe(4,Me)],lS);function iP
`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class dPe{constructor(e,t,i,n,s,r,a){this.id=++tee,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new nee),this.removedResources.has(t)||this.removedResources.set(t,new iee(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new nee),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new iee(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class see{constructor(e,t){this.resourceLabel=e,this.strResource=t,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 t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(`
`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new S$(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const c=this._past[a];i&&(n>=t||c.id!==e.elements[n])&&(i=!1,s=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}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,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,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 z8{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const oee=new see("","");oee.locked=!0;let U8=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(`
`))}pushElement(e,t=YP.None,i=Xf.None){if(e.type===0){const n=IE(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new DE(e,n,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,s=[],r=[];for(const a of e.resources){const l=IE(a),c=this.getUriComparisonKey(a);n.has(c)||(n.add(c),s.push(l),r.push(c))}s.length===1?this._pushElement(new DE(e,s[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new dPe(e,s,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const n=e.resourceLabels[t],s=e.strResources[t];let r;this._editStacks.has(s)?r=this._editStacks.get(s):(r=new see(n,s),this._editStacks.set(s,r)),r.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const n=i.getClosestPastElement();return n?n.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const r=IE(s.resource),a=this.getUriComparisonKey(s.resource),l=new DE(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const r=IE(s.resource),a=this.getUriComparisonKey(s.resource),l=new DE(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitFutureWorkspaceElement(e,n)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new S$(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestPastElement();r&&r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof Xf){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){Ee(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,s){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),n.dispose(),s()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),s())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return A.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?A.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(A.None);const i=e.actual.prepareUndoRedo();return i?Xu(i)?t(i):i.then(n=>t(n)):t(A.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||oee);return new z8(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new EE(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(n),new EE}_checkWorkspaceUndo(e,t,i,n){if(t.removedResourc
: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, "Apple SD Gothic Neo", "Nanum Gothic", "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 _Pe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bPe=function(o,e){return function(t,i){e(t,i,o)}};let NE=class extends A{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new K8(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(me(t))?n=1:i?n=3:n=2:n=1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};NE=_Pe([bPe(0,Hl)],NE);class CPe extends NE{getContextViewElement(){return this.contextView.getViewElement()}}function cee(o){const e=o;return typeof e=="object"&&"markdown"in e&&"markdownNotSupportedFallback"in e}class vPe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(ji(e)||ai(e)||e===void 0)n=e;else{this._cancellationTokenSource=new Xt;const s=this._cancellationTokenSource.token;let r;if(cee(e)?Ku(e.markdown)?r=e.markdown(s).then(a=>a??e.markdownNotSupportedFallback):r=e.markdown??e.markdownNotSupportedFallback:r=e.element(s),r instanceof Promise?(this._hoverWidget||this.show(p(75,"Loading..."),t,i),n=await r):n=r,this.isDisposed||s.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const s={content:e,target:this.target,actions:i?.actions,linkHandler:i?.linkHandler,trapFocus:i?.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n,showHoverHint:i?.appearance?.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(s,t)}n?.dispose()}hasContent(e){return e?Rl(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}var wPe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nC=function(o,e){return function(t,i){e(t,i,o)}};let G8=class extends A{constructor(e,t,i,n,s,r){super(),this._instantiationService=e,this._configurationService=t,this._keybindingService=n,this._layoutService=s,this._accessibilityService=r,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(i.onDidShowContextMenu(()=>this.hideHover())),this._contextViewHandler=this._register(new NE(this._layoutService)),this._register(rn.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:199,when:T.editorTextFocus.negate(),primary:Ei(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(e,t,i,n){const s=this._createHover(e,i);if(s)return this._showHover(s,e,t),s}showDelayedHover(e,t){if(e.id===void 0&&(e.id=dee(e.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if(this._currentHover?.isLocked)return;if(vu(this._currentHoverOptions)===vu(e))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&this._currentDelayedHoverGroupId!==void 0&&this._currentDelayedHoverGroupId===t?.groupId)return this.showInstantHover({...e,appearance:{...e.appearance,skipFadeInAnimation:!0}})}else if(t
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=RE.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const s=n+i.length;if(s>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(s);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!fo(a,l)}return!0}}const ME={kind:0},IPe={kind:1};function DPe(o,e,t){return{kind:2,commandId:o,commandArgs:e,isBubble:t}}class hS{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const s=n.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=hS.handleRemovals([].concat(e).concat(t));for(let n=0,s=this._keybindings.length;n<s;n++){const r=this._keybindings[n];if(r.chords.length===0)continue;const a=r.when?.substituteConstants();a&&a.type===0||this._addKeyPress(r.chords[0],r)}}static _isTargetedForRemoval(e,t,i){if(t){for(let n=0;n<t.length;n++)if(t[n]!==e.chords[n])return!1}return!(i&&i.type!==1&&(!e.when||!Rse(i,e.when)))}static handleRemovals(e){const t=new Map;for(let n=0,s=e.length;n<s;n++){const r=e[n];if(r.command&&r.command.charAt(0)==="-"){const a=r.command.substring(1);t.has(a)?t.get(a).push(r):t.set(a,[r])}}if(t.size===0)return e;const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];if(!r.command||r.command.length===0){i.push(r);continue}if(r.command.charAt(0)==="-")continue;const a=t.get(r.command);if(!a||!r.isDefault){i.push(r);continue}let l=!1;for(const c of a){const d=c.when;if(this._isTargetedForRemoval(r,c.chords,d)){l=!0;break}}if(!l){i.push(r);continue}}return i}_addKeyPress(e,t){const i=this._map.get(e);if(typeof i>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const s=i[n];if(s.command===t.command)continue;let r=!0;for(let a=1;a<s.chords.length&&a<t.chords.length;a++)if(s.chords[a]!==t.chords[a]){r=!1;break}r&&hS.whenIsEntirelyIncluded(s.when,t.when)&&this._removeFromLookupMap(s)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);typeof t>"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i<n;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:h2(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t,i=!1){const n=this._lookupMap.get(e);if(typeof n>"u"||n.length===0)return null;if(n.length===1&&!i)return n[0];for(let s=n.length-1;s>=0;s--){const r=n[s];if(t.contextMatchesRules(r.when))return r}return i?null:n[n.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const s=this._map.get(n[0]);if(s===void 0)return this._log("\\ No keybinding entries."),ME;let r=null;if(n.length<2)r=s;else{r=[];for(let l=0,c=s.length;l<c;l++){const d=s[l];if(n.length>d.chords.length)continue;let h=!0;for(let u=1;u<n.length;u++)if(d.chords[u]!==n[u]){h=!1;break}h&&r.push(d)}}const a=this._findCommand(e,r);return a?n.length<a.chords.length?(this._log(`\\ From ${r.length} keybinding entries, awaiting ${a.chords.length-n.length} more chord(s), when: ${fee(a.when)}, source: ${gee(a)}.`),IPe):(this._log(`\\ From ${r.length} keybinding entries, matched ${a.command}, when: ${fee(a.when)}, source
.monaco-menu {
font-size: 13px;
border-radius: 5px;
min-width: 160px;
}
${yee(Y.menuSelection)}
${yee(Y.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 .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;
opacity: 0.7;
}
.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;
max-height: 100%;
}
.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){t+=`
/* 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;
}
/* Fix for https://github.com/microsoft/vscode/issues/103170 */
.monaco-menu .action-item .monaco-submenu {
z-index: 1;
}
`;const i=o.scrollbarShadow;i&&(t+=`
.monaco-scrollable-element > .shadow.top {
box-shadow: ${i} 0 6px 6px -6px inset;
}
.monaco-scrollable-element > .shadow.left {
box-shadow: ${i} 6px 0 6px -6px inset;
}
.monaco-scrollable-element > .shadow.top.left {
box-shadow: ${i} 6px 6px 6px -6px inset;
}
`);const n=o.scrollbarSliderBackground;n&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider {
background: ${n};
}
`);const s=o.scrollbarSliderHoverBackground;s&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: ${s};
}
`);const r=o.scrollbarSliderActiveBackground;r&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider.active {
background: ${r};
}
`)}return t}class VPe{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=Ui();let i;const n=ai(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,layer:e.layer,render:s=>{this.lastContainer=s;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(s.className+=" "+r),this.options.blockMouse&&(this.block=s.appendChild(Q(".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",this.blockDisposable?.dispose(),this.blockDisposable=W(this.block,te.MOUSE_DOWN,d=>d.stopPropagation()));const a=new U,l=e.actionRunner||a.add(new hf);l.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new rC(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},z1e),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=me(s);return a.add(W(c,te.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(W(c,te.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new yn(c,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===s)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),jr(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:s=>{e.onHide?.(!!s),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(Ui()===this.lastContainer||Zi(Ui(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Do(e.error)&&this.notificationService.error(e.error)}}var zPe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},aC=function(o,e){return function(t,i){e(t,i,o)}};let iW=class extends A{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new VPe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new P),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new P),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=nW.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),Pc.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};iW=zPe([aC(0,Vn),aC(1,hi),aC(2,hd),aC(3,ot),aC(4,Cr),aC(5,xe)],iW);var nW;(function(o){function e(i){return i&&i.menuId instanceof de}function t(i,n,s){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>
`?r=2:a===`
`&&(r=1);let l=Un.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=Un.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Un.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Un.bracketPairColorizationOptions;return e.editor?.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:s,detectIndentation:c,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:so===3||so===2?`
`:`\r
`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);s=lC._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;n<s;n++){const r=i[n],a=this._models[r],l=a.model.getLanguageId(),c=a.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:l,resource:c})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:l,resource:c}))continue;const d=t[l+c],h=this.getCreationOptions(l,c,a.model.isForSimpleWidget);lC._setModelOptionsForModel(a.model,h,d)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&fo(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions))&&(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(up(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(up(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(up(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),r=this._instantiationService.createInstance(Jf,e,t,s,i);if(i&&this._disposedModels.has(up(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===c.sha1:!1;if(u||c.sharesUndoRedoStack){for(const f of d.past)Zc(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)Zc(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>Zc(f)&&f.matchesResource(i)),u&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=up(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new qPe(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,n=!1){let s;return t?s=this._createModelData(e,t,i,n):s=this._createModelData(e,Fo,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const s=t[i];e.push(this._models[s].model)}return e}getModel(e){const t=up(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===we.file||e.scheme===we.vscodeRemote||e.scheme===we.vscodeUserData||e.scheme===we.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=up(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!=
`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};gW=iAe([Iee(0,Me),Iee(1,Qs)],gW);const Nee="done",Tee="active",pW="infinite",mW="infinite-long-running",Ree="discrete",ET=class ET extends A{constructor(e,t){super(),this.progressSignal=this._register(new ct),this.workedVal=0,this.showDelayedScheduler=this._register(new wt(()=>uo(this.element),0)),this.longRunningScheduler=this._register(new wt(()=>this.infiniteLongRunning(),ET.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){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=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Tee,pW,mW,Ree),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Nee),this.element.classList.contains(pW)?(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(Ree,Nee,mW),this.element.classList.add(Tee,pW),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(mW)}getContainer(){return this.element}};ET.LONG_RUNNING_INFINITE_THRESHOLD=1e4;let _W=ET;const dAe=Q;class hAe extends A{constructor(e,t,i){super(),this.parent=e,this.onDidChange=s=>this.findInput.onDidChange(s),this.container=Z(this.parent,dAe(".quick-input-box")),this.findInput=this._register(new fZ(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="textbox",n.ariaHasPopup="menu",n.ariaAutoComplete="list"}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}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)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute("aria-label")||""}set ariaLabel(e){this.findInput.inputBox.inputElement.setAttribute("aria-label",e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===ii.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===ii.Info?1:e===ii.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===ii.Info?1:e===ii.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const Mee=new Ln(()=>{const o=Sf.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:o,collatorIsNumeric:o.resolvedOptions().numeric}});new Ln(()=>({collator:Sf.Collator(void 0,{numeric:!0}).value})),new Ln(()=>({collator:Sf.Collator(void 0,{numeric:!0,sensitivity:"accent"}).value}));function uAe(o,e,t=!1){const i=o||"",n=e||"",s=Mee.value.collator.compare(i,n);return Mee.value.collatorIsNumeric&&s===0&&i!==n?i<n?-1:1:s}function fAe(o,e,t){const i=o.toLowerCase(),n=e.toLowerCase()
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}loadViewState(){try{const e=JSON.parse(this.storageService.get(LW,-1,"{}"));if(e.top!==void 0||e.left!==void 0)return e}catch{}}saveViewState(e){this.layoutService.activeContainer===this.layoutService.mainContainer&&(e!==void 0?this.storageService.store(LW,JSON.stringify(e),-1,1):this.storageService.remove(LW,-1))}},yW=ym,ym.MAX_WIDTH=600,ym);xW=yW=Bee([gp(1,Hl),gp(2,ge),gp(3,xe),gp(4,Es)],xW);let kW=class extends A{constructor(e,t,i,n,s,r,a){super(),this._container=e,this._quickInputContainer=t,this._quickInputDragAreas=i,this._layoutService=s,this.configurationService=a,this.dndViewState=Le(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=oAe.bindTo(r);const l=j1e(this.configurationService)==="custom";this._controlsOnLeft=l&&XT===1,this._controlsOnRight=l&&(XT===3||XT===2),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...n,done:!0},void 0)}reparentUI(e){this._container=e}layoutContainer(e=this._layoutService.activeContainerDimension){const t=this.dndViewState.get(),i=this._quickInputContainer.getBoundingClientRect();if(t?.top&&t?.left){const n=Math.round(t.left*100)/100,s=e.width,r=i.width,a=n*s-r/2;this._layout(t.top*e.height,a)}}_registerLayoutListener(){this._register(ie.filter(this._layoutService.onDidLayoutContainer,e=>e.container===this._container)(e=>this.layoutContainer(e.dimension)))}registerMouseListeners(){const e=this._quickInputContainer;this._register(Q6(e,t=>{const i=new yn(me(e),t);i.detail===2&&this._quickInputDragAreas.some(({node:n,includeChildren:s})=>s?Zi(i.target,n):i.target===n)&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)})),this._register(X6(e,t=>{const i=me(this._layoutService.activeContainer),n=new yn(i,t);if(!this._quickInputDragAreas.some(({node:h,includeChildren:u})=>u?Zi(n.target,h):n.target===h))return;const s=this._quickInputContainer.getBoundingClientRect(),r=n.browserEvent.clientX-s.left,a=n.browserEvent.clientY-s.top;let l=!1;const c=Jne(i,h=>{new yn(i,h).preventDefault(),l||(l=!0),this._layout(h.clientY-a,h.clientX-r)}),d=Q6(i,h=>{if(l){const u=this.dndViewState.get();this.dndViewState.set({top:u?.top,left:u?.left,done:!0},void 0)}c.dispose(),d.dispose()})}))}_layout(e,t){const i=this._getTopSnapValue(),n=this._getCenterYSnapValue(),s=this._getCenterXSnapValue();e=Math.max(0,Math.min(e,this._container.clientHeight-this._quickInputContainer.clientHeight)),e<this._layoutService.activeContainerOffset.top&&(this._controlsOnLeft?t=Math.max(t,80/UT(ft())):this._controlsOnRight&&(t=Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth-140/UT(ft()))));const r=Math.abs(e-i)<this._snapThreshold;e=r?i:e;const a=Math.abs(e-n)<this._snapThreshold;e=a?n:e;const l=e/this._container.clientHeight;t=Math.max(0,Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth));const c=Math.abs(t-s)<this._snapThreshold;t=c?s:t;const d=this._container.clientWidth,h=this._quickInputContainer.clientWidth,f=(t+h/2)/d;if(this.dndViewState.set({top:l,left:f,done:!1},void 0),c){if(r){this._quickInputAlignmentContext.set("top");return}else if(a){this._quickInputAlignmentContext.set("center");return}}this._quickInputAlignmentContext.set(void 0)}_getTopSnapValue(){return this._layoutService.activeContainerOffset.quickPickTop}_getCenterYSnapValue(){return Math.round(this._container.clientHeight*this._snapLineHorizontalRatio)}_getCenterXSnapValue(){return Math.round(this._container.clientWidth/2)-Math.round(this._quickInputContainer.clientWidth/2)}};kW=Bee([gp(4,Hl),gp(5,xe),gp(6,Me)],kW);var EAe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},CS=function(o,e){return function(t,i){e(t,i,o)}};let IW=class extends Nde{get contr
(-> incoming)[${[...i.incoming.keys()].join(", ")}]
(outgoing ->)[${[...i.outgoing.keys()].join(",")}]
`);return e.join(`
`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const s=this._findCycle(n,t);if(s)return s;t.delete(i)}}}const zAe=!1;class Kee extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph:
${e.toString()}`}}class jE{constructor(e=new O_,t=!1,i,n=zAe){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(ge,this),this._globalGraph=n?i?._globalGraph??new qee(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,pt(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)Xu(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends jE{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t?.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=SS.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw YS("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a},getIfExists:r=>{if(n)throw YS("service accessor is only valid during the invocation of its target method");return this._getOrCreateServiceInstance(r,i)}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof gl?(i=SS.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=SS.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=La.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),s.push(l)}const r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(s))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof gl)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof gl?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const n=new qee(l=>l.id.toString());let s=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const l=r.pop();if(!a.has(String(l.id))){if(a.add(String(l.id)),n.lookupOrInsertNode(l),s++>1e3)throw new Kee(n);for(const c of La.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(l.id),String(c.id)),d instanceof gl){const h={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};n.insertEdge(l,h),r.push(h)}}}}for(;;){const l=n.roots();if(l.length===0){if(!n.isEmpty())throw new Kee(n);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof gl){const h=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreated
`).slice(3,4).join(`
`)):ar._None}static traceCreation(e,t){return e?new ar(1,t.name):ar._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new ar(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;ar._totals+=e;let t=!1;function i(s,r){const a=[],l=new Array(s+1).join(" ");for(const[c,d,h]of r._dep)if(d&&h){t=!0,a.push(`${l}CREATES -> ${c}`);const u=i(s+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${c}`);return a.join(`
`)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${ar._totals.toFixed(2)}ms)`];(e>2||t)&&ar.all.add(n.join(`
`))}};ar.all=new Set,ar._None=new class extends ar{constructor(){super(0,null)}stop(){}branch(){return this}},ar._totals=0;let SS=ar;const UAe=new Set([we.inMemory,we.vscodeSourceControl,we.walkThrough,we.walkThroughSnippet,we.vscodeChatCodeBlock,we.vscodeTerminal]);class $Ae{constructor(){this._byResource=new Li,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new Li,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){return this._byResource.get(e)?.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){return typeof e=="string"?this._byOwner.get(e)?.values()??Ye.empty():be.isUri(e)?this._byResource.get(e)?.values()??Ye.empty():Ye.map(Ye.concat(...this._byOwner.values()),t=>t[1])}}class jAe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Li,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(UAe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===oi.Error?t.errors+=1:i===oi.Warning?t.warnings+=1:i===oi.Info?t.infos+=1:t.unknowns+=1;return t}_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 mp{constructor(){this._onMarkerChanged=new jB({delay:0,merge:mp._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new $Ae,this._stats=new jAe(this),this._filteredResources=new Li}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(E6(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const s of i){const r=mp._toMarker(e,t,s);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f,origin:g}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,h=h>0?h:c,{resource:t,owner:e,code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f,origin:g}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const r=Ye.first(s);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(is(t)){const s=new Li;for(const{resource:r,marker:a}of t){const l=mp._toMarker(e,r,a);if(!l)continue;const c=s.get(r);c?c.push(l):(s.set(r,[l]),i.push(r))}for(const[r,a]of s)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}_createFilteredMarker(e,t){const i=t.length===1?p(1721,'Problems are paused because: "{0}"',t[0]):p(1722,'Problems are paused because: "{0}" and {1} more',t[0],t.length-1);return{owner:"markersFilter",resource:e,severity:oi.Info,message:i,startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const r=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);if(r?.length)return[this._createFilteredMarker(i,r)];const a=this._data.get(i,t);if(!a)return[];const l=[];for(const c of a){if(s>0&&l.length===s)break;const d=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);d?.length?l.push(this._createFilteredMarker(i,d)):mp._accept(c,n)&&l.push(c)}return l}else{const r=!t&&!i?this._data.values():this._data.values(i??t),a=[],l=new Hse;for(const c of r)for(const d of c){if(l.has(d.resource))continue;if(s>0&&a.length===s)break;const h=e.ignoreResourceFilters?void 0:this._filteredResources.get(d.resource);h?.length?(a.push(this._c
`+t),bt.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const n=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&n.push(e.cancelButton),t=await n[0]?.run({checkboxChecked:!1})}return{result:t}}async error(e,t){await this.prompt({type:ii.Error,message:e,detail:t})}}const HS=class HS{info(e){return this.notify({severity:ii.Info,message:e})}warn(e){return this.notify({severity:ii.Warning,message:e})}error(e){return this.notify({severity:ii.Error,message:e})}notify(e){switch(e.severity){case ii.Error:console.error(e.message);break;case ii.Warning:console.warn(e.message);break;default:console.log(e.message);break}return HS.NO_OP}prompt(e,t,i,n){return HS.NO_OP}status(e,t){return{close:()=>{}}}};HS.NO_OP=new Lue;let HW=HS,VW=class{constructor(e){this._onWillExecuteCommand=new P,this._onDidExecuteCommand=new P,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Xe.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};VW=oc([Ri(0,ge)],VW);let hC=class extends NPe{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new U;g.add(W(f,te.KEY_DOWN,m=>{const _=new St(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(W(f,te.KEY_UP,m=>{const _=new St(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new JAe(f,g))},l=f=>{for(let g=0;g<this._domNodeListeners.length;g++){const m=this._domNodeListeners[g];m.domNode===f&&(this._domNodeListeners.splice(g,1),m.dispose())}},c=f=>{f.getOption(70)||a(f.getContainerDomNode())},d=f=>{f.getOption(70)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const h=f=>{a(f.getContainerDomNode())},u=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return jr(Xe.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:nR(i.keybinding,so),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),ue(()=>{for(let i=0;i<this._dynamicKeybindings.length;i++)if(this._dynamicKeybindings[i]===t[0]){this._dynamicKeybindings.splice(i,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(rn.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new hS(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return bt.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const r=s.when||void 0,a=s.keybinding;if(!a)i[n++]=new pee(void 0,s.command,s.commandArgs,r,t,null,!1);else{const l=uS.resolveKeybinding(a,so);for(const c of l)i[n++]=new pee(c,s.command,s.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Sc(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new uS([t],so)}};hC=oc([Ri(0,xe),Ri(1,Tt),Ri(2,Vn),Ri(3,hi),Ri(4,Rt),Ri(5,et)],hC);class JAe extends A{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Gee(o){return o&&typeof o=="object"&&(!o.overrideIdentifier||typeof o.overrideIdentifier=="string")&&(!o.resource||o.resource instanceof be)}let qE=class{constructor(e){this.logServic
`:`\r
`}};UW=oc([Ri(0,Me)],UW);class eOe{publicLog2(){}}const VS=class VS{constructor(){const e=be.from({scheme:VS.SCHEME,authority:"model",path:"/"});this.workspace={id:PK,folders:[new Qve({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===VS.SCHEME?this.workspace.folders[0]:null}};VS.SCHEME="inmemory";let $W=VS;function KE(o,e,t){if(!e||!(o instanceof qE))return;const i=[];Object.keys(e).forEach(n=>{mwe(n)&&i.push([`editor.${n}`,e[n]]),t&&_we(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&o.updateValues(i)}let jW=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:jO.convert(e),n=new Map;for(const a of i){if(!(a instanceof jh))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=n.get(l);c||(c=[],n.set(l,c)),c.push(fi.replaceMove(k.lift(a.textEdit.range),a.textEdit.text))}let s=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,s+=l.length;return{ariaSummary:tf(g9.bulkEditServiceSummary,s,r),isApplied:s>0}}};jW=oc([Ri(0,Qt)],jW);class tOe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return vr(e)}}let qW=class extends CPe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};qW=oc([Ri(0,Hl),Ri(1,et)],qW);class iOe{constructor(){this._neverEmitter=new P,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class nOe extends Q8{constructor(){super()}}class sOe extends KAe{constructor(){super(new Xse)}}let KW=class extends iW{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r),this.configure({blockMouse:!1})}};KW=oc([Ri(0,Vn),Ri(1,hi),Ri(2,hd),Ri(3,ot),Ri(4,Cr),Ri(5,xe)],KW);const oOe={esmModuleLocation:void 0,label:"editorWorkerService"};let GW=class extends O8{constructor(e,t,i,n,s){super(oOe,e,t,i,n,s)}};GW=oc([Ri(0,Qt),Ri(1,ZD),Ri(2,Rt),Ri(3,Jt),Ri(4,he)],GW);class rOe{async playSignal(e,t){}}je(Rt,sOe,0),je(Me,qE,0),je(ZD,zW,0),je(NQ,UW,0),je(pd,$W,0),je(zg,tOe,0),je(Vn,eOe,0),je(Y0,QAe,0),je(k4,XAe,0),je(hi,HW,0),je(zl,mp,0),je(Mt,nOe,0),je(ir,dMe,0),je(Qt,cW,0),je(j2,lW,0),je(xe,FW,0),je(X$,YAe,0),je(sd,BW,0),je(Es,O1e,0),je(Xs,GW,0),je(yw,jW,0),je(GQ,iOe,0),je(ns,WW,0),je(bn,RW,0),je(Fr,dye,0),je(Tt,VW,0),je(ot,hC,0),je(Zn,EW,0),je(hd,qW,0),je(Js,aW,0),je(Wa,PW,0),je(Ko,KW,0),je(Cr,PO,0),je(nd,rOe,0),je(jP,GAe,0),je(PH,toe,0),je(TF,lke,0);var De;(function(o){const e=new O_;for(const[l,c]of nV())e.set(l,c);const t=new jE(e,!0);e.set(ge,t);function i(l){n||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof gl?t.invokeFunction(d=>d.get(l)):c}o.get=i;let n=!1;const s=new P;function r(l){if(n)return t;n=!0;for(const[d,h]of nV())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=We(d);e.get(h)instanceof gl&&e.set(h,l[d])}const c=Xwe();for(const d of c)try{t.createInstance(d)}catch(h){Ee(h)}return s.fire(),t}o.initialize=r;function a(l){if(n)return l();const c=new U,d=c.add(s.event(()=>{d.dispose(),c.add(l())}));return c}o.withServices=a})(De||(De={}));var ZW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zt=function(o,e){return function(t,i){e(t,i,o)}};let aOe=0,Zee=!1;function lOe(o){if(!o){if(Zee)return;Zee=!0}mse(o||bt.document.body)}let GE=class extends sg{constructor(e,t,i,n,s,r,a,l,c,d,h,u,f){const g={...t};g.ariaLabel=g.ariaLabel||u9.edito
`);let r=t;return s!==-1&&(r=t.substring(0,s)),Xee(o,t,e.createByFilepathOrFirstLine(n||null,r),n)}return Xee(o,t,e.createById(i),n)}function Xee(o,e,t,i){return o.createModel(e,t,i)}N("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},p(139,"The background color of the diff editor's header")),N("multiDiffEditor.background",xi,p(140,"The background color of the multi file diff editor")),N("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},p(141,"The border color of the multi file diff editor"));var cOe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Qee=function(o,e){return function(t,i){e(t,i,o)}};class dOe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let QW=class extends A{constructor(e,t,i,n,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Le(this,void 0),this._collapsed=j(this,l=>this._viewModel.read(l)?.collapsed.read(l)),this._editorContentHeight=Le(this,500),this.contentHeight=j(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Le(this,0),this._modifiedWidth=Le(this,0),this._originalContentWidth=Le(this,0),this._originalWidth=Le(this,0),this.maxScroll=j(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=Je("div.multiDiffEntry",[Je("div.header@header",[Je("div.header-content",[Je("div.collapse-button@collapseButton"),Je("div.file-path",[Je("div.title.modified.show-file-icons@primaryPath",[]),Je("div.status.deleted@status",["R"]),Je("div.title.original.show-file-icons@secondaryPath",[])]),Je("div.actions@actions")])]),Je("div.editorParent",[Je("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Bl,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=ni(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=ni(this.editor.getOriginalEditor()).isFocused,this.isFocused=j(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new U),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new Tk(this._elements.collapseButton,{});this._register(Se(l=>{r.element.className="",r.icon=this._collapsed.read(l)?Y.chevronRight:Y.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Se(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{g1(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")s.push({token:a.token+t.tokenPostfix,open:Ad(t,a.open),close:Ad(t,a.close)});else throw Gt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function t4e(o){Gm.registerLanguage(o)}function i4e(){let o=[];return o=o.concat(Gm.getLanguages()),o}function n4e(o){return De.get(Mt).languageIdCodec.encodeLanguageId(o)}function s4e(o,e){return De.withServices(()=>{const i=De.get(Mt).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function o4e(o,e){return De.withServices(()=>{const i=De.get(Mt).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function r4e(o,e){if(!De.get(Mt).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return De.get(Jt).register(o,e,100)}class a4e{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return yS.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new YL(n.tokens,n.endState)}}class yS{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,r=e.length;s<r;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<n&&(l=n),i[s]=new rv(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),r=yS._toClassicTokens(s.tokens,e);let a;return s.endState.equals(n)?a=n:a=s.endState,new HM(r,a)}tokenize(e,t,i){return yS.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const h=t[c],u=n.match(i,h.scopes)|1024;if(r>0&&s[r-1]===u)continue;let f=h.startIndex;c===0?f=0:f<a&&(f=a),s[r++]=f,s[r++]=u,a=f}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=s[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new YL(s,r)}}function l4e(o){return typeof o.getInitialState=="function"}function c4e(o){return"tokenizeEncoded"in o}function ste(o){return o&&typeof o.then=="function"}function d4e(o){const e=De.get(ir);if(o){const t=[null];for(let i=1,n=o.length;i<n;i++)t[i]=$.fromHex(o[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function ote(o,e){return c4e(e)?new a4e(o,e):new yS(o,e,De.get(Mt),De.get(ir))}function nB(o,e){const t=new zhe(async()=>{const i=await Promise.resolve(e.create());return i?l4e(i)?ote(o,i):new lS(De.get(Mt),De.get(ir),o,nte(o,i),De.get(Me)):null});return di.registerFactory(o,t)}function h4e(o,e){if(!De.get(Mt).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return ste(e)?nB(o,{create:()=>e}):di.register(o,ote(o,e))}function u4e(o,e){const t=i=>new lS(De.get(Mt),De.get(ir),o,nte(o,i),De.get(Me));return ste(e)?nB(o,{create:()=>e}):di.register(o,t(e))}function f4e(o,e){return De.get(he).referenceProvider.register(o,e)}function g4e(o,e){return De.get(he).renameProvider.register(o,e)}function p4e(o,e){return De.get(he).newSymbolNamesProvider.register(o,e)}function m4e(o,e){return De.get(he).signatureHelpProvider.register(o,e)}function _4e(o,e){return De.get(he).hoverProvider.register(o,{provideHover:async(i,n,s,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new k(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new k(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function b4e(o,e){r