Files
lit-examples/assets/code-editor-DcpYVa1u.js
2026-07-05 02:38:01 +00:00

756 lines
2.3 MiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/tsMode-BubA63TC.js","assets/lit-element-BUNo9pnf.js","assets/custom-element-BhZVzxrc.js","assets/property-MreHcJY-.js","assets/main-Dy7OaPgN.js","assets/modulepreload-polyfill-B5Qt9EMX.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/cssMode--Vs7p4z6.js","assets/jsonMode-DMYpj5fT.js","assets/htmlMode-BA0L6YRc.js","assets/handlebars-CPBsJnEq.js","assets/html-CBV6GB1r.js","assets/javascript-BV6C_W1_.js","assets/typescript-BniNjZN7.js","assets/liquid-Cbg-0PaI.js","assets/python-LDkdiNmM.js","assets/razor-ID9fWjNT.js","assets/xml-B4dCqQoG.js"])))=>i.map(i=>d[i]);
import{A as jD,a as lF,b as dF,i as cF}from"./lit-element-BUNo9pnf.js";import{t as hF}from"./custom-element-BhZVzxrc.js";import{n as G_}from"./property-MreHcJY-.js";import{_ as ae}from"./main-Dy7OaPgN.js";import{c as uF}from"./_commonjsHelpers-Cpj98o6Y.js";/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const fF=s=>s.strings===void 0;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const gF={CHILD:2},pF=s=>(...e)=>({_$litDirective$:s,values:e});class mF{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const pu=(s,e)=>{var i;const t=s._$AN;if(t===void 0)return!1;for(const n of t)(i=n._$AO)==null||i.call(n,e,!1),pu(n,e);return!0},hm=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while((t==null?void 0:t.size)===0)},nM=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),vF(e)}};function _F(s){this._$AN!==void 0?(hm(this),this._$AM=s,nM(this)):this._$AM=s}function bF(s,e=!1,t=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(i))for(let o=t;o<i.length;o++)pu(i[o],!1),hm(i[o]);else i!=null&&(pu(i,!1),hm(i));else pu(this,s)}const vF=s=>{s.type==gF.CHILD&&(s._$AP??(s._$AP=bF),s._$AQ??(s._$AQ=_F))};class wF extends mF{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),nM(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,n;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),t&&(pu(this,e),hm(this))}setValue(e){if(fF(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const CF=()=>new SF;class SF{}const Uv=new WeakMap,yF=pF(class extends wF{render(s){return jD}update(s,[e]){var i;const t=e!==this.G;return t&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),jD}rt(s){if(this.G!==void 0)if(this.isConnected||(s=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=Uv.get(e);t===void 0&&(t=new WeakMap,Uv.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){var s,e;return typeof this.G=="function"?(s=Uv.get(this.ht??globalThis))==null?void 0:s.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function LF(s,e){let t;return e.length===0?t=s:t=s.replace(/\{(\d+)\}/g,function(i,n){const o=n[0];return typeof e[o]<"u"?e[o]:i}),t}function p(s,e,...t){return LF(e,t)}var $v;const Lp="en";let um=!1,fm=!1,xp=!1,sM=!1,oM=!1,By=!1,Dg,jv=Lp,xF,Hr;const jt=typeof self=="object"?self:typeof global=="object"?global:{};let Kt;typeof jt.vscode<"u"&&typeof jt.vscode.process<"u"?Kt=jt.vscode.process:typeof process<"u"&&(Kt=process);const rM=typeof(($v=Kt==null?void 0:Kt.versions)===null||$v===void 0?void 0:$v.electron)=="string"&&Kt.type==="renderer",DF=rM&&(Kt==null?void 0:Kt.sandboxed),kF=(()=>{if(DF)return"bypassHeatCheck";const s=Kt==null?void 0:Kt.env.VSCODE_BROWSER_CODE_LOADING;if(typeof s=="string")return s==="none"||s==="code"||s==="bypassHeatCheck"||s==="bypassHeatCheckAndEagerCompile"?s:"bypassHeatCheck"})(),IF=typeof kF=="string";if(typeof navigator=="object"&&!rM)Hr=navigator.userAgent,um=Hr.indexOf("Windows")>=0,fm=Hr.indexOf("Macintosh")>=0,By=(Hr.indexOf("Macintosh")>=0||Hr.indexOf("iPad")>=0||Hr.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,xp=Hr.indexOf("Linux")>=0,oM=!0,Dg=navigator.language,jv=Dg;else if(typeof Kt=="object"){um=Kt.platform==="win32",fm=Kt.platform==="darwin",xp=Kt.platform==="linux",xp&&Kt.env.SNAP&&Kt.env.SNAP_REVISION,Dg=Lp,jv=Lp;const s=Kt.env.VSCODE_NLS_CONFIG;if(s)try{const e=JSON.parse(s),t=e.availableLanguages["*"];Dg=e.locale,jv=t||Lp,xF=e._translationsConfigFile}catch{}sM=!0}else console.error("Unable to resolve platform.");const Si=um,Re=fm,sn=xp,Mo=sM,gh=oM,To=By,EF=Hr,gm=function(){if(jt.setImmediate)return jt.setImmediate.bind(jt);if(typeof jt.postMessage=="function"&&!jt.importScripts){let t=[];jt.addEventListener("message",n=>{if(n.data&&n.data.vscodeSetImmediateId)for(let o=0,r=t.length;o<r;o++){const a=t[o];if(a.id===n.data.vscodeSetImmediateId){t.splice(o,1),a.callback();return}}});let i=0;return n=>{const o=++i;t.push({id:o,callback:n}),jt.postMessage({vscodeSetImmediateId:o},"*")}}if(typeof(Kt==null?void 0:Kt.nextTick)=="function")return Kt.nextTick.bind(Kt);const e=Promise.resolve();return t=>e.then(t)}(),ps=fm||By?2:um?1:3;let qD=!0,KD=!1;function aM(){if(!KD){KD=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,qD=new Uint16Array(s.buffer)[0]===513}return qD}const lM="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function NF(s=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of lM)s.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const dM=NF();function XC(s){let e=dM;if(s&&s instanceof RegExp)if(s.global)e=s;else{let t="g";s.ignoreCase&&(t+="i"),s.multiline&&(t+="m"),s.unicode&&(t+="u"),e=new RegExp(s.source,t)}return e.lastIndex=0,e}const MF={maxLen:1e3,windowSize:15,timeBudget:150};function pm(s,e,t,i,n=MF){if(t.length>n.maxLen){let d=s-n.maxLen/2;return d<0?d=0:i+=d,t=t.substring(d,s+n.maxLen/2),pm(s,e,t,i,n)}const o=Date.now(),r=s-1-i;let a=-1,l=null;for(let d=1;!(Date.now()-o>=n.timeBudget);d++){const c=r-n.windowSize*d;e.lastIndex=Math.max(0,c);const h=TF(e,t,r,a);if(!h&&l||(l=h,c<=0))break;a=c}if(l){let d={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,d}return null}function TF(s,e,t,i){let n;for(;n=s.exec(e);){const o=n.index||0;if(o<=t&&s.lastIndex>=t)return n;if(i>0&&o>i)return null}return null}const nu=8;class cM{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class AF{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class hM{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class xi{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}compute(e,t,i){return i}}class ph{constructor(e,t=null){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0,this.deps=t}validate(e){return this.defaultValue}}class cd{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function me(s,e){return typeof s>"u"?e:s==="false"?!1:!!s}class Me extends cd{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return me(e,this.defaultValue)}}class mt extends cd{constructor(e,t,i,n,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=n,r.maximum=o),super(e,t,i,r),this.minimum=n,this.maximum=o}static clampedInt(e,t,i,n){if(typeof e>"u")return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),o=Math.min(n,o),o|0)}validate(e){return mt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class So extends cd{constructor(e,t,i,n,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){return this.validationFn(So.float(e,this.defaultValue))}}class un extends cd{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return un.string(e,this.defaultValue)}}function fn(s,e,t){return typeof s!="string"||t.indexOf(s)===-1?e:s}class qt extends cd{constructor(e,t,i,n,o=void 0){typeof o<"u"&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return fn(e,this.defaultValue,this._allowedValues)}}class Ph extends xi{constructor(e,t,i,n,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=n),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function RF(s){switch(s){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class OF extends xi{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[p("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),p("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."),p("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:"auto",description:p("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class PF extends xi{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(17,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:p("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:p("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:me(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:me(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function FF(s){switch(s){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var li;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(li||(li={}));function BF(s){switch(s){case"line":return li.Line;case"block":return li.Block;case"underline":return li.Underline;case"line-thin":return li.LineThin;case"block-outline":return li.BlockOutline;case"underline-thin":return li.UnderlineThin}}class WF extends ph{constructor(){super(125,[63,31])}compute(e,t,i){const n=["monaco-editor"];return t.get(31)&&n.push(t.get(31)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(63)==="default"?n.push("mouse-default"):t.get(63)==="copy"&&n.push("mouse-copy"),t.get(98)&&n.push("showUnused"),t.get(123)&&n.push("showDeprecated"),n.join(" ")}}class VF extends Me{constructor(){super(30,"emptySelectionClipboard",!0,{description:p("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class HF extends xi{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:!0,autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(33,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:p("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"boolean",default:e.seedSearchStringFromSelection,description:p("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[p("editor.find.autoFindInSelection.never","Never turn on Find in selection automatically (default)."),p("editor.find.autoFindInSelection.always","Always turn on Find in selection automatically."),p("editor.find.autoFindInSelection.multiline","Turn on Find in selection automatically when multiple lines of content are selected.")],description:p("find.autoFindInSelection","Controls the condition for turning on find in selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:p("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Re},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:p("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:p("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:me(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:me(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":fn(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:me(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:me(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:me(t.loop,this.defaultValue.loop)}}}class In extends xi{constructor(){super(41,"fontLigatures",In.OFF,{anyOf:[{type:"boolean",description:p("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:p("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:p("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?In.OFF:e==="true"?In.ON:e:e?In.ON:In.OFF}}In.OFF='"liga" off, "calt" off';In.ON='"liga" on, "calt" on';class zF extends ph{constructor(){super(40)}compute(e,t,i){return e.fontInfo}}class UF extends cd{constructor(){super(42,"fontSize",Yn.fontSize,{type:"number",minimum:6,maximum:100,default:Yn.fontSize,description:p("fontSize","Controls the font size in pixels.")})}validate(e){let t=So.float(e,this.defaultValue);return t===0?Yn.fontSize:So.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class bo extends xi{constructor(){super(43,"fontWeight",Yn.fontWeight,{anyOf:[{type:"number",minimum:bo.MINIMUM_VALUE,maximum:bo.MAXIMUM_VALUE,errorMessage:p("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:bo.SUGGESTION_VALUES}],default:Yn.fontWeight,description:p("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(mt.clampedInt(e,Yn.fontWeight,bo.MINIMUM_VALUE,bo.MAXIMUM_VALUE))}}bo.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];bo.MINIMUM_VALUE=1;bo.MAXIMUM_VALUE=1e3;class $F extends xi{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[p("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),p("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),p("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(47,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:p("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:p("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:p("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:p("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:p("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:p("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:p("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:p("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:p("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:p("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:p("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,o,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:fn(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:fn(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:fn(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(n=a.multipleDeclarations)!==null&&n!==void 0?n:fn(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:fn(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:fn(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:un.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:un.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:un.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:un.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:un.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class jF extends xi{constructor(){const e={enabled:!0,delay:300,sticky:!0};super(50,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:p("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,description:p("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:p("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:me(t.enabled,this.defaultValue.enabled),delay:mt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:me(t.sticky,this.defaultValue.sticky)}}}class gc extends ph{constructor(){super(128,[46,55,35,62,90,57,58,92,115,118,119,120,2])}compute(e,t,i){return gc.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=e.scrollBeyondLastLine?t-1:0,n=(e.viewLineCount+i)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/n);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:n,minimapLineCount:o}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,d=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,b=e.verticalScrollbarWidth,v=e.viewLineCount,_=e.remainingWidth,w=e.isViewportWrapping,C=h?2:3;let S=Math.floor(o*n);const D=S/o;let y=!1,x=!1,E=C*u,P=u/o,A=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:Le,extraLinesBeyondLastLine:Se,desiredRatio:st,minimapLineCount:pi}=gc.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:c,height:n,lineHeight:l,pixelRatio:o});if(v/pi>1)y=!0,x=!0,u=1,E=1,P=u/o;else{let zt=!1,Ii=u+1;if(g==="fit"){const rs=Math.ceil((v+Se)*E);w&&a&&_<=t.stableFitRemainingWidth?(zt=!0,Ii=t.stableFitMaxMinimapScale):zt=rs>S}if(g==="fill"||zt){y=!0;const rs=u;E=Math.min(l*o,Math.max(1,Math.floor(1/st))),w&&a&&_<=t.stableFitRemainingWidth&&(Ii=t.stableFitMaxMinimapScale),u=Math.min(Ii,Math.max(1,Math.floor(E/C))),u>rs&&(A=Math.min(2,u/rs)),P=u/o/A,S=Math.ceil(Math.max(Le,v+Se)*E),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const H=Math.floor(f*P),q=Math.min(H,Math.max(0,Math.floor((_-b-2)*P/(d+P)))+nu);let de=Math.floor(o*q);const ce=de/o;de=Math.floor(de*A);const be=h?1:2,ke=m==="left"?0:i-q-b;return{renderMinimap:be,minimapLeft:ke,minimapWidth:q,minimapHeightIsEditorHeight:y,minimapIsSampling:x,minimapScale:u,minimapLineHeight:E,minimapCanvasInnerWidth:de,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:ce,minimapCanvasOuterHeight:D}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,c=t.viewLineCount,h=e.get(120),u=h==="inherit"?e.get(119):h,f=u==="inherit"?e.get(115):u,g=e.get(118),m=e.get(2),b=t.isDominatedByLongLines,v=e.get(46),_=e.get(57).renderType!==0,w=e.get(58),C=e.get(92),S=e.get(62),D=e.get(90),y=D.verticalScrollbarSize,x=D.verticalHasArrows,E=D.arrowSize,P=D.horizontalScrollbarSize,A=e.get(55),H=e.get(35);let q;if(typeof A=="string"&&/^\d+(\.\d+)?ch$/.test(A)){const Uo=parseFloat(A.substr(0,A.length-2));q=mt.clampedInt(Uo*a,0,0,1e3)}else q=mt.clampedInt(A,0,0,1e3);H&&(q+=16);let de=0;if(_){const Uo=Math.max(r,w);de=Math.round(Uo*l)}let ce=0;v&&(ce=o);let be=0,ke=be+ce,Le=ke+de,Se=Le+q;const st=i-ce-de-q;let pi=!1,Zi=!1,zt=-1;m!==2&&(u==="inherit"&&b?(pi=!0,Zi=!0):f==="on"||f==="bounded"?Zi=!0:f==="wordWrapColumn"&&(zt=g));const Ii=gc._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:C,minimap:S,verticalScrollbarWidth:y,viewLineCount:c,remainingWidth:st,isViewportWrapping:Zi},t.memory||new hM);Ii.renderMinimap!==0&&Ii.minimapLeft===0&&(be+=Ii.minimapWidth,ke+=Ii.minimapWidth,Le+=Ii.minimapWidth,Se+=Ii.minimapWidth);const rs=st-Ii.minimapWidth,Md=Math.max(1,Math.floor((rs-y-2)/a)),Td=x?E:0;return Zi&&(zt=Math.max(1,Md),f==="bounded"&&(zt=Math.min(zt,g))),{width:i,height:n,glyphMarginLeft:be,glyphMarginWidth:ce,lineNumbersLeft:ke,lineNumbersWidth:de,decorationsLeft:Le,decorationsWidth:q,contentLeft:Se,contentWidth:rs,minimap:Ii,viewportColumn:Md,isWordWrapMinified:pi,isViewportWrapping:Zi,wrappingColumn:zt,verticalScrollbarWidth:y,horizontalScrollbarHeight:P,overviewRuler:{top:Td,width:y,height:n-2*Td,right:0}}}}class qF extends xi{constructor(){const e={enabled:!0};super(54,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:p("codeActions","Enables the code action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:me(e.enabled,this.defaultValue.enabled)}}}class KF extends xi{constructor(){const e={enabled:!0,fontSize:0,fontFamily:Yn.fontFamily};super(124,"inlayHints",e,{"editor.inlayHints.enabled":{type:"boolean",default:e.enabled,description:p("inlayHints.enable","Enables the inlay hints in the editor.")},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:p("inlayHints.fontSize","Controls font size of inlay hints in the editor. When set to `0`, the 90% of `#editor.fontSize#` is used.")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,description:p("inlayHints.fontFamily","Controls font family of inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:me(t.enabled,this.defaultValue.enabled),fontSize:mt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:un.string(t.fontFamily,this.defaultValue.fontFamily)}}}class GF extends So{constructor(){super(56,"lineHeight",Yn.lineHeight,e=>So.clamp(e,0,150),{markdownDescription:p("lineHeight",`Controls the line height.
- Use 0 to automatically compute the line height from the font size.
- Values between 0 and 8 will be used as a multiplier with the font size.
- Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class ZF extends xi{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(62,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),p("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:p("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:me(t.enabled,this.defaultValue.enabled),size:fn(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:fn(t.side,this.defaultValue.side,["right","left"]),showSlider:fn(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:me(t.renderCharacters,this.defaultValue.renderCharacters),scale:mt.clampedInt(t.scale,1,1,3),maxColumn:mt.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function YF(s){return s==="ctrlCmd"?Re?"metaKey":"ctrlKey":"altKey"}class XF extends xi{constructor(){super(72,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:mt.clampedInt(t.top,0,0,1e3),bottom:mt.clampedInt(t.bottom,0,0,1e3)}}}class QF extends xi{constructor(){const e={enabled:!0,cycle:!1};super(73,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:p("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:p("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:me(t.enabled,this.defaultValue.enabled),cycle:me(t.cycle,this.defaultValue.cycle)}}}class JF extends ph{constructor(){super(126)}compute(e,t,i){return e.pixelRatio}}class e4 extends xi{constructor(){const e={other:!0,comments:!1,strings:!1};super(76,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:p("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:p("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:e.other,description:p("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}}}],default:e,description:p("quickSuggestions","Controls whether suggestions should automatically show up while typing.")}),this.defaultValue=e}validate(e){if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const t=e,i={other:me(t.other,this.defaultValue.other),comments:me(t.comments,this.defaultValue.comments),strings:me(t.strings,this.defaultValue.strings)};return i.other&&i.comments&&i.strings?!0:!i.other&&!i.comments&&!i.strings?!1:i}return this.defaultValue}}class t4 extends xi{constructor(){super(57,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[p("lineNumbers.off","Line numbers are not rendered."),p("lineNumbers.on","Line numbers are rendered as absolute number."),p("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),p("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:p("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function Wy(s){const e=s.get(85);return e==="editable"?s.get(78):e!=="on"}class i4 extends xi{constructor(){const e=[],t={type:"number",description:p("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(89,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:p("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:p("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){let t=[];for(let i of e)if(typeof i=="number")t.push({column:mt.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const n=i;t.push({column:mt.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}function GD(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return 2;case"visible":return 3;default:return 1}}let n4=class extends xi{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(90,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),p("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),p("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),p("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),p("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:p("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:p("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:p("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=mt.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=mt.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:mt.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:GD(t.vertical,this.defaultValue.vertical),horizontal:GD(t.horizontal,this.defaultValue.horizontal),useShadows:me(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:me(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:me(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:me(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:me(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:mt.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:mt.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:me(t.scrollByPage,this.defaultValue.scrollByPage)}}};class s4 extends xi{constructor(){const e={enabled:!1,mode:"subwordDiff"};super(52,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:p("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.mode":{type:"string",enum:["prefix","subwordDiff"],enumDescriptions:[p("inlineSuggest.mode.prefix","Only render an inline suggestion if the replace text is a prefix of the insert text."),p("inlineSuggest.mode.subwordDiff","Only render an inline suggestion if the replace text is a subword of the insert text.")],default:e.mode,description:p("inlineSuggest.mode","Controls which mode to use for rendering inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:me(t.enabled,this.defaultValue.enabled),mode:fn(t.mode,this.defaultValue.mode,["prefix","subwordDiff"])}}}class o4 extends xi{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"prefix",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(104,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[p("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),p("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:p("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:p("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:p("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:p("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:p("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:p("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:p("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:p("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.previewMode":{type:"string",enum:["prefix","subwordDiff"],enumDescriptions:[p("suggest.previewMode.prefix","Only render a preview if the replace text is a prefix of the insert text."),p("suggest.previewMode.subwordDiff","Only render a preview if the replace text is a subword of the insert text.")],default:e.previewMode,description:p("suggest.previewMode","Controls which mode to use for rendering the suggest preview.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:p("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:p("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:p("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:fn(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:me(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:me(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:me(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:me(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:me(t.showIcons,this.defaultValue.showIcons),showStatusBar:me(t.showStatusBar,this.defaultValue.showStatusBar),preview:me(t.preview,this.defaultValue.preview),previewMode:fn(t.previewMode,this.defaultValue.previewMode,["prefix","subwordDiff"]),showInlineDetails:me(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:me(t.showMethods,this.defaultValue.showMethods),showFunctions:me(t.showFunctions,this.defaultValue.showFunctions),showConstructors:me(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:me(t.showDeprecated,this.defaultValue.showDeprecated),showFields:me(t.showFields,this.defaultValue.showFields),showVariables:me(t.showVariables,this.defaultValue.showVariables),showClasses:me(t.showClasses,this.defaultValue.showClasses),showStructs:me(t.showStructs,this.defaultValue.showStructs),showInterfaces:me(t.showInterfaces,this.defaultValue.showInterfaces),showModules:me(t.showModules,this.defaultValue.showModules),showProperties:me(t.showProperties,this.defaultValue.showProperties),showEvents:me(t.showEvents,this.defaultValue.showEvents),showOperators:me(t.showOperators,this.defaultValue.showOperators),showUnits:me(t.showUnits,this.defaultValue.showUnits),showValues:me(t.showValues,this.defaultValue.showValues),showConstants:me(t.showConstants,this.defaultValue.showConstants),showEnums:me(t.showEnums,this.defaultValue.showEnums),showEnumMembers:me(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:me(t.showKeywords,this.defaultValue.showKeywords),showWords:me(t.showWords,this.defaultValue.showWords),showColors:me(t.showColors,this.defaultValue.showColors),showFiles:me(t.showFiles,this.defaultValue.showFiles),showReferences:me(t.showReferences,this.defaultValue.showReferences),showFolders:me(t.showFolders,this.defaultValue.showFolders),showTypeParameters:me(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:me(t.showSnippets,this.defaultValue.showSnippets),showUsers:me(t.showUsers,this.defaultValue.showUsers),showIssues:me(t.showIssues,this.defaultValue.showIssues)}}}class r4 extends xi{constructor(){super(100,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:p("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:me(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}}}class a4 extends ph{constructor(){super(127,[78])}compute(e,t,i){return t.get(78)?!0:e.tabFocusMode}}function l4(s){switch(s){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}class d4 extends ph{constructor(){super(129,[128])}compute(e,t,i){const n=t.get(128);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}const c4="Consolas, 'Courier New', monospace",h4="Menlo, Monaco, 'Courier New', monospace",u4="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",Yn={fontFamily:Re?h4:sn?u4:c4,fontWeight:"normal",fontSize:Re?12:14,lineHeight:0,letterSpacing:0},pn={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},nc=[];function Z(s){return nc[s.id]=s,s}const Js={acceptSuggestionOnCommitCharacter:Z(new Me(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:p("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Z(new qt(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",p("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:p("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Z(new OF),accessibilityPageSize:Z(new mt(3,"accessibilityPageSize",10,1,1073741824,{description:p("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.")})),ariaLabel:Z(new un(4,"ariaLabel",p("editorViewAccessibleLabel","Editor content"))),autoClosingBrackets:Z(new qt(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),p("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:p("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingDelete:Z(new qt(6,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Z(new qt(7,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Z(new qt(8,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),p("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:p("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Z(new Ph(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],RF,{enumDescriptions:[p("editor.autoIndent.none","The editor will not insert indentation automatically."),p("editor.autoIndent.keep","The editor will keep the current line's indentation."),p("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),p("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),p("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:p("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Z(new Me(10,"automaticLayout",!1)),autoSurround:Z(new qt(11,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[p("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),p("editor.autoSurround.quotes","Surround with quotes but not brackets."),p("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:p("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),stickyTabStops:Z(new Me(102,"stickyTabStops",!1,{description:p("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Z(new Me(12,"codeLens",!0,{description:p("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Z(new un(13,"codeLensFontFamily","",{description:p("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Z(new mt(14,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:p("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.")})),colorDecorators:Z(new Me(15,"colorDecorators",!0,{description:p("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:Z(new Me(16,"columnSelection",!1,{description:p("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Z(new PF),contextmenu:Z(new Me(18,"contextmenu",!0)),copyWithSyntaxHighlighting:Z(new Me(19,"copyWithSyntaxHighlighting",!0,{description:p("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Z(new Ph(20,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],FF,{description:p("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Z(new Me(21,"cursorSmoothCaretAnimation",!1,{description:p("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Z(new Ph(22,"cursorStyle",li.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],BF,{description:p("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Z(new mt(23,"cursorSurroundingLines",0,0,1073741824,{description:p("cursorSurroundingLines","Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Z(new qt(24,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[p("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),p("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],description:p("cursorSurroundingLinesStyle","Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:Z(new mt(25,"cursorWidth",0,0,1073741824,{markdownDescription:p("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Z(new Me(26,"disableLayerHinting",!1)),disableMonospaceOptimizations:Z(new Me(27,"disableMonospaceOptimizations",!1)),domReadOnly:Z(new Me(28,"domReadOnly",!1)),dragAndDrop:Z(new Me(29,"dragAndDrop",!0,{description:p("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Z(new VF),extraEditorClassName:Z(new un(31,"extraEditorClassName","")),fastScrollSensitivity:Z(new So(32,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:p("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Z(new HF),fixedOverflowWidgets:Z(new Me(34,"fixedOverflowWidgets",!1)),folding:Z(new Me(35,"folding",!0,{description:p("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Z(new qt(36,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[p("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),p("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:p("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Z(new Me(37,"foldingHighlight",!0,{description:p("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),unfoldOnClickAfterEndOfLine:Z(new Me(38,"unfoldOnClickAfterEndOfLine",!1,{description:p("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Z(new un(39,"fontFamily",Yn.fontFamily,{description:p("fontFamily","Controls the font family.")})),fontInfo:Z(new zF),fontLigatures2:Z(new In),fontSize:Z(new UF),fontWeight:Z(new bo),formatOnPaste:Z(new Me(44,"formatOnPaste",!1,{description:p("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Z(new Me(45,"formatOnType",!1,{description:p("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Z(new Me(46,"glyphMargin",!0,{description:p("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Z(new $F),hideCursorInOverviewRuler:Z(new Me(48,"hideCursorInOverviewRuler",!1,{description:p("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),highlightActiveIndentGuide:Z(new Me(49,"highlightActiveIndentGuide",!0,{description:p("highlightActiveIndentGuide","Controls whether the editor should highlight the active indent guide.")})),hover:Z(new jF),inDiffEditor:Z(new Me(51,"inDiffEditor",!1)),letterSpacing:Z(new So(53,"letterSpacing",Yn.letterSpacing,s=>So.clamp(s,-5,20),{description:p("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Z(new qF),lineDecorationsWidth:Z(new cd(55,"lineDecorationsWidth",10)),lineHeight:Z(new GF),lineNumbers:Z(new t4),lineNumbersMinChars:Z(new mt(58,"lineNumbersMinChars",5,1,300)),linkedEditing:Z(new Me(59,"linkedEditing",!1,{description:p("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.")})),links:Z(new Me(60,"links",!0,{description:p("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Z(new qt(61,"matchBrackets","always",["always","near","never"],{description:p("matchBrackets","Highlight matching brackets.")})),minimap:Z(new ZF),mouseStyle:Z(new qt(63,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Z(new So(64,"mouseWheelScrollSensitivity",1,s=>s===0?1:s,{markdownDescription:p("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Z(new Me(65,"mouseWheelZoom",!1,{markdownDescription:p("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Z(new Me(66,"multiCursorMergeOverlapping",!0,{description:p("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Z(new Ph(67,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],YF,{markdownEnumDescriptions:[p("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),p("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:p({},"The modifier to be used to add multiple cursors with the mouse. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Z(new qt(68,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[p("multiCursorPaste.spread","Each cursor pastes a single line of the text."),p("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:p("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),occurrencesHighlight:Z(new Me(69,"occurrencesHighlight",!0,{description:p("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:Z(new Me(70,"overviewRulerBorder",!0,{description:p("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Z(new mt(71,"overviewRulerLanes",3,0,3)),padding:Z(new XF),parameterHints:Z(new QF),peekWidgetDefaultFocus:Z(new qt(74,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[p("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),p("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:p("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Z(new Me(75,"definitionLinkOpensInPeek",!1,{description:p("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Z(new e4),quickSuggestionsDelay:Z(new mt(77,"quickSuggestionsDelay",10,0,1073741824,{description:p("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Z(new Me(78,"readOnly",!1)),renameOnType:Z(new Me(79,"renameOnType",!1,{description:p("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:p("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Z(new Me(80,"renderControlCharacters",!1,{description:p("renderControlCharacters","Controls whether the editor should render control characters.")})),renderIndentGuides:Z(new Me(81,"renderIndentGuides",!0,{description:p("renderIndentGuides","Controls whether the editor should render indent guides.")})),renderFinalNewline:Z(new Me(82,"renderFinalNewline",!0,{description:p("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Z(new qt(83,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",p("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:p("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Z(new Me(84,"renderLineHighlightOnlyWhenFocus",!1,{description:p("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Z(new qt(85,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Z(new qt(86,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",p("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),p("renderWhitespace.selection","Render whitespace characters only on selected text."),p("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:p("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Z(new mt(87,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:Z(new Me(88,"roundedSelection",!0,{description:p("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Z(new i4),scrollbar:Z(new n4),scrollBeyondLastColumn:Z(new mt(91,"scrollBeyondLastColumn",5,0,1073741824,{description:p("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Z(new Me(92,"scrollBeyondLastLine",!0,{description:p("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Z(new Me(93,"scrollPredominantAxis",!0,{description:p("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Z(new Me(94,"selectionClipboard",!0,{description:p("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:sn})),selectionHighlight:Z(new Me(95,"selectionHighlight",!0,{description:p("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Z(new Me(96,"selectOnLineNumbers",!0)),showFoldingControls:Z(new qt(97,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[p("showFoldingControls.always","Always show the folding controls."),p("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:p("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Z(new Me(98,"showUnused",!0,{description:p("showUnused","Controls fading out of unused code.")})),showDeprecated:Z(new Me(123,"showDeprecated",!0,{description:p("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Z(new KF),snippetSuggestions:Z(new qt(99,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[p("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),p("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),p("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),p("snippetSuggestions.none","Do not show snippet suggestions.")],description:p("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Z(new r4),smoothScrolling:Z(new Me(101,"smoothScrolling",!1,{description:p("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Z(new mt(103,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Z(new o4),inlineSuggest:Z(new s4),suggestFontSize:Z(new mt(105,"suggestFontSize",0,0,1e3,{markdownDescription:p("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")})),suggestLineHeight:Z(new mt(106,"suggestLineHeight",0,0,1e3,{markdownDescription:p("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.")})),suggestOnTriggerCharacters:Z(new Me(107,"suggestOnTriggerCharacters",!0,{description:p("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Z(new qt(108,"suggestSelection","recentlyUsed",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[p("suggestSelection.first","Always select the first suggestion."),p("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),p("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:p("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Z(new qt(109,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[p("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),p("tabCompletion.off","Disable tab completions."),p("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:p("tabCompletion","Enables tab completions.")})),tabIndex:Z(new mt(110,"tabIndex",0,-1,1073741824)),unusualLineTerminators:Z(new qt(111,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[p("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),p("unusualLineTerminators.off","Unusual line terminators are ignored."),p("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:p("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Z(new Me(112,"useShadowDOM",!0)),useTabStops:Z(new Me(113,"useTabStops",!0,{description:p("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordSeparators:Z(new un(114,"wordSeparators",lM,{description:p("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Z(new qt(115,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p({},"Lines will wrap at `#editor.wordWrapColumn#`."),p({},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:p({},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Z(new un(116,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Z(new un(117,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥+")),wordWrapColumn:Z(new mt(118,"wordWrapColumn",80,1,1073741824,{markdownDescription:p({},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Z(new qt(119,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Z(new qt(120,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:Z(new Ph(121,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],l4,{enumDescriptions:[p("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),p("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),p("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),p("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:p("wrappingIndent","Controls the indentation of wrapped lines.")})),wrappingStrategy:Z(new qt(122,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[p("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),p("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],description:p("wrappingStrategy","Controls the algorithm that computes wrapping points.")})),editorClassName:Z(new WF),pixelRatio:Z(new JF),tabFocusMode:Z(new a4),layoutInfo:Z(new gc),wrappingInfo:Z(new d4)};class f4{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw 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 uM=new f4;function ve(s){Vo(s)||uM.onUnexpectedError(s)}function gi(s){Vo(s)||uM.onUnexpectedExternalError(s)}function ZD(s){if(s instanceof Error){let{name:e,message:t}=s;const i=s.stacktrace||s.stack;return{$isError:!0,name:e,message:t,stack:i}}return s}const QC="Canceled";function Vo(s){return s instanceof Error&&s.name===QC&&s.message===QC}function mh(){const s=new Error(QC);return s.name=s.message,s}function Rn(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")}function g4(s){return new Error(`Illegal state: ${s}`)}var Be;(function(s){function e(_){return _&&typeof _=="object"&&typeof _[Symbol.iterator]=="function"}s.is=e;const t=Object.freeze([]);function i(){return t}s.empty=i;function*n(_){yield _}s.single=n;function o(_){return _||t}s.from=o;function r(_){return!_||_[Symbol.iterator]().next().done===!0}s.isEmpty=r;function a(_){return _[Symbol.iterator]().next().value}s.first=a;function l(_,w){for(const C of _)if(w(C))return!0;return!1}s.some=l;function d(_,w){for(const C of _)if(w(C))return C}s.find=d;function*c(_,w){for(const C of _)w(C)&&(yield C)}s.filter=c;function*h(_,w){let C=0;for(const S of _)yield w(S,C++)}s.map=h;function*u(..._){for(const w of _)for(const C of w)yield C}s.concat=u;function*f(_){for(const w of _)for(const C of w)yield C}s.concatNested=f;function g(_,w,C){let S=C;for(const D of _)S=w(S,D);return S}s.reduce=g;function*m(_,w,C=_.length){for(w<0&&(w+=_.length),C<0?C+=_.length:C>_.length&&(C=_.length);w<C;w++)yield _[w]}s.slice=m;function b(_,w=Number.POSITIVE_INFINITY){const C=[];if(w===0)return[C,_];const S=_[Symbol.iterator]();for(let D=0;D<w;D++){const y=S.next();if(y.done)return[C,s.empty()];C.push(y.value)}return[C,{[Symbol.iterator](){return S}}]}s.consume=b;function v(_,w,C=(S,D)=>S===D){const S=_[Symbol.iterator](),D=w[Symbol.iterator]();for(;;){const y=S.next(),x=D.next();if(y.done!==x.done)return!1;if(y.done)return!0;if(!C(y.value,x.value))return!1}}s.equals=v})(Be||(Be={}));function p4(s){}class m4 extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function Vy(s){return typeof s.dispose=="function"&&s.dispose.length===0}function $e(s){if(Be.is(s)){let e=[];for(const t of s)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new m4(e);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function sa(...s){return s.forEach(p4),Pe(()=>$e(s))}function Pe(s){return{dispose:()=>{s()}}}class X{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}clear(){try{$e(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?X.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}X.DISABLE_DISPOSED_WARNING=!1;class U{constructor(){this._store=new X}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}U.None=Object.freeze({dispose(){}});let Es=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}};class _4{constructor(e){this.object=e}dispose(){}}let Ut=class JC{constructor(e){this.element=e,this.next=JC.Undefined,this.prev=JC.Undefined}};Ut.Undefined=new Ut(void 0);class Mn{constructor(){this._first=Ut.Undefined,this._last=Ut.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ut.Undefined}clear(){let e=this._first;for(;e!==Ut.Undefined;){const t=e.next;e.prev=Ut.Undefined,e.next=Ut.Undefined,e=t}this._first=Ut.Undefined,this._last=Ut.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new Ut(e);if(this._first===Ut.Undefined)this._first=i,this._last=i;else if(t){const o=this._last;this._last=i,i.prev=o,o.next=i}else{const o=this._first;this._first=i,i.next=o,o.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==Ut.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ut.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ut.Undefined&&e.next!==Ut.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ut.Undefined&&e.next===Ut.Undefined?(this._first=Ut.Undefined,this._last=Ut.Undefined):e.next===Ut.Undefined?(this._last=this._last.prev,this._last.next=Ut.Undefined):e.prev===Ut.Undefined&&(this._first=this._first.next,this._first.prev=Ut.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ut.Undefined;)yield e.element,e=e.next}}const b4=jt.performance&&typeof jt.performance.now=="function";class Ao{constructor(e){this._highResolution=b4&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new Ao(e)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?jt.performance.now():Date.now()}}var re;(function(s){s.None=()=>U.None;function e(_){return(w,C=null,S)=>{let D=!1,y;return y=_(x=>{if(!D)return y?y.dispose():D=!0,w.call(C,x)},null,S),D&&y.dispose(),y}}s.once=e;function t(_,w){return l((C,S=null,D)=>_(y=>C.call(S,w(y)),null,D))}s.map=t;function i(_,w){return l((C,S=null,D)=>_(y=>{w(y),C.call(S,y)},null,D))}s.forEach=i;function n(_,w){return l((C,S=null,D)=>_(y=>w(y)&&C.call(S,y),null,D))}s.filter=n;function o(_){return _}s.signal=o;function r(..._){return(w,C=null,S)=>sa(..._.map(D=>D(y=>w.call(C,y),null,S)))}s.any=r;function a(_,w,C){let S=C;return t(_,D=>(S=w(S,D),S))}s.reduce=a;function l(_){let w;const C=new M({onFirstListenerAdd(){w=_(C.fire,C)},onLastListenerRemove(){w.dispose()}});return C.event}function d(_,w,C=100,S=!1,D){let y,x,E,P=0;const A=new M({leakWarningThreshold:D,onFirstListenerAdd(){y=_(H=>{P++,x=w(x,H),S&&!E&&(A.fire(x),x=void 0),clearTimeout(E),E=setTimeout(()=>{const q=x;x=void 0,E=void 0,(!S||P>1)&&A.fire(q),P=0},C)})},onLastListenerRemove(){y.dispose()}});return A.event}s.debounce=d;function c(_,w=(C,S)=>C===S){let C=!0,S;return n(_,D=>{const y=C||!w(D,S);return C=!1,S=D,y})}s.latch=c;function h(_,w){return[s.filter(_,w),s.filter(_,C=>!w(C))]}s.split=h;function u(_,w=!1,C=[]){let S=C.slice(),D=_(E=>{S?S.push(E):x.fire(E)});const y=()=>{S&&S.forEach(E=>x.fire(E)),S=null},x=new M({onFirstListenerAdd(){D||(D=_(E=>x.fire(E)))},onFirstListenerDidAdd(){S&&(w?setTimeout(y):y())},onLastListenerRemove(){D&&D.dispose(),D=null}});return x.event}s.buffer=u;class f{constructor(w){this.event=w}map(w){return new f(t(this.event,w))}forEach(w){return new f(i(this.event,w))}filter(w){return new f(n(this.event,w))}reduce(w,C){return new f(a(this.event,w,C))}latch(){return new f(c(this.event))}debounce(w,C=100,S=!1,D){return new f(d(this.event,w,C,S,D))}on(w,C,S){return this.event(w,C,S)}once(w,C,S){return e(this.event)(w,C,S)}}function g(_){return new f(_)}s.chain=g;function m(_,w,C=S=>S){const S=(...E)=>x.fire(C(...E)),D=()=>_.on(w,S),y=()=>_.removeListener(w,S),x=new M({onFirstListenerAdd:D,onLastListenerRemove:y});return x.event}s.fromNodeEventEmitter=m;function b(_,w,C=S=>S){const S=(...E)=>x.fire(C(...E)),D=()=>_.addEventListener(w,S),y=()=>_.removeEventListener(w,S),x=new M({onFirstListenerAdd:D,onLastListenerRemove:y});return x.event}s.fromDOMEventEmitter=b;function v(_){return new Promise(w=>e(_)(w))}s.toPromise=v})(re||(re={}));class Z_{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${Z_._idPool++}`}start(e){this._stopWatch=new Ao(!0),this._listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this._elapsedOverall+=e,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${e.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}Z_._idPool=0;let M=class fM{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=void 0,this._perfMon=!((t=this._options)===null||t===void 0)&&t._profName?new Z_(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,i)=>{var n;this._listeners||(this._listeners=new Mn);const o=this._listeners.isEmpty();o&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(t?[e,t]:e);o&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);const a=(n=this._leakageMon)===null||n===void 0?void 0:n.check(this._listeners.size);let l;return l={dispose:()=>{a&&a(),l.dispose=fM._noop,this._disposed||(r(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))}},i instanceof X?i.add(l):Array.isArray(i)&&i.push(l),l}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Mn);for(let n of this._listeners)this._deliveryQueue.push([n,e]);for((t=this._perfMon)===null||t===void 0||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[n,o]=this._deliveryQueue.shift();try{typeof n=="function"?n.call(void 0,o):n[0].call(n[1],o)}catch(r){ve(r)}}(i=this._perfMon)===null||i===void 0||i.stop()}}dispose(){var e,t,i,n,o;this._disposed||(this._disposed=!0,(e=this._listeners)===null||e===void 0||e.clear(),(t=this._deliveryQueue)===null||t===void 0||t.clear(),(n=(i=this._options)===null||i===void 0?void 0:i.onLastListenerRemove)===null||n===void 0||n.call(i),(o=this._leakageMon)===null||o===void 0||o.dispose())}};M._noop=function(){};class mm extends M{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Mn,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){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._listeners&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class v4 extends mm{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class Hy{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e(o=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(i,o)):t.call(i,o)},void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(n=>n()),i}}class YD{constructor(){this.listening=!1,this.inputEvent=re.None,this.inputEventListener=U.None,this.emitter=new M({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const gM=Object.freeze(function(s,e){const t=setTimeout(s.bind(e),0);return{dispose(){clearTimeout(t)}}});var Fe;(function(s){function e(t){return t===s.None||t===s.Cancelled||t instanceof Dp?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}s.isCancellationToken=e,s.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:re.None}),s.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:gM})})(Fe||(Fe={}));class Dp{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?gM:(this._emitter||(this._emitter=new M),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class on{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Dp),this._token}cancel(){this._token?this._token instanceof Dp&&this._token.cancel():this._token=Fe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof Dp&&this._token.dispose():this._token=Fe.None}}class zy{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const e0=new zy,t0=new zy,i0=new zy;(function(){function s(e,t,i=t,n=i){e0.define(e,t),t0.define(e,i),i0.define(e,n)}s(0,"unknown"),s(1,"Backspace"),s(2,"Tab"),s(3,"Enter"),s(4,"Shift"),s(5,"Ctrl"),s(6,"Alt"),s(7,"PauseBreak"),s(8,"CapsLock"),s(9,"Escape"),s(10,"Space"),s(11,"PageUp"),s(12,"PageDown"),s(13,"End"),s(14,"Home"),s(15,"LeftArrow","Left"),s(16,"UpArrow","Up"),s(17,"RightArrow","Right"),s(18,"DownArrow","Down"),s(19,"Insert"),s(20,"Delete"),s(21,"0"),s(22,"1"),s(23,"2"),s(24,"3"),s(25,"4"),s(26,"5"),s(27,"6"),s(28,"7"),s(29,"8"),s(30,"9"),s(31,"A"),s(32,"B"),s(33,"C"),s(34,"D"),s(35,"E"),s(36,"F"),s(37,"G"),s(38,"H"),s(39,"I"),s(40,"J"),s(41,"K"),s(42,"L"),s(43,"M"),s(44,"N"),s(45,"O"),s(46,"P"),s(47,"Q"),s(48,"R"),s(49,"S"),s(50,"T"),s(51,"U"),s(52,"V"),s(53,"W"),s(54,"X"),s(55,"Y"),s(56,"Z"),s(57,"Meta"),s(58,"ContextMenu"),s(59,"F1"),s(60,"F2"),s(61,"F3"),s(62,"F4"),s(63,"F5"),s(64,"F6"),s(65,"F7"),s(66,"F8"),s(67,"F9"),s(68,"F10"),s(69,"F11"),s(70,"F12"),s(71,"F13"),s(72,"F14"),s(73,"F15"),s(74,"F16"),s(75,"F17"),s(76,"F18"),s(77,"F19"),s(78,"NumLock"),s(79,"ScrollLock"),s(80,";",";","OEM_1"),s(81,"=","=","OEM_PLUS"),s(82,",",",","OEM_COMMA"),s(83,"-","-","OEM_MINUS"),s(84,".",".","OEM_PERIOD"),s(85,"/","/","OEM_2"),s(86,"`","`","OEM_3"),s(110,"ABNT_C1"),s(111,"ABNT_C2"),s(87,"[","[","OEM_4"),s(88,"\\","\\","OEM_5"),s(89,"]","]","OEM_6"),s(90,"'","'","OEM_7"),s(91,"OEM_8"),s(92,"OEM_102"),s(93,"NumPad0"),s(94,"NumPad1"),s(95,"NumPad2"),s(96,"NumPad3"),s(97,"NumPad4"),s(98,"NumPad5"),s(99,"NumPad6"),s(100,"NumPad7"),s(101,"NumPad8"),s(102,"NumPad9"),s(103,"NumPad_Multiply"),s(104,"NumPad_Add"),s(105,"NumPad_Separator"),s(106,"NumPad_Subtract"),s(107,"NumPad_Decimal"),s(108,"NumPad_Divide")})();var pc;(function(s){function e(r){return e0.keyCodeToStr(r)}s.toString=e;function t(r){return e0.strToKeyCode(r)}s.fromString=t;function i(r){return t0.keyCodeToStr(r)}s.toUserSettingsUS=i;function n(r){return i0.keyCodeToStr(r)}s.toUserSettingsGeneral=n;function o(r){return t0.strToKeyCode(r)||i0.strToKeyCode(r)}s.fromUserSettings=o})(pc||(pc={}));function oi(s,e){const t=(e&65535)<<16>>>0;return(s|t)>>>0}function n0(s,e){if(s===0)return null;const t=(s&65535)>>>0,i=(s&4294901760)>>>16;return i!==0?new s0([qv(t,e),qv(i,e)]):new s0([qv(t,e)])}function qv(s,e){const t=!!(s&2048),i=!!(s&256),n=e===2?i:t,o=!!(s&1024),r=!!(s&512),a=e===2?t:i,l=s&255;return new zu(n,o,r,a,l)}class zu{constructor(e,t,i,n,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=o}equals(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toChord(){return new s0([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}}class s0{constructor(e){if(e.length===0)throw Rn("parts");this.parts=e}}class w4{constructor(e,t,i,n,o,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=o,this.keyAriaLabel=r}}class C4{}var XD={};let mc;if(typeof jt.vscode<"u"&&typeof jt.vscode.process<"u"){const s=jt.vscode.process;mc={get platform(){return s.platform},get env(){return s.env},cwd(){return s.cwd()},nextTick(e){return gm(e)}}}else typeof process<"u"?mc={get platform(){return process.platform},get env(){return XD},cwd(){return XD.VSCODE_CWD||process.cwd()},nextTick(s){return process.nextTick(s)}}:mc={get platform(){return Si?"win32":Re?"darwin":"linux"},nextTick(s){return gm(s)},get env(){return{}},cwd(){return"/"}};const o0=mc.cwd,S4=mc.env,hd=mc.platform,y4=65,L4=97,x4=90,D4=122,oa=46,Pi=47,Dn=92,Pr=58,k4=63;class pM extends Error{constructor(e,t,i){let n;typeof t=="string"&&t.indexOf("not ")===0?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${n} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function ii(s,e){if(typeof s!="string")throw new pM(e,"string",s)}function Ye(s){return s===Pi||s===Dn}function r0(s){return s===Pi}function Fr(s){return s>=y4&&s<=x4||s>=L4&&s<=D4}function _m(s,e,t,i){let n="",o=0,r=-1,a=0,l=0;for(let d=0;d<=s.length;++d){if(d<s.length)l=s.charCodeAt(d);else{if(i(l))break;l=Pi}if(i(l)){if(!(r===d-1||a===1))if(a===2){if(n.length<2||o!==2||n.charCodeAt(n.length-1)!==oa||n.charCodeAt(n.length-2)!==oa){if(n.length>2){const c=n.lastIndexOf(t);c===-1?(n="",o=0):(n=n.slice(0,c),o=n.length-1-n.lastIndexOf(t)),r=d,a=0;continue}else if(n.length!==0){n="",o=0,r=d,a=0;continue}}e&&(n+=n.length>0?`${t}..`:"..",o=2)}else n.length>0?n+=`${t}${s.slice(r+1,d)}`:n=s.slice(r+1,d),o=d-r-1;r=d,a=0}else l===oa&&a!==-1?++a:a=-1}return n}function mM(s,e){if(e===null||typeof e!="object")throw new pM("pathObject","Object",e);const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${s}${i}`:i}const _n={resolve(...s){let e="",t="",i=!1;for(let n=s.length-1;n>=-1;n--){let o;if(n>=0){if(o=s[n],ii(o,"path"),o.length===0)continue}else e.length===0?o=o0():(o=S4[`=${e}`]||o0(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Dn)&&(o=`${e}\\`));const r=o.length;let a=0,l="",d=!1;const c=o.charCodeAt(0);if(r===1)Ye(c)&&(a=1,d=!0);else if(Ye(c))if(d=!0,Ye(o.charCodeAt(1))){let h=2,u=h;for(;h<r&&!Ye(o.charCodeAt(h));)h++;if(h<r&&h!==u){const f=o.slice(u,h);for(u=h;h<r&&Ye(o.charCodeAt(h));)h++;if(h<r&&h!==u){for(u=h;h<r&&!Ye(o.charCodeAt(h));)h++;(h===r||h!==u)&&(l=`\\\\${f}\\${o.slice(u,h)}`,a=h)}}}else a=1;else Fr(c)&&o.charCodeAt(1)===Pr&&(l=o.slice(0,2),a=2,r>2&&Ye(o.charCodeAt(2))&&(d=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=d,d&&e.length>0)break}return t=_m(t,!i,"\\",Ye),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(s){ii(s,"path");const e=s.length;if(e===0)return".";let t=0,i,n=!1;const o=s.charCodeAt(0);if(e===1)return r0(o)?"\\":s;if(Ye(o))if(n=!0,Ye(s.charCodeAt(1))){let a=2,l=a;for(;a<e&&!Ye(s.charCodeAt(a));)a++;if(a<e&&a!==l){const d=s.slice(l,a);for(l=a;a<e&&Ye(s.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!Ye(s.charCodeAt(a));)a++;if(a===e)return`\\\\${d}\\${s.slice(l)}\\`;a!==l&&(i=`\\\\${d}\\${s.slice(l,a)}`,t=a)}}}else t=1;else Fr(o)&&s.charCodeAt(1)===Pr&&(i=s.slice(0,2),t=2,e>2&&Ye(s.charCodeAt(2))&&(n=!0,t=3));let r=t<e?_m(s.slice(t),!n,"\\",Ye):"";return r.length===0&&!n&&(r="."),r.length>0&&Ye(s.charCodeAt(e-1))&&(r+="\\"),i===void 0?n?`\\${r}`:r:n?`${i}\\${r}`:`${i}${r}`},isAbsolute(s){ii(s,"path");const e=s.length;if(e===0)return!1;const t=s.charCodeAt(0);return Ye(t)||e>2&&Fr(t)&&s.charCodeAt(1)===Pr&&Ye(s.charCodeAt(2))},join(...s){if(s.length===0)return".";let e,t;for(let o=0;o<s.length;++o){const r=s[o];ii(r,"path"),r.length>0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,n=0;if(typeof t=="string"&&Ye(t.charCodeAt(0))){++n;const o=t.length;o>1&&Ye(t.charCodeAt(1))&&(++n,o>2&&(Ye(t.charCodeAt(2))?++n:i=!1))}if(i){for(;n<e.length&&Ye(e.charCodeAt(n));)n++;n>=2&&(e=`\\${e.slice(n)}`)}return _n.normalize(e)},relative(s,e){if(ii(s,"from"),ii(e,"to"),s===e)return"";const t=_n.resolve(s),i=_n.resolve(e);if(t===i||(s=t.toLowerCase(),e=i.toLowerCase(),s===e))return"";let n=0;for(;n<s.length&&s.charCodeAt(n)===Dn;)n++;let o=s.length;for(;o-1>n&&s.charCodeAt(o-1)===Dn;)o--;const r=o-n;let a=0;for(;a<e.length&&e.charCodeAt(a)===Dn;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===Dn;)l--;const d=l-a,c=r<d?r:d;let h=-1,u=0;for(;u<c;u++){const g=s.charCodeAt(n+u);if(g!==e.charCodeAt(a+u))break;g===Dn&&(h=u)}if(u!==c){if(h===-1)return i}else{if(d>c){if(e.charCodeAt(a+u)===Dn)return i.slice(a+u+1);if(u===2)return i.slice(a+u)}r>c&&(s.charCodeAt(n+u)===Dn?h=u:u===2&&(h=3)),h===-1&&(h=0)}let f="";for(u=n+h+1;u<=o;++u)(u===o||s.charCodeAt(u)===Dn)&&(f+=f.length===0?"..":"\\..");return a+=h,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===Dn&&++a,i.slice(a,l))},toNamespacedPath(s){if(typeof s!="string")return s;if(s.length===0)return"";const e=_n.resolve(s);if(e.length<=2)return s;if(e.charCodeAt(0)===Dn){if(e.charCodeAt(1)===Dn){const t=e.charCodeAt(2);if(t!==k4&&t!==oa)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Fr(e.charCodeAt(0))&&e.charCodeAt(1)===Pr&&e.charCodeAt(2)===Dn)return`\\\\?\\${e}`;return s},dirname(s){ii(s,"path");const e=s.length;if(e===0)return".";let t=-1,i=0;const n=s.charCodeAt(0);if(e===1)return Ye(n)?s:".";if(Ye(n)){if(t=i=1,Ye(s.charCodeAt(1))){let a=2,l=a;for(;a<e&&!Ye(s.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&Ye(s.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!Ye(s.charCodeAt(a));)a++;if(a===e)return s;a!==l&&(t=i=a+1)}}}}else Fr(n)&&s.charCodeAt(1)===Pr&&(t=e>2&&Ye(s.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(Ye(s.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return s.slice(0,o)},basename(s,e){e!==void 0&&ii(e,"ext"),ii(s,"path");let t=0,i=-1,n=!0,o;if(s.length>=2&&Fr(s.charCodeAt(0))&&s.charCodeAt(1)===Pr&&(t=2),e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=t;--o){const l=s.charCodeAt(o);if(Ye(l)){if(!n){t=o+1;break}}else a===-1&&(n=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(o=s.length-1;o>=t;--o)if(Ye(s.charCodeAt(o))){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){ii(s,"path");let e=0,t=-1,i=0,n=-1,o=!0,r=0;s.length>=2&&s.charCodeAt(1)===Pr&&Fr(s.charCodeAt(0))&&(e=i=2);for(let a=s.length-1;a>=e;--a){const l=s.charCodeAt(a);if(Ye(l)){if(!o){i=a+1;break}continue}n===-1&&(o=!1,n=a+1),l===oa?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||n===-1||r===0||r===1&&t===n-1&&t===i+1?"":s.slice(t,n)},format:mM.bind(null,"\\"),parse(s){ii(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.length;let i=0,n=s.charCodeAt(0);if(t===1)return Ye(n)?(e.root=e.dir=s,e):(e.base=e.name=s,e);if(Ye(n)){if(i=1,Ye(s.charCodeAt(1))){let h=2,u=h;for(;h<t&&!Ye(s.charCodeAt(h));)h++;if(h<t&&h!==u){for(u=h;h<t&&Ye(s.charCodeAt(h));)h++;if(h<t&&h!==u){for(u=h;h<t&&!Ye(s.charCodeAt(h));)h++;h===t?i=h:h!==u&&(i=h+1)}}}}else if(Fr(n)&&s.charCodeAt(1)===Pr){if(t<=2)return e.root=e.dir=s,e;if(i=2,Ye(s.charCodeAt(2))){if(t===3)return e.root=e.dir=s,e;i=3}}i>0&&(e.root=s.slice(0,i));let o=-1,r=i,a=-1,l=!0,d=s.length-1,c=0;for(;d>=i;--d){if(n=s.charCodeAt(d),Ye(n)){if(!l){r=d+1;break}continue}a===-1&&(l=!1,a=d+1),n===oa?o===-1?o=d:c!==1&&(c=1):o!==-1&&(c=-1)}return a!==-1&&(o===-1||c===0||c===1&&o===a-1&&o===r+1?e.base=e.name=s.slice(r,a):(e.name=s.slice(r,o),e.base=s.slice(r,a),e.ext=s.slice(o,a))),r>0&&r!==i?e.dir=s.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Yt={resolve(...s){let e="",t=!1;for(let i=s.length-1;i>=-1&&!t;i--){const n=i>=0?s[i]:o0();ii(n,"path"),n.length!==0&&(e=`${n}/${e}`,t=n.charCodeAt(0)===Pi)}return e=_m(e,!t,"/",r0),t?`/${e}`:e.length>0?e:"."},normalize(s){if(ii(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===Pi,t=s.charCodeAt(s.length-1)===Pi;return s=_m(s,!e,"/",r0),s.length===0?e?"/":t?"./":".":(t&&(s+="/"),e?`/${s}`:s)},isAbsolute(s){return ii(s,"path"),s.length>0&&s.charCodeAt(0)===Pi},join(...s){if(s.length===0)return".";let e;for(let t=0;t<s.length;++t){const i=s[t];ii(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Yt.normalize(e)},relative(s,e){if(ii(s,"from"),ii(e,"to"),s===e||(s=Yt.resolve(s),e=Yt.resolve(e),s===e))return"";const t=1,i=s.length,n=i-t,o=1,r=e.length-o,a=n<r?n:r;let l=-1,d=0;for(;d<a;d++){const h=s.charCodeAt(t+d);if(h!==e.charCodeAt(o+d))break;h===Pi&&(l=d)}if(d===a)if(r>a){if(e.charCodeAt(o+d)===Pi)return e.slice(o+d+1);if(d===0)return e.slice(o+d)}else n>a&&(s.charCodeAt(t+d)===Pi?l=d:d===0&&(l=0));let c="";for(d=t+l+1;d<=i;++d)(d===i||s.charCodeAt(d)===Pi)&&(c+=c.length===0?"..":"/..");return`${c}${e.slice(o+l)}`},toNamespacedPath(s){return s},dirname(s){if(ii(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===Pi;let t=-1,i=!0;for(let n=s.length-1;n>=1;--n)if(s.charCodeAt(n)===Pi){if(!i){t=n;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":s.slice(0,t)},basename(s,e){e!==void 0&&ii(e,"ext"),ii(s,"path");let t=0,i=-1,n=!0,o;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=0;--o){const l=s.charCodeAt(o);if(l===Pi){if(!n){t=o+1;break}}else a===-1&&(n=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(o=s.length-1;o>=0;--o)if(s.charCodeAt(o)===Pi){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){ii(s,"path");let e=-1,t=0,i=-1,n=!0,o=0;for(let r=s.length-1;r>=0;--r){const a=s.charCodeAt(r);if(a===Pi){if(!n){t=r+1;break}continue}i===-1&&(n=!1,i=r+1),a===oa?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":s.slice(e,i)},format:mM.bind(null,"/"),parse(s){ii(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.charCodeAt(0)===Pi;let i;t?(e.root="/",i=1):i=0;let n=-1,o=0,r=-1,a=!0,l=s.length-1,d=0;for(;l>=i;--l){const c=s.charCodeAt(l);if(c===Pi){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),c===oa?n===-1?n=l:d!==1&&(d=1):n!==-1&&(d=-1)}if(r!==-1){const c=o===0&&t?1:o;n===-1||d===0||d===1&&n===r-1&&n===o+1?e.base=e.name=s.slice(c,r):(e.name=s.slice(c,n),e.base=s.slice(c,r),e.ext=s.slice(n,r))}return o>0?e.dir=s.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Yt.win32=_n.win32=_n;Yt.posix=_n.posix=Yt;const Uy=hd==="win32"?_n.normalize:Yt.normalize,I4=hd==="win32"?_n.resolve:Yt.resolve,E4=hd==="win32"?_n.relative:Yt.relative,_M=hd==="win32"?_n.dirname:Yt.dirname,bl=hd==="win32"?_n.basename:Yt.basename,N4=hd==="win32"?_n.extname:Yt.extname,vl=hd==="win32"?_n.sep:Yt.sep,M4=/^\w[\w\d+.-]*$/,T4=/^\//,A4=/^\/\//;function QD(s,e){if(!s.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${s.authority}", path: "${s.path}", query: "${s.query}", fragment: "${s.fragment}"}`);if(s.scheme&&!M4.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!T4.test(s.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(A4.test(s.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function R4(s,e){return!s&&!e?"file":s}function O4(s,e){switch(s){case"https":case"http":case"file":e?e[0]!==Ws&&(e=Ws+e):e=Ws;break}return e}const Nt="",Ws="/",P4=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class he{constructor(e,t,i,n,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||Nt,this.authority=e.authority||Nt,this.path=e.path||Nt,this.query=e.query||Nt,this.fragment=e.fragment||Nt):(this.scheme=R4(e,r),this.authority=t||Nt,this.path=O4(this.scheme,i||Nt),this.query=n||Nt,this.fragment=o||Nt,QD(this,r))}static isUri(e){return e instanceof he?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}get fsPath(){return bm(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=Nt),i===void 0?i=this.authority:i===null&&(i=Nt),n===void 0?n=this.path:n===null&&(n=Nt),o===void 0?o=this.query:o===null&&(o=Nt),r===void 0?r=this.fragment:r===null&&(r=Nt),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&r===this.fragment?this:new Rd(t,i,n,o,r)}static parse(e,t=!1){const i=P4.exec(e);return i?new Rd(i[2]||Nt,kg(i[4]||Nt),kg(i[5]||Nt),kg(i[7]||Nt),kg(i[9]||Nt),t):new Rd(Nt,Nt,Nt,Nt,Nt)}static file(e){let t=Nt;if(Si&&(e=e.replace(/\\/g,Ws)),e[0]===Ws&&e[1]===Ws){const i=e.indexOf(Ws,2);i===-1?(t=e.substring(2),e=Ws):(t=e.substring(2,i),e=e.substring(i)||Ws)}return new Rd("file",t,e,Nt,Nt)}static from(e){const t=new Rd(e.scheme,e.authority,e.path,e.query,e.fragment);return QD(t,!0),t}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Si&&e.scheme==="file"?i=he.file(_n.join(bm(e,!0),...t)).path:i=Yt.join(e.path,...t),e.with({path:i})}toString(e=!1){return a0(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof he)return e;{const t=new Rd(e);return t._formatted=e.external,t._fsPath=e._sep===bM?e.fsPath:null,t}}else return e}}const bM=Si?1:void 0;let Rd=class extends he{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=bm(this,!1)),this._fsPath}toString(e=!1){return e?a0(this,!0):(this._formatted||(this._formatted=a0(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=bM),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const vM={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function JD(s,e){let t,i=-1;for(let n=0;n<s.length;n++){const o=s.charCodeAt(n);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||e&&o===47)i!==-1&&(t+=encodeURIComponent(s.substring(i,n)),i=-1),t!==void 0&&(t+=s.charAt(n));else{t===void 0&&(t=s.substr(0,n));const r=vM[o];r!==void 0?(i!==-1&&(t+=encodeURIComponent(s.substring(i,n)),i=-1),t+=r):i===-1&&(i=n)}}return i!==-1&&(t+=encodeURIComponent(s.substring(i))),t!==void 0?t:s}function F4(s){let e;for(let t=0;t<s.length;t++){const i=s.charCodeAt(t);i===35||i===63?(e===void 0&&(e=s.substr(0,t)),e+=vM[i]):e!==void 0&&(e+=s[t])}return e!==void 0?e:s}function bm(s,e){let t;return s.authority&&s.path.length>1&&s.scheme==="file"?t=`//${s.authority}${s.path}`:s.path.charCodeAt(0)===47&&(s.path.charCodeAt(1)>=65&&s.path.charCodeAt(1)<=90||s.path.charCodeAt(1)>=97&&s.path.charCodeAt(1)<=122)&&s.path.charCodeAt(2)===58?e?t=s.path.substr(1):t=s.path[1].toLowerCase()+s.path.substr(2):t=s.path,Si&&(t=t.replace(/\//g,"\\")),t}function a0(s,e){const t=e?F4:JD;let i="",{scheme:n,authority:o,path:r,query:a,fragment:l}=s;if(n&&(i+=n,i+=":"),(o||n==="file")&&(i+=Ws,i+=Ws),o){let d=o.indexOf("@");if(d!==-1){const c=o.substr(0,d);o=o.substr(d+1),d=c.indexOf(":"),d===-1?i+=t(c,!1):(i+=t(c.substr(0,d),!1),i+=":",i+=t(c.substr(d+1),!1)),i+="@"}o=o.toLowerCase(),d=o.indexOf(":"),d===-1?i+=t(o,!1):(i+=t(o.substr(0,d),!1),i+=o.substr(d))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const d=r.charCodeAt(1);d>=65&&d<=90&&(r=`/${String.fromCharCode(d+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const d=r.charCodeAt(0);d>=65&&d<=90&&(r=`${String.fromCharCode(d+32)}:${r.substr(2)}`)}i+=t(r,!0)}return a&&(i+="?",i+=t(a,!1)),l&&(i+="#",i+=e?l:JD(l,!1)),i}function wM(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+wM(s.substr(3)):s}}const ek=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function kg(s){return s.match(ek)?s.replace(ek,e=>wM(e)):s}class O{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new O(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return O.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return O.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(e){return O.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){let i=e.lineNumber|0,n=t.lineNumber|0;if(i===n){let o=e.column|0,r=t.column|0;return o-r}return i-n}clone(){return new O(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new O(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}}let L=class Oi{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return Oi.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Oi.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}containsRange(e){return Oi.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return Oi.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return Oi.plusRange(this,e)}static plusRange(e,t){let i,n,o,r;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,n=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,n=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,n=e.startColumn),t.endLineNumber>e.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new Oi(i,n,o,r)}intersectRanges(e){return Oi.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=t.startLineNumber,l=t.startColumn,d=t.endLineNumber,c=t.endColumn;return i<a?(i=a,n=l):i===a&&(n=Math.max(n,l)),o>d?(o=d,r=c):o===d&&(r=Math.min(r,c)),i>o||i===o&&n>r?null:new Oi(i,n,o,r)}equalsRange(e){return Oi.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Oi.getEndPosition(this)}static getEndPosition(e){return new O(e.endLineNumber,e.endColumn)}getStartPosition(){return Oi.getStartPosition(this)}static getStartPosition(e){return new O(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Oi(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Oi(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Oi.collapseToStart(this)}static collapseToStart(e){return new Oi(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new Oi(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Oi(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static compareRangesUsingStarts(e,t){if(e&&t){const o=e.startLineNumber|0,r=t.startLineNumber|0;if(o===r){const a=e.startColumn|0,l=t.startColumn|0;if(a===l){const d=e.endLineNumber|0,c=t.endLineNumber|0;if(d===c){const h=e.endColumn|0,u=t.endColumn|0;return h-u}return d-c}return a-l}return o-r}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}};class ee extends L{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return ee.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new ee(this.startLineNumber,this.startColumn,e,t):new ee(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new O(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return this.getDirection()===0?new ee(e,t,this.endLineNumber,this.endColumn):new ee(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new ee(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new ee(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&typeof e.selectionStartLineNumber=="number"&&typeof e.selectionStartColumn=="number"&&typeof e.positionLineNumber=="number"&&typeof e.positionColumn=="number"}static createWithDirection(e,t,i,n,o){return o===0?new ee(e,t,i,n):new ee(i,n,e,t)}}class Y_{constructor(e,t,i){this._tokenBrand=void 0,this.offset=e|0,this.type=t,this.language=i}toString(){return"("+this.offset+", "+this.type+")"}}class $y{constructor(e,t){this._tokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}class X_{constructor(e,t){this._tokenizationResult2Brand=void 0,this.tokens=e,this.endState=t}}var l0;(function(s){s[s.Unknown=0]="Unknown",s[s.Disabled=1]="Disabled",s[s.Enabled=2]="Enabled"})(l0||(l0={}));var d0;(function(s){s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(d0||(d0={}));var c0;(function(s){s[s.Method=0]="Method",s[s.Function=1]="Function",s[s.Constructor=2]="Constructor",s[s.Field=3]="Field",s[s.Variable=4]="Variable",s[s.Class=5]="Class",s[s.Struct=6]="Struct",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Event=10]="Event",s[s.Operator=11]="Operator",s[s.Unit=12]="Unit",s[s.Value=13]="Value",s[s.Constant=14]="Constant",s[s.Enum=15]="Enum",s[s.EnumMember=16]="EnumMember",s[s.Keyword=17]="Keyword",s[s.Text=18]="Text",s[s.Color=19]="Color",s[s.File=20]="File",s[s.Reference=21]="Reference",s[s.Customcolor=22]="Customcolor",s[s.Folder=23]="Folder",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue",s[s.Snippet=27]="Snippet"})(c0||(c0={}));var h0;(function(s){s[s.Deprecated=1]="Deprecated"})(h0||(h0={}));var u0;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(u0||(u0={}));var f0;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(f0||(f0={}));var g0;(function(s){s[s.NotSet=0]="NotSet",s[s.ContentFlush=1]="ContentFlush",s[s.RecoverFromMarkers=2]="RecoverFromMarkers",s[s.Explicit=3]="Explicit",s[s.Paste=4]="Paste",s[s.Undo=5]="Undo",s[s.Redo=6]="Redo"})(g0||(g0={}));var p0;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(p0||(p0={}));var m0;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(m0||(m0={}));var _0;(function(s){s[s.None=0]="None",s[s.Keep=1]="Keep",s[s.Brackets=2]="Brackets",s[s.Advanced=3]="Advanced",s[s.Full=4]="Full"})(_0||(_0={}));var b0;(function(s){s[s.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",s[s.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",s[s.accessibilitySupport=2]="accessibilitySupport",s[s.accessibilityPageSize=3]="accessibilityPageSize",s[s.ariaLabel=4]="ariaLabel",s[s.autoClosingBrackets=5]="autoClosingBrackets",s[s.autoClosingDelete=6]="autoClosingDelete",s[s.autoClosingOvertype=7]="autoClosingOvertype",s[s.autoClosingQuotes=8]="autoClosingQuotes",s[s.autoIndent=9]="autoIndent",s[s.automaticLayout=10]="automaticLayout",s[s.autoSurround=11]="autoSurround",s[s.codeLens=12]="codeLens",s[s.codeLensFontFamily=13]="codeLensFontFamily",s[s.codeLensFontSize=14]="codeLensFontSize",s[s.colorDecorators=15]="colorDecorators",s[s.columnSelection=16]="columnSelection",s[s.comments=17]="comments",s[s.contextmenu=18]="contextmenu",s[s.copyWithSyntaxHighlighting=19]="copyWithSyntaxHighlighting",s[s.cursorBlinking=20]="cursorBlinking",s[s.cursorSmoothCaretAnimation=21]="cursorSmoothCaretAnimation",s[s.cursorStyle=22]="cursorStyle",s[s.cursorSurroundingLines=23]="cursorSurroundingLines",s[s.cursorSurroundingLinesStyle=24]="cursorSurroundingLinesStyle",s[s.cursorWidth=25]="cursorWidth",s[s.disableLayerHinting=26]="disableLayerHinting",s[s.disableMonospaceOptimizations=27]="disableMonospaceOptimizations",s[s.domReadOnly=28]="domReadOnly",s[s.dragAndDrop=29]="dragAndDrop",s[s.emptySelectionClipboard=30]="emptySelectionClipboard",s[s.extraEditorClassName=31]="extraEditorClassName",s[s.fastScrollSensitivity=32]="fastScrollSensitivity",s[s.find=33]="find",s[s.fixedOverflowWidgets=34]="fixedOverflowWidgets",s[s.folding=35]="folding",s[s.foldingStrategy=36]="foldingStrategy",s[s.foldingHighlight=37]="foldingHighlight",s[s.unfoldOnClickAfterEndOfLine=38]="unfoldOnClickAfterEndOfLine",s[s.fontFamily=39]="fontFamily",s[s.fontInfo=40]="fontInfo",s[s.fontLigatures=41]="fontLigatures",s[s.fontSize=42]="fontSize",s[s.fontWeight=43]="fontWeight",s[s.formatOnPaste=44]="formatOnPaste",s[s.formatOnType=45]="formatOnType",s[s.glyphMargin=46]="glyphMargin",s[s.gotoLocation=47]="gotoLocation",s[s.hideCursorInOverviewRuler=48]="hideCursorInOverviewRuler",s[s.highlightActiveIndentGuide=49]="highlightActiveIndentGuide",s[s.hover=50]="hover",s[s.inDiffEditor=51]="inDiffEditor",s[s.inlineSuggest=52]="inlineSuggest",s[s.letterSpacing=53]="letterSpacing",s[s.lightbulb=54]="lightbulb",s[s.lineDecorationsWidth=55]="lineDecorationsWidth",s[s.lineHeight=56]="lineHeight",s[s.lineNumbers=57]="lineNumbers",s[s.lineNumbersMinChars=58]="lineNumbersMinChars",s[s.linkedEditing=59]="linkedEditing",s[s.links=60]="links",s[s.matchBrackets=61]="matchBrackets",s[s.minimap=62]="minimap",s[s.mouseStyle=63]="mouseStyle",s[s.mouseWheelScrollSensitivity=64]="mouseWheelScrollSensitivity",s[s.mouseWheelZoom=65]="mouseWheelZoom",s[s.multiCursorMergeOverlapping=66]="multiCursorMergeOverlapping",s[s.multiCursorModifier=67]="multiCursorModifier",s[s.multiCursorPaste=68]="multiCursorPaste",s[s.occurrencesHighlight=69]="occurrencesHighlight",s[s.overviewRulerBorder=70]="overviewRulerBorder",s[s.overviewRulerLanes=71]="overviewRulerLanes",s[s.padding=72]="padding",s[s.parameterHints=73]="parameterHints",s[s.peekWidgetDefaultFocus=74]="peekWidgetDefaultFocus",s[s.definitionLinkOpensInPeek=75]="definitionLinkOpensInPeek",s[s.quickSuggestions=76]="quickSuggestions",s[s.quickSuggestionsDelay=77]="quickSuggestionsDelay",s[s.readOnly=78]="readOnly",s[s.renameOnType=79]="renameOnType",s[s.renderControlCharacters=80]="renderControlCharacters",s[s.renderIndentGuides=81]="renderIndentGuides",s[s.renderFinalNewline=82]="renderFinalNewline",s[s.renderLineHighlight=83]="renderLineHighlight",s[s.renderLineHighlightOnlyWhenFocus=84]="renderLineHighlightOnlyWhenFocus",s[s.renderValidationDecorations=85]="renderValidationDecorations",s[s.renderWhitespace=86]="renderWhitespace",s[s.revealHorizontalRightPadding=87]="revealHorizontalRightPadding",s[s.roundedSelection=88]="roundedSelection",s[s.rulers=89]="rulers",s[s.scrollbar=90]="scrollbar",s[s.scrollBeyondLastColumn=91]="scrollBeyondLastColumn",s[s.scrollBeyondLastLine=92]="scrollBeyondLastLine",s[s.scrollPredominantAxis=93]="scrollPredominantAxis",s[s.selectionClipboard=94]="selectionClipboard",s[s.selectionHighlight=95]="selectionHighlight",s[s.selectOnLineNumbers=96]="selectOnLineNumbers",s[s.showFoldingControls=97]="showFoldingControls",s[s.showUnused=98]="showUnused",s[s.snippetSuggestions=99]="snippetSuggestions",s[s.smartSelect=100]="smartSelect",s[s.smoothScrolling=101]="smoothScrolling",s[s.stickyTabStops=102]="stickyTabStops",s[s.stopRenderingLineAfter=103]="stopRenderingLineAfter",s[s.suggest=104]="suggest",s[s.suggestFontSize=105]="suggestFontSize",s[s.suggestLineHeight=106]="suggestLineHeight",s[s.suggestOnTriggerCharacters=107]="suggestOnTriggerCharacters",s[s.suggestSelection=108]="suggestSelection",s[s.tabCompletion=109]="tabCompletion",s[s.tabIndex=110]="tabIndex",s[s.unusualLineTerminators=111]="unusualLineTerminators",s[s.useShadowDOM=112]="useShadowDOM",s[s.useTabStops=113]="useTabStops",s[s.wordSeparators=114]="wordSeparators",s[s.wordWrap=115]="wordWrap",s[s.wordWrapBreakAfterCharacters=116]="wordWrapBreakAfterCharacters",s[s.wordWrapBreakBeforeCharacters=117]="wordWrapBreakBeforeCharacters",s[s.wordWrapColumn=118]="wordWrapColumn",s[s.wordWrapOverride1=119]="wordWrapOverride1",s[s.wordWrapOverride2=120]="wordWrapOverride2",s[s.wrappingIndent=121]="wrappingIndent",s[s.wrappingStrategy=122]="wrappingStrategy",s[s.showDeprecated=123]="showDeprecated",s[s.inlayHints=124]="inlayHints",s[s.editorClassName=125]="editorClassName",s[s.pixelRatio=126]="pixelRatio",s[s.tabFocusMode=127]="tabFocusMode",s[s.layoutInfo=128]="layoutInfo",s[s.wrappingInfo=129]="wrappingInfo"})(b0||(b0={}));var v0;(function(s){s[s.TextDefined=0]="TextDefined",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(v0||(v0={}));var w0;(function(s){s[s.LF=0]="LF",s[s.CRLF=1]="CRLF"})(w0||(w0={}));var C0;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(C0||(C0={}));var S0;(function(s){s[s.Other=0]="Other",s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(S0||(S0={}));var y0;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(y0||(y0={}));var L0;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.Unknown=0]="Unknown",s[s.Backspace=1]="Backspace",s[s.Tab=2]="Tab",s[s.Enter=3]="Enter",s[s.Shift=4]="Shift",s[s.Ctrl=5]="Ctrl",s[s.Alt=6]="Alt",s[s.PauseBreak=7]="PauseBreak",s[s.CapsLock=8]="CapsLock",s[s.Escape=9]="Escape",s[s.Space=10]="Space",s[s.PageUp=11]="PageUp",s[s.PageDown=12]="PageDown",s[s.End=13]="End",s[s.Home=14]="Home",s[s.LeftArrow=15]="LeftArrow",s[s.UpArrow=16]="UpArrow",s[s.RightArrow=17]="RightArrow",s[s.DownArrow=18]="DownArrow",s[s.Insert=19]="Insert",s[s.Delete=20]="Delete",s[s.KEY_0=21]="KEY_0",s[s.KEY_1=22]="KEY_1",s[s.KEY_2=23]="KEY_2",s[s.KEY_3=24]="KEY_3",s[s.KEY_4=25]="KEY_4",s[s.KEY_5=26]="KEY_5",s[s.KEY_6=27]="KEY_6",s[s.KEY_7=28]="KEY_7",s[s.KEY_8=29]="KEY_8",s[s.KEY_9=30]="KEY_9",s[s.KEY_A=31]="KEY_A",s[s.KEY_B=32]="KEY_B",s[s.KEY_C=33]="KEY_C",s[s.KEY_D=34]="KEY_D",s[s.KEY_E=35]="KEY_E",s[s.KEY_F=36]="KEY_F",s[s.KEY_G=37]="KEY_G",s[s.KEY_H=38]="KEY_H",s[s.KEY_I=39]="KEY_I",s[s.KEY_J=40]="KEY_J",s[s.KEY_K=41]="KEY_K",s[s.KEY_L=42]="KEY_L",s[s.KEY_M=43]="KEY_M",s[s.KEY_N=44]="KEY_N",s[s.KEY_O=45]="KEY_O",s[s.KEY_P=46]="KEY_P",s[s.KEY_Q=47]="KEY_Q",s[s.KEY_R=48]="KEY_R",s[s.KEY_S=49]="KEY_S",s[s.KEY_T=50]="KEY_T",s[s.KEY_U=51]="KEY_U",s[s.KEY_V=52]="KEY_V",s[s.KEY_W=53]="KEY_W",s[s.KEY_X=54]="KEY_X",s[s.KEY_Y=55]="KEY_Y",s[s.KEY_Z=56]="KEY_Z",s[s.Meta=57]="Meta",s[s.ContextMenu=58]="ContextMenu",s[s.F1=59]="F1",s[s.F2=60]="F2",s[s.F3=61]="F3",s[s.F4=62]="F4",s[s.F5=63]="F5",s[s.F6=64]="F6",s[s.F7=65]="F7",s[s.F8=66]="F8",s[s.F9=67]="F9",s[s.F10=68]="F10",s[s.F11=69]="F11",s[s.F12=70]="F12",s[s.F13=71]="F13",s[s.F14=72]="F14",s[s.F15=73]="F15",s[s.F16=74]="F16",s[s.F17=75]="F17",s[s.F18=76]="F18",s[s.F19=77]="F19",s[s.NumLock=78]="NumLock",s[s.ScrollLock=79]="ScrollLock",s[s.US_SEMICOLON=80]="US_SEMICOLON",s[s.US_EQUAL=81]="US_EQUAL",s[s.US_COMMA=82]="US_COMMA",s[s.US_MINUS=83]="US_MINUS",s[s.US_DOT=84]="US_DOT",s[s.US_SLASH=85]="US_SLASH",s[s.US_BACKTICK=86]="US_BACKTICK",s[s.US_OPEN_SQUARE_BRACKET=87]="US_OPEN_SQUARE_BRACKET",s[s.US_BACKSLASH=88]="US_BACKSLASH",s[s.US_CLOSE_SQUARE_BRACKET=89]="US_CLOSE_SQUARE_BRACKET",s[s.US_QUOTE=90]="US_QUOTE",s[s.OEM_8=91]="OEM_8",s[s.OEM_102=92]="OEM_102",s[s.NUMPAD_0=93]="NUMPAD_0",s[s.NUMPAD_1=94]="NUMPAD_1",s[s.NUMPAD_2=95]="NUMPAD_2",s[s.NUMPAD_3=96]="NUMPAD_3",s[s.NUMPAD_4=97]="NUMPAD_4",s[s.NUMPAD_5=98]="NUMPAD_5",s[s.NUMPAD_6=99]="NUMPAD_6",s[s.NUMPAD_7=100]="NUMPAD_7",s[s.NUMPAD_8=101]="NUMPAD_8",s[s.NUMPAD_9=102]="NUMPAD_9",s[s.NUMPAD_MULTIPLY=103]="NUMPAD_MULTIPLY",s[s.NUMPAD_ADD=104]="NUMPAD_ADD",s[s.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",s[s.NUMPAD_SUBTRACT=106]="NUMPAD_SUBTRACT",s[s.NUMPAD_DECIMAL=107]="NUMPAD_DECIMAL",s[s.NUMPAD_DIVIDE=108]="NUMPAD_DIVIDE",s[s.KEY_IN_COMPOSITION=109]="KEY_IN_COMPOSITION",s[s.ABNT_C1=110]="ABNT_C1",s[s.ABNT_C2=111]="ABNT_C2",s[s.MAX_VALUE=112]="MAX_VALUE"})(L0||(L0={}));var x0;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(x0||(x0={}));var D0;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(D0||(D0={}));var k0;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(k0||(k0={}));var I0;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.TEXTAREA=1]="TEXTAREA",s[s.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",s[s.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",s[s.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",s[s.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",s[s.CONTENT_TEXT=6]="CONTENT_TEXT",s[s.CONTENT_EMPTY=7]="CONTENT_EMPTY",s[s.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",s[s.CONTENT_WIDGET=9]="CONTENT_WIDGET",s[s.OVERVIEW_RULER=10]="OVERVIEW_RULER",s[s.SCROLLBAR=11]="SCROLLBAR",s[s.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",s[s.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(I0||(I0={}));var E0;(function(s){s[s.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",s[s.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",s[s.TOP_CENTER=2]="TOP_CENTER"})(E0||(E0={}));var N0;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(N0||(N0={}));var M0;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval",s[s.Custom=4]="Custom"})(M0||(M0={}));var T0;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Blocks=2]="Blocks"})(T0||(T0={}));var A0;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(A0||(A0={}));var R0;(function(s){s[s.Auto=1]="Auto",s[s.Hidden=2]="Hidden",s[s.Visible=3]="Visible"})(R0||(R0={}));var O0;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(O0||(O0={}));var P0;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(P0||(P0={}));var F0;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(F0||(F0={}));var B0;(function(s){s[s.Deprecated=1]="Deprecated"})(B0||(B0={}));var W0;(function(s){s[s.Hidden=0]="Hidden",s[s.Blink=1]="Blink",s[s.Smooth=2]="Smooth",s[s.Phase=3]="Phase",s[s.Expand=4]="Expand",s[s.Solid=5]="Solid"})(W0||(W0={}));var V0;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(V0||(V0={}));var H0;(function(s){s[s.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",s[s.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",s[s.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",s[s.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(H0||(H0={}));var z0;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(z0||(z0={}));class Zf{static chord(e,t){return oi(e,t)}}Zf.CtrlCmd=2048;Zf.Shift=1024;Zf.Alt=512;Zf.WinCtrl=256;function CM(){return{editor:void 0,languages:void 0,CancellationTokenSource:on,Emitter:M,KeyCode:L0,KeyMod:Zf,Position:O,Range:L,Selection:ee,SelectionDirection:O0,MarkerSeverity:x0,MarkerTag:D0,Uri:he,Token:Y_}}var $s;(function(s){s.serviceIds=new Map,s.DI_TARGET="$di$target",s.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[s.DI_DEPENDENCIES]||[]}s.getServiceDependencies=e})($s||($s={}));const qe=Ze("instantiationService");function SM(s,e,t,i){e[$s.DI_TARGET]===e?e[$s.DI_DEPENDENCIES].push({id:s,index:t,optional:i}):(e[$s.DI_DEPENDENCIES]=[{id:s,index:t,optional:i}],e[$s.DI_TARGET]=e)}function Ze(s){if($s.serviceIds.has(s))return $s.serviceIds.get(s);const e=function(t,i,n){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");SM(e,t,n,!1)};return e.toString=()=>s,$s.serviceIds.set(s,e),e}function U0(s){return function(e,t,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");SM(s,e,i,!0)}}const Ge=Ze("codeEditorService");class El{constructor(){this._zoomLevel=0,this._lastZoomLevelChangeTime=0,this._onDidChangeZoomLevel=new M,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this._zoomFactor=1}getZoomLevel(){return this._zoomLevel}getTimeSinceLastZoomLevelChanged(){return Date.now()-this._lastZoomLevelChangeTime}getZoomFactor(){return this._zoomFactor}getPixelRatio(){let e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}El.INSTANCE=new El;function $0(){return El.INSTANCE.getZoomLevel()}function B4(){return El.INSTANCE.getTimeSinceLastZoomLevelChanged()}function yM(s){return El.INSTANCE.onDidChangeZoomLevel(s)}function W4(){return El.INSTANCE.getZoomFactor()}function vm(){return El.INSTANCE.getPixelRatio()}const Yf=navigator.userAgent,qi=Yf.indexOf("Firefox")>=0,Q_=Yf.indexOf("AppleWebKit")>=0,wm=Yf.indexOf("Chrome")>=0,Oc=!wm&&Yf.indexOf("Safari")>=0,V4=!wm&&!Oc&&Q_,su=Yf.indexOf("Android")>=0,H4=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches;let LM=new Array(230),Kv=new Array(112);(function(){for(let e=0;e<Kv.length;e++)Kv[e]=-1;function s(e,t){LM[e]=t,Kv[t]=e}s(3,7),s(8,1),s(9,2),s(13,3),s(16,4),s(17,5),s(18,6),s(19,7),s(20,8),s(27,9),s(32,10),s(33,11),s(34,12),s(35,13),s(36,14),s(37,15),s(38,16),s(39,17),s(40,18),s(45,19),s(46,20),s(48,21),s(49,22),s(50,23),s(51,24),s(52,25),s(53,26),s(54,27),s(55,28),s(56,29),s(57,30),s(65,31),s(66,32),s(67,33),s(68,34),s(69,35),s(70,36),s(71,37),s(72,38),s(73,39),s(74,40),s(75,41),s(76,42),s(77,43),s(78,44),s(79,45),s(80,46),s(81,47),s(82,48),s(83,49),s(84,50),s(85,51),s(86,52),s(87,53),s(88,54),s(89,55),s(90,56),s(93,58),s(96,93),s(97,94),s(98,95),s(99,96),s(100,97),s(101,98),s(102,99),s(103,100),s(104,101),s(105,102),s(106,103),s(107,104),s(108,105),s(109,106),s(110,107),s(111,108),s(112,59),s(113,60),s(114,61),s(115,62),s(116,63),s(117,64),s(118,65),s(119,66),s(120,67),s(121,68),s(122,69),s(123,70),s(124,71),s(125,72),s(126,73),s(127,74),s(128,75),s(129,76),s(130,77),s(144,78),s(145,79),s(186,80),s(187,81),s(188,82),s(189,83),s(190,84),s(191,85),s(192,86),s(193,110),s(194,111),s(219,87),s(220,88),s(221,89),s(222,90),s(223,91),s(226,92),s(229,109),qi?(s(59,80),s(107,81),s(109,83),Re&&s(224,57)):Q_&&(s(91,57),s(Re?93:92,57))})();function z4(s){if(s.charCode){let e=String.fromCharCode(s.charCode).toUpperCase();return pc.fromString(e)}return LM[s.keyCode]||0}const U4=Re?256:2048,$4=512,j4=1024,q4=Re?2048:256;class Mt{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.keyCode=z4(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asRuntimeKeybinding=this._computeRuntimeKeybinding()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeybinding(){return this._asRuntimeKeybinding}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=U4),this.altKey&&(t|=$4),this.shiftKey&&(t|=j4),this.metaKey&&(t|=q4),t|=e,t}_computeRuntimeKeybinding(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new zu(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let j0=!1,Od=null;function K4(s){if(!s.parent||s.parent===s)return null;try{let e=s.location,t=s.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&(e.protocol!==t.protocol||e.hostname!==t.hostname||e.port!==t.port))return j0=!0,null}catch{return j0=!0,null}return s.parent}class q0{static getSameOriginWindowChain(){if(!Od){Od=[];let e=window,t;do t=K4(e),t?Od.push({window:e,iframeElement:e.frameElement||null}):Od.push({window:e,iframeElement:null}),e=t;while(e)}return Od.slice(0)}static hasDifferentOriginAncestor(){return Od||this.getSameOriginWindowChain(),j0}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0,o=this.getSameOriginWindowChain();for(const r of o){if(i+=r.window.scrollY,n+=r.window.scrollX,r.window===t||!r.iframeElement)break;let a=r.iframeElement.getBoundingClientRect();i+=a.top,n+=a.left}return{top:i,left:n}}}class Zn{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);let t=q0.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class Pc{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){let n=e,o=e;if(typeof n.wheelDeltaY<"u")this.deltaY=n.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?qi&&!Re?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof n.wheelDeltaX<"u")Oc&&Si?this.deltaX=-(n.wheelDeltaX/120):this.deltaX=n.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?qi&&!Re?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation()}}var G4=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function Z4(s){return!!s&&typeof s.then=="function"}function fi(s){const e=new on,t=s(e.token),i=new Promise((n,o)=>{e.token.onCancellationRequested(()=>{o(mh())}),Promise.resolve(t).then(r=>{e.dispose(),n(r)},r=>{e.dispose(),o(r)})});return new class{cancel(){e.cancel()}then(n,o){return i.then(n,o)}catch(n){return this.then(void 0,n)}finally(n){return i.finally(n)}}}function xM(s,e,t){return Promise.race([s,new Promise(i=>e.onCancellationRequested(()=>i(t)))])}class Y4{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{this.queuedPromise=null;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(n=>{this.activePromise=null,t(n)},n=>{this.activePromise=null,i(n)})})}}class yr{constructor(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){return this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,n)=>{this.doResolve=i,this.doReject=n}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const i=this.task;return this.task=null,i()}})),this.timeout=setTimeout(()=>{this.timeout=null,this.doResolve&&this.doResolve(null)},t),this.completionPromise}isTriggered(){return this.timeout!==null}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject&&this.doReject(mh()),this.completionPromise=null)}cancelTimeout(){this.timeout!==null&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancel()}}class X4{constructor(e){this.delayer=new yr(e),this.throttler=new Y4}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}dispose(){this.delayer.dispose()}}function pa(s,e){return e?new Promise((t,i)=>{const n=setTimeout(t,s);e.onCancellationRequested(()=>{clearTimeout(n),i(mh())})}):fi(t=>pa(s,t))}function Nl(s,e=0){const t=setTimeout(s,e);return Pe(()=>clearTimeout(t))}function DM(s,e=i=>!!i,t=null){let i=0;const n=s.length,o=()=>{if(i>=n)return Promise.resolve(t);const r=s[i++];return Promise.resolve(r()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class an{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class Xf{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class bt{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner&&this.runner()}}let Cm;(function(){if(typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"){const s=Object.freeze({didTimeout:!0,timeRemaining(){return 15}});Cm=e=>{const t=setTimeout(()=>e(s));let i=!1;return{dispose(){i||(i=!0,clearTimeout(t))}}}}else Cm=(s,e)=>{const t=requestIdleCallback(s,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class _c{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=Cm(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}}var K0;(function(s){function e(t){return G4(this,void 0,void 0,function*(){let i;const n=yield Promise.all(t.map(o=>o.then(r=>r,r=>{i||(i=r)})));if(typeof i<"u")throw i;return n})}s.settled=e})(K0||(K0={}));var Oe;(function(s){s.inMemory="inmemory",s.vscode="vscode",s.internal="private",s.walkThrough="walkThrough",s.walkThroughSnippet="walkThroughSnippet",s.http="http",s.https="https",s.file="file",s.mailto="mailto",s.untitled="untitled",s.data="data",s.command="command",s.vscodeRemote="vscode-remote",s.vscodeRemoteResource="vscode-remote-resource",s.userData="vscode-userdata",s.vscodeCustomEditor="vscode-custom-editor",s.vscodeNotebook="vscode-notebook",s.vscodeNotebookCell="vscode-notebook-cell",s.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",s.vscodeNotebookCellOutput="vscode-notebook-cell-output",s.vscodeInteractive="vscode-interactive",s.vscodeInteractiveInput="vscode-interactive-input",s.vscodeSettings="vscode-settings",s.vscodeWorkspaceTrust="vscode-workspace-trust",s.vscodeTerminal="vscode-terminal",s.webviewPanel="webview-panel",s.vscodeWebview="vscode-webview",s.extension="extension",s.vscodeFileResource="vscode-file",s.tmp="tmp"})(Oe||(Oe={}));class Q4{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)return this._delegate(e);const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&tkn=${encodeURIComponent(o)}`),he.from({scheme:gh?this._preferredWebSchema:Oe.vscodeRemoteResource,authority:`${i}:${n}`,path:"/vscode-remote-resource",query:r})}}const kM=new Q4;class J4{constructor(){this.FALLBACK_AUTHORITY="vscode-app"}asBrowserUri(e,t,i){const n=this.toUri(e,t);if(n.scheme===Oe.vscodeRemote)return kM.rewrite(n);let o=!1;return Mo&&(i||IF)&&n.scheme===Oe.file&&(o=!0),n.scheme===Oe.file&&typeof jt.importScripts=="function"&&jt.origin==="vscode-file://vscode-app"&&(o=!0),o?n.with({scheme:Oe.vscodeFileResource,authority:n.authority||this.FALLBACK_AUTHORITY,query:null,fragment:null}):n}toUri(e,t){return he.isUri(e)?e:he.parse(t.toUrl(e))}}const IM=new J4,J_={clipboard:{writeText:Mo||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Mo||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0)};function hi(s){for(;s.firstChild;)s.firstChild.remove()}function jy(s){var e;return(e=s==null?void 0:s.isConnected)!==null&&e!==void 0?e:!1}class e5{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function K(s,e,t,i){return new e5(s,e,t,i)}function EM(s){return function(e){return s(new Zn(e))}}function t5(s){return function(e){return s(new Mt(e))}}let Gt=function(e,t,i,n){let o=i;return t==="click"||t==="mousedown"?o=EM(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=t5(i)),K(e,t,o,n)},i5=function(e,t,i){let n=EM(t);return qy(e,n,i)};function qy(s,e,t){return K(s,To&&J_.pointerEvents?le.POINTER_DOWN:le.MOUSE_DOWN,e,t)}function NM(s,e,t){return K(s,To&&J_.pointerEvents?le.POINTER_UP:le.MOUSE_UP,e,t)}function Ky(s,e){return K(s,"mouseout",t=>{let i=t.relatedTarget;for(;i&&i!==s;)i=i.parentNode;i!==s&&e(t)})}function n5(s,e){return K(s,"pointerout",t=>{let i=t.relatedTarget;for(;i&&i!==s;)i=i.parentNode;i!==s&&e(t)})}let Gv=null;function s5(s){if(!Gv){const e=t=>setTimeout(()=>t(new Date().getTime()),0);Gv=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}return Gv.call(self,s)}let MM,Ro;class Zv{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){ve(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let s=[],e=null,t=!1,i=!1,n=()=>{for(t=!1,e=s,s=[],i=!0;e.length>0;)e.sort(Zv.sort),e.shift().execute();i=!1};Ro=(o,r=0)=>{let a=new Zv(o,r);return s.push(a),t||(t=!0,s5(n)),a},MM=(o,r)=>{if(i){let a=new Zv(o,r);return e.push(a),a}else return Ro(o,r)}})();const o5=8,r5=function(s,e){return e};class a5 extends U{constructor(e,t,i,n=r5,o=o5){super();let r=null,a=0,l=this._register(new an),d=()=>{a=new Date().getTime(),i(r),r=null};this._register(K(e,t,c=>{r=n(r,c);let h=new Date().getTime()-a;h>=o?(l.cancel(),d()):l.setIfNotSet(d,o-h)}))}}function Gy(s,e,t,i,n){return new a5(s,e,t,i,n)}function Zy(s){return document.defaultView.getComputedStyle(s,null)}function eb(s){if(s!==document.body)return new gt(s.clientWidth,s.clientHeight);if(To&&window.visualViewport)return new gt(window.visualViewport.width,window.visualViewport.height);if(window.innerWidth&&window.innerHeight)return new gt(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new gt(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new gt(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class kt{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let n=Zy(e),o="0";return n&&(n.getPropertyValue?o=n.getPropertyValue(t):o=n.getAttribute(i)),kt.convertToPixels(e,o)}static getBorderLeftWidth(e){return kt.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return kt.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return kt.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return kt.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return kt.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return kt.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return kt.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return kt.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return kt.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return kt.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return kt.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return kt.getDimension(e,"margin-bottom","marginBottom")}}class gt{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new gt(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof gt?e:new gt(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}function TM(s){let e=s.offsetParent,t=s.offsetTop,i=s.offsetLeft;for(;(s=s.parentNode)!==null&&s!==document.body&&s!==document.documentElement;){t-=s.scrollTop;const n=RM(s)?null:Zy(s);n&&(i-=n.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(i+=kt.getBorderLeftWidth(s),t+=kt.getBorderTopWidth(s),t+=s.offsetTop,i+=s.offsetLeft,e=s.offsetParent)}return{left:i,top:t}}function l5(s,e,t){typeof e=="number"&&(s.style.width=`${e}px`),typeof t=="number"&&(s.style.height=`${t}px`)}function vi(s){let e=s.getBoundingClientRect();return{left:e.left+_r.scrollX,top:e.top+_r.scrollY,width:e.width,height:e.height}}const _r=new class{get scrollX(){return typeof window.scrollX=="number"?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft}get scrollY(){return typeof window.scrollY=="number"?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop}};function cs(s){let e=kt.getMarginLeft(s)+kt.getMarginRight(s);return s.offsetWidth+e}function Yv(s){let e=kt.getBorderLeftWidth(s)+kt.getBorderRightWidth(s),t=kt.getPaddingLeft(s)+kt.getPaddingRight(s);return s.offsetWidth-e-t}function d5(s){let e=kt.getBorderTopWidth(s)+kt.getBorderBottomWidth(s),t=kt.getPaddingTop(s)+kt.getPaddingBottom(s);return s.offsetHeight-e-t}function G0(s){let e=kt.getMarginTop(s)+kt.getMarginBottom(s);return s.offsetHeight+e}function Lr(s,e){for(;s;){if(s===e)return!0;s=s.parentNode}return!1}function AM(s,e,t){for(;s&&s.nodeType===s.ELEMENT_NODE;){if(s.classList.contains(e))return s;if(t){if(typeof t=="string"){if(s.classList.contains(t))return null}else if(s===t)return null}s=s.parentNode}return null}function tk(s,e,t){return!!AM(s,e,t)}function RM(s){return s&&!!s.host&&!!s.mode}function tb(s){return!!_h(s)}function _h(s){for(;s.parentNode;){if(s===document.body)return null;s=s.parentNode}return RM(s)?s:null}function bc(){let s=document.activeElement;for(;s!=null&&s.shadowRoot;)s=s.shadowRoot.activeElement;return s}function On(s=document.getElementsByTagName("head")[0]){let e=document.createElement("style");return e.type="text/css",e.media="screen",s.appendChild(e),e}let Xv=null;function OM(){return Xv||(Xv=On()),Xv}function c5(s){var e,t;return!((e=s==null?void 0:s.sheet)===null||e===void 0)&&e.rules?s.sheet.rules:!((t=s==null?void 0:s.sheet)===null||t===void 0)&&t.cssRules?s.sheet.cssRules:[]}function Z0(s,e,t=OM()){!t||!e||t.sheet.insertRule(s+"{"+e+"}",0)}function Sm(s,e=OM()){if(!e)return;let t=c5(e),i=[];for(let n=0;n<t.length;n++)t[n].selectorText.indexOf(s)!==-1&&i.push(n);for(let n=i.length-1;n>=0;n--)e.sheet.deleteRule(i[n])}function PM(s){return typeof HTMLElement=="object"?s instanceof HTMLElement:s&&typeof s=="object"&&s.nodeType===1&&typeof s.nodeName=="string"}const le={CLICK:"click",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",CONTEXT_MENU:"contextmenu",KEY_DOWN:"keydown",KEY_UP:"keyup",CHANGE:"change",FOCUS:"focus",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",DRAG_START:"dragstart"},et={stop:function(s,e){s.preventDefault?s.preventDefault():s.returnValue=!1,e&&(s.stopPropagation?s.stopPropagation():s.cancelBubble=!0)}};function h5(s){let e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function u5(s,e){for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)s.scrollTop!==e[t]&&(s.scrollTop=e[t]),s=s.parentNode}class f5 extends U{constructor(e){super(),this._onDidFocus=this._register(new M),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new M),this.onDidBlur=this._onDidBlur.event;let t=Lr(document.activeElement,e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{Lr(document.activeElement,e)!==t&&(t?o():n())},this._register(K(e,le.FOCUS,n,!0)),this._register(K(e,le.BLUR,o,!0))}}function Fc(s){return new f5(s)}function $(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function ma(s,...e){s.innerText="",$(s,...e)}const g5=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Uu;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(Uu||(Uu={}));function FM(s,e,t,...i){let n=g5.exec(e);if(!n)throw new Error("Bad use of emmet");t=Object.assign({},t||{});let o=n[1]||"div",r;return s!==Uu.HTML?r=document.createElementNS(s,o):r=document.createElement(o),n[3]&&(r.id=n[3]),n[4]&&(r.className=n[4].replace(/\./g," ").trim()),Object.keys(t).forEach(a=>{const l=t[a];typeof l>"u"||(/^on\w+$/.test(a)?r[a]=l:a==="selected"?l&&r.setAttribute(a,"true"):r.setAttribute(a,l))}),r.append(...i),r}function Y(s,e,...t){return FM(Uu.HTML,s,e,...t)}Y.SVG=function(s,e,...t){return FM(Uu.SVG,s,e,...t)};function En(...s){for(let e of s)e.style.display="",e.removeAttribute("aria-hidden")}function Qi(...s){for(let e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function ik(s){return Array.prototype.slice.call(document.getElementsByTagName(s),0)}function nk(s){const e=window.devicePixelRatio*s;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function BM(s){window.open(s,"_blank","noopener")}function p5(s){const e=()=>{s(),t=Ro(e)};let t=Ro(e);return Pe(()=>t.dispose())}kM.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function xr(s){return s?`url('${IM.asBrowserUri(s).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function sk(s){return`'${s.replace(/'/g,"%27")}'`}class ul extends M{constructor(){super(),this._subscriptions=new X,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(K(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Mt(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(K(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(K(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(K(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(K(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(K(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return ul.instance||(ul.instance=new ul),ul.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}function m5(s,e){const t=window.matchMedia(s);typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)}function WM(s){return!s||typeof s!="string"?!0:s.trim().length===0}const _5=/{(\d+)}/g;function Ai(s,...e){return e.length===0?s:s.replace(_5,function(t,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=e.length?t:e[n]})}function Yy(s){return s.replace(/[<>&]/g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}})}function Ys(s){return s.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function b5(s,e=" "){const t=Xy(s,e);return VM(t,e)}function Xy(s,e){if(!s||!e)return s;const t=e.length;if(t===0||s.length===0)return s;let i=0;for(;s.indexOf(e,i)===i;)i=i+t;return s.substring(i)}function VM(s,e){if(!s||!e)return s;const t=e.length,i=s.length;if(t===0||i===0)return s;let n=i,o=-1;for(;o=s.lastIndexOf(e,n-1),!(o===-1||o+t!==n);){if(o===0)return"";n=o}return s.substring(0,n)}function v5(s){return s.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function w5(s){return s.replace(/\*/g,"")}function HM(s,e,t={}){if(!s)throw new Error("Cannot create regex from empty string");e||(s=Ys(s)),t.wholeWord&&(/\B/.test(s.charAt(0))||(s="\\b"+s),/\B/.test(s.charAt(s.length-1))||(s=s+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(s,i)}function C5(s){return s.source==="^"||s.source==="^$"||s.source==="$"||s.source==="^\\s*$"?!1:!!(s.exec("")&&s.lastIndex===0)}function Qv(s){return(s.global?"g":"")+(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")}function Fa(s){return s.split(/\r\n|\r|\n/)}function bn(s){for(let e=0,t=s.length;e<t;e++){const i=s.charCodeAt(e);if(i!==32&&i!==9)return e}return-1}function ct(s,e=0,t=s.length){for(let i=e;i<t;i++){const n=s.charCodeAt(i);if(n!==32&&n!==9)return s.substring(e,i)}return s.substring(e,t)}function xo(s,e=s.length-1){for(let t=e;t>=0;t--){const i=s.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function $u(s,e){return s<e?-1:s>e?1:0}function Qy(s,e,t=0,i=s.length,n=0,o=e.length){for(;t<i&&n<o;t++,n++){let l=s.charCodeAt(t),d=e.charCodeAt(n);if(l<d)return-1;if(l>d)return 1}const r=i-t,a=o-n;return r<a?-1:r>a?1:0}function Y0(s,e){return Jy(s,e,0,s.length,0,e.length)}function Jy(s,e,t=0,i=s.length,n=0,o=e.length){for(;t<i&&n<o;t++,n++){let l=s.charCodeAt(t),d=e.charCodeAt(n);if(l===d)continue;const c=l-d;if(!(c===32&&Vs(d))&&!(c===-32&&Vs(l)))return fr(l)&&fr(d)?c:Qy(s.toLowerCase(),e.toLowerCase(),t,i,n,o)}const r=i-t,a=o-n;return r<a?-1:r>a?1:0}function fr(s){return s>=97&&s<=122}function Vs(s){return s>=65&&s<=90}function ok(s){return fr(s)||Vs(s)}function ou(s,e){return s.length===e.length&&zM(s,e)}function zM(s,e,t=s.length){for(let i=0;i<t;i++){const n=s.charCodeAt(i),o=e.charCodeAt(i);if(n!==o){if(ok(n)&&ok(o)){const r=Math.abs(n-o);if(r!==0&&r!==32)return!1}else if(String.fromCharCode(n).toLowerCase()!==String.fromCharCode(o).toLowerCase())return!1}}return!0}function UM(s,e){const t=e.length;return e.length>s.length?!1:zM(s,e,t)}function ju(s,e){let t,i=Math.min(s.length,e.length);for(t=0;t<i;t++)if(s.charCodeAt(t)!==e.charCodeAt(t))return t;return i}function X0(s,e){let t,i=Math.min(s.length,e.length);const n=s.length-1,o=e.length-1;for(t=0;t<i;t++)if(s.charCodeAt(n-t)!==e.charCodeAt(o-t))return t;return i}function di(s){return 55296<=s&&s<=56319}function Bc(s){return 56320<=s&&s<=57343}function eL(s,e){return(s-55296<<10)+(e-56320)+65536}function er(s,e,t){const i=s.charCodeAt(t);if(di(i)&&t+1<e){const n=s.charCodeAt(t+1);if(Bc(n))return eL(i,n)}return i}function vc(s,e){const t=s.charCodeAt(e-1);if(Bc(t)&&e>1){const i=s.charCodeAt(e-2);if(di(i))return eL(i,t)}return t}function ym(s,e){const t=gr.getInstance(),i=e,n=s.length,o=er(s,n,e);e+=o>=65536?2:1;let r=t.getGraphemeBreakType(o);for(;e<n;){const a=er(s,n,e),l=t.getGraphemeBreakType(a);if(_u(r,l))break;e+=a>=65536?2:1,r=l}return e-i}function S5(s,e){const t=gr.getInstance(),i=e,n=vc(s,e);e-=n>=65536?2:1;let o=t.getGraphemeBreakType(n);for(;e>0;){const r=vc(s,e),a=t.getGraphemeBreakType(r);if(_u(a,o))break;e-=r>=65536?2:1,o=a}return i-e}function y5(s){const e=s.byteLength,t=[];let i=0;for(;i<e;){const n=s[i];let o;if(n>=240&&i+3<e?o=(s[i++]&7)<<18>>>0|(s[i++]&63)<<12>>>0|(s[i++]&63)<<6>>>0|(s[i++]&63)<<0>>>0:n>=224&&i+2<e?o=(s[i++]&15)<<12>>>0|(s[i++]&63)<<6>>>0|(s[i++]&63)<<0>>>0:n>=192&&i+1<e?o=(s[i++]&31)<<6>>>0|(s[i++]&63)<<0>>>0:o=s[i++],o>=0&&o<=55295||o>=57344&&o<=65535)t.push(String.fromCharCode(o));else if(o>=65536&&o<=1114111){const r=o-65536,a=55296+((r&1047552)>>>10),l=56320+((r&1023)>>>0);t.push(String.fromCharCode(a)),t.push(String.fromCharCode(l))}else t.push("")}return t.join("")}const L5=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function ib(s){return L5.test(s)}const x5=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function D5(s){return x5.test(s)}const k5=/^[\t\n\r\x20-\x7E]*$/;function tL(s){return k5.test(s)}const $M=/[\u2028\u2029]/;function jM(s){return $M.test(s)}function I5(s){for(let e=0,t=s.length;e<t;e++)if(Ks(s.charCodeAt(e)))return!0;return!1}function Ks(s){return s=+s,s>=11904&&s<=55215||s>=63744&&s<=64255||s>=65281&&s<=65374}function mu(s){return s>=127462&&s<=127487||s===8986||s===8987||s===9200||s===9203||s>=9728&&s<=10175||s===11088||s===11093||s>=127744&&s<=128591||s>=128640&&s<=128764||s>=128992&&s<=129003||s>=129280&&s<=129535||s>=129648&&s<=129750}const E5="\uFEFF";function iL(s){return!!(s&&s.length>0&&s.charCodeAt(0)===65279)}function N5(s,e=!1){return s?(e&&(s=s.replace(/\\./g,"")),s.toLowerCase()!==s):!1}function qM(s){return s=s%(2*26),s<26?String.fromCharCode(97+s):String.fromCharCode(65+s-26)}function Pd(s){return gr.getInstance().getGraphemeBreakType(s)}function _u(s,e){return s===0?e!==5&&e!==7:s===2&&e===3?!1:s===4||s===2||s===3||e===4||e===2||e===3?!0:!(s===8&&(e===8||e===9||e===11||e===12)||(s===11||s===9)&&(e===9||e===10)||(s===12||s===10)&&e===10||e===5||e===13||e===7||s===1||s===13&&e===14||s===6&&e===6)}class gr{constructor(){this._data=M5()}static getInstance(){return gr._INSTANCE||(gr._INSTANCE=new gr),gr._INSTANCE}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(e<t[3*n])n=2*n;else if(e>t[3*n+1])n=2*n+1;else return t[3*n+2];return 0}}gr._INSTANCE=null;function M5(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function T5(s,e){if(s===0)return 0;const t=A5(s,e);if(t!==void 0)return t;const i=vc(e,s);return s-=kp(i),s}function A5(s,e){let t=vc(e,s);for(s-=kp(t);R5(t)||t===65039||t===8419;){if(s===0)return;t=vc(e,s),s-=kp(t)}if(mu(t)){if(s>=0){const i=vc(e,s);i===8205&&(s-=kp(i))}return s}}function kp(s){return s>=65536?2:1}function R5(s){return 127995<=s&&s<=127999}var rk,ak;class O5{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){const t=e.charCodeAt(0),i=this._value.charCodeAt(this._pos);return t-i}value(){return this._value[this._pos]}}class P5{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?Qy(e,this._value,0,e.length,this._from,this._to):Jy(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class F5{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){return this._value=e.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++){const t=this._value.charCodeAt(this._to);if(t===47||this._splitOnBackslash&&t===92)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?Qy(e,this._value,0,e.length,this._from,this._to):Jy(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class B5{constructor(e){this._ignorePathCasing=e,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new F5(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===1)return Y0(e,this._value.scheme);if(this._states[this._stateIdx]===2)return Y0(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return $u(e,this._value.query);if(this._states[this._stateIdx]===5)return $u(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}}class Ig{isEmpty(){return!this.left&&!this.mid&&!this.right&&!this.value}}class wc{constructor(e){this._iter=e}static forUris(e=()=>!1){return new wc(new B5(e))}static forStrings(){return new wc(new O5)}static forConfigKeys(){return new wc(new P5)}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;for(this._root||(this._root=new Ig,this._root.segment=i.value()),n=this._root;;){const r=i.cmp(n.segment);if(r>0)n.left||(n.left=new Ig,n.left.segment=i.value()),n=n.left;else if(r<0)n.right||(n.right=new Ig,n.right.segment=i.value()),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new Ig,n.mid.segment=i.value()),n=n.mid;else break}const o=n.value;return n.value=t,n.key=e,o}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const n=t.cmp(i.segment);if(n>0)i=i.left;else if(n<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),n=[];let o=this._root;for(;o;){const r=i.cmp(o.segment);if(r>0)n.push([1,o]),o=o.left;else if(r<0)n.push([-1,o]),o=o.right;else if(i.hasNext())i.next(),n.push([0,o]),o=o.mid;else{for(t?(o.left=void 0,o.mid=void 0,o.right=void 0):o.value=void 0;n.length>0&&o.isEmpty();){let[a,l]=n.pop();switch(a){case 1:l.left=void 0;break;case 0:l.mid=void 0;break;case-1:l.right=void 0;break}o=l}break}}}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),n=i.value||n,i=i.mid;else break}return i&&i.value||n}findSuperstr(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const n=t.cmp(i.segment);if(n>0)i=i.left;else if(n<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else return i.mid?this._entries(i.mid):void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}*_entries(e){if(!e)return;const t=[e];for(;t.length>0;){const i=t.pop();i&&(i.value&&(yield[i.key,i.value]),i.left&&t.push(i.left),i.mid&&t.push(i.mid),i.right&&t.push(i.right))}}}class Ji{constructor(e,t){this[rk]="ResourceMap",e instanceof Ji?(this.map=new Map(e.map),this.toKey=t??Ji.defaultToKey):(this.map=new Map,this.toKey=e??Ji.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),t),this}get(e){return this.map.get(this.toKey(e))}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(let[i,n]of this.map)e(n,he.parse(i),this)}values(){return this.map.values()}*keys(){for(let e of this.map.keys())yield he.parse(e)}*entries(){for(let e of this.map.entries())yield[he.parse(e[0]),e[1]]}*[(rk=Symbol.toStringTag,Symbol.iterator)](){for(let e of this.map)yield[he.parse(e[0]),e[1]]}}Ji.defaultToKey=s=>s.toString();class W5{constructor(){this[ak]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,i!==0&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(n);break;case 1:this.addItemFirst(n);break;case 2:this.addItemLast(n);break;default:this.addItemLast(n);break}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return n}[(ak=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(i.previous=n,n.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,n=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=n,n.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class ud extends W5{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}const lk=typeof Buffer<"u",V5=typeof TextDecoder<"u";let Jv;class nb{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(e){return lk&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new nb(e)}toString(){return lk?this.buffer.toString():V5?(Jv||(Jv=new TextDecoder),Jv.decode(this.buffer)):y5(this.buffer)}}function H5(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0}function z5(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function As(s,e){return s[e]*Math.pow(2,24)+s[e+1]*Math.pow(2,16)+s[e+2]*Math.pow(2,8)+s[e+3]}function Rs(s,e,t){s[t+3]=e,e=e>>>8,s[t+2]=e,e=e>>>8,s[t+1]=e,e=e>>>8,s[t]=e}function dk(s,e){return s[e]}function ck(s,e,t){s[t]=e}function Q0(s){let e=JSON.parse(s);return e=J0(e),e}function J0(s,e=0){if(!s||e>200)return s;if(typeof s=="object"){switch(s.$mid){case 1:return he.revive(s);case 2:return new RegExp(s.source,s.flags)}if(s instanceof nb||s instanceof Uint8Array)return s;if(Array.isArray(s))for(let t=0;t<s.length;++t)s[t]=J0(s[t],e+1);else for(const t in s)Object.hasOwnProperty.call(s,t)&&(s[t]=J0(s[t],e+1))}return s}function U5(s){return s.replace(/[\\/]/g,Yt.sep)}function $5(s){return s.indexOf("/")===-1&&(s=U5(s)),/^[a-zA-Z]:(\/|$)/.test(s)&&(s="/"+s),s}function j5(s,e,t,i=vl){return s===e?!0:!s||!e||e.length>s.length?!1:(e.charAt(e.length-1)!==i&&(e+=i),s.indexOf(e)===0)}function q5(s){return s>=65&&s<=90||s>=97&&s<=122}function K5(s){const e=Uy(s);return Si?s.length>3?!1:KM(e)&&(s.length===2||e.charCodeAt(2)===92):e===Yt.sep}function KM(s){return Si?q5(s.charCodeAt(0))&&s.charCodeAt(1)===58:!1}function Ip(s){return bm(s,!0)}class G5{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:$u(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()}joinPath(e,...t){return he.joinPath(e,...t)}basenameOrAuthority(e){return Is(e)||e.authority}basename(e){return Yt.basename(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Oe.file?t=he.file(_M(Ip(e))).path:(t=Yt.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===Oe.file?t=he.file(Uy(Ip(e))).path:t=Yt.normalize(e.path),e.with({path:t})}resolvePath(e,t){if(e.scheme===Oe.file){const i=he.file(I4(Ip(e),t));return e.with({authority:i.authority,path:i.path})}return t=$5(t),e.with({path:Yt.resolve(e.path,t)})}}const rn=new G5(()=>!1),GM=rn.isEqual.bind(rn),ZM=rn.basenameOrAuthority.bind(rn),Is=rn.basename.bind(rn),nL=rn.dirname.bind(rn),Z5=rn.joinPath.bind(rn),Y5=rn.normalizePath.bind(rn),hk=rn.resolvePath.bind(rn);var _a;(function(s){s.META_DATA_LABEL="label",s.META_DATA_DESCRIPTION="description",s.META_DATA_SIZE="size",s.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,l]=r.split(":");a&&l&&i.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(s.META_DATA_MIME,o),i}s.parseMetaData=e})(_a||(_a={}));function YM(s){return Array.isArray(s)}function es(s){return typeof s=="string"}function tn(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function Ml(s){return typeof s=="number"&&!isNaN(s)}function XM(s){return s===!0||s===!1}function ji(s){return typeof s>"u"}function qn(s){return ji(s)||s===null}function nt(s,e){if(!s)throw new Error("Unexpected type")}function Eg(s){if(qn(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function bu(s){return typeof s=="function"}function X5(s,e){const t=Math.min(s.length,e.length);for(let i=0;i<t;i++)Q5(s[i],e[i])}function Q5(s,e){if(es(e)){if(typeof s!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(bu(e)){try{if(s instanceof e)return}catch{}if(!qn(s)&&s.constructor===e||e.length===1&&e.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function J5(s){let e=[],t=Object.getPrototypeOf(s);for(;Object.prototype!==t;)e=e.concat(Object.getOwnPropertyNames(t)),t=Object.getPrototypeOf(t);return e}function sL(s){const e=[];for(const t of J5(s))typeof s[t]=="function"&&e.push(t);return e}function QM(s,e){const t=n=>function(){const o=Array.prototype.slice.call(arguments,0);return e(n,o)};let i={};for(const n of s)i[n]=t(n);return i}function Tn(s){return s===null?void 0:s}function e3(s){throw new Error("Unreachable")}const Wt=Ze("commandService"),He=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new M,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(s,e){if(!s)throw new Error("invalid command");if(typeof s=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:s,handler:e})}if(s.description){const r=[];for(let l of s.description.args)r.push(l.constraint);const a=s.handler;s.handler=function(l,...d){return X5(d,r),a(l,...d)}}const{id:t}=s;let i=this._commands.get(t);i||(i=new Mn,this._commands.set(t,i));let n=i.unshift(s),o=Pe(()=>{n();const r=this._commands.get(t);r!=null&&r.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(s,e){return He.registerCommand(s,(t,...i)=>t.get(Wt).executeCommand(e,...i))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return Be.first(e)}getCommands(){const s=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&s.set(e,t)}return s}};He.registerCommand("noop",()=>{});var Lm;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(Lm||(Lm={}));var uk=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Oo=Ze("openerService"),t3=Object.freeze({_serviceBrand:void 0,registerOpener(){return U.None},registerValidator(){return U.None},registerExternalUriResolver(){return U.None},setDefaultExternalOpener(){},registerExternalOpener(){return U.None},open(){return uk(this,void 0,void 0,function*(){return!1})},resolveExternalUri(s){return uk(this,void 0,void 0,function*(){return{resolved:s,dispose(){}}})}});function Qd(s,e){return he.isUri(s)?ou(s.scheme,e):UM(s,e+":")}var oL=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},xm=function(s,e){return function(t,i){e(t,i,s)}},el=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let eS=class{constructor(e){this._commandService=e}open(e,t){return el(this,void 0,void 0,function*(){if(!Qd(e,Oe.command))return!1;if(!(t!=null&&t.allowCommands))return!0;typeof e=="string"&&(e=he.parse(e));let i=[];try{i=Q0(decodeURIComponent(e.query))}catch{try{i=Q0(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};eS=oL([xm(0,Wt)],eS);let tS=class{constructor(e){this._editorService=e}open(e,t){return el(this,void 0,void 0,function*(){typeof e=="string"&&(e=he.parse(e));let i;const n=/^L?(\d+)(?:,(\d+))?/.exec(e.fragment);return n&&(i={startLineNumber:parseInt(n[1]),startColumn:n[2]?parseInt(n[2]):1},e=e.with({fragment:""})),e.scheme===Oe.file&&(e=Y5(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,context:t!=null&&t.fromUserGesture?Lm.USER:Lm.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};tS=oL([xm(0,Ge)],tS);let iS=class{constructor(e,t){this._openers=new Mn,this._validators=new Mn,this._resolvers=new Mn,this._resolvedUriTargets=new Ji(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Mn,this._defaultExternalOpener={openExternal:i=>el(this,void 0,void 0,function*(){return Qd(i,Oe.http)||Qd(i,Oe.https)?BM(i):window.location.href=i,!0})},this._openers.push({open:(i,n)=>el(this,void 0,void 0,function*(){return n!=null&&n.openExternal||Qd(i,Oe.mailto)||Qd(i,Oe.http)||Qd(i,Oe.https)?(yield this._doOpenExternal(i,n),!0):!1})}),this._openers.push(new eS(t)),this._openers.push(new tS(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}registerValidator(e){return{dispose:this._validators.push(e)}}registerExternalUriResolver(e){return{dispose:this._resolvers.push(e)}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){return{dispose:this._externalOpeners.push(e)}}open(e,t){var i;return el(this,void 0,void 0,function*(){const n=typeof e=="string"?he.parse(e):e,o=(i=this._resolvedUriTargets.get(n))!==null&&i!==void 0?i:e;for(const r of this._validators)if(!(yield r.shouldOpen(o)))return!1;for(const r of this._openers)if(yield r.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return el(this,void 0,void 0,function*(){for(const i of this._resolvers)try{const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return el(this,void 0,void 0,function*(){const i=typeof e=="string"?he.parse(e):e;let n;try{n=(yield this.resolveExternalUri(i,t)).resolved}catch{n=i}let o;if(typeof e=="string"&&i.toString()===n.toString()?o=e:o=encodeURI(n.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:r},Fe.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Fe.None)})}dispose(){this._validators.clear()}};iS=oL([xm(0,Ge),xm(1,Wt)],iS);function Ep(s,e){if(!s)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function Zr(s){if(!s||typeof s!="object"||s instanceof RegExp)return s;const e=Array.isArray(s)?[]:{};return Object.keys(s).forEach(t=>{s[t]&&typeof s[t]=="object"?e[t]=Zr(s[t]):e[t]=s[t]}),e}function i3(s){if(!s||typeof s!="object")return s;const e=[s];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(JM.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&e.push(n)}}return s}const JM=Object.prototype.hasOwnProperty;function n3(s,e){return nS(s,e,new Set)}function nS(s,e,t){if(qn(s))return s;const i=e(s);if(typeof i<"u")return i;if(YM(s)){const n=[];for(const o of s)n.push(nS(o,e,t));return n}if(tn(s)){if(t.has(s))throw new Error("Cannot clone recursive data-structure");t.add(s);const n={};for(let o in s)JM.call(s,o)&&(n[o]=nS(s[o],e,t));return t.delete(s),n}return s}function eo(s,e,t=!0){return tn(s)?(tn(e)&&Object.keys(e).forEach(i=>{i in s?t&&(tn(s[i])&&tn(e[i])?eo(s[i],e[i],t):s[i]=e[i]):s[i]=e[i]}),s):e}function br(s,e){if(s===e)return!0;if(s==null||e===null||e===void 0||typeof s!=typeof e||typeof s!="object"||Array.isArray(s)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(s)){if(s.length!==e.length)return!1;for(t=0;t<s.length;t++)if(!br(s[t],e[t]))return!1}else{const n=[];for(i in s)n.push(i);n.sort();const o=[];for(i in e)o.push(i);if(o.sort(),!br(n,o))return!1;for(t=0;t<n.length;t++)if(!br(s[n[t]],e[n[t]]))return!1}return!0}function ro(s,e,t){const i=e(s);return typeof i>"u"?t:i}const s3={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class o3 extends U{constructor(e,t={}){super(),this._onDidUpdate=this._register(new M),this._editor=e,this._options=eo(t,s3,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=!!this._options.alwaysRevealFirst,this._register(this._editor.onDidDispose(()=>this.dispose())),this._register(this._editor.onDidUpdateDiff(()=>this._onDiffUpdated())),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition(i=>{this.ignoreSelectionChange||(this.nextIdx=-1)})),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel(i=>{this.revealFirst=!0})),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&this._editor.getLineChanges()!==null&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach(t=>{!this._options.ignoreCharChanges&&t.charChanges?t.charChanges.forEach(i=>{this.ranges.push({rhs:!0,range:new L(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn)})}):this.ranges.push({rhs:!0,range:new L(t.modifiedStartLineNumber,1,t.modifiedStartLineNumber,1)})}),this.ranges.sort((t,i)=>t.range.getStartPosition().isBeforeOrEqual(i.range.getStartPosition())?-1:i.range.getStartPosition().isBeforeOrEqual(t.range.getStartPosition())?1:0),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1,i=this._editor.getPosition();if(!i){this.nextIdx=0;return}for(let n=0,o=this.ranges.length;n<o&&!t;n++){let r=this.ranges[n].range;i.isBeforeOrEqual(r.getStartPosition())&&(this.nextIdx=n+(e?0:-1),t=!0)}t||(this.nextIdx=e?0:this.ranges.length-1),this.nextIdx<0&&(this.nextIdx=this.ranges.length-1)}_move(e,t){if(Ep(!this.disposed,"Illegal State - diff navigator has been disposed"),!this.canNavigate())return;this.nextIdx===-1?this._initIdx(e):e?(this.nextIdx+=1,this.nextIdx>=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));let i=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{let n=i.range.getStartPosition();this._editor.setPosition(n),this._editor.revealPositionInCenter(n,t)}finally{this.ignoreSelectionChange=!1}}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this._move(!0,e)}previous(e=0){this._move(!1,e)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}}const Dr=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new M,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(s){s=Math.min(Math.max(-5,s),20),this._zoomLevel!==s&&(this._zoomLevel=s,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},r3=Re?1.5:1.35,ew=8;class Wc{constructor(e){this._bareFontInfoBrand=void 0,this.zoomLevel=e.zoomLevel,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}static createFromValidatedSettings(e,t,i,n){const o=e.get(39),r=e.get(43),a=e.get(42),l=e.get(41),d=e.get(56),c=e.get(53);return Wc._create(o,r,a,l,d,c,t,i,n)}static _create(e,t,i,n,o,r,a,l,d){o===0?o=r3*i:o<ew&&(o=o*i),o=Math.round(o),o<ew&&(o=ew);const c=1+(d?0:Dr.getZoomLevel()*.1);return i*=c,o*=c,new Wc({zoomLevel:a,pixelRatio:l,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:n,lineHeight:o,letterSpacing:r})}getId(){return this.zoomLevel+"-"+this.pixelRatio+"-"+this.fontFamily+"-"+this.fontWeight+"-"+this.fontSize+"-"+this.fontFeatureSettings+"-"+this.lineHeight+"-"+this.letterSpacing}getMassagedFontFamily(){return/[,"']/.test(this.fontFamily)?this.fontFamily:/[+ ]/.test(this.fontFamily)?`"${this.fontFamily}"`:this.fontFamily}}const a3=1;class sS extends Wc{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=a3,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}function l3(s){return s&&typeof s.id=="string"}const Qf={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var Pn;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(Pn||(Pn={}));var ba;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(ba||(ba={}));class Np{constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),this.indentSize=e.tabSize|0,this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace}equals(e){return this.tabSize===e.tabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class qu{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}class tw{constructor(e,t,i,n,o,r){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=n,this.isAutoWhitespaceEdit=o,this._isTracked=r}}class d3{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function sb(s){return rL(s,0)}function rL(s,e){switch(typeof s){case"object":return s===null?pr(349,e):Array.isArray(s)?h3(s,e):u3(s,e);case"string":return aL(s,e);case"boolean":return c3(s,e);case"number":return pr(s,e);case"undefined":return pr(937,e);default:return pr(617,e)}}function pr(s,e){return(e<<5)-e+s|0}function c3(s,e){return pr(s?433:863,e)}function aL(s,e){e=pr(149417,e);for(let t=0,i=s.length;t<i;t++)e=pr(s.charCodeAt(t),e);return e}function h3(s,e){return e=pr(104579,e),s.reduce((t,i)=>rL(i,t),e)}function u3(s,e){return e=pr(181387,e),Object.keys(s).sort().reduce((t,i)=>(t=aL(i,t),rL(s[i],t)),e)}function iw(s,e,t=32){const i=t-e,n=~((1<<i)-1);return(s<<e|(n&s)>>>i)>>>0}function fk(s,e=0,t=s.byteLength,i=0){for(let n=0;n<t;n++)s[e+n]=i}function f3(s,e,t="0"){for(;s.length<e;)s=t+s;return s}function Fh(s,e=32){return s instanceof ArrayBuffer?Array.from(new Uint8Array(s)).map(t=>t.toString(16).padStart(2,"0")).join(""):f3((s>>>0).toString(16),e/4)}class ob{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let n=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(di(r))if(a+1<t){const d=e.charCodeAt(a+1);Bc(d)?(a++,l=eL(r,d)):l=65533}else{o=r;break}else Bc(r)&&(l=65533);if(n=this._push(i,n,l),a++,a<t)r=e.charCodeAt(a);else break}this._buffLen=n,this._leftoverHighSurrogate=o}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(i&1984)>>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Fh(this._h0)+Fh(this._h1)+Fh(this._h2)+Fh(this._h3)+Fh(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,fk(this._buff,this._buffLen),this._buffLen>56&&(this._step(),fk(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=ob._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,iw(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let i=this._h0,n=this._h1,o=this._h2,r=this._h3,a=this._h4,l,d,c;for(let h=0;h<80;h++)h<20?(l=n&o|~n&r,d=1518500249):h<40?(l=n^o^r,d=1859775393):h<60?(l=n&o|n&r|o&r,d=2400959708):(l=n^o^r,d=3395469782),c=iw(i,5)+l+a+d+e.getUint32(h*4,!1)&4294967295,a=r,r=o,o=iw(n,30),n=i,i=c;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}ob._bigBlock32=new DataView(new ArrayBuffer(320));function fs(s,e,t){return Math.min(Math.max(s,e),t)}class g3{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this}get value(){return this._val}}const nw="**",gk="/",Mp="[/\\\\]",Tp="[^/\\\\]",p3=/\//g;function pk(s){switch(s){case 0:return"";case 1:return`${Tp}*?`;default:return`(?:${Mp}|${Tp}+${Mp}|${Mp}${Tp}+)*?`}}function mk(s,e){if(!s)return[];const t=[];let i=!1,n=!1,o="";for(const r of s){switch(r){case e:if(!i&&!n){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}o+=r}return o&&t.push(o),t}function eT(s){if(!s)return"";let e="";const t=mk(s,gk);if(t.every(i=>i===nw))e=".*";else{let i=!1;t.forEach((n,o)=>{if(n===nw){i||(e+=pk(2),i=!0);return}let r=!1,a="",l=!1,d="";for(const c of n){if(c!=="}"&&r){a+=c;continue}if(l&&(c!=="]"||!d)){let h;c==="-"?h=c:(c==="^"||c==="!")&&!d?h="^":c===gk?h="":h=Ys(c),d+=h;continue}switch(c){case"{":r=!0;continue;case"[":l=!0;continue;case"}":const u=`(?:${mk(a,",").map(f=>eT(f)).join("|")})`;e+=u,r=!1,a="";break;case"]":e+="["+d+"]",l=!1,d="";break;case"?":e+=Tp;continue;case"*":e+=pk(1);continue;default:e+=Ys(c)}}o<t.length-1&&(t[o+1]!==nw||o+2<t.length)&&(e+=Mp),i=!1})}return e}const m3=/^\*\*\/\*\.[\w\.-]+$/,_3=/^\*\*\/([\w\.-]+)\/?$/,b3=/^{\*\*\/[\*\.]?[\w\.-]+\/?(,\*\*\/[\*\.]?[\w\.-]+\/?)*}$/,v3=/^{\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?(,\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?)*}$/,w3=/^\*\*((\/[\w\.-]+)+)\/?$/,C3=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,_k=new ud(1e4),bk=function(){return!1},Do=function(){return null};function lL(s,e){if(!s)return Do;let t;typeof s!="string"?t=s.pattern:t=s,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let n=_k.get(i);if(n)return vk(n,s);let o;if(m3.test(t)){const r=t.substr(4);n=function(a,l){return typeof a=="string"&&a.endsWith(r)?t:null}}else(o=_3.exec(sw(t,e)))?n=S3(o[1],t):(e.trimForExclusions?v3:b3).test(t)?n=y3(t,e):(o=w3.exec(sw(t,e)))?n=wk(o[1].substr(1),t,!0):(o=C3.exec(sw(t,e)))?n=wk(o[1],t,!1):n=L3(t);return _k.set(i,n),vk(n,s)}function vk(s,e){return typeof e=="string"?s:function(t,i){return j5(t,e.base)?s(E4(e.base,t),i):null}}function sw(s,e){return e.trimForExclusions&&s.endsWith("/**")?s.substr(0,s.length-2):s}function S3(s,e){const t=`/${s}`,i=`\\${s}`,n=function(r,a){return typeof r!="string"?null:a?a===s?e:null:r===s||r.endsWith(t)||r.endsWith(i)?e:null},o=[s];return n.basenames=o,n.patterns=[e],n.allBasenames=o,n}function y3(s,e){const t=iT(s.slice(1,-1).split(",").map(a=>lL(a,e)).filter(a=>a!==Do),s),i=t.length;if(!i)return Do;if(i===1)return t[0];const n=function(a,l){for(let d=0,c=t.length;d<c;d++)if(t[d](a,l))return s;return null},o=t.find(a=>!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function wk(s,e,t){const i=vl===Yt.sep,n=i?s:s.replace(p3,vl),o=vl+n,r=Yt.sep+s,a=t?function(l,d){return typeof l=="string"&&(l===n||l.endsWith(o)||!i&&(l===s||l.endsWith(r)))?e:null}:function(l,d){return typeof l=="string"&&(l===n||!i&&l===s)?e:null};return a.allPaths=[(t?"*/":"./")+s],a}function L3(s){try{const e=new RegExp(`^${eT(s)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?s:null}}catch{return Do}}function tT(s,e,t){return!s||typeof e!="string"?!1:x3(s)(e,void 0,t)}function x3(s,e={}){if(!s)return bk;if(typeof s=="string"||D3(s)){const t=lL(s,e);if(t===Do)return bk;const i=function(n,o){return!!t(n,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return k3(s,e)}function D3(s){const e=s;return e&&typeof e.base=="string"&&typeof e.pattern=="string"}function k3(s,e){const t=iT(Object.getOwnPropertyNames(s).map(a=>I3(a,s[a],e)).filter(a=>a!==Do)),i=t.length;if(!i)return Do;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(c,h){for(let u=0,f=t.length;u<f;u++){const g=t[u](c,h);if(g)return g}return null},l=t.find(c=>!!c.allBasenames);l&&(a.allBasenames=l.allBasenames);const d=t.reduce((c,h)=>h.allPaths?c.concat(h.allPaths):c,[]);return d.length&&(a.allPaths=d),a}const n=function(a,l,d){let c;for(let h=0,u=t.length;h<u;h++){const f=t[h];f.requiresSiblings&&d&&(l||(l=bl(a)),c||(c=l.substr(0,l.length-N4(a).length)));const g=f(a,l,c,d);if(g)return g}return null},o=t.find(a=>!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function I3(s,e,t){if(e===!1)return Do;const i=lL(s,t);if(i===Do)return Do;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const o=(r,a,l,d)=>{if(!d||!i(r,a))return null;const c=n.replace("$(basename)",l),h=d(c);return Z4(h)?h.then(u=>u?s:null):h?s:null};return o.requiresSiblings=!0,o}}return i}function iT(s,e){const t=s.filter(a=>!!a.basenames);if(t.length<2)return s;const i=t.reduce((a,l)=>{const d=l.basenames;return d?a.concat(d):a},[]);let n;if(e){n=[];for(let a=0,l=i.length;a<l;a++)n.push(e)}else n=t.reduce((a,l)=>{const d=l.patterns;return d?a.concat(d):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let c;for(c=a.length;c>0;c--){const h=a.charCodeAt(c-1);if(h===47||h===92)break}l=a.substr(c)}const d=i.indexOf(l);return d!==-1?n[d]:null};o.basenames=i,o.patterns=n,o.allBasenames=i;const r=s.filter(a=>!a.basenames);return r.push(o),r}function nT(s,e,t,i){if(Array.isArray(s)){let n=0;for(const o of s){const r=nT(o,e,t,i);if(r===10)return r;r>n&&(n=r)}return n}else{if(typeof s=="string")return i?s==="*"?5:s===t?10:0:0;if(s){const{language:n,pattern:o,scheme:r,hasAccessToAllModels:a}=s;if(!i&&!a)return 0;let l=0;if(r)if(r===e.scheme)l=10;else if(r==="*")l=5;else return 0;if(n)if(n===t)l=10;else if(n==="*")l=Math.max(l,5);else return 0;if(o){let d;if(typeof o=="string"?d=o:d=Object.assign(Object.assign({},o),{base:Uy(o.base)}),d===e.fsPath||tT(d,e.fsPath))l=10;else return 0}return l}else return 0}}const Vt=Ze("modelService");function E3(s){return!s.isTooLargeForSyncing()&&!s.isForSimpleWidget}function sT(s){return typeof s=="string"?!1:Array.isArray(s)?s.every(sT):!!s.exclusive}class Tt{constructor(){this._clock=0,this._entries=[],this._onDidChange=new M}get onDidChange(){return this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Pe(()=>{if(i){let n=this._entries.indexOf(i);n>=0&&(this._entries.splice(n,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(let i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,o=>{i&&n===o._score?i.push(o.provider):(n=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){if(e){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}}_updateScores(e){let t={uri:e.uri.toString(),language:e.getLanguageIdentifier().language};if(!(this._lastCandidate&&this._lastCandidate.language===t.language&&this._lastCandidate.uri===t.uri)){this._lastCandidate=t;for(let i of this._entries)if(i._score=nT(i.selector,e.uri,e.getLanguageIdentifier().language,E3(e)),sT(i.selector)&&i._score>0){for(let n of this._entries)n._score=0;i._score=1e3;break}this._entries.sort(Tt._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:e._time<t._time?1:e._time>t._time?-1:0}}class Dm{constructor(e,t,i=Number.MAX_SAFE_INTEGER){this._registry=e,this.min=t,this.max=i,this._cache=new ud(50,.7)}_key(e){return e.id+sb(this._registry.all(e))}_clamp(e){return e===void 0?this.min:Math.min(this.max,Math.max(this.min,Math.floor(e*1.3)))}get(e){const t=this._key(e),i=this._cache.get(t);return this._clamp(i==null?void 0:i.value)}update(e,t){const i=this._key(e);let n=this._cache.get(i);return n||(n=new g3,this._cache.set(i,n)),n.update(t),this.get(e)}}class N3{constructor(){this._map=new Map,this._promises=new Map,this._onDidChange=new M,this.onDidChange=this._onDidChange.event,this._colorMap=null}fire(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._map.set(e,t),this.fire([e]),Pe(()=>{this._map.get(e)===t&&(this._map.delete(e),this.fire([e]))})}registerPromise(e,t){let i=null,n=!1;return this._promises.set(e,t.then(o=>{this._promises.delete(e),!(n||!o)&&(i=this.register(e,o))})),Pe(()=>{n=!0,i&&i.dispose()})}getPromise(e){const t=this.get(e);if(t)return Promise.resolve(t);const i=this._promises.get(e);return i?i.then(n=>this.get(e)):null}get(e){return this._map.get(e)||null}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._map.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}let M3=class{constructor(){this._icons=new Map,this._onDidRegister=new M}add(e){const t=this._icons.get(e.id);t?e.description?t.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}};const oT=new M3,km=oT;function Ns(s,e){return new te(s,e)}function T3(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}class te{constructor(e,t,i){this.id=e,this.definition=t,this.description=i,oT.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var mn;(function(s){s.iconNameSegment="[A-Za-z0-9]+",s.iconNameExpression="[A-Za-z0-9\\-]+",s.iconModifierExpression="~[A-Za-z]+";const e=new RegExp(`^(${s.iconNameExpression})(${s.iconModifierExpression})?$`);function t(o){if(o instanceof te)return["codicon","codicon-"+o.id];const r=e.exec(o.id);if(!r)return t(te.error);let[,a,l]=r;const d=["codicon","codicon-"+a];return l&&d.push("codicon-modifier-"+l.substr(1)),d}s.asClassNameArray=t;function i(o){return t(o).join(" ")}s.asClassName=i;function n(o){return"."+t(o).join(".")}s.asCSSSelector=n})(mn||(mn={}));(function(s){s.add=new s("add",{fontCharacter:"\\ea60"}),s.plus=new s("plus",{fontCharacter:"\\ea60"}),s.gistNew=new s("gist-new",{fontCharacter:"\\ea60"}),s.repoCreate=new s("repo-create",{fontCharacter:"\\ea60"}),s.lightbulb=new s("lightbulb",{fontCharacter:"\\ea61"}),s.lightBulb=new s("light-bulb",{fontCharacter:"\\ea61"}),s.repo=new s("repo",{fontCharacter:"\\ea62"}),s.repoDelete=new s("repo-delete",{fontCharacter:"\\ea62"}),s.gistFork=new s("gist-fork",{fontCharacter:"\\ea63"}),s.repoForked=new s("repo-forked",{fontCharacter:"\\ea63"}),s.gitPullRequest=new s("git-pull-request",{fontCharacter:"\\ea64"}),s.gitPullRequestAbandoned=new s("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),s.recordKeys=new s("record-keys",{fontCharacter:"\\ea65"}),s.keyboard=new s("keyboard",{fontCharacter:"\\ea65"}),s.tag=new s("tag",{fontCharacter:"\\ea66"}),s.tagAdd=new s("tag-add",{fontCharacter:"\\ea66"}),s.tagRemove=new s("tag-remove",{fontCharacter:"\\ea66"}),s.person=new s("person",{fontCharacter:"\\ea67"}),s.personFollow=new s("person-follow",{fontCharacter:"\\ea67"}),s.personOutline=new s("person-outline",{fontCharacter:"\\ea67"}),s.personFilled=new s("person-filled",{fontCharacter:"\\ea67"}),s.gitBranch=new s("git-branch",{fontCharacter:"\\ea68"}),s.gitBranchCreate=new s("git-branch-create",{fontCharacter:"\\ea68"}),s.gitBranchDelete=new s("git-branch-delete",{fontCharacter:"\\ea68"}),s.sourceControl=new s("source-control",{fontCharacter:"\\ea68"}),s.mirror=new s("mirror",{fontCharacter:"\\ea69"}),s.mirrorPublic=new s("mirror-public",{fontCharacter:"\\ea69"}),s.star=new s("star",{fontCharacter:"\\ea6a"}),s.starAdd=new s("star-add",{fontCharacter:"\\ea6a"}),s.starDelete=new s("star-delete",{fontCharacter:"\\ea6a"}),s.starEmpty=new s("star-empty",{fontCharacter:"\\ea6a"}),s.comment=new s("comment",{fontCharacter:"\\ea6b"}),s.commentAdd=new s("comment-add",{fontCharacter:"\\ea6b"}),s.alert=new s("alert",{fontCharacter:"\\ea6c"}),s.warning=new s("warning",{fontCharacter:"\\ea6c"}),s.search=new s("search",{fontCharacter:"\\ea6d"}),s.searchSave=new s("search-save",{fontCharacter:"\\ea6d"}),s.logOut=new s("log-out",{fontCharacter:"\\ea6e"}),s.signOut=new s("sign-out",{fontCharacter:"\\ea6e"}),s.logIn=new s("log-in",{fontCharacter:"\\ea6f"}),s.signIn=new s("sign-in",{fontCharacter:"\\ea6f"}),s.eye=new s("eye",{fontCharacter:"\\ea70"}),s.eyeUnwatch=new s("eye-unwatch",{fontCharacter:"\\ea70"}),s.eyeWatch=new s("eye-watch",{fontCharacter:"\\ea70"}),s.circleFilled=new s("circle-filled",{fontCharacter:"\\ea71"}),s.primitiveDot=new s("primitive-dot",{fontCharacter:"\\ea71"}),s.closeDirty=new s("close-dirty",{fontCharacter:"\\ea71"}),s.debugBreakpoint=new s("debug-breakpoint",{fontCharacter:"\\ea71"}),s.debugBreakpointDisabled=new s("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),s.debugHint=new s("debug-hint",{fontCharacter:"\\ea71"}),s.primitiveSquare=new s("primitive-square",{fontCharacter:"\\ea72"}),s.edit=new s("edit",{fontCharacter:"\\ea73"}),s.pencil=new s("pencil",{fontCharacter:"\\ea73"}),s.info=new s("info",{fontCharacter:"\\ea74"}),s.issueOpened=new s("issue-opened",{fontCharacter:"\\ea74"}),s.gistPrivate=new s("gist-private",{fontCharacter:"\\ea75"}),s.gitForkPrivate=new s("git-fork-private",{fontCharacter:"\\ea75"}),s.lock=new s("lock",{fontCharacter:"\\ea75"}),s.mirrorPrivate=new s("mirror-private",{fontCharacter:"\\ea75"}),s.close=new s("close",{fontCharacter:"\\ea76"}),s.removeClose=new s("remove-close",{fontCharacter:"\\ea76"}),s.x=new s("x",{fontCharacter:"\\ea76"}),s.repoSync=new s("repo-sync",{fontCharacter:"\\ea77"}),s.sync=new s("sync",{fontCharacter:"\\ea77"}),s.clone=new s("clone",{fontCharacter:"\\ea78"}),s.desktopDownload=new s("desktop-download",{fontCharacter:"\\ea78"}),s.beaker=new s("beaker",{fontCharacter:"\\ea79"}),s.microscope=new s("microscope",{fontCharacter:"\\ea79"}),s.vm=new s("vm",{fontCharacter:"\\ea7a"}),s.deviceDesktop=new s("device-desktop",{fontCharacter:"\\ea7a"}),s.file=new s("file",{fontCharacter:"\\ea7b"}),s.fileText=new s("file-text",{fontCharacter:"\\ea7b"}),s.more=new s("more",{fontCharacter:"\\ea7c"}),s.ellipsis=new s("ellipsis",{fontCharacter:"\\ea7c"}),s.kebabHorizontal=new s("kebab-horizontal",{fontCharacter:"\\ea7c"}),s.mailReply=new s("mail-reply",{fontCharacter:"\\ea7d"}),s.reply=new s("reply",{fontCharacter:"\\ea7d"}),s.organization=new s("organization",{fontCharacter:"\\ea7e"}),s.organizationFilled=new s("organization-filled",{fontCharacter:"\\ea7e"}),s.organizationOutline=new s("organization-outline",{fontCharacter:"\\ea7e"}),s.newFile=new s("new-file",{fontCharacter:"\\ea7f"}),s.fileAdd=new s("file-add",{fontCharacter:"\\ea7f"}),s.newFolder=new s("new-folder",{fontCharacter:"\\ea80"}),s.fileDirectoryCreate=new s("file-directory-create",{fontCharacter:"\\ea80"}),s.trash=new s("trash",{fontCharacter:"\\ea81"}),s.trashcan=new s("trashcan",{fontCharacter:"\\ea81"}),s.history=new s("history",{fontCharacter:"\\ea82"}),s.clock=new s("clock",{fontCharacter:"\\ea82"}),s.folder=new s("folder",{fontCharacter:"\\ea83"}),s.fileDirectory=new s("file-directory",{fontCharacter:"\\ea83"}),s.symbolFolder=new s("symbol-folder",{fontCharacter:"\\ea83"}),s.logoGithub=new s("logo-github",{fontCharacter:"\\ea84"}),s.markGithub=new s("mark-github",{fontCharacter:"\\ea84"}),s.github=new s("github",{fontCharacter:"\\ea84"}),s.terminal=new s("terminal",{fontCharacter:"\\ea85"}),s.console=new s("console",{fontCharacter:"\\ea85"}),s.repl=new s("repl",{fontCharacter:"\\ea85"}),s.zap=new s("zap",{fontCharacter:"\\ea86"}),s.symbolEvent=new s("symbol-event",{fontCharacter:"\\ea86"}),s.error=new s("error",{fontCharacter:"\\ea87"}),s.stop=new s("stop",{fontCharacter:"\\ea87"}),s.variable=new s("variable",{fontCharacter:"\\ea88"}),s.symbolVariable=new s("symbol-variable",{fontCharacter:"\\ea88"}),s.array=new s("array",{fontCharacter:"\\ea8a"}),s.symbolArray=new s("symbol-array",{fontCharacter:"\\ea8a"}),s.symbolModule=new s("symbol-module",{fontCharacter:"\\ea8b"}),s.symbolPackage=new s("symbol-package",{fontCharacter:"\\ea8b"}),s.symbolNamespace=new s("symbol-namespace",{fontCharacter:"\\ea8b"}),s.symbolObject=new s("symbol-object",{fontCharacter:"\\ea8b"}),s.symbolMethod=new s("symbol-method",{fontCharacter:"\\ea8c"}),s.symbolFunction=new s("symbol-function",{fontCharacter:"\\ea8c"}),s.symbolConstructor=new s("symbol-constructor",{fontCharacter:"\\ea8c"}),s.symbolBoolean=new s("symbol-boolean",{fontCharacter:"\\ea8f"}),s.symbolNull=new s("symbol-null",{fontCharacter:"\\ea8f"}),s.symbolNumeric=new s("symbol-numeric",{fontCharacter:"\\ea90"}),s.symbolNumber=new s("symbol-number",{fontCharacter:"\\ea90"}),s.symbolStructure=new s("symbol-structure",{fontCharacter:"\\ea91"}),s.symbolStruct=new s("symbol-struct",{fontCharacter:"\\ea91"}),s.symbolParameter=new s("symbol-parameter",{fontCharacter:"\\ea92"}),s.symbolTypeParameter=new s("symbol-type-parameter",{fontCharacter:"\\ea92"}),s.symbolKey=new s("symbol-key",{fontCharacter:"\\ea93"}),s.symbolText=new s("symbol-text",{fontCharacter:"\\ea93"}),s.symbolReference=new s("symbol-reference",{fontCharacter:"\\ea94"}),s.goToFile=new s("go-to-file",{fontCharacter:"\\ea94"}),s.symbolEnum=new s("symbol-enum",{fontCharacter:"\\ea95"}),s.symbolValue=new s("symbol-value",{fontCharacter:"\\ea95"}),s.symbolRuler=new s("symbol-ruler",{fontCharacter:"\\ea96"}),s.symbolUnit=new s("symbol-unit",{fontCharacter:"\\ea96"}),s.activateBreakpoints=new s("activate-breakpoints",{fontCharacter:"\\ea97"}),s.archive=new s("archive",{fontCharacter:"\\ea98"}),s.arrowBoth=new s("arrow-both",{fontCharacter:"\\ea99"}),s.arrowDown=new s("arrow-down",{fontCharacter:"\\ea9a"}),s.arrowLeft=new s("arrow-left",{fontCharacter:"\\ea9b"}),s.arrowRight=new s("arrow-right",{fontCharacter:"\\ea9c"}),s.arrowSmallDown=new s("arrow-small-down",{fontCharacter:"\\ea9d"}),s.arrowSmallLeft=new s("arrow-small-left",{fontCharacter:"\\ea9e"}),s.arrowSmallRight=new s("arrow-small-right",{fontCharacter:"\\ea9f"}),s.arrowSmallUp=new s("arrow-small-up",{fontCharacter:"\\eaa0"}),s.arrowUp=new s("arrow-up",{fontCharacter:"\\eaa1"}),s.bell=new s("bell",{fontCharacter:"\\eaa2"}),s.bold=new s("bold",{fontCharacter:"\\eaa3"}),s.book=new s("book",{fontCharacter:"\\eaa4"}),s.bookmark=new s("bookmark",{fontCharacter:"\\eaa5"}),s.debugBreakpointConditionalUnverified=new s("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),s.debugBreakpointConditional=new s("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),s.debugBreakpointConditionalDisabled=new s("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),s.debugBreakpointDataUnverified=new s("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),s.debugBreakpointData=new s("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),s.debugBreakpointDataDisabled=new s("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),s.debugBreakpointLogUnverified=new s("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),s.debugBreakpointLog=new s("debug-breakpoint-log",{fontCharacter:"\\eaab"}),s.debugBreakpointLogDisabled=new s("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),s.briefcase=new s("briefcase",{fontCharacter:"\\eaac"}),s.broadcast=new s("broadcast",{fontCharacter:"\\eaad"}),s.browser=new s("browser",{fontCharacter:"\\eaae"}),s.bug=new s("bug",{fontCharacter:"\\eaaf"}),s.calendar=new s("calendar",{fontCharacter:"\\eab0"}),s.caseSensitive=new s("case-sensitive",{fontCharacter:"\\eab1"}),s.check=new s("check",{fontCharacter:"\\eab2"}),s.checklist=new s("checklist",{fontCharacter:"\\eab3"}),s.chevronDown=new s("chevron-down",{fontCharacter:"\\eab4"}),s.chevronLeft=new s("chevron-left",{fontCharacter:"\\eab5"}),s.chevronRight=new s("chevron-right",{fontCharacter:"\\eab6"}),s.chevronUp=new s("chevron-up",{fontCharacter:"\\eab7"}),s.chromeClose=new s("chrome-close",{fontCharacter:"\\eab8"}),s.chromeMaximize=new s("chrome-maximize",{fontCharacter:"\\eab9"}),s.chromeMinimize=new s("chrome-minimize",{fontCharacter:"\\eaba"}),s.chromeRestore=new s("chrome-restore",{fontCharacter:"\\eabb"}),s.circleOutline=new s("circle-outline",{fontCharacter:"\\eabc"}),s.debugBreakpointUnverified=new s("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),s.circleSlash=new s("circle-slash",{fontCharacter:"\\eabd"}),s.circuitBoard=new s("circuit-board",{fontCharacter:"\\eabe"}),s.clearAll=new s("clear-all",{fontCharacter:"\\eabf"}),s.clippy=new s("clippy",{fontCharacter:"\\eac0"}),s.closeAll=new s("close-all",{fontCharacter:"\\eac1"}),s.cloudDownload=new s("cloud-download",{fontCharacter:"\\eac2"}),s.cloudUpload=new s("cloud-upload",{fontCharacter:"\\eac3"}),s.code=new s("code",{fontCharacter:"\\eac4"}),s.collapseAll=new s("collapse-all",{fontCharacter:"\\eac5"}),s.colorMode=new s("color-mode",{fontCharacter:"\\eac6"}),s.commentDiscussion=new s("comment-discussion",{fontCharacter:"\\eac7"}),s.compareChanges=new s("compare-changes",{fontCharacter:"\\eafd"}),s.creditCard=new s("credit-card",{fontCharacter:"\\eac9"}),s.dash=new s("dash",{fontCharacter:"\\eacc"}),s.dashboard=new s("dashboard",{fontCharacter:"\\eacd"}),s.database=new s("database",{fontCharacter:"\\eace"}),s.debugContinue=new s("debug-continue",{fontCharacter:"\\eacf"}),s.debugDisconnect=new s("debug-disconnect",{fontCharacter:"\\ead0"}),s.debugPause=new s("debug-pause",{fontCharacter:"\\ead1"}),s.debugRestart=new s("debug-restart",{fontCharacter:"\\ead2"}),s.debugStart=new s("debug-start",{fontCharacter:"\\ead3"}),s.debugStepInto=new s("debug-step-into",{fontCharacter:"\\ead4"}),s.debugStepOut=new s("debug-step-out",{fontCharacter:"\\ead5"}),s.debugStepOver=new s("debug-step-over",{fontCharacter:"\\ead6"}),s.debugStop=new s("debug-stop",{fontCharacter:"\\ead7"}),s.debug=new s("debug",{fontCharacter:"\\ead8"}),s.deviceCameraVideo=new s("device-camera-video",{fontCharacter:"\\ead9"}),s.deviceCamera=new s("device-camera",{fontCharacter:"\\eada"}),s.deviceMobile=new s("device-mobile",{fontCharacter:"\\eadb"}),s.diffAdded=new s("diff-added",{fontCharacter:"\\eadc"}),s.diffIgnored=new s("diff-ignored",{fontCharacter:"\\eadd"}),s.diffModified=new s("diff-modified",{fontCharacter:"\\eade"}),s.diffRemoved=new s("diff-removed",{fontCharacter:"\\eadf"}),s.diffRenamed=new s("diff-renamed",{fontCharacter:"\\eae0"}),s.diff=new s("diff",{fontCharacter:"\\eae1"}),s.discard=new s("discard",{fontCharacter:"\\eae2"}),s.editorLayout=new s("editor-layout",{fontCharacter:"\\eae3"}),s.emptyWindow=new s("empty-window",{fontCharacter:"\\eae4"}),s.exclude=new s("exclude",{fontCharacter:"\\eae5"}),s.extensions=new s("extensions",{fontCharacter:"\\eae6"}),s.eyeClosed=new s("eye-closed",{fontCharacter:"\\eae7"}),s.fileBinary=new s("file-binary",{fontCharacter:"\\eae8"}),s.fileCode=new s("file-code",{fontCharacter:"\\eae9"}),s.fileMedia=new s("file-media",{fontCharacter:"\\eaea"}),s.filePdf=new s("file-pdf",{fontCharacter:"\\eaeb"}),s.fileSubmodule=new s("file-submodule",{fontCharacter:"\\eaec"}),s.fileSymlinkDirectory=new s("file-symlink-directory",{fontCharacter:"\\eaed"}),s.fileSymlinkFile=new s("file-symlink-file",{fontCharacter:"\\eaee"}),s.fileZip=new s("file-zip",{fontCharacter:"\\eaef"}),s.files=new s("files",{fontCharacter:"\\eaf0"}),s.filter=new s("filter",{fontCharacter:"\\eaf1"}),s.flame=new s("flame",{fontCharacter:"\\eaf2"}),s.foldDown=new s("fold-down",{fontCharacter:"\\eaf3"}),s.foldUp=new s("fold-up",{fontCharacter:"\\eaf4"}),s.fold=new s("fold",{fontCharacter:"\\eaf5"}),s.folderActive=new s("folder-active",{fontCharacter:"\\eaf6"}),s.folderOpened=new s("folder-opened",{fontCharacter:"\\eaf7"}),s.gear=new s("gear",{fontCharacter:"\\eaf8"}),s.gift=new s("gift",{fontCharacter:"\\eaf9"}),s.gistSecret=new s("gist-secret",{fontCharacter:"\\eafa"}),s.gist=new s("gist",{fontCharacter:"\\eafb"}),s.gitCommit=new s("git-commit",{fontCharacter:"\\eafc"}),s.gitCompare=new s("git-compare",{fontCharacter:"\\eafd"}),s.gitMerge=new s("git-merge",{fontCharacter:"\\eafe"}),s.githubAction=new s("github-action",{fontCharacter:"\\eaff"}),s.githubAlt=new s("github-alt",{fontCharacter:"\\eb00"}),s.globe=new s("globe",{fontCharacter:"\\eb01"}),s.grabber=new s("grabber",{fontCharacter:"\\eb02"}),s.graph=new s("graph",{fontCharacter:"\\eb03"}),s.gripper=new s("gripper",{fontCharacter:"\\eb04"}),s.heart=new s("heart",{fontCharacter:"\\eb05"}),s.home=new s("home",{fontCharacter:"\\eb06"}),s.horizontalRule=new s("horizontal-rule",{fontCharacter:"\\eb07"}),s.hubot=new s("hubot",{fontCharacter:"\\eb08"}),s.inbox=new s("inbox",{fontCharacter:"\\eb09"}),s.issueClosed=new s("issue-closed",{fontCharacter:"\\eb0a"}),s.issueReopened=new s("issue-reopened",{fontCharacter:"\\eb0b"}),s.issues=new s("issues",{fontCharacter:"\\eb0c"}),s.italic=new s("italic",{fontCharacter:"\\eb0d"}),s.jersey=new s("jersey",{fontCharacter:"\\eb0e"}),s.json=new s("json",{fontCharacter:"\\eb0f"}),s.kebabVertical=new s("kebab-vertical",{fontCharacter:"\\eb10"}),s.key=new s("key",{fontCharacter:"\\eb11"}),s.law=new s("law",{fontCharacter:"\\eb12"}),s.lightbulbAutofix=new s("lightbulb-autofix",{fontCharacter:"\\eb13"}),s.linkExternal=new s("link-external",{fontCharacter:"\\eb14"}),s.link=new s("link",{fontCharacter:"\\eb15"}),s.listOrdered=new s("list-ordered",{fontCharacter:"\\eb16"}),s.listUnordered=new s("list-unordered",{fontCharacter:"\\eb17"}),s.liveShare=new s("live-share",{fontCharacter:"\\eb18"}),s.loading=new s("loading",{fontCharacter:"\\eb19"}),s.location=new s("location",{fontCharacter:"\\eb1a"}),s.mailRead=new s("mail-read",{fontCharacter:"\\eb1b"}),s.mail=new s("mail",{fontCharacter:"\\eb1c"}),s.markdown=new s("markdown",{fontCharacter:"\\eb1d"}),s.megaphone=new s("megaphone",{fontCharacter:"\\eb1e"}),s.mention=new s("mention",{fontCharacter:"\\eb1f"}),s.milestone=new s("milestone",{fontCharacter:"\\eb20"}),s.mortarBoard=new s("mortar-board",{fontCharacter:"\\eb21"}),s.move=new s("move",{fontCharacter:"\\eb22"}),s.multipleWindows=new s("multiple-windows",{fontCharacter:"\\eb23"}),s.mute=new s("mute",{fontCharacter:"\\eb24"}),s.noNewline=new s("no-newline",{fontCharacter:"\\eb25"}),s.note=new s("note",{fontCharacter:"\\eb26"}),s.octoface=new s("octoface",{fontCharacter:"\\eb27"}),s.openPreview=new s("open-preview",{fontCharacter:"\\eb28"}),s.package_=new s("package",{fontCharacter:"\\eb29"}),s.paintcan=new s("paintcan",{fontCharacter:"\\eb2a"}),s.pin=new s("pin",{fontCharacter:"\\eb2b"}),s.play=new s("play",{fontCharacter:"\\eb2c"}),s.run=new s("run",{fontCharacter:"\\eb2c"}),s.plug=new s("plug",{fontCharacter:"\\eb2d"}),s.preserveCase=new s("preserve-case",{fontCharacter:"\\eb2e"}),s.preview=new s("preview",{fontCharacter:"\\eb2f"}),s.project=new s("project",{fontCharacter:"\\eb30"}),s.pulse=new s("pulse",{fontCharacter:"\\eb31"}),s.question=new s("question",{fontCharacter:"\\eb32"}),s.quote=new s("quote",{fontCharacter:"\\eb33"}),s.radioTower=new s("radio-tower",{fontCharacter:"\\eb34"}),s.reactions=new s("reactions",{fontCharacter:"\\eb35"}),s.references=new s("references",{fontCharacter:"\\eb36"}),s.refresh=new s("refresh",{fontCharacter:"\\eb37"}),s.regex=new s("regex",{fontCharacter:"\\eb38"}),s.remoteExplorer=new s("remote-explorer",{fontCharacter:"\\eb39"}),s.remote=new s("remote",{fontCharacter:"\\eb3a"}),s.remove=new s("remove",{fontCharacter:"\\eb3b"}),s.replaceAll=new s("replace-all",{fontCharacter:"\\eb3c"}),s.replace=new s("replace",{fontCharacter:"\\eb3d"}),s.repoClone=new s("repo-clone",{fontCharacter:"\\eb3e"}),s.repoForcePush=new s("repo-force-push",{fontCharacter:"\\eb3f"}),s.repoPull=new s("repo-pull",{fontCharacter:"\\eb40"}),s.repoPush=new s("repo-push",{fontCharacter:"\\eb41"}),s.report=new s("report",{fontCharacter:"\\eb42"}),s.requestChanges=new s("request-changes",{fontCharacter:"\\eb43"}),s.rocket=new s("rocket",{fontCharacter:"\\eb44"}),s.rootFolderOpened=new s("root-folder-opened",{fontCharacter:"\\eb45"}),s.rootFolder=new s("root-folder",{fontCharacter:"\\eb46"}),s.rss=new s("rss",{fontCharacter:"\\eb47"}),s.ruby=new s("ruby",{fontCharacter:"\\eb48"}),s.saveAll=new s("save-all",{fontCharacter:"\\eb49"}),s.saveAs=new s("save-as",{fontCharacter:"\\eb4a"}),s.save=new s("save",{fontCharacter:"\\eb4b"}),s.screenFull=new s("screen-full",{fontCharacter:"\\eb4c"}),s.screenNormal=new s("screen-normal",{fontCharacter:"\\eb4d"}),s.searchStop=new s("search-stop",{fontCharacter:"\\eb4e"}),s.server=new s("server",{fontCharacter:"\\eb50"}),s.settingsGear=new s("settings-gear",{fontCharacter:"\\eb51"}),s.settings=new s("settings",{fontCharacter:"\\eb52"}),s.shield=new s("shield",{fontCharacter:"\\eb53"}),s.smiley=new s("smiley",{fontCharacter:"\\eb54"}),s.sortPrecedence=new s("sort-precedence",{fontCharacter:"\\eb55"}),s.splitHorizontal=new s("split-horizontal",{fontCharacter:"\\eb56"}),s.splitVertical=new s("split-vertical",{fontCharacter:"\\eb57"}),s.squirrel=new s("squirrel",{fontCharacter:"\\eb58"}),s.starFull=new s("star-full",{fontCharacter:"\\eb59"}),s.starHalf=new s("star-half",{fontCharacter:"\\eb5a"}),s.symbolClass=new s("symbol-class",{fontCharacter:"\\eb5b"}),s.symbolColor=new s("symbol-color",{fontCharacter:"\\eb5c"}),s.symbolConstant=new s("symbol-constant",{fontCharacter:"\\eb5d"}),s.symbolEnumMember=new s("symbol-enum-member",{fontCharacter:"\\eb5e"}),s.symbolField=new s("symbol-field",{fontCharacter:"\\eb5f"}),s.symbolFile=new s("symbol-file",{fontCharacter:"\\eb60"}),s.symbolInterface=new s("symbol-interface",{fontCharacter:"\\eb61"}),s.symbolKeyword=new s("symbol-keyword",{fontCharacter:"\\eb62"}),s.symbolMisc=new s("symbol-misc",{fontCharacter:"\\eb63"}),s.symbolOperator=new s("symbol-operator",{fontCharacter:"\\eb64"}),s.symbolProperty=new s("symbol-property",{fontCharacter:"\\eb65"}),s.wrench=new s("wrench",{fontCharacter:"\\eb65"}),s.wrenchSubaction=new s("wrench-subaction",{fontCharacter:"\\eb65"}),s.symbolSnippet=new s("symbol-snippet",{fontCharacter:"\\eb66"}),s.tasklist=new s("tasklist",{fontCharacter:"\\eb67"}),s.telescope=new s("telescope",{fontCharacter:"\\eb68"}),s.textSize=new s("text-size",{fontCharacter:"\\eb69"}),s.threeBars=new s("three-bars",{fontCharacter:"\\eb6a"}),s.thumbsdown=new s("thumbsdown",{fontCharacter:"\\eb6b"}),s.thumbsup=new s("thumbsup",{fontCharacter:"\\eb6c"}),s.tools=new s("tools",{fontCharacter:"\\eb6d"}),s.triangleDown=new s("triangle-down",{fontCharacter:"\\eb6e"}),s.triangleLeft=new s("triangle-left",{fontCharacter:"\\eb6f"}),s.triangleRight=new s("triangle-right",{fontCharacter:"\\eb70"}),s.triangleUp=new s("triangle-up",{fontCharacter:"\\eb71"}),s.twitter=new s("twitter",{fontCharacter:"\\eb72"}),s.unfold=new s("unfold",{fontCharacter:"\\eb73"}),s.unlock=new s("unlock",{fontCharacter:"\\eb74"}),s.unmute=new s("unmute",{fontCharacter:"\\eb75"}),s.unverified=new s("unverified",{fontCharacter:"\\eb76"}),s.verified=new s("verified",{fontCharacter:"\\eb77"}),s.versions=new s("versions",{fontCharacter:"\\eb78"}),s.vmActive=new s("vm-active",{fontCharacter:"\\eb79"}),s.vmOutline=new s("vm-outline",{fontCharacter:"\\eb7a"}),s.vmRunning=new s("vm-running",{fontCharacter:"\\eb7b"}),s.watch=new s("watch",{fontCharacter:"\\eb7c"}),s.whitespace=new s("whitespace",{fontCharacter:"\\eb7d"}),s.wholeWord=new s("whole-word",{fontCharacter:"\\eb7e"}),s.window=new s("window",{fontCharacter:"\\eb7f"}),s.wordWrap=new s("word-wrap",{fontCharacter:"\\eb80"}),s.zoomIn=new s("zoom-in",{fontCharacter:"\\eb81"}),s.zoomOut=new s("zoom-out",{fontCharacter:"\\eb82"}),s.listFilter=new s("list-filter",{fontCharacter:"\\eb83"}),s.listFlat=new s("list-flat",{fontCharacter:"\\eb84"}),s.listSelection=new s("list-selection",{fontCharacter:"\\eb85"}),s.selection=new s("selection",{fontCharacter:"\\eb85"}),s.listTree=new s("list-tree",{fontCharacter:"\\eb86"}),s.debugBreakpointFunctionUnverified=new s("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),s.debugBreakpointFunction=new s("debug-breakpoint-function",{fontCharacter:"\\eb88"}),s.debugBreakpointFunctionDisabled=new s("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),s.debugStackframeActive=new s("debug-stackframe-active",{fontCharacter:"\\eb89"}),s.debugStackframeDot=new s("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),s.debugStackframe=new s("debug-stackframe",{fontCharacter:"\\eb8b"}),s.debugStackframeFocused=new s("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),s.debugBreakpointUnsupported=new s("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),s.symbolString=new s("symbol-string",{fontCharacter:"\\eb8d"}),s.debugReverseContinue=new s("debug-reverse-continue",{fontCharacter:"\\eb8e"}),s.debugStepBack=new s("debug-step-back",{fontCharacter:"\\eb8f"}),s.debugRestartFrame=new s("debug-restart-frame",{fontCharacter:"\\eb90"}),s.callIncoming=new s("call-incoming",{fontCharacter:"\\eb92"}),s.callOutgoing=new s("call-outgoing",{fontCharacter:"\\eb93"}),s.menu=new s("menu",{fontCharacter:"\\eb94"}),s.expandAll=new s("expand-all",{fontCharacter:"\\eb95"}),s.feedback=new s("feedback",{fontCharacter:"\\eb96"}),s.groupByRefType=new s("group-by-ref-type",{fontCharacter:"\\eb97"}),s.ungroupByRefType=new s("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),s.account=new s("account",{fontCharacter:"\\eb99"}),s.bellDot=new s("bell-dot",{fontCharacter:"\\eb9a"}),s.debugConsole=new s("debug-console",{fontCharacter:"\\eb9b"}),s.library=new s("library",{fontCharacter:"\\eb9c"}),s.output=new s("output",{fontCharacter:"\\eb9d"}),s.runAll=new s("run-all",{fontCharacter:"\\eb9e"}),s.syncIgnored=new s("sync-ignored",{fontCharacter:"\\eb9f"}),s.pinned=new s("pinned",{fontCharacter:"\\eba0"}),s.githubInverted=new s("github-inverted",{fontCharacter:"\\eba1"}),s.debugAlt=new s("debug-alt",{fontCharacter:"\\eb91"}),s.serverProcess=new s("server-process",{fontCharacter:"\\eba2"}),s.serverEnvironment=new s("server-environment",{fontCharacter:"\\eba3"}),s.pass=new s("pass",{fontCharacter:"\\eba4"}),s.stopCircle=new s("stop-circle",{fontCharacter:"\\eba5"}),s.playCircle=new s("play-circle",{fontCharacter:"\\eba6"}),s.record=new s("record",{fontCharacter:"\\eba7"}),s.debugAltSmall=new s("debug-alt-small",{fontCharacter:"\\eba8"}),s.vmConnect=new s("vm-connect",{fontCharacter:"\\eba9"}),s.cloud=new s("cloud",{fontCharacter:"\\ebaa"}),s.merge=new s("merge",{fontCharacter:"\\ebab"}),s.exportIcon=new s("export",{fontCharacter:"\\ebac"}),s.graphLeft=new s("graph-left",{fontCharacter:"\\ebad"}),s.magnet=new s("magnet",{fontCharacter:"\\ebae"}),s.notebook=new s("notebook",{fontCharacter:"\\ebaf"}),s.redo=new s("redo",{fontCharacter:"\\ebb0"}),s.checkAll=new s("check-all",{fontCharacter:"\\ebb1"}),s.pinnedDirty=new s("pinned-dirty",{fontCharacter:"\\ebb2"}),s.passFilled=new s("pass-filled",{fontCharacter:"\\ebb3"}),s.circleLargeFilled=new s("circle-large-filled",{fontCharacter:"\\ebb4"}),s.circleLargeOutline=new s("circle-large-outline",{fontCharacter:"\\ebb5"}),s.combine=new s("combine",{fontCharacter:"\\ebb6"}),s.gather=new s("gather",{fontCharacter:"\\ebb6"}),s.table=new s("table",{fontCharacter:"\\ebb7"}),s.variableGroup=new s("variable-group",{fontCharacter:"\\ebb8"}),s.typeHierarchy=new s("type-hierarchy",{fontCharacter:"\\ebb9"}),s.typeHierarchySub=new s("type-hierarchy-sub",{fontCharacter:"\\ebba"}),s.typeHierarchySuper=new s("type-hierarchy-super",{fontCharacter:"\\ebbb"}),s.gitPullRequestCreate=new s("git-pull-request-create",{fontCharacter:"\\ebbc"}),s.runAbove=new s("run-above",{fontCharacter:"\\ebbd"}),s.runBelow=new s("run-below",{fontCharacter:"\\ebbe"}),s.notebookTemplate=new s("notebook-template",{fontCharacter:"\\ebbf"}),s.debugRerun=new s("debug-rerun",{fontCharacter:"\\ebc0"}),s.workspaceTrusted=new s("workspace-trusted",{fontCharacter:"\\ebc1"}),s.workspaceUntrusted=new s("workspace-untrusted",{fontCharacter:"\\ebc2"}),s.workspaceUnspecified=new s("workspace-unspecified",{fontCharacter:"\\ebc3"}),s.terminalCmd=new s("terminal-cmd",{fontCharacter:"\\ebc4"}),s.terminalDebian=new s("terminal-debian",{fontCharacter:"\\ebc5"}),s.terminalLinux=new s("terminal-linux",{fontCharacter:"\\ebc6"}),s.terminalPowershell=new s("terminal-powershell",{fontCharacter:"\\ebc7"}),s.terminalTmux=new s("terminal-tmux",{fontCharacter:"\\ebc8"}),s.terminalUbuntu=new s("terminal-ubuntu",{fontCharacter:"\\ebc9"}),s.terminalBash=new s("terminal-bash",{fontCharacter:"\\ebca"}),s.arrowSwap=new s("arrow-swap",{fontCharacter:"\\ebcb"}),s.copy=new s("copy",{fontCharacter:"\\ebcc"}),s.personAdd=new s("person-add",{fontCharacter:"\\ebcd"}),s.filterFilled=new s("filter-filled",{fontCharacter:"\\ebce"}),s.wand=new s("wand",{fontCharacter:"\\ebcf"}),s.debugLineByLine=new s("debug-line-by-line",{fontCharacter:"\\ebd0"}),s.inspect=new s("inspect",{fontCharacter:"\\ebd1"}),s.dropDownButton=new s("drop-down-button",s.chevronDown.definition)})(te||(te={}));class dL{constructor(e,t){this.language=e,this.id=t}}class $i{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&1792)>>>8}static getFontStyle(e){return(e&14336)>>>11}static getForeground(e){return(e&8372224)>>>14}static getBackground(e){return(e&4286578688)>>>23}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e),n=this.getFontStyle(e);return n&1&&(i+=" mtki"),n&2&&(i+=" mtkb"),n&4&&(i+=" mtku"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;return n&1&&(o+="font-style: italic;"),n&2&&(o+="font-weight: bold;"),n&4&&(o+="text-decoration: underline;"),o}}const A3=function(){let s=Object.create(null);return s[0]="symbol-method",s[1]="symbol-function",s[2]="symbol-constructor",s[3]="symbol-field",s[4]="symbol-variable",s[5]="symbol-class",s[6]="symbol-struct",s[7]="symbol-interface",s[8]="symbol-module",s[9]="symbol-property",s[10]="symbol-event",s[11]="symbol-operator",s[12]="symbol-unit",s[13]="symbol-value",s[14]="symbol-constant",s[15]="symbol-enum",s[16]="symbol-enum-member",s[17]="symbol-keyword",s[27]="symbol-snippet",s[18]="symbol-text",s[19]="symbol-color",s[20]="symbol-file",s[21]="symbol-reference",s[22]="symbol-customcolor",s[23]="symbol-folder",s[24]="symbol-type-parameter",s[25]="account",s[26]="issues",function(e){const t=s[e];let i=t&&km.get(t);return i||(console.info("No codicon found for CompletionItemKind "+e),i=te.symbolProperty),i.classNames}}();let rT=function(){let s=Object.create(null);return s.method=0,s.function=1,s.constructor=2,s.field=3,s.variable=4,s.class=5,s.struct=6,s.interface=7,s.module=8,s.property=9,s.event=10,s.operator=11,s.unit=12,s.value=13,s.constant=14,s.enum=15,s["enum-member"]=16,s.enumMember=16,s.keyword=17,s.snippet=27,s.text=18,s.color=19,s.file=20,s.reference=21,s.customcolor=22,s.folder=23,s["type-parameter"]=24,s.typeParameter=24,s.account=25,s.issue=26,function(e,t){let i=s[e];return typeof i>"u"&&!t&&(i=9),i}}();var tl;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(tl||(tl={}));var ko;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(ko||(ko={}));var Ku;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(Ku||(Ku={}));function R3(s){return s&&he.isUri(s.uri)&&L.isIRange(s.range)&&(L.isIRange(s.originSelectionRange)||L.isIRange(s.targetSelectionRange))}var oS;(function(s){const e=new Map;e.set("file",0),e.set("module",1),e.set("namespace",2),e.set("package",3),e.set("class",4),e.set("method",5),e.set("property",6),e.set("field",7),e.set("constructor",8),e.set("enum",9),e.set("interface",10),e.set("function",11),e.set("variable",12),e.set("constant",13),e.set("string",14),e.set("number",15),e.set("boolean",16),e.set("array",17),e.set("object",18),e.set("key",19),e.set("null",20),e.set("enum-member",21),e.set("struct",22),e.set("event",23),e.set("operator",24),e.set("type-parameter",25);const t=new Map;t.set(0,"file"),t.set(1,"module"),t.set(2,"namespace"),t.set(3,"package"),t.set(4,"class"),t.set(5,"method"),t.set(6,"property"),t.set(7,"field"),t.set(8,"constructor"),t.set(9,"enum"),t.set(10,"interface"),t.set(11,"function"),t.set(12,"variable"),t.set(13,"constant"),t.set(14,"string"),t.set(15,"number"),t.set(16,"boolean"),t.set(17,"array"),t.set(18,"object"),t.set(19,"key"),t.set(20,"null"),t.set(21,"enum-member"),t.set(22,"struct"),t.set(23,"event"),t.set(24,"operator"),t.set(25,"type-parameter");function i(r){return e.get(r)}s.fromString=i;function n(r){return t.get(r)}s.toString=n;function o(r,a){const l=t.get(r);let d=l&&km.get("symbol-"+l);return d||(console.info("No codicon found for SymbolKind "+r),d=te.symbolProperty),`${a?"inline":"block"} ${d.classNames}`}s.toCssClassName=o})(oS||(oS={}));class Po{constructor(e){this.value=e}}Po.Comment=new Po("comment");Po.Imports=new Po("imports");Po.Region=new Po("region");var Ck;(function(s){s[s.Other=0]="Other",s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Ck||(Ck={}));const Im=new Tt,Em=new Tt,zs=new Tt,cL=new Tt,wl=new Tt,Gu=new Tt,ws=new Tt,Vc=new Tt,Nm=new Tt,Zu=new Tt,Mm=new Tt,Tm=new Tt,Am=new Tt,lr=new Tt,Qr=new Tt,Io=new Tt,vu=new Tt,Us=new Tt,Rm=new Tt,Yu=new Tt,Hc=new Tt,rb=new Tt,rS=new Tt,Om=new Tt,hL=new Tt,St=new N3;class O3{clone(){return this}equals(e){return this===e}}const Jf=new O3,uL="vs.editor.nullMode",Pm=new dL(uL,0);function aT(s,e,t,i){return new $y([new Y_(i,"",s)],t)}function fL(s,e,t,i){let n=new Uint32Array(2);return n[0]=i,n[1]=(s<<0|0|0|16384|2<<23)>>>0,new X_(n,t===null?Jf:t)}const P3="editorWorkerService",Ms=Ze(P3),to=Ze("modeService"),Xs=Ze("textModelService"),F3="$initialize";let Sk=!1;function aS(s){gh&&(Sk||(Sk=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(s.message))}class B3{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}setWorkerId(e){this._workerId=e}sendMessage(e,t){let i=String(++this._lastSentReq);return new Promise((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send({vsWorker:this._workerId,req:i,method:e,args:t})})}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){if(e.seq){let o=e;if(!this._pendingReplies[o.seq]){console.warn("Got reply to unknown seq");return}let r=this._pendingReplies[o.seq];if(delete this._pendingReplies[o.seq],o.err){let a=o.err;o.err.$isError&&(a=new Error,a.name=o.err.name,a.message=o.err.message,a.stack=o.err.stack),r.reject(a);return}r.resolve(o.res);return}let t=e,i=t.req;this._handler.handleMessage(t.method,t.args).then(o=>{this._send({vsWorker:this._workerId,seq:i,res:o,err:void 0})},o=>{o.detail instanceof Error&&(o.detail=ZD(o.detail)),this._send({vsWorker:this._workerId,seq:i,res:void 0,err:ZD(o)})})}_send(e){let t=[];if(e.req){const i=e;for(let n=0;n<i.args.length;n++)i.args[n]instanceof ArrayBuffer&&t.push(i.args[n])}else{const i=e;i.res instanceof ArrayBuffer&&t.push(i.res)}this._handler.sendMessage(e,t)}}class W3 extends U{constructor(e,t,i){super();let n=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",l=>{this._protocol.handleMessage(l)},l=>{n&&n(l)})),this._protocol=new B3({sendMessage:(l,d)=>{this._worker.postMessage(l,d)},handleMessage:(l,d)=>{if(typeof i[l]!="function")return Promise.reject(new Error("Missing method "+l+" on main thread host."));try{return Promise.resolve(i[l].apply(i,d))}catch(c){return Promise.reject(c)}}}),this._protocol.setWorkerId(this._worker.getId());let o=null;typeof self.require<"u"&&typeof self.require.getConfig=="function"?o=self.require.getConfig():typeof self.requirejs<"u"&&(o=self.requirejs.s.contexts._.config);const r=sL(i);this._onModuleLoaded=this._protocol.sendMessage(F3,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,r]);const a=(l,d)=>this._request(l,d);this._lazyProxy=new Promise((l,d)=>{n=d,this._onModuleLoaded.then(c=>{l(QM(c,a))},c=>{d(c),this._onError("Worker failed to load "+t,c)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,n)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,n)},n)})}_onError(e,t){console.error(e),console.info(t)}}var ow;const yk=(ow=window.trustedTypes)===null||ow===void 0?void 0:ow.createPolicy("defaultWorkerFactory",{createScriptURL:s=>s});function V3(s,e){if(jt.MonacoEnvironment){if(typeof jt.MonacoEnvironment.getWorker=="function")return jt.MonacoEnvironment.getWorker(s,e);if(typeof jt.MonacoEnvironment.getWorkerUrl=="function"){const t=jt.MonacoEnvironment.getWorkerUrl(s,e);return new Worker(yk?yk.createScriptURL(t):t,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function H3(s){return typeof s.then=="function"}class z3{constructor(e,t,i,n,o){this.id=t;const r=V3("workerMain.js",i);H3(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){n(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)})}getId(){return this.id}postMessage(e,t){this.worker&&this.worker.then(i=>i.postMessage(e,t))}dispose(){this.worker&&this.worker.then(e=>e.terminate()),this.worker=null}}class ab{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let n=++ab.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new z3(e,n,this._label||"anonymous"+n,t,o=>{aS(o),this._webWorkerFailedBeforeError=o,i(o)})}}ab.LAST_WORKER_ID=0;var Ft;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(Ft||(Ft={}));class rw{constructor(e){if(this._standardAutoClosingPairConditionalBrand=void 0,this.open=e.open,this.close=e.close,this._standardTokenMask=0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._standardTokenMask|=2;break;case"comment":this._standardTokenMask|=1;break;case"regex":this._standardTokenMask|=4;break}}isOK(e){return(this._standardTokenMask&e)===0}}class U3{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)Bh(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),Bh(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),Bh(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),Bh(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&Bh(this.autoClosingPairsCloseSingleChar,t.close,t)}}function Bh(s,e,t){s.has(e)?s.get(e).push(t):s.set(e,[t])}function Ng(s,e){let t=s.getCount(),i=s.findTokenIndexAtOffset(e),n=s.getLanguageId(i),o=i;for(;o+1<t&&s.getLanguageId(o+1)===n;)o++;let r=i;for(;r>0&&s.getLanguageId(r-1)===n;)r--;return new $3(s,n,r,o+1,s.getStartOffset(r),s.getEndOffset(o))}class $3{constructor(e,t,i,n,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=r}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function ho(s){return(s&7)!==0}class zc{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new rw(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new rw({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new rw({open:t.open,close:t.close||""}))}this._autoCloseBefore=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:zc.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(){return this._autoCloseBefore}static shouldAutoClosePair(e,t,i){if(t.getTokenCount()===0)return!0;const n=t.findTokenIndexAtOffset(i-2),o=t.getStandardTokenType(n);return e.isOK(o)}getSurroundingPairs(){return this._surroundingPairs}}zc.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=`;:.,=}])>
`;let aw;function lT(){return aw||(aw=new TextDecoder("UTF-16LE")),aw}let lw;function j3(){return lw||(lw=new TextDecoder("UTF-16BE")),lw}let dw;function dT(){return dw||(dw=aM()?lT():j3()),dw}const cT=typeof TextDecoder<"u";let Tl,lS;cT?(Tl=s=>new K3(s),lS=q3):(Tl=s=>new G3,lS=hT);function q3(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?hT(s,e,t):lT().decode(i)}function hT(s,e,t){let i=[],n=0;for(let o=0;o<t;o++){const r=H5(s,e);e+=2,i[n++]=String.fromCharCode(r)}return i.join("")}class K3{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 dT().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}write1(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||di(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCII(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIIString(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 G3{constructor(){this._pieces=[],this._piecesLen=0}reset(){this._pieces=[],this._piecesLen=0}build(){return this._pieces.join("")}write1(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCII(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCIIString(e){this._pieces[this._piecesLen++]=e}}class Fm{constructor(e,t,i,n,o,r){this._richEditBracketBrand=void 0,this.languageIdentifier=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=r,this._openSet=Fm._toSet(this.open),this._closeSet=Fm._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 Z3(s){const e=s.length;s=s.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,d]=r,[c,h]=a;return l===c||l===h||d===c||d===h},n=(r,a)=>{const l=Math.min(r,a),d=Math.max(r,a);for(let c=0;c<e;c++)t[c]===d&&(t[c]=l)};for(let r=0;r<e;r++){const a=s[r];for(let l=r+1;l<e;l++){const d=s[l];i(a,d)&&n(t[r],t[l])}}const o=[];for(let r=0;r<e;r++){let a=[],l=[];for(let d=0;d<e;d++)if(t[d]===r){const[c,h]=s[d];a.push(c),l.push(h)}a.length>0&&o.push({open:a,close:l})}return o}class Y3{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Z3(t);this.brackets=i.map((n,o)=>new Fm(e,o,n.open,n.close,X3(n.open,n.close,i,o),Q3(n.open,n.close,i,o))),this.forwardRegex=J3(this.brackets),this.reversedRegex=eB(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const o of n.open)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of n.close)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function uT(s,e,t,i){for(let n=0,o=e.length;n<o;n++){if(n===t)continue;const r=e[n];for(const a of r.open)a.indexOf(s)>=0&&i.push(a);for(const a of r.close)a.indexOf(s)>=0&&i.push(a)}}function fT(s,e){return s.length-e.length}function lb(s){if(s.length<=1)return s;const e=[],t=new Set;for(const i of s)t.has(i)||(e.push(i),t.add(i));return e}function X3(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let o=0,r=n.length;o<r;o++)uT(n[o],t,i,n);return n=lb(n),n.sort(fT),n.reverse(),db(n)}function Q3(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let o=0,r=n.length;o<r;o++)uT(n[o],t,i,n);return n=lb(n),n.sort(fT),n.reverse(),db(n.map(gL))}function J3(s){let e=[];for(const t of s){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=lb(e),db(e)}function eB(s){let e=[];for(const t of s){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=lb(e),db(e.map(gL))}function tB(s){const e=/^[\w ]+$/.test(s);return s=Ys(s),e?`\\b${s}\\b`:s}function db(s){let e=`(${s.map(tB).join(")|(")})`;return HM(e,!0)}const gL=function(){function s(i){if(cT){const n=new Uint16Array(i.length);let o=0;for(let r=i.length-1;r>=0;r--)n[o++]=i.charCodeAt(r);return dT().decode(n)}else{let n=[],o=0;for(let r=i.length-1;r>=0;r--)n[o++]=i.charAt(r);return n.join("")}}let e=null,t=null;return function(n){return e!==n&&(e=n,t=s(e)),t}}();class ds{static _findPrevBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let r=i.length-(o.index||0),a=o[0].length,l=n+r;return new L(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,n,o){const a=gL(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let r=o.index||0,a=o[0].length;if(a===0)return null;let l=n+r;return new L(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,n,o){const r=i.substring(n,o);return this.findNextBracketInText(e,t,r,n)}}class iB{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const n=i.charAt(i.length-1);e.push(n)}return e=e.filter((t,i,n)=>n.indexOf(t)===i),e}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(ho(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=ds.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const l=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const c=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(c)?{matchOpenBracket:l}:null}}function Mg(s){return s.global&&(s.lastIndex=0),!0}class nB{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&Mg(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&Mg(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&Mg(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&Mg(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class sc{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=sc._createOpenBracketRegExp(t[0]),n=sc._createCloseBracketRegExp(t[1]);i&&n&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:n})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let o=0,r=this._regExpRules.length;o<r;o++){let a=this._regExpRules[o];if([{reg:a.beforeText,text:i},{reg:a.afterText,text:n},{reg:a.previousLineText,text:t}].every(d=>d.reg?(d.reg.lastIndex=0,d.reg.test(d.text)):!0))return a.action}if(e>=2&&i.length>0&&n.length>0)for(let o=0,r=this._brackets.length;o<r;o++){let a=this._brackets[o];if(a.openRegExp.test(i)&&a.closeRegExp.test(n))return{indentAction:Ft.IndentOutdent}}if(e>=2&&i.length>0){for(let o=0,r=this._brackets.length;o<r;o++)if(this._brackets[o].openRegExp.test(i))return{indentAction:Ft.Indent}}return null}static _createOpenBracketRegExp(e){let t=Ys(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",sc._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=Ys(e);return/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"),t="^\\s*"+t,sc._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return ve(t),null}}}class pL{constructor(e,t){this._languageIdentifier=e,this._brackets=null,this._electricCharacter=null,this._conf=t,this._onEnterSupport=this._conf.brackets||this._conf.indentationRules||this._conf.onEnterRules?new sc(this._conf):null,this.comments=pL._handleComments(this._conf),this.characterPair=new zc(this._conf),this.wordDefinition=this._conf.wordPattern||dM,this.indentationRules=this._conf.indentationRules,this._conf.indentationRules?this.indentRulesSupport=new nB(this._conf.indentationRules):this.indentRulesSupport=null,this.foldingRules=this._conf.folding||{}}get brackets(){return!this._brackets&&this._conf.brackets&&(this._brackets=new Y3(this._languageIdentifier,this._conf.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new iB(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}static _handleComments(e){let t=e.comments;if(!t)return null;let i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){let[n,o]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=o}return i}}class Lk{constructor(e){this.languageIdentifier=e}}class xk{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class sB{constructor(e){this.languageIdentifier=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new xk(e,t,++this._order);return this._entries.push(i),this._resolved=null,Pe(()=>{for(let n=0;n<this._entries.length;n++)if(this._entries[n]===i){this._entries.splice(n,1),this._resolved=null;break}})}getRichEditSupport(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new pL(this.languageIdentifier,e))}return this._resolved}_resolve(){if(this._entries.length===0)return null;this._entries.sort(xk.cmp);const e={};for(const t of this._entries){const i=t.configuration;e.comments=i.comments||e.comments,e.brackets=i.brackets||e.brackets,e.wordPattern=i.wordPattern||e.wordPattern,e.indentationRules=i.indentationRules||e.indentationRules,e.onEnterRules=i.onEnterRules||e.onEnterRules,e.autoClosingPairs=i.autoClosingPairs||e.autoClosingPairs,e.surroundingPairs=i.surroundingPairs||e.surroundingPairs,e.autoCloseBefore=i.autoCloseBefore||e.autoCloseBefore,e.folding=i.folding||e.folding,e.__electricCharacterSupport=i.__electricCharacterSupport||e.__electricCharacterSupport}return e}}class oB{constructor(){this._entries2=new Map,this._onDidChange=new M,this.onDidChange=this._onDidChange.event}register(e,t,i=0){let n=this._entries2.get(e.id);n||(n=new sB(e),this._entries2.set(e.id,n));const o=n.register(t,i);return this._onDidChange.fire(new Lk(e)),Pe(()=>{o.dispose(),this._onDidChange.fire(new Lk(e))})}_getRichEditSupport(e){const t=this._entries2.get(e);return t?t.getRichEditSupport():null}getIndentationRules(e){const t=this._getRichEditSupport(e);return t&&t.indentationRules||null}_getElectricCharacterSupport(e){let t=this._getRichEditSupport(e);return t&&t.electricCharacter||null}getElectricCharacters(e){let t=this._getElectricCharacterSupport(e);return t?t.getElectricCharacters():[]}onElectricCharacter(e,t,i){let n=Ng(t,i-1),o=this._getElectricCharacterSupport(n.languageId);return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}getComments(e){let t=this._getRichEditSupport(e);return t&&t.comments||null}_getCharacterPairSupport(e){let t=this._getRichEditSupport(e);return t&&t.characterPair||null}getAutoClosingPairs(e){const t=this._getCharacterPairSupport(e);return new U3(t?t.getAutoClosingPairs():[])}getAutoCloseBeforeSet(e){let t=this._getCharacterPairSupport(e);return t?t.getAutoCloseBeforeSet():zc.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED}getSurroundingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getSurroundingPairs():[]}shouldAutoClosePair(e,t,i){const n=Ng(t,i-1);return zc.shouldAutoClosePair(e,n,i-n.firstCharOffset)}getWordDefinition(e){let t=this._getRichEditSupport(e);return XC(t&&t.wordDefinition||null)}getFoldingRules(e){let t=this._getRichEditSupport(e);return t?t.foldingRules:{}}getIndentRulesSupport(e){let t=this._getRichEditSupport(e);return t&&t.indentRulesSupport||null}getPrecedingValidLine(e,t,i){let n=e.getLanguageIdAtPosition(t,0);if(t>1){let o,r=-1;for(o=t-1;o>=1;o--){if(e.getLanguageIdAtPosition(o,0)!==n)return r;let a=e.getLineContent(o);if(i.shouldIgnore(a)||/^\s+$/.test(a)||a===""){r=o;continue}return o}}return-1}getInheritIndentForLine(e,t,i,n=!0){if(e<4)return null;const o=this.getIndentRulesSupport(t.getLanguageIdentifier().id);if(!o)return null;if(i<=1)return{indentation:"",action:null};const r=this.getPrecedingValidLine(t,i,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=t.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:ct(a),action:Ft.Indent,line:r};if(o.shouldDecrease(a))return{indentation:ct(a),action:null,line:r};{if(r===1)return{indentation:ct(t.getLineContent(r)),action:null,line:r};const l=r-1,d=o.getIndentMetadata(t.getLineContent(l));if(!(d&3)&&d&4){let c=0;for(let h=l-1;h>0;h--)if(!o.shouldIndentNextLine(t.getLineContent(h))){c=h;break}return{indentation:ct(t.getLineContent(c+1)),action:null,line:c+1}}if(n)return{indentation:ct(t.getLineContent(r)),action:null,line:r};for(let c=r;c>0;c--){const h=t.getLineContent(c);if(o.shouldIncrease(h))return{indentation:ct(h),action:Ft.Indent,line:c};if(o.shouldIndentNextLine(h)){let u=0;for(let f=c-1;f>0;f--)if(!o.shouldIndentNextLine(t.getLineContent(c))){u=f;break}return{indentation:ct(t.getLineContent(u+1)),action:null,line:u+1}}else if(o.shouldDecrease(h))return{indentation:ct(h),action:null,line:c}}return{indentation:ct(t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,n,o){if(e<4)return null;const r=this._getRichEditSupport(i);if(!r)return null;const a=this.getIndentRulesSupport(i);if(!a)return null;const l=this.getInheritIndentForLine(e,t,n),d=t.getLineContent(n);if(l){const c=l.line;if(c!==void 0){const h=r.onEnter(e,"",t.getLineContent(c),"");if(h){let u=ct(t.getLineContent(c));return h.removeText&&(u=u.substring(0,u.length-h.removeText)),h.indentAction===Ft.Indent||h.indentAction===Ft.IndentOutdent?u=o.shiftIndent(u):h.indentAction===Ft.Outdent&&(u=o.unshiftIndent(u)),a.shouldDecrease(d)&&(u=o.unshiftIndent(u)),h.appendText&&(u+=h.appendText),ct(u)}}return a.shouldDecrease(d)?l.action===Ft.Indent?l.indentation:o.unshiftIndent(l.indentation):l.action===Ft.Indent?o.shiftIndent(l.indentation):l.indentation}return null}getIndentForEnter(e,t,i,n){if(e<4)return null;t.forceTokenization(i.startLineNumber);const o=t.getLineTokens(i.startLineNumber),r=Ng(o,i.startColumn-1),a=r.getLineContent();let l=!1,d;r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(l=!0,d=a.substr(0,i.startColumn-1-r.firstCharOffset)):d=o.getLineContent().substring(0,i.startColumn-1);let c;i.isEmpty()?c=a.substr(i.startColumn-1-r.firstCharOffset):c=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset);const h=this.getIndentRulesSupport(r.languageId);if(!h)return null;const u=d,f=ct(d),g={getLineTokens:_=>t.getLineTokens(_),getLanguageIdentifier:()=>t.getLanguageIdentifier(),getLanguageIdAtPosition:(_,w)=>t.getLanguageIdAtPosition(_,w),getLineContent:_=>_===i.startLineNumber?u:t.getLineContent(_)},m=ct(o.getLineContent()),b=this.getInheritIndentForLine(e,g,i.startLineNumber+1);if(!b){const _=l?m:f;return{beforeEnter:_,afterEnter:_}}let v=l?m:b.indentation;return b.action===Ft.Indent&&(v=n.shiftIndent(v)),h.shouldDecrease(c)&&(v=n.unshiftIndent(v)),{beforeEnter:l?m:f,afterEnter:v}}getIndentActionForType(e,t,i,n,o){if(e<4)return null;const r=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn);if(r.firstCharOffset)return null;const a=this.getIndentRulesSupport(r.languageId);if(!a)return null;const l=r.getLineContent(),d=l.substr(0,i.startColumn-1-r.firstCharOffset);let c;if(i.isEmpty()?c=l.substr(i.startColumn-1-r.firstCharOffset):c=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset),!a.shouldDecrease(d+c)&&a.shouldDecrease(d+n+c)){const h=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!h)return null;let u=h.indentation;return h.action!==Ft.Indent&&(u=o.unshiftIndent(u)),u}return null}getIndentMetadata(e,t){const i=this.getIndentRulesSupport(e.getLanguageIdentifier().id);return!i||t<1||t>e.getLineCount()?null:i.getIndentMetadata(e.getLineContent(t))}getEnterAction(e,t,i){const n=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn),o=this._getRichEditSupport(n.languageId);if(!o)return null;const r=n.getLineContent(),a=r.substr(0,i.startColumn-1-n.firstCharOffset);let l;i.isEmpty()?l=r.substr(i.startColumn-1-n.firstCharOffset):l=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-n.firstCharOffset);let d="";if(i.startLineNumber>1&&n.firstCharOffset===0){const m=this.getScopedLineTokens(t,i.startLineNumber-1);m.languageId===n.languageId&&(d=m.getLineContent())}const c=o.onEnter(e,d,a,l);if(!c)return null;const h=c.indentAction;let u=c.appendText;const f=c.removeText||0;u?h===Ft.Indent&&(u=" "+u):h===Ft.Indent||h===Ft.IndentOutdent?u=" ":u="";let g=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:h,appendText:u,removeText:f,indentation:g}}getIndentationAtPosition(e,t,i){const n=e.getLineContent(t);let o=ct(n);return o.length>i-1&&(o=o.substring(0,i-1)),o}getScopedLineTokens(e,t,i){e.forceTokenization(t);const n=e.getLineTokens(t),o=typeof i>"u"?e.getLineMaxColumn(t)-1:i-1;return Ng(n,o)}getBracketsSupport(e){const t=this._getRichEditSupport(e);return t&&t.brackets||null}}const xe=new oB;class zr{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class Dk{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i<n;i++)t[i]=e.charCodeAt(i);return t}}function gT(s,e,t){return new dr(new Dk(s),new Dk(e)).ComputeDiff(t).changes}class Fd{static Assert(e,t){if(!e)throw new Error(t)}}class Bd{static Copy(e,t,i,n,o){for(let r=0;r<o;r++)i[n+r]=e[t+r]}static Copy2(e,t,i,n,o){for(let r=0;r<o;r++)i[n+r]=e[t+r]}}class kk{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new zr(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class dr{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,r]=dr._getElements(e),[a,l,d]=dr._getElements(t);this._hasStrings=r&&d,this._originalStringElements=n,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(dr._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,o=t.length;n<o;n++)i[n]=aL(t[n],0);return[t,i,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]!==this._modifiedElementsOrHash[t]?!1:this._hasStrings?this._originalStringElements[e]===this._modifiedStringElements[t]:!0}ElementsAreStrictEqual(e,t){if(!this.ElementsAreEqual(e,t))return!1;const i=dr._getStrictElement(this._originalSequence,e),n=dr._getStrictElement(this._modifiedSequence,t);return i===n}static _getStrictElement(e,t){return typeof e.getStrictElement=="function"?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]!==this._originalElementsOrHash[t]?!1:this._hasStrings?this._originalStringElements[e]===this._originalStringElements[t]:!0}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]!==this._modifiedElementsOrHash[t]?!1:this._hasStrings?this._modifiedStringElements[e]===this._modifiedStringElements[t]:!0}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,n,o){const r=[!1];let a=this.ComputeDiffRecursive(e,t,i,n,r);return o&&(a=this.PrettifyChanges(a)),{quitEarly:r[0],changes:a}}ComputeDiffRecursive(e,t,i,n,o){for(o[0]=!1;e<=t&&i<=n&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let h;return i<=n?(Fd.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new zr(e,0,i,n-i+1)]):e<=t?(Fd.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[new zr(e,t-e+1,i,0)]):(Fd.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Fd.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,n,r,a,o),d=r[0],c=a[0];if(l!==null)return l;if(!o[0]){const h=this.ComputeDiffRecursive(e,d,i,c,o);let u=[];return o[0]?u=[new zr(d+1,t-(d+1)+1,c+1,n-(c+1)+1)]:u=this.ComputeDiffRecursive(d+1,t,c+1,n,o),this.ConcatenateChanges(h,u)}return[new zr(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,r,a,l,d,c,h,u,f,g,m,b,v,_){let w=null,C=null,S=new kk,D=t,y=i,x=f[0]-b[0]-n,E=-1073741824,P=this.m_forwardHistory.length-1;do{const A=x+e;A===D||A<y&&d[A-1]<d[A+1]?(h=d[A+1],g=h-x-n,h<E&&S.MarkNextChange(),E=h,S.AddModifiedElement(h+1,g),x=A+1-e):(h=d[A-1]+1,g=h-x-n,h<E&&S.MarkNextChange(),E=h-1,S.AddOriginalElement(h,g+1),x=A-1-e),P>=0&&(d=this.m_forwardHistory[P],e=d[0],D=1,y=d.length-1)}while(--P>=-1);if(w=S.getReverseChanges(),_[0]){let A=f[0]+1,H=b[0]+1;if(w!==null&&w.length>0){const q=w[w.length-1];A=Math.max(A,q.getOriginalEnd()),H=Math.max(H,q.getModifiedEnd())}C=[new zr(A,u-A+1,H,m-H+1)]}else{S=new kk,D=r,y=a,x=f[0]-b[0]-l,E=1073741824,P=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=x+o;A===D||A<y&&c[A-1]>=c[A+1]?(h=c[A+1]-1,g=h-x-l,h>E&&S.MarkNextChange(),E=h+1,S.AddOriginalElement(h+1,g+1),x=A+1-o):(h=c[A-1],g=h-x-l,h>E&&S.MarkNextChange(),E=h,S.AddModifiedElement(h+1,g+1),x=A-1-o),P>=0&&(c=this.m_reverseHistory[P],o=c[0],D=1,y=c.length-1)}while(--P>=-1);C=S.getChanges()}return this.ConcatenateChanges(w,C)}ComputeRecursionPoint(e,t,i,n,o,r,a){let l=0,d=0,c=0,h=0,u=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),m=g+1,b=new Int32Array(m),v=new Int32Array(m),_=n-i,w=t-e,C=e-i,S=t-n,y=(w-_)%2===0;b[_]=e,v[w]=t,a[0]=!1;for(let x=1;x<=g/2+1;x++){let E=0,P=0;c=this.ClipDiagonalBound(_-x,x,_,m),h=this.ClipDiagonalBound(_+x,x,_,m);for(let H=c;H<=h;H+=2){H===c||H<h&&b[H-1]<b[H+1]?l=b[H+1]:l=b[H-1]+1,d=l-(H-_)-C;const q=l;for(;l<t&&d<n&&this.ElementsAreEqual(l+1,d+1);)l++,d++;if(b[H]=l,l+d>E+P&&(E=l,P=d),!y&&Math.abs(H-w)<=x-1&&l>=v[H])return o[0]=l,r[0]=d,q<=v[H]&&x<=1448?this.WALKTRACE(_,c,h,C,w,u,f,S,b,v,l,t,o,d,n,r,y,a):null}const A=(E-e+(P-i)-x)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(E,A))return a[0]=!0,o[0]=E,r[0]=P,A>0&&x<=1448?this.WALKTRACE(_,c,h,C,w,u,f,S,b,v,l,t,o,d,n,r,y,a):(e++,i++,[new zr(e,t-e+1,i,n-i+1)]);u=this.ClipDiagonalBound(w-x,x,w,m),f=this.ClipDiagonalBound(w+x,x,w,m);for(let H=u;H<=f;H+=2){H===u||H<f&&v[H-1]>=v[H+1]?l=v[H+1]-1:l=v[H-1],d=l-(H-w)-S;const q=l;for(;l>e&&d>i&&this.ElementsAreEqual(l,d);)l--,d--;if(v[H]=l,y&&Math.abs(H-_)<=x&&l<=b[H])return o[0]=l,r[0]=d,q>=b[H]&&x<=1448?this.WALKTRACE(_,c,h,C,w,u,f,S,b,v,l,t,o,d,n,r,y,a):null}if(x<=1447){let H=new Int32Array(h-c+2);H[0]=_-c+1,Bd.Copy2(b,c,H,1,h-c+1),this.m_forwardHistory.push(H),H=new Int32Array(f-u+2),H[0]=w-u+1,Bd.Copy2(v,u,H,1,f-u+1),this.m_reverseHistory.push(H)}}return this.WALKTRACE(_,c,h,C,w,u,f,S,b,v,l,t,o,d,n,r,y,a)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],n=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,r=i.originalLength>0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength<n&&i.modifiedStart+i.modifiedLength<o&&(!r||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!a||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const d=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!d)break;i.originalStart++,i.modifiedStart++}let l=[null];if(t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],l)){e[t]=l[0],e.splice(t+1,1),t--;continue}}for(let t=e.length-1;t>=0;t--){const i=e[t];let n=0,o=0;if(t>0){const h=e[t-1];n=h.originalStart+h.originalLength,o=h.modifiedStart+h.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let l=0,d=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let h=1;;h++){const u=i.originalStart-h,f=i.modifiedStart-h;if(u<n||f<o||r&&!this.OriginalElementsAreEqual(u,u+i.originalLength)||a&&!this.ModifiedElementsAreEqual(f,f+i.modifiedLength))break;const m=(u===n&&f===o?5:0)+this._boundaryScore(u,i.originalLength,f,i.modifiedLength);m>d&&(d=m,l=h)}i.originalStart-=l,i.modifiedStart-=l;const c=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],c)){e[t-1]=c[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const n=e[t-1],o=e[t],r=o.originalStart-n.originalStart-n.originalLength,a=n.originalStart,l=o.originalStart+o.originalLength,d=l-a,c=n.modifiedStart,h=o.modifiedStart+o.modifiedLength,u=h-c;if(r<5&&d<20&&u<20){const f=this._findBetterContiguousSequence(a,d,c,u,r);if(f){const[g,m]=f;(g!==n.originalStart+n.originalLength||m!==n.modifiedStart+n.modifiedLength)&&(n.originalLength=g-n.originalStart,n.modifiedLength=m-n.modifiedStart,o.originalStart=g+r,o.modifiedStart=m+r,o.originalLength=l-o.originalStart,o.modifiedLength=h-o.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,n,o){if(t<o||n<o)return null;const r=e+t-o+1,a=i+n-o+1;let l=0,d=0,c=0;for(let h=e;h<r;h++)for(let u=i;u<a;u++){const f=this._contiguousSequenceScore(h,u,o);f>0&&f>l&&(l=f,d=h,c=u)}return l>0?[d,c]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;n+=this._originalStringElements[e+o].length}return n}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,n)?1:0;return o+r}ConcatenateChanges(e,t){let i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return Bd.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],Bd.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return Bd.Copy(e,0,n,0,e.length),Bd.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(Fd.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Fd.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new zr(n,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e<n)return e;const o=i,r=n-i-1,a=t%2===0;if(e<0){const l=o%2===0;return a===l?0:1}else{const l=r%2===0;return a===l?n-1:n-2}}}const rB=3;function pT(s,e,t,i){return new dr(s,e,t).ComputeDiff(i)}class Ik{constructor(e){const t=[],i=[];for(let n=0,o=e.length;n<o;n++)t[n]=dS(e[n],1),i[n]=cS(e[n],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){const n=[],o=[],r=[];let a=0;for(let l=t;l<=i;l++){const d=this.lines[l],c=e?this._startColumns[l]:1,h=e?this._endColumns[l]:d.length+1;for(let u=c;u<h;u++)n[a]=d.charCodeAt(u-1),o[a]=l+1,r[a]=u,a++}return new aB(n,o,r)}}class aB{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}getElements(){return this._charCodes}getStartLineNumber(e){return this._lineNumbers[e]}getStartColumn(e){return this._columns[e]}getEndLineNumber(e){return this._lineNumbers[e]}getEndColumn(e){return this._columns[e]+1}}class Xu{constructor(e,t,i,n,o,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){let n,o,r,a,l,d,c,h;return e.originalLength===0?(n=0,o=0,r=0,a=0):(n=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1)),e.modifiedLength===0?(l=0,d=0,c=0,h=0):(l=i.getStartLineNumber(e.modifiedStart),d=i.getStartColumn(e.modifiedStart),c=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1)),new Xu(n,o,r,a,l,d,c,h)}}function lB(s){if(s.length<=1)return s;const e=[s[0]];let t=e[0];for(let i=1,n=s.length;i<n;i++){const o=s[i],r=o.originalStart-(t.originalStart+t.originalLength),a=o.modifiedStart-(t.modifiedStart+t.modifiedLength);Math.min(r,a)<rB?(t.originalLength=o.originalStart+o.originalLength-t.originalStart,t.modifiedLength=o.modifiedStart+o.modifiedLength-t.modifiedStart):(e.push(o),t=o)}return e}class wu{constructor(e,t,i,n,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=o}static createFromDiffResult(e,t,i,n,o,r,a){let l,d,c,h,u;if(t.originalLength===0?(l=i.getStartLineNumber(t.originalStart)-1,d=0):(l=i.getStartLineNumber(t.originalStart),d=i.getEndLineNumber(t.originalStart+t.originalLength-1)),t.modifiedLength===0?(c=n.getStartLineNumber(t.modifiedStart)-1,h=0):(c=n.getStartLineNumber(t.modifiedStart),h=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),r&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);let m=pT(f,g,o,!0).changes;a&&(m=lB(m)),u=[];for(let b=0,v=m.length;b<v;b++)u.push(Xu.createFromDiffChange(m[b],f,g))}return new wu(l,d,c,h,u)}}class dB{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new Ik(e),this.modified=new Ik(t),this.continueLineDiff=Ek(i.maxComputationTime),this.continueCharDiff=Ek(i.maxComputationTime===0?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(this.original.lines.length===1&&this.original.lines[0].length===0)return this.modified.lines.length===1&&this.modified.lines[0].length===0?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:[{modifiedEndColumn:0,modifiedEndLineNumber:0,modifiedStartColumn:0,modifiedStartLineNumber:0,originalEndColumn:0,originalEndLineNumber:0,originalStartColumn:0,originalStartLineNumber:0}]}]};if(this.modified.lines.length===1&&this.modified.lines[0].length===0)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:[{modifiedEndColumn:0,modifiedEndLineNumber:0,modifiedStartColumn:0,modifiedStartLineNumber:0,originalEndColumn:0,originalEndLineNumber:0,originalStartColumn:0,originalStartLineNumber:0}]}]};const e=pT(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const a=[];for(let l=0,d=t.length;l<d;l++)a.push(wu.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[l],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:a}}const n=[];let o=0,r=0;for(let a=-1,l=t.length;a<l;a++){const d=a+1<l?t[a+1]:null,c=d?d.originalStart:this.originalLines.length,h=d?d.modifiedStart:this.modifiedLines.length;for(;o<c&&r<h;){const u=this.originalLines[o],f=this.modifiedLines[r];if(u!==f){{let g=dS(u,1),m=dS(f,1);for(;g>1&&m>1;){const b=u.charCodeAt(g-2),v=f.charCodeAt(m-2);if(b!==v)break;g--,m--}(g>1||m>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,g,r+1,1,m)}{let g=cS(u,1),m=cS(f,1);const b=u.length+1,v=f.length+1;for(;g<b&&m<v;){const _=u.charCodeAt(g-1),w=u.charCodeAt(m-1);if(_!==w)break;g++,m++}(g<b||m<v)&&this._pushTrimWhitespaceCharChange(n,o+1,g,b,r+1,m,v)}}o++,r++}d&&(n.push(wu.createFromDiffResult(this.shouldIgnoreTrimWhitespace,d,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=d.originalLength,r+=d.modifiedLength)}return{quitEarly:i,changes:n}}_pushTrimWhitespaceCharChange(e,t,i,n,o,r,a){if(this._mergeTrimWhitespaceCharChange(e,t,i,n,o,r,a))return;let l;this.shouldComputeCharChanges&&(l=[new Xu(t,i,t,n,o,r,o,a)]),e.push(new wu(t,t,o,o,l))}_mergeTrimWhitespaceCharChange(e,t,i,n,o,r,a){const l=e.length;if(l===0)return!1;const d=e[l-1];return d.originalEndLineNumber===0||d.modifiedEndLineNumber===0?!1:d.originalEndLineNumber+1===t&&d.modifiedEndLineNumber+1===o?(d.originalEndLineNumber=t,d.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&d.charChanges&&d.charChanges.push(new Xu(t,i,t,n,o,r,o,a)),!0):!1}}function dS(s,e){const t=bn(s);return t===-1?e:t+1}function cS(s,e){const t=xo(s);return t===-1?e:t+2}function Ek(s){if(s===0)return()=>!0;const e=Date.now();return()=>Date.now()-e<s}function Bm(s){return s<0?0:s>255?255:s|0}function Wd(s){return s<0?0:s>4294967295?4294967295:s|0}class mT{constructor(e,t){this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class cB{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Wd(e);const i=this.values,n=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}changeValue(e,t){return e=Wd(e),t=Wd(t),this.values[e]===t?!1:(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=Wd(e),t=Wd(t);const i=this.values,n=this.prefixSum;if(e>=i.length)return!1;let o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Wd(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,o=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],r=o-this.values[n],e<r)i=n-1;else if(e>=o)t=n+1;else break;return new mT(n,e-r)}}class hB{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 O(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 cB(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.changeValue(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;let i=Fa(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]);let n=new Uint32Array(i.length-1);for(let o=1;o<i.length;o++)this._lines.splice(e.lineNumber+o-1,0,i[o]),n[o-1]=i[o].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}}class bh{constructor(e){let t=Bm(e);this._defaultValue=t,this._asciiMap=bh._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);for(let i=0;i<256;i++)t[i]=e;return t}set(e,t){let i=Bm(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}}class oc{constructor(){this._actual=new bh(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}}class uB{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,r=e*t;o<r;o++)n[o]=i;this._data=n,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class fB{constructor(e){let t=0,i=0;for(let o=0,r=e.length;o<r;o++){let[a,l,d]=e[o];l>t&&(t=l),a>i&&(i=a),d>i&&(i=d)}t++,i++;let n=new uB(i,t,0);for(let o=0,r=e.length;o<r;o++){let[a,l,d]=e[o];n.set(a,l,d)}this._states=n,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let cw=null;function gB(){return cw===null&&(cw=new fB([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),cw}let Wh=null;function pB(){if(Wh===null){Wh=new bh(0);const s=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;t<s.length;t++)Wh.set(s.charCodeAt(t),1);const e=".,;";for(let t=0;t<e.length;t++)Wh.set(e.charCodeAt(t),2)}return Wh}class Wm{static _createLink(e,t,i,n,o){let r=o-1;do{const a=t.charCodeAt(r);if(e.get(a)!==2)break;r--}while(r>n);if(n>0){const a=t.charCodeAt(n-1),l=t.charCodeAt(r);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&r--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:r+2},url:t.substring(n,r+1)}}static computeLinks(e,t=gB()){const i=pB();let n=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),l=a.length;let d=0,c=0,h=0,u=1,f=!1,g=!1,m=!1,b=!1;for(;d<l;){let v=!1;const _=a.charCodeAt(d);if(u===13){let w;switch(_){case 40:f=!0,w=0;break;case 41:w=f?0:1;break;case 91:m=!0,g=!0,w=0;break;case 93:m=!1,w=g?0:1;break;case 123:b=!0,w=0;break;case 125:w=b?0:1;break;case 39:w=h===34||h===96?0:1;break;case 34:w=h===39||h===96?0:1;break;case 96:w=h===39||h===34?0:1;break;case 42:w=h===42?1:0;break;case 124:w=h===124?1:0;break;case 32:w=m?0:1;break;default:w=i.get(_)}w===1&&(n.push(Wm._createLink(i,a,o,c,d)),v=!0)}else if(u===12){let w;_===91?(g=!0,w=0):w=i.get(_),w===1?v=!0:u=13}else u=t.nextState(u,_),u===0&&(v=!0);v&&(u=1,f=!1,g=!1,b=!1,c=d+1,h=_),d++}u===13&&n.push(Wm._createLink(i,a,o,c,l))}return n}}function mB(s){return!s||typeof s.getLineCount!="function"||typeof s.getLineContent!="function"?[]:Wm.computeLinks(s)}class hS{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,n,o){if(e&&t){let r=this.doNavigateValueSet(t,o);if(r)return{range:e,value:r}}if(i&&n){let r=this.doNavigateValueSet(n,o);if(r)return{range:i,value:r}}return null}doNavigateValueSet(e,t){let i=this.numberReplace(e,t);return i!==null?i:this.textReplace(e,t)}numberReplace(e,t){let i=Math.pow(10,e.length-(e.lastIndexOf(".")+1)),n=Number(e),o=parseFloat(e);return!isNaN(n)&&!isNaN(o)&&n===o?n===0&&!t?null:(n=Math.floor(n*i),n+=t?i:-i,String(n/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let n=null;for(let o=0,r=e.length;n===null&&o<r;o++)n=this.valueSetReplace(e[o],t,i);return n}valueSetReplace(e,t,i){let n=e.indexOf(t);return n>=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}hS.INSTANCE=new hS;var Vd=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class _B extends hB{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){let i=pm(e.column,XC(t),this._lines[e.lineNumber-1],0);return i?new L(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,o="",r=0,a=[];return{*[Symbol.iterator](){for(;;)if(r<a.length){const l=o.substring(a[r].start,a[r].end);r+=1,yield l}else if(n<t.length)o=t[n],a=i(o,e),r=0,n+=1;else break}}}getLineWords(e,t){let i=this._lines[e-1],n=this._wordenize(i,t),o=[];for(const r of n)o.push({word:i.substring(r.start,r.end),startColumn:r.start+1,endColumn:r.end+1});return o}_wordenize(e,t){const i=[];let n;for(t.lastIndex=0;(n=t.exec(e))&&n[0].length!==0;)i.push({start:n.index,end:n.index+n[0].length});return i}getValueInRange(e){if(e=this._validateRange(e),e.startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);let t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let r=i+1;r<n;r++)o.push(this._lines[r]);return o.push(this._lines[n].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();let t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!O.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,n=!1;if(t<1)t=1,i=1,n=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{let o=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>o&&(i=o,n=!0)}return n?{lineNumber:t,column:i}:e}}class Al{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){let e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new _B(he.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,i,n){return Vd(this,void 0,void 0,function*(){const o=this._getModel(e),r=this._getModel(t);if(!o||!r)return null;const a=o.getLinesContent(),l=r.getLinesContent(),c=new dB(a,l,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:n}).computeDiff(),h=c.changes.length>0?!1:this._modelsAreIdentical(o,r);return{quitEarly:c.quitEarly,identical:h,changes:c.changes}})}_modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLineCount();if(i!==n)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}computeMoreMinimalEdits(e,t){return Vd(this,void 0,void 0,function*(){const i=this._getModel(e);if(!i)return t;const n=[];let o;t=t.slice(0).sort((r,a)=>{if(r.range&&a.range)return L.compareRangesUsingStarts(r.range,a.range);let l=r.range?0:1,d=a.range?0:1;return l-d});for(let{range:r,text:a,eol:l}of t){if(typeof l=="number"&&(o=l),L.isEmpty(r)&&!a)continue;const d=i.getValueInRange(r);if(a=a.replace(/\r\n|\n|\r/g,i.eol),d===a)continue;if(Math.max(a.length,d.length)>Al._diffLimit){n.push({range:r,text:a});continue}const c=gT(d,a,!1),h=i.offsetAt(L.lift(r).getStartPosition());for(const u of c){const f=i.positionAt(h+u.originalStart),g=i.positionAt(h+u.originalStart+u.originalLength),m={text:a.substr(u.modifiedStart,u.modifiedLength),range:{startLineNumber:f.lineNumber,startColumn:f.column,endLineNumber:g.lineNumber,endColumn:g.column}};i.getValueInRange(m.range)!==m.text&&n.push(m)}}return typeof o=="number"&&n.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),n})}computeLinks(e){return Vd(this,void 0,void 0,function*(){let t=this._getModel(e);return t?mB(t):null})}textualSuggest(e,t,i,n){return Vd(this,void 0,void 0,function*(){const o=new Ao(!0),r=new RegExp(i,n),a=new Set;e:for(let l of e){const d=this._getModel(l);if(d){for(let c of d.words(r))if(!(c===t||!isNaN(Number(c)))&&(a.add(c),a.size>Al._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,n){return Vd(this,void 0,void 0,function*(){let o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,n),a=Object.create(null);for(let l=t.startLineNumber;l<t.endLineNumber;l++){let d=o.getLineWords(l,r);for(const c of d){if(!isNaN(Number(c.word)))continue;let h=a[c.word];h||(h=[],a[c.word]=h),h.push({startLineNumber:l,startColumn:c.startColumn,endLineNumber:l,endColumn:c.endColumn})}}return a})}navigateValueSet(e,t,i,n,o){return Vd(this,void 0,void 0,function*(){let r=this._getModel(e);if(!r)return null;let a=new RegExp(n,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});let l=r.getValueInRange(t),d=r.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},a);if(!d)return null;let c=r.getValueInRange(d);return hS.INSTANCE.navigateValueSet(t,l,d,c,i)})}loadForeignModule(e,t,i){let r={host:QM(i,(a,l)=>this._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(sL(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}Al._diffLimit=1e5;Al._suggestionsLimit=1e4;typeof importScripts=="function"&&(jt.monaco=CM());const mL=Ze("textResourceConfigurationService"),_T=Ze("textResourcePropertiesService");function Un(s,e=0){return s[s.length-(1+e)]}function bB(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Ss(s,e,t=(i,n)=>i===n){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let i=0,n=s.length;i<n;i++)if(!t(s[i],e[i]))return!1;return!0}function _L(s,e,t){let i=0,n=s.length-1;for(;i<=n;){const o=(i+n)/2|0,r=t(s[o],e);if(r<0)i=o+1;else if(r>0)n=o-1;else return o}return-(i+1)}function bT(s,e){let t=0,i=s.length;if(i===0)return 0;for(;t<i;){const n=Math.floor((t+i)/2);e(s[n])?i=n:t=n+1}return t}function uS(s,e,t){if(s=s|0,s>=e.length)throw new TypeError("invalid index");let i=e[Math.floor(e.length*Math.random())],n=[],o=[],r=[];for(let a of e){const l=t(a,i);l<0?n.push(a):l>0?o.push(a):r.push(a)}return s<n.length?uS(s,n,t):s<n.length+r.length?r[0]:uS(s-(n.length+r.length),o,t)}function Nk(s,e){const t=[];let i;for(const n of s.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function fd(s){return s.filter(e=>!!e)}function vT(s){return!Array.isArray(s)||s.length===0}function vn(s){return Array.isArray(s)&&s.length>0}function wT(s,e){return s.filter((t,i)=>s.indexOf(t)===i)}function Mk(s){const e=new Set;return s.filter(t=>e.has(t)?!1:(e.add(t),!0))}function fS(s,e){return s.length>0?s[0]:e}function eg(s){return[].concat(...s)}function zi(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const i=[];if(t<=e)for(let n=t;n<e;n++)i.push(n);else for(let n=t;n>e;n--)i.push(n);return i}function Qu(s,e,t){const i=s.slice(0,e),n=s.slice(e);return i.concat(t,n)}function hw(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function Tg(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function bL(s){return Array.isArray(s)?s:[s]}class Tk{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}}const Tr=Ze("logService");var js;(function(s){s[s.Trace=0]="Trace",s[s.Debug=1]="Debug",s[s.Info=2]="Info",s[s.Warning=3]="Warning",s[s.Error=4]="Error",s[s.Critical=5]="Critical",s[s.Off=6]="Off"})(js||(js={}));const CT=js.Info;class vB extends U{constructor(){super(...arguments),this.level=CT,this._onDidChangeLogLevel=this._register(new M)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class wB extends vB{constructor(e=CT){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=js.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=js.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=js.Info&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.getLevel()<=js.Error&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}class CB extends U{constructor(e){super(),this.logger=e,this._register(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}error(e,...t){this.logger.error(e,...t)}}var SB=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},uw=function(s,e){return function(t,i){e(t,i,s)}},ST=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Ak=60*1e3,Rk=5*60*1e3;function jr(s,e){let t=s.getModel(e);return!(!t||t.isTooLargeForSyncing())}let gS=class extends U{constructor(e,t,i){super(),this._modelService=e,this._workerManager=this._register(new LB(this._modelService)),this._logService=i,this._register(Yu.register("*",{provideLinks:(n,o)=>jr(this._modelService,n.uri)?this._workerManager.withWorker().then(r=>r.computeLinks(n.uri)).then(r=>r&&{links:r}):Promise.resolve({links:[]})})),this._register(zs.register("*",new yB(this._workerManager,t,this._modelService)))}dispose(){super.dispose()}canComputeDiff(e,t){return jr(this._modelService,e)&&jr(this._modelService,t)}computeDiff(e,t,i,n){return this._workerManager.withWorker().then(o=>o.computeDiff(e,t,i,n))}computeMoreMinimalEdits(e,t){if(vn(t)){if(!jr(this._modelService,e))return Promise.resolve(t);const i=Ao.create(!0),n=this._workerManager.withWorker().then(o=>o.computeMoreMinimalEdits(e,t));return n.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed())),Promise.race([n,pa(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return jr(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return jr(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};gS=SB([uw(0,Vt),uw(1,mL),uw(2,Tr)],gS);class yB{constructor(e,t,i){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return ST(this,void 0,void 0,function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const n=[];if(i.wordBasedSuggestionsMode==="currentDocument")jr(this._modelService,e.uri)&&n.push(e.uri);else for(const h of this._modelService.getModels())jr(this._modelService,h.uri)&&(h===e?n.unshift(h.uri):(i.wordBasedSuggestionsMode==="allDocuments"||h.getLanguageIdentifier().id===e.getLanguageIdentifier().id)&&n.push(h.uri));if(n.length===0)return;const o=xe.getWordDefinition(e.getLanguageIdentifier().id),r=e.getWordAtPosition(t),a=r?new L(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):L.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),c=yield(yield this._workerManager.withWorker()).textualSuggest(n,r==null?void 0:r.word,o);if(c)return{duration:c.duration,suggestions:c.words.map(h=>({kind:18,label:h,insertText:h,range:{insert:l,replace:a}}))}})}}class LB extends U{constructor(e){super(),this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new Xf).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(Rk/2)),this._register(this._modelService.onModelRemoved(i=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>Rk&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new yT(this._modelService,!1,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)}}class xB extends U{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){let n=new Xf;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round(Ak/2)),this._register(n)}}dispose(){for(let e in this._syncedModels)$e(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e){for(const t of e){let i=t.toString();this._syncedModels[i]||this._beginModelSync(t),this._syncedModels[i]&&(this._syncedModelsLastUsedTime[i]=new Date().getTime())}}_checkStopModelSync(){let e=new Date().getTime(),t=[];for(let i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>Ak&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e){let t=this._modelService.getModel(e);if(!t||t.isTooLargeForSyncing())return;let i=e.toString();this._proxy.acceptNewModel({url:t.uri.toString(),lines:t.getLinesContent(),EOL:t.getEOL(),versionId:t.getVersionId()});const n=new X;n.add(t.onDidChangeContent(o=>{this._proxy.acceptModelChanged(i.toString(),o)})),n.add(t.onWillDispose(()=>{this._stopModelSync(i)})),n.add(Pe(()=>{this._proxy.acceptRemovedModel(i)})),this._syncedModels[i]=n}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],$e(t)}}class Ok{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class fw{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class yT extends U{constructor(e,t,i){super(),this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new ab(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new W3(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new fw(this)))}catch(e){aS(e),this._worker=new Ok(new Al(new fw(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(aS(e),this._worker=new Ok(new Al(new fw(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new xB(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e){return this._disposed?Promise.reject(mh()):this._getProxy().then(t=>(this._getOrCreateModelManager(t).ensureSyncedResources(e),t))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t]).then(o=>o.computeDiff(e.toString(),t.toString(),i,n))}computeMoreMinimalEdits(e,t){return this._withSyncedResources([e]).then(i=>i.computeMoreMinimalEdits(e.toString(),t))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}textualSuggest(e,t,i){return ST(this,void 0,void 0,function*(){const n=yield this._withSyncedResources(e),o=i.source,r=Qv(i);return n.textualSuggest(e.map(a=>a.toString()),t,o,r)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{let n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);let o=xe.getWordDefinition(n.getLanguageIdentifier().id),r=o.source,a=Qv(o);return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(n=>{let o=this._modelService.getModel(e);if(!o)return null;let r=xe.getWordDefinition(o.getLanguageIdentifier().id),a=r.source,l=Qv(r);return n.navigateValueSet(e.toString(),t,i,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function DB(s,e){return new kB(s,e)}class kB extends yT{constructor(e,t){super(e,t.keepIdleModels||!1,t.label),this._foreignModuleId=t.moduleId,this._foreignModuleCreateData=t.createData||null,this._foreignModuleHost=t.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?sL(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const n=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const d=Array.prototype.slice.call(arguments,0);return l(a,d)};let r={};for(const a of i)r[a]=o(a,n);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}class ci{constructor(e,t){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t}static createEmpty(e){const t=ci.defaultTokenMetadata,i=new Uint32Array(2);return i[0]=e.length,i[1]=t,new ci(i,e)}equals(e){return e instanceof ci?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let r=n;r<o;r++)if(this._tokens[r]!==e._tokens[r])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1];return $i.getLanguageId(t)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return $i.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return $i.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return $i.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return $i.getInlineStyleFromMetadata(i,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return ci.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new vL(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let o=0;o<n;o++)e[o<<1]=e[o+1<<1];e[n<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;for(;i<n;){const o=i+Math.floor((n-i)/2),r=e[o<<1];if(r===t)return o+1;r<t?i=o+1:r>t&&(n=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const o=new Array;let r=0;for(;;){let a=t<this._tokensCount?this._tokens[t<<1]:-1,l=i<e.length?e[i]:null;if(a!==-1&&(l===null||a<=l.offset)){n+=this._text.substring(r,a);const d=this._tokens[(t<<1)+1];o.push(n.length,d),t++,r=a}else if(l){if(l.offset>r){n+=this._text.substring(r,l.offset);const d=this._tokens[(t<<1)+1];o.push(n.length,d),r=l.offset}n+=l.text,o.push(n.length,l.tokenMetadata),i++}else break}return new ci(new Uint32Array(o),n)}}ci.defaultTokenMetadata=(16384|2<<23)>>>0;class vL{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o<r&&!(e.getStartOffset(o)>=i);o++)this._tokensCount++}equals(e){return e instanceof vL?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class An{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,n=t.length;if(i!==n)return!1;for(let o=0;o<i;o++)if(!An._equals(e[o],t[o]))return!1;return!0}static extractWrapped(e,t,i){if(e.length===0)return e;const n=t+1,o=i+1,r=i-t,a=[];let l=0;for(const d of e)d.endColumn<=n||d.startColumn>=o||(a[l++]=new An(Math.max(1,d.startColumn-n+1),Math.min(r+1,d.endColumn-n+1),d.className,d.type));return a}static filter(e,t,i,n){if(e.length===0)return[];let o=[],r=0;for(let a=0,l=e.length;a<l;a++){const d=e[a],c=d.range;if(c.endLineNumber<t||c.startLineNumber>t||c.isEmpty()&&(d.type===0||d.type===3))continue;const h=c.startLineNumber===t?c.startColumn:i,u=c.endLineNumber===t?c.endColumn:n;o[r++]=new An(h,u,d.inlineClassName,d.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn===t.startColumn){if(e.endColumn===t.endColumn){const i=An._typeCompare(e.type,t.type);return i===0?e.className<t.className?-1:e.className>t.className?1:0:i}return e.endColumn-t.endColumn}return e.startColumn-t.startColumn}}class Pk{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class Vm{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i<n;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let n=0;for(;n+1<this.count&&this.stopOffsets[n]===this.stopOffsets[n+1];)n++;i.push(new Pk(t,this.stopOffsets[n],this.classNames.join(" "),Vm._metadata(this.metadata))),t=this.stopOffsets[n]+1,this.stopOffsets.splice(0,n+1),this.classNames.splice(0,n+1),this.metadata.splice(0,n+1),this.count-=n+1}return this.count>0&&t<e&&(i.push(new Pk(t,e-1,this.classNames.join(" "),Vm._metadata(this.metadata))),t=e),t}insert(e,t,i){if(this.count===0||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let n=0;n<this.count;n++)if(this.stopOffsets[n]>=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class IB{static normalize(e,t){if(t.length===0)return[];let i=[];const n=new Vm;let o=0;for(let r=0,a=t.length;r<a;r++){const l=t[r];let d=l.startColumn,c=l.endColumn;const h=l.className,u=l.type===1?2:l.type===2?4:0;if(d>1){const m=e.charCodeAt(d-2);di(m)&&d--}if(c>1){const m=e.charCodeAt(c-2);di(m)&&c--}const f=d-1,g=c-2;o=n.consumeLowerThan(f,o,i),n.count===0&&(o=f),n.insert(g,h,u)}return n.consumeLowerThan(1073741824,o,i),i}}class Bi{constructor(e,t,i){this._linePartBrand=void 0,this.endIndex=e,this.type=t,this.metadata=i}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class EB{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class gd{constructor(e,t,i,n,o,r,a,l,d,c,h,u,f,g,m,b,v,_,w){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=d.sort(An.compare),this.tabSize=c,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=b==="all"?4:b==="boundary"?1:b==="selection"?2:b==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=_,this.selectionsOnLine=w&&w.sort((D,y)=>D.startOffset<y.startOffset?-1:1);const C=Math.abs(g-u),S=Math.abs(f-u);C<S?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=f,this.renderSpaceCharCode=183)}sameSelection(e){if(this.selectionsOnLine===null)return e===null;if(e===null||e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&An.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class wL{constructor(e,t){this.partIndex=e,this.charIndex=t}}class mo{constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._absoluteOffsets=new Uint32Array(this.length)}static getPartIndex(e){return(e&4294901760)>>>16}static getCharIndex(e){return(e&65535)>>>0}setColumnInfo(e,t,i,n){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._absoluteOffsets[e-1]=n+i}getAbsoluteOffset(e){return this._absoluteOffsets.length===0?0:this._absoluteOffsets[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=mo.getPartIndex(t),n=mo.getCharIndex(t);return new wL(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;let n=(e<<16|i<<0)>>>0,o=0,r=this.length-1;for(;o+1<r;){let m=o+r>>>1,b=this._data[m];if(b===n)return m;b>n?r=m:o=m}if(o===r)return o;let a=this._data[o],l=this._data[r];if(a===n)return o;if(l===n)return r;let d=mo.getPartIndex(a),c=mo.getCharIndex(a),h=mo.getPartIndex(l),u;d!==h?u=t:u=mo.getCharIndex(l);let f=i-c,g=u-i;return f<=g?o:r}}class pS{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function cb(s,e){if(s.lineContent.length===0){if(s.lineDecorations.length>0){e.appendASCIIString("<span>");let t=0,i=0,n=0;for(const r of s.lineDecorations)(r.type===1||r.type===2)&&(e.appendASCIIString('<span class="'),e.appendASCIIString(r.className),e.appendASCIIString('"></span>'),r.type===1&&(n|=1,t++),r.type===2&&(n|=2,i++));e.appendASCIIString("</span>");const o=new mo(1,t+i);return o.setColumnInfo(1,t,0,0),new pS(o,!1,n)}return e.appendASCIIString("<span><span></span></span>"),new pS(new mo(0,0),!1,0)}return FB(TB(s),e)}class NB{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function hb(s){let e=Tl(1e4),t=cb(s,e);return new NB(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class MB{constructor(e,t,i,n,o,r,a,l,d,c,h,u,f,g,m){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.parts=r,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=d,this.startVisibleColumn=c,this.containsRTL=h,this.spaceWidth=u,this.renderSpaceCharCode=f,this.renderWhitespace=g,this.renderControlCharacters=m}}function TB(s){const e=s.lineContent;let t,i;s.stopRenderingLineAfter!==-1&&s.stopRenderingLineAfter<e.length?(t=!0,i=s.stopRenderingLineAfter):(t=!1,i=e.length);let n=AB(s.lineTokens,s.fauxIndentLength,i);(s.renderWhitespace===4||s.renderWhitespace===1||s.renderWhitespace===2&&s.selectionsOnLine||s.renderWhitespace===3)&&(n=OB(s,e,i,n));let o=0;if(s.lineDecorations.length>0){for(let r=0,a=s.lineDecorations.length;r<a;r++){const l=s.lineDecorations[r];l.type===3||l.type===1?o|=1:l.type===2&&(o|=2)}n=PB(e,i,n,s.lineDecorations)}return s.containsRTL||(n=RB(e,n,!s.isBasicASCII||s.fontLigatures)),new MB(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,e,i,t,n,o,s.fauxIndentLength,s.tabSize,s.startVisibleColumn,s.containsRTL,s.spaceWidth,s.renderSpaceCharCode,s.renderWhitespace,s.renderControlCharacters)}function AB(s,e,t){let i=[],n=0;e>0&&(i[n++]=new Bi(e,"",0));for(let o=0,r=s.getCount();o<r;o++){const a=s.getEndOffset(o);if(a<=e)continue;const l=s.getClassName(o);if(a>=t){i[n++]=new Bi(t,l,0);break}i[n++]=new Bi(a,l,0)}return i}function RB(s,e,t){let i=0,n=[],o=0;if(t)for(let r=0,a=e.length;r<a;r++){const l=e[r],d=l.endIndex;if(i+50<d){const c=l.type,h=l.metadata;let u=-1,f=i;for(let g=i;g<d;g++)s.charCodeAt(g)===32&&(u=g),u!==-1&&g-f>=50&&(n[o++]=new Bi(u+1,c,h),f=u+1,u=-1);f!==d&&(n[o++]=new Bi(d,c,h))}else n[o++]=l;i=d}else for(let r=0,a=e.length;r<a;r++){const l=e[r],d=l.endIndex;let c=d-i;if(c>50){const h=l.type,u=l.metadata,f=Math.ceil(c/50);for(let g=1;g<f;g++){let m=i+g*50;n[o++]=new Bi(m,h,u)}n[o++]=new Bi(d,h,u)}else n[o++]=l;i=d}return n}function OB(s,e,t,i){const n=s.continuesWithWrappedLine,o=s.fauxIndentLength,r=s.tabSize,a=s.startVisibleColumn,l=s.useMonospaceOptimizations,d=s.selectionsOnLine,c=s.renderWhitespace===1,h=s.renderWhitespace===3,u=s.renderSpaceWidth!==s.spaceWidth;let f=[],g=0,m=0,b=i[m].type,v=i[m].endIndex;const _=i.length;let w=!1,C=bn(e),S;C===-1?(w=!0,C=t,S=t):S=xo(e);let D=!1,y=0,x=d&&d[y],E=a%r;for(let A=o;A<t;A++){const H=e.charCodeAt(A);x&&A>=x.endOffset&&(y++,x=d&&d[y]);let q;if(A<C||A>S)q=!0;else if(H===9)q=!0;else if(H===32)if(c)if(D)q=!0;else{const de=A+1<t?e.charCodeAt(A+1):0;q=de===32||de===9}else q=!0;else q=!1;if(q&&d&&(q=!!x&&x.startOffset<=A&&x.endOffset>A),q&&h&&(q=w||A>S),D){if(!q||!l&&E>=r){if(u){const de=g>0?f[g-1].endIndex:o;for(let ce=de+1;ce<=A;ce++)f[g++]=new Bi(ce,"mtkw",1)}else f[g++]=new Bi(A,"mtkw",1);E=E%r}}else(A===v||q&&A>o)&&(f[g++]=new Bi(A,b,0),E=E%r);for(H===9?E=r:Ks(H)?E+=2:E++,D=q;A===v&&(m++,m<_);)b=i[m].type,v=i[m].endIndex}let P=!1;if(D)if(n&&c){let A=t>0?e.charCodeAt(t-1):0,H=t>1?e.charCodeAt(t-2):0;A===32&&H!==32&&H!==9||(P=!0)}else P=!0;if(P)if(u){const A=g>0?f[g-1].endIndex:o;for(let H=A+1;H<=t;H++)f[g++]=new Bi(H,"mtkw",1)}else f[g++]=new Bi(t,"mtkw",1);else f[g++]=new Bi(t,b,0);return f}function PB(s,e,t,i){i.sort(An.compare);const n=IB.normalize(s,i),o=n.length;let r=0,a=[],l=0,d=0;for(let h=0,u=t.length;h<u;h++){const f=t[h],g=f.endIndex,m=f.type,b=f.metadata;for(;r<o&&n[r].startOffset<g;){const v=n[r];if(v.startOffset>d&&(d=v.startOffset,a[l++]=new Bi(d,m,b)),v.endOffset+1<=g)d=v.endOffset+1,a[l++]=new Bi(d,m+" "+v.className,b|v.metadata),r++;else{d=g,a[l++]=new Bi(d,m+" "+v.className,b|v.metadata);break}}g>d&&(d=g,a[l++]=new Bi(d,m,b))}const c=t[t.length-1].endIndex;if(r<o&&n[r].startOffset===c)for(;r<o&&n[r].startOffset===c;){const h=n[r];a[l++]=new Bi(d,h.className,h.metadata),r++}return a}function FB(s,e){const t=s.fontIsMonospace,i=s.canUseHalfwidthRightwardsArrow,n=s.containsForeignElements,o=s.lineContent,r=s.len,a=s.isOverflowing,l=s.parts,d=s.fauxIndentLength,c=s.tabSize,h=s.startVisibleColumn,u=s.containsRTL,f=s.spaceWidth,g=s.renderSpaceCharCode,m=s.renderWhitespace,b=s.renderControlCharacters,v=new mo(r+1,l.length);let _=!1,w=0,C=h,S=0,D=0,y=0,x=0;u?e.appendASCIIString('<span dir="ltr">'):e.appendASCIIString("<span>");for(let E=0,P=l.length;E<P;E++){x+=y;const A=l[E],H=A.endIndex,q=A.type,de=m!==0&&A.isWhitespace(),ce=de&&!t&&(q==="mtkw"||!n),be=w===H&&A.isPseudoAfter();if(S=0,e.appendASCIIString('<span class="'),e.appendASCIIString(ce?"mtkz":q),e.appendASCII(34),de){let ke=0;{let Le=w,Se=C;for(;Le<H;Le++){const pi=(o.charCodeAt(Le)===9?c-Se%c:1)|0;ke+=pi,Le>=d&&(Se+=pi)}}for(ce&&(e.appendASCIIString(' style="width:'),e.appendASCIIString(String(f*ke)),e.appendASCIIString('px"')),e.appendASCII(62);w<H;w++){v.setColumnInfo(w+1,E-D,S,x),D=0;const Le=o.charCodeAt(w);let Se;if(Le===9){Se=c-C%c|0,!i||Se>1?e.write1(8594):e.write1(65515);for(let st=2;st<=Se;st++)e.write1(160)}else Se=1,e.write1(g);S+=Se,w>=d&&(C+=Se)}y=ke}else{let ke=0;for(e.appendASCII(62);w<H;w++){v.setColumnInfo(w+1,E-D,S,x),D=0;const Le=o.charCodeAt(w);let Se=1,st=1;switch(Le){case 9:Se=c-C%c,st=Se;for(let pi=1;pi<=Se;pi++)e.write1(160);break;case 32:e.write1(160);break;case 60:e.appendASCIIString("&lt;");break;case 62:e.appendASCIIString("&gt;");break;case 38:e.appendASCIIString("&amp;");break;case 0:b?e.write1(9216):e.appendASCIIString("&#00;");break;case 65279:case 8232:case 8233:case 133:e.write1(65533);break;default:Ks(Le)&&st++,b&&Le<32?e.write1(9216+Le):b&&Le===127?e.write1(9249):e.write1(Le)}S+=Se,ke+=Se,w>=d&&(C+=st)}y=ke}be?D++:D=0,w>=r&&!_&&A.isPseudoAfter()&&(_=!0,v.setColumnInfo(w+1,E,S,x)),e.appendASCIIString("</span>")}return _||v.setColumnInfo(r+1,l.length-1,S,x),a&&e.appendASCIIString("<span>&hellip;</span>"),e.appendASCIIString("</span>"),new pS(v,u,n)}class Fk{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=n|0}}class BB{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}}class Cu{constructor(e,t,i,n,o){this.breakOffsets=e,this.breakOffsetsVisibleColumn=t,this.wrappedTextIndentLength=i,this.injectionTexts=n,this.injectionOffsets=o}getInputOffsetOfOutputPosition(e,t){let i=0;if(e===0?i=t:i=this.breakOffsets[e-1]+t,this.injectionOffsets!==null)for(let n=0;n<this.injectionOffsets.length&&i>this.injectionOffsets[n];n++)i<this.injectionOffsets[n]+this.injectionTexts[n].length?i=this.injectionOffsets[n]:i-=this.injectionTexts[n].length;return i}getOutputPositionOfInputOffset(e){let t=0;if(this.injectionOffsets!==null)for(let a=0;a<this.injectionOffsets.length&&!(e<this.injectionOffsets[a]);a++)t+=this.injectionTexts[a].length;e+=t;let i=0,n=this.breakOffsets.length-1,o=0,r=0;for(;i<=n;){o=i+(n-i)/2|0;const a=this.breakOffsets[o];if(r=o>0?this.breakOffsets[o-1]:0,e<r)n=o-1;else if(e>=a)i=o+1;else break}return new BB(o,e-r)}}class WB{constructor(e,t){this.tabSize=e,this.data=t}}class CL{constructor(e,t,i,n,o,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=r}}class Fn{constructor(e,t,i,n,o,r,a,l,d,c){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=Fn.isBasicASCII(i,r),this.containsRTL=Fn.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=d,this.startVisibleColumn=c}static isBasicASCII(e,t){return t?tL(e):!0}static containsRTL(e,t,i){return!t&&i?ib(e):!1}}class Ap{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class LT{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}function VB(s){return Array.isArray(s)}function HB(s){return!VB(s)}function xT(s){return typeof s=="string"}function Bk(s){return!xT(s)}function Jd(s){return!s}function ra(s,e){return s.ignoreCase&&e?e.toLowerCase():e}function Wk(s){return s.replace(/[&<>'"_]/g,"-")}function zB(s,e){console.log(`${s.languageId}: ${e}`)}function dt(s,e){return new Error(`${s.languageId}: ${e}`)}function Yr(s,e,t,i,n){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,l,d,c,h,u,f,g,m){return Jd(d)?Jd(c)?!Jd(h)&&h<i.length?ra(s,i[h]):!Jd(f)&&s&&typeof s[f]=="string"?s[f]:(r===null&&(r=n.split("."),r.unshift(n)),!Jd(u)&&u<r.length?ra(s,r[u]):""):ra(s,t):"$"})}function Ag(s,e){let t=e;for(;t&&t.length>0;){const i=s.tokenizer[t];if(i)return i;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return null}function UB(s,e){let t=e;for(;t&&t.length>0;){if(s.stateNames[t])return!0;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return!1}const DT=5;class Ju{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new Cc(e,t);let i=Cc.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new Cc(e,t),this._entries[i]=n,n)}}Ju._INSTANCE=new Ju(DT);class Cc{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return Cc._equals(this,e)}push(e){return Ju.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return Ju.create(this.parent,e)}}class Su{constructor(e,t){this.modeId=e,this.state=t}equals(e){return this.modeId===e.modeId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new Su(this.modeId,this.state)}}class Xr{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(t!==null)return new yu(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new yu(e,t);let i=Cc.getStackElementId(e),n=this._entries[i];return n||(n=new yu(e,null),this._entries[i]=n,n)}}Xr._INSTANCE=new Xr(DT);class yu{constructor(e,t){this.stack=e,this.embeddedModeData=t}clone(){return(this.embeddedModeData?this.embeddedModeData.clone():null)===this.embeddedModeData?this:Xr.create(this.stack,this.embeddedModeData)}equals(e){return!(e instanceof yu)||!this.stack.equals(e.stack)?!1:this.embeddedModeData===null&&e.embeddedModeData===null?!0:this.embeddedModeData===null||e.embeddedModeData===null?!1:this.embeddedModeData.equals(e.embeddedModeData)}}class $B{constructor(){this._tokens=[],this._language=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterMode(e,t){this._language=t}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._language||(this._lastTokenType=t,this._lastTokenLanguage=this._language,this._tokens.push(new Y_(e,t,this._language)))}nestedModeTokenize(e,t,i,n){const o=i.modeId,r=i.state,a=St.get(o);if(!a)return this.enterMode(n,o),this.emit(n,""),r;let l=a.tokenize(e,t,r,n);return this._tokens=this._tokens.concat(l.tokens),this._lastTokenType=null,this._lastTokenLanguage=null,this._language=null,l.endState}finalize(e){return new $y(this._tokens,e)}}class Hm{constructor(e,t){this._modeService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterMode(e,t){this._currentLanguageId=this._modeService.getLanguageIdentifier(t).id}emit(e,t){let i=this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){let n=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(n===0&&o===0&&r===0)return new Uint32Array(0);if(n===0&&o===0)return i;if(o===0&&r===0)return e;let a=new Uint32Array(n+o+r);e!==null&&a.set(e);for(let l=0;l<o;l++)a[n+l]=t[l];return i!==null&&a.set(i,n+o),a}nestedModeTokenize(e,t,i,n){const o=i.modeId,r=i.state,a=St.get(o);if(!a)return this.enterMode(n,o),this.emit(n,""),r;let l=a.tokenize2(e,t,r,n);return this._prependTokens=Hm._merge(this._prependTokens,this._tokens,l.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,l.endState}finalize(e){return new X_(Hm._merge(this._prependTokens,this._tokens,null),e)}}class ub{constructor(e,t,i,n){this._modeService=e,this._standaloneThemeService=t,this._modeId=i,this._lexer=n,this._embeddedModes=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let o=!1;this._tokenizationRegistryListener=St.onDidChange(r=>{if(o)return;let a=!1;for(let l=0,d=r.changedLanguages.length;l<d;l++){let c=r.changedLanguages[l];if(this._embeddedModes[c]){a=!0;break}}a&&(o=!0,St.fire([this._modeId]),o=!1)})}dispose(){this._tokenizationRegistryListener.dispose()}getLoadStatus(){let e=[];for(let t in this._embeddedModes){const i=St.get(t);if(i){if(i instanceof ub){const o=i.getLoadStatus();o.loaded===!1&&e.push(o.promise)}continue}const n=St.getPromise(t);n&&e.push(n)}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){let e=Ju.create(null,this._lexer.start);return Xr.create(e,null)}tokenize(e,t,i,n){let o=new $B,r=this._tokenize(e,t,i,n,o);return o.finalize(r)}tokenize2(e,t,i,n){let o=new Hm(this._modeService,this._standaloneThemeService.getColorTheme().tokenTheme),r=this._tokenize(e,t,i,n,o);return o.finalize(r)}_tokenize(e,t,i,n,o){return i.embeddedModeData?this._nestedTokenize(e,t,i,n,o):this._myTokenize(e,t,i,n,o)}_findLeavingNestedModeOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=Ag(this._lexer,t.stack.state),!i))throw dt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const r of i){if(!Bk(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.regex,l=r.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){let c=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),c)}let d=e.search(a);d===-1||d!==0&&r.matchOnlyAtLineStart||(n===-1||d<n)&&(n=d)}if(!o)throw dt(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return n}_nestedTokenize(e,t,i,n,o){let r=this._findLeavingNestedModeOffset(e,i);if(r===-1){let d=o.nestedModeTokenize(e,t,i.embeddedModeData,n);return Xr.create(i.stack,new Su(i.embeddedModeData.modeId,d))}let a=e.substring(0,r);a.length>0&&o.nestedModeTokenize(a,!1,i.embeddedModeData,n);let l=e.substring(r);return this._myTokenize(l,t,i,n+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterMode(n,this._modeId);const r=e.length,a=t&&this._lexer.includeLF?e+`
`:e,l=a.length;let d=i.embeddedModeData,c=i.stack,h=0,u=null,f=!0;for(;f||h<l;){const g=h,m=c.depth,b=u?u.groups.length:0,v=c.state;let _=null,w=null,C=null,S=null,D=null;if(u){_=u.matches;const E=u.groups.shift();w=E.matched,C=E.action,S=u.rule,u.groups.length===0&&(u=null)}else{if(!f&&h>=l)break;f=!1;let E=this._lexer.tokenizer[v];if(!E&&(E=Ag(this._lexer,v),!E))throw dt(this._lexer,"tokenizer state is not defined: "+v);let P=a.substr(h);for(const A of E)if((h===0||!A.matchOnlyAtLineStart)&&(_=P.match(A.regex),_)){w=_[0],C=A.action;break}}if(_||(_=[""],w=""),C||(h<l&&(_=[a.charAt(h)],w=_[0]),C=this._lexer.defaultToken),w===null)break;for(h+=w.length;HB(C)&&Bk(C)&&C.test;)C=C.test(w,_,v,h===l);let y=null;if(typeof C=="string"||Array.isArray(C))y=C;else if(C.group)y=C.group;else if(C.token!==null&&C.token!==void 0){if(C.tokenSubst?y=Yr(this._lexer,C.token,w,_,v):y=C.token,C.nextEmbedded)if(C.nextEmbedded==="@pop"){if(!d)throw dt(this._lexer,"cannot pop embedded mode if not inside one");d=null}else{if(d)throw dt(this._lexer,"cannot enter embedded mode from within an embedded mode");D=Yr(this._lexer,C.nextEmbedded,w,_,v)}if(C.goBack&&(h=Math.max(0,h-C.goBack)),C.switchTo&&typeof C.switchTo=="string"){let E=Yr(this._lexer,C.switchTo,w,_,v);if(E[0]==="@"&&(E=E.substr(1)),Ag(this._lexer,E))c=c.switchTo(E);else throw dt(this._lexer,"trying to switch to a state '"+E+"' that is undefined in rule: "+this._safeRuleName(S))}else{if(C.transform&&typeof C.transform=="function")throw dt(this._lexer,"action.transform not supported");if(C.next)if(C.next==="@push"){if(c.depth>=this._lexer.maxStack)throw dt(this._lexer,"maximum tokenizer stack size reached: ["+c.state+","+c.parent.state+",...]");c=c.push(v)}else if(C.next==="@pop"){if(c.depth<=1)throw dt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));c=c.pop()}else if(C.next==="@popall")c=c.popall();else{let E=Yr(this._lexer,C.next,w,_,v);if(E[0]==="@"&&(E=E.substr(1)),Ag(this._lexer,E))c=c.push(E);else throw dt(this._lexer,"trying to set a next state '"+E+"' that is undefined in rule: "+this._safeRuleName(S))}}C.log&&typeof C.log=="string"&&zB(this._lexer,this._lexer.languageId+": "+Yr(this._lexer,C.log,w,_,v))}if(y===null)throw dt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const x=E=>{let P=this._modeService.getModeIdForLanguageName(E);P&&(E=P);const A=this._getNestedEmbeddedModeData(E);if(h<l){const H=e.substr(h);return this._nestedTokenize(H,t,Xr.create(c,A),n+h,o)}else return Xr.create(c,A)};if(Array.isArray(y)){if(u&&u.groups.length>0)throw dt(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(_.length!==y.length+1)throw dt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let E=0;for(let P=1;P<_.length;P++)E+=_[P].length;if(E!==w.length)throw dt(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(S));u={rule:S,matches:_,groups:[]};for(let P=0;P<y.length;P++)u.groups[P]={action:y[P],matched:_[P+1]};h-=w.length;continue}else{if(y==="@rematch"&&(h-=w.length,w="",_=null,y="",D!==null))return x(D);if(w.length===0){if(l===0||m!==c.depth||v!==c.state||(u?u.groups.length:0)!==b)continue;throw dt(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(S))}let E=null;if(xT(y)&&y.indexOf("@brackets")===0){let P=y.substr(9),A=jB(this._lexer,w);if(!A)throw dt(this._lexer,"@brackets token returned but no bracket defined as: "+w);E=Wk(A.token+P)}else{let P=y===""?"":y+this._lexer.tokenPostfix;E=Wk(P)}g<r&&o.emit(g+n,E)}if(D!==null)return x(D)}return Xr.create(c,d)}_getNestedEmbeddedModeData(e){let t=this._locateMode(e);if(t){let i=St.get(t);if(i)return new Su(t,i.getInitialState())}return new Su(t||uL,Jf)}_locateMode(e){if(!e||!this._modeService.isRegisteredMode(e))return null;if(e===this._modeId)return e;let t=this._modeService.getModeId(e);return t&&(this._modeService.triggerMode(t),this._embeddedModes[t]=!0),t}}function jB(s,e){if(!e)return null;e=ra(s,e);let t=s.brackets;for(const i of t){if(i.open===e)return{token:i.token,bracketType:1};if(i.close===e)return{token:i.token,bracketType:-1}}return null}function qB(s,e,t,i){return new ub(s,e,t,i)}var gw;const pw=(gw=window.trustedTypes)===null||gw===void 0?void 0:gw.createPolicy("standaloneColorizer",{createHTML:s=>s});class SL{static colorizeElement(e,t,i,n){n=n||{};let o=n.theme||"vs",r=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();e.setTheme(o);let a=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;let l=d=>{var c;const h=(c=pw==null?void 0:pw.createHTML(d))!==null&&c!==void 0?c:d;i.innerHTML=h};return this.colorize(t,a||"",r,n).then(l,d=>console.error(d))}static colorize(e,t,i,n){let o=4;n&&typeof n.tabSize=="number"&&(o=n.tabSize),iL(t)&&(t=t.substr(1));let r=Fa(t),a=e.getModeId(i);if(!a)return Promise.resolve(Vk(r,o));e.triggerMode(a);const l=St.get(a);if(l)return mw(r,o,l);const d=St.getPromise(a);return d?new Promise((c,h)=>{d.then(u=>{mw(r,o,u).then(c,h)},h)}):new Promise((c,h)=>{let u=null,f=null;const g=()=>{u&&(u.dispose(),u=null),f&&(f.dispose(),f=null);const m=St.get(a);if(m){mw(r,o,m).then(c,h);return}c(Vk(r,o))};f=new an,f.cancelAndSet(g,500),u=St.onDidChange(m=>{m.changedLanguages.indexOf(a)>=0&&g()})})}static colorizeLine(e,t,i,n,o=4){const r=Fn.isBasicASCII(e,t),a=Fn.containsRTL(e,r,i);return hb(new gd(!1,!0,e,!1,r,a,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){let n=e.getLineContent(t);e.forceTokenization(t);let r=e.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function mw(s,e,t){return new Promise((i,n)=>{const o=()=>{const r=KB(s,e,t);if(t instanceof ub){const a=t.getLoadStatus();if(a.loaded===!1){a.promise.then(o,n);return}}i(r)};o()})}function Vk(s,e){let t=[];const n=new Uint32Array(2);n[0]=0,n[1]=16793600;for(let o=0,r=s.length;o<r;o++){let a=s[o];n[0]=a.length;const l=new ci(n,a),d=Fn.isBasicASCII(a,!0),c=Fn.containsRTL(a,d,!0);let h=hb(new gd(!1,!0,a,!1,d,c,0,l,[],e,0,0,0,0,-1,"none",!1,!1,null));t=t.concat(h.html),t.push("<br/>")}return t.join("")}function KB(s,e,t){let i=[],n=t.getInitialState();for(let o=0,r=s.length;o<r;o++){let a=s[o],l=t.tokenize2(a,!0,n,0);ci.convertToEndOffset(l.tokens,a.length);let d=new ci(l.tokens,a);const c=Fn.isBasicASCII(a,!0),h=Fn.containsRTL(a,c,!0);let u=hb(new gd(!1,!0,a,!1,c,h,0,d.inflate(),[],e,0,0,0,0,-1,"none",!1,!1,null));i=i.concat(u.html),i.push("<br/>"),n=l.endState}return i.join("")}var ef;(function(s){s[s.Ignore=0]="Ignore",s[s.Info=1]="Info",s[s.Warning=2]="Warning",s[s.Error=3]="Error"})(ef||(ef={}));(function(s){const e="error",t="warning",i="warn",n="info",o="ignore";function r(l){return l?ou(e,l)?s.Error:ou(t,l)||ou(i,l)?s.Warning:ou(n,l)?s.Info:s.Ignore:s.Ignore}s.fromValue=r;function a(l){switch(l){case s.Error:return e;case s.Warning:return t;case s.Info:return n;default:return o}}s.toString=a})(ef||(ef={}));const It=ef;function Fo(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===Qf.ICodeEditor:!1}function kT(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===Qf.IDiffEditor:!1}function IT(s){return Fo(s)?s:kT(s)?s.getModifiedEditor():null}const yL=Ze("IWorkspaceEditService");function GB(s){return tn(s)&&(!!s.newUri||!!s.oldUri)}function ZB(s){return tn(s)&&he.isUri(s.resource)&&tn(s.edit)}class fb{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(ZB(t))return new ET(t.resource,t.edit,t.modelVersionId,t.metadata);if(GB(t))return new YB(t.oldUri,t.newUri,t.options,t.metadata);throw new Error("Unsupported edit")})}}class ET extends fb{constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class YB extends fb{constructor(e,t,i,n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}class XB{constructor(){this.data=new Map}add(e,t){Ep(es(e)),Ep(tn(t)),Ep(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}}const Ht=new XB,gb={JSONContribution:"base.contributions.json"};function QB(s){return s.length>0&&s.charAt(s.length-1)==="#"?s.substring(0,s.length-1):s}class JB{constructor(){this._onDidChangeSchema=new M,this.schemasById={}}registerSchema(e,t){this.schemasById[QB(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const eW=new JB;Ht.add(gb.JSONContribution,eW);const pd={Configuration:"base.contributions.configuration"},_w="vscode://schemas/settings/resourceLanguage",Hk=Ht.as(gb.JSONContribution);class tW{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new M,this._onDidUpdateConfiguration=new M,this.defaultValues={},this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:p("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},Hk.registerSchema(_w,this.resourceLanguageSettingsSchema)}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=[];e.forEach(n=>{i.push(...this.validateAndRegisterProperties(n,t,n.extensionInfo)),this.configurationContributors.push(n),this.registerJSONConfiguration(n)}),Hk.registerSchema(_w,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(i)}registerOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}validateAndRegisterProperties(e,t=!0,i,n=3){var o;n=qn(e.scope)?n:e.scope;let r=[],a=e.properties;if(a)for(let d in a){if(t&&oW(d)){delete a[d];continue}const c=a[d];if(this.updatePropertyDefaultValue(d,c),LL.test(d)?c.scope=void 0:(c.scope=qn(c.scope)?n:c.scope,c.restricted=qn(c.restricted)?!!(!((o=i==null?void 0:i.restrictedConfigurations)===null||o===void 0)&&o.includes(d)):c.restricted),a[d].hasOwnProperty("included")&&!a[d].included){this.excludedConfigurationProperties[d]=a[d],delete a[d];continue}else this.configurationProperties[d]=a[d];!a[d].deprecationMessage&&a[d].markdownDeprecationMessage&&(a[d].deprecationMessage=a[d].markdownDeprecationMessage),r.push(d)}let l=e.allOf;if(l)for(let d of l)r.push(...this.validateAndRegisterProperties(d,t,i,n));return r}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=i=>{let n=i.properties;if(n)for(const r in n)this.updateSchema(r,n[r]);let o=i.allOf;o&&o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:p("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:p("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:_w};this.updatePropertyDefaultValue(t,i)}this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.defaultValues[e];ji(i)&&(i=t.default),ji(i)&&(i=sW(t.type)),t.default=i}}const iW="\\[.*\\]$",LL=new RegExp(iW);function nW(s){return s.substring(1,s.length-1)}function sW(s){switch(Array.isArray(s)?s[0]:s){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const NT=new tW;Ht.add(pd.Configuration,NT);function oW(s){return s.trim()?LL.test(s)?p("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",s):NT.getConfigurationProperties()[s]!==void 0?p("config.property.duplicate","Cannot register '{0}'. This property is already registered.",s):null:p("config.property.empty","Cannot register an empty property")}const rW=Object.prototype.hasOwnProperty;function aW(s,e){for(let t in s)if(rW.call(s,t)&&e({key:t,value:s[t]},function(){delete s[t]})===!1)return}class lW{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}}const zm=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new M,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(s){this._tabFocus!==s&&(this._tabFocus=s,this._onDidChangeTabFocus.fire(this._tabFocus))}},MT=Object.hasOwnProperty;class dW{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class cW{constructor(){this._values=[]}_read(e){return this._values[e]}_write(e,t){this._values[e]=t}}class tr{static readOptions(e){const t=e,i=new cW;for(const n of nc){const o=n.name==="_never_"?void 0:t[n.name];i._write(n.id,o)}return i}static validateOptions(e){const t=new AF;for(const i of nc)t._write(i.id,i.validate(e._read(i.id)));return t}static computeOptions(e,t){const i=new dW;for(const n of nc)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object")return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Ss(e,t):!1;for(let i in e)if(!tr._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of nc){const r=!tr._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(n=!0)}return n?new cM(i):null}}function hW(s){const e=s.wordWrap;e===!0?s.wordWrap="on":e===!1&&(s.wordWrap="off");const t=s.lineNumbers;t===!0?s.lineNumbers="on":t===!1&&(s.lineNumbers="off"),s.autoClosingBrackets===!1&&(s.autoClosingBrackets="never",s.autoClosingQuotes="never",s.autoSurround="never"),s.cursorBlinking==="visible"&&(s.cursorBlinking="solid");const o=s.renderWhitespace;o===!0?s.renderWhitespace="boundary":o===!1&&(s.renderWhitespace="none");const r=s.renderLineHighlight;r===!0?s.renderLineHighlight="line":r===!1&&(s.renderLineHighlight="none");const a=s.acceptSuggestionOnEnter;a===!0?s.acceptSuggestionOnEnter="on":a===!1&&(s.acceptSuggestionOnEnter="off");const l=s.tabCompletion;l===!1?s.tabCompletion="off":l===!0&&(s.tabCompletion="onlySnippets");const d=s.suggest;if(d&&typeof d.filteredTypes=="object"&&d.filteredTypes){const g={};g.method="showMethods",g.function="showFunctions",g.constructor="showConstructors",g.deprecated="showDeprecated",g.field="showFields",g.variable="showVariables",g.class="showClasses",g.struct="showStructs",g.interface="showInterfaces",g.module="showModules",g.property="showProperties",g.event="showEvents",g.operator="showOperators",g.unit="showUnits",g.value="showValues",g.constant="showConstants",g.enum="showEnums",g.enumMember="showEnumMembers",g.keyword="showKeywords",g.text="showWords",g.color="showColors",g.file="showFiles",g.reference="showReferences",g.folder="showFolders",g.typeParameter="showTypeParameters",g.snippet="showSnippets",aW(g,m=>{const b=d.filteredTypes[m.key];b===!1&&(d[m.value]=b)})}const c=s.hover;c===!0?s.hover={enabled:!0}:c===!1&&(s.hover={enabled:!1});const h=s.parameterHints;h===!0?s.parameterHints={enabled:!0}:h===!1&&(s.parameterHints={enabled:!1});const u=s.autoIndent;u===!0?s.autoIndent="full":u===!1&&(s.autoIndent="advanced");const f=s.matchBrackets;f===!0?s.matchBrackets="always":f===!1&&(s.matchBrackets="never")}function zk(s){const e=Zr(s);return hW(e),e}class Um extends U{constructor(e,t){super(),this._onDidChange=this._register(new M),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new M),this.onDidChangeFast=this._onDidChangeFast.event,this.isSimpleWidget=e,this._isDominatedByLongLines=!1,this._computeOptionsMemory=new hM,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._rawOptions=zk(t),this._readOptions=tr.readOptions(this._rawOptions),this._validatedOptions=tr.validateOptions(this._readOptions),this._register(Dr.onDidChangeZoomLevel(i=>this._recomputeOptions())),this._register(zm.onDidChangeTabFocus(i=>this._recomputeOptions()))}observeReferenceElement(e){}updatePixelRatio(){}_recomputeOptions(){const e=this.options,t=this._computeInternalOptions();if(!e)this.options=t;else{const i=tr.checkEquals(e,t);if(i===null)return;this.options=t,this._onDidChangeFast.fire(i),this._onDidChange.fire(i)}}getRawOptions(){return this._rawOptions}_computeInternalOptions(){const e=this._getEnvConfiguration(),t=Wc.createFromValidatedSettings(this._validatedOptions,e.zoomLevel,e.pixelRatio,this.isSimpleWidget),i={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,fontInfo:this.readConfiguration(t),extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:zm.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return tr.computeOptions(this._validatedOptions,i)}static _subsetEquals(e,t){for(const i in t)if(MT.call(t,i)){const n=t[i],o=e[i];if(o===n)continue;if(Array.isArray(o)&&Array.isArray(n)){if(!Ss(o,n))return!1;continue}if(o&&typeof o=="object"&&n&&typeof n=="object"){if(!this._subsetEquals(o,n))return!1;continue}return!1}return!0}updateOptions(e){if(typeof e>"u")return;const t=zk(e);Um._subsetEquals(this._rawOptions,t)||(this._rawOptions=eo(this._rawOptions,t||{}),this._readOptions=tr.readOptions(this._rawOptions),this._validatedOptions=tr.validateOptions(this._readOptions),this._recomputeOptions())}setIsDominatedByLongLines(e){this._isDominatedByLongLines=e,this._recomputeOptions()}setMaxLineNumber(e){const t=Um._digitCount(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}static _digitCount(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}}const uW=Object.freeze({id:"editor",order:5,type:"object",title:p("editorConfigurationTitle","Editor"),scope:5}),fW=Ht.as(pd.Configuration),$m=Object.assign(Object.assign({},uW),{properties:{"editor.tabSize":{type:"number",default:pn.tabSize,minimum:1,markdownDescription:p("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.insertSpaces":{type:"boolean",default:pn.insertSpaces,markdownDescription:p("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.detectIndentation":{type:"boolean",default:pn.detectIndentation,markdownDescription:p("detectIndentation","Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.")},"editor.trimAutoWhitespace":{type:"boolean",default:pn.trimAutoWhitespace,description:p("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:pn.largeFileOptimizations,description:p("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:p("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[p("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),p("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),p("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:p("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[p("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),p("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),p("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:p("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:p("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:p("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:p("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:p("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:p("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:p("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:p("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p("wordWrap.inherit","Lines will wrap according to the `#editor.wordWrap#` setting.")]}}});function gW(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of nc){const e=s.schema;if(typeof e<"u")if(gW(e))$m.properties[`editor.${s.name}`]=e;else for(let t in e)MT.call(e,t)&&($m.properties[t]=e[t])}let Rg=null;function TT(){return Rg===null&&(Rg=Object.create(null),Object.keys($m.properties).forEach(s=>{Rg[s]=!0})),Rg}function pW(s){return TT()[`editor.${s}`]||!1}function mW(s){return TT()[`diffEditor.${s}`]||!1}fW.registerConfiguration($m);class Bt{static insert(e,t){return{range:new L(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}const At=Ze("configurationService");function AT(s,e){const t=Object.create(null);for(let i in s)xL(t,i,s[i],e);return t}function xL(s,e,t,i){const n=e.split("."),o=n.pop();let r=s;for(let a=0;a<n.length;a++){let l=n[a],d=r[l];switch(typeof d){case"undefined":d=r[l]=Object.create(null);break;case"object":break;default:i(`Ignoring ${e} as ${n.slice(0,a+1).join(".")} is ${JSON.stringify(d)}`);return}r=d}if(typeof r=="object"&&r!==null)try{r[o]=t}catch{i(`Ignoring ${e} as ${n.join(".")} is ${JSON.stringify(r)}`)}else i(`Ignoring ${e} as ${n.join(".")} is ${JSON.stringify(r)}`)}function _W(s,e){const t=e.split(".");RT(s,t)}function RT(s,e){const t=e.shift();if(e.length===0){delete s[t];return}if(Object.keys(s).indexOf(t)!==-1){const i=s[t];typeof i=="object"&&!Array.isArray(i)&&(RT(i,e),Object.keys(i).length===0&&delete s[t])}}function bW(s,e,t){function i(r,a){let l=r;for(const d of a){if(typeof l!="object"||l===null)return;l=l[d]}return l}const n=e.split("."),o=i(s,n);return typeof o>"u"?t:o}function vW(){const s=Ht.as(pd.Configuration).getConfigurationProperties();return Object.keys(s)}function wW(){const s=Object.create(null),e=Ht.as(pd.Configuration).getConfigurationProperties();for(let t in e){let i=e[t].default;xL(s,t,i,n=>console.error(`Conflict in default settings: ${n}`))}return s}class jn{constructor(e={},t=[],i=[]){this._contents=e,this._keys=t,this._overrides=i,this.isFrozen=!1}get contents(){return this.checkAndFreeze(this._contents)}get overrides(){return this.checkAndFreeze(this._overrides)}get keys(){return this.checkAndFreeze(this._keys)}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?bW(this.contents,e):this.contents}override(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;let i={};for(const n of wT([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[n],r=t[n];r&&(typeof o=="object"&&typeof r=="object"?(o=Zr(o),this.mergeContents(o,r)):o=r),i[n]=o}return new jn(i,this.keys,this.overrides)}merge(...e){const t=Zr(this.contents),i=Zr(this.overrides),n=[...this.keys];for(const o of e){this.mergeContents(t,o.contents);for(const r of o.overrides){const[a]=i.filter(l=>Ss(l.identifiers,r.identifiers));a?this.mergeContents(a.contents,r.contents):i.push(Zr(r))}for(const r of o.keys)n.indexOf(r)===-1&&n.push(r)}return new jn(t,n,i)}freeze(){return this.isFrozen=!0,this}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&tn(e[i])&&tn(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Zr(t[i])}}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?i3(e):e}getContentsForOverrideIdentifer(e){for(const t of this.overrides)if(t.identifiers.indexOf(e)!==-1)return t.contents;return null}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.addKey(e),xL(this.contents,e,t,i=>{throw new Error(i)})}removeValue(e){this.removeKey(e)&&_W(this.contents,e)}addKey(e){let t=this.keys.length;for(let i=0;i<t;i++)e.indexOf(this.keys[i])===0&&(t=i);this.keys.splice(t,1,e)}removeKey(e){let t=this.keys.indexOf(e);return t!==-1?(this.keys.splice(t,1),!0):!1}}class CW extends jn{constructor(){const e=wW(),t=vW(),i=[];for(const n of Object.keys(e))LL.test(n)&&i.push({identifiers:[nW(n).trim()],keys:Object.keys(e[n]),contents:AT(e[n],o=>console.error(`Conflict in default settings file: ${o}`))});super(e,t,i)}}let OT=class PT{constructor(e,t,i=new jn,n=new jn,o=new Ji,r=new jn,a=new Ji,l=!0){this._defaultConfiguration=e,this._localUserConfiguration=t,this._remoteUserConfiguration=i,this._workspaceConfiguration=n,this._folderConfigurations=o,this._memoryConfiguration=r,this._memoryConfigurationByResource=a,this._freeze=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Ji,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidateConfigurationModel(t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new jn,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,t===void 0?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration),this._freeze&&this._userConfiguration.freeze()),this._userConfiguration}getConsolidateConfigurationModel(e,t){let i=this.getConsolidatedConfigurationModelForResource(e,t);return e.overrideIdentifier?i.override(e.overrideIdentifier):i}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._freeze&&(this._workspaceConfiguration=this._workspaceConfiguration.freeze())),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._freeze&&(t=t.freeze()),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.user),n=this.parseConfigurationModel(e.workspace),o=e.folders.reduce((r,a)=>(r.set(he.revive(a[0]),this.parseConfigurationModel(a[1])),r),new Ji);return new PT(t,i,new jn,n,o,new jn,new Ji,!1)}static parseConfigurationModel(e){return new jn(e.contents,e.keys,e.overrides).freeze()}};class SW{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._previousConfiguration=void 0;const o=new Set;e.keys.forEach(a=>o.add(a)),e.overrides.forEach(([,a])=>a.forEach(l=>o.add(l))),this.affectedKeys=[...o.values()];const r=new jn;this.affectedKeys.forEach(a=>r.setValue(a,{})),this.affectedKeysTree=r.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=OT.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;if(this.doesAffectedKeysTreeContains(this.affectedKeysTree,e)){if(t){const n=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,o=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!br(n,o)}return!0}return!1}doesAffectedKeysTreeContains(e,t){let i=AT({[t]:!0},()=>{}),n;for(;typeof i=="object"&&(n=Object.keys(i)[0]);){if(e=e[n],!e)return!1;i=i[n]}return!0}}const yW=/^(cursor|delete)/;class LW extends U{constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new M),this._currentChord=null,this._currentChordChecker=new Xf,this._currentChordStatusMessage=null,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new an,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:re.None}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){const i=this.resolveKeyboardEvent(e);if(i.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),null;const[n]=i.getDispatchParts();if(n===null)return null;const o=this._contextKeyService.getContext(t),r=this._currentChord?this._currentChord.keypress:null;return this._getResolver().resolve(o,r,n)}_enterChordMode(e,t){this._currentChord={keypress:e,label:t},this._currentChordStatusMessage=this._notificationService.status(p("first.chord","({0}) was pressed. Waiting for second key of chord...",t));const i=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-i>5e3&&this._leaveChordMode()},500)}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchParts();return n!==null&&this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n!==null&&n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1)}_doDispatch(e,t,i=!1){let n=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;let o=null,r=null;if(i){const[c]=e.getSingleModifierDispatchParts();o=c,r=c}else[o]=e.getDispatchParts(),r=this._currentChord?this._currentChord.keypress:null;if(o===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const a=this._contextKeyService.getContext(t),l=e.getLabel(),d=this._getResolver().resolve(a,r,o);return this._logService.trace("KeybindingService#dispatch",l,d==null?void 0:d.commandId),d&&d.enterChord?(n=!0,this._enterChordMode(o,l),n):(this._currentChord&&(!d||!d.commandId)&&(this._notificationService.status(p("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,l),{hideAfter:10*1e3}),n=!0),this._leaveChordMode(),d&&d.commandId&&(d.bubble||(n=!0),typeof d.commandArgs>"u"?this._commandService.executeCommand(d.commandId).then(void 0,c=>this._notificationService.warn(c)):this._commandService.executeCommand(d.commandId,d.commandArgs).then(void 0,c=>this._notificationService.warn(c)),yW.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding"})),n)}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class Sc{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(let n=0,o=e.length;n<o;n++){const r=e[n].command;r&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Sc.combine(e,t);for(let n=0,o=this._keybindings.length;n<o;n++){let r=this._keybindings[n];r.keypressParts.length!==0&&(r.when&&r.when.type===0||this._addKeyPress(r.keypressParts[0],r))}}static _isTargetedForRemoval(e,t,i,n,o){return!(e.command!==n||t&&e.keypressParts[0]!==t||i&&e.keypressParts[1]!==i||o&&(!e.when||!o.equals(e.when)))}static combine(e,t){e=e.slice(0);let i=[];for(const n of t){if(!n.command||n.command.length===0||n.command.charAt(0)!=="-"){i.push(n);continue}const o=n.command.substr(1),r=n.keypressParts[0],a=n.keypressParts[1],l=n.when;for(let d=e.length-1;d>=0;d--)this._isTargetedForRemoval(e[d],r,a,o,l)&&e.splice(d,1)}return e.concat(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--){let o=i[n];if(o.command===t.command)continue;const r=o.keypressParts.length>1,a=t.keypressParts.length>1;r&&a&&o.keypressParts[1]!==t.keypressParts[1]||Sc.whenIsEntirelyIncluded(o.when,t.when)&&this._removeFromLookupMap(o)}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;let 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:this._implies(e,t)}static _implies(e,t){const i=e.negate(),n=r=>r.type===9?r.expr:[r];let o=n(i).concat(n(t));for(let r=0;r<o.length;r++){const l=o[r].negate();for(let d=r+1;d<o.length;d++){const c=o[d];if(l.equals(c))return!0}}return!1}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let n=i.length-1;n>=0;n--){const o=i[n];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){this._log(`| Resolving ${i}${t?` chorded from ${t}`:""}`);let n=null;if(t!==null){const r=this._map.get(t);if(typeof r>"u")return this._log("\\ No keybinding entries."),null;n=[];for(let a=0,l=r.length;a<l;a++){let d=r[a];d.keypressParts[1]===i&&n.push(d)}}else{const r=this._map.get(i);if(typeof r>"u")return this._log("\\ No keybinding entries."),null;n=r}let o=this._findCommand(e,n);return o?t===null&&o.keypressParts.length>1&&o.keypressParts[1]!==null?(this._log(`\\ From ${n.length} keybinding entries, matched chord, when: ${Uk(o.when)}, source: ${$k(o)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${n.length} keybinding entries, matched ${o.command}, when: ${Uk(o.when)}, source: ${$k(o)}.`),{enterChord:!1,leaveChord:o.keypressParts.length>1,commandId:o.command,commandArgs:o.commandArgs,bubble:o.bubble}):(this._log(`\\ From ${n.length} keybinding entries, no when clauses matched the context.`),null)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){let n=t[i];if(Sc.contextMatchesRules(e,n.when))return n}return null}static contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Uk(s){return s?`${s.serialize()}`:"no when condition"}function $k(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}class jm{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(ps===1){if(e&&e.win)return e.win}else if(ps===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=jm.bindToCurrentPlatform(e);if(t&&t.primary){const i=n0(t.primary,ps);i&&this._registerDefaultKeybinding(i,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let i=0,n=t.secondary.length;i<n;i++){const o=t.secondary[i],r=n0(o,ps);r&&this._registerDefaultKeybinding(r,e.id,e.args,e.weight,-i-1,e.when)}}registerCommandAndKeybindingRule(e){this.registerKeybindingRule(e),He.registerCommand(e)}static _mightProduceChar(e){return e>=21&&e<=30||e>=31&&e<=56?!0:e===80||e===81||e===82||e===83||e===84||e===85||e===86||e===110||e===111||e===87||e===88||e===89||e===90||e===91||e===92}_assertNoCtrlAlt(e,t){e.ctrlKey&&e.altKey&&!e.metaKey&&jm._mightProduceChar(e.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",e," for ",t)}_registerDefaultKeybinding(e,t,i,n,o,r){ps===1&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:r,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(DW)),this._cachedMergedKeybindings.slice(0)}}const ln=new jm,xW={EditorModes:"platform.keybindingsRegistry"};Ht.add(xW.EditorModes,ln);function DW(s,e){return s.weight1!==e.weight1?s.weight1-e.weight1:s.command<e.command?-1:s.command>e.command?1:s.weight2-e.weight2}class jk{constructor(e,t,i,n,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.keypressParts=e?qk(e.getDispatchParts()):[],e&&this.keypressParts.length===0&&(this.keypressParts=qk(e.getSingleModifierDispatchParts())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function qk(s){let e=[];for(let t=0,i=s.length;t<i;t++){const n=s[t];if(!n)return e;e.push(n)}return e}class FT{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(t.length===0)return null;const n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],l=i(a);if(l===null)return null;n[o]=IW(a,l,this.modifierLabels[e])}return n.join(" ")}}const DL=new FT({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:p({},"Ctrl"),shiftKey:p({},"Shift"),altKey:p({},"Alt"),metaKey:p({},"Windows"),separator:"+"},{ctrlKey:p({},"Ctrl"),shiftKey:p({},"Shift"),altKey:p({},"Alt"),metaKey:p({},"Super"),separator:"+"}),kW=new FT({ctrlKey:p({},"Control"),shiftKey:p({},"Shift"),altKey:p({},"Alt"),metaKey:p({},"Command"),separator:"+"},{ctrlKey:p({},"Control"),shiftKey:p({},"Shift"),altKey:p({},"Alt"),metaKey:p({},"Windows"),separator:"+"},{ctrlKey:p({},"Control"),shiftKey:p({},"Shift"),altKey:p({},"Alt"),metaKey:p({},"Super"),separator:"+"});function IW(s,e,t){if(e===null)return"";const i=[];return s.ctrlKey&&i.push(t.ctrlKey),s.shiftKey&&i.push(t.shiftKey),s.altKey&&i.push(t.altKey),s.metaKey&&i.push(t.metaKey),e!==""&&i.push(e),i.join(t.separator)}class EW extends C4{constructor(e,t){if(super(),t.length===0)throw Rn("parts");this._os=e,this._parts=t}getLabel(){return DL.toLabel(this._os,this._parts,e=>this._getLabel(e))}getAriaLabel(){return kW.toLabel(this._os,this._parts,e=>this._getAriaLabel(e))}isChord(){return this._parts.length>1}getParts(){return this._parts.map(e=>this._getPart(e))}_getPart(e){return new w4(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchParts(){return this._parts.map(e=>this._getDispatchPart(e))}getSingleModifierDispatchParts(){return this._parts.map(e=>this._getSingleModifierDispatchPart(e))}}class qm extends EW{constructor(e,t){super(t,e.parts)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return pc.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":pc.toString(e.keyCode)}_getDispatchPart(e){return qm.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=pc.toString(e.keyCode),t}_getSingleModifierDispatchPart(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}}const Qt=Ze("notificationService");class NW{}const BT=Ze("contextService");class MW{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}var $t;(function(s){s.noSelection=p("noSelection","No selection"),s.singleSelectionRange=p("singleSelectionRange","Line {0}, Column {1} ({2} selected)"),s.singleSelection=p("singleSelection","Line {0}, Column {1}"),s.multiSelectionRange=p("multiSelectionRange","{0} selections ({1} characters selected)"),s.multiSelection=p("multiSelection","{0} selections"),s.emergencyConfOn=p("emergencyConfOn","Now changing the setting `accessibilitySupport` to 'on'."),s.openingDocs=p("openingDocs","Now opening the Editor Accessibility documentation page."),s.readonlyDiffEditor=p("readonlyDiffEditor"," in a read-only pane of a diff editor."),s.editableDiffEditor=p("editableDiffEditor"," in a pane of a diff editor."),s.readonlyEditor=p("readonlyEditor"," in a read-only code editor"),s.editableEditor=p("editableEditor"," in a code editor"),s.changeConfigToOnMac=p("changeConfigToOnMac","To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),s.changeConfigToOnWinLinux=p("changeConfigToOnWinLinux","To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),s.auto_on=p("auto_on","The editor is configured to be optimized for usage with a Screen Reader."),s.auto_off=p("auto_off","The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),s.tabFocusModeOnMsg=p("tabFocusModeOnMsg","Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),s.tabFocusModeOnMsgNoKb=p("tabFocusModeOnMsgNoKb","Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."),s.tabFocusModeOffMsg=p("tabFocusModeOffMsg","Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),s.tabFocusModeOffMsgNoKb=p("tabFocusModeOffMsgNoKb","Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),s.openDocMac=p("openDocMac","Press Command+H now to open a browser window with more information related to editor accessibility."),s.openDocWinLinux=p("openDocWinLinux","Press Control+H now to open a browser window with more information related to editor accessibility."),s.outroMsg=p("outroMsg","You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),s.showAccessibilityHelpAction=p("showAccessibilityHelpAction","Show Accessibility Help")})($t||($t={}));var mS;(function(s){s.inspectTokensAction=p("inspectTokens","Developer: Inspect Tokens")})(mS||(mS={}));var Km;(function(s){s.gotoLineActionLabel=p("gotoLineActionLabel","Go to Line/Column...")})(Km||(Km={}));var _S;(function(s){s.helpQuickAccessActionLabel=p("helpQuickAccess","Show all Quick Access Providers")})(_S||(_S={}));var Gm;(function(s){s.quickCommandActionLabel=p("quickCommandActionLabel","Command Palette"),s.quickCommandHelp=p("quickCommandActionHelp","Show And Run Commands")})(Gm||(Gm={}));var tf;(function(s){s.quickOutlineActionLabel=p("quickOutlineActionLabel","Go to Symbol..."),s.quickOutlineByCategoryActionLabel=p("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(tf||(tf={}));var Zm;(function(s){s.editorViewAccessibleLabel=p("editorViewAccessibleLabel","Editor content"),s.accessibilityHelpMessage=p("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(Zm||(Zm={}));var bS;(function(s){s.toggleHighContrast=p("toggleHighContrast","Toggle High Contrast Theme")})(bS||(bS={}));var vS;(function(s){s.bulkEditServiceSummary=p("bulkEditServiceSummary","Made {0} edits in {1} files")})(vS||(vS={}));var WT=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},VT=function(s,e){return function(t,i){e(t,i,s)}},HT=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class TW{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new M}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}function AW(s,e,t){return Fo(s)?e(s):t(s)}let wS=class{constructor(e){this.modelService=e}setEditor(e){this.editor=e}createModelReference(e){let t=null;return this.editor&&(t=AW(this.editor,i=>this.findModel(i,e),i=>this.findModel(i.getOriginalEditor(),e)||this.findModel(i.getModifiedEditor(),e))),t?Promise.resolve(new _4(new TW(t))):Promise.reject(new Error("Model not found"))}findModel(e,t){let i=this.modelService.getModel(t);return i&&i.uri.toString()!==t.toString()?null:i}};wS=WT([VT(0,Vt)],wS);class pb{show(){return pb.NULL_PROGRESS_RUNNER}showWhile(e,t){return HT(this,void 0,void 0,function*(){yield e})}}pb.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class RW{confirm(e){return this.doConfirm(e).then(t=>({confirmed:t,checkboxChecked:!1}))}doConfirm(e){let t=e.message;return e.detail&&(t=t+`
`+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}}class mb{info(e){return this.notify({severity:It.Info,message:e})}warn(e){return this.notify({severity:It.Warning,message:e})}error(e){return this.notify({severity:It.Error,message:e})}notify(e){switch(e.severity){case It.Error:console.error(e.message);break;case It.Warning:console.warn(e.message);break;default:console.log(e.message);break}return mb.NO_OP}status(e,t){return U.None}}mb.NO_OP=new NW;class OW{constructor(e){this._onWillExecuteCommand=new M,this._onDidExecuteCommand=new M,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=He.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)}}}class zT extends LW{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._register(K(r,le.KEY_DOWN,a=>{const l=new Mt(a);this._dispatch(l,l.target)&&(l.preventDefault(),l.stopPropagation())})),this._register(K(window,le.KEY_UP,a=>{const l=new Mt(a);this._singleModifierDispatch(l,l.target)&&l.preventDefault()}))}addDynamicKeybinding(e,t,i,n){const o=n0(t,ps),r=new X;return o&&(this._dynamicKeybindings.push({keybinding:o,command:e,when:n,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),r.add(Pe(()=>{for(let a=0;a<this._dynamicKeybindings.length;a++)if(this._dynamicKeybindings[a].command===e){this._dynamicKeybindings.splice(a,1),this.updateResolver({source:1});return}}))),r.add(He.registerCommand(e,i)),this.updateResolver({source:1}),r}updateResolver(e){this._cachedResolver=null,this._onDidUpdateKeybindings.fire(e)}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(ln.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new Sc(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){let i=[],n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new jk(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=this.resolveKeybinding(a);for(const d of l)i[n++]=new jk(d,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeybinding(e){return[new qm(e,ps)]}resolveKeyboardEvent(e){let t=new zu(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new qm(t,ps)}}function Kk(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource||s.resource instanceof he)}class UT{constructor(){this._onDidChangeConfiguration=new M,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new OT(new CW,new jn)}getValue(e,t){const i=typeof e=="string"?e:void 0,n=Kk(e)?e:Kk(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()};let i=[];for(const n of e){const[o,r]=n;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const n=new SW({keys:i,overrides:[]},t,this._configuration);n.source=7,n.sourceConfig=null,this._onDidChangeConfiguration.fire(n)}return Promise.resolve()}}class PW{constructor(e){this.configurationService=e,this._onDidChangeConfiguration=new M,this.configurationService.onDidChangeConfiguration(t=>{this._onDidChangeConfiguration.fire({affectedKeys:t.affectedKeys,affectsConfiguration:(i,n)=>t.affectsConfiguration(n)})})}getValue(e,t,i){const o=(O.isIPosition(t)?t:null)?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0;return typeof o>"u"?this.configurationService.getValue():this.configurationService.getValue(o)}}let CS=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&i!=="auto"?i:sn||Re?`
`:`\r
`}};CS=WT([VT(0,At)],CS);class FW{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class _b{constructor(){const e=he.from({scheme:_b.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new MW({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}_b.SCHEME="inmemory";function Ym(s,e,t){if(!e||!(s instanceof UT))return;let i=[];Object.keys(e).forEach(n=>{pW(n)&&i.push([`editor.${n}`,e[n]]),t&&mW(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}class BW{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return HT(this,void 0,void 0,function*(){const i=new Map;for(let r of e){if(!(r instanceof ET))throw new Error("bad edit - only text edits are supported");const a=this._modelService.getModel(r.resource);if(!a)throw new Error("bad edit - model not found");if(typeof r.versionId=="number"&&a.getVersionId()!==r.versionId)throw new Error("bad state - model changed in the meantime");let l=i.get(a);l||(l=[],i.set(a,l)),l.push(Bt.replaceMove(L.lift(r.textEdit.range),r.textEdit.text))}let n=0,o=0;for(const[r,a]of i)r.pushStackElement(),r.pushEditOperations([],a,()=>[]),r.pushStackElement(),o+=1,n+=a.length;return{ariaSummary:Ai(vS.bulkEditServiceSummary,n,o)}})}}class WW{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}}class VW{constructor(e,t){this._codeEditorService=e,this._container=t,this.onDidLayout=re.None}get dimension(){return this._dimension||(this._dimension=eb(window.document.body)),this._dimension}get container(){return this._container}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}}const Gk=2e4;let il,Rp,SS,Op,yS;function HW(s){il=document.createElement("div"),il.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),il.appendChild(i),i};Rp=e(),SS=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("role","complementary"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),il.appendChild(i),i};Op=t(),yS=t(),s.appendChild(il)}function wi(s){il&&(Rp.textContent!==s?(hi(SS),Qm(Rp,s)):(hi(Rp),Qm(SS,s)))}function Xm(s){il&&(Re?wi(s):Op.textContent!==s?(hi(yS),Qm(Op,s)):(hi(Op),Qm(yS,s)))}function Qm(s,e){hi(s),e.length>Gk&&(e=e.substr(0,Gk)),s.textContent=e,s.style.visibility="hidden",s.style.visibility="visible"}const kL=Ze("markerDecorationsService");var Jm=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class ys extends U{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new M),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._checked=!1,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return Jm(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class bb extends U{constructor(){super(...arguments),this._onBeforeRun=this._register(new M),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new M),this.onDidRun=this._onDidRun.event}run(e,t){return Jm(this,void 0,void 0,function*(){if(!e.enabled)return;this._onBeforeRun.fire({action:e});let i;try{yield this.runAction(e,t)}catch(n){i=n}this._onDidRun.fire({action:e,error:i})})}runAction(e,t){return Jm(this,void 0,void 0,function*(){yield e.run(t)})}}class Ls extends ys{constructor(e){super(Ls.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Ls.ID="vs.actions.separator";class vb{constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=e,this.label=t,this.class=n,this._actions=i}get actions(){return this._actions}dispose(){}run(){return Jm(this,void 0,void 0,function*(){})}}class wb extends ys{constructor(){super(wb.ID,p("submenu.empty","(empty)"),void 0,!1)}}wb.ID="vs.actions.empty";let Cb=EF||"";const Sn=new Map;Sn.set("false",!1);Sn.set("true",!0);Sn.set("isMac",Re);Sn.set("isLinux",sn);Sn.set("isWindows",Si);Sn.set("isWeb",gh);Sn.set("isMacNative",Re&&!gh);Sn.set("isEdge",Cb.indexOf("Edg/")>=0);Sn.set("isFirefox",Cb.indexOf("Firefox")>=0);Sn.set("isChrome",Cb.indexOf("Chrome")>=0);Sn.set("isSafari",Cb.indexOf("Safari")>=0);const zW=Object.prototype.hasOwnProperty;class J{static has(e){return va.create(e)}static equals(e,t){return nf.create(e,t)}static regex(e,t){return e_.create(e,t)}static not(e){return Rl.create(e)}static and(...e){return yc.create(e)}static or(...e){return Ol.create(e)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return Ol.create(i.map(n=>this._deserializeAndExpression(n,t)))}static _deserializeAndExpression(e,t){let i=e.split("&&");return yc.create(i.map(n=>this._deserializeOne(n,t)))}static _deserializeOne(e,t){if(e=e.trim(),e.indexOf("!=")>=0){let i=e.split("!=");return Sb.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return nf.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return e_.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let i=e.split(" in ");return IL.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const i=e.split(">=");return Lb.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const i=e.split(">");return yb.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const i=e.split("<=");return Db.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const i=e.split("<");return xb.create(i[0].trim(),i[1].trim())}return/^\!\s*/.test(e)?Rl.create(e.substr(1).trim()):va.create(e)}static _deserializeValue(e,t){if(e=e.trim(),e==="true")return!0;if(e==="false")return!1;let i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if(WM(e)){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let i=e.indexOf("/"),n=e.lastIndexOf("/");if(i===n||i<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let o=e.slice(i+1,n),r=e[n+1]==="i"?"i":"";try{return new RegExp(o,r)}catch(a){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${a}`);return console.warn(`bad regexp-value '${e}', parse error: ${a}`),null}}}function Lu(s,e){return s.cmp(e)}class kr{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Ir.INSTANCE}}kr.INSTANCE=new kr;class Ir{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return kr.INSTANCE}}Ir.INSTANCE=new Ir;class va{constructor(e){this.key=e,this.type=2}static create(e){const t=Sn.get(e);return typeof t=="boolean"?t?Ir.INSTANCE:kr.INSTANCE:new va(e)}cmp(e){return e.type!==this.type?this.type-e.type:$T(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return Rl.create(this.key)}}class nf{constructor(e,t){this.key=e,this.value=t,this.type=4}static create(e,t){if(typeof t=="boolean")return t?va.create(e):Rl.create(e);const i=Sn.get(e);return typeof i=="boolean"?t===(i?"true":"false")?Ir.INSTANCE:kr.INSTANCE:new nf(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:md(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return Sb.create(this.key,this.value)}}class IL{constructor(e,t){this.key=e,this.valueKey=t,this.type=10}static create(e,t){return new IL(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:md(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.indexOf(i)>=0:typeof i=="string"&&typeof t=="object"&&t!==null?zW.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return EL.create(this)}}class EL{constructor(e){this._actual=e,this.type=11}static create(e){return new EL(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class Sb{constructor(e,t){this.key=e,this.value=t,this.type=5}static create(e,t){if(typeof t=="boolean")return t?Rl.create(e):va.create(e);const i=Sn.get(e);return typeof i=="boolean"?t===(i?"true":"false")?kr.INSTANCE:Ir.INSTANCE:new Sb(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:md(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return nf.create(this.key,this.value)}}class Rl{constructor(e){this.key=e,this.type=3}static create(e){const t=Sn.get(e);return typeof t=="boolean"?t?kr.INSTANCE:Ir.INSTANCE:new Rl(e)}cmp(e){return e.type!==this.type?this.type-e.type:$T(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return va.create(this.key)}}class yb{constructor(e,t){this.key=e,this.value=t,this.type=12}static create(e,t){return new yb(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:md(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}evaluate(e){return parseFloat(e.getValue(this.key))>parseFloat(this.value)}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return Db.create(this.key,this.value)}}class Lb{constructor(e,t){this.key=e,this.value=t,this.type=13}static create(e,t){return new Lb(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:md(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}evaluate(e){return parseFloat(e.getValue(this.key))>=parseFloat(this.value)}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return xb.create(this.key,this.value)}}class xb{constructor(e,t){this.key=e,this.value=t,this.type=14}static create(e,t){return new xb(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:md(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}evaluate(e){return parseFloat(e.getValue(this.key))<parseFloat(this.value)}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return Lb.create(this.key,this.value)}}class Db{constructor(e,t){this.key=e,this.value=t,this.type=15}static create(e,t){return new Db(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:md(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}evaluate(e){return parseFloat(e.getValue(this.key))<=parseFloat(this.value)}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return yb.create(this.key,this.value)}}class e_{constructor(e,t){this.key=e,this.regexp=t,this.type=7}static create(e,t){return new e_(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}evaluate(e){let t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return NL.create(this)}}class NL{constructor(e){this._actual=e,this.type=8}static create(e){return new NL(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class yc{constructor(e){this.expr=e,this.type=6}static create(e){return yc._normalizeArr(e)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const n=Lu(this.expr[t],e.expr[t]);if(n!==0)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e){const t=[];let i=!1;for(const n of e)if(n){if(n.type===1){i=!0;continue}if(n.type===0)return kr.INSTANCE;if(n.type===6){t.push(...n.expr);continue}t.push(n)}if(t.length===0&&i)return Ir.INSTANCE;if(t.length!==0){if(t.length===1)return t[0];for(t.sort(Lu);t.length>1;){const n=t[t.length-1];if(n.type!==9)break;t.pop();const o=t.pop(),r=Ol.create(n.expr.map(a=>yc.create([a,o])));r&&(t.push(r),t.sort(Lu))}return t.length===1?t[0]:new yc(t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){let e=[];for(let t of this.expr)e.push(t.negate());return Ol.create(e)}}class Ol{constructor(e){this.expr=e,this.type=9}static create(e){const t=Ol._normalizeArr(e);if(t.length!==0)return t.length===1?t[0]:new Ol(t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const n=Lu(this.expr[t],e.expr[t]);if(n!==0)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e){let t=[],i=!1;if(e){for(let n=0,o=e.length;n<o;n++){const r=e[n];if(r){if(r.type===0){i=!0;continue}if(r.type===1)return[Ir.INSTANCE];if(r.type===9){t=t.concat(r.expr);continue}t.push(r)}}if(t.length===0&&i)return[kr.INSTANCE];t.sort(Lu)}return t}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){let e=[];for(let i of this.expr)e.push(i.negate());const t=i=>i.type===9?i.expr:[i];for(;e.length>1;){const i=e.shift(),n=e.shift(),o=[];for(const r of t(i))for(const a of t(n))o.push(J.and(r,a));e.unshift(J.or(...o))}return e[0]}}class se extends va{constructor(e,t,i){super(e),this._defaultValue=t,typeof i=="object"?se._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&se._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}static all(){return se._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return J.not(this.key)}isEqualTo(e){return J.equals(this.key,e)}}se._info=[];const we=Ze("contextKeyService"),UW="setContext";function $T(s,e){return s<e?-1:s>e?1:0}function md(s,e,t,i){return s<t?-1:s>t?1:e<i?-1:e>i?1:0}var Xn;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST="hc"})(Xn||(Xn={}));const pt=Ze("themeService");var LS;(function(s){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})(LS||(LS={}));function en(s){return{id:s}}var wt;(function(s){function e(a){return a&&typeof a=="object"&&typeof a.id=="string"&&(typeof a.color>"u"||LS.isThemeColor(a.color))}s.isThemeIcon=e;const t=new RegExp(`^\\$\\((${mn.iconNameExpression}(?:${mn.iconModifierExpression})?)\\)$`);function i(a){const l=t.exec(a);if(!l)return;let[,d]=l;return{id:d}}s.fromString=i;function n(a,l){let d=a.id;const c=d.lastIndexOf("~");return c!==-1&&(d=d.substring(0,c)),l&&(d=`${d}~${l}`),{id:d}}s.modify=n;function o(a,l){var d,c;return a.id===l.id&&((d=a.color)===null||d===void 0?void 0:d.id)===((c=l.color)===null||c===void 0?void 0:c.id)}s.isEqual=o;function r(a){return{id:a.id}}s.asThemeIcon=r,s.asClassNameArray=mn.asClassNameArray,s.asClassName=mn.asClassName,s.asCSSSelector=mn.asCSSSelector})(wt||(wt={}));function t_(s){switch(s){case Xn.DARK:return"vs-dark";case Xn.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const jT={ThemingContribution:"base.contributions.theming"};class $W{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new M}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Pe(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let qT=new $W;Ht.add(jT.ThemingContribution,qT);function tt(s){return qT.onColorThemeChange(s)}class jW extends U{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}var qW=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Zk=function(s,e){return function(t,i){e(t,i,s)}};function ru(s){return s.command!==void 0}class oe{constructor(e){this.id=oe._idPool++,this._debugName=e}}oe._idPool=0;oe.CommandPalette=new oe("CommandPalette");oe.EditorContext=new oe("EditorContext");oe.SimpleEditorContext=new oe("SimpleEditorContext");oe.EditorContextCopy=new oe("EditorContextCopy");oe.EditorContextPeek=new oe("EditorContextPeek");oe.MenubarEditMenu=new oe("MenubarEditMenu");oe.MenubarCopy=new oe("MenubarCopy");oe.MenubarGoMenu=new oe("MenubarGoMenu");oe.MenubarSelectionMenu=new oe("MenubarSelectionMenu");oe.InlineCompletionsActions=new oe("InlineCompletionsActions");const vh=Ze("menuService"),xs=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new M,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===oe.CommandPalette}}addCommand(s){return this.addCommands(Be.single(s))}addCommands(s){for(const e of s)this._commands.set(e.id,e);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Pe(()=>{let e=!1;for(const t of s)e=this._commands.delete(t.id)||e;e&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((e,t)=>s.set(t,e)),s}appendMenuItem(s,e){return this.appendMenuItems(Be.single({id:s,item:e}))}appendMenuItems(s){const e=new Set,t=new Mn;for(const{id:i,item:n}of s){let o=this._menuItems.get(i);o||(o=new Mn,this._menuItems.set(i,o)),t.push(o.push(n)),e.add(i)}return this._onDidChangeMenu.fire(e),Pe(()=>{if(t.size>0){for(let i of t)i();this._onDidChangeMenu.fire(e),t.clear()}})}getMenuItems(s){let e;return this._menuItems.has(s)?e=[...this._menuItems.get(s)]:e=[],s===oe.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(s){const e=new Set;for(const t of s)ru(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||s.push({command:t})})}};class ML extends vb{constructor(e,t,i,n){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,[],"submenu"),this.item=e,this._menuService=t,this._contextKeyService=i,this._options=n}get actions(){const e=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),i=t.getActions(this._options);t.dispose();for(const[,n]of i)n.length>0&&(e.push(...n),e.push(new Ls));return e.length&&e.pop(),e}}let Uc=class KT{constructor(e,t,i,n,o){var r;if(this._commandService=o,this.id=e.id,this.label=i!=null&&i.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value,this.tooltip=(r=e.tooltip)!==null&&r!==void 0?r:"",this.enabled=!e.precondition||n.contextMatchesRules(e.precondition),this.checked=!1,e.toggled){const a=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=n.contextMatchesRules(a.condition),this.checked&&a.tooltip&&(this.tooltip=typeof a.tooltip=="string"?a.tooltip:a.tooltip.value),a.title&&(this.label=typeof a.title=="string"?a.title:a.title.value)}this.item=e,this.alt=t?new KT(t,void 0,i,n,o):void 0,this._options=i,wt.isThemeIcon(e.icon)&&(this.class=mn.asClassName(e.icon))}dispose(){}run(...e){var t,i;let n=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(n=[...n,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};Uc=qW([Zk(3,we),Zk(4,Wt)],Uc);const Ba=Ze("telemetryService");class kb{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=J.and(i,this.precondition):i=this.precondition);const n={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};ln.registerKeybindingRule(n)}}He.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){xs.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class wh extends kb{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),this._implementations.sort((n,o)=>o.priority-n.priority),{dispose:()=>{for(let n=0;n<this._implementations.length;n++)if(this._implementations[n].implementation===i){this._implementations.splice(n,1);return}}}}runCommand(e,t){const i=e.get(Tr);for(const n of this._implementations){const o=n.implementation(e,t);if(o)return i.trace(`Command '${this.id}' was handled by '${n.name}'.`),typeof o=="boolean"?void 0:o}}}class GT extends kb{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class Di extends kb{static bindToContribution(e){return class extends Di{constructor(i){super(i),this._callback=i.handler}runEditorCommand(i,n,o){e(n)&&this._callback(e(n),o)}}}runCommand(e,t){const i=e.get(Ge),n=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(n)return n.invokeWithinContext(o=>{if(o.get(we).contextMatchesRules(Tn(this.precondition)))return this.runEditorCommand(o,n,t)})}}class ne extends Di{constructor(e){super(ne.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(n){return n.menuId||(n.menuId=oe.EditorContext),n.title||(n.title=e.label),n.when=J.and(e.precondition,n.when),n}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(Ba).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class ZT extends ne{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,n)=>n[0]-i[0]),{dispose:()=>{for(let i=0;i<this._implementations.length;i++)if(this._implementations[i][1]===t){this._implementations.splice(i,1);return}}}}run(e,t,i){for(const n of this._implementations){const o=n[1](e,t,i);if(o)return typeof o=="boolean"?void 0:o}}}function Ar(s,e){He.registerCommand(s,function(t,...i){const[n,o]=i;nt(he.isUri(n)),nt(O.isIPosition(o));const r=t.get(Vt).getModel(n);if(r){const a=O.lift(o);return e(r,a,...i.slice(2))}return t.get(Xs).createModelReference(n).then(a=>new Promise((l,d)=>{try{const c=e(a.object.textEditorModel,O.lift(o),i.slice(2));l(c)}catch(c){d(c)}}).finally(()=>{a.dispose()}))})}function KW(s,e){He.registerCommand(s,function(t,...i){const[n]=i;nt(he.isUri(n));const o=t.get(Vt).getModel(n);return o?e(o,...i.slice(1)):t.get(Xs).createModelReference(n).then(r=>new Promise((a,l)=>{try{const d=e(r.object.textEditorModel,i.slice(1));a(d)}catch(d){l(d)}}).finally(()=>{r.dispose()}))})}function G(s){return Kn.INSTANCE.registerEditorCommand(s),s}function Q(s){const e=new s;return Kn.INSTANCE.registerEditorAction(e),e}function YT(s){return Kn.INSTANCE.registerEditorAction(s),s}function XT(s){Kn.INSTANCE.registerEditorAction(s)}function Xe(s,e){Kn.INSTANCE.registerEditorContribution(s,e)}var Lc;(function(s){function e(r){return Kn.INSTANCE.getEditorCommand(r)}s.getEditorCommand=e;function t(){return Kn.INSTANCE.getEditorActions()}s.getEditorActions=t;function i(){return Kn.INSTANCE.getEditorContributions()}s.getEditorContributions=i;function n(r){return Kn.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}s.getSomeEditorContributions=n;function o(){return Kn.INSTANCE.getDiffEditorContributions()}s.getDiffEditorContributions=o})(Lc||(Lc={}));const GW={EditorCommonContributions:"editor.contributions"};class Kn{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}Kn.INSTANCE=new Kn;Ht.add(GW.EditorCommonContributions,Kn.INSTANCE);function tg(s){return s.register(),s}const TL=tg(new wh({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:oe.MenubarEditMenu,group:"1_do",title:p({},"&&Undo"),order:1},{menuId:oe.CommandPalette,group:"",title:p("undo","Undo"),order:1}]}));tg(new GT(TL,{id:"default:undo",precondition:void 0}));const AL=tg(new wh({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:oe.MenubarEditMenu,group:"1_do",title:p({},"&&Redo"),order:2},{menuId:oe.CommandPalette,group:"",title:p("redo","Redo"),order:1}]}));tg(new GT(AL,{id:"default:redo",precondition:void 0}));const ZW=tg(new wh({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:oe.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Select All"),order:1},{menuId:oe.CommandPalette,group:"",title:p("selectAll","Select All"),order:1}]}));var YW=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},XW=function(s,e){return function(t,i){e(t,i,s)}};let sf=class{constructor(e,t){}dispose(){}};sf.ID="editor.contrib.markerDecorations";sf=YW([XW(1,kL)],sf);Xe(sf.ID,sf);class QW{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class RL{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");t.style.fontFamily=this._bareFontInfo.getMassagedFontFamily(),t.style.fontWeight=this._bareFontInfo.fontWeight,t.style.fontSize=this._bareFontInfo.fontSize+"px",t.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,t.style.lineHeight=this._bareFontInfo.lineHeight+"px",t.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",e.appendChild(t);const i=document.createElement("div");i.style.fontFamily=this._bareFontInfo.getMassagedFontFamily(),i.style.fontWeight="bold",i.style.fontSize=this._bareFontInfo.fontSize+"px",i.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,i.style.lineHeight=this._bareFontInfo.lineHeight+"px",i.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",e.appendChild(i);const n=document.createElement("div");n.style.fontFamily=this._bareFontInfo.getMassagedFontFamily(),n.style.fontWeight=this._bareFontInfo.fontWeight,n.style.fontSize=this._bareFontInfo.fontSize+"px",n.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,n.style.lineHeight=this._bareFontInfo.lineHeight+"px",n.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const r of this._requests){let a;r.type===0&&(a=t),r.type===2&&(a=i),r.type===1&&(a=n),a.appendChild(document.createElement("br"));const l=document.createElement("span");RL._render(l,r),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let n=0;n<8;n++)i+=i;e.innerText=i}else{let i=t.chr;for(let n=0;n<8;n++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const i=this._requests[e],n=this._testElements[e];i.fulfill(n.offsetWidth/256)}}}function JW(s,e){new RL(s,e).read()}class QT extends U{constructor(e,t,i){super(),this.referenceDomElement=e,this.changeCallback=i,this.width=-1,this.height=-1,this.resizeObserver=null,this.measureReferenceDomElementToken=-1,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this.width}getHeight(){return this.height}startObserving(){typeof ResizeObserver<"u"?!this.resizeObserver&&this.referenceDomElement&&(this.resizeObserver=new ResizeObserver(e=>{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()}),this.resizeObserver.observe(this.referenceDomElement)):this.measureReferenceDomElementToken===-1&&(this.measureReferenceDomElementToken=setInterval(()=>this.observe(),100))}stopObserving(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.measureReferenceDomElementToken!==-1&&(clearInterval(this.measureReferenceDomElementToken),this.measureReferenceDomElementToken=-1)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this.referenceDomElement&&(i=this.referenceDomElement.clientWidth,n=this.referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),(this.width!==i||this.height!==n)&&(this.width=i,this.height=n,e&&this.changeCallback())}}class Yk{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}function eV(){Pl.INSTANCE.clearCache()}class Pl extends U{constructor(){super(),this._onDidChange=this._register(new M),this.onDidChange=this._onDidChange.event,this._cache=new Yk,this._evictUntrustedReadingsTimeout=-1}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearCache(){this._cache=new Yk,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),!t.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readConfiguration(e){if(!this._cache.has(e)){let t=Pl._actualReadConfiguration(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new sS({zoomLevel:$0(),pixelRatio:vm(),fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}static createRequest(e,t,i,n){const o=new QW(e,t);return i.push(o),n&&n.push(o),o}static _actualReadConfiguration(e){const t=[],i=[],n=this.createRequest("n",0,t,i),o=this.createRequest("",0,t,null),r=this.createRequest(" ",0,t,i),a=this.createRequest("0",0,t,i),l=this.createRequest("1",0,t,i),d=this.createRequest("2",0,t,i),c=this.createRequest("3",0,t,i),h=this.createRequest("4",0,t,i),u=this.createRequest("5",0,t,i),f=this.createRequest("6",0,t,i),g=this.createRequest("7",0,t,i),m=this.createRequest("8",0,t,i),b=this.createRequest("9",0,t,i),v=this.createRequest("→",0,t,i),_=this.createRequest("→",0,t,null),w=this.createRequest("·",0,t,i),C=this.createRequest("⸱",0,t,null);this.createRequest("|",0,t,i),this.createRequest("/",0,t,i),this.createRequest("-",0,t,i),this.createRequest("_",0,t,i),this.createRequest("i",0,t,i),this.createRequest("l",0,t,i),this.createRequest("m",0,t,i),this.createRequest("|",1,t,i),this.createRequest("_",1,t,i),this.createRequest("i",1,t,i),this.createRequest("l",1,t,i),this.createRequest("m",1,t,i),this.createRequest("n",1,t,i),this.createRequest("|",2,t,i),this.createRequest("_",2,t,i),this.createRequest("i",2,t,i),this.createRequest("l",2,t,i),this.createRequest("m",2,t,i),this.createRequest("n",2,t,i),JW(e,t);const S=Math.max(a.width,l.width,d.width,c.width,h.width,u.width,f.width,g.width,m.width,b.width);let D=e.fontFeatureSettings===In.OFF;const y=i[0].width;for(let P=1,A=i.length;D&&P<A;P++){const H=y-i[P].width;if(H<-.001||H>.001){D=!1;break}}let x=!0;D&&_.width!==y&&(x=!1),_.width>v.width&&(x=!1);const E=B4()>2e3;return new sS({zoomLevel:$0(),pixelRatio:vm(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:D,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:x,spaceWidth:r.width,middotWidth:w.width,wsmiddotWidth:C.width,maxDigitWidth:S},E)}}Pl.INSTANCE=new Pl;class Wi extends Um{constructor(e,t,i=null,n){super(e,t),this.accessibilityService=n,this._elementSizeObserver=this._register(new QT(i,t.dimension,()=>this._recomputeOptions())),this._register(Pl.INSTANCE.onDidChange(()=>this._recomputeOptions())),this._validatedOptions.get(10)&&this._elementSizeObserver.startObserving(),this._register(yM(o=>this._recomputeOptions())),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._recomputeOptions()}static applyFontInfoSlow(e,t){e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"}static applyFontInfo(e,t){e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)}observeReferenceElement(e){this._elementSizeObserver.observe(e)}updatePixelRatio(){this._recomputeOptions()}static _getExtraEditorClassName(){let e="";return!Oc&&!V4&&(e+="no-user-select "),Oc&&(e+="no-minimap-shadow "),Re&&(e+="mac "),e}_getEnvConfiguration(){return{extraEditorClassName:Wi._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:Q_||qi,pixelRatio:vm(),zoomLevel:$0(),accessibilitySupport:this.accessibilityService.isScreenReaderOptimized()?2:this.accessibilityService.getAccessibilitySupport()}}readConfiguration(e){return Pl.INSTANCE.readConfiguration(e)}}class JT{constructor(e){this.domNode=e,this._maxWidth=-1,this._width=-1,this._height=-1,this._top=-1,this._left=-1,this._bottom=-1,this._right=-1,this._fontFamily="",this._fontWeight="",this._fontSize=-1,this._fontFeatureSettings="",this._lineHeight=-1,this._letterSpacing=-100,this._className="",this._display="",this._position="",this._visibility="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth+"px")}setWidth(e){this._width!==e&&(this._width=e,this.domNode.style.width=this._width+"px")}setHeight(e){this._height!==e&&(this._height=e,this.domNode.style.height=this._height+"px")}setTop(e){this._top!==e&&(this._top=e,this.domNode.style.top=this._top+"px")}unsetTop(){this._top!==-1&&(this._top=-1,this.domNode.style.top="")}setLeft(e){this._left!==e&&(this._left=e,this.domNode.style.left=this._left+"px")}setBottom(e){this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom+"px")}setRight(e){this._right!==e&&(this._right=e,this.domNode.style.right=this._right+"px")}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize+"px")}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setLineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight+"px")}setLetterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing+"px")}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Ue(s){return new JT(s)}function Zt(s,e,t){let i=null,n=null;if(typeof t.value=="function"?(i="value",n=t.value,n.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",n=t.get),!n)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:n.apply(this,r)}),this[o]}}var tV=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},vt;(function(s){s.Tap="-monaco-gesturetap",s.Change="-monaco-gesturechange",s.Start="-monaco-gesturestart",s.End="-monaco-gesturesend",s.Contextmenu="-monaco-gesturecontextmenu"})(vt||(vt={}));class ot extends U{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(K(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(K(document,"touchend",e=>this.onTouchEnd(e))),this._register(K(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){return ot.isTouchDevice()?(ot.INSTANCE||(ot.INSTANCE=new ot),ot.INSTANCE.targets.push(e),{dispose:()=>{ot.INSTANCE.targets=ot.INSTANCE.targets.filter(t=>t!==e)}}):U.None}static ignoreTarget(e){return ot.isTouchDevice()?(ot.INSTANCE||(ot.INSTANCE=new ot),ot.INSTANCE.ignoreTargets.push(e),{dispose:()=>{ot.INSTANCE.ignoreTargets=ot.INSTANCE.ignoreTargets.filter(t=>t!==e)}}):U.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){let o=e.targetTouches.item(i);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:t,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[t],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};let r=this.newGestureEvent(vt.Start,o.target);r.pageX=o.pageX,r.pageY=o.pageY,this.dispatchEvent(r)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e){let t=Date.now(),i=Object.keys(this.activeTouches).length;for(let n=0,o=e.changedTouches.length;n<o;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("move of an UNKNOWN touch",r);continue}let a=this.activeTouches[r.identifier],l=Date.now()-a.initialTimeStamp;if(l<ot.HOLD_DELAY&&Math.abs(a.initialPageX-Un(a.rollingPageX))<30&&Math.abs(a.initialPageY-Un(a.rollingPageY))<30){let d=this.newGestureEvent(vt.Tap,a.initialTarget);d.pageX=Un(a.rollingPageX),d.pageY=Un(a.rollingPageY),this.dispatchEvent(d)}else if(l>=ot.HOLD_DELAY&&Math.abs(a.initialPageX-Un(a.rollingPageX))<30&&Math.abs(a.initialPageY-Un(a.rollingPageY))<30){let d=this.newGestureEvent(vt.Contextmenu,a.initialTarget);d.pageX=Un(a.rollingPageX),d.pageY=Un(a.rollingPageY),this.dispatchEvent(d)}else if(i===1){let d=Un(a.rollingPageX),c=Un(a.rollingPageY),h=Un(a.rollingTimestamps)-a.rollingTimestamps[0],u=d-a.rollingPageX[0],f=c-a.rollingPageY[0];const g=this.targets.filter(m=>a.initialTarget instanceof Node&&m.contains(a.initialTarget));this.inertia(g,t,Math.abs(u)/h,u>0?1:-1,d,Math.abs(f)/h,f>0?1:-1,c)}this.dispatchEvent(this.newGestureEvent(vt.End,a.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===vt.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>ot.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===vt.Change||e.type===vt.Contextmenu)&&(this._lastSetTapCountTime=0);for(let t=0;t<this.ignoreTargets.length;t++)if(e.initialTarget instanceof Node&&this.ignoreTargets[t].contains(e.initialTarget))return;this.targets.forEach(t=>{e.initialTarget instanceof Node&&t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)})}inertia(e,t,i,n,o,r,a,l){this.handle=Ro(()=>{let d=Date.now(),c=d-t,h=0,u=0,f=!0;i+=ot.SCROLL_FRICTION*c,r+=ot.SCROLL_FRICTION*c,i>0&&(f=!1,h=n*i*c),r>0&&(f=!1,u=a*r*c);let g=this.newGestureEvent(vt.Change);g.translationX=h,g.translationY=u,e.forEach(m=>m.dispatchEvent(g)),f||this.inertia(e,d,i,n,o+h,r,a,l+u)})}onTouchMove(e){let t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){let o=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}let r=this.activeTouches[o.identifier],a=this.newGestureEvent(vt.Change,r.initialTarget);a.translationX=o.pageX-Un(r.rollingPageX),a.translationY=o.pageY-Un(r.rollingPageY),a.pageX=o.pageX,a.pageY=o.pageY,this.dispatchEvent(a),r.rollingPageX.length>3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}ot.SCROLL_FRICTION=-.005;ot.HOLD_DELAY=700;ot.CLEAR_TAP_COUNT_TIME=400;tV([Zt],ot,"isTouchDevice",null);function Ch(s,e){let t=new Zn(e);return t.preventDefault(),{leftButton:t.leftButton,buttons:t.buttons,posx:t.posx,posy:t.posy}}class _d{constructor(){this._hooks=new X,this._mouseMoveEventMerger=null,this._mouseMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._mouseMoveEventMerger=null,this._mouseMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._mouseMoveEventMerger}startMonitoring(e,t,i,n,o){if(this.isMonitoring())return;this._mouseMoveEventMerger=i,this._mouseMoveCallback=n,this._onStopCallback=o;const r=q0.getSameOriginWindowChain(),a=To?"pointermove":"mousemove",l="mouseup",d=r.map(h=>h.window.document),c=_h(e);c&&d.unshift(c);for(const h of d)this._hooks.add(Gy(h,a,u=>{if(u.buttons!==t){this.stopMonitoring(!0);return}this._mouseMoveCallback(u)},(u,f)=>this._mouseMoveEventMerger(u,f))),this._hooks.add(K(h,l,u=>this.stopMonitoring(!0)));if(q0.hasDifferentOriginAncestor()){let h=r[r.length-1];this._hooks.add(K(h.window.document,"mouseout",u=>{new Zn(u).target.tagName.toLowerCase()==="html"&&this.stopMonitoring(!0)})),this._hooks.add(K(h.window.document,"mouseover",u=>{new Zn(u).target.tagName.toLowerCase()==="html"&&this.stopMonitoring(!0)})),this._hooks.add(K(h.window.document.body,"mouseleave",u=>{this.stopMonitoring(!0)}))}}}class OL{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new eA(this.x-_r.scrollX,this.y-_r.scrollY)}}class eA{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new OL(this.clientX+_r.scrollX,this.clientY+_r.scrollY)}}class iV{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}function tA(s){const e=vi(s);return new iV(e.left,e.top,e.width,e.height)}class Fl extends Zn{constructor(e,t){super(e),this._editorMouseEventBrand=void 0,this.pos=new OL(this.posx,this.posy),this.editorPos=tA(t)}}class nV{constructor(e){this._editorViewDomNode=e}_create(e){return new Fl(e,this._editorViewDomNode)}onContextMenu(e,t){return K(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return K(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return K(e,"mousedown",i=>{t(this._create(i))})}onMouseLeave(e,t){return Ky(e,i=>{t(this._create(i))})}onMouseMoveThrottled(e,t,i,n){return Gy(e,"mousemove",t,(r,a)=>i(r,this._create(a)),n)}}class sV{constructor(e){this._editorViewDomNode=e}_create(e){return new Fl(e,this._editorViewDomNode)}onPointerUp(e,t){return K(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return K(e,"pointerdown",i=>{t(this._create(i))})}onPointerLeave(e,t){return n5(e,i=>{t(this._create(i))})}onPointerMoveThrottled(e,t,i,n){return Gy(e,"pointermove",t,(r,a)=>i(r,this._create(a)),n)}}class oV extends U{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new _d),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=Gt(document,"keydown",a=>{a.toKeybinding().isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,a.browserEvent)},!0);const r=(a,l)=>i(a,new Fl(l,this._editorViewDomNode));this._globalMouseMoveMonitor.startMonitoring(e,t,r,n,a=>{this._keydownListener.dispose(),o(a)})}stopMonitoring(){this._globalMouseMoveMonitor.stopMonitoring(!0)}}class ig extends U{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++){let o=e[i];switch(o.type){case 0:this.onCompositionStart(o)&&(t=!0);break;case 1:this.onCompositionEnd(o)&&(t=!0);break;case 2:this.onConfigurationChanged(o)&&(t=!0);break;case 3:this.onCursorStateChanged(o)&&(t=!0);break;case 4:this.onDecorationsChanged(o)&&(t=!0);break;case 5:this.onFlushed(o)&&(t=!0);break;case 6:this.onFocusChanged(o)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(o)&&(t=!0);break;case 8:this.onLineMappingChanged(o)&&(t=!0);break;case 9:this.onLinesChanged(o)&&(t=!0);break;case 10:this.onLinesDeleted(o)&&(t=!0);break;case 11:this.onLinesInserted(o)&&(t=!0);break;case 12:this.onRevealRangeRequest(o)&&(t=!0);break;case 13:this.onScrollChanged(o)&&(t=!0);break;case 15:this.onTokensChanged(o)&&(t=!0);break;case 14:this.onThemeChanged(o)&&(t=!0);break;case 16:this.onTokensColorsChanged(o)&&(t=!0);break;case 17:this.onZonesChanged(o)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(o)}}t&&(this._shouldRender=!0)}}class is extends ig{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class Bo{static write(e,t){e instanceof JT,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){let i=[],n=0;for(;e&&e!==document.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(n);for(let r=0;r<n;r++)o[r]=i[n-r-1];return o}}class rV{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){return this._viewLayout.getVerticalOffsetForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class aV extends rV{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class lV{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}}class aa{constructor(e,t){this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class dV{constructor(e,t){this.outsideRenderedLine=e,this.left=Math.round(t)}}class cV{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class Xk{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class bw{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){const r=this._createRange();try{return r.setStart(e,t),r.setEnd(i,n),r.getClientRects()}catch{return null}finally{this._detachRange(r,o)}}static _mergeAdjacentRanges(e){if(e.length===1)return[new aa(e[0].left,e[0].width)];e.sort(Xk.compare);let t=[],i=0,n=e[0].left,o=e[0].width;for(let r=1,a=e.length;r<a;r++){const l=e[r],d=l.left,c=l.width;n+o+.9>=d?o=Math.max(o,d+c-n):(t[i++]=new aa(n,o),n=d,o=c)}return t[i++]=new aa(n,o),t}static _createHorizontalRangesFromClientRects(e,t){if(!e||e.length===0)return null;const i=[];for(let n=0,o=e.length;n<o;n++){const r=e[n];i[n]=new Xk(Math.max(0,r.left-t),r.width)}return this._mergeAdjacentRanges(i)}static readHorizontalRanges(e,t,i,n,o,r,a){const d=e.children.length-1;if(0>d)return null;if(t=Math.min(d,Math.max(0,t)),n=Math.min(d,Math.max(0,n)),t===n&&i===o&&i===0&&!e.children[t].firstChild){const f=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(f,r)}t!==n&&n>0&&o===0&&(n--,o=1073741824);let c=e.children[t].firstChild,h=e.children[n].firstChild;if((!c||!h)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!h&&o===0&&n>0&&(h=e.children[n-1].firstChild,o=1073741824)),!c||!h)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(h.textContent.length,Math.max(0,o));const u=this._readClientRects(c,i,h,o,a);return this._createHorizontalRangesFromClientRects(u,r)}}const hV=function(){return Mo?!0:!(sn||qi||Oc)}();let xc=!0;class Qk{constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}get clientRectDeltaLeft(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft}}class Jk{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(40);this.renderWhitespace=i.get(86),this.renderControlCharacters=i.get(80),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(27),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(56),this.stopRenderingLineAfter=i.get(103),this.fontLigatures=i.get(41)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class vo{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=Ue(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return this._options.themeType===Xn.HIGH_CONTRAST||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),r=this._options,a=An.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(r.themeType===Xn.HIGH_CONTRAST||this._options.renderWhitespace==="selection"){const u=i.selections;for(const f of u){if(f.endLineNumber<e||f.startLineNumber>e)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,m=f.endLineNumber===e?f.endColumn:o.maxColumn;g<m&&(r.themeType===Xn.HIGH_CONTRAST||this._options.renderWhitespace!=="selection"?a.push(new An(g,m,"inline-selected-text",0)):(l||(l=[]),l.push(new EB(g-1,m-1))))}}const d=new gd(r.useMonospaceOptimizations,r.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,a,o.tabSize,o.startVisibleColumn,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==In.OFF,l);if(this._renderedViewLine&&this._renderedViewLine.input.equals(d))return!1;n.appendASCIIString('<div style="top:'),n.appendASCIIString(String(t)),n.appendASCIIString("px;height:"),n.appendASCIIString(String(this._options.lineHeight)),n.appendASCIIString('px;" class="'),n.appendASCIIString(vo.CLASS_NAME),n.appendASCIIString('">');const c=cb(d,n);n.appendASCIIString("</div>");let h=null;return xc&&hV&&o.isBasicASCII&&r.useMonospaceOptimizations&&c.containsForeignElements===0&&o.content.length<300&&d.lineTokens.getCount()<100&&(h=new Og(this._renderedViewLine?this._renderedViewLine.domNode:null,d,c.characterMapping)),h||(h=nA(this._renderedViewLine?this._renderedViewLine.domNode:null,d,c.characterMapping,c.containsRTL,c.containsForeignElements)),this._renderedViewLine=h,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Og:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Og?this._renderedViewLine.monospaceAssumptionsAreValid():xc}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Og&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i){if(!this._renderedViewLine)return null;e=e|0,t=t|0,e=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,e)),t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t));const n=this._renderedViewLine.input.stopRenderingLineAfter|0;let o=!1;n!==-1&&e>n+1&&t>n+1&&(o=!0),n!==-1&&e>n+1&&(e=n+1),n!==-1&&t>n+1&&(t=n+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i);return r&&r.length>0?new cV(o,r):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}vo.CLASS_NAME="view-line";class Og{constructor(e,t,i){this.domNode=e,this.input=t,this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){return this._getCharPosition(this._characterMapping.length)}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){if(!this.domNode)return xc;const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;return Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),xc=!1),xc}toSlowRenderedLine(){return nA(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i){const n=this._getCharPosition(e),o=this._getCharPosition(t);return[new aa(n,o-n)]}_getCharPosition(e){const t=this._characterMapping.getAbsoluteOffset(e);return Math.round(this._charWidth*t)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new wL(o,i),n)}}class iA{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||this._characterMapping.length===0){this._pixelOffsetCache=new Int32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const n=this._readPixelOffset(this.domNode,e,i);if(n===-1)return null;const o=this._readPixelOffset(this.domNode,t,i);return o===-1?null:[new aa(n,o-n)]}return this._readVisibleRangesForRange(this.domNode,e,t,i)}_readVisibleRangesForRange(e,t,i,n){if(t===i){const o=this._readPixelOffset(e,t,n);return o===-1?null:[new aa(o,0)]}else return this._readRawVisibleRangesForRange(e,t,i,n)}_readPixelOffset(e,t,i){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth();const n=this._getReadingTarget(e);return n.firstChild?n.firstChild.offsetWidth:0}if(this._pixelOffsetCache!==null){const n=this._pixelOffsetCache[t];if(n!==-1)return n;const o=this._actualReadPixelOffset(e,t,i);return this._pixelOffsetCache[t]=o,o}return this._actualReadPixelOffset(e,t,i)}_actualReadPixelOffset(e,t,i){if(this._characterMapping.length===0){const a=bw.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,i.clientRectDeltaLeft,i.endNode);return!a||a.length===0?-1:a[0].left}if(t===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth();const n=this._characterMapping.getDomPosition(t),o=bw.readHorizontalRanges(this._getReadingTarget(e),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i.clientRectDeltaLeft,i.endNode);if(!o||o.length===0)return-1;const r=o[0].left;if(this.input.isBasicASCII){const a=this._characterMapping.getAbsoluteOffset(t),l=Math.round(this.input.spaceWidth*a);if(Math.abs(l-r)<=1)return l}return r}_readRawVisibleRangesForRange(e,t,i,n){if(t===1&&i===this._characterMapping.length)return[new aa(0,this.getWidth())];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return bw.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,n.clientRectDeltaLeft,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new wL(o,i),n)}}class uV extends iA{_readVisibleRangesForRange(e,t,i,n){const o=super._readVisibleRangesForRange(e,t,i,n);if(!o||o.length===0||t===i||t===1&&i===this._characterMapping.length)return o;if(!this.input.containsRTL){const r=this._readPixelOffset(e,i,n);if(r!==-1){const a=o[o.length-1];a.left<r&&(a.width=r-a.left)}}return o}}const nA=function(){return Q_?fV:gV}();function fV(s,e,t,i,n){return new uV(s,e,t,i,n)}function gV(s,e,t,i,n){return new iA(s,e,t,i,n)}function Pg(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class _i{constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Pg(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Pg(this.oldText)}")`:`(replace@${this.oldPosition} "${Pg(this.oldText)}" with "${Pg(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Rs(e,n,i),i+=4;for(let o=0;o<n;o++)z5(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=As(e,t);return t+=4,lS(e,t,i)}writeSize(){return 8+_i._writeStringSize(this.oldText)+_i._writeStringSize(this.newText)}write(e,t){return Rs(e,this.oldPosition,t),t+=4,Rs(e,this.newPosition,t),t+=4,t=_i._writeString(e,this.oldText,t),t=_i._writeString(e,this.newText,t),t}static read(e,t,i){const n=As(e,t);t+=4;const o=As(e,t);t+=4;const r=_i._readString(e,t);t+=_i._writeStringSize(r);const a=_i._readString(e,t);return t+=_i._writeStringSize(a),i.push(new _i(n,r,o,a)),t}}function pV(s,e){return s===null||s.length===0?e:new fo(s,e).compress()}class fo{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),n=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(i===null){this._acceptCurr(n),n=this._getCurr(++t);continue}if(n===null){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldEnd<=i.newPosition){this._acceptCurr(n),n=this._getCurr(++t);continue}if(i.newEnd<=n.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldPosition<i.newPosition){const[d,c]=fo._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(d),n=c;continue}if(i.newPosition<n.oldPosition){const[d,c]=fo._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(d),i=c;continue}let a,l;if(n.oldEnd===i.newEnd)a=i,l=n,i=this._getPrev(++e),n=this._getCurr(++t);else if(n.oldEnd<i.newEnd){const[d,c]=fo._splitPrev(i,n.oldLength);a=d,l=n,i=c,n=this._getCurr(++t)}else{const[d,c]=fo._splitCurr(n,i.newLength);a=i,l=d,i=this._getPrev(++e),n=c}this._result[this._resultLen++]=new _i(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const o=fo._merge(this._result);return fo._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=fo._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=fo._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new _i(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new _i(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),n=e.newText.substr(t);return[new _i(e.oldPosition,e.oldText,e.newPosition,i),new _i(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new _i(e.oldPosition,i,e.newPosition,e.newText),new _i(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(e.length===0)return e;let t=[],i=0,n=e[0];for(let o=1;o<e.length;o++){const r=e[o];n.oldEnd===r.oldPosition?n=new _i(n.oldPosition,n.oldText+r.oldText,n.newPosition,n.newText+r.newText):(t[i++]=n,n=r)}return t[i++]=n,t}static _removeNoOps(e){if(e.length===0)return e;let t=[],i=0;for(let n=0;n<e.length;n++){const o=e[n];o.oldText!==o.newText&&(t[i++]=o)}return t}}function Hd(s){return s.toString()}class ti{constructor(e,t,i,n,o,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=r,this.changes=a}static create(e,t){const i=e.getAlternativeVersionId(),n=xS(e);return new ti(i,i,n,n,t,t,[])}append(e,t,i,n,o){t.length>0&&(this.changes=pV(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Rs(e,t?t.length:0,i),i+=4,t)for(const n of t)Rs(e,n.selectionStartLineNumber,i),i+=4,Rs(e,n.selectionStartColumn,i),i+=4,Rs(e,n.positionLineNumber,i),i+=4,Rs(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=As(e,t);t+=4;for(let o=0;o<n;o++){const r=As(e,t);t+=4;const a=As(e,t);t+=4;const l=As(e,t);t+=4;const d=As(e,t);t+=4,i.push(new ee(r,a,l,d))}return t}serialize(){let e=10+ti._writeSelectionsSize(this.beforeCursorState)+ti._writeSelectionsSize(this.afterCursorState)+4;for(const n of this.changes)e+=n.writeSize();const t=new Uint8Array(e);let i=0;Rs(t,this.beforeVersionId,i),i+=4,Rs(t,this.afterVersionId,i),i+=4,ck(t,this.beforeEOL,i),i+=1,ck(t,this.afterEOL,i),i+=1,i=ti._writeSelections(t,this.beforeCursorState,i),i=ti._writeSelections(t,this.afterCursorState,i),Rs(t,this.changes.length,i),i+=4;for(const n of this.changes)i=n.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const n=As(t,i);i+=4;const o=As(t,i);i+=4;const r=dk(t,i);i+=1;const a=dk(t,i);i+=1;const l=[];i=ti._readSelections(t,i,l);const d=[];i=ti._readSelections(t,i,d);const c=As(t,i);i+=4;const h=[];for(let u=0;u<c;u++)i=_i.read(t,i,h);return new ti(n,o,r,a,l,d,h)}}class sA{constructor(e,t){this.model=e,this._data=ti.create(e,t)}get type(){return 0}get resource(){return he.isUri(this.model)?this.model:this.model.uri}get label(){return p("edit","Typing")}toString(){return(this._data instanceof ti?this._data:ti.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(he.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof ti}append(e,t,i,n,o){this._data instanceof ti&&this._data.append(e,t,i,n,o)}close(){this._data instanceof ti&&(this._data=this._data.serialize())}open(){this._data instanceof ti||(this._data=ti.deserialize(this._data))}undo(){if(he.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof ti&&(this._data=this._data.serialize());const e=ti.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(he.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof ti&&(this._data=this._data.serialize());const e=ti.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof ti&&(this._data=this._data.serialize()),this._data.byteLength+168}}class mV{constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const i of this._editStackElementsArr){const n=Hd(i.resource);this._editStackElementsMap.set(n,i)}this._delegate=null}get resources(){return this._editStackElementsArr.map(e=>e.resource)}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=Hd(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Hd(he.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Hd(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,o){const r=Hd(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=Hd(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){let e=[];for(const t of this._editStackElementsArr)e.push(`${Is(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function xS(s){return s.getEOL()===`
`?0:1}function ir(s){return s?s instanceof sA||s instanceof mV:!1}class PL{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);ir(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);ir(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(ir(t)&&t.canAppend(this._model))return t;const i=new sA(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],xS(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),r=PL._computeCursorState(i,o),a=o.map((l,d)=>({index:d,textChange:l.textChange}));return a.sort((l,d)=>l.textChange.oldPosition===d.textChange.oldPosition?l.index-d.index:l.textChange.oldPosition-d.textChange.oldPosition),n.append(this._model,a.map(l=>l.textChange),xS(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return ve(i),null}}}class _V{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function bV(s,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let o;for(o=0;o<e&&o<i;o++){let u=s.charCodeAt(o),f=t.charCodeAt(o);if(u!==f)break}let r=0,a=0;for(let u=o;u<e;u++)s.charCodeAt(u)===32?r++:a++;let l=0,d=0;for(let u=o;u<i;u++)t.charCodeAt(u)===32?l++:d++;if(r>0&&a>0||l>0&&d>0)return;let c=Math.abs(a-d),h=Math.abs(r-l);if(c===0){n.spacesDiff=h,h>0&&0<=l-1&&l-1<s.length&&l<t.length&&t.charCodeAt(l)!==32&&s.charCodeAt(l-1)===32&&s.charCodeAt(s.length-1)===44&&(n.looksLikeAlignment=!0);return}if(h%c===0){n.spacesDiff=h/c;return}}function eI(s,e,t){const i=Math.min(s.getLineCount(),1e4);let n=0,o=0,r="",a=0;const l=[2,4,6,8,3,5,7],d=8;let c=[0,0,0,0,0,0,0,0,0],h=new _V;for(let g=1;g<=i;g++){let m=s.getLineLength(g),b=s.getLineContent(g);const v=m<=65536;let _=!1,w=0,C=0,S=0;for(let y=0,x=m;y<x;y++){let E=v?b.charCodeAt(y):s.getLineCharCode(g,y);if(E===9)S++;else if(E===32)C++;else{_=!0,w=y;break}}if(!_||(S>0?n++:C>1&&o++,bV(r,a,b,w,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;let D=h.spacesDiff;D<=d&&c[D]++,r=b,a=w}let u=t;n!==o&&(u=n<o);let f=e;if(u){let g=u?0:.1*i;l.forEach(m=>{let b=c[m];b>g&&(g=b,f=m)}),f===4&&c[4]>0&&c[2]>0&&c[2]>=c[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}function Yi(s){return(s.metadata&1)>>>0}function lt(s,e){s.metadata=s.metadata&254|e<<0}function Ci(s){return(s.metadata&2)>>>1===1}function rt(s,e){s.metadata=s.metadata&253|(e?1:0)<<1}function oA(s){return(s.metadata&4)>>>2===1}function tI(s,e){s.metadata=s.metadata&251|(e?1:0)<<2}function vV(s){return(s.metadata&24)>>>3}function iI(s,e){s.metadata=s.metadata&231|e<<3}function wV(s){return(s.metadata&32)>>>5===1}function nI(s,e){s.metadata=s.metadata&223|(e?1:0)<<5}class rA{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,lt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,tI(this,!1),iI(this,1),nI(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,rt(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;let t=this.options.className;tI(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),iI(this,this.options.stickiness),nI(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const ye=new rA(null,0,0);ye.parent=ye;ye.left=ye;ye.right=ye;lt(ye,0);class vw{constructor(){this.root=ye,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o){return this.root===ye?[]:IV(this,e,t,i,n,o)}search(e,t,i){return this.root===ye?[]:kV(this,e,t,i)}collectNodesFromOwner(e){return xV(this,e)}collectNodesPostOrder(){return DV(this)}insert(e){sI(this,e),this._normalizeDeltaIfNecessary()}delete(e){oI(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,r=i.end+n;i.setCachedOffsets(o,r,t)}acceptReplace(e,t,i,n){const o=yV(this,e,e+t);for(let r=0,a=o.length;r<a;r++){const l=o[r];oI(this,l)}this._normalizeDeltaIfNecessary(),LV(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let r=0,a=o.length;r<a;r++){const l=o[r];l.start=l.cachedAbsoluteStart,l.end=l.cachedAbsoluteEnd,SV(l,e,e+t,i,n),l.maxEnd=l.end,sI(this,l)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,CV(this))}}function CV(s){let e=s.root,t=0;for(;e!==ye;){if(e.left!==ye&&!Ci(e.left)){e=e.left;continue}if(e.right!==ye&&!Ci(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,wa(e),rt(e,!0),rt(e.left,!1),rt(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}rt(s.root,!1)}function zd(s,e,t,i){return s<t?!0:s>t||i===1?!1:i===2?!0:e}function SV(s,e,t,i,n){const o=vV(s),r=o===0||o===2,a=o===1||o===2,l=t-e,d=i,c=Math.min(l,d),h=s.start;let u=!1;const f=s.end;let g=!1;e<=h&&f<=t&&wV(s)&&(s.start=e,u=!0,s.end=e,g=!0);{const b=n?1:l>0?2:0;!u&&zd(h,r,e,b)&&(u=!0),!g&&zd(f,a,e,b)&&(g=!0)}if(c>0&&!n){const b=l>d?2:0;!u&&zd(h,r,e+c,b)&&(u=!0),!g&&zd(f,a,e+c,b)&&(g=!0)}{const b=n?1:0;!u&&zd(h,r,t,b)&&(s.start=e+d,u=!0),!g&&zd(f,a,t,b)&&(s.end=e+d,g=!0)}const m=d-l;u||(s.start=Math.max(0,h+m)),g||(s.end=Math.max(0,f+m)),s.start>s.end&&(s.end=s.start)}function yV(s,e,t){let i=s.root,n=0,o=0,r=0,a=0,l=[],d=0;for(;i!==ye;){if(Ci(i)){rt(i.left,!1),rt(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!Ci(i.left)){if(o=n+i.maxEnd,o<e){rt(i,!0);continue}if(i.left!==ye){i=i.left;continue}}if(r=n+i.start,r>t){rt(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[d++]=i),rt(i,!0),i.right!==ye&&!Ci(i.right)){n+=i.delta,i=i.right;continue}}return rt(s.root,!1),l}function LV(s,e,t,i){let n=s.root,o=0,r=0,a=0;const l=i-(t-e);for(;n!==ye;){if(Ci(n)){rt(n.left,!1),rt(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),wa(n),n=n.parent;continue}if(!Ci(n.left)){if(r=o+n.maxEnd,r<e){rt(n,!0);continue}if(n.left!==ye){n=n.left;continue}}if(a=o+n.start,a>t){n.start+=l,n.end+=l,n.delta+=l,(n.delta<-1073741824||n.delta>1073741824)&&(s.requestNormalizeDelta=!0),rt(n,!0);continue}if(rt(n,!0),n.right!==ye&&!Ci(n.right)){o+=n.delta,n=n.right;continue}}rt(s.root,!1)}function xV(s,e){let t=s.root,i=[],n=0;for(;t!==ye;){if(Ci(t)){rt(t.left,!1),rt(t.right,!1),t=t.parent;continue}if(t.left!==ye&&!Ci(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),rt(t,!0),t.right!==ye&&!Ci(t.right)){t=t.right;continue}}return rt(s.root,!1),i}function DV(s){let e=s.root,t=[],i=0;for(;e!==ye;){if(Ci(e)){rt(e.left,!1),rt(e.right,!1),e=e.parent;continue}if(e.left!==ye&&!Ci(e.left)){e=e.left;continue}if(e.right!==ye&&!Ci(e.right)){e=e.right;continue}t[i++]=e,rt(e,!0)}return rt(s.root,!1),t}function kV(s,e,t,i){let n=s.root,o=0,r=0,a=0,l=[],d=0;for(;n!==ye;){if(Ci(n)){rt(n.left,!1),rt(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;continue}if(n.left!==ye&&!Ci(n.left)){n=n.left;continue}r=o+n.start,a=o+n.end,n.setCachedOffsets(r,a,i);let c=!0;if(e&&n.ownerId&&n.ownerId!==e&&(c=!1),t&&oA(n)&&(c=!1),c&&(l[d++]=n),rt(n,!0),n.right!==ye&&!Ci(n.right)){o+=n.delta,n=n.right;continue}}return rt(s.root,!1),l}function IV(s,e,t,i,n,o){let r=s.root,a=0,l=0,d=0,c=0,h=[],u=0;for(;r!==ye;){if(Ci(r)){rt(r.left,!1),rt(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;continue}if(!Ci(r.left)){if(l=a+r.maxEnd,l<e){rt(r,!0);continue}if(r.left!==ye){r=r.left;continue}}if(d=a+r.start,d>t){rt(r,!0);continue}if(c=a+r.end,c>=e){r.setCachedOffsets(d,c,o);let f=!0;i&&r.ownerId&&r.ownerId!==i&&(f=!1),n&&oA(r)&&(f=!1),f&&(h[u++]=r)}if(rt(r,!0),r.right!==ye&&!Ci(r.right)){a+=r.delta,r=r.right;continue}}return rt(s.root,!1),h}function sI(s,e){if(s.root===ye)return e.parent=ye,e.left=ye,e.right=ye,lt(e,0),s.root=e,s.root;EV(s,e),Ur(e.parent);let t=e;for(;t!==s.root&&Yi(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Yi(i)===1?(lt(t.parent,0),lt(i,0),lt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,xu(s,t)),lt(t.parent,0),lt(t.parent.parent,1),Du(s,t.parent.parent))}else{const i=t.parent.parent.left;Yi(i)===1?(lt(t.parent,0),lt(i,0),lt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,Du(s,t)),lt(t.parent,0),lt(t.parent.parent,1),xu(s,t.parent.parent))}return lt(s.root,0),e}function EV(s,e){let t=0,i=s.root;const n=e.start,o=e.end;for(;;)if(MV(n,o,i.start+t,i.end+t)<0)if(i.left===ye){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===ye){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=ye,e.right=ye,lt(e,1)}function oI(s,e){let t,i;if(e.left===ye?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===ye?(t=e.left,i=e):(i=NV(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(s.requestNormalizeDelta=!0)),i===s.root){s.root=t,lt(t,0),e.detach(),ww(),wa(t),s.root.parent=ye;return}let n=Yi(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,lt(i,Yi(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==ye&&(i.left.parent=i),i.right!==ye&&(i.right.parent=i)),e.detach(),n){Ur(t.parent),i!==e&&(Ur(i),Ur(i.parent)),ww();return}Ur(t),Ur(t.parent),i!==e&&(Ur(i),Ur(i.parent));let o;for(;t!==s.root&&Yi(t)===0;)t===t.parent.left?(o=t.parent.right,Yi(o)===1&&(lt(o,0),lt(t.parent,1),xu(s,t.parent),o=t.parent.right),Yi(o.left)===0&&Yi(o.right)===0?(lt(o,1),t=t.parent):(Yi(o.right)===0&&(lt(o.left,0),lt(o,1),Du(s,o),o=t.parent.right),lt(o,Yi(t.parent)),lt(t.parent,0),lt(o.right,0),xu(s,t.parent),t=s.root)):(o=t.parent.left,Yi(o)===1&&(lt(o,0),lt(t.parent,1),Du(s,t.parent),o=t.parent.left),Yi(o.left)===0&&Yi(o.right)===0?(lt(o,1),t=t.parent):(Yi(o.left)===0&&(lt(o.right,0),lt(o,1),xu(s,o),o=t.parent.left),lt(o,Yi(t.parent)),lt(t.parent,0),lt(o.left,0),Du(s,t.parent),t=s.root));lt(t,0),ww()}function NV(s){for(;s.left!==ye;)s=s.left;return s}function ww(){ye.parent=ye,ye.delta=0,ye.start=0,ye.end=0}function xu(s,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==ye&&(t.left.parent=e),t.parent=e.parent,e.parent===ye?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,wa(e),wa(t)}function Du(s,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==ye&&(t.right.parent=e),t.parent=e.parent,e.parent===ye?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,wa(e),wa(t)}function aA(s){let e=s.end;if(s.left!==ye){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==ye){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function wa(s){s.maxEnd=aA(s)}function Ur(s){for(;s!==ye;){const e=aA(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function MV(s,e,t,i){return s===t?e-i:s-t}class DS{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==_e)return FL(this.right);let e=this;for(;e.parent!==_e&&e.parent.left!==e;)e=e.parent;return e.parent===_e?_e:e.parent}prev(){if(this.left!==_e)return lA(this.left);let e=this;for(;e.parent!==_e&&e.parent.right!==e;)e=e.parent;return e.parent===_e?_e:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const _e=new DS(null,0);_e.parent=_e;_e.left=_e;_e.right=_e;_e.color=0;function FL(s){for(;s.left!==_e;)s=s.left;return s}function lA(s){for(;s.right!==_e;)s=s.right;return s}function BL(s){return s===_e?0:s.size_left+s.piece.length+BL(s.right)}function WL(s){return s===_e?0:s.lf_left+s.piece.lineFeedCnt+WL(s.right)}function Cw(){_e.parent=_e}function ku(s,e){let t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==_e&&(t.left.parent=e),t.parent=e.parent,e.parent===_e?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function Iu(s,e){let t=e.left;e.left=t.right,t.right!==_e&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===_e?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function Fg(s,e){let t,i;if(e.left===_e?(i=e,t=i.right):e.right===_e?(i=e,t=i.left):(i=FL(e.right),t=i.right),i===s.root){s.root=t,t.color=0,e.detach(),Cw(),s.root.parent=_e;return}let n=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,au(s,t)):(i.parent===e?t.parent=i:t.parent=i.parent,au(s,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==_e&&(i.left.parent=i),i.right!==_e&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,au(s,i)),e.detach(),t.parent.left===t){let r=BL(t),a=WL(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){let l=r-t.parent.size_left,d=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,Zo(s,t.parent,l,d)}}if(au(s,t.parent),n){Cw();return}let o;for(;t!==s.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,ku(s,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,Iu(s,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,ku(s,t.parent),t=s.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,Iu(s,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,ku(s,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,Iu(s,t.parent),t=s.root));t.color=0,Cw()}function rI(s,e){for(au(s,e);e!==s.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,ku(s,e)),e.parent.color=0,e.parent.parent.color=1,Iu(s,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,Iu(s,e)),e.parent.color=0,e.parent.parent.color=1,ku(s,e.parent.parent))}s.root.color=0}function Zo(s,e,t,i){for(;e!==s.root&&e!==_e;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function au(s,e){let t=0,i=0;if(e!==s.root){if(t===0){for(;e!==s.root&&e===e.parent.right;)e=e.parent;if(e===s.root)return;e=e.parent,t=BL(e.left)-e.size_left,i=WL(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i}for(;e!==s.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}class TV extends bh{constructor(e){super(0);for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}}function AV(s){let e={};return t=>(e.hasOwnProperty(t)||(e[t]=s(t)),e[t])}const ts=AV(s=>new TV(s)),RV=999;class Ja{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=OV(this.searchString):e=this.searchString.indexOf(`
`)>=0;let t=null;try{t=HM(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 PV(t,this.wordSeparators?ts(this.wordSeparators):null,i?this.searchString:null)}}function OV(s){if(!s||s.length===0)return!1;for(let e=0,t=s.length;e<t;e++)if(s.charCodeAt(e)===92){if(e++,e>=t)break;const n=s.charCodeAt(e);if(n===110||n===114||n===87||n===119)return!0}return!1}class PV{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}function nl(s,e,t){if(!t)return new qu(s,null);let i=[];for(let n=0,o=e.length;n<o;n++)i[n]=e[n];return new qu(s,i)}class aI{constructor(e){let t=[],i=0;for(let n=0,o=e.length;n<o;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 o=i+((n-i)/2>>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class Bg{static findMatches(e,t,i,n,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new lu(r.wordSeparators,r.regex),n,o):this._doFindMatchesLineByLine(e,i,r,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let d;if(n){let f=n.findLineFeedCountBeforeOffset(o+r.length)-l;d=a+r.length+f}else d=a+r.length;const c=e.getPositionAt(a),h=e.getPositionAt(d);return new L(c.lineNumber,c.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r
`?new aI(a):null,d=[];let c=0,h;for(i.reset(0);h=i.next(a);)if(d[c++]=nl(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,n),c>=o)return d;return d}static _doFindMatchesLineByLine(e,t,i,n,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const d=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,d,t.startLineNumber,t.startColumn-1,a,r,n,o),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,o);for(let d=t.startLineNumber+1;d<t.endLineNumber&&a<o;d++)a=this._findMatchesInLine(i,e.getLineContent(d),d,0,a,r,n,o);if(a<o){const d=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,d,t.endLineNumber,0,a,r,n,o)}return r}static _findMatchesInLine(e,t,i,n,o,r,a,l){const d=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((!d||VL(d,t,g,m,f))&&(r[o++]=new qu(new L(i,m+1+n,i,m+1+f+n),null),o>=l))return o;return o}const c=new lu(e.wordSeparators,e.regex);let h;c.reset(0);do if(h=c.next(t),h&&(r[o++]=nl(new L(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),o>=l))return o;while(h);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new lu(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new O(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new L(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),d=e.getEOL()===`\r
`?new aI(l):null;i.reset(t.column-1);let c=i.next(l);return c?nl(this._getMultilineMatchRange(e,r,l,d,c.index,c[0]),c,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new O(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let d=1;d<=o;d++){const c=(r+d-1)%o,h=e.getLineContent(c+1),u=this._findFirstMatchInLine(i,h,c+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const r=e.next(t);return r?nl(new L(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new lu(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new L(1,1,t.lineNumber,t.column),i,n,10*RV);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new O(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=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 d=1;d<=o;d++){const c=(o+r-d-1)%o,h=e.getLineContent(c+1),u=this._findLastMatchInLine(i,h,c+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let o=null,r;for(e.reset(0);r=e.next(t);)o=nl(new L(i,r.index+1,i,r.index+1+r[0].length),r,n);return o}}function FV(s,e,t,i,n){if(i===0)return!0;const o=e.charCodeAt(i-1);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i);if(s.get(r)!==0)return!0}return!1}function BV(s,e,t,i,n){if(i+n===t)return!0;const o=e.charCodeAt(i+n);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(s.get(r)!==0)return!0}return!1}function VL(s,e,t,i,n){return FV(s,e,t,i,n)&&BV(s,e,t,i,n)}class lu{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,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){er(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||VL(this._wordSeparators,e,t,n,o))return i}while(i);return null}}const $o=65535;function dA(s){let e;return s[s.length-1]<65536?e=new Uint16Array(s.length):e=new Uint32Array(s.length),e.set(s,0),e}class WV{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function Yo(s,e=!0){let t=[0],i=1;for(let n=0,o=s.length;n<o;n++){const r=s.charCodeAt(n);r===13?n+1<o&&s.charCodeAt(n+1)===10?(t[i++]=n+2,n++):t[i++]=n+1:r===10&&(t[i++]=n+1)}return e?dA(t):t}function VV(s,e){s.length=0,s[0]=0;let t=1,i=0,n=0,o=0,r=!0;for(let l=0,d=e.length;l<d;l++){const c=e.charCodeAt(l);c===13?l+1<d&&e.charCodeAt(l+1)===10?(o++,s[t++]=l+2,l++):(i++,s[t++]=l+1):c===10?(n++,s[t++]=l+1):r&&c!==9&&(c<32||c>126)&&(r=!1)}const a=new WV(dA(s),i,n,o,r);return s.length=0,a}class dn{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class sl{constructor(e,t){this.buffer=e,this.lineStarts=t}}class HV{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==_e&&e.iterate(e.root,i=>(i!==_e&&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._pieces[this._index++])}}class zV{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,i=this._cache;for(let n=0;n<i.length;n++){let o=i[n];if(o.node.parent===null||o.nodeStartOffset>=e){i[n]=null,t=!0;continue}}if(t){let n=[];for(const o of i)o!==null&&n.push(o);this._cache=n}}}class UV{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new sl("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=_e,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,r=e.length;o<r;o++)if(e[o].buffer.length>0){e[o].lineStarts||(e[o].lineStarts=Yo(e[o].buffer));let a=new dn(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),n=this.rbInsertRight(n,a)}this._searchCache=new zV(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=$o,i=t-Math.floor(t/3),n=i*2,o="",r=0,a=[];if(this.iterate(this.root,l=>{let d=this.getNodeContent(l),c=d.length;if(r<=i||r+c<n)return o+=d,r+=c,!0;let h=o.replace(/\r\n|\r|\n/g,e);return a.push(new sl(h,Yo(h))),o=d,r=c,!0}),r>0){let l=o.replace(/\r\n|\r|\n/g,e);a.push(new sl(l,Yo(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new HV(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==_e;)if(n.left!==_e&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;let o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=o+t-1}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0,n=e;for(;t!==_e;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){let o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){let r=this.getOffsetAt(i+1,1),a=n-r;return new O(i+1,a+1)}return new O(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===_e){let o=this.getOffsetAt(i+1,1),r=n-e-o;return new O(i+1,r+1)}else t=t.right;return new O(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";let i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){let a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,d=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(d+e.remainder,d+t.remainder)}let i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start),r=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==_e;){let a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){let e=[],t=0,i="",n=!1;return this.iterate(this.root,o=>{if(o===_e)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,d=this._buffers[r.bufferIndex].lineStarts,c=r.start.line,h=r.end.line;let u=d[c]+r.start.column;if(n&&(l.charCodeAt(u)===10&&(u++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(c===h)return!this._EOLNormalized&&l.charCodeAt(u+a-1)===13?(n=!0,i+=l.substr(u,a-1)):i+=l.substr(u,a),!0;i+=this._EOLNormalized?l.substring(u,Math.max(u,d[c+1]-this._EOLLength)):l.substring(u,d[c+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=c+1;f<h;f++)i=this._EOLNormalized?l.substring(d[f],d[f+1]-this._EOLLength):l.substring(d[f],d[f+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return!this._EOLNormalized&&l.charCodeAt(d[h]+r.end.column-1)===13?(n=!0,r.end.column===0?t--:i=l.substr(d[h],r.end.column-1)):i=l.substr(d[h],r.end.column),!0}),n&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){let t=e.node.next();if(!t)return 0;let i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}else{let t=this._buffers[e.node.piece.bufferIndex],n=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(n)}}getLineCharCode(e,t){let i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){let t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,i,n,o,r,a,l,d,c,h){let u=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),m=this.offsetInBuffer(e.piece.bufferIndex,r),b,v={line:0,column:0},_,w;t._wordSeparators?(_=u.buffer.substring(g,m),w=C=>C+g,t.reset(0)):(_=u.buffer,w=C=>C,t.reset(g));do if(b=t.next(_),b){if(w(b.index)>=m)return c;this.positionInBuffer(e,w(b.index)-f,v);let C=this.getLineFeedCnt(e.piece.bufferIndex,o,v),S=v.line===o.line?v.column-o.column+n:v.column+1,D=S+b[0].length;if(h[c++]=nl(new L(i+C,S,i+C,D),b,l),w(b.index)+b[0].length>=m||c>=d)return c}while(b);return c}findMatchesLineByLine(e,t,i,n){const o=[];let r=0;const a=new lu(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];let d=this.nodeAt2(e.endLineNumber,e.endColumn);if(d===null)return[];let c=this.positionInBuffer(l.node,l.remainder),h=this.positionInBuffer(d.node,d.remainder);if(l.node===d.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,c,h,t,i,n,r,o),o;let u=e.startLineNumber,f=l.node;for(;f!==d.node;){let m=this.getLineFeedCnt(f.piece.bufferIndex,c,f.piece.end);if(m>=1){let v=this._buffers[f.piece.bufferIndex].lineStarts,_=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),w=v[c.line+m],C=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,u,C,c,this.positionInBuffer(f,w-_),t,i,n,r,o),r>=n)return o;u+=m}let b=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const v=this.getLineContent(u).substring(b,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,b,r,o,i,n),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(b),u,b,r,o,i,n),r>=n)return o;u++,l=this.nodeAt2(u,1),f=l.node,c=this.positionInBuffer(l.node,l.remainder)}if(u===e.endLineNumber){let m=u===e.startLineNumber?e.startColumn-1:0;const b=this.getLineContent(u).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,b,e.endLineNumber,m,r,o,i,n),o}let g=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(d.node,a,u,g,c,h,t,i,n,r,o),o}_findMatchesInLine(e,t,i,n,o,r,a,l,d){const c=e.wordSeparators;if(!l&&e.simpleSearch){const u=e.simpleSearch,f=u.length,g=i.length;let m=-f;for(;(m=i.indexOf(u,m+f))!==-1;)if((!c||VL(c,i,g,m,f))&&(a[r++]=new qu(new L(n,m+1+o,n,m+1+f+o),null),r>=d))return r;return r}let h;t.reset(0);do if(h=t.next(i),h&&(a[r++]=nl(new L(n,h.index+1+o,n,h.index+1+h[0].length+o),h,l),r>=d))return r;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==_e){let{node:n,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,l=a.bufferIndex,d=this.positionInBuffer(n,o);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.length<$o){this.appendToNode(n,t),this.computeBufferMetadata();return}if(r===e)this.insertContentToNodeLeft(t,n),this._searchCache.validate(e);else if(r+n.piece.length>e){let c=[],h=new dn(a.bufferIndex,d,a.end,this.getLineFeedCnt(a.bufferIndex,d,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,d));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,o)===10){let m={line:h.start.line+1,column:0};h=new dn(h.bufferIndex,m,h.end,this.getLineFeedCnt(h.bufferIndex,m,h.end),h.length-1),t+=`
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,o-1)===13){let m=this.positionInBuffer(n,o-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&c.push(n)}else this.deleteNodeTail(n,d);else this.deleteNodeTail(n,d);let 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(c)}else this.insertContentToNodeRight(t,n)}else{let n=this.createNewPieces(t),o=this.rbInsertLeft(null,n[0]);for(let r=1;r<n.length;r++)o=this.rbInsertRight(o,n[r])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===_e)return;let i=this.nodeAt(e),n=this.nodeAt(e+t),o=i.node,r=n.node;if(o===r){let u=this.positionInBuffer(o,i.remainder),f=this.positionInBuffer(o,n.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){let g=o.next();Fg(this,o),this.validateCRLFWithPrevNode(g),this.computeBufferMetadata();return}this.deleteNodeHead(o,f),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),this.computeBufferMetadata();return}if(i.nodeStartOffset+o.piece.length===e+t){this.deleteNodeTail(o,u),this.validateCRLFWithNextNode(o),this.computeBufferMetadata();return}this.shrinkNode(o,u,f),this.computeBufferMetadata();return}let a=[],l=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,l),this._searchCache.validate(e),o.piece.length===0&&a.push(o);let d=this.positionInBuffer(r,n.remainder);this.deleteNodeHead(r,d),r.piece.length===0&&a.push(r);let c=o.next();for(let u=c;u!==_e&&u!==r;u=u.next())a.push(u);let h=o.piece.length===0?o.prev():o;this.deleteNodes(a),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){let i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){let r=t.piece,a={line:r.start.line+1,column:0},l=new dn(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=l,e+=`
`,Zo(this,t,-1,-1),t.piece.length===0&&i.push(t)}let n=this.createNewPieces(e),o=this.rbInsertLeft(t,n[n.length-1]);for(let r=n.length-2;r>=0;r--)o=this.rbInsertLeft(o,n[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
`);let i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]),o=n;for(let r=1;r<i.length;r++)o=this.rbInsertRight(o,i[r]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){let n=e.piece,o=e.piece.bufferIndex,r=this._buffers[o].lineStarts,l=r[n.start.line]+n.start.column+t,d=n.start.line,c=n.end.line,h=0,u=0,f=0;for(;d<=c&&(h=d+(c-d)/2|0,f=r[h],h!==c);)if(u=r[h+1],l<f)c=h-1;else if(l>=u)d=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;let n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;let o=n[i.line+1],r=n[i.line]+i.column;if(o>r+1)return i.line-t.line;let 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++)Fg(this,e[t])}createNewPieces(e){if(e.length>$o){let c=[];for(;e.length>$o;){const u=e.charCodeAt($o-1);let f;u===13||u>=55296&&u<=56319?(f=e.substring(0,$o-1),e=e.substring($o-1)):(f=e.substring(0,$o),e=e.substring($o));let g=Yo(f);c.push(new dn(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 sl(f,g))}let h=Yo(e);return c.push(new dn(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 sl(e,h)),c}let t=this._buffers[0].buffer.length;const i=Yo(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 c=0;c<i.length;c++)i[c]+=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 c=0;c<i.length;c++)i[c]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length;let r=this._buffers[0].lineStarts.length-1,a=o-this._buffers[0].lineStarts[r],l={line:r,column:a},d=new dn(0,n,l,this.getLineFeedCnt(0,n,l),o-t);return this._lastChangeBufferPos=l,[d]}getLineRawContent(e,t=0){let i=this.root,n="",o=this._searchCache.get2(e);if(o){i=o.node;let r=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=a.substring(l+r,l+i.piece.length);else{let d=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return a.substring(l+r,l+d-t)}}else{let r=0;const a=e;for(;i!==_e;)if(i.left!==_e&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let l=this.getAccumulatedValue(i,e-i.lf_left-2),d=this.getAccumulatedValue(i,e-i.lf_left-1),c=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)}),c.substring(h+l,h+d-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let l=this.getAccumulatedValue(i,e-i.lf_left-2),d=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=d.substring(c+l,c+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!==_e;){let r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){let a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{let 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!==_e;)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._length)}getIndexOf(e,t){let i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){let r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;let i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),d=l-n,c=a-o,h=i.length+c;e.piece=new dn(i.bufferIndex,i.start,r,l,h),Zo(this,e,c,d)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),d=a-n,c=o-l,h=i.length+c;e.piece=new dn(i.bufferIndex,r,i.end,a,h),Zo(this,e,c,d)}shrinkNode(e,t,i){const n=e.piece,o=n.start,r=n.end,a=n.length,l=n.lineFeedCnt,d=t,c=this.getLineFeedCnt(n.bufferIndex,n.start,d),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new dn(n.bufferIndex,n.start,d,c,h),Zo(this,e,h-a,c-l);let u=new dn(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.bufferIndex,i)),f=this.rbInsertRight(e,u);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=`
`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=Yo(t,!1);for(let f=0;f<o.length;f++)o[f]+=n;if(i){let 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(o.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},d=e.piece.length+t.length,c=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,l),u=h-c;e.piece=new dn(e.piece.bufferIndex,e.piece.start,l,h,d),this._lastChangeBufferPos=l,Zo(this,e,t.length,u)}nodeAt(e){let t=this.root,i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==_e;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;let o={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(o),o}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!==_e;)if(i.left!==_e&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let o=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(o+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==_e;){if(i.piece.lineFeedCnt>0){let o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){let o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let 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===_e||e.piece.lineFeedCnt===0)return!1;let t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n===i.length-1||i[n+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===_e||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let i=[],n=this._buffers[e.piece.bufferIndex].lineStarts,o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:o={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 dn(e.piece.bufferIndex,e.piece.start,o,a,r),Zo(this,e,-1,-1),e.piece.length===0&&i.push(e);let l={line:t.piece.start.line+1,column:0};const d=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new dn(t.piece.bufferIndex,l,t.piece.end,c,d),Zo(this,t,-1,-1),t.piece.length===0&&i.push(t);let h=this.createNewPieces(`\r
`);this.rbInsertRight(e,h[0]);for(let u=0;u<i.length;u++)Fg(this,i[u])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let i=t.next();if(this.startWithLF(i)){if(e+=`
`,i.piece.length===1)Fg(this,i);else{const n=i.piece,o={line:n.start.line+1,column:0},r=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,o,n.end);i.piece=new dn(n.bufferIndex,o,n.end,a,r),Zo(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===_e)return t(_e);let i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===_e)return"";let t=this._buffers[e.piece.bufferIndex],i,n=e.piece,o=this.offsetInBuffer(n.bufferIndex,n.start),r=this.offsetInBuffer(n.bufferIndex,n.end);return i=t.buffer.substring(o,r),i}getPieceContent(e){let 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){let i=new DS(t,1);if(i.left=_e,i.right=_e,i.parent=_e,i.size_left=0,i.lf_left=0,this.root===_e)this.root=i,i.color=0;else if(e.right===_e)e.right=i,i.parent=e;else{let o=FL(e.right);o.left=i,i.parent=o}return rI(this,i),i}rbInsertLeft(e,t){let i=new DS(t,1);if(i.left=_e,i.right=_e,i.parent=_e,i.size_left=0,i.lf_left=0,this.root===_e)this.root=i,i.color=0;else if(e.left===_e)e.left=i,i.parent=e;else{let n=lA(e.left);n.right=i,i.parent=n}return rI(this,i),i}}function $c(s){let e=0,t=0,i=0,n=0;for(let o=0,r=s.length;o<r;o++){const a=s.charCodeAt(o);a===13?(e===0&&(t=o),e++,o+1<r&&s.charCodeAt(o+1)===10?(n|=2,o++):n|=3,i=o+1):a===10&&(n|=1,e===0&&(t=o),e++,i=o+1)}return e===0&&(t=s.length),[e,t,s.length-i,n]}function lI(s){return(s<<0|0|0|16384|2<<23)>>>0}const jo=new Uint32Array(0).buffer;class Sw{constructor(){this.tokens=[]}add(e,t){if(this.tokens.length>0){const i=this.tokens[this.tokens.length-1];if(i.startLineNumber+i.tokens.length-1+1===e){i.tokens.push(t);return}}this.tokens.push(new $V(e,[t]))}}class i_{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return e===0?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(e===0)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),n=this._getEndCharacter(e-1);return new L(0,t+1,i,n+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return this._getTokenCount()===0}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const n=t+Math.floor((i-t)/2),o=this._getDeltaLine(n);if(o<e)t=n+1;else if(o>e)i=n-1;else{let r=n;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=n;for(;a<i&&this._getDeltaLine(a+1)===e;)a++;return new dI(this._tokens.subarray(4*r,4*a+4))}}return this._getDeltaLine(t)===e?new dI(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,n){const o=this._tokens,r=this._tokenCount;let a=0,l=!1,d=0;for(let c=0;c<r;c++){const h=4*c,u=o[h],f=o[h+1],g=o[h+2],m=o[h+3];if((u>e||u===e&&g>=t)&&(u<i||u===i&&f<=n))l=!0;else{if(a===0&&(d=u),l){const b=4*a;o[b]=u-d,o[b+1]=f,o[b+2]=g,o[b+3]=m}a++}}return this._tokenCount=a,d}split(e,t,i,n){const o=this._tokens,r=this._tokenCount;let a=[],l=[],d=a,c=0,h=0;for(let u=0;u<r;u++){const f=4*u,g=o[f],m=o[f+1],b=o[f+2],v=o[f+3];if(g>e||g===e&&b>=t){if(g<i||g===i&&m<=n)continue;d!==l&&(d=l,c=0,h=g)}d[c++]=g-h,d[c++]=m,d[c++]=b,d[c++]=v}return[new i_(new Uint32Array(a)),new i_(new Uint32Array(l)),h]}acceptDeleteRange(e,t,i,n,o){const r=this._tokens,a=this._tokenCount,l=n-t;let d=0,c=!1;for(let h=0;h<a;h++){const u=4*h;let f=r[u],g=r[u+1],m=r[u+2];const b=r[u+3];if(f<t||f===t&&m<=i){d++;continue}else if(f===t&&g<i)f===n&&m>o?m-=o-i:m=i;else if(f===t&&g===i)if(f===n&&m>o)m-=o-i;else{c=!0;continue}else if(f<n||f===n&&g<o)if(f===n&&m>o)f===t?(g=i,m=g+(m-o)):(g=0,m=g+(m-o));else{c=!0;continue}else if(f>n){if(l===0&&!c){d=a;break}f-=l}else if(f===n&&g>=o)e&&f===0&&(g+=e,m+=e),f-=l,g-=o-i,m-=o-i;else throw new Error("Not possible!");const v=4*d;r[v]=f,r[v+1]=g,r[v+2]=m,r[v+3]=b,d++}this._tokenCount=d}acceptInsertText(e,t,i,n,o,r){const a=i===0&&n===1&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),l=this._tokens,d=this._tokenCount;for(let c=0;c<d;c++){const h=4*c;let u=l[h],f=l[h+1],g=l[h+2];if(!(u<e||u===e&&g<t)){if(u===e&&g===t)if(a)g+=1;else continue;else if(u===e&&f<t&&t<g)i===0?g+=n:g=t;else{if(u===e&&f===t&&a)continue;if(u===e)if(u+=i,i===0)f+=n,g+=n;else{const m=g-f;f=o+(f-t),g=f+m}else u+=i}l[h]=u,l[h+1]=f,l[h+2]=g}}}}class dI{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}class n_{constructor(e,t){this.startLineNumber=e,this.tokens=t,this.endLineNumber=this.startLineNumber+this.tokens.getMaxDeltaLine()}toString(){return this.tokens.toString(this.startLineNumber)}_updateEndLineNumber(){this.endLineNumber=this.startLineNumber+this.tokens.getMaxDeltaLine()}isEmpty(){return this.tokens.isEmpty()}getLineTokens(e){return this.startLineNumber<=e&&e<=this.endLineNumber?this.tokens.getLineTokens(e-this.startLineNumber):null}getRange(){const e=this.tokens.getRange();return e&&new L(this.startLineNumber+e.startLineNumber,e.startColumn,this.startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;this.startLineNumber+=this.tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber,[n,o,r]=this.tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new n_(this.startLineNumber,n),new n_(this.startLineNumber+r,o)]}applyEdit(e,t){const[i,n,o]=$c(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new O(e.startLineNumber,e.startColumn),t,i,n,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;if(i<0){const o=i-t;this.startLineNumber-=o;return}const n=this.tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1){this.startLineNumber=0,this.tokens.clear();return}if(t<0){const o=-t;this.startLineNumber-=o,this.tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this.tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(t===0&&i===0)return;const r=e.lineNumber-this.startLineNumber;if(r<0){this.startLineNumber+=t;return}const a=this.tokens.getMaxDeltaLine();r>=a+1||this.tokens.acceptInsertText(r,e.column-1,t,i,n,o)}}class $V{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function qo(s){return s instanceof Uint32Array?s:new Uint32Array(s)}class HL{constructor(){this._pieces=[],this._isComplete=!1}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let n=null;for(let o=0,r=this._pieces.length;o<r;o++){const a=this._pieces[o];if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){n=n||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){n=n||{index:o};continue}const[l,d]=a.split(i);if(l.isEmpty()){n=n||{index:o};continue}d.isEmpty()||(this._pieces.splice(o,1,l,d),o++,r++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=Qu(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSemanticTokens(e,t){const i=this._pieces;if(i.length===0)return t;const n=HL._findFirstPieceWithLine(i,e),o=i[n].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let l=0,d=[],c=0,h=0;const u=(f,g)=>{f!==h&&(h=f,d[c++]=f,d[c++]=g)};for(let f=0;f<a;f++){const g=o.getStartCharacter(f),m=o.getEndCharacter(f),b=o.getMetadata(f),v=((b&1?2048:0)|(b&2?4096:0)|(b&4?8192:0)|(b&8?8372224:0)|(b&16?4286578688:0))>>>0,_=~v>>>0;for(;l<r&&t.getEndOffset(l)<=g;)u(t.getEndOffset(l),t.getMetadata(l)),l++;for(l<r&&t.getStartOffset(l)<g&&u(g,t.getMetadata(l));l<r&&t.getEndOffset(l)<m;)u(t.getEndOffset(l),t.getMetadata(l)&_|b&v),l++;if(l<r)u(m,t.getMetadata(l)&_|b&v),t.getEndOffset(l)===m&&l++;else{const w=Math.min(Math.max(0,l-1),r-1);u(m,t.getMetadata(w)&_|b&v)}}for(;l<r;)u(t.getEndOffset(l),t.getMetadata(l)),l++;return new ci(new Uint32Array(d),t.getLineContent())}static _findFirstPieceWithLine(e,t){let i=0,n=e.length-1;for(;i<n;){let o=i+Math.floor((n-i)/2);if(e[o].endLineNumber<t)i=o+1;else if(e[o].startLineNumber>t)n=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,n,o){for(const r of this._pieces)r.acceptEdit(e,t,i,n,o)}}class $n{constructor(){this._lineTokens=[],this._len=0}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),n!==null&&n!==jo)return new ci(qo(n),i);let o=new Uint32Array(2);return o[0]=i.length,o[1]=lI(e),new ci(o,i)}static _massageTokens(e,t,i){const n=i?qo(i):null;if(t===0){let o=!1;if(n&&n.length>1&&(o=$i.getLanguageId(n[1])!==e),!o)return jo}if(!n||n.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=lI(e),o.buffer}return n[n.length-2]=t,n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;let i=[];for(let n=0;n<t;n++)i[n]=null;this._lineTokens=Qu(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,n,o){const r=$n._massageTokens(e,i,n);this._ensureLine(t);const a=this._lineTokens[t];return this._lineTokens[t]=r,o?!$n._equals(a,r):!1}static _equals(e,t){if(!e||!t)return!e&&!t;const i=qo(e),n=qo(t);if(i.length!==n.length)return!1;for(let o=0,r=i.length;o<r;o++)if(i[o]!==n[o])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new O(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=$n._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=$n._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i<this._len&&(n=$n._deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=$n._append(this._lineTokens[t],n),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(t===0&&i===0)return;const n=e.lineNumber-1;if(!(n>=this._len)){if(t===0){this._lineTokens[n]=$n._insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=$n._deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=$n._insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}static _deleteBeginning(e,t){return e===null||e===jo?e:$n._delete(e,0,t)}static _deleteEnding(e,t){if(e===null||e===jo)return e;const i=qo(e),n=i[i.length-2];return $n._delete(e,t,n)}static _delete(e,t,i){if(e===null||e===jo||t===i)return e;const n=qo(e),o=n.length>>>1;if(t===0&&n[n.length-2]===i)return jo;const r=ci.findIndexInTokensArray(n,t),a=r>0?n[r-1<<1]:0,l=n[r<<1];if(i<l){const f=i-t;for(let g=r;g<o;g++)n[g<<1]-=f;return e}let d,c;a!==t?(n[r<<1]=t,d=r+1<<1,c=t):(d=r<<1,c=a);const h=i-t;for(let f=r+1;f<o;f++){const g=n[f<<1]-h;g>c&&(n[d++]=g,n[d++]=n[(f<<1)+1],c=g)}if(d===n.length)return e;let u=new Uint32Array(d);return u.set(n.subarray(0,d),0),u.buffer}static _append(e,t){if(t===jo)return e;if(e===jo)return t;if(e===null)return e;if(t===null)return null;const i=qo(e),n=qo(t),o=n.length>>>1;let r=new Uint32Array(i.length+n.length);r.set(i,0);let a=i.length;const l=i[i.length-2];for(let d=0;d<o;d++)r[a++]=n[d<<1]+l,r[a++]=n[(d<<1)+1];return r.buffer}static _insert(e,t,i){if(e===null||e===jo)return e;const n=qo(e),o=n.length>>>1;let r=ci.findIndexInTokensArray(n,t);r>0&&n[r-1<<1]===t&&r--;for(let a=r;a<o;a++)n[a<<1]+=i;return e}}class Dc extends U{constructor(e,t,i,n,o,r,a){super(),this._onDidChangeContent=this._register(new M),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new UV(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){let i=e+t;const n=this.getPositionAt(e),o=this.getPositionAt(i);return new L(n.lineNumber,n.column,o.lineNumber,o.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;let i=this.getOffsetAt(e.startLineNumber,e.startColumn);return this.getOffsetAt(e.endLineNumber,e.endColumn)-i}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let r=n;r<=o;r++){const a=this.getLineContent(r),l=r===n?e.startColumn-1:0,d=r===o?e.endColumn-1:a.length;for(let c=l;c<d;c++)di(a.charCodeAt(c))?(i=i+1,c=c+1):i=i+1}return i+=this._getEndOfLine(t).length*(o-n),i}return this.getValueLengthInRange(e,t)}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=bn(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=xo(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,o=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let m=0;m<e.length;m++){let b=e[m];a&&b._isTracked&&(a=!1);let v=b.range;if(b.text){let D=!0;r||(D=!tL(b.text),r=D),!n&&D&&(n=ib(b.text)),!o&&D&&(o=jM(b.text))}let _="",w=0,C=0,S=0;if(b.text){let D;[w,C,S,D]=$c(b.text);const y=this.getEOL();D===0||D===(y===`\r
`?2:1)?_=b.text:_=b.text.replace(/\r\n|\r|\n/g,y)}l[m]={sortIndex:m,identifier:b.identifier||null,range:v,rangeOffset:this.getOffsetAt(v.startLineNumber,v.startColumn),rangeLength:this.getValueLengthInRange(v),text:_,eolCount:w,firstLineLength:C,lastLineLength:S,forceMoveMarkers:!!b.forceMoveMarkers,isAutoWhitespaceEdit:b.isAutoWhitespaceEdit||!1}}l.sort(Dc._sortOpsAscending);let d=!1;for(let m=0,b=l.length-1;m<b;m++){let v=l[m].range.getEndPosition(),_=l[m+1].range.getStartPosition();if(_.isBeforeOrEqual(v)){if(_.isBefore(v))throw new Error("Overlapping ranges are not allowed!");d=!0}}a&&(l=this._reduceOperations(l));let c=i||t?Dc._getInverseEditRanges(l):[],h=[];if(t)for(let m=0;m<l.length;m++){let b=l[m],v=c[m];if(b.isAutoWhitespaceEdit&&b.range.isEmpty())for(let _=v.startLineNumber;_<=v.endLineNumber;_++){let w="";_===v.startLineNumber&&(w=this.getLineContent(b.range.startLineNumber),bn(w)!==-1)||h.push({lineNumber:_,oldContent:w})}}let u=null;if(i){let m=0;u=[];for(let b=0;b<l.length;b++){const v=l[b],_=c[b],w=this.getValueInRange(v.range),C=v.rangeOffset+m;m+=v.text.length-w.length,u[b]={sortIndex:v.sortIndex,identifier:v.identifier,range:_,text:w,textChange:new _i(v.rangeOffset,w,C,v.text)}}d||u.sort((b,v)=>b.sortIndex-v.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let g=null;if(t&&h.length>0){h.sort((m,b)=>b.lineNumber-m.lineNumber),g=[];for(let m=0,b=h.length;m<b;m++){let v=h[m].lineNumber;if(m>0&&h[m-1].lineNumber===v)continue;let _=h[m].oldContent,w=this.getLineContent(v);w.length===0||w===_||bn(w)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new d3(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,o=new L(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],b=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new L(r,a,b.startLineNumber,b.startColumn))),m.text.length>0&&l.push(m.text),r=b.endLineNumber,a=b.endColumn}const d=l.join(""),[c,h,u]=$c(d);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:d,eolCount:c,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Dc._sortOpsDescending);let t=[];for(let i=0;i<e.length;i++){let n=e[i];const o=n.range.startLineNumber,r=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(o===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 d=new L(o,r,a,l);t.push({range:d,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){let t=[],i=0,n=0,o=null;for(let r=0,a=e.length;r<a;r++){let l=e[r],d,c;o?o.range.endLineNumber===l.range.startLineNumber?(d=i,c=n+(l.range.startColumn-o.range.endColumn)):(d=i+(l.range.startLineNumber-o.range.endLineNumber),c=l.range.startColumn):(d=l.range.startLineNumber,c=l.range.startColumn);let h;if(l.text.length>0){const u=l.eolCount+1;u===1?h=new L(d,c,d,c+l.firstLineLength):h=new L(d,c,d+u-1,l.lastLineLength+1)}else h=new L(d,c,d,c);i=h.endLineNumber,n=h.endColumn,t.push(h),o=l}return t}static _sortOpsAscending(e,t){let i=L.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=L.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class jV{constructor(e,t,i,n,o,r,a,l,d){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=d}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?`
`:`\r
`:i>t/2?`\r
`:`
`}create(e){const t=this._getEOL(e);let i=this._chunks;if(this._normalizeEOL&&(t===`\r
`&&(this._cr>0||this._lf>0)||t===`
`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o<r;o++){let a=i[o].buffer.replace(/\r\n|\r|\n/g,t),l=Yo(a);i[o]=new sl(a,l)}const n=new Dc(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class qV{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&&iL(e)&&(this.BOM=E5,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=VV(this._tmpLineStarts,e);this.chunks.push(new sl(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),!this.isBasicASCII&&!this.containsRTL&&(this.containsRTL=ib(e)),!this.isBasicASCII&&!this.containsUnusualLineTerminators&&(this.containsUnusualLineTerminators=jM(e))}finish(e=!0){return this._finish(),new jV(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;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=Yo(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class KV{constructor(){this.changeType=1}}class Er{constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.order=n,this.text=o}static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.text;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new Er(i.ownerId,i.range.startLineNumber,i.range.startColumn,0,i.options.before.content)),i.options.after&&i.options.after.content.length>0&&t.push(new Er(i.ownerId,i.range.endLineNumber,i.range.endColumn,1,i.options.after.content));return t.sort((i,n)=>i.lineNumber===n.lineNumber?i.column===n.column?i.order-n.order:i.column-n.column:i.lineNumber-n.lineNumber),t}}class cI{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class GV{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class ZV{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class YV{constructor(){this.changeType=5}}class la{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.versionId,o=e.isUndoing||t.isUndoing,r=e.isRedoing||t.isRedoing;return new la(i,n,o,r)}}class XV{constructor(e){this.changes=e}}class s_{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=la.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=s_._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new s_(t,i)}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.eol,o=t.versionId,r=e.isUndoing||t.isUndoing,a=e.isRedoing||t.isRedoing,l=e.isFlush||t.isFlush;return{changes:i,eol:n,versionId:o,isUndoing:r,isRedoing:a,isFlush:l}}}class QV{constructor(){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0}_reset(e){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0,e&&this._setBeginState(0,e)}flush(e){this._reset(e)}get invalidLineStartIndex(){return this._invalidLineStartIndex}_invalidateLine(e){e<this._len&&(this._valid[e]=!1),e<this._invalidLineStartIndex&&(this._invalidLineStartIndex=e)}_isValid(e){return e<this._len?this._valid[e]:!1}getBeginState(e){return e<this._len?this._beginState[e]:null}_ensureLine(e){for(;e>=this._len;)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;let i=[],n=[];for(let o=0;o<t;o++)i[o]=null,n[o]=!1;this._beginState=Qu(this._beginState,e,i),this._valid=Qu(this._valid,e,n),this._len+=t}_setValid(e,t){this._ensureLine(e),this._valid[e]=t}_setBeginState(e,t){this._ensureLine(e),this._beginState[e]=t}setEndState(e,t,i){if(this._setValid(t,!0),this._invalidLineStartIndex=t+1,t===e-1)return;const n=this.getBeginState(t+1);if(n===null||!i.equals(n)){this._setBeginState(t+1,i),this._invalidateLine(t+1);return}let o=t+1;for(;o<e&&this._isValid(o);)o++;this._invalidLineStartIndex=o}setFakeTokens(e){this._setValid(e,!1)}applyEdits(e,t){const i=e.endLineNumber-e.startLineNumber,o=Math.min(i,t);for(let r=o;r>=0;r--)this._invalidateLine(e.startLineNumber+r-1);this._acceptDeleteRange(e),this._acceptInsertText(new O(e.startLineNumber,e.startColumn),t)}_acceptDeleteRange(e){e.startLineNumber-1>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){e.lineNumber-1>=this._len||this._insertLines(e.lineNumber,t)}}class JV extends U{constructor(e){super(),this._isDisposed=!1,this._textModel=e,this._tokenizationStateStore=new QV,this._tokenizationSupport=null,this._register(St.onDidChange(t=>{const i=this._textModel.getLanguageIdentifier();t.changedLanguages.indexOf(i.language)!==-1&&(this._resetTokenizationState(),this._textModel.clearTokens())})),this._register(this._textModel.onDidChangeContentFast(t=>{if(t.isFlush){this._resetTokenizationState();return}for(let i=0,n=t.changes.length;i<n;i++){const o=t.changes[i],[r]=$c(o.text);this._tokenizationStateStore.applyEdits(o.range,r)}this._beginBackgroundTokenization()})),this._register(this._textModel.onDidChangeAttached(()=>{this._beginBackgroundTokenization()})),this._register(this._textModel.onDidChangeLanguage(()=>{this._resetTokenizationState(),this._textModel.clearTokens()})),this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}_resetTokenizationState(){const[e,t]=e7(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&gm(()=>{this._isDisposed||this._revalidateTokensNow()})}_revalidateTokensNow(e=this._textModel.getLineCount()){const i=new Sw,n=Ao.create(!1);for(;this._hasLinesToTokenize()&&!(n.elapsed()>1||this._tokenizeOneInvalidLine(i)>=e););this._beginBackgroundTokenization(),this._textModel.setTokens(i.tokens)}tokenizeViewport(e,t){const i=new Sw;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens)}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new Sw;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens)}isCheapToTokenize(e){if(!this._tokenizationSupport)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return e>t?!1:e<t||this._textModel.getLineLength(e)<2048}_hasLinesToTokenize(){return this._tokenizationSupport?this._tokenizationStateStore.invalidLineStartIndex<this._textModel.getLineCount():!1}_tokenizeOneInvalidLine(e){if(!this._hasLinesToTokenize())return this._textModel.getLineCount()+1;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return this._updateTokensUntilLine(e,t),t}_updateTokensUntilLine(e,t){if(!this._tokenizationSupport)return;const i=this._textModel.getLanguageIdentifier(),n=this._textModel.getLineCount(),o=t-1;for(let r=this._tokenizationStateStore.invalidLineStartIndex;r<=o;r++){const a=this._textModel.getLineContent(r+1),l=this._tokenizationStateStore.getBeginState(r),d=yw(i,this._tokenizationSupport,a,!0,l);e.add(r+1,d.tokens),this._tokenizationStateStore.setEndState(n,r,d.endState),r=this._tokenizationStateStore.invalidLineStartIndex-1}}_tokenizeViewport(e,t,i){if(!this._tokenizationSupport||i<=this._tokenizationStateStore.invalidLineStartIndex)return;if(t<=this._tokenizationStateStore.invalidLineStartIndex){this._updateTokensUntilLine(e,i);return}let n=this._textModel.getLineFirstNonWhitespaceColumn(t),o=[],r=null;for(let d=t-1;n>0&&d>=1;d--){let c=this._textModel.getLineFirstNonWhitespaceColumn(d);if(c!==0&&c<n){if(r=this._tokenizationStateStore.getBeginState(d-1),r)break;o.push(this._textModel.getLineContent(d)),n=c}}r||(r=this._tokenizationSupport.getInitialState());const a=this._textModel.getLanguageIdentifier();let l=r;for(let d=o.length-1;d>=0;d--)l=yw(a,this._tokenizationSupport,o[d],!1,l).endState;for(let d=t;d<=i;d++){let c=this._textModel.getLineContent(d),h=yw(a,this._tokenizationSupport,c,!0,l);e.add(d,h.tokens),this._tokenizationStateStore.setFakeTokens(d-1),l=h.endState}}}function e7(s){const e=s.getLanguageIdentifier();let t=s.isTooLargeForTokenization()?null:St.get(e.language),i=null;if(t)try{i=t.getInitialState()}catch(n){ve(n),t=null}return[t,i]}function yw(s,e,t,i,n){let o=null;if(e)try{o=e.tokenize2(t,i,n.clone(),0)}catch(r){ve(r)}return o||(o=fL(s.id,t,n,0)),ci.convertToEndOffset(o.tokens,t.length),o}function da(s,e){const t=Math.pow(10,e);return Math.round(s*t)/t}class Ve{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=da(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class Hs{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=da(Math.max(Math.min(1,t),0),3),this.l=da(Math.max(Math.min(1,i),0),3),this.a=da(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=e.a,r=Math.max(t,i,n),a=Math.min(t,i,n);let l=0,d=0;const c=(a+r)/2,h=r-a;if(h>0){switch(d=Math.min(c<=.5?h/(2*c):h/(2-2*c),1),r){case t:l=(i-n)/h+(i<n?6:0);break;case i:l=(n-t)/h+2;break;case n:l=(t-i)/h+4;break}l*=60,l=Math.round(l)}return new Hs(l,d,c,o)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:o}=e;let r,a,l;if(i===0)r=a=l=n;else{const d=n<.5?n*(1+i):n+i-n*i,c=2*n-d;r=Hs._hue2rgb(c,d,t+1/3),a=Hs._hue2rgb(c,d,t),l=Hs._hue2rgb(c,d,t-1/3)}return new Ve(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class yo{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=da(Math.max(Math.min(1,t),0),3),this.v=da(Math.max(Math.min(1,i),0),3),this.a=da(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=Math.max(t,i,n),r=Math.min(t,i,n),a=o-r,l=o===0?0:a/o;let d;return a===0?d=0:o===t?d=((i-n)/a%6+6)%6:o===i?d=(n-t)/a+2:d=(t-i)/a+4,new yo(Math.round(d*60),l,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,r=n*i,a=r*(1-Math.abs(t/60%2-1)),l=n-r;let[d,c,h]=[0,0,0];return t<60?(d=r,c=a):t<120?(d=a,c=r):t<180?(c=r,h=a):t<240?(c=a,h=r):t<300?(d=a,h=r):t<=360&&(d=r,h=a),d=Math.round((d+l)*255),c=Math.round((c+l)*255),h=Math.round((h+l)*255),new Ve(d,c,h,o)}}class B{constructor(e){if(e)if(e instanceof Ve)this.rgba=e;else if(e instanceof Hs)this._hsla=e,this.rgba=Hs.toRGBA(e);else if(e instanceof yo)this._hsva=e,this.rgba=yo.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}static fromHex(e){return B.Format.CSS.parseHex(e)||B.red}get hsla(){return this._hsla?this._hsla:Hs.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:yo.fromRGBA(this.rgba)}equals(e){return!!e&&Ve.equals(this.rgba,e.rgba)&&Hs.equals(this.hsla,e.hsla)&&yo.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=B._relativeLuminanceForComponent(this.rgba.r),t=B._relativeLuminanceForComponent(this.rgba.g),i=B._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return da(n,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t<i}lighten(e){return new B(new Hs(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new B(new Hs(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:n,a:o}=this.rgba;return new B(new Ve(t,i,n,o*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new B(new Ve(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}toString(){return""+B.Format.CSS.format(this)}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(n-o)/n,e.darken(i)}}B.white=new B(new Ve(255,255,255,1));B.black=new B(new Ve(0,0,0,1));B.red=new B(new Ve(255,0,0,1));B.blue=new B(new Ve(0,0,255,1));B.cyan=new B(new Ve(0,255,255,1));B.lightgrey=new B(new Ve(211,211,211,1));B.transparent=new B(new Ve(0,0,0,0));(function(s){(function(e){(function(t){function i(f){return f.rgba.a===1?`rgb(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b})`:s.Format.CSS.formatRGBA(f)}t.formatRGB=i;function n(f){return`rgba(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b}, ${+f.rgba.a.toFixed(2)})`}t.formatRGBA=n;function o(f){return f.hsla.a===1?`hsl(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%)`:s.Format.CSS.formatHSLA(f)}t.formatHSL=o;function r(f){return`hsla(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%, ${f.hsla.a.toFixed(2)})`}t.formatHSLA=r;function a(f){const g=f.toString(16);return g.length!==2?"0"+g:g}function l(f){return`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}`}t.formatHex=l;function d(f,g=!1){return g&&f.rgba.a===1?s.Format.CSS.formatHex(f):`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}${a(Math.round(f.rgba.a*255))}`}t.formatHexA=d;function c(f){return f.isOpaque()?s.Format.CSS.formatHex(f):s.Format.CSS.formatRGBA(f)}t.format=c;function h(f){const g=f.length;if(g===0||f.charCodeAt(0)!==35)return null;if(g===7){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),b=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),v=16*u(f.charCodeAt(5))+u(f.charCodeAt(6));return new s(new Ve(m,b,v,1))}if(g===9){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),b=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),v=16*u(f.charCodeAt(5))+u(f.charCodeAt(6)),_=16*u(f.charCodeAt(7))+u(f.charCodeAt(8));return new s(new Ve(m,b,v,_/255))}if(g===4){const m=u(f.charCodeAt(1)),b=u(f.charCodeAt(2)),v=u(f.charCodeAt(3));return new s(new Ve(16*m+m,16*b+b,16*v+v))}if(g===5){const m=u(f.charCodeAt(1)),b=u(f.charCodeAt(2)),v=u(f.charCodeAt(3)),_=u(f.charCodeAt(4));return new s(new Ve(16*m+m,16*b+b,16*v+v,(16*_+_)/255))}return null}t.parseHex=h;function u(f){switch(f){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(e.CSS||(e.CSS={}))})(s.Format||(s.Format={}))})(B||(B={}));function t7(){return new qV}function i7(s){const e=t7();return e.acceptChunk(s),e.finish()}function hI(s,e){return(typeof s=="string"?i7(s):s).create(e)}let Wg=0;const n7=999,s7=1e4;class o7{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,i=0;do{let n=this._source.read();if(n===null)return this._eos=!0,t===0?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=64*1024)return e.join("")}while(!0)}}const Vh=()=>{throw new Error("Invalid change accessor")};class nr{constructor(){this._searchCanceledBrand=void 0}}nr.INSTANCE=new nr;function Vg(s){return s instanceof nr?null:s}class si extends U{constructor(e,t,i,n=null,o){super(),this._onWillDispose=this._register(new M),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new d7(c=>this.handleBeforeFireDecorationsChangedEvent(c))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new M),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new M),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new M),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new M),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new M),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeContentOrInjectedText=this._register(new M),this.onDidChangeContentOrInjectedText=this._onDidChangeContentOrInjectedText.event,this._eventEmitter=this._register(new c7),this._register(this._eventEmitter.fastEvent(c=>{this._onDidChangeContentOrInjectedText.fire(c.rawContentChangedEvent)})),Wg++,this.id="$model"+Wg,this.isForSimpleWidget=t.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=he.parse("inmemory://model/"+Wg):this._associatedResource=n,this._undoRedoService=o,this._attachedEditorCount=0;const{textBuffer:r,disposable:a}=hI(e,t.defaultEOL);this._buffer=r,this._bufferDisposable=a,this._options=si.resolveOptions(this._buffer,t);const l=this._buffer.getLineCount(),d=this._buffer.getValueLengthInRange(new L(1,1,l,this._buffer.getLineLength(l)+1),0);t.largeFileOptimizations?this._isTooLargeForTokenization=d>si.LARGE_FILE_SIZE_THRESHOLD||l>si.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=d>si.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageIdentifier=i||Pm,this._languageRegistryListener=xe.onDidChange(c=>{c.languageIdentifier.id===this._languageIdentifier.id&&this._onDidChangeLanguageConfiguration.fire({})}),this._instanceId=qM(Wg),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new uI,this._commandManager=new PL(this,o),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new $n,this._tokens2=new HL,this._tokenization=new JV(this)}static resolveOptions(e,t){if(t.detectIndentation){const i=eI(e,t.tabSize,t.insertSpaces);return new Np({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new Np({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}onDidChangeContentFast(e){return this._eventEmitter.fastEvent(t=>e(t.contentChangedEvent))}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}dispose(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this._isDisposing=!1;const e=new Dc([],"",`
`,!1,!1,!0,!0);e.dispose(),this._buffer=e}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._isDisposing||this._eventEmitter.fire(new s_(e,t))}setValue(e){if(this._assertNotDisposed(),e===null)return;const{textBuffer:t,disposable:i}=hI(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,r,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokens.flush(),this._tokens2.flush(),this._decorations=Object.create(null),this._decorationsTree=new uI,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new la([new KV],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,o,r),0,n,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
`:`
`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new la([new YV],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,o,r),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.search(0,!1,!1,e);this._ensureNodesHaveRanges(t)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const o=t[i],r=o.cachedAbsoluteStart-o.start,a=this._buffer.getOffsetAt(o.range.startLineNumber,o.range.startColumn),l=this._buffer.getOffsetAt(o.range.endLineNumber,o.range.endColumn);o.cachedAbsoluteStart=a,o.cachedAbsoluteEnd=l,o.cachedVersionId=e,o.start=a-r,o.end=l-r,wa(o)}}onBeforeAttached(){this._attachedEditorCount++,this._attachedEditorCount===1&&this._onDidChangeAttached.fire(void 0)}onBeforeDetached(){this._attachedEditorCount--,this._attachedEditorCount===0&&this._onDidChangeAttached.fire(void 0)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}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 o=this._buffer.getLineLength(n);o>=s7?t+=o:e+=o}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();let t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.indentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=new Np({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o});if(this._options.equals(r))return;let a=this._options.createChangeEvent(r);this._options=r,this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();let i=eI(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}static _normalizeIndentationFromWhitespace(e,t,i){let n=0;for(let r=0;r<e.length;r++)e.charAt(r)===" "?n+=t:n++;let o="";if(!i){let r=Math.floor(n/t);n=n%t;for(let a=0;a<r;a++)o+=" "}for(let r=0;r<n;r++)o+=" ";return o}static normalizeIndentation(e,t,i){let n=bn(e);return n===-1&&(n=e.length),si._normalizeIndentationFromWhitespace(e.substring(0,n),t,i)+e.substring(n)}normalizeIndentation(e){return this._assertNotDisposed(),si.normalizeIndentation(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($M.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();let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();let t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new o7(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===`
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(o);r>=h&&(r=h)}const a=e.endLineNumber,l=e.endColumn;let d=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),c=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(d<1)d=1,c=1;else if(d>t)d=t,c=this.getLineMaxColumn(d);else if(c<=1)c=1;else{const h=this.getLineMaxColumn(d);c>=h&&(c=h)}return i===o&&n===r&&a===d&&l===c&&e instanceof L&&!(e instanceof ee)?e:new L(o,r,d,c)}_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 o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(di(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new O(1,1);if(n>r)return new O(r,this.getLineMaxColumn(r));if(o<=1)return new O(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new O(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,o-2);if(di(l))return new O(n,o-1)}return new O(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof O&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(o,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(o)?this._buffer.getLineCharCode(o,r-2):0,d=di(a),c=di(l);return!d&&!c}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof L&&!(e instanceof ee)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const d=r>1?this._buffer.getLineCharCode(o,r-2):0,c=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=di(d),u=di(c);return!h&&!u?new L(o,r,a,l):o===a&&r===l?new L(o,r-1,a,l-1):h&&u?new L(o,r-1,a,l+1):h?new L(o,r-1,a,l):new L(o,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();let 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 L(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,r,a=n7){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>L.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 d=[];d.push(l.reduce((h,u)=>L.areIntersecting(h,u)?h.plusRange(u):(d.push(h),u)));let c;if(!i&&e.indexOf(`
`)<0){const u=new Ja(e,i,n,o).parseSearchRequest();if(!u)return[];c=f=>this.findMatchesLineByLine(f,u,r,a)}else c=h=>Bg.findMatches(this,new Ja(e,i,n,o),h,r,a);return d.map(c).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
`)<0){const d=new Ja(e,i,n,o).parseSearchRequest();if(!d)return null;const c=this.getLineCount();let h=new L(a.lineNumber,a.column,c,this.getLineMaxColumn(c)),u=this.findMatchesLineByLine(h,d,r,1);return Bg.findNextMatch(this,new Ja(e,i,n,o),a,r),u.length>0||(h=new L(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,d,r,1),u.length>0)?u[0]:null}return Bg.findNextMatch(this,new Ja(e,i,n,o),a,r)}findPreviousMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return Bg.findPreviousMatch(this,new Ja(e,i,n,o),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 tw?e:new tw(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){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){let n=t.map(r=>({range:this.validateRange(r.range),text:r.text})),o=!0;if(e)for(let r=0,a=e.length;r<a;r++){let l=e[r],d=!1;for(let c=0,h=n.length;c<h;c++){let u=n[c].range,f=u.startLineNumber>l.endLineNumber,g=l.startLineNumber>u.endLineNumber;if(!f&&!g){d=!0;break}}if(!d){o=!1;break}}if(o)for(let r=0,a=this._trimAutoWhitespaceLines.length;r<a;r++){let l=this._trimAutoWhitespaceLines[r],d=this.getLineMaxColumn(l),c=!0;for(let h=0,u=n.length;h<u;h++){let f=n[h].range,g=n[h].text;if(!(l<f.startLineNumber||l>f.endLineNumber)&&!(l===f.startLineNumber&&f.startColumn===d&&f.isEmpty()&&g&&g.length>0&&g.charAt(0)===`
`)&&!(l===f.startLineNumber&&f.startColumn===1&&f.isEmpty()&&g&&g.length>0&&g.charAt(g.length-1)===`
`)){c=!1;break}}if(c){const h=new L(l,1,l,d);t.push(new tw(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let d=0,c=r.length;d<c;d++){const h=r[d],[u,f,g]=$c(h.text);this._tokens.acceptEdit(h.range,u,f),this._tokens2.acceptEdit(h.range,u,f,g,h.text.length>0?h.text.charCodeAt(0):0),this._decorationsTree.acceptReplace(h.rangeOffset,h.rangeLength,h.text.length,h.forceMoveMarkers)}let a=[];this._increaseVersionId();let l=i;for(let d=0,c=r.length;d<c;d++){const h=r[d],[u]=$c(h.text);this._onDidChangeDecorations.fire();const f=h.range.startLineNumber,g=h.range.endLineNumber,m=g-f,b=u,v=Math.min(m,b),_=b-m,w=o-l-_+f,C=w,S=w+b,D=this._ensureNodesHaveRanges(this._decorationsTree.getInjectedTextInInterval(this.getOffsetAt(new O(C,1)),this.getOffsetAt(new O(S,this.getLineMaxColumn(S))),0,this._versionId)),y=Er.fromDecorations(D),x=new Tk(y);for(let E=v;E>=0;E--){const P=f+E,A=w+E;x.takeFromEndWhile(q=>q.lineNumber>A);const H=x.takeFromEndWhile(q=>q.lineNumber===A);a.push(new cI(P,this.getLineContent(A),H))}if(v<m){const E=f+v;a.push(new GV(E+1,g))}if(v<b){const E=new Tk(y),P=f+v,A=b-v,H=o-l-A+P+1;let q=[],de=[];for(let ce=0;ce<A;ce++){let be=H+ce;de[ce]=this.getLineContent(be),E.takeWhile(ke=>ke.lineNumber<be),q[ce]=E.takeWhile(ke=>ke.lineNumber===be)}a.push(new ZV(P+1,f+b,de,q))}l+=_}this._emitContentChangedEvent(new la(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=[...e].map(n=>new cI(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeContentOrInjectedText.fire(new XV(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){let i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,pI(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)},n=null;try{n=t(i)}catch(o){ve(o)}return i.addDecoration=Vh,i.changeDecoration=Vh,i.changeDecorationOptions=Vh,i.removeDecoration=Vh,i.deltaDecorations=Vh,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:gI[i]}])[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,a,o),n.setOptions(gI[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;i<n;i++){const o=t[i];this._decorationsTree.delete(o),delete this._decorations[o.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._getDecorationRange(t):null}_getDecorationRange(e){const t=this.getVersionId();return e.cachedVersionId!==t&&this._decorationsTree.resolveNode(e,t),e.range===null&&(e.range=this._getRangeAt(e.cachedAbsoluteStart,e.cachedAbsoluteEnd)),e.range}getLineDecorations(e,t=0,i=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1){let o=this.getLineCount(),r=Math.min(o,Math.max(1,e)),a=Math.min(o,Math.max(1,t)),l=this.getLineMaxColumn(a);return this._getDecorationsInRange(new L(r,1,a,l),i,n)}getDecorationsInRange(e,t=0,i=!1){let n=this.validateRange(e);return this._getDecorationsInRange(n,t,i)}getOverviewRulerDecorations(e=0,t=!1){const i=this.getVersionId(),n=this._decorationsTree.search(e,t,!0,i);return this._ensureNodesHaveRanges(n)}getInjectedTextDecorations(e=0){const t=this.getVersionId(),i=this._decorationsTree.getInjectedText(e,t);return this._ensureNodesHaveRanges(i)}_getInjectedTextInLine(e){const t=this.getVersionId(),i=this._buffer.getOffsetAt(e,1),n=i+this._buffer.getLineLength(e),o=this._decorationsTree.getInjectedTextInInterval(i,n,0,t);return this._ensureNodesHaveRanges(o),Er.fromDecorations(o).filter(r=>r.lineNumber===e)}getAllDecorations(e=0,t=!1){const i=this.getVersionId(),n=this._decorationsTree.search(e,t,!1,i);return this._ensureNodesHaveRanges(n)}_getDecorationsInRange(e,t,i){const n=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn),r=this.getVersionId(),a=this._decorationsTree.intervalSearch(n,o,t,i,r);return this._ensureNodesHaveRanges(a)}_ensureNodesHaveRanges(e){for(let t=0,i=e.length;t<i;t++){const n=e[t];n.range===null&&(n.range=this._getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd))}return e}_getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),r=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),(i.options.after||t.after)&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(i.range.endLineNumber),(i.options.before||t.before)&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(i.range.startLineNumber),n!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i){const n=this.getVersionId(),o=t.length;let r=0;const a=i.length;let l=0,d=new Array(a);for(;r<o||l<a;){let c=null;if(r<o){do c=this._decorations[t[r++]];while(!c&&r<o);if(c){if(c.options.after){const h=this._getDecorationRange(c);this._onDidChangeDecorations.recordLineAffectedByInjectedText(h.endLineNumber)}if(c.options.before){const h=this._getDecorationRange(c);this._onDidChangeDecorations.recordLineAffectedByInjectedText(h.startLineNumber)}this._decorationsTree.delete(c),this._onDidChangeDecorations.checkAffectedAndFire(c.options)}}if(l<a){if(!c){const b=++this._lastDecorationId,v=`${this._instanceId};${b}`;c=new rA(v,0,0),this._decorations[v]=c}const h=i[l],u=this._validateRangeRelaxedNoAllocations(h.range),f=pI(h.options),g=this._buffer.getOffsetAt(u.startLineNumber,u.startColumn),m=this._buffer.getOffsetAt(u.endLineNumber,u.endColumn);c.ownerId=e,c.reset(n,g,m,u),c.setOptions(f),c.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(u.endLineNumber),c.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(u.startLineNumber),this._onDidChangeDecorations.checkAffectedAndFire(f),this._decorationsTree.insert(c),d[l]=c.id,l++}else c&&delete this._decorations[c.id]}return d}setTokens(e){if(e.length===0)return;let t=[];for(let i=0,n=e.length;i<n;i++){const o=e[i];let r=0,a=0,l=!1;for(let d=0,c=o.tokens.length;d<c;d++){const h=o.startLineNumber+d;l?(this._tokens.setTokens(this._languageIdentifier.id,h-1,this._buffer.getLineLength(h),o.tokens[d],!1),a=h):this._tokens.setTokens(this._languageIdentifier.id,h-1,this._buffer.getLineLength(h),o.tokens[d],!0)&&(l=!0,r=h,a=h)}l&&t.push({fromLineNumber:r,toLineNumber:a})}t.length>0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:t})}setSemanticTokens(e,t){this._tokens2.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]})}hasCompleteSemanticTokens(){return this._tokens2.isComplete()}hasSomeSemanticTokens(){return!this._tokens2.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._tokens2.setPartial(e,t);this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._buffer.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._buffer.getLineCount()}]})}_emitModelTokensChangedEvent(e){this._isDisposing||this._onDidChangeTokens.fire(e)}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this.getLineContent(e),i=this._tokens.getTokens(this._languageIdentifier.id,e-1,t);return this._tokens2.addSemanticTokens(e,i)}getLanguageIdentifier(){return this._languageIdentifier}getModeId(){return this._languageIdentifier.language}setMode(e){if(this._languageIdentifier.id===e.id)return;let t={oldLanguage:this._languageIdentifier.language,newLanguage:e.language};this._languageIdentifier=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}getLanguageIdAtPosition(e,t){const i=this.validatePosition(new O(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}getWordAtPosition(e){this._assertNotDisposed();const t=this.validatePosition(e),i=this.getLineContent(t.lineNumber),n=this._getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[r,a]=si._findLanguageBoundaries(n,o),l=pm(t.column,xe.getWordDefinition(n.getLanguageId(o)),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&r===t.column-1){const[d,c]=si._findLanguageBoundaries(n,o-1),h=pm(t.column,xe.getWordDefinition(n.getLanguageId(o-1)),i.substring(d,c),d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn)return h}return null}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)n=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r<a&&e.getLanguageId(r)===i;r++)o=e.getEndOffset(r);return[n,o]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}findMatchingBracketUp(e,t){let i=e.toLowerCase(),n=this.validatePosition(t),o=this._getLineTokens(n.lineNumber),r=o.getLanguageId(o.findTokenIndexAtOffset(n.column-1)),a=xe.getBracketsSupport(r);if(!a)return null;let l=a.textIsBracket[i];return l?Vg(this._findMatchingBracketUp(l,n,null)):null}matchBracket(e){return this._matchBracket(this.validatePosition(e))}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),r=t.getLanguageId(n);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let d=n-1;d>=0;d--){const c=t.getEndOffset(d);if(c<=a)break;if(ho(t.getStandardTokenType(d))||t.getLanguageId(d)!==r){a=c;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let d=n+1;d<o;d++){const c=t.getStartOffset(d);if(c>=l)break;if(ho(t.getStandardTokenType(d))||t.getLanguageId(d)!==r){l=c;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e){const t=e.lineNumber,i=this._getLineTokens(t),n=this._buffer.getLineContent(t),o=i.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const r=xe.getBracketsSupport(i.getLanguageId(o));if(r&&!ho(i.getStandardTokenType(o))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,i,r,o),d=null;for(;;){const c=ds.findNextBracketInRange(r.forwardRegex,t,n,a,l);if(!c)break;if(c.startColumn<=e.column&&e.column<=c.endColumn){const h=n.substring(c.startColumn-1,c.endColumn-1).toLowerCase(),u=this._matchFoundBracket(c,r.textIsBracket[h],r.textIsOpenBracket[h],null);if(u){if(u instanceof nr)return null;d=u}}a=c.endColumn-1}if(d)return d}if(o>0&&i.getStartOffset(o)===e.column-1){const a=o-1,l=xe.getBracketsSupport(i.getLanguageId(a));if(l&&!ho(i.getStandardTokenType(a))){let{searchStartOffset:d,searchEndOffset:c}=this._establishBracketSearchOffsets(e,i,l,a);const h=ds.findPrevBracketInRange(l.reversedRegex,t,n,d,c);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const u=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,l.textIsBracket[u],l.textIsOpenBracket[u],null);if(f)return f instanceof nr?null:f}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof nr?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageIdentifier.id,o=e.reversedRegex;let r=-1,a=0;const l=(d,c,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return nr.INSTANCE;const f=ds.findPrevBracketInRange(o,d,c,h,u);if(!f)break;const g=c.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?r++:e.isClose(g)&&r--,r===0)return f;u=f.startColumn-1}return null};for(let d=t.lineNumber;d>=1;d--){const c=this._getLineTokens(d),h=c.getCount(),u=this._buffer.getLineContent(d);let f=h-1,g=u.length,m=u.length;d===t.lineNumber&&(f=c.findTokenIndexAtOffset(t.column-1),g=t.column-1,m=t.column-1);let b=!0;for(;f>=0;f--){const v=c.getLanguageId(f)===n&&!ho(c.getStandardTokenType(f));if(v)b?g=c.getStartOffset(f):(g=c.getStartOffset(f),m=c.getEndOffset(f));else if(b&&g!==m){const _=l(d,u,g,m);if(_)return _}b=v}if(b&&g!==m){const v=l(d,u,g,m);if(v)return v}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageIdentifier.id,o=e.forwardRegex;let r=1,a=0;const l=(c,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return nr.INSTANCE;const g=ds.findNextBracketInRange(o,c,h,u,f);if(!g)break;const m=h.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(m)?r++:e.isClose(m)&&r--,r===0)return g;u=g.endColumn-1}return null},d=this.getLineCount();for(let c=t.lineNumber;c<=d;c++){const h=this._getLineTokens(c),u=h.getCount(),f=this._buffer.getLineContent(c);let g=0,m=0,b=0;c===t.lineNumber&&(g=h.findTokenIndexAtOffset(t.column-1),m=t.column-1,b=t.column-1);let v=!0;for(;g<u;g++){const _=h.getLanguageId(g)===n&&!ho(h.getStandardTokenType(g));if(_)v||(m=h.getStartOffset(g)),b=h.getEndOffset(g);else if(v&&m!==b){const w=l(c,f,m,b);if(w)return w}v=_}if(v&&m!==b){const _=l(c,f,m,b);if(_)return _}}return null}findPrevBracket(e){const t=this.validatePosition(e);let i=-1,n=null;for(let o=t.lineNumber;o>=1;o--){const r=this._getLineTokens(o),a=r.getCount(),l=this._buffer.getLineContent(o);let d=a-1,c=l.length,h=l.length;if(o===t.lineNumber){d=r.findTokenIndexAtOffset(t.column-1),c=t.column-1,h=t.column-1;const f=r.getLanguageId(d);i!==f&&(i=f,n=xe.getBracketsSupport(i))}let u=!0;for(;d>=0;d--){const f=r.getLanguageId(d);if(i!==f){if(n&&u&&c!==h){const m=ds.findPrevBracketInRange(n.reversedRegex,o,l,c,h);if(m)return this._toFoundBracket(n,m);u=!1}i=f,n=xe.getBracketsSupport(i)}const g=!!n&&!ho(r.getStandardTokenType(d));if(g)u?c=r.getStartOffset(d):(c=r.getStartOffset(d),h=r.getEndOffset(d));else if(n&&u&&c!==h){const m=ds.findPrevBracketInRange(n.reversedRegex,o,l,c,h);if(m)return this._toFoundBracket(n,m)}u=g}if(n&&u&&c!==h){const f=ds.findPrevBracketInRange(n.reversedRegex,o,l,c,h);if(f)return this._toFoundBracket(n,f)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let n=-1,o=null;for(let r=t.lineNumber;r<=i;r++){const a=this._getLineTokens(r),l=a.getCount(),d=this._buffer.getLineContent(r);let c=0,h=0,u=0;if(r===t.lineNumber){c=a.findTokenIndexAtOffset(t.column-1),h=t.column-1,u=t.column-1;const g=a.getLanguageId(c);n!==g&&(n=g,o=xe.getBracketsSupport(n))}let f=!0;for(;c<l;c++){const g=a.getLanguageId(c);if(n!==g){if(o&&f&&h!==u){const b=ds.findNextBracketInRange(o.forwardRegex,r,d,h,u);if(b)return this._toFoundBracket(o,b);f=!1}n=g,o=xe.getBracketsSupport(n)}const m=!!o&&!ho(a.getStandardTokenType(c));if(m)f||(h=a.getStartOffset(c)),u=a.getEndOffset(c);else if(o&&f&&h!==u){const b=ds.findNextBracketInRange(o.forwardRegex,r,d,h,u);if(b)return this._toFoundBracket(o,b)}f=m}if(o&&f&&h!==u){const g=ds.findNextBracketInRange(o.forwardRegex,r,d,h,u);if(g)return this._toFoundBracket(o,g)}}return null}findEnclosingBrackets(e,t){let i;if(typeof t>"u")i=null;else{const f=Date.now();i=()=>Date.now()-f<=t}const n=this.validatePosition(e),o=this.getLineCount(),r=new Map;let a=[];const l=(f,g)=>{if(!r.has(f)){let m=[];for(let b=0,v=g?g.brackets.length:0;b<v;b++)m[b]=0;r.set(f,m)}a=r.get(f)};let d=0;const c=(f,g,m,b,v)=>{for(;;){if(i&&++d%100===0&&!i())return nr.INSTANCE;const _=ds.findNextBracketInRange(f.forwardRegex,g,m,b,v);if(!_)break;const w=m.substring(_.startColumn-1,_.endColumn-1).toLowerCase(),C=f.textIsBracket[w];if(C&&(C.isOpen(w)?a[C.index]++:C.isClose(w)&&a[C.index]--,a[C.index]===-1))return this._matchFoundBracket(_,C,!1,i);b=_.endColumn-1}return null};let h=-1,u=null;for(let f=n.lineNumber;f<=o;f++){const g=this._getLineTokens(f),m=g.getCount(),b=this._buffer.getLineContent(f);let v=0,_=0,w=0;if(f===n.lineNumber){v=g.findTokenIndexAtOffset(n.column-1),_=n.column-1,w=n.column-1;const S=g.getLanguageId(v);h!==S&&(h=S,u=xe.getBracketsSupport(h),l(h,u))}let C=!0;for(;v<m;v++){const S=g.getLanguageId(v);if(h!==S){if(u&&C&&_!==w){const y=c(u,f,b,_,w);if(y)return Vg(y);C=!1}h=S,u=xe.getBracketsSupport(h),l(h,u)}const D=!!u&&!ho(g.getStandardTokenType(v));if(D)C||(_=g.getStartOffset(v)),w=g.getEndOffset(v);else if(u&&C&&_!==w){const y=c(u,f,b,_,w);if(y)return Vg(y)}C=D}if(u&&C&&_!==w){const S=c(u,f,b,_,w);if(S)return Vg(S)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.getValueInRange(t);i=i.toLowerCase();let n=e.textIsBracket[i];return n?{range:t,open:n.open,close:n.close,isOpen:e.textIsOpenBracket[i]}:null}static computeIndentLevel(e,t){let i=0,n=0,o=e.length;for(;n<o;){let r=e.charCodeAt(n);if(r===32)i++;else if(r===9)i=i-i%t+t;else break;n++}return n===o?-1:i}_computeIndentLevel(e){return si.computeIndentLevel(this._buffer.getLineContent(e+1),this._options.tabSize)}getActiveIndentGuide(e,t,i){this._assertNotDisposed();const n=this.getLineCount();if(e<1||e>n)throw new Error("Illegal value for lineNumber");const o=xe.getFoldingRules(this._languageIdentifier.id),r=!!(o&&o.offSide);let a=-2,l=-1,d=-2,c=-1;const h=y=>{if(a!==-1&&(a===-2||a>y-1)){a=-1,l=-1;for(let x=y-2;x>=0;x--){let E=this._computeIndentLevel(x);if(E>=0){a=x,l=E;break}}}if(d===-2){d=-1,c=-1;for(let x=y;x<n;x++){let E=this._computeIndentLevel(x);if(E>=0){d=x,c=E;break}}}};let u=-2,f=-1,g=-2,m=-1;const b=y=>{if(u===-2){u=-1,f=-1;for(let x=y-2;x>=0;x--){let E=this._computeIndentLevel(x);if(E>=0){u=x,f=E;break}}}if(g!==-1&&(g===-2||g<y-1)){g=-1,m=-1;for(let x=y;x<n;x++){let E=this._computeIndentLevel(x);if(E>=0){g=x,m=E;break}}}};let v=0,_=!0,w=0,C=!0,S=0,D=0;for(let y=0;_||C;y++){const x=e-y,E=e+y;y>1&&(x<1||x<t)&&(_=!1),y>1&&(E>n||E>i)&&(C=!1),y>5e4&&(_=!1,C=!1);let P=-1;if(_){const H=this._computeIndentLevel(x-1);H>=0?(d=x-1,c=H,P=Math.ceil(H/this._options.indentSize)):(h(x),P=this._getIndentLevelForWhitespaceLine(r,l,c))}let A=-1;if(C){const H=this._computeIndentLevel(E-1);H>=0?(u=E-1,f=H,A=Math.ceil(H/this._options.indentSize)):(b(E),A=this._getIndentLevelForWhitespaceLine(r,f,m))}if(y===0){D=P;continue}if(y===1){if(E<=n&&A>=0&&D+1===A){_=!1,v=E,w=E,S=A;continue}if(x>=1&&P>=0&&P-1===D){C=!1,v=x,w=x,S=P;continue}if(v=e,w=e,S=D,S===0)return{startLineNumber:v,endLineNumber:w,indent:S}}_&&(P>=S?v=x:_=!1),C&&(A>=S?w=E:C=!1)}return{startLineNumber:v,endLineNumber:w,indent:S}}getLinesIndentGuides(e,t){this._assertNotDisposed();const i=this.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=xe.getFoldingRules(this._languageIdentifier.id),o=!!(n&&n.offSide);let r=new Array(t-e+1),a=-2,l=-1,d=-2,c=-1;for(let h=e;h<=t;h++){let u=h-e;const f=this._computeIndentLevel(h-1);if(f>=0){a=h-1,l=f,r[u]=Math.ceil(f/this._options.indentSize);continue}if(a===-2){a=-1,l=-1;for(let g=h-2;g>=0;g--){let m=this._computeIndentLevel(g);if(m>=0){a=g,l=m;break}}}if(d!==-1&&(d===-2||d<h-1)){d=-1,c=-1;for(let g=h;g<i;g++){let m=this._computeIndentLevel(g);if(m>=0){d=g,c=m;break}}}r[u]=this._getIndentLevelForWhitespaceLine(o,l,c)}return r}_getIndentLevelForWhitespaceLine(e,t,i){return t===-1||i===-1?0:t<i?1+Math.floor(t/this._options.indentSize):t===i?Math.ceil(i/this._options.indentSize):e?Math.ceil(i/this._options.indentSize):1+Math.floor(i/this._options.indentSize)}normalizePosition(e,t){return e}getLineIndentColumn(e){return r7(this.getLineContent(e))+1}}si.MODEL_SYNC_LIMIT=50*1024*1024;si.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;si.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;si.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:pn.tabSize,indentSize:pn.indentSize,insertSpaces:pn.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:pn.trimAutoWhitespace,largeFileOptimizations:pn.largeFileOptimizations};function r7(s){let e=0;for(const t of s)if(t===" "||t===" ")e++;else break;return e}function Lw(s){return!!(s.options.overviewRuler&&s.options.overviewRuler.color)}function xw(s){return!!s.options.after||!!s.options.before}class uI{constructor(){this._decorationsTree0=new vw,this._decorationsTree1=new vw,this._injectedTextDecorationsTree=new vw}intervalSearch(e,t,i,n,o){const r=this._decorationsTree0.intervalSearch(e,t,i,n,o),a=this._decorationsTree1.intervalSearch(e,t,i,n,o),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o);return r.concat(a).concat(l)}getInjectedTextInInterval(e,t,i,n){return this._injectedTextDecorationsTree.intervalSearch(e,t,i,!1,n)}getInjectedText(e,t){return this._injectedTextDecorationsTree.search(e,!1,t)}search(e,t,i,n){if(i)return this._decorationsTree1.search(e,t,n);{const o=this._decorationsTree0.search(e,t,n),r=this._decorationsTree1.search(e,t,n),a=this._injectedTextDecorationsTree.search(e,t,n);return o.concat(r).concat(a)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){xw(e)?this._injectedTextDecorationsTree.insert(e):Lw(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){xw(e)?this._injectedTextDecorationsTree.delete(e):Lw(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}resolveNode(e,t){xw(e)?this._injectedTextDecorationsTree.resolveNode(e,t):Lw(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function Br(s){return s.replace(/[^a-z0-9\-_]/gi," ")}class cA{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class a7 extends cA{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Pn.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;let i=e?t.getColor(e.id):null;return i?i.toString():""}}class l7 extends cA{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?B.fromHex(e):t.getColor(e.id)}}class fI{constructor(e){this.content=e||""}}class De{constructor(e){this.description=e.description,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Br(e.className):null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new a7(e.overviewRuler):null,this.minimap=e.minimap?new l7(e.minimap):null,this.glyphMarginClassName=e.glyphMarginClassName?Br(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Br(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Br(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Br(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Br(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Br(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Br(e.afterContentClassName):null,this.after=e.after?new fI(e.after.content):null,this.before=e.before?new fI(e.before.content):null}static register(e){return new De(e)}static createDynamic(e){return new De(e)}}De.EMPTY=De.register({description:"empty"});const gI=[De.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),De.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),De.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),De.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function pI(s){return s instanceof De?s:De.createDynamic(s)}class d7 extends U{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new M),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;if(this._deferredCnt--,this._deferredCnt===0){if(this._shouldFire){this.handleBeforeFire(this._affectedInjectedTextLines);const t={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler};this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._actual.fire(t)}(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null}}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._shouldFire=!0}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._shouldFire=!0}}class c7 extends U{constructor(){super(),this._fastEmitter=this._register(new M),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new M),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}const h7=()=>!0,mI=()=>!1,u7=s=>s===" "||s===" ";class gs{constructor(e,t,i){this._cursorMoveConfigurationBrand=void 0,this._languageIdentifier=e;const n=i.options,o=n.get(128);this.readOnly=n.get(78),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=n.get(102),this.lineHeight=n.get(56),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=n.get(113),this.wordSeparators=n.get(114),this.emptySelectionClipboard=n.get(30),this.copyWithSyntaxHighlighting=n.get(19),this.multiCursorMergeOverlapping=n.get(66),this.multiCursorPaste=n.get(68),this.autoClosingBrackets=n.get(5),this.autoClosingQuotes=n.get(8),this.autoClosingDelete=n.get(6),this.autoClosingOvertype=n.get(7),this.autoSurround=n.get(11),this.autoIndent=n.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:gs._getShouldAutoClose(e,this.autoClosingQuotes),bracket:gs._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=xe.getAutoClosingPairs(e.id);let r=gs._getSurroundingPairs(e);if(r)for(const a of r)this.surroundingPairs[a.open]=a.close}static shouldRecreate(e){return e.hasChanged(128)||e.hasChanged(114)||e.hasChanged(30)||e.hasChanged(66)||e.hasChanged(68)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(113)||e.hasChanged(56)||e.hasChanged(78)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=gs._getElectricCharacters(this._languageIdentifier);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return si.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return xe.getElectricCharacters(e.id)}catch(t){return ve(t),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return u7;case"languageDefined":return gs._getLanguageDefinedShouldAutoClose(e);case"always":return h7;case"never":return mI}}static _getLanguageDefinedShouldAutoClose(e){try{const t=xe.getAutoCloseBeforeSet(e.id);return i=>t.indexOf(i)!==-1}catch(t){return ve(t),mI}}static _getSurroundingPairs(e){try{return xe.getSurroundingPairs(e.id)}catch(t){return ve(t),null}}}class bi{constructor(e,t,i,n){this._singleCursorStateBrand=void 0,this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=n,this.selection=bi._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new bi(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new O(t,i),n):new bi(new L(t,i,t,i),n,new O(t,i),n)}static _computeSelection(e,t){let i,n,o,r;return e.isEmpty()?(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,r=t.column):t.isBeforeOrEqual(e.getStartPosition())?(i=e.endLineNumber,n=e.endColumn,o=t.lineNumber,r=t.column):(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,r=t.column),new ee(i,n,o,r)}}class _I{constructor(e,t,i){this._cursorContextBrand=void 0,this.model=e,this.coordinatesConverter=t,this.cursorConfig=i}}class f7{constructor(e){this.modelState=e,this.viewState=null}}class g7{constructor(e){this.modelState=null,this.viewState=e}}let Te=class hA{constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}static fromModelState(e){return new f7(e)}static fromViewState(e){return new g7(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,n=e.positionLineNumber,o=e.positionColumn,r=new bi(new L(t,i,t,i),0,new O(n,o),0);return hA.fromModelState(r)}static fromModelSelections(e){let t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}};class cn{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}class it{static visibleColumnFromColumn(e,t,i){const n=e.length,o=t-1<n?t-1:n;let r=0,a=0;for(;a<o;){const l=er(e,o,a);if(a+=l>=65536?2:1,l===9)r=it.nextRenderTabStop(r,i);else{let d=Pd(l);for(;a<o;){const c=er(e,o,a),h=Pd(c);if(_u(d,h))break;a+=c>=65536?2:1,d=h}Ks(l)||mu(l)?r=r+2:r=r+1}}return r}static visibleColumnsByColumns(e,t){const i=e.length;let n=new Array;n.push(-1);let o=0,r=0;for(;r<i;){const a=er(e,i,r);if(r+=a>=65536?2:1,n.push(o),a>=65536&&n.push(o),a===9)o=it.nextRenderTabStop(o,t);else{let l=Pd(a);for(;r<i;){const d=er(e,i,r),c=Pd(d);if(_u(l,c))break;r+=d>=65536?2:1,n.push(o),a>=65536&&n.push(o),l=c}Ks(a)||mu(a)?o=o+2:o=o+1}}return n.push(o),n}static visibleColumnFromColumn2(e,t,i){return this.visibleColumnFromColumn(t.getLineContent(i.lineNumber),i.column,e.tabSize)}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length;let o=0,r=1,a=0;for(;a<n;){const l=er(e,n,a);a+=l>=65536?2:1;let d;if(l===9)d=it.nextRenderTabStop(o,i);else{let h=Pd(l);for(;a<n;){const u=er(e,n,a),f=Pd(u);if(_u(h,f))break;a+=u>=65536?2:1,h=f}Ks(l)||mu(l)?d=o+2:d=o+1}const c=a+1;if(d>=t){const h=t-o;return d-t<h?c:r}o=d,r=c}return n+1}static columnFromVisibleColumn2(e,t,i,n){let o=this.columnFromVisibleColumn(t.getLineContent(i),n,e.tabSize),r=t.getLineMinColumn(i);if(o<r)return r;let a=t.getLineMaxColumn(i);return o>a?a:o}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}function ec(s){return s==="'"||s==='"'||s==="`"}class of{static whitespaceVisibleColumn(e,t,i){const n=e.length;let o=0,r=-1,a=-1;for(let l=0;l<n;l++){if(l===t)return[r,a,o];switch(o%i===0&&(r=l,a=o),e.charCodeAt(l)){case 32:o+=1;break;case 9:o=it.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===n?[r,a,o]:[-1,-1,-1]}static atomicPosition(e,t,i,n){const o=e.length,[r,a,l]=of.whitespaceVisibleColumn(e,t,i);if(l===-1)return-1;let d;switch(n){case 0:d=!0;break;case 1:d=!1;break;case 2:if(l%i===0)return t;d=l%i<=i/2;break}if(d){if(r===-1)return-1;let u=a;for(let f=r;f<o;++f){if(u===a+i)return r;switch(e.charCodeAt(f)){case 32:u+=1;break;case 9:u=it.nextRenderTabStop(u,i);break;default:return-1}}return u===a+i?r:-1}const c=it.nextRenderTabStop(l,i);let h=l;for(let u=t;u<o;u++){if(h===c)return u;switch(e.charCodeAt(u)){case 32:h+=1;break;case 9:h=it.nextRenderTabStop(h,i);break;default:return-1}}return h===c?o:-1}}class $r{constructor(e=null){this.hitTarget=e,this.type=0}}class uA{constructor(e,t){this.position=e,this.spanNode=t,this.type=1}}var ol;(function(s){function e(t,i,n){const o=t.getPositionFromDOMInfo(i,n);return o?new uA(o,i):new $r(i)}s.createFromDOMInfo=e})(ol||(ol={}));class p7{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class Ps{constructor(e,t,i=0,n=null,o=null,r=null){this.element=e,this.type=t,this.mouseColumn=i,this.position=n,!o&&n&&(o=new L(n.lineNumber,n.column,n.lineNumber,n.column)),this.range=o,this.detail=r}static _typeToString(e){return e===1?"TEXTAREA":e===2?"GUTTER_GLYPH_MARGIN":e===3?"GUTTER_LINE_NUMBERS":e===4?"GUTTER_LINE_DECORATIONS":e===5?"GUTTER_VIEW_ZONE":e===6?"CONTENT_TEXT":e===7?"CONTENT_EMPTY":e===8?"CONTENT_VIEW_ZONE":e===9?"CONTENT_WIDGET":e===10?"OVERVIEW_RULER":e===11?"SCROLLBAR":e===12?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+e.detail}toString(){return Ps.toString(this)}}class as{static isTextArea(e){return e.length===2&&e[0]===3&&e[1]===6}static isChildOfViewLines(e){return e.length>=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class jc{constructor(e,t,i){this.model=e.model;const n=e.configuration.options;this.layoutInfo=n.get(128),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(56),this.stickyTabStops=n.get(102),this.typicalHalfwidthCharacterWidth=n.get(40).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return jc.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.model.getLineCount();let r=null,a,l=null;return i.afterLineNumber!==o&&(l=new O(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new O(i.afterLineNumber,e.model.getLineMaxColumn(i.afterLineNumber))),l===null?a=r:r===null?a=l:t<n?a=r:a=l,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:l,position:a}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const n=this._context.model.getLineCount(),o=this._context.model.getLineMaxColumn(n);return{range:new L(n,o,n,o),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.model.getLineMaxColumn(t);return{range:new L(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return jc._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==document.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class m7{constructor(e,t,i){this.editorPos=t,this.pos=i,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+i.y-t.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+i.x-t.x-e.layoutInfo.contentLeft,this.isInMarginArea=i.x-t.x<e.layoutInfo.contentLeft&&i.x-t.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Ni._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class zL extends m7{constructor(e,t,i,n){super(e,t,i),this._ctx=e,n?(this.target=n,this.targetPath=Bo.collect(n,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}
target: ${this.target?this.target.outerHTML:null}`}fulfill(e,t=null,i=null,n=null){let o=this.mouseColumn;return t&&t.column<this._ctx.model.getLineMaxColumn(t.lineNumber)&&(o=it.visibleColumnFromColumn(this._ctx.model.getLineContent(t.lineNumber),t.column,this._ctx.model.getTextModelOptions().tabSize)+1),new Ps(this.target,e,o,t,i,n)}withTarget(e){return new zL(this._ctx,this.editorPos,this.pos,e)}}const bI={isAfterLines:!0};function Dw(s){return{isAfterLines:!1,horizontalDistanceToText:s}}class Ni{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=Bo.collect(t,this._viewHelper.viewDomNode);return!!(as.isChildOfContentWidgets(i)||as.isChildOfOverflowingContentWidgets(i)||as.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,n){const o=new jc(this._context,this._viewHelper,e),r=new zL(o,t,i,n);try{return Ni._createMouseTarget(o,r,!1)}catch{return r.fulfill(0)}}static _createMouseTarget(e,t,i){if(t.target===null){if(i)return t.fulfill(0);const r=Ni._doHitTest(e,t);return r.type===1?Ni.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}const n=t;let o=null;return o=o||Ni._hitTestContentWidget(e,n),o=o||Ni._hitTestOverlayWidget(e,n),o=o||Ni._hitTestMinimap(e,n),o=o||Ni._hitTestScrollbarSlider(e,n),o=o||Ni._hitTestViewZone(e,n),o=o||Ni._hitTestMargin(e,n),o=o||Ni._hitTestViewCursor(e,n),o=o||Ni._hitTestTextArea(e,n),o=o||Ni._hitTestViewLines(e,n,i),o=o||Ni._hitTestScrollbar(e,n),o||t.fulfill(0)}static _hitTestContentWidget(e,t){if(as.isChildOfContentWidgets(t.targetPath)||as.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfill(9,null,null,i):t.fulfill(0)}return null}static _hitTestOverlayWidget(e,t){if(as.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfill(12,null,null,i):t.fulfill(0)}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.fulfill(6,n.position,null,{mightBeForeignElement:!1})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=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<=o&&o<=a+r.height)return t.fulfill(6,r.position,null,{mightBeForeignElement:!1})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfill(n,i.position,null,i)}return null}static _hitTestTextArea(e,t){return as.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfill(6,e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1}):t.fulfill(1,e.lastRenderData.lastTextareaPosition):null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.pos.x-t.editorPos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,n,i.range,r):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,n,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,n,i.range,r)))}return null}static _hitTestViewLines(e,t,i){if(!as.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfill(7,new O(1,1),null,bI);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return t.fulfill(7,new O(o,r),null,bI)}if(i){if(as.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.model.getLineLength(o)===0){const a=e.getLineWidth(o),l=Dw(t.mouseContentHorizontalOffset-a);return t.fulfill(7,new O(o,1),null,l)}const r=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=r){const a=Dw(t.mouseContentHorizontalOffset-r),l=new O(o,e.model.getLineMaxColumn(o));return t.fulfill(7,l,null,a)}}return t.fulfill(0)}const n=Ni._doHitTest(e,t);return n.type===1?Ni.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(as.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new O(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(as.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.model.getLineMaxColumn(n);return t.fulfill(11,new O(n,o))}}return null}static _hitTestScrollbar(e,t){if(as.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new O(i,n))}return null}getMouseColumn(e,t){const i=this._context.configuration.options,n=i.get(128),o=this._context.viewLayout.getCurrentScrollLeft()+t.x-e.x-n.contentLeft;return Ni._getMouseColumn(o,i.get(40).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n){const o=n.lineNumber,r=n.column,a=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>a){const m=Dw(t.mouseContentHorizontalOffset-a);return t.fulfill(7,n,null,m)}const l=e.visibleRangeForPosition(o,r);if(!l)return t.fulfill(0,n);const d=l.left;if(t.mouseContentHorizontalOffset===d)return t.fulfill(6,n,null,{mightBeForeignElement:!1});const c=[];if(c.push({offset:l.left,column:r}),r>1){const m=e.visibleRangeForPosition(o,r-1);m&&c.push({offset:m.left,column:r-1})}const h=e.model.getLineMaxColumn(o);if(r<h){const m=e.visibleRangeForPosition(o,r+1);m&&c.push({offset:m.left,column:r+1})}c.sort((m,b)=>m.offset-b.offset);const u=t.pos.toClientCoordinates(),f=i.getBoundingClientRect(),g=f.left<=u.clientX&&u.clientX<=f.right;for(let m=1;m<c.length;m++){const b=c[m-1],v=c[m];if(b.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=v.offset){const _=new L(o,b.column,o,v.column);return t.fulfill(6,n,_,{mightBeForeignElement:!g})}}return t.fulfill(6,n,null,{mightBeForeignElement:!g})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.getVerticalOffsetForLineNumber(i)+Math.floor(e.lineHeight/2);let r=t.pos.y+(o-t.mouseVerticalOffset);r<=t.editorPos.y&&(r=t.editorPos.y+1),r>=t.editorPos.y+e.layoutInfo.height&&(r=t.editorPos.y+e.layoutInfo.height-1);const a=new OL(t.pos.x,r),l=this._actualDoHitTestWithCaretRangeFromPoint(e,a.toClientCoordinates());return l.type===1?l:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=_h(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=_7(i,t.clientX,t.clientY):n=i.caretRangeFromPoint(t.clientX,t.clientY):n=document.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new $r;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===vo.CLASS_NAME?ol.createFromDOMInfo(e,r,n.startOffset):new $r(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===vo.CLASS_NAME?ol.createFromDOMInfo(e,o,o.textContent.length):new $r(o)}return new $r}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const n=i.offsetNode.parentNode,o=n?n.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===vo.CLASS_NAME?ol.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new $r(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,o=n&&n.nodeType===n.ELEMENT_NODE?n.className:null,r=n?n.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===vo.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return ol.createFromDOMInfo(e,l,0)}else if(a===vo.CLASS_NAME)return ol.createFromDOMInfo(e,i.offsetNode,0)}return new $r(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.getTextModelOptions(),o=of.atomicPosition(i,e.column-1,n,2);return o!==-1?new O(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new $r;return typeof document.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1&&e.stickyTabStops&&(i=new uA(this._snapToSoftTabBoundary(i.position,e.model),i.spanNode)),i}}function _7(s,e,t){const i=document.createRange();let n=s.elementFromPoint(e,t);if(n!==null){for(;n&&n.firstChild&&n.firstChild.nodeType!==n.firstChild.TEXT_NODE&&n.lastChild&&n.lastChild.firstChild;)n=n.lastChild;const o=n.getBoundingClientRect(),r=window.getComputedStyle(n,null).getPropertyValue("font"),a=n.innerText;let l=o.left,d=0,c;if(e>o.left+o.width)d=a.length;else{const h=fl.getInstance();for(let u=0;u<a.length+1;u++){if(c=h.getCharWidth(a.charAt(u),r)/2,l+=c,e<l){d=u;break}l+=c}}i.setStart(n.firstChild,d),i.setEnd(n.firstChild,d)}return i}class fl{constructor(){this._cache={},this._canvas=document.createElement("canvas")}static getInstance(){return fl._INSTANCE||(fl._INSTANCE=new fl),fl._INSTANCE}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const n=this._canvas.getContext("2d");n.font=t;const r=n.measureText(e).width;return this._cache[i]=r,r}}fl._INSTANCE=null;function o_(s){return function(e,t){let i=!1;return s&&(i=s.mouseTargetIsWidget(t)),i||t.preventDefault(),t}}class Bl extends ig{constructor(e,t,i){super(),this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Ni(this._context,i),this._mouseDownOperation=this._register(new b7(this._context,this.viewController,this.viewHelper,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(128).height;const n=new nV(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(n.onMouseMoveThrottled(this.viewHelper.viewDomNode,r=>this._onMouseMove(r),o_(this.mouseTargetFactory),Bl.MOUSE_MOVE_MINIMUM_TIME)),this._register(n.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r)));const o=r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(65))return;const a=new Pc(r);if(Re?(r.metaKey||r.ctrlKey)&&!r.shiftKey&&!r.altKey:r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey){const d=Dr.getZoomLevel(),c=a.deltaY>0?1:-1;Dr.setZoomLevel(d+c),a.preventDefault(),a.stopPropagation()}};this._register(K(this.viewHelper.viewDomNode,le.MOUSE_WHEEL,o,{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(128)){const t=this._context.configuration.options.get(128).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}onScrollChanged(e){return this._mouseDownOperation.onScrollChanged(),!1}getTargetAtClientPoint(e,t){const n=new eA(e,t).toPageCoordinates(),o=tA(this.viewHelper.viewDomNode);return n.y<o.y||n.y>o.y+o.height||n.x<o.x||n.x>o.x+o.width?null:this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,n,null)}_createMouseTarget(e,t){return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,t?e.target:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this.lastMouseLeaveTime=new Date().getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e){const t=this._createMouseTarget(e,!0),i=t.type===6||t.type===7,n=t.type===2||t.type===3||t.type===4,o=t.type===3,r=this._context.configuration.options.get(96),a=t.type===8||t.type===5,l=t.type===9;let d=e.leftButton||e.middleButton;Re&&e.leftButton&&e.ctrlKey&&(d=!1);const c=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(i||o&&r))c(),this._mouseDownOperation.start(t.type,e);else if(n)e.preventDefault();else if(a){const h=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(c(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(c(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}Bl.MOUSE_MOVE_MINIMUM_TIME=100;class b7 extends U{constructor(e,t,i,n,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._createMouseTarget=n,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new oV(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new an),this._mouseState=new Ib,this._currentSelection=new ee(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!0);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):this._dispatchMouse(t,!0))}start(e,t){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const i=this._findMousePosition(t,!0);if(!i||!i.position)return;this._mouseState.trySetCount(t.detail,i.position),t.detail=this._mouseState.count;const n=this._context.configuration.options;if(!n.get(78)&&n.get(29)&&!n.get(16)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&i.type===6&&i.position&&this._currentSelection.containsPosition(i.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,o_(null),o=>this._onMouseDownThenMove(o),o=>{const r=this._findMousePosition(this._lastMouseEvent,!0);o&&o instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:r?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(i,t.shiftKey),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,o_(null),o=>this._onMouseDownThenMove(o),()=>this._stop()))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onScrollChanged(){this._isActive&&this._onScrollTimeout.setIfNotSet(()=>{if(!this._lastMouseEvent)return;const e=this._findMousePosition(this._lastMouseEvent,!1);e&&(this._mouseState.isDragAndDrop||this._dispatchMouse(e,!0))},10)}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.model,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const a=Math.max(n.getCurrentScrollTop()-(t.y-e.posy),0),l=jc.getZoneAtCoord(this._context,a);if(l){const c=this._helpPositionJumpOverViewZone(l);if(c)return new Ps(null,13,o,c)}const d=n.getLineNumberAtVerticalOffset(a);return new Ps(null,13,o,new O(d,1))}if(e.posy>t.y+t.height){const a=n.getCurrentScrollTop()+(e.posy-t.y),l=jc.getZoneAtCoord(this._context,a);if(l){const c=this._helpPositionJumpOverViewZone(l);if(c)return new Ps(null,13,o,c)}const d=n.getLineNumberAtVerticalOffset(a);return new Ps(null,13,o,new O(d,i.getLineMaxColumn(d)))}const r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+(e.posy-t.y));return e.posx<t.x?new Ps(null,13,o,new O(r,1)):e.posx>t.x+t.width?new Ps(null,13,o,new O(r,i.getLineMaxColumn(r))):null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(n.type===8||n.type===5){const r=this._helpPositionJumpOverViewZone(n.detail);if(r)return new Ps(n.element,n.type,n.mouseColumn,r,null,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new O(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton})}}class Ib{constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>Ib.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}Ib.CLEAR_MOUSE_DOWN_COUNT_TIME=400;var ms;(function(s){s.text="text/plain",s.binary="application/octet-stream",s.unknown="application/unknown",s.markdown="text/markdown"})(ms||(ms={}));let r_=[],fA=[],gA=[];function Hg(s,e=!1){const t=v7(s);r_.push(t),t.userConfigured?gA.push(t):fA.push(t),e&&!t.userConfigured&&r_.forEach(i=>{i.mime===t.mime||i.userConfigured||(t.extension&&i.extension===t.extension&&console.warn(`Overwriting extension <<${t.extension}>> to now point to mime <<${t.mime}>>`),t.filename&&i.filename===t.filename&&console.warn(`Overwriting filename <<${t.filename}>> to now point to mime <<${t.mime}>>`),t.filepattern&&i.filepattern===t.filepattern&&console.warn(`Overwriting filepattern <<${t.filepattern}>> to now point to mime <<${t.mime}>>`),t.firstline&&i.firstline===t.firstline&&console.warn(`Overwriting firstline <<${t.firstline}>> to now point to mime <<${t.mime}>>`))})}function v7(s){return{id:s.id,mime:s.mime,filename:s.filename,extension:s.extension,filepattern:s.filepattern,firstline:s.firstline,userConfigured:s.userConfigured,filenameLowercase:s.filename?s.filename.toLowerCase():void 0,extensionLowercase:s.extension?s.extension.toLowerCase():void 0,filepatternLowercase:s.filepattern?s.filepattern.toLowerCase():void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(Yt.sep)>=0:!1}}function w7(s,e){let t;if(s)switch(s.scheme){case Oe.file:t=s.fsPath;break;case Oe.data:t=_a.parseMetaData(s).get(_a.META_DATA_LABEL);break;default:t=s.path}if(!t)return[ms.unknown];t=t.toLowerCase();const i=bl(t),n=vI(t,i,gA);if(n)return[n,ms.text];const o=vI(t,i,fA);if(o)return[o,ms.text];if(e){const r=C7(e);if(r)return[r,ms.text]}return[ms.unknown]}function vI(s,e,t){let i=null,n=null,o=null;for(let r=t.length-1;r>=0;r--){const a=t[r];if(e===a.filenameLowercase){i=a;break}if(a.filepattern&&(!n||a.filepattern.length>n.filepattern.length)){const l=a.filepatternOnPath?s:e;tT(a.filepatternLowercase,l)&&(n=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&e.endsWith(a.extensionLowercase)&&(o=a)}return i?i.mime:n?n.mime:o?o.mime:null}function C7(s){if(iL(s)&&(s=s.substr(1)),s.length>0)for(let e=r_.length-1;e>=0;e--){const t=r_[e];if(!t.firstline)continue;const i=s.match(t.firstline);if(i&&i.length>0)return t.mime}return null}class ni{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selectionStartPosition=n,this.selectionEndPosition=o}toString(){return"[ <"+this.value+">, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"}static readFromTextArea(e){return new ni(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new ni(this.value,this.value.length,this.value.length,null,null)}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.selectionStartPosition,n,-1)}if(e>=this.selectionEnd){const n=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,n,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(this.selectionStartPosition,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;(o=t.indexOf(`
`,o+1))!==-1;)n++;return[e,i*t.length,n]}static selectedText(e){return new ni(e,0,e.length,null,null)}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};let n=e.value,o=e.selectionStart,r=e.selectionEnd,a=t.value,l=t.selectionStart,d=t.selectionEnd;const c=n.substring(r),h=a.substring(d),u=X0(c,h);a=a.substring(0,a.length-u),n=n.substring(0,n.length-u);const f=n.substring(0,o),g=a.substring(0,l),m=ju(f,g);if(a=a.substring(m),n=n.substring(m),l-=m,o-=m,d-=m,r-=m,i&&l===d&&n.length>0){let v=null;if(l===a.length?a.startsWith(n)&&(v=a.substring(n.length)):a.endsWith(n)&&(v=a.substring(0,a.length-n.length)),v!==null&&v.length>0&&(/\uFE0F/.test(v)||D5(v)))return{text:v,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0}}if(l===d){if(n===a&&o===0&&r===n.length&&l===a.length&&a.indexOf(`
`)===-1&&I5(a))return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const v=f.length-m;return{text:a,replacePrevCharCnt:v,replaceNextCharCnt:0,positionDelta:0}}const b=r-o;return{text:a,replacePrevCharCnt:b,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(ju(e.value,t.value),e.selectionEnd),n=Math.min(X0(e.value,t.value),e.value.length-e.selectionEnd),o=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:o.length-a,positionDelta:l-r.length}}}ni.EMPTY=new ni("",0,0,null,null);class rc{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new L(n,1,o+1,1)}static fromEditorSelection(e,t,i,n,o){const r=rc._getPageOfLine(i.startLineNumber,n),a=rc._getRangeForPage(r,n),l=rc._getPageOfLine(i.endLineNumber,n),d=rc._getRangeForPage(l,n),c=a.intersectRanges(new L(1,1,i.startLineNumber,i.startColumn));let h=t.getValueInRange(c,1);const u=t.getLineCount(),f=t.getLineMaxColumn(u),g=d.intersectRanges(new L(i.endLineNumber,i.endColumn,u,f));let m=t.getValueInRange(g,1),b;if(r===l||r+1===l)b=t.getValueInRange(i,1);else{const v=a.intersectRanges(i),_=d.intersectRanges(i);b=t.getValueInRange(v,1)+"…"+t.getValueInRange(_,1)}return o&&(h.length>500&&(h=h.substring(h.length-500,h.length)),m.length>500&&(m=m.substring(0,500)),b.length>2*500&&(b=b.substring(0,500)+"…"+b.substring(b.length-500,b.length))),new ni(h+b+m,h.length,h.length+b.length,new O(i.startLineNumber,i.startColumn),new O(i.endLineNumber,i.endColumn))}}var a_;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(a_||(a_={}));const kS={forceCopyWithSyntaxHighlighting:!1};class rf{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}rf.INSTANCE=new rf;class S7 extends U{constructor(e,t){super(),this.textArea=t,this._onFocus=this._register(new M),this.onFocus=this._onFocus.event,this._onBlur=this._register(new M),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new M),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new M),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new M),this.onCut=this._onCut.event,this._onPaste=this._register(new M),this.onPaste=this._onPaste.event,this._onType=this._register(new M),this.onType=this._onType.event,this._onCompositionStart=this._register(new M),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new M),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new M),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new M),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._host=e,this._textArea=this._register(new y7(t)),this._asyncTriggerCut=this._register(new bt(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new bt(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=ni.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._isDoingComposition=!1,this._nextCommand=0;let i=null;this._register(Gt(t.domNode,"keydown",a=>{(a.keyCode===109||this._isDoingComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),i=a,this._onKeyDown.fire(a)})),this._register(Gt(t.domNode,"keyup",a=>{this._onKeyUp.fire(a)})),this._register(K(t.domNode,"compositionstart",a=>{if(!this._isDoingComposition){if(this._isDoingComposition=!0,Re&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===a.data&&(i&&i.equals(109)&&(i.code==="ArrowRight"||i.code==="ArrowLeft")||qi)){this._textAreaState=new ni(this._textAreaState.value,this._textAreaState.selectionStart-1,this._textAreaState.selectionEnd,this._textAreaState.selectionStartPosition?new O(this._textAreaState.selectionStartPosition.lineNumber,this._textAreaState.selectionStartPosition.column-1):null,this._textAreaState.selectionEndPosition),this._onCompositionStart.fire({revealDeltaColumns:-1});return}if(su){this._onCompositionStart.fire({revealDeltaColumns:-this._textAreaState.selectionStart});return}this._setAndWriteTextAreaState("compositionstart",ni.EMPTY),this._onCompositionStart.fire({revealDeltaColumns:0})}}));const n=a=>{const l=this._textAreaState,d=ni.readFromTextArea(this._textArea);return[d,ni.deduceInput(l,d,a)]},o=()=>{const a=this._textAreaState,l=ni.readFromTextArea(this._textArea);return[l,ni.deduceAndroidCompositionInput(a,l)]},r=a=>{const l=this._textAreaState,d=ni.selectedText(a),c={text:d.value,replacePrevCharCnt:l.selectionEnd-l.selectionStart,replaceNextCharCnt:0,positionDelta:0};return[d,c]};this._register(K(t.domNode,"compositionupdate",a=>{if(su){const[c,h]=o();this._textAreaState=c,this._onType.fire(h),this._onCompositionUpdate.fire(a);return}const[l,d]=r(a.data||"");this._textAreaState=l,this._onType.fire(d),this._onCompositionUpdate.fire(a)})),this._register(K(t.domNode,"compositionend",a=>{if(!this._isDoingComposition)return;if(this._isDoingComposition=!1,su){const[c,h]=o();this._textAreaState=c,this._onType.fire(h),this._onCompositionEnd.fire();return}const[l,d]=r(a.data||"");this._textAreaState=l,this._onType.fire(d),(wm||qi)&&(this._textAreaState=ni.readFromTextArea(this._textArea)),this._onCompositionEnd.fire()})),this._register(K(t.domNode,"input",()=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._isDoingComposition)return;const[a,l]=n(Re);l.replacePrevCharCnt===0&&l.text.length===1&&di(l.text.charCodeAt(0))||(this._textAreaState=a,this._nextCommand===0?(l.text!==""||l.replacePrevCharCnt!==0)&&this._onType.fire(l):((l.text!==""||l.replacePrevCharCnt!==0)&&this._firePaste(l.text,null),this._nextCommand=0))})),this._register(K(t.domNode,"cut",a=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(a),this._asyncTriggerCut.schedule()})),this._register(K(t.domNode,"copy",a=>{this._ensureClipboardGetsEditorSelection(a)})),this._register(K(t.domNode,"paste",a=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),Hh.canUseTextData(a)){const[l,d]=Hh.getTextData(a);l!==""&&this._firePaste(l,d)}else this._textArea.getSelectionStart()!==this._textArea.getSelectionEnd()&&this._setAndWriteTextAreaState("paste",ni.EMPTY),this._nextCommand=1})),this._register(K(t.domNode,"focus",()=>{const a=this._hasFocus;this._setHasFocus(!0),Oc&&!a&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(K(t.domNode,"blur",()=>{this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(K(t.domNode,a_.Tap,()=>{su&&this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return K(document,"selectionchange",t=>{if(!this._hasFocus||this._isDoingComposition||!wm)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selectionStartPosition||!this._textAreaState.selectionEndPosition)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const d=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(d[0],d[1],d[2]),h=this._textAreaState.deduceEditorPosition(l),u=this._host.deduceModelPosition(h[0],h[1],h[2]),f=new ee(c.lineNumber,c.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){const e=_h(this.textArea.domNode);e?this._setHasFocus(e.activeElement===this.textArea.domNode):jy(this.textArea.domNode)?this._setHasFocus(document.activeElement===this.textArea.domNode):this._setHasFocus(!1)}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(Hh.canUseTextData(e)),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};if(rf.INSTANCE.set(qi?t.text.replace(/\r\n/g,`
`):t.text,i),!Hh.canUseTextData(e)){this._setAndWriteTextAreaState("copy or cut",ni.selectedText(t.text));return}Hh.setTextData(e,t.text,t.html,i)}_firePaste(e,t){t||(t=rf.INSTANCE.get(e)),this._onPaste.fire({text:e,metadata:t})}}class Hh{static canUseTextData(e){return!!(e.clipboardData||window.clipboardData)}static getTextData(e){if(e.clipboardData){e.preventDefault();const t=e.clipboardData.getData(ms.text);let i=null;const n=e.clipboardData.getData("vscode-editor-data");if(typeof n=="string")try{i=JSON.parse(n),i.version!==1&&(i=null)}catch{}return[t,i]}if(window.clipboardData)return e.preventDefault(),[window.clipboardData.getData("Text"),null];throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")}static setTextData(e,t,i,n){if(e.clipboardData){e.clipboardData.setData(ms.text,t),typeof i=="string"&&e.clipboardData.setData("text/html",i),e.clipboardData.setData("vscode-editor-data",JSON.stringify(n)),e.preventDefault();return}if(window.clipboardData){window.clipboardData.setData("Text",t),e.preventDefault();return}throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")}}class y7 extends U{constructor(e){super(),this._actual=e,this._ignoreSelectionChangeTime=0}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.domNode.value}setValue(e,t){const i=this._actual.domNode;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.domNode.selectionDirection==="backward"?this._actual.domNode.selectionEnd:this._actual.domNode.selectionStart}getSelectionEnd(){return this._actual.domNode.selectionDirection==="backward"?this._actual.domNode.selectionStart:this._actual.domNode.selectionEnd}setSelectionRange(e,t,i){const n=this._actual.domNode;let o=null;const r=_h(n);r?o=r.activeElement:o=document.activeElement;const a=o===n,l=n.selectionStart,d=n.selectionEnd;if(a&&l===t&&d===i){qi&&window.parent!==window&&n.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),qi&&window.parent!==window&&n.focus();return}try{const c=h5(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),u5(n,c)}catch{}}}class L7 extends Bl{constructor(e,t,i){super(e,t,i),this._register(ot.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,vt.Tap,o=>this.onTap(o))),this._register(K(this.viewHelper.linesContentDomNode,vt.Change,o=>this.onChange(o))),this._register(K(this.viewHelper.linesContentDomNode,vt.Contextmenu,o=>this._onContextMenu(new Fl(o,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(K(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new sV(this.viewHelper.viewDomNode);this._register(n.onPointerMoveThrottled(this.viewHelper.viewDomNode,o=>this._onMouseMove(o),o_(this.mouseTargetFactory),Bl.MOUSE_MOVE_MINIMUM_TIME)),this._register(n.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,o=>this._onMouseDown(o)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Fl(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1})}onChange(e){this._lastPointerType==="touch"&&this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e)}}class x7 extends Bl{constructor(e,t,i){super(e,t,i),this._register(ot.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,vt.Tap,n=>this.onTap(n))),this._register(K(this.viewHelper.linesContentDomNode,vt.Change,n=>this.onChange(n))),this._register(K(this.viewHelper.linesContentDomNode,vt.Contextmenu,n=>this._onContextMenu(new Fl(n,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Fl(e,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(a_.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position)}}onChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}}class D7 extends U{constructor(e,t,i){super(),To&&J_.pointerEvents?this.handler=this._register(new L7(e,t,i)):window.TouchEvent?this.handler=this._register(new x7(e,t,i)):this.handler=this._register(new Bl(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Sh extends ig{}const pA={ColorContribution:"base.contributions.colors"};class k7{constructor(){this._onDidChangeSchema=new M,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){let r={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=r;let a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const n=i.defaults[t.type];return qr(n,t)}}getColorSchema(){return this.colorSchema}toString(){let e=(t,i)=>{let n=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return n!==o?n-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(`
`)}}const Eb=new k7;Ht.add(pA.ColorContribution,Eb);function T(s,e,t,i,n){return Eb.registerColor(s,e,t,i,n)}const ue=T("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},p("foreground","Overall foreground color. This color is only used if not overridden by a component.")),I7=T("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},p("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),kw=T("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},p("iconForeground","The default color for icons in the workbench.")),Ca=T("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},p("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Xt=T("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Vi=T("contrastActiveBorder",{light:null,dark:null,hc:Ca},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),ng=T("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},p("textLinkForeground","Foreground color for links in text.")),E7=T("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover.")),UL=T("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:B.black},p("textCodeBlockBackground","Background color for code blocks in text.")),Sa=T("widget.shadow",{dark:ui(B.black,.36),light:ui(B.black,.16),hc:null},p("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),$L=T("input.background",{dark:"#3C3C3C",light:B.white,hc:B.black},p("inputBoxBackground","Input box background.")),jL=T("input.foreground",{dark:ue,light:ue,hc:ue},p("inputBoxForeground","Input box foreground.")),qL=T("input.border",{dark:null,light:null,hc:Xt},p("inputBoxBorder","Input box border.")),IS=T("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:Xt},p("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),ES=T("inputOption.activeBackground",{dark:ui(Ca,.4),light:ui(Ca,.2),hc:B.transparent},p("inputOption.activeBackground","Background color of activated options in input fields.")),NS=T("inputOption.activeForeground",{dark:B.white,light:B.black,hc:null},p("inputOption.activeForeground","Foreground color of activated options in input fields.")),KL=T("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:B.black},p("inputValidationInfoBackground","Input validation background color for information severity.")),GL=T("inputValidation.infoForeground",{dark:null,light:null,hc:null},p("inputValidationInfoForeground","Input validation foreground color for information severity.")),ZL=T("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:Xt},p("inputValidationInfoBorder","Input validation border color for information severity.")),mA=T("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:B.black},p("inputValidationWarningBackground","Input validation background color for warning severity.")),_A=T("inputValidation.warningForeground",{dark:null,light:null,hc:null},p("inputValidationWarningForeground","Input validation foreground color for warning severity.")),bA=T("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:Xt},p("inputValidationWarningBorder","Input validation border color for warning severity.")),vA=T("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:B.black},p("inputValidationErrorBackground","Input validation background color for error severity.")),wA=T("inputValidation.errorForeground",{dark:null,light:null,hc:null},p("inputValidationErrorForeground","Input validation foreground color for error severity.")),CA=T("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:Xt},p("inputValidationErrorBorder","Input validation border color for error severity.")),Iw=T("dropdown.background",{dark:"#3C3C3C",light:B.white,hc:B.black},p("dropdownBackground","Dropdown background.")),wI=T("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:B.white},p("dropdownForeground","Dropdown foreground.")),N7=T("button.foreground",{dark:B.white,light:B.white,hc:B.white},p("buttonForeground","Button foreground color.")),MS=T("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},p("buttonBackground","Button background color.")),M7=T("button.hoverBackground",{dark:MA(MS,.2),light:NA(MS,.2),hc:null},p("buttonHoverBackground","Button background color when hovering.")),SA=T("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:B.black},p("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),yA=T("badge.foreground",{dark:B.white,light:"#333",hc:B.white},p("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Nb=T("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},p("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),Pp=T("scrollbarSlider.background",{dark:B.fromHex("#797979").transparent(.4),light:B.fromHex("#646464").transparent(.4),hc:ui(Xt,.6)},p("scrollbarSliderBackground","Scrollbar slider background color.")),Fp=T("scrollbarSlider.hoverBackground",{dark:B.fromHex("#646464").transparent(.7),light:B.fromHex("#646464").transparent(.7),hc:ui(Xt,.8)},p("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),Bp=T("scrollbarSlider.activeBackground",{dark:B.fromHex("#BFBFBF").transparent(.4),light:B.fromHex("#000000").transparent(.6),hc:Xt},p("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),T7=T("progressBar.background",{dark:B.fromHex("#0E70C0"),light:B.fromHex("#0E70C0"),hc:Xt},p("progressBarBackground","Background color of the progress bar that can show for long running operations.")),A7=T("editorError.background",{dark:null,light:null,hc:null},p("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Eu=T("editorError.foreground",{dark:"#F48771",light:"#E51400",hc:null},p("editorError.foreground","Foreground color of error squigglies in the editor.")),LA=T("editorError.border",{dark:null,light:null,hc:B.fromHex("#E47777").transparent(.8)},p("errorBorder","Border color of error boxes in the editor.")),R7=T("editorWarning.background",{dark:null,light:null,hc:null},p("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),vr=T("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hc:null},p("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Mb=T("editorWarning.border",{dark:null,light:null,hc:B.fromHex("#FFCC00").transparent(.8)},p("warningBorder","Border color of warning boxes in the editor.")),O7=T("editorInfo.background",{dark:null,light:null,hc:null},p("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Cl=T("editorInfo.foreground",{dark:"#75BEFF",light:"#75BEFF",hc:null},p("editorInfo.foreground","Foreground color of info squigglies in the editor.")),YL=T("editorInfo.border",{dark:null,light:null,hc:B.fromHex("#75BEFF").transparent(.8)},p("infoBorder","Border color of info boxes in the editor.")),P7=T("editorHint.foreground",{dark:B.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},p("editorHint.foreground","Foreground color of hint squigglies in the editor.")),F7=T("editorHint.border",{dark:null,light:null,hc:B.fromHex("#eeeeee").transparent(.8)},p("hintBorder","Border color of hint boxes in the editor.")),Eo=T("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:B.black},p("editorBackground","Editor background color.")),ca=T("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:B.white},p("editorForeground","Editor default foreground color.")),Ki=T("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},p("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Ds=T("editorWidget.foreground",{dark:ue,light:ue,hc:ue},p("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Sl=T("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:Xt},p("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),B7=T("editorWidget.resizeBorder",{light:null,dark:null,hc:null},p("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),CI=T("quickInput.background",{dark:Ki,light:Ki,hc:Ki},p("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),W7=T("quickInput.foreground",{dark:Ds,light:Ds,hc:Ds},p("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),V7=T("quickInputTitle.background",{dark:new B(new Ve(255,255,255,.105)),light:new B(new Ve(0,0,0,.06)),hc:"#000000"},p("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),H7=T("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:B.white},p("pickerGroupForeground","Quick picker color for grouping labels.")),z7=T("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:B.white},p("pickerGroupBorder","Quick picker color for grouping borders.")),U7=T("keybindingLabel.background",{dark:new B(new Ve(128,128,128,.17)),light:new B(new Ve(221,221,221,.4)),hc:B.transparent},p("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),$7=T("keybindingLabel.foreground",{dark:B.fromHex("#CCCCCC"),light:B.fromHex("#555555"),hc:B.white},p("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),j7=T("keybindingLabel.border",{dark:new B(new Ve(51,51,51,.6)),light:new B(new Ve(204,204,204,.4)),hc:new B(new Ve(111,195,223))},p("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),q7=T("keybindingLabel.bottomBorder",{dark:new B(new Ve(68,68,68,.6)),light:new B(new Ve(187,187,187,.4)),hc:new B(new Ve(111,195,223))},p("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),ha=T("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},p("editorSelectionBackground","Color of the editor selection.")),K7=T("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},p("editorSelectionForeground","Color of the selected text for high contrast.")),XL=T("editor.inactiveSelectionBackground",{light:ui(ha,.5),dark:ui(ha,.5),hc:ui(ha,.5)},p("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),QL=T("editor.selectionHighlightBackground",{light:LI(ha,Eo,.3,.6),dark:LI(ha,Eo,.3,.6),hc:null},p("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),G7=T("editor.selectionHighlightBorder",{light:null,dark:null,hc:Vi},p("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),Z7=T("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},p("editorFindMatch","Color of the current search match.")),TS=T("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},p("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Y7=T("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},p("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),X7=T("editor.findMatchBorder",{light:null,dark:null,hc:Vi},p("editorFindMatchBorder","Border color of the current search match.")),Q7=T("editor.findMatchHighlightBorder",{light:null,dark:null,hc:Vi},p("findMatchHighlightBorder","Border color of the other search matches.")),J7=T("editor.findRangeHighlightBorder",{dark:null,light:null,hc:ui(Vi,.4)},p("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),e8=T("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},p("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),Wl=T("editorHoverWidget.background",{light:Ki,dark:Ki,hc:Ki},p("hoverBackground","Background color of the editor hover.")),JL=T("editorHoverWidget.foreground",{light:Ds,dark:Ds,hc:Ds},p("hoverForeground","Foreground color of the editor hover.")),ex=T("editorHoverWidget.border",{light:Sl,dark:Sl,hc:Sl},p("hoverBorder","Border color of the editor hover.")),t8=T("editorHoverWidget.statusBarBackground",{dark:MA(Wl,.2),light:NA(Wl,.05),hc:Ki},p("statusBarBackground","Background color of the editor hover status bar.")),tx=T("editorLink.activeForeground",{dark:"#4E94CE",light:B.blue,hc:B.cyan},p("activeLinkForeground","Color of active links.")),i8=T("editorInlayHint.foreground",{dark:Ki,light:Ds,hc:Ki},p("editorInlayHintForeground","Foreground color of inline hints")),n8=T("editorInlayHint.background",{dark:Ds,light:Ki,hc:Ds},p("editorInlayHintBackground","Background color of inline hints")),s8=T("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},p("editorLightBulbForeground","The color used for the lightbulb actions icon.")),o8=T("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},p("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),AS=new B(new Ve(155,185,85,.2)),RS=new B(new Ve(255,0,0,.2)),xA=T("diffEditor.insertedTextBackground",{dark:AS,light:AS,hc:null},p("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),DA=T("diffEditor.removedTextBackground",{dark:RS,light:RS,hc:null},p("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),r8=T("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},p("diffEditorInsertedOutline","Outline color for the text that got inserted.")),a8=T("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},p("diffEditorRemovedOutline","Outline color for text that got removed.")),l8=T("diffEditor.border",{dark:null,light:null,hc:Xt},p("diffEditorBorder","Border color between the two text editors.")),d8=T("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},p("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),c8=T("list.focusBackground",{dark:null,light:null,hc:null},p("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),h8=T("list.focusForeground",{dark:null,light:null,hc:null},p("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),u8=T("list.focusOutline",{dark:Ca,light:Ca,hc:Vi},p("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),yl=T("list.activeSelectionBackground",{dark:"#094771",light:"#0060C0",hc:null},p("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),ua=T("list.activeSelectionForeground",{dark:B.white,light:B.white,hc:null},p("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Wp=T("list.activeSelectionIconForeground",{dark:null,light:null,hc:null},p("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),f8=T("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},p("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),g8=T("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},p("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),p8=T("list.inactiveSelectionIconForeground",{dark:null,light:null,hc:null},p("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),m8=T("list.inactiveFocusBackground",{dark:null,light:null,hc:null},p("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),_8=T("list.inactiveFocusOutline",{dark:null,light:null,hc:null},p("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),b8=T("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},p("listHoverBackground","List/Tree background when hovering over items using the mouse.")),v8=T("list.hoverForeground",{dark:null,light:null,hc:null},p("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),w8=T("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},p("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),kc=T("list.highlightForeground",{dark:"#18A3FF",light:"#0066BF",hc:Ca},p("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),Vp=T("list.focusHighlightForeground",{dark:kc,light:kc,hc:kc},p("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),C8=T("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:B.black},p("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),S8=T("listFilterWidget.outline",{dark:B.transparent,light:B.transparent,hc:"#f38518"},p("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),y8=T("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:Xt},p("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),L8=T("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},p("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),x8=T("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hc:null},p("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),SI=T("quickInput.list.focusBackground",{dark:null,light:null,hc:null},"",void 0,p("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),Hp=T("quickInputList.focusForeground",{dark:ua,light:ua,hc:ua},p("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),zp=T("quickInputList.focusIconForeground",{dark:Wp,light:Wp,hc:Wp},p("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),Up=T("quickInputList.focusBackground",{dark:af(SI,yl,"#062F4A"),light:af(SI,yl,"#D6EBFF"),hc:null},p("quickInput.listFocusBackground","Quick picker background color for the focused item.")),D8=T("menu.border",{dark:null,light:null,hc:Xt},p("menuBorder","Border color of menus.")),k8=T("menu.foreground",{dark:wI,light:ue,hc:wI},p("menuForeground","Foreground color of menu items.")),I8=T("menu.background",{dark:Iw,light:Iw,hc:Iw},p("menuBackground","Background color of menu items.")),E8=T("menu.selectionForeground",{dark:ua,light:ua,hc:ua},p("menuSelectionForeground","Foreground color of the selected menu item in menus.")),N8=T("menu.selectionBackground",{dark:yl,light:yl,hc:yl},p("menuSelectionBackground","Background color of the selected menu item in menus.")),M8=T("menu.selectionBorder",{dark:null,light:null,hc:Vi},p("menuSelectionBorder","Border color of the selected menu item in menus.")),T8=T("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:Xt},p("menuSeparatorBackground","Color of a separator menu item in menus.")),A8=T("editor.snippetTabstopHighlightBackground",{dark:new B(new Ve(124,124,124,.3)),light:new B(new Ve(10,50,100,.2)),hc:new B(new Ve(124,124,124,.3))},p("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),R8=T("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},p("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),O8=T("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},p("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),P8=T("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new B(new Ve(10,50,100,.5)),hc:"#525252"},p("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),ix=T("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},p("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),kA=T("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},p("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),IA=T("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},p("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),yI=T("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},p("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),F8=T("minimap.errorHighlight",{dark:new B(new Ve(255,18,18,.7)),light:new B(new Ve(255,18,18,.7)),hc:new B(new Ve(255,50,50,1))},p("minimapError","Minimap marker color for errors.")),B8=T("minimap.warningHighlight",{dark:vr,light:vr,hc:Mb},p("overviewRuleWarning","Minimap marker color for warnings.")),EA=T("minimap.background",{dark:null,light:null,hc:null},p("minimapBackground","Minimap background color.")),W8=T("minimapSlider.background",{light:ui(Pp,.5),dark:ui(Pp,.5),hc:ui(Pp,.5)},p("minimapSliderBackground","Minimap slider background color.")),V8=T("minimapSlider.hoverBackground",{light:ui(Fp,.5),dark:ui(Fp,.5),hc:ui(Fp,.5)},p("minimapSliderHoverBackground","Minimap slider background color when hovering.")),H8=T("minimapSlider.activeBackground",{light:ui(Bp,.5),dark:ui(Bp,.5),hc:ui(Bp,.5)},p("minimapSliderActiveBackground","Minimap slider background color when clicked on.")),z8=T("problemsErrorIcon.foreground",{dark:Eu,light:Eu,hc:Eu},p("problemsErrorIconForeground","The color used for the problems error icon.")),U8=T("problemsWarningIcon.foreground",{dark:vr,light:vr,hc:vr},p("problemsWarningIconForeground","The color used for the problems warning icon.")),$8=T("problemsInfoIcon.foreground",{dark:Cl,light:Cl,hc:Cl},p("problemsInfoIconForeground","The color used for the problems info icon."));function j8(s,e){var t,i,n;switch(s.op){case 0:return(t=qr(s.value,e))===null||t===void 0?void 0:t.darken(s.factor);case 1:return(i=qr(s.value,e))===null||i===void 0?void 0:i.lighten(s.factor);case 2:return(n=qr(s.value,e))===null||n===void 0?void 0:n.transparent(s.factor);case 3:for(const a of s.values){const l=qr(a,e);if(l)return l}return;case 4:const o=qr(s.value,e);if(!o)return;const r=qr(s.background,e);return r?o.isDarkerThan(r)?B.getLighterColor(o,r,s.factor).transparent(s.transparency):B.getDarkerColor(o,r,s.factor).transparent(s.transparency):o.transparent(s.factor*s.transparency);default:throw e3()}}function NA(s,e){return{op:0,value:s,factor:e}}function MA(s,e){return{op:1,value:s,factor:e}}function ui(s,e){return{op:2,value:s,factor:e}}function af(...s){return{op:3,values:s}}function LI(s,e,t,i){return{op:4,value:s,background:e,factor:t,transparency:i}}function qr(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?B.fromHex(s):e.getColor(s);if(s instanceof B)return s;if(typeof s=="object")return j8(s,e)}}const TA="vscode://schemas/workbench-colors";let AA=Ht.as(gb.JSONContribution);AA.registerSchema(TA,Eb.getColorSchema());const xI=new bt(()=>AA.notifySchemaChanged(TA),200);Eb.onDidChangeSchema(()=>{xI.isScheduled()||xI.schedule()});const q8=T("editor.lineHighlightBackground",{dark:null,light:null,hc:null},p("lineHighlight","Background color for the highlight of line at the cursor position.")),DI=T("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},p("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),K8=T("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},p("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),G8=T("editor.rangeHighlightBorder",{dark:null,light:null,hc:Vi},p("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),Z8=T("editor.symbolHighlightBackground",{dark:TS,light:TS,hc:null},p("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),Y8=T("editor.symbolHighlightBorder",{dark:null,light:null,hc:Vi},p("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),RA=T("editorCursor.foreground",{dark:"#AEAFAD",light:B.black,hc:B.white},p("caret","Color of the editor cursor.")),X8=T("editorCursor.background",null,p("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Ll=T("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},p("editorWhitespaces","Color of whitespace characters in the editor.")),Tb=T("editorIndentGuide.background",{dark:Ll,light:Ll,hc:Ll},p("editorIndentGuides","Color of the editor indentation guides.")),Ab=T("editorIndentGuide.activeBackground",{dark:Ll,light:Ll,hc:Ll},p("editorActiveIndentGuide","Color of the active editor indentation guides.")),OA=T("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:B.white},p("editorLineNumbers","Color of editor line numbers.")),Ew=T("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:Vi},p("editorActiveLineNumber","Color of editor active line number"),!1,p("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),Q8=T("editorLineNumber.activeForeground",{dark:Ew,light:Ew,hc:Ew},p("editorActiveLineNumber","Color of editor active line number")),J8=T("editorRuler.foreground",{dark:"#5A5A5A",light:B.lightgrey,hc:B.white},p("editorRuler","Color of the editor rulers.")),e6=T("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hc:"#999999"},p("editorCodeLensForeground","Foreground color of editor CodeLens")),t6=T("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},p("editorBracketMatchBackground","Background color behind matching brackets")),PA=T("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:Xt},p("editorBracketMatchBorder","Color for matching brackets boxes")),i6=T("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},p("editorOverviewRulerBorder","Color of the overview ruler border.")),n6=T("editorOverviewRuler.background",null,p("editorOverviewRulerBackground","Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.")),s6=T("editorGutter.background",{dark:Eo,light:Eo,hc:Eo},p("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),o6=T("editorUnnecessaryCode.border",{dark:null,light:null,hc:B.fromHex("#fff").transparent(.8)},p("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),r6=T("editorUnnecessaryCode.opacity",{dark:B.fromHex("#000a"),light:B.fromHex("#0007"),hc:null},p("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`)),FA=T("editorGhostText.border",{dark:null,light:null,hc:B.fromHex("#fff").transparent(.8)},p("editorGhostTextBorder","Border color of ghost text in the editor.")),BA=T("editorGhostText.foreground",{dark:B.fromHex("#ffffff56"),light:B.fromHex("#0007"),hc:null},p("editorGhostTextForeground","Foreground color of the ghost text in the editor.")),Nw=new B(new Ve(0,122,204,.6)),a6=T("editorOverviewRuler.rangeHighlightForeground",{dark:Nw,light:Nw,hc:Nw},p("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),l6=T("editorOverviewRuler.errorForeground",{dark:new B(new Ve(255,18,18,.7)),light:new B(new Ve(255,18,18,.7)),hc:new B(new Ve(255,50,50,1))},p("overviewRuleError","Overview ruler marker color for errors.")),d6=T("editorOverviewRuler.warningForeground",{dark:vr,light:vr,hc:Mb},p("overviewRuleWarning","Overview ruler marker color for warnings.")),c6=T("editorOverviewRuler.infoForeground",{dark:Cl,light:Cl,hc:YL},p("overviewRuleInfo","Overview ruler marker color for infos."));tt((s,e)=>{const t=s.getColor(Eo);t&&e.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${t}; }`);const i=s.getColor(ca);i&&e.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${i}; }`);const n=s.getColor(s6);n&&e.addRule(`.monaco-editor .margin { background-color: ${n}; }`);const o=s.getColor(K8);o&&e.addRule(`.monaco-editor .rangeHighlight { background-color: ${o}; }`);const r=s.getColor(G8);r&&e.addRule(`.monaco-editor .rangeHighlight { border: 1px ${s.type==="hc"?"dotted":"solid"} ${r}; }`);const a=s.getColor(Z8);a&&e.addRule(`.monaco-editor .symbolHighlight { background-color: ${a}; }`);const l=s.getColor(Y8);l&&e.addRule(`.monaco-editor .symbolHighlight { border: 1px ${s.type==="hc"?"dotted":"solid"} ${l}; }`);const d=s.getColor(Ll);d&&(e.addRule(`.monaco-editor .mtkw { color: ${d} !important; }`),e.addRule(`.monaco-editor .mtkz { color: ${d} !important; }`))});class qc extends Sh{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new O(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(56);const t=e.get(57);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(82);const i=e.get(128);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new O(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const n=Math.abs(this._lastCursorModelPosition.lineNumber-i);return n===0?'<span class="relative-current-line-number">'+i+"</span>":String(n)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=sn?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o='<div class="'+qc.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">',r=this._context.model.getLineCount(),a=[];for(let l=i;l<=n;l++){const d=l-i;if(!this._renderFinalNewline&&l===r&&this._context.model.getLineLength(l)===0){a[d]="";continue}const c=this._getLineRenderLineNumber(l);c?l===this._activeLineNumber?a[d]='<div class="active-line-number '+qc.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">'+c+"</div>":a[d]=o+c+"</div>":a[d]=""}this._renderResult=a}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}qc.CLASS_NAME="line-numbers";tt((s,e)=>{const t=s.getColor(OA);t&&e.addRule(`.monaco-editor .line-numbers { color: ${t}; }`);const i=s.getColor(Q8);i&&e.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${i}; }`)});class Vl extends is{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(128);this._canUseLayerHinting=!t.get(26),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=Ue(document.createElement("div")),this._domNode.setClassName(Vl.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Ue(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Vl.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(128);return this._canUseLayerHinting=!t.get(26),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}Vl.CLASS_NAME="glyph-margin";Vl.OUTER_CLASS_NAME="margin";const xl="monaco-mouse-cursor-text";class nx{constructor(e,t,i){this._visibleTextAreaBrand=void 0,this.top=e,this.left=t,this.width=i}setWidth(e){return new nx(this.top,this.left,e)}}const zh=qi;class h6 extends is{constructor(e,t,i){super(e),this._primaryCursorPosition=new O(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._viewHelper=i,this._scrollLeft=0,this._scrollTop=0;const n=this._context.configuration.options,o=n.get(128);this._setAccessibilityOptions(n),this._contentLeft=o.contentLeft,this._contentWidth=o.contentWidth,this._contentHeight=o.height,this._fontInfo=n.get(40),this._lineHeight=n.get(56),this._emptySelectionClipboard=n.get(30),this._copyWithSyntaxHighlighting=n.get(19),this._visibleTextArea=null,this._selections=[new ee(1,1,1,1)],this._modelSelections=[new ee(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Ue(document.createElement("textarea")),Bo.write(this.textArea,6),this.textArea.setClassName(`inputarea ${xl}`),this.textArea.setAttribute("wrap","off"),this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(n)),this.textArea.setAttribute("tabindex",String(n.get(110))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",p("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),n.get(28)&&n.get(78)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=Ue(document.createElement("div")),this.textAreaCover.setPosition("absolute");const r={getLineCount:()=>this._context.model.getLineCount(),getLineMaxColumn:l=>this._context.model.getLineMaxColumn(l),getValueInRange:(l,d)=>this._context.model.getValueInRange(l,d)},a={getDataToCopy:l=>{const d=this._context.model.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Si),c=this._context.model.getEOL(),h=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),u=Array.isArray(d)?d:null,f=Array.isArray(d)?d.join(c):d;let g,m=null;if(l&&(kS.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&f.length<65536)){const b=this._context.model.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);b&&(g=b.html,m=b.mode)}return{isFromEmptySelection:h,multicursorText:u,text:f,html:g,mode:m}},getScreenReaderContent:l=>{if(this._accessibilitySupport===1){if(Re){const d=this._selections[0];if(d.isEmpty()){const c=d.getStartPosition();let h=this._getWordBeforePosition(c);if(h.length===0&&(h=this._getCharacterBeforePosition(c)),h.length>0)return new ni(h,h.length,h.length,c,c)}}return ni.EMPTY}if(su){const d=this._selections[0];if(d.isEmpty()){const c=d.getStartPosition(),[h,u]=this._getAndroidWordAtPosition(c);if(h.length>0)return new ni(h,u,u,c,c)}return ni.EMPTY}return rc.fromEditorSelection(l,r,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(l,d,c)=>this._context.model.deduceModelPositionRelativeToViewPosition(l,d,c)};this._textAreaInput=this._register(new S7(a,this.textArea)),this._register(this._textAreaInput.onKeyDown(l=>{this._viewController.emitKeyDown(l)})),this._register(this._textAreaInput.onKeyUp(l=>{this._viewController.emitKeyUp(l)})),this._register(this._textAreaInput.onPaste(l=>{let d=!1,c=null,h=null;l.metadata&&(d=this._emptySelectionClipboard&&!!l.metadata.isFromEmptySelection,c=typeof l.metadata.multicursorText<"u"?l.metadata.multicursorText:null,h=l.metadata.mode),this._viewController.paste(l.text,d,c,h)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(l=>{l.replacePrevCharCnt||l.replaceNextCharCnt||l.positionDelta?this._viewController.compositionType(l.text,l.replacePrevCharCnt,l.replaceNextCharCnt,l.positionDelta):this._viewController.type(l.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(l=>{this._viewController.setSelection(l)})),this._register(this._textAreaInput.onCompositionStart(l=>{const d=this._selections[0].startLineNumber,c=this._selections[0].startColumn+l.revealDeltaColumns;this._context.model.revealRange("keyboard",!0,new L(d,c,d,c),0,1);const h=this._viewHelper.visibleRangeForPositionRelativeToEditor(d,c);h&&(this._visibleTextArea=new nx(this._context.viewLayout.getVerticalOffsetForLineNumber(d),h.left,zh?0:1),this._render()),this.textArea.setClassName(`inputarea ${xl} ime-input`),this._viewController.compositionStart(),this._context.model.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(l=>{this._visibleTextArea&&(this._visibleTextArea=this._visibleTextArea.setWidth(u6(l.data,this._fontInfo)),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName(`inputarea ${xl}`),this._viewController.compositionEnd(),this._context.model.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.model.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.model.setHasFocus(!1)}))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.model.getLineContent(e.lineNumber),n=ts(t);let o=!0,r=e.column,a=!0,l=e.column,d=0;for(;d<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const c=i.charCodeAt(r-2);n.get(c)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const c=i.charCodeAt(l-1);n.get(c)!==0?a=!1:l++}d++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.model.getLineContent(e.lineNumber),i=ts(this._context.configuration.options.get(114));let n=e.column,o=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.model.getLineContent(e.lineNumber).charAt(e.column-2);if(!di(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){return e.get(2)===1?p("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",sn?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Js.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(128);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(40),this._lineHeight=t.get(56),this._emptySelectionClipboard=t.get(30),this._copyWithSyntaxHighlighting=t.get(19),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(110))),(e.hasChanged(28)||e.hasChanged(78))&&(t.get(28)&&t.get(78)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}prepareRender(e){this._primaryCursorPosition=new O(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){if(this._visibleTextArea){this._renderInsideEditor(null,this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight);return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(Re){this._renderInsideEditor(this._primaryCursorPosition,t,e,zh?0:1,this._lineHeight);return}this._renderInsideEditor(this._primaryCursorPosition,t,e,zh?0:1,zh?0:1)}_renderInsideEditor(e,t,i,n,o){this._lastRenderPosition=e;const r=this.textArea,a=this.textAreaCover;Wi.applyFontInfo(r,this._fontInfo),r.setTop(t),r.setLeft(i),r.setWidth(n),r.setHeight(o),a.setTop(0),a.setLeft(0),a.setWidth(0),a.setHeight(0)}_renderAtTopLeft(){this._lastRenderPosition=null;const e=this.textArea,t=this.textAreaCover;if(Wi.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),zh){e.setWidth(0),e.setHeight(0),t.setWidth(0),t.setHeight(0);return}e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1);const i=this._context.configuration.options;i.get(46)?t.setClassName("monaco-editor-background textAreaCover "+Vl.OUTER_CLASS_NAME):i.get(57).renderType!==0?t.setClassName("monaco-editor-background textAreaCover "+qc.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")}}function u6(s,e){const i=document.createElement("canvas").getContext("2d");i.font=f6(e);const n=i.measureText(s);return qi?n.width+2:n.width}function f6(s){return g6("normal",s.fontWeight,s.fontSize,s.lineHeight,s.fontFamily)}function g6(s,e,t,i,n){return`${s} normal ${e} ${t}px / ${i}px ${n}`}class rl{static columnSelect(e,t,i,n,o,r){let a=Math.abs(o-i)+1,l=i>o,d=n>r,c=n<r,h=[];for(let u=0;u<a;u++){let f=i+(l?-u:u),g=it.columnFromVisibleColumn2(e,t,f,n),m=it.columnFromVisibleColumn2(e,t,f,r),b=it.visibleColumnFromColumn2(e,t,new O(f,g)),v=it.visibleColumnFromColumn2(e,t,new O(f,m));c&&(b>r||v<n)||d&&(v>n||b<r)||h.push(new bi(new L(f,g,f,g),0,new O(f,m),0))}if(h.length===0)for(let u=0;u<a;u++){const f=i+(l?-u:u),g=t.getLineMaxColumn(f);h.push(new bi(new L(f,g,f,g),0,new O(f,g),0))}return{viewStates:h,reversed:l,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:r}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,rl.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=o;l<=r;l++){const d=t.getLineMaxColumn(l),c=it.visibleColumnFromColumn2(e,t,new O(l,d));n=Math.max(n,c)}let a=i.toViewVisualColumn;return a<n&&a++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,a)}static columnSelectUp(e,t,i,n){const o=n?e.pageSize:1,r=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,r,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){const o=n?e.pageSize:1,r=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,r,i.toViewVisualColumn)}}class mi{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return new ee(n.endLineNumber,n.endColumn,n.endLineNumber,n.endColumn)}}class p6{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return new ee(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn)}}class zg{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return new ee(n.startLineNumber,n.startColumn,n.startLineNumber,n.startColumn)}}class $p{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return new ee(n.endLineNumber+this._lineNumberDeltaOffset,n.endColumn+this._columnDeltaOffset,n.endLineNumber+this._lineNumberDeltaOffset,n.endColumn+this._columnDeltaOffset)}}class sx{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class Ug{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class Ke{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-S5(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new O(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=of.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=n)return new O(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?Ke.leftPositionAtomicSoftTabs(t,i,e.tabSize):Ke.leftPosition(t,i);return new Ug(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let r,a;if(i.hasSelection()&&!n)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(o-1)),d=t.normalizePosition(Ke.clipPositionColumn(l,t),0),c=Ke.left(e,t,d);r=c.lineNumber,a=c.column}return i.move(n,r,a,0)}static clipPositionColumn(e,t){return new O(e.lineNumber,Ke.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i=i+ym(e.getLineContent(t),i-1):t<e.getLineCount()&&(t=t+1,i=e.getLineMinColumn(t)),new O(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){const r=e.getLineContent(t),a=of.atomicPosition(r,i-1,n,1);if(a!==-1)return new O(t,a+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const n=e.stickyTabStops?Ke.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):Ke.rightPosition(t,i.lineNumber,i.column);return new Ug(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,o){let r,a;if(i.hasSelection()&&!n)r=i.selection.endLineNumber,a=i.selection.endColumn;else{const l=i.position.delta(void 0,o-1),d=t.normalizePosition(Ke.clipPositionColumn(l,t),1),c=Ke.right(e,t,d);r=c.lineNumber,a=c.column}return i.move(n,r,a,0)}static down(e,t,i,n,o,r,a){const l=it.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,d=t.getLineCount(),c=i===d&&n===t.getLineMaxColumn(i);return i=i+r,i>d?(i=d,a?n=t.getLineMaxColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=it.columnFromVisibleColumn2(e,t,i,l),c?o=0:o=l-it.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),new Ug(i,n,o)}static moveDown(e,t,i,n,o){let r,a;i.hasSelection()&&!n?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let l=Ke.down(e,t,r,a,i.leftoverVisibleColumns,o,!0);return i.move(n,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateDown(e,t,i){let n=i.selection,o=Ke.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=Ke.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new bi(new L(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new O(r.lineNumber,r.column),r.leftoverVisibleColumns)}static up(e,t,i,n,o,r,a){const l=it.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,d=i===1&&n===1;return i=i-r,i<1?(i=1,a?n=t.getLineMinColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=it.columnFromVisibleColumn2(e,t,i,l),d?o=0:o=l-it.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),new Ug(i,n,o)}static moveUp(e,t,i,n,o){let r,a;i.hasSelection()&&!n?(r=i.selection.startLineNumber,a=i.selection.startColumn):(r=i.position.lineNumber,a=i.position.column);let l=Ke.up(e,t,r,a,i.leftoverVisibleColumns,o,!0);return i.move(n,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateUp(e,t,i){let n=i.selection,o=Ke.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=Ke.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new bi(new L(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new O(r.lineNumber,r.column),r.leftoverVisibleColumns)}static _isBlankLine(e,t){return e.getLineFirstNonWhitespaceColumn(t)===0}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let r=i.position.lineNumber;for(;r<o&&this._isBlankLine(t,r);)r++;for(;r<o&&!this._isBlankLine(t,r);)r++;return i.move(n,r,t.getLineMinColumn(r),0)}static moveToBeginningOfLine(e,t,i,n){let o=i.position.lineNumber,r=t.getLineMinColumn(o),a=t.getLineFirstNonWhitespaceColumn(o)||r,l;return i.position.column===a?l=r:l=a,i.move(n,o,l,0)}static moveToEndOfLine(e,t,i,n,o){let r=i.position.lineNumber,a=t.getLineMaxColumn(r);return i.move(n,r,a,o?1073741824-a:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){let o=t.getLineCount(),r=t.getLineMaxColumn(o);return i.move(n,o,r,0)}}class Hl{static deleteRight(e,t,i,n){let o=[],r=e!==3;for(let a=0,l=n.length;a<l;a++){const d=n[a];let c=d;if(c.isEmpty()){let h=d.getPosition(),u=Ke.right(t,i,h);c=new L(u.lineNumber,u.column,h.lineNumber,h.column)}if(c.isEmpty()){o[a]=null;continue}c.startLineNumber!==c.endLineNumber&&(r=!0),o[a]=new mi(c,"")}return[r,o]}static isAutoClosingPairDelete(e,t,i,n,o,r,a){if(t==="never"&&i==="never"||e==="never")return!1;for(let l=0,d=r.length;l<d;l++){const c=r[l],h=c.getPosition();if(!c.isEmpty())return!1;const u=o.getLineContent(h.lineNumber);if(h.column<2||h.column>=u.length+1)return!1;const f=u.charAt(h.column-2),g=n.get(f);if(!g)return!1;if(ec(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=u.charAt(h.column-1);let b=!1;for(const v of g)v.open===f&&v.close===m&&(b=!0);if(!b)return!1;if(e==="auto"){let v=!1;for(let _=0,w=a.length;_<w;_++){const C=a[_];if(h.lineNumber===C.startLineNumber&&h.column===C.startColumn){v=!0;break}}if(!v)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){let n=[];for(let o=0,r=i.length;o<r;o++){const a=i[o].getPosition(),l=new L(a.lineNumber,a.column-1,a.lineNumber,a.column+1);n[o]=new mi(l,"")}return[!0,n]}static deleteLeft(e,t,i,n,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,o))return this._runAutoClosingPairDelete(t,i,n);const r=[];let a=e!==2;for(let l=0,d=n.length;l<d;l++){let c=Hl.getDeleteRange(n[l],i,t);if(c.isEmpty()){r[l]=null;continue}c.startLineNumber!==c.endLineNumber&&(a=!0),r[l]=new mi(c,"")}return[a,r]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const n=e.getPosition();if(i.useTabStops&&n.column>1){const o=t.getLineContent(n.lineNumber),r=bn(o),a=r===-1?o.length+1:r+1;if(n.column<=a){const l=it.visibleColumnFromColumn2(i,t,n),d=it.prevIndentTabStop(l,i.indentSize),c=it.columnFromVisibleColumn2(i,t,n.lineNumber,d);return new L(n.lineNumber,c,n.lineNumber,n.column)}}return L.fromPositions(Hl.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=T5(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new O(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){let n=[];for(let o=0,r=i.length;o<r;o++){const a=i[o];if(a.isEmpty())if(e.emptySelectionClipboard){let l=a.getPosition(),d,c,h,u;l.lineNumber<t.getLineCount()?(d=l.lineNumber,c=1,h=l.lineNumber+1,u=1):l.lineNumber>1?(d=l.lineNumber-1,c=t.getLineMaxColumn(l.lineNumber-1),h=l.lineNumber,u=t.getLineMaxColumn(l.lineNumber)):(d=l.lineNumber,c=1,h=l.lineNumber,u=t.getLineMaxColumn(l.lineNumber));let f=new L(d,c,h,u);f.isEmpty()?n[o]=null:n[o]=new mi(f,"")}else n[o]=null;else n[o]=new mi(a,"")}return new cn(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class ze{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){let n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let o=i.column-2;o>=0;o--){let r=e.charCodeAt(o),a=t.get(r);if(a===0){if(n===2)return this._createWord(e,n,a,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(a===2){if(n===1)return this._createWord(e,n,a,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(a===1&&n!==0)return this._createWord(e,n,a,o+1,this._findEndOfWord(e,t,n,o+1))}return n!==0?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){let o=e.length;for(let r=n;r<o;r++){let a=e.charCodeAt(r),l=t.get(a);if(l===1||i===1&&l===2||i===2&&l===0)return r}return o}static _findNextWordOnLine(e,t,i){let n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0,o=e.length;for(let r=i.column-1;r<o;r++){let a=e.charCodeAt(r),l=t.get(a);if(l===0){if(n===2)return this._createWord(e,n,l,this._findStartOfWord(e,t,n,r-1),r);n=1}else if(l===2){if(n===1)return this._createWord(e,n,l,this._findStartOfWord(e,t,n,r-1),r);n=2}else if(l===1&&n!==0)return this._createWord(e,n,l,this._findStartOfWord(e,t,n,r-1),r)}return n!==0?this._createWord(e,n,1,this._findStartOfWord(e,t,n,o-1),o):null}static _findStartOfWord(e,t,i,n){for(let o=n;o>=0;o--){let r=e.charCodeAt(o),a=t.get(r);if(a===1||i===1&&a===2||i===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=ze._findPreviousWordOnLine(e,t,new O(o,r));if(n===0)return new O(o,a?a.start+1:1);if(n===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=ze._findPreviousWordOnLine(e,t,new O(o,a.start+1))),new O(o,a?a.start+1:1);if(n===3){for(;a&&a.wordType===2;)a=ze._findPreviousWordOnLine(e,t,new O(o,a.start+1));return new O(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=ze._findPreviousWordOnLine(e,t,new O(o,a.start+1))),new O(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===1)return i>1?new O(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),l=o.charCodeAt(r-1);if(a===95&&l!==95)return new O(i,r);if(fr(a)&&Vs(l))return new O(i,r);if(Vs(a)&&Vs(l)&&r+1<n){const d=o.charCodeAt(r);if(fr(d))return new O(i,r)}}return new O(i,1)}static moveWordRight(e,t,i,n){let o=i.lineNumber,r=i.column,a=!1;r===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(a=!0,o=o+1,r=1);let l=ze._findNextWordOnLine(e,t,new O(o,r));if(n===2)l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=ze._findNextWordOnLine(e,t,new O(o,l.end+1))),l?r=l.end+1:r=t.getLineMaxColumn(o);else if(n===3){for(a&&(r=0);l&&(l.wordType===2||l.start+1<=r);)l=ze._findNextWordOnLine(e,t,new O(o,l.end+1));l?r=l.start+1:r=t.getLineMaxColumn(o)}else l&&!a&&r>=l.start+1&&(l=ze._findNextWordOnLine(e,t,new O(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new O(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new O(i+1,1):t;const o=e.getLineContent(i);for(let r=t.column+1;r<n;r++){const a=o.charCodeAt(r-2),l=o.charCodeAt(r-1);if(a!==95&&l===95)return new O(i,r);if(fr(a)&&Vs(l))return new O(i,r);if(Vs(a)&&Vs(l)&&r+1<n){const d=o.charCodeAt(r);if(fr(d))return new O(i,r)}}return new O(i,n)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-2,o=xo(i,n);return o+1<n?new L(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,r=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(Hl.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const h=e.selection.getPosition();return new L(h.lineNumber,h.column-1,h.lineNumber,h.column+1)}const a=new O(o.positionLineNumber,o.positionColumn);let l=a.lineNumber,d=a.column;if(l===1&&d===1)return null;if(r){let h=this._deleteWordLeftWhitespace(n,a);if(h)return h}let c=ze._findPreviousWordOnLine(i,n,a);return t===0?c?d=c.start+1:d>1?d=1:(l--,d=n.getLineMaxColumn(l)):(c&&d<=c.end+1&&(c=ze._findPreviousWordOnLine(i,n,new O(l,c.start+1))),c?d=c.end+1:d>1?d=1:(l--,d=n.getLineMaxColumn(l))),new L(l,d,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new O(i.positionLineNumber,i.positionColumn);let o=this._deleteInsideWordWhitespace(t,n);return o||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(n===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+1<n&&this._charAtIsWhitespace(i,r+1);)r++;return new L(t.lineNumber,o+1,t.lineNumber,r+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const n=t.getLineContent(i.lineNumber),o=n.length;if(o===0)return i.lineNumber>1?new L(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new L(i.lineNumber,1,i.lineNumber+1,1):new L(i.lineNumber,1,i.lineNumber,1);const r=h=>h.start+1<=i.column&&i.column<=h.end+1,a=(h,u)=>(h=Math.min(h,i.column),u=Math.max(u,i.column),new L(i.lineNumber,h,i.lineNumber,u)),l=h=>{let u=h.start+1,f=h.end+1,g=!1;for(;f-1<o&&this._charAtIsWhitespace(n,f-1);)g=!0,f++;if(!g)for(;u>1&&this._charAtIsWhitespace(n,u-2);)u--;return a(u,f)},d=ze._findPreviousWordOnLine(e,t,i);if(d&&r(d))return l(d);const c=ze._findNextWordOnLine(e,t,i);return c&&r(c)?l(c):d&&c?a(d.end+1,c.start+1):d?a(d.start+1,d.end+1):c?a(c.start+1,c.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=ze._moveWordPartLeft(e,i);return new L(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let n=t;n<i;n++){let o=e.charAt(n);if(o!==" "&&o!==" ")return n}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-1,o=this._findFirstNonWhitespaceChar(i,n);return n+1<o?new L(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,r=e.whitespaceHeuristics;if(!o.isEmpty())return o;const a=new O(o.positionLineNumber,o.positionColumn);let l=a.lineNumber,d=a.column;const c=n.getLineCount(),h=n.getLineMaxColumn(l);if(l===c&&d===h)return null;if(r){let f=this._deleteWordRightWhitespace(n,a);if(f)return f}let u=ze._findNextWordOnLine(i,n,a);return t===2?u?d=u.end+1:d<h||l===c?d=h:(l++,u=ze._findNextWordOnLine(i,n,new O(l,1)),u?d=u.start+1:d=n.getLineMaxColumn(l)):(u&&d>=u.start+1&&(u=ze._findNextWordOnLine(i,n,new O(l,u.end+1))),u?d=u.start+1:d<h||l===c?d=h:(l++,u=ze._findNextWordOnLine(i,n,new O(l,1)),u?d=u.start+1:d=n.getLineMaxColumn(l))),new L(l,d,a.lineNumber,a.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=ze._moveWordPartRight(e,i);return new L(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){const n=new L(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(e,t,i){const n=ts(t),o=ze._findPreviousWordOnLine(n,e,i);if(o&&o.wordType===1&&o.start<=i.column-1&&i.column-1<=o.end)return ze._createWordAtPosition(e,i.lineNumber,o);const r=ze._findNextWordOnLine(n,e,i);return r&&r.wordType===1&&r.start<=i.column-1&&i.column-1<=r.end?ze._createWordAtPosition(e,i.lineNumber,r):null}static word(e,t,i,n,o){const r=ts(e.wordSeparators);let a=ze._findPreviousWordOnLine(r,t,o),l=ze._findNextWordOnLine(r,t,o);if(!n){let f,g;return a&&a.wordType===1&&a.start<=o.column-1&&o.column-1<=a.end?(f=a.start+1,g=a.end+1):l&&l.wordType===1&&l.start<=o.column-1&&o.column-1<=l.end?(f=l.start+1,g=l.end+1):(a?f=a.end+1:f=1,l?g=l.start+1:g=t.getLineMaxColumn(o.lineNumber)),new bi(new L(o.lineNumber,f,o.lineNumber,g),0,new O(o.lineNumber,g),0)}let d,c;a&&a.wordType===1&&a.start<o.column-1&&o.column-1<a.end?(d=a.start+1,c=a.end+1):l&&l.wordType===1&&l.start<o.column-1&&o.column-1<l.end?(d=l.start+1,c=l.end+1):(d=o.column,c=o.column);let h=o.lineNumber,u;if(i.selectionStart.containsPosition(o))u=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){u=d;let f=new O(h,u);i.selectionStart.containsPosition(f)&&(u=i.selectionStart.endColumn)}else{u=c;let f=new O(h,u);i.selectionStart.containsPosition(f)&&(u=i.selectionStart.startColumn)}return i.move(!0,h,u,0)}}class Rb extends ze{static deleteWordPartLeft(e){const t=$g([ze.deleteWordLeft(e,0),ze.deleteWordLeft(e,2),ze._deleteWordPartLeft(e.model,e.selection)]);return t.sort(L.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=$g([ze.deleteWordRight(e,0),ze.deleteWordRight(e,2),ze._deleteWordPartRight(e.model,e.selection)]);return t.sort(L.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i){const n=$g([ze.moveWordLeft(e,t,i,0),ze.moveWordLeft(e,t,i,2),ze._moveWordPartLeft(t,i)]);return n.sort(O.compare),n[2]}static moveWordPartRight(e,t,i){const n=$g([ze.moveWordRight(e,t,i,0),ze.moveWordRight(e,t,i,2),ze._moveWordPartRight(t,i)]);return n.sort(O.compare),n[0]}}function $g(s){return s.filter(e=>!!e)}class ai{static addCursorDown(e,t,i){let n=[],o=0;for(let r=0,a=t.length;r<a;r++){const l=t[r];n[o++]=new Te(l.modelState,l.viewState),i?n[o++]=Te.fromModelState(Ke.translateDown(e.cursorConfig,e.model,l.modelState)):n[o++]=Te.fromViewState(Ke.translateDown(e.cursorConfig,e,l.viewState))}return n}static addCursorUp(e,t,i){let n=[],o=0;for(let r=0,a=t.length;r<a;r++){const l=t[r];n[o++]=new Te(l.modelState,l.viewState),i?n[o++]=Te.fromModelState(Ke.translateUp(e.cursorConfig,e.model,l.modelState)):n[o++]=Te.fromViewState(Ke.translateUp(e.cursorConfig,e,l.viewState))}return n}static moveToBeginningOfLine(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o];n[o]=this._moveToLineStart(e,a,i)}return n}static _moveToLineStart(e,t,i){const n=t.viewState.position.column,o=t.modelState.position.column,r=n===o,a=t.viewState.position.lineNumber,l=e.getLineFirstNonWhitespaceColumn(a);return!r&&!(n===l)?this._moveToLineStartByView(e,t,i):this._moveToLineStartByModel(e,t,i)}static _moveToLineStartByView(e,t,i){return Te.fromViewState(Ke.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return Te.fromModelState(Ke.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){let o=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];o[r]=this._moveToLineEnd(e,l,i,n)}return o}static _moveToLineEnd(e,t,i,n){const o=t.viewState.position,r=e.getLineMaxColumn(o.lineNumber),a=o.column===r,l=t.modelState.position,d=e.model.getLineMaxColumn(l.lineNumber),c=r-o.column===d-l.column;return a||c?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return Te.fromViewState(Ke.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return Te.fromModelState(Ke.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){let i=[];for(let n=0,o=t.length;n<o;n++){const r=t[n],a=r.modelState.selection.startLineNumber,l=e.model.getLineCount();let d=r.modelState.selection.endLineNumber,c;d===l?c=e.model.getLineMaxColumn(l):(d++,c=1),i[n]=Te.fromModelState(new bi(new L(a,1,a,1),0,new O(d,c),0))}return i}static moveToBeginningOfBuffer(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o];n[o]=Te.fromModelState(Ke.moveToBeginningOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o];n[o]=Te.fromModelState(Ke.moveToEndOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return n}static selectAll(e,t){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return Te.fromModelState(new bi(new L(1,1,1,1),0,new O(i,n),0))}static line(e,t,i,n,o){const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new O(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);if(!i||!t.modelState.hasSelection()){const d=e.model.getLineCount();let c=r.lineNumber+1,h=1;return c>d&&(c=d,h=e.model.getLineMaxColumn(c)),Te.fromModelState(new bi(new L(r.lineNumber,1,c,h),0,new O(c,h),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumber<l)return Te.fromViewState(t.viewState.move(t.modelState.hasSelection(),a.lineNumber,1,0));if(r.lineNumber>l){const d=e.getLineCount();let c=a.lineNumber+1,h=1;return c>d&&(c=d,h=e.getLineMaxColumn(c)),Te.fromViewState(t.viewState.move(t.modelState.hasSelection(),c,h,0))}else{const d=t.modelState.selectionStart.getEndPosition();return Te.fromModelState(t.modelState.move(t.modelState.hasSelection(),d.lineNumber,d.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return Te.fromModelState(ze.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Te(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Te.fromViewState(new bi(new L(i,n,i,n),0,new O(i,n),0))}static moveTo(e,t,i,n,o){const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new O(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return Te.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,o,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return r===4?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return r===2?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return r===2?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return r===2?t.map(a=>Te.fromViewState(Ke.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Te.fromModelState(Ke.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 5:return r===2?t.map(a=>Te.fromViewState(Ke.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Te.fromModelState(Ke.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),d=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,d)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),d=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,d)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),d=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,d)]}case 14:{let l=[];for(let d=0,c=t.length;d<c;d++){const h=t[d];l[d]=this.findPositionInViewportIfOutside(e,h,r,n)}return l}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){let o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new Te(t.modelState,t.viewState);{o>i.endLineNumber-1&&(o=i.endLineNumber-1),o<i.startLineNumber&&(o=i.startLineNumber);const r=e.getLineFirstNonWhitespaceColumn(o);return this._moveToViewPosition(e,t,n,o,r)}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map(o=>Te.fromViewState(Ke.moveLeft(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.viewState.position.lineNumber,d=Math.round(e.getLineContent(l).length/2);n[o]=Te.fromViewState(Ke.moveLeft(e.cursorConfig,e,a.viewState,i,d))}return n}static _moveRight(e,t,i,n){return t.map(o=>Te.fromViewState(Ke.moveRight(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineRight(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.viewState.position.lineNumber,d=Math.round(e.getLineContent(l).length/2);n[o]=Te.fromViewState(Ke.moveRight(e.cursorConfig,e,a.viewState,i,d))}return n}static _moveDownByViewLines(e,t,i,n){let o=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];o[r]=Te.fromViewState(Ke.moveDown(e.cursorConfig,e,l.viewState,i,n))}return o}static _moveDownByModelLines(e,t,i,n){let o=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];o[r]=Te.fromModelState(Ke.moveDown(e.cursorConfig,e.model,l.modelState,i,n))}return o}static _moveUpByViewLines(e,t,i,n){let o=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];o[r]=Te.fromViewState(Ke.moveUp(e.cursorConfig,e,l.viewState,i,n))}return o}static _moveUpByModelLines(e,t,i,n){let o=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];o[r]=Te.fromModelState(Ke.moveUp(e.cursorConfig,e.model,l.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return Te.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return Te.fromModelState(t.modelState.move(i,n,o,0))}static _moveToViewMinColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.viewState.position.lineNumber,d=e.getLineMinColumn(l);n[o]=this._moveToViewPosition(e,a,i,l,d)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.viewState.position.lineNumber,d=e.getLineFirstNonWhitespaceColumn(l);n[o]=this._moveToViewPosition(e,a,i,l,d)}return n}static _moveToViewCenterColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.viewState.position.lineNumber,d=Math.round((e.getLineMaxColumn(l)+e.getLineMinColumn(l))/2);n[o]=this._moveToViewPosition(e,a,i,l,d)}return n}static _moveToViewMaxColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.viewState.position.lineNumber,d=e.getLineMaxColumn(l);n[o]=this._moveToViewPosition(e,a,i,l,d)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.viewState.position.lineNumber,d=e.getLineLastNonWhitespaceColumn(l);n[o]=this._moveToViewPosition(e,a,i,l,d)}return n}}var l_;(function(s){const e=function(i){if(!tn(i))return!1;let n=i;return!(!es(n.to)||!ji(n.select)&&!XM(n.select)||!ji(n.by)&&!es(n.by)||!ji(n.value)&&!Ml(n.value))};s.description={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:`Property-value pairs that can be passed through this argument:
* 'to': A mandatory logical position value providing where to move the cursor.
\`\`\`
'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
\`\`\`
* 'by': Unit to move. Default is computed based on 'to' value.
\`\`\`
'line', 'wrappedLine', 'character', 'halfLine'
\`\`\`
* 'value': Number of units to move. Default is '1'.
* 'select': If 'true' makes the selection. Default is 'false'.
`,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},s.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"},s.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case s.RawDirection.Left:n=0;break;case s.RawDirection.Right:n=1;break;case s.RawDirection.Up:n=2;break;case s.RawDirection.Down:n=3;break;case s.RawDirection.PrevBlankLine:n=4;break;case s.RawDirection.NextBlankLine:n=5;break;case s.RawDirection.WrappedLineStart:n=6;break;case s.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case s.RawDirection.WrappedLineColumnCenter:n=8;break;case s.RawDirection.WrappedLineEnd:n=9;break;case s.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case s.RawDirection.ViewPortTop:n=11;break;case s.RawDirection.ViewPortBottom:n=13;break;case s.RawDirection.ViewPortCenter:n=12;break;case s.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let o=0;switch(i.by){case s.RawUnit.Line:o=1;break;case s.RawUnit.WrappedLine:o=2;break;case s.RawUnit.Character:o=3;break;case s.RawUnit.HalfLine:o=4;break}return{direction:n,unit:o,select:!!i.select,value:i.value||1}}s.parse=t})(l_||(l_={}));const Mw=Object.create(null);function qa(s,e){if(e<=0)return"";Mw[s]||(Mw[s]=["",s]);const t=Mw[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}class Nn{constructor(e,t){this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,i,n,o){const r=it.visibleColumnFromColumn(e,t,i);if(o){const a=qa(" ",n),d=it.prevIndentTabStop(r,n)/n;return qa(a,d)}else{const a=" ",d=it.prevRenderTabStop(r,i)/i;return qa(a,d)}}static shiftIndent(e,t,i,n,o){const r=it.visibleColumnFromColumn(e,t,i);if(o){const a=qa(" ",n),d=it.nextIndentTabStop(r,n)/n;return qa(a,d)}else{const a=" ",d=it.nextRenderTabStop(r,i)/i;return qa(a,d)}}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;this._selection.endColumn===1&&i!==n&&(n=n-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,l=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let d=0,c=0;for(let h=i;h<=n;h++,d=c){c=0;let u=e.getLineContent(h),f=bn(u);if(this._opts.isUnshift&&(u.length===0||f===0)||!l&&!this._opts.isUnshift&&u.length===0)continue;if(f===-1&&(f=u.length),h>1&&it.visibleColumnFromColumn(u,f+1,o)%r!==0&&e.isCheapToTokenize(h-1)){let b=xe.getEnterAction(this._opts.autoIndent,e,new L(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)));if(b){if(c=d,b.appendText)for(let v=0,_=b.appendText.length;v<_&&c<r&&b.appendText.charCodeAt(v)===32;v++)c++;b.removeText&&(c=Math.max(0,c-b.removeText));for(let v=0;v<c&&!(f===0||u.charCodeAt(f-1)!==32);v++)f--}}if(this._opts.isUnshift&&f===0)continue;let g;this._opts.isUnshift?g=Nn.unshiftIndent(u,f+1,o,r,a):g=Nn.shiftIndent(u,f+1,o,r,a),this._addEditOperation(t,new L(h,1,h,f+1),g),h===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn<=f+1)}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&e.getLineLength(i)===0&&(this._useLastEditRangeForCursorEndPosition=!0);const d=a?qa(" ",r):" ";for(let c=i;c<=n;c++){const h=e.getLineContent(c);let u=bn(h);if(!(this._opts.isUnshift&&(h.length===0||u===0))&&!(!l&&!this._opts.isUnshift&&h.length===0)&&(u===-1&&(u=h.length),!(this._opts.isUnshift&&u===0)))if(this._opts.isUnshift){u=Math.min(u,r);for(let f=0;f<u;f++)if(h.charCodeAt(f)===9){u=f+1;break}this._addEditOperation(t,new L(c,1,c,u+1),"")}else this._addEditOperation(t,new L(c,1,c,1),d),c===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn===1)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){let n=t.getInverseEditOperations()[0];return new ee(n.range.endLineNumber,n.range.endColumn,n.range.endLineNumber,n.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){let n=this._selection.startColumn;return i.startColumn<=n?i:i.getDirection()===0?new ee(i.startLineNumber,n,i.endLineNumber,i.endColumn):new ee(i.endLineNumber,i.endColumn,i.startLineNumber,n)}return i}}class m6{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new L(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new L(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){let i=t.getInverseEditOperations(),n=i[0].range,o=i[1].range;return new ee(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class Ct{static indent(e,t,i){if(t===null||i===null)return[];let n=[];for(let o=0,r=i.length;o<r;o++)n[o]=new Nn(i[o],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent});return n}static outdent(e,t,i){let n=[];for(let o=0,r=i.length;o<r;o++)n[o]=new Nn(i[o],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent});return n}static shiftIndent(e,t,i){return i=i||1,Nn.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,Nn.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,n){let o=[];for(let r=0,a=i.length;r<a;r++)o[r]=new mi(i[r],n[r]);return new cn(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,o){let r=[];for(let a=0,l=i.length;a<l;a++){const d=i[a];let c=d.getPosition();if(o&&!d.isEmpty()&&(o=!1),o&&n.indexOf(`
`)!==n.length-1&&(o=!1),o){let h=new L(c.lineNumber,1,c.lineNumber,1);r[a]=new sx(h,n,d,!0)}else r[a]=new mi(d,n)}return new cn(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,o){if(n||t.length===1)return null;if(o&&o.length===t.length)return o;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substr(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substr(0,i.length-1));let r=Fa(i);if(r.length===t.length)return r}return null}static paste(e,t,i,n,o,r){const a=this._distributePasteToCursors(e,i,n,o,r);return a?(i=i.sort(L.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,o)}static _goodIndentForLine(e,t,i){let n=null,o="";const r=xe.getInheritIndentForLine(e.autoIndent,t,i,!1);if(r)n=r.action,o=r.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const c=t.getLineContent(a);if(xo(c)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),d=xe.getEnterAction(e.autoIndent,t,new L(a,l,a,l));d&&(o=d.indentation+d.appendText)}return n&&(n===Ft.Indent&&(o=Ct.shiftIndent(e,o)),n===Ft.Outdent&&(o=Ct.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="",r=i.getStartPosition();if(e.insertSpaces){let a=it.visibleColumnFromColumn2(e,t,r),l=e.indentSize,d=l-a%l;for(let c=0;c<d;c++)o+=" "}else o=" ";return new mi(i,o,n)}static tab(e,t,i){let n=[];for(let o=0,r=i.length;o<r;o++){const a=i[o];if(a.isEmpty()){let l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.isCheapToTokenize(a.startLineNumber)){let d=this._goodIndentForLine(e,t,a.startLineNumber);d=d||" ";let c=e.normalizeIndentation(d);if(!l.startsWith(c)){n[o]=new mi(new L(a.startLineNumber,1,a.startLineNumber,l.length+1),c,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){let l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){n[o]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}n[o]=new Nn(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent})}}return n}static compositionType(e,t,i,n,o,r,a,l){const d=n.map(c=>this._compositionType(i,c,o,r,a,l));return new cn(4,d,{shouldPushStackElementBefore:jg(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),d=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),c=new L(a.lineNumber,l,a.lineNumber,d);return e.getValueInRange(c)===i&&r===0?null:new $p(c,i,0,r)}static _typeCommand(e,t,i){return i?new zg(e,t,!0):new mi(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return Ct._typeCommand(n,`
`,i);if(!t.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){let l=t.getLineContent(n.startLineNumber),d=ct(l).substring(0,n.startColumn-1);return Ct._typeCommand(n,`
`+e.normalizeIndentation(d),i)}const o=xe.getEnterAction(e.autoIndent,t,n);if(o){if(o.indentAction===Ft.None)return Ct._typeCommand(n,`
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Ft.Indent)return Ct._typeCommand(n,`
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Ft.IndentOutdent){const l=e.normalizeIndentation(o.indentation),d=e.normalizeIndentation(o.indentation+o.appendText),c=`
`+d+`
`+l;return i?new zg(n,c,!0):new $p(n,c,-1,d.length-l.length,!0)}else if(o.indentAction===Ft.Outdent){const l=Ct.unshiftIndent(e,o.indentation);return Ct._typeCommand(n,`
`+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=ct(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=xe.getIndentForEnter(e.autoIndent,t,n,{unshiftIndent:d=>Ct.unshiftIndent(e,d),shiftIndent:d=>Ct.shiftIndent(e,d),normalizeIndentation:d=>e.normalizeIndentation(d)});if(l){let d=it.visibleColumnFromColumn2(e,t,n.getEndPosition());const c=n.endColumn,h=t.getLineContent(n.endLineNumber),u=bn(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 zg(n,`
`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return c<=u+1&&(e.insertSpaces||(d=Math.ceil(d/e.indentSize)),f=Math.min(d+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new $p(n,`
`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return Ct._typeCommand(n,`
`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;n<o;n++)if(!t.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const o=xe.getIndentationAtPosition(t,i.startLineNumber,i.startColumn),r=xe.getIndentActionForType(e.autoIndent,t,i,n,{shiftIndent:a=>Ct.shiftIndent(e,a),unshiftIndent:a=>Ct.unshiftIndent(e,a)});if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Ct._typeCommand(new L(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+n,!1):Ct._typeCommand(new L(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r<a;r++){const l=i[r];if(!l.isEmpty())return!1;const d=l.getPosition(),c=t.getLineContent(d.lineNumber);if(c.charAt(d.column-1)!==o)return!1;const u=ec(o);if((d.column>2?c.charCodeAt(d.column-2):0)===92&&u)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let m=0,b=n.length;m<b;m++){const v=n[m];if(d.lineNumber===v.startLineNumber&&d.column===v.startColumn){g=!0;break}}if(!g)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,o){let r=[];for(let a=0,l=n.length;a<l;a++){const c=n[a].getPosition(),h=new L(c.lineNumber,c.column,c.lineNumber,c.column+1);r[a]=new mi(h,o)}return new cn(4,r,{shouldPushStackElementBefore:jg(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(l=>t.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let l=!0;for(const d of i)if(t.getValueInRange(new L(d.lineNumber,d.column-a.open.length+1,d.lineNumber,d.column))+n!==a.open){l=!1;break}l&&(r=a)}return r}static _findSubAutoClosingPairClose(e,t){if(t.open.length<=1)return"";const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o?o.close:""}static _getAutoClosingPairClose(e,t,i,n,o){const r=ec(n),a=r?e.autoClosingQuotes:e.autoClosingBrackets;if(a==="never")return null;const l=this._findAutoClosingPairOpen(e,t,i.map(u=>u.getPosition()),n);if(!l)return null;const d=this._findSubAutoClosingPairClose(e,l);let c=!0;const h=r?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;for(let u=0,f=i.length;u<f;u++){const g=i[u];if(!g.isEmpty())return null;const m=g.getPosition(),b=t.getLineContent(m.lineNumber),v=b.substring(m.column-1);if(v.startsWith(d)||(c=!1),b.length>m.column-1){const C=b.charAt(m.column-1);if(!Ct._isBeforeClosingBrace(e,v)&&!h(C))return null}if(!t.isCheapToTokenize(m.lineNumber))return null;if(l.open.length===1&&r&&a!=="always"){const C=ts(e.wordSeparators);if(o&&m.column>1&&C.get(b.charCodeAt(m.column-2))===0||!o&&m.column>2&&C.get(b.charCodeAt(m.column-3))===0)return null}t.forceTokenization(m.lineNumber);const _=t.getLineTokens(m.lineNumber);let w=!1;try{w=xe.shouldAutoClosePair(l,_,o?m.column:m.column-1)}catch(C){ve(C)}if(!w)return null}return c?l.close.substring(0,l.close.length-d.length):l.close}static _runAutoClosingOpenCharType(e,t,i,n,o,r,a){let l=[];for(let d=0,c=n.length;d<c;d++){const h=n[d];l[d]=new WA(h,o,r,a)}return new cn(4,l,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return ec(t)?e.autoSurround==="quotes"||e.autoSurround==="languageDefined":e.autoSurround==="brackets"||e.autoSurround==="languageDefined"}static _isSurroundSelectionType(e,t,i,n){if(!Ct._shouldSurroundChar(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const o=ec(n);for(let r=0,a=i.length;r<a;r++){const l=i[r];if(l.isEmpty())return!1;let d=!0;for(let c=l.startLineNumber;c<=l.endLineNumber;c++){const h=t.getLineContent(c),u=c===l.startLineNumber?l.startColumn-1:0,f=c===l.endLineNumber?l.endColumn-1:h.length,g=h.substring(u,f);if(/[^ \t]/.test(g)){d=!1;break}}if(d)return!1;if(o&&l.startLineNumber===l.endLineNumber&&l.startColumn+1===l.endColumn){const c=t.getValueInRange(l);if(ec(c))return!1}}return!0}static _runSurroundSelectionType(e,t,i,n,o){let r=[];for(let a=0,l=n.length;a<l;a++){const d=n[a],c=t.surroundingPairs[o];r[a]=new m6(d,o,c)}return new cn(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!!(i.length===1&&t.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,o){if(!t.electricChars.hasOwnProperty(o)||!n.isEmpty())return null;let r=n.getPosition();i.forceTokenization(r.lineNumber);let a=i.getLineTokens(r.lineNumber),l;try{l=xe.onElectricCharacter(o,a,r.column)}catch(d){return ve(d),null}if(!l)return null;if(l.matchOpenBracket){let d=(a.getLineContent()+o).lastIndexOf(l.matchOpenBracket)+1,c=i.findMatchingBracketUp(l.matchOpenBracket,{lineNumber:r.lineNumber,column:d});if(c){if(c.startLineNumber===r.lineNumber)return null;let h=i.getLineContent(c.startLineNumber),u=ct(h),f=t.normalizeIndentation(u),g=i.getLineContent(r.lineNumber),m=i.getLineFirstNonWhitespaceColumn(r.lineNumber)||r.column,b=g.substring(m-1,r.column-1),v=f+b+o,_=new L(r.lineNumber,1,r.lineNumber,r.column);const w=new mi(_,v);return new cn(Tw(v,e),[w],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,n,o,r){if(!n||ee.selectionsArrEqual(n,o))return null;let a=null;for(const d of o){if(!d.isEmpty())return null;const c=d.getPosition(),h=i.getValueInRange(new L(c.lineNumber,c.column-1,c.lineNumber,c.column));if(a===null)a=h;else if(a!==h)return null}if(!a)return null;if(this._isAutoClosingOvertype(t,i,o,r,a)){const d=o.map(c=>new mi(new L(c.positionLineNumber,c.positionColumn,c.positionLineNumber,c.positionColumn+1),"",!1));return new cn(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const l=this._getAutoClosingPairClose(t,i,o,a,!1);return l!==null?this._runAutoClosingOpenCharType(e,t,i,o,a,!1,l):null}static typeWithInterceptors(e,t,i,n,o,r,a){if(!e&&a===`
`){let c=[];for(let h=0,u=o.length;h<u;h++)c[h]=Ct._enter(i,n,!1,o[h]);return new cn(4,c,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,o)){let c=[],h=!1;for(let u=0,f=o.length;u<f;u++)if(c[u]=this._runAutoIndentType(i,n,o[u],a),!c[u]){h=!0;break}if(!h)return new cn(4,c,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoClosingOvertype(i,n,o,r,a))return this._runAutoClosingOvertype(t,i,n,o,a);if(!e){const c=this._getAutoClosingPairClose(i,n,o,a,!0);if(c)return this._runAutoClosingOpenCharType(t,i,n,o,a,!0,c)}if(this._isSurroundSelectionType(i,n,o,a))return this._runSurroundSelectionType(t,i,n,o,a);if(!e&&this._isTypeInterceptorElectricChar(i,n,o)){const c=this._typeInterceptorElectricChar(t,i,n,o[0],a);if(c)return c}let l=[];for(let c=0,h=o.length;c<h;c++)l[c]=new mi(o[c],a);const d=Tw(a,t);return new cn(d,l,{shouldPushStackElementBefore:jg(t,d),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,o){let r=[];for(let l=0,d=n.length;l<d;l++)r[l]=new mi(n[l],o);const a=Tw(o,e);return new cn(a,r,{shouldPushStackElementBefore:jg(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];let n=[];for(let o=0,r=i.length;o<r;o++){let a=i[o].positionLineNumber;if(a===1)n[o]=new zg(new L(1,1,1,1),`
`);else{a--;let l=t.getLineMaxColumn(a);n[o]=this._enter(e,t,!1,new L(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];let n=[];for(let o=0,r=i.length;o<r;o++){const a=i[o].positionLineNumber;let l=t.getLineMaxColumn(a);n[o]=this._enter(e,t,!1,new L(a,l,a,l))}return n}static lineBreakInsert(e,t,i){let n=[];for(let o=0,r=i.length;o<r;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class WA extends $p{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new L(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new L(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}function Tw(s,e){return s===" "?e===5||e===6?6:5:4}function jg(s,e){return II(s)&&!II(e)?!0:s===5?!1:kI(s)!==kI(e)}function kI(s){return s===6||s===5?"space":s}function II(s){return s===4||s===5||s===6}var I;(function(s){s.editorSimpleInput=new se("editorSimpleInput",!1,!0),s.editorTextFocus=new se("editorTextFocus",!1,p("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),s.focus=new se("editorFocus",!1,p("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),s.textInputFocus=new se("textInputFocus",!1,p("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),s.readOnly=new se("editorReadonly",!1,p("editorReadonly","Whether the editor is read only")),s.inDiffEditor=new se("inDiffEditor",!1,p("inDiffEditor","Whether the context is a diff editor")),s.columnSelection=new se("editorColumnSelection",!1,p("editorColumnSelection","Whether `editor.columnSelection` is enabled")),s.writable=s.readOnly.toNegated(),s.hasNonEmptySelection=new se("editorHasSelection",!1,p("editorHasSelection","Whether the editor has text selected")),s.hasOnlyEmptySelection=s.hasNonEmptySelection.toNegated(),s.hasMultipleSelections=new se("editorHasMultipleSelections",!1,p("editorHasMultipleSelections","Whether the editor has multiple selections")),s.hasSingleSelection=s.hasMultipleSelections.toNegated(),s.tabMovesFocus=new se("editorTabMovesFocus",!1,p("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),s.tabDoesNotMoveFocus=s.tabMovesFocus.toNegated(),s.isInWalkThroughSnippet=new se("isInEmbeddedEditor",!1,!0),s.canUndo=new se("canUndo",!1,!0),s.canRedo=new se("canRedo",!1,!0),s.hoverVisible=new se("editorHoverVisible",!1,p("editorHoverVisible","Whether the editor hover is visible")),s.inCompositeEditor=new se("inCompositeEditor",void 0,p("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),s.notInCompositeEditor=s.inCompositeEditor.toNegated(),s.languageId=new se("editorLangId","",p("editorLangId","The language identifier of the editor")),s.hasCompletionItemProvider=new se("editorHasCompletionItemProvider",!1,p("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),s.hasCodeActionsProvider=new se("editorHasCodeActionsProvider",!1,p("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),s.hasCodeLensProvider=new se("editorHasCodeLensProvider",!1,p("editorHasCodeLensProvider","Whether the editor has a code lens provider")),s.hasDefinitionProvider=new se("editorHasDefinitionProvider",!1,p("editorHasDefinitionProvider","Whether the editor has a definition provider")),s.hasDeclarationProvider=new se("editorHasDeclarationProvider",!1,p("editorHasDeclarationProvider","Whether the editor has a declaration provider")),s.hasImplementationProvider=new se("editorHasImplementationProvider",!1,p("editorHasImplementationProvider","Whether the editor has an implementation provider")),s.hasTypeDefinitionProvider=new se("editorHasTypeDefinitionProvider",!1,p("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),s.hasHoverProvider=new se("editorHasHoverProvider",!1,p("editorHasHoverProvider","Whether the editor has a hover provider")),s.hasDocumentHighlightProvider=new se("editorHasDocumentHighlightProvider",!1,p("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),s.hasDocumentSymbolProvider=new se("editorHasDocumentSymbolProvider",!1,p("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),s.hasReferenceProvider=new se("editorHasReferenceProvider",!1,p("editorHasReferenceProvider","Whether the editor has a reference provider")),s.hasRenameProvider=new se("editorHasRenameProvider",!1,p("editorHasRenameProvider","Whether the editor has a rename provider")),s.hasSignatureHelpProvider=new se("editorHasSignatureHelpProvider",!1,p("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),s.hasInlayHintsProvider=new se("editorHasInlayHintsProvider",!1,p("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),s.hasDocumentFormattingProvider=new se("editorHasDocumentFormattingProvider",!1,p("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),s.hasDocumentSelectionFormattingProvider=new se("editorHasDocumentSelectionFormattingProvider",!1,p("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),s.hasMultipleDocumentFormattingProvider=new se("editorHasMultipleDocumentFormattingProvider",!1,p("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),s.hasMultipleDocumentSelectionFormattingProvider=new se("editorHasMultipleDocumentSelectionFormattingProvider",!1,p("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(I||(I={}));const je=0;class Ot extends Di{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}var d_;(function(s){const e=function(i){if(!tn(i))return!1;const n=i;return!(!es(n.to)||!ji(n.by)&&!es(n.by)||!ji(n.value)&&!Ml(n.value)||!ji(n.revealCursor)&&!XM(n.revealCursor))};s.description={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n * 'to': A mandatory direction value.\n ```\n 'up', 'down'\n ```\n * 'by': Unit to move. Default is computed based on 'to' value.\n ```\n 'line', 'wrappedLine', 'page', 'halfPage'\n ```\n * 'value': Number of units to move. Default is '1'.\n * 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n ",constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},s.RawDirection={Up:"up",Down:"down"},s.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage"};function t(i){let n;switch(i.to){case s.RawDirection.Up:n=1;break;case s.RawDirection.Down:n=2;break;default:return null}let o;switch(i.by){case s.RawUnit.Line:o=1;break;case s.RawUnit.WrappedLine:o=2;break;case s.RawUnit.Page:o=3;break;case s.RawUnit.HalfPage:o=4;break;default:o=2}const r=Math.floor(i.value||1),a=!!i.revealCursor;return{direction:n,unit:o,value:r,revealCursor:a,select:!!i.select}}s.parse=t})(d_||(d_={}));var ac;(function(s){const e=function(t){if(!tn(t))return!1;const i=t;return!(!Ml(i.lineNumber)&&!es(i.lineNumber)||!ji(i.at)&&!es(i.at))};s.description={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n * 'lineNumber': A mandatory line number value.\n * 'at': Logical position at which line has to be revealed.\n ```\n 'top', 'center', 'bottom'\n ```\n ",constraint:e,schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},s.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}})(ac||(ac={}));class OS{constructor(e){e.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Ge).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=document.activeElement;return n&&["input","textarea"].indexOf(n.tagName.toLowerCase())>=0?(this.runDOMCommand(),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(Ge).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(t,n,i)):!1})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}var ei;(function(s){class e extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){_.model.pushStackElement(),_.setCursorStates(w.source,3,[ai.moveTo(_,_.getPrimaryCursorState(),this._inSelectionMode,w.position,w.viewPosition)]),_.revealPrimaryCursor(w.source,!0)}}s.MoveTo=G(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),s.MoveToSelect=G(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends Ot{runCoreEditorCommand(_,w){_.model.pushStackElement();const C=this._getColumnSelectResult(_,_.getPrimaryCursorState(),_.getCursorColumnSelectData(),w);_.setCursorStates(w.source,3,C.viewStates.map(S=>Te.fromViewState(S))),_.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:C.fromLineNumber,fromViewVisualColumn:C.fromVisualColumn,toViewLineNumber:C.toLineNumber,toViewVisualColumn:C.toVisualColumn}),C.reversed?_.revealTopMostCursor(w.source):_.revealBottomMostCursor(w.source)}}s.ColumnSelect=G(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,_,w,C){const S=v.model.validatePosition(C.position),D=v.coordinatesConverter.validateViewPosition(new O(C.viewPosition.lineNumber,C.viewPosition.column),S);let y=C.doColumnSelect?w.fromViewLineNumber:D.lineNumber,x=C.doColumnSelect?w.fromViewVisualColumn:C.mouseColumn-1;return rl.columnSelect(v.cursorConfig,v,y,x,D.lineNumber,C.mouseColumn-1)}}),s.CursorColumnSelectLeft=G(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,_,w,C){return rl.columnSelectLeft(v.cursorConfig,v,w)}}),s.CursorColumnSelectRight=G(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,_,w,C){return rl.columnSelectRight(v.cursorConfig,v,w)}});class i extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,w,C,S){return rl.columnSelectUp(_.cursorConfig,_,C,this._isPaged)}}s.CursorColumnSelectUp=G(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:3600,linux:{primary:0}}})),s.CursorColumnSelectPageUp=G(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:3595,linux:{primary:0}}}));class n extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,w,C,S){return rl.columnSelectDown(_.cursorConfig,_,C,this._isPaged)}}s.CursorColumnSelectDown=G(new n({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:3602,linux:{primary:0}}})),s.CursorColumnSelectPageDown=G(new n({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends Ot{constructor(){super({id:"cursorMove",precondition:void 0,description:l_.description})}runCoreEditorCommand(_,w){const C=l_.parse(w);C&&this._runCursorMove(_,w.source,C)}_runCursorMove(_,w,C){_.model.pushStackElement(),_.setCursorStates(w,3,o._move(_,_.getCursorStates(),C)),_.revealPrimaryCursor(w,!0)}static _move(_,w,C){const S=C.select,D=C.value;switch(C.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return ai.simpleMove(_,w,C.direction,S,D,C.unit);case 11:case 13:case 12:case 14:return ai.viewportMove(_,w,C.direction,S,D);default:return null}}}s.CursorMoveImpl=o,s.CursorMove=G(new o);class r extends Ot{constructor(_){super(_),this._staticArgs=_.args}runCoreEditorCommand(_,w){let C=this._staticArgs;this._staticArgs.value===-1&&(C={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:_.cursorConfig.pageSize}),_.model.pushStackElement(),_.setCursorStates(w.source,3,ai.simpleMove(_,_.getCursorStates(),C.direction,C.select,C.value,C.unit)),_.revealPrimaryCursor(w.source,!0)}}s.CursorLeft=G(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),s.CursorLeftSelect=G(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:1039}})),s.CursorRight=G(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),s.CursorRightSelect=G(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:1041}})),s.CursorUp=G(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),s.CursorUpSelect=G(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),s.CursorPageUp=G(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:11}})),s.CursorPageUpSelect=G(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:1035}})),s.CursorDown=G(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),s.CursorDownSelect=G(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),s.CursorPageDown=G(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:12}})),s.CursorPageDownSelect=G(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:1036}})),s.CreateCursor=G(new class extends Ot{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,_){let w;_.wholeLine?w=ai.line(v,v.getPrimaryCursorState(),!1,_.position,_.viewPosition):w=ai.moveTo(v,v.getPrimaryCursorState(),!1,_.position,_.viewPosition);const C=v.getCursorStates();if(C.length>1){const S=w.modelState?w.modelState.position:null,D=w.viewState?w.viewState.position:null;for(let y=0,x=C.length;y<x;y++){const E=C[y];if(!(S&&!E.modelState.selection.containsPosition(S))&&!(D&&!E.viewState.selection.containsPosition(D))){C.splice(y,1),v.model.pushStackElement(),v.setCursorStates(_.source,3,C);return}}}C.push(w),v.model.pushStackElement(),v.setCursorStates(_.source,3,C)}}),s.LastCursorMoveToSelect=G(new class extends Ot{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(v,_){const w=v.getLastAddedCursorIndex(),C=v.getCursorStates(),S=C.slice(0);S[w]=ai.moveTo(v,C[w],!0,_.position,_.viewPosition),v.model.pushStackElement(),v.setCursorStates(_.source,3,S)}});class a extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){_.model.pushStackElement(),_.setCursorStates(w.source,3,ai.moveToBeginningOfLine(_,_.getCursorStates(),this._inSelectionMode)),_.revealPrimaryCursor(w.source,!0)}}s.CursorHome=G(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),s.CursorHomeSelect=G(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){_.model.pushStackElement(),_.setCursorStates(w.source,3,this._exec(_.getCursorStates())),_.revealPrimaryCursor(w.source,!0)}_exec(_){const w=[];for(let C=0,S=_.length;C<S;C++){const D=_[C],y=D.modelState.position.lineNumber;w[C]=Te.fromModelState(D.modelState.move(this._inSelectionMode,y,1,0))}return w}}s.CursorLineStart=G(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:0,mac:{primary:287}}})),s.CursorLineStartSelect=G(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:0,mac:{primary:1311}}}));class d extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){_.model.pushStackElement(),_.setCursorStates(w.source,3,ai.moveToEndOfLine(_,_.getCursorStates(),this._inSelectionMode,w.sticky||!1)),_.revealPrimaryCursor(w.source,!0)}}s.CursorEnd=G(new d({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:je,kbExpr:I.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:p("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),s.CursorEndSelect=G(new d({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:je,kbExpr:I.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:p("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class c extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){_.model.pushStackElement(),_.setCursorStates(w.source,3,this._exec(_,_.getCursorStates())),_.revealPrimaryCursor(w.source,!0)}_exec(_,w){const C=[];for(let S=0,D=w.length;S<D;S++){const y=w[S],x=y.modelState.position.lineNumber,E=_.model.getLineMaxColumn(x);C[S]=Te.fromModelState(y.modelState.move(this._inSelectionMode,x,E,0))}return C}}s.CursorLineEnd=G(new c({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:0,mac:{primary:291}}})),s.CursorLineEndSelect=G(new c({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:0,mac:{primary:1315}}}));class h extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){_.model.pushStackElement(),_.setCursorStates(w.source,3,ai.moveToBeginningOfBuffer(_,_.getCursorStates(),this._inSelectionMode)),_.revealPrimaryCursor(w.source,!0)}}s.CursorTop=G(new h({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:2062,mac:{primary:2064}}})),s.CursorTopSelect=G(new h({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:3086,mac:{primary:3088}}}));class u extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){_.model.pushStackElement(),_.setCursorStates(w.source,3,ai.moveToEndOfBuffer(_,_.getCursorStates(),this._inSelectionMode)),_.revealPrimaryCursor(w.source,!0)}}s.CursorBottom=G(new u({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:2061,mac:{primary:2066}}})),s.CursorBottomSelect=G(new u({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:3085,mac:{primary:3090}}}));class f extends Ot{constructor(){super({id:"editorScroll",precondition:void 0,description:d_.description})}runCoreEditorCommand(_,w){const C=d_.parse(w);C&&this._runEditorScroll(_,w.source,C)}_runEditorScroll(_,w,C){const S=this._computeDesiredScrollTop(_,C);if(C.revealCursor){const D=_.getCompletelyVisibleViewRangeAtScrollTop(S);_.setCursorStates(w,3,[ai.findPositionInViewportIfOutside(_,_.getPrimaryCursorState(),D,C.select)])}_.setScrollTop(S,0)}_computeDesiredScrollTop(_,w){if(w.unit===1){const D=_.getCompletelyVisibleViewRange(),y=_.coordinatesConverter.convertViewRangeToModelRange(D);let x;w.direction===1?x=Math.max(1,y.startLineNumber-w.value):x=Math.min(_.model.getLineCount(),y.startLineNumber+w.value);const E=_.coordinatesConverter.convertModelPositionToViewPosition(new O(x,1));return _.getVerticalOffsetForLineNumber(E.lineNumber)}let C;w.unit===3?C=_.cursorConfig.pageSize*w.value:w.unit===4?C=Math.round(_.cursorConfig.pageSize/2)*w.value:C=w.value;const S=(w.direction===1?-1:1)*C;return _.getScrollTop()+S*_.cursorConfig.lineHeight}}s.EditorScrollImpl=f,s.EditorScroll=G(new f),s.ScrollLineUp=G(new class extends Ot{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(v,_){s.EditorScroll._runEditorScroll(v,_.source,{direction:1,unit:2,value:1,revealCursor:!1,select:!1})}}),s.ScrollPageUp=G(new class extends Ot{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(v,_){s.EditorScroll._runEditorScroll(v,_.source,{direction:1,unit:3,value:1,revealCursor:!1,select:!1})}}),s.ScrollLineDown=G(new class extends Ot{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(v,_){s.EditorScroll._runEditorScroll(v,_.source,{direction:2,unit:2,value:1,revealCursor:!1,select:!1})}}),s.ScrollPageDown=G(new class extends Ot{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(v,_){s.EditorScroll._runEditorScroll(v,_.source,{direction:2,unit:3,value:1,revealCursor:!1,select:!1})}});class g extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){_.model.pushStackElement(),_.setCursorStates(w.source,3,[ai.word(_,_.getPrimaryCursorState(),this._inSelectionMode,w.position)]),_.revealPrimaryCursor(w.source,!0)}}s.WordSelect=G(new g({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),s.WordSelectDrag=G(new g({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),s.LastCursorWordSelect=G(new class extends Ot{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(v,_){const w=v.getLastAddedCursorIndex(),C=v.getCursorStates(),S=C.slice(0),D=C[w];S[w]=ai.word(v,D,D.modelState.hasSelection(),_.position),v.model.pushStackElement(),v.setCursorStates(_.source,3,S)}});class m extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){_.model.pushStackElement(),_.setCursorStates(w.source,3,[ai.line(_,_.getPrimaryCursorState(),this._inSelectionMode,w.position,w.viewPosition)]),_.revealPrimaryCursor(w.source,!1)}}s.LineSelect=G(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),s.LineSelectDrag=G(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class b extends Ot{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){const C=_.getLastAddedCursorIndex(),S=_.getCursorStates(),D=S.slice(0);D[C]=ai.line(_,S[C],this._inSelectionMode,w.position,w.viewPosition),_.model.pushStackElement(),_.setCursorStates(w.source,3,D)}}s.LastCursorLineSelect=G(new b({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),s.LastCursorLineSelectDrag=G(new b({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),s.ExpandLineSelection=G(new class extends Ot{constructor(){super({id:"expandLineSelection",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:2090}})}runCoreEditorCommand(v,_){v.model.pushStackElement(),v.setCursorStates(_.source,3,ai.expandLineSelection(v,v.getCursorStates())),v.revealPrimaryCursor(_.source,!0)}}),s.CancelSelection=G(new class extends Ot{constructor(){super({id:"cancelSelection",precondition:I.hasNonEmptySelection,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(v,_){v.model.pushStackElement(),v.setCursorStates(_.source,3,[ai.cancelSelection(v,v.getPrimaryCursorState())]),v.revealPrimaryCursor(_.source,!0)}}),s.RemoveSecondaryCursors=G(new class extends Ot{constructor(){super({id:"removeSecondaryCursors",precondition:I.hasMultipleSelections,kbOpts:{weight:je+1,kbExpr:I.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(v,_){v.model.pushStackElement(),v.setCursorStates(_.source,3,[v.getPrimaryCursorState()]),v.revealPrimaryCursor(_.source,!0),Xm(p("removedCursor","Removed secondary cursors"))}}),s.RevealLine=G(new class extends Ot{constructor(){super({id:"revealLine",precondition:void 0,description:ac.description})}runCoreEditorCommand(v,_){const w=_,C=w.lineNumber||0;let S=typeof C=="number"?C+1:parseInt(C)+1;S<1&&(S=1);const D=v.model.getLineCount();S>D&&(S=D);const y=new L(S,1,S,v.model.getLineMaxColumn(S));let x=0;if(w.at)switch(w.at){case ac.RawAtArgument.Top:x=3;break;case ac.RawAtArgument.Center:x=1;break;case ac.RawAtArgument.Bottom:x=4;break}const E=v.coordinatesConverter.convertModelRangeToViewRange(y);v.revealRange(_.source,!1,E,x,0)}}),s.SelectAll=new class extends OS{constructor(){super(ZW)}runDOMCommand(){qi&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(v,_,w){const C=_._getViewModel();C&&this.runCoreEditorCommand(C,w)}runCoreEditorCommand(v,_){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[ai.selectAll(v,v.getPrimaryCursorState())])}},s.SetSelection=G(new class extends Ot{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,_){v.model.pushStackElement(),v.setCursorStates(_.source,3,[Te.fromModelSelection(_.selection)])}})})(ei||(ei={}));const _6=J.and(I.textInputFocus,I.columnSelection);function yh(s,e){ln.registerKeybindingRule({id:s,primary:e,when:_6,weight:je+1})}yh(ei.CursorColumnSelectLeft.id,1039);yh(ei.CursorColumnSelectRight.id,1041);yh(ei.CursorColumnSelectUp.id,1040);yh(ei.CursorColumnSelectPageUp.id,1035);yh(ei.CursorColumnSelectDown.id,1042);yh(ei.CursorColumnSelectPageDown.id,1036);function EI(s){return s.register(),s}var Ic;(function(s){class e extends Di{runEditorCommand(i,n,o){const r=n._getViewModel();r&&this.runCoreEditingCommand(n,r,o||{})}}s.CoreEditingCommand=e,s.LineBreakInsert=G(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:I.writable,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Ct.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),s.Outdent=G(new class extends e{constructor(){super({id:"outdent",precondition:I.writable,kbOpts:{weight:je,kbExpr:J.and(I.editorTextFocus,I.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Ct.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.Tab=G(new class extends e{constructor(){super({id:"tab",precondition:I.writable,kbOpts:{weight:je,kbExpr:J.and(I.editorTextFocus,I.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Ct.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.DeleteLeft=G(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,n){const[o,r]=Hl.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),s.DeleteRight=G(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:je,kbExpr:I.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,n){const[o,r]=Hl.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),s.Undo=new class extends OS{constructor(){super(TL)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(78)===!0))return i.getModel().undo()}},s.Redo=new class extends OS{constructor(){super(AL)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(78)===!0))return i.getModel().redo()}}})(Ic||(Ic={}));class NI extends kb{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Ge).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function bd(s,e){EI(new NI("default:"+s,s)),EI(new NI(s,s,e))}bd("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});bd("replacePreviousChar");bd("compositionType");bd("compositionStart");bd("compositionEnd");bd("paste");bd("cut");class b6{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){ei.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new O(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(67)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(67)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=sn&&t.get(94),n=t.get(16);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount>=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount===2?this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){ei.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){ei.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),ei.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),ei.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){ei.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){ei.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){ei.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){ei.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){ei.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){ei.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){ei.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){ei.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){ei.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class Ob{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown&&this.onKeyDown(e)}emitKeyUp(e){this.onKeyUp&&this.onKeyUp(e)}emitContextMenu(e){this.onContextMenu&&this.onContextMenu(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove&&this.onMouseMove(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave&&this.onMouseLeave(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown&&this.onMouseDown(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp&&this.onMouseUp(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag&&this.onMouseDrag(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop&&this.onMouseDrop(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled&&this.onMouseDropCanceled()}emitMouseWheel(e){this.onMouseWheel&&this.onMouseWheel(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return Ob.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){return new v6(e.element,e.type,e.mouseColumn,e.position?t.convertViewPositionToModelPosition(e.position):null,e.range?t.convertViewRangeToModelRange(e.range):null,e.detail)}}class v6{constructor(e,t,i,n,o,r){this.element=e,this.type=t,this.mouseColumn=i,this.position=n,this.range=o,this.detail=r}toString(){return Ps.toString(this)}}var Aw;class VA{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i){const l=t-e+1;return this._rendLineNumberStart-=l,null}if(e>n)return null;let o=0,r=0;for(let l=i;l<=n;l++){const d=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(o=d,r=1):r++)}if(e<i){let l=0;t<i?l=t-e+1:l=i-e,this._rendLineNumberStart-=l}return this._lines.splice(o,r)}onLinesChanged(e,t){if(this.getCount()===0)return!1;const i=this.getStartLineNumber(),n=this.getEndLineNumber();let o=!1;for(let r=e;r<=t;r++)r>=i&&r<=n&&(this._lines[r-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let h=0;h<i;h++)r[h]=this._createLine();const a=e-this._rendLineNumberStart,l=this._lines.slice(0,a),d=this._lines.slice(a,this._lines.length-i),c=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=l.concat(r).concat(d),c}onTokensChanged(e){if(this.getCount()===0)return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let n=!1;for(let o=0,r=e.length;o<r;o++){const a=e[o];if(a.toLineNumber<t||a.fromLineNumber>i)continue;const l=Math.max(t,a.fromLineNumber),d=Math.min(i,a.toLineNumber);for(let c=l;c<=d;c++){const h=c-this._rendLineNumberStart;this._lines[h].onTokensChanged(),n=!0}}return n}}class HA{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new VA(()=>this._host.createVisibleLine())}_createDomNode(){const e=Ue(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(128)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;i<n;i++){const o=t[i].getDomNode();o&&this.domNode.domNode.removeChild(o)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;i<n;i++){const o=t[i].getDomNode();o&&this.domNode.domNode.removeChild(o)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),i=new cr(this.domNode.domNode,this._host,e),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class cr{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,n){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let r=t;r<=i;r++)o.lines[r-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,n),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),n,t),o.rendLineNumberStart>t){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,n,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart<t){const r=Math.min(o.linesLength,t-o.rendLineNumberStart);r>0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const r=o.rendLineNumberStart+o.linesLength,a=i;r<=a&&(this._insertLinesAfter(o,r,a,n,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const r=Math.max(0,i-o.rendLineNumberStart+1),l=o.linesLength-1-r+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const d=r+l;a[l].layoutLine(d,n[d-o])}}_insertLinesBefore(e,t,i,n,o){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const n=e.lines[i].getDomNode();n&&this.domNode.removeChild(n)}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,o){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this.host.createVisibleLine();e.lines=e.lines.concat(r)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let n=0;n<t;n++){const o=e.lines[i+n].getDomNode();o&&this.domNode.removeChild(o)}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,n){cr._ttPolicy&&(i=cr._ttPolicy.createHTML(i));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let r=this.domNode.lastChild;for(let a=e.linesLength-1;a>=0;a--){const l=e.lines[a];n[a]&&(l.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");cr._ttPolicy&&(t=cr._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;o<e.linesLength;o++){const r=e.lines[o];if(i[o]){const a=n.firstChild,l=r.getDomNode();l.parentNode.replaceChild(a,l),r.setDomNode(a)}}}_finishRendering(e,t,i){const n=cr._sb,o=e.linesLength,r=e.lines,a=e.rendLineNumberStart,l=[];{n.reset();let d=!1;for(let c=0;c<o;c++){const h=r[c];l[c]=!1,!(h.getDomNode()||!h.renderLine(c+a,i[c],this.viewportData,n))&&(l[c]=!0,d=!0)}d&&this._finishRenderingNewLines(e,t,n.build(),l)}{n.reset();let d=!1;const c=[];for(let h=0;h<o;h++){const u=r[h];c[h]=!1,!(l[h]||!u.renderLine(h+a,i[h],this.viewportData,n))&&(c[h]=!0,d=!0)}d&&this._finishRenderingInvalidLines(e,n.build(),c)}}}cr._ttPolicy=(Aw=window.trustedTypes)===null||Aw===void 0?void 0:Aw.createPolicy("editorViewLayer",{createHTML:s=>s});cr._sb=Tl(1e5);class zA extends is{constructor(e){super(e),this._visibleLines=new HA(this),this.domNode=this._visibleLines.domNode,this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new w6(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).onConfigurationChanged(e);return!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter(i=>i.shouldRender());for(let i=0,n=t.length;i<n;i++){const o=t[i];o.prepareRender(e),o.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class w6{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(56),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=Ue(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(56)}renderLine(e,t,i,n){let o="";for(let r=0,a=this._dynamicOverlays.length;r<a;r++){const l=this._dynamicOverlays[r];o+=l.render(i.startLineNumber,e)}return this._renderedContent===o?!1:(this._renderedContent=o,n.appendASCIIString('<div style="position:absolute;top:'),n.appendASCIIString(String(t)),n.appendASCIIString("px;width:100%;height:"),n.appendASCIIString(String(this._lineHeight)),n.appendASCIIString('px;">'),n.appendASCIIString(o),n.appendASCIIString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class C6 extends zA{constructor(e){super(e);const i=this._context.configuration.options.get(128);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(128);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class S6 extends zA{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(128);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Wi.applyFontInfo(this.domNode,t.get(40))}onConfigurationChanged(e){const t=this._context.configuration.options;Wi.applyFontInfo(this.domNode,t.get(40));const i=t.get(128);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class Uh{constructor(e,t){this._coordinateBrand=void 0,this.top=e,this.left=t}}class y6 extends is{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Ue(document.createElement("div")),Bo.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Ue(document.createElement("div")),Bo.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onLineMappingChanged(e);return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}addWidget(e){const t=new L6(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i){this._widgets[e.getId()].setPosition(t,i),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const i=this._widgets[t];delete this._widgets[t];const n=i.domNode.domNode;n.parentNode.removeChild(n),n.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}let L6=class{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=Ue(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,o=n.get(128);this._fixedOverflowWidgets=n.get(34),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(56),this._range=null,this._viewRange=null,this._preference=[],this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(56),e.hasChanged(128)){const i=t.get(128);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}onLineMappingChanged(e){this._setPosition(this._range)}_setPosition(e){if(this._range=e,this._viewRange=null,this._range){const t=this._context.model.validateModelRange(this._range);(this._context.model.coordinatesConverter.modelPositionIsVisible(t.getStartPosition())||this._context.model.coordinatesConverter.modelPositionIsVisible(t.getEndPosition()))&&(this._viewRange=this._context.model.coordinatesConverter.convertModelRangeToViewRange(t))}}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:this._contentWidth}setPosition(e,t){this._setPosition(e),this._preference=t,this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1}_layoutBoxInViewport(e,t,i,n,o){const r=e.top,a=r,l=t.top+this._lineHeight,d=o.viewportHeight-l,c=r-n,h=a>=n,u=l,f=d>=n;let g=e.left,m=t.left;return g+i>o.scrollLeft+o.viewportWidth&&(g=o.scrollLeft+o.viewportWidth-i),m+i>o.scrollLeft+o.viewportWidth&&(m=o.scrollLeft+o.viewportWidth-i),g<o.scrollLeft&&(g=o.scrollLeft),m<o.scrollLeft&&(m=o.scrollLeft),{fitsAbove:h,aboveTop:c,aboveLeft:g,fitsBelow:f,belowTop:u,belowLeft:m}}_layoutHorizontalSegmentInPage(e,t,i,n){const o=Math.max(0,t.left-n),r=Math.min(t.left+t.width+n,e.width);let a=t.left+i-_r.scrollX;if(a+n>r){const l=a-(r-n);a-=l,i-=l}if(a<o){const l=a-o;a-=l,i-=l}return[i,a]}_layoutBoxInPage(e,t,i,n,o){const r=e.top-n,a=t.top+this._lineHeight,l=vi(this._viewDomNode.domNode),d=l.top+r-_r.scrollY,c=l.top+a-_r.scrollY,h=eb(document.body),[u,f]=this._layoutHorizontalSegmentInPage(h,l,e.left-o.scrollLeft+this._contentLeft,i),[g,m]=this._layoutHorizontalSegmentInPage(h,l,t.left-o.scrollLeft+this._contentLeft,i),b=22,v=22,_=d>=b,w=c+n<=h.height-v;return this._fixedOverflowWidgets?{fitsAbove:_,aboveTop:Math.max(d,b),aboveLeft:f,fitsBelow:w,belowTop:c,belowLeft:m}:{fitsAbove:_,aboveTop:r,aboveLeft:u,fitsBelow:w,belowTop:a,belowLeft:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Uh(e.top,e.left+this._contentLeft)}_getTopAndBottomLeft(e){if(!this._viewRange)return[null,null];const t=e.linesVisibleRangesForRange(this._viewRange,!1);if(!t||t.length===0)return[null,null];let i=t[0],n=t[0];for(const h of t)h.lineNumber<i.lineNumber&&(i=h),h.lineNumber>n.lineNumber&&(n=h);let o=1073741824;for(const h of i.ranges)h.left<o&&(o=h.left);let r=1073741824;for(const h of n.ranges)h.left<r&&(r=h.left);const a=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.scrollTop,l=new Uh(a,o),d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.scrollTop,c=new Uh(d,r);return[l,c]}_prepareRenderWidget(e){const[t,i]=this._getTopAndBottomLeft(e);if(!t||!i)return null;if(this._cachedDomNodeClientWidth===-1||this._cachedDomNodeClientHeight===-1){let o=null;if(typeof this._actual.beforeRender=="function"&&(o=Rw(this._actual.beforeRender,this._actual)),o)this._cachedDomNodeClientWidth=o.width,this._cachedDomNodeClientHeight=o.height;else{const r=this.domNode.domNode;this._cachedDomNodeClientWidth=r.clientWidth,this._cachedDomNodeClientHeight=r.clientHeight}}let n;if(this.allowEditorOverflow?n=this._layoutBoxInPage(t,i,this._cachedDomNodeClientWidth,this._cachedDomNodeClientHeight,e):n=this._layoutBoxInViewport(t,i,this._cachedDomNodeClientWidth,this._cachedDomNodeClientHeight,e),this._preference)for(let o=1;o<=2;o++)for(const r of this._preference)if(r===1){if(!n)return null;if(o===2||n.fitsAbove)return{coordinate:new Uh(n.aboveTop,n.aboveLeft),position:1}}else if(r===2){if(!n)return null;if(o===2||n.fitsBelow)return{coordinate:new Uh(n.belowTop,n.belowLeft),position:2}}else return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(t),position:0}:{coordinate:t,position:0};return null}onBeforeRender(e){!this._viewRange||!this._preference||this._viewRange.endLineNumber<e.startLineNumber||this._viewRange.startLineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&Rw(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&Rw(this._actual.afterRender,this._actual,this._renderData.position)}};function Rw(s,e,...t){try{return s.call(e,...t)}catch{return null}}let PS=!0;class UA extends Sh{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(128);this._lineHeight=t.get(56),this._renderLineHighlight=t.get(83),this._renderLineHighlightOnlyWhenFocus=t.get(84),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ee(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=PS?this._selections.slice(0,1):this._selections,i=t.map(o=>o.positionLineNumber);i.sort((o,r)=>o-r),Ss(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=t.every(o=>o.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(128);return this._lineHeight=t.get(56),this._renderLineHighlight=t.get(83),this._renderLineHighlightOnlyWhenFocus=t.get(84),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let r=0;const a=[];for(let l=i;l<=n;l++){const d=l-i;for(;r<o&&this._cursorLineNumbers[r]<l;)r++;r<o&&this._cursorLineNumbers[r]===l?a[d]=t:a[d]=""}this._renderData=a}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}}class x6 extends UA{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderOther()?" current-line-both":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderOther(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class D6 extends UA{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderThis(){return!0}_shouldRenderOther(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}tt((s,e)=>{PS=!1;const t=s.getColor(q8);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||s.defines(DI)){const i=s.getColor(DI);i&&(PS=!0,e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),s.type==="hc"&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class k6 extends Sh{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(56),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(56),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let l=0,d=t.length;l<d;l++){const c=t[l];c.options.className&&(i[n++]=c)}i=i.sort((l,d)=>{if(l.options.zIndex<d.options.zIndex)return-1;if(l.options.zIndex>d.options.zIndex)return 1;const c=l.options.className,h=d.options.className;return c<h?-1:c>h?1:L.compareRangesUsingStarts(l.range,d.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=r;l++){const d=l-o;a[d]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a<l;a++){const d=t[a];if(!d.options.isWholeLine)continue;const c='<div class="cdr '+d.options.className+'" style="left:0;width:100%;height:'+n+'px;"></div>',h=Math.max(d.range.startLineNumber,o),u=Math.min(d.range.endLineNumber,r);for(let f=h;f<=u;f++){const g=f-o;i[g]+=c}}}_renderNormalDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber;let r=null,a=!1,l=null;for(let d=0,c=t.length;d<c;d++){const h=t[d];if(h.options.isWholeLine)continue;const u=h.options.className,f=!!h.options.showIfCollapsed;let g=h.range;if(f&&g.endColumn===1&&g.endLineNumber!==g.startLineNumber&&(g=new L(g.startLineNumber,g.startColumn,g.endLineNumber-1,this._context.model.getLineMaxColumn(g.endLineNumber-1))),r===u&&a===f&&L.areIntersectingOrTouching(l,g)){l=L.plusRange(l,g);continue}r!==null&&this._renderNormalDecoration(e,l,r,a,n,o,i),r=u,a=f,l=g}r!==null&&this._renderNormalDecoration(e,l,r,a,n,o,i)}_renderNormalDecoration(e,t,i,n,o,r,a){const l=e.linesVisibleRangesForRange(t,i==="findMatch");if(l)for(let d=0,c=l.length;d<c;d++){const h=l[d];if(h.outsideRenderedLine)continue;const u=h.lineNumber-r;if(n&&h.ranges.length===1){const f=h.ranges[0];f.width===0&&(h.ranges[0]=new aa(f.left,this._typicalHalfwidthCharacterWidth))}for(let f=0,g=h.ranges.length;f<g;f++){const m=h.ranges[f],b='<div class="cdr '+i+'" style="left:'+String(m.left)+"px;width:"+String(m.width)+"px;height:"+o+'px;"></div>';a[u]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Vn extends U{onclick(e,t){this._register(K(e,le.CLICK,i=>t(new Zn(i))))}onmousedown(e,t){this._register(K(e,le.MOUSE_DOWN,i=>t(new Zn(i))))}onmouseover(e,t){this._register(K(e,le.MOUSE_OVER,i=>t(new Zn(i))))}onnonbubblingmouseout(e,t){this._register(Ky(e,i=>t(new Zn(i))))}onkeydown(e,t){this._register(K(e,le.KEY_DOWN,i=>t(new Mt(i))))}onkeyup(e,t){this._register(K(e,le.KEY_UP,i=>t(new Mt(i))))}oninput(e,t){this._register(K(e,le.INPUT,t))}onblur(e,t){this._register(K(e,le.BLUR,t))}onfocus(e,t){this._register(K(e,le.FOCUS,t))}ignoreGesture(e){ot.ignoreTarget(e)}}const Kc=11;class I6 extends Vn{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...e.icon.classNamesArray),this.domNode.style.position="absolute",this.domNode.style.width=Kc+"px",this.domNode.style.height=Kc+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new _d),this.onmousedown(this.bgDomNode,t=>this._arrowMouseDown(t)),this.onmousedown(this.domNode,t=>this._arrowMouseDown(t)),this._mousedownRepeatTimer=this._register(new Xf),this._mousedownScheduleRepeatTimer=this._register(new an)}_arrowMouseDown(e){const t=()=>{this._mousedownRepeatTimer.cancelAndSet(()=>this._onActivate(),41.666666666666664)};this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet(t,200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,Ch,i=>{},()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class E6 extends U{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new an)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode&&this._domNode.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode&&this._domNode.setClassName(this._invisibleClassName+(e?" fade":"")))}}const N6=140;class $A extends Vn{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new E6(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new _d),this._shouldRender=!0,this.domNode=Ue(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this.onmousedown(this.domNode.domNode,t=>this._domNodeMouseDown(t))}_createArrow(e){const t=this._register(new I6(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Ue(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this.onmousedown(this.slider.domNode,o=>{o.leftButton&&(o.preventDefault(),this._sliderMouseDown(o,()=>{}))}),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodeMouseDown(e){e.target===this.domNode.domNode&&this._onMouseDown(e)}delegateMouseDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderMousePosition(e);i<=o&&o<=n?e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{})):this._onMouseDown(e)}_onMouseDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.browserEvent.offsetX=="number"&&typeof e.browserEvent.offsetY=="number")t=e.browserEvent.offsetX,i=e.browserEvent.offsetY;else{const o=vi(this.domNode.domNode);t=e.posx-o.left,i=e.posy-o.top}const n=this._mouseDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{}))}_sliderMouseDown(e,t){const i=this._sliderMousePosition(e),n=this._sliderOrthogonalMousePosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,Ch,r=>{const a=this._sliderOrthogonalMousePosition(r),l=Math.abs(a-n);if(Si&&l>N6){this._setDesiredScrollPositionNow(o.getScrollPosition());return}const c=this._sliderMousePosition(r)-i;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd(),t()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const M6=20;class lf{constructor(e,t,i,n,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new lf(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),l=n>0&&n>i;if(!l)return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const d=Math.round(Math.max(M6,Math.floor(i*a/n))),c=(a-d)/(n-i),h=o*c;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(d),computedSliderRatio:c,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=lf._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}const T6=Ns("scrollbar-button-left",te.triangleLeft),A6=Ns("scrollbar-button-right",te.triangleRight);class R6 extends $A{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new lf(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const r=(t.arrowSize-Kc)/2,a=(t.horizontalScrollbarSize-Kc)/2;this._createArrow({className:"scra",icon:T6,top:a,left:r,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Pc(null,1,0))}),this._createArrow({className:"scra",icon:A6,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Pc(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return e}_sliderMousePosition(e){return e.posx}_sliderOrthogonalMousePosition(e){return e.posy}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}const O6=Ns("scrollbar-button-up",te.triangleUp),P6=Ns("scrollbar-button-down",te.triangleDown);class F6 extends $A{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new lf(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-Kc)/2,a=(t.verticalScrollbarSize-Kc)/2;this._createArrow({className:"scra",icon:O6,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Pc(null,0,1))}),this._createArrow({className:"scra",icon:P6,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Pc(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return t}_sliderMousePosition(e){return e.posy}_sliderOrthogonalMousePosition(e){return e.posx}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class c_{constructor(e,t,i,n,o,r){this._scrollStateBrand=void 0,e=e|0,t=t|0,i=i|0,n=n|0,o=o|0,r=r|0,this.rawScrollLeft=i,this.rawScrollTop=r,e<0&&(e=0),i+e>t&&(i=t-e),i<0&&(i=0),n<0&&(n=0),r+n>o&&(r=o-n),r<0&&(r=0),this.width=e,this.scrollWidth=t,this.scrollLeft=i,this.height=n,this.scrollHeight=o,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new c_(typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new c_(this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:o,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}}class Pb extends U{constructor(e,t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new M),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e,this._scheduleAtNextAnimationFrame=t,this._state=new c_(0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;t?n=new df(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=df.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class MI{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function Ow(s,e){const t=e-s;return function(i){return s+t*V6(i)}}function B6(s,e,t){return function(i){return i<t?s(i/t):e((i-t)/(1-t))}}class df{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let o,r;return e<t?(o=e+.75*i,r=t-.75*i):(o=e-.75*i,r=t+.75*i),B6(Ow(e,o),Ow(r,t),.33)}return Ow(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const i=this.scrollLeft(t),n=this.scrollTop(t);return new MI(i,n,!1)}return new MI(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return df.start(e,t,i)}static start(e,t,i){i=i+10;const n=Date.now()-10;return new df(e,t,n,i)}}function W6(s){return Math.pow(s,3)}function V6(s){return 1-W6(1-s)}const H6=500,TI=50;class z6{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class FS{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,n=this._rear;do{const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(!0);return t<=.5}accept(e,t,i){const n=new z6(e,t,i);n.score=this._computeScore(n),this._front===-1&&this._rear===-1?(this._memory[0]=n,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}FS.INSTANCE=new FS;class jA extends Vn{constructor(e,t,i){super(),this._onScroll=this._register(new M),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new M),e.style.overflow="hidden",this._options=U6(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const n={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new F6(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new R6(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Ue(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Ue(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Ue(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onnonbubblingmouseout(this._listenOnDomNode,o=>this._onMouseOut(o)),this._hideTimeout=this._register(new an),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=$e(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarMouseDown(e){this._verticalScrollbar.delegateMouseDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Re&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=$e(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new Pc(n))};this._mouseWheelToDispose.push(K(this._listenOnDomNode,le.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){const t=FS.INSTANCE;{const o=window.devicePixelRatio/W4();Si||sn?t.accept(Date.now(),e.deltaX/o,e.deltaY/o):t.accept(Date.now(),e.deltaX,e.deltaY)}let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(o)>=Math.abs(r)?r=0:o=0),this._options.flipAxes&&([o,r]=[r,o]);const a=!Re&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!r&&(r=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(r=r*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const l=this._scrollable.getFutureScrollPosition();let d={};if(o){const c=l.scrollTop-TI*o;this._verticalScrollbar.writeScrollPosition(d,c)}if(r){const c=l.scrollLeft-TI*r;this._horizontalScrollbar.writeScrollPosition(d,c)}d=this._scrollable.validateScrollPosition(d),(l.scrollLeft!==d.scrollLeft||l.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseOut(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),H6)}}class ox extends jA{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Pb(0,n=>Ro(n));super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class rx extends jA{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class sg extends ox{constructor(e,t){super(e,t),this._element=e,this.onScroll(i=>{i.scrollTopChanged&&(this._element.scrollTop=i.scrollTop),i.scrollLeftChanged&&(this._element.scrollLeft=i.scrollLeft)}),this.scanDomNode()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function U6(s){const e={lazyRender:typeof s.lazyRender<"u"?s.lazyRender:!1,className:typeof s.className<"u"?s.className:"",useShadows:typeof s.useShadows<"u"?s.useShadows:!0,handleMouseWheel:typeof s.handleMouseWheel<"u"?s.handleMouseWheel:!0,flipAxes:typeof s.flipAxes<"u"?s.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s.consumeMouseWheelIfScrollbarIsNeeded<"u"?s.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s.alwaysConsumeMouseWheel<"u"?s.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s.scrollYToX<"u"?s.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s.mouseWheelScrollSensitivity<"u"?s.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s.fastScrollSensitivity<"u"?s.fastScrollSensitivity:5,scrollPredominantAxis:typeof s.scrollPredominantAxis<"u"?s.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s.mouseWheelSmoothScroll<"u"?s.mouseWheelSmoothScroll:!0,arrowSize:typeof s.arrowSize<"u"?s.arrowSize:11,listenOnDomNode:typeof s.listenOnDomNode<"u"?s.listenOnDomNode:null,horizontal:typeof s.horizontal<"u"?s.horizontal:1,horizontalScrollbarSize:typeof s.horizontalScrollbarSize<"u"?s.horizontalScrollbarSize:10,horizontalSliderSize:typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:0,horizontalHasArrows:typeof s.horizontalHasArrows<"u"?s.horizontalHasArrows:!1,vertical:typeof s.vertical<"u"?s.vertical:1,verticalScrollbarSize:typeof s.verticalScrollbarSize<"u"?s.verticalScrollbarSize:10,verticalHasArrows:typeof s.verticalHasArrows<"u"?s.verticalHasArrows:!1,verticalSliderSize:typeof s.verticalSliderSize<"u"?s.verticalSliderSize:0,scrollByPage:typeof s.scrollByPage<"u"?s.scrollByPage:!1};return e.horizontalSliderSize=typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof s.verticalSliderSize<"u"?s.verticalSliderSize:e.verticalScrollbarSize,Re&&(e.className+=" mac"),e}class $6 extends is{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,r=o.get(90),a=o.get(64),l=o.get(32),d=o.get(93),c={listenOnDomNode:i.domNode,className:"editor-scrollable "+t_(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:d,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new rx(t.domNode,c,this._context.viewLayout.getScrollable())),Bo.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=Ue(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const h=(u,f,g)=>{const m={};{const b=u.scrollTop;b&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+b,u.scrollTop=0)}if(g){const b=u.scrollLeft;b&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+b,u.scrollLeft=0)}this._context.model.setScrollPosition(m,1)};this._register(K(i.domNode,"scroll",u=>h(i.domNode,!0,!0))),this._register(K(t.domNode,"scroll",u=>h(t.domNode,!0,!1))),this._register(K(n.domNode,"scroll",u=>h(n.domNode,!0,!1))),this._register(K(this.scrollbarDomNode.domNode,"scroll",u=>h(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(128);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(62).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarMouseDown(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)}onConfigurationChanged(e){if(e.hasChanged(90)||e.hasChanged(64)||e.hasChanged(32)){const t=this._context.configuration.options,i=t.get(90),n=t.get(64),o=t.get(32),r=t.get(93),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(128)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+t_(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class h_{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class ax extends Sh{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const l=a-e;n[l]=[]}if(i.length===0)return n;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.className<l.className?-1:1);let o=null,r=0;for(let a=0,l=i.length;a<l;a++){const d=i[a],c=d.className;let h=Math.max(d.startLineNumber,e)-e;const u=Math.min(d.endLineNumber,t)-e;o===c?(h=Math.max(r+1,h),r=Math.max(r,u)):(o=c,r=u);for(let f=h;f<=r;f++)n[f].push(o)}return n}}class j6 extends ax{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(128);this._lineHeight=t.get(56),this._glyphMargin=t.get(46),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(128);return this._lineHeight=t.get(56),this._glyphMargin=t.get(46),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.options.glyphMarginClassName;l&&(i[n++]=new h_(a.range.startLineNumber,a.range.endLineNumber,l))}return i}prepareRender(e){if(!this._glyphMargin){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=this._lineHeight.toString(),r=this._glyphMarginLeft.toString(),a=this._glyphMarginWidth.toString(),l='" style="left:'+r+"px;width:"+a+"px;height:"+o+'px;"></div>',d=[];for(let c=t;c<=i;c++){const h=c-t,u=n[h];u.length===0?d[h]="":d[h]='<div class="cgmr codicon '+u.join(" ")+l}this._renderResult=d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class q6 extends Sh{constructor(e){super(),this._context=e,this._primaryLineNumber=0;const t=this._context.configuration.options,i=t.get(129),n=t.get(40);this._lineHeight=t.get(56),this._spaceWidth=n.spaceWidth,this._enabled=t.get(81),this._activeIndentEnabled=t.get(49),this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129),n=t.get(40);return this._lineHeight=t.get(56),this._spaceWidth=n.spaceWidth,this._enabled=t.get(81),this._activeIndentEnabled=t.get(49),this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){const t=e.selections[0],i=t.isEmpty()?t.positionLineNumber:0;return this._primaryLineNumber!==i?(this._primaryLineNumber=i,!0):!1}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){if(!this._enabled){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,{indentSize:n}=this._context.model.getTextModelOptions(),o=n*this._spaceWidth,r=e.scrollWidth,a=this._lineHeight,l=this._context.model.getLinesIndentGuides(t,i);let d=0,c=0,h=0;if(this._activeIndentEnabled&&this._primaryLineNumber){const f=this._context.model.getActiveIndentGuide(this._primaryLineNumber,t,i);d=f.startLineNumber,c=f.endLineNumber,h=f.indent}const u=[];for(let f=t;f<=i;f++){const g=d<=f&&f<=c,m=f-t,b=l[m];let v="";if(b>=1){const _=e.visibleRangeForPosition(new O(f,1));let w=_?_.left:0;for(let C=1;C<=b&&(v+=`<div class="${g&&C===h?"cigra":"cigr"}" style="left:${w}px;height:${a}px;width:${o}px"></div>`,w+=o,!(w>r||this._maxIndentLeft>0&&w>this._maxIndentLeft));C++);}u[m]=v}this._renderResult=u}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}tt((s,e)=>{const t=s.getColor(Tb);t&&e.addRule(`.monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 ${t} inset; }`);const i=s.getColor(Ab)||t;i&&e.addRule(`.monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 ${i} inset; }`)});class K6{constructor(){this._currentVisibleRange=new L(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class G6{constructor(e,t,i,n,o,r){this.lineNumber=e,this.startColumn=t,this.endColumn=i,this.startScrollTop=n,this.stopScrollTop=o,this.scrollType=r,this.type="range",this.minLineNumber=e,this.maxLineNumber=e}}class Z6{constructor(e,t,i,n){this.selections=e,this.startScrollTop=t,this.stopScrollTop=i,this.scrollType=n,this.type="selections";let o=e[0].startLineNumber,r=e[0].endLineNumber;for(let a=1,l=e.length;a<l;a++){const d=e[a];o=Math.min(o,d.startLineNumber),r=Math.max(r,d.endLineNumber)}this.minLineNumber=o,this.maxLineNumber=r}}class Fb extends is{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new HA(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,n=this._context.configuration.options,o=n.get(40),r=n.get(129);this._lineHeight=n.get(56),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=n.get(87),this._cursorSurroundingLines=n.get(23),this._cursorSurroundingLinesStyle=n.get(24),this._canUseLayerHinting=!n.get(26),this._viewLineOptions=new Jk(i,this._context.theme.type),Bo.write(this.domNode,7),this.domNode.setClassName(`view-lines ${xl}`),Wi.applyFontInfo(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new bt(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new bt(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new K6,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new vo(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(129)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(40),n=t.get(129);return this._lineHeight=t.get(56),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(87),this._cursorSurroundingLines=t.get(23),this._cursorSurroundingLinesStyle=t.get(24),this._canUseLayerHinting=!t.get(26),Wi.applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(128)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Jk(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new G6(e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Z6(e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.model.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.model.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const n=this._getLineNumberFor(i);if(n===-1||n<1||n>this._context.model.getLineCount())return null;if(this._context.model.getLineMaxColumn(n)===1)return new O(n,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(n<o||n>r)return null;let a=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(n,e,t);const l=this._context.model.getLineMinColumn(n);return a<l&&(a=l),new O(n,a)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===vo.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++){const o=this._visibleLines.getVisibleLine(n);if(e===o.getDomNode())return n}return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();return e<t||e>i?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=L.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let o=[],r=0;const a=new Qk(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new O(n.startLineNumber,1)).lineNumber);const d=this._visibleLines.getStartLineNumber(),c=this._visibleLines.getEndLineNumber();for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(h<d||h>c)continue;const u=h===n.startLineNumber?n.startColumn:1,f=h===n.endLineNumber?n.endColumn:this._context.model.getLineMaxColumn(h),g=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(u,f,a);if(g){if(t&&h<i){const m=l;l=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new O(h+1,1)).lineNumber,m!==l&&(g.ranges[g.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[r++]=new lV(g.outsideRenderedLine,h,g.ranges)}}return r===0?null:o}_visibleRangesForLineRange(e,t,i){return this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(t,i,new Qk(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new dV(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}n=Math.max(n,a.getWidth())}return o&&t===1&&i===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth();a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const n=this._computeScrollLeftToReveal(i);n&&(this._isViewportWrapping||this._ensureMaxLineWidth(n.maxHorizontalOffset),this._context.model.setScrollPosition({scrollLeft:n.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),sn&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.model.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,o){const r=e.top,a=e.height,l=r+a;let d,c,h;if(n&&n.length>0){let g=n[0].startLineNumber,m=n[0].endLineNumber;for(let b=1,v=n.length;b<v;b++){const _=n[b];g=Math.min(g,_.startLineNumber),m=Math.max(m,_.endLineNumber)}d=!1,c=this._context.viewLayout.getVerticalOffsetForLineNumber(g),h=this._context.viewLayout.getVerticalOffsetForLineNumber(m)+this._lineHeight}else if(i)d=!0,c=this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber),h=this._context.viewLayout.getVerticalOffsetForLineNumber(i.endLineNumber)+this._lineHeight;else return-1;if(!(t==="mouse"&&this._cursorSurroundingLinesStyle==="default")){const g=Math.min(a/this._lineHeight/2,this._cursorSurroundingLines);c-=g*this._lineHeight,h+=Math.max(0,g-1)*this._lineHeight}(o===0||o===4)&&(h+=this._lineHeight);let f;if(h-c>a){if(!d)return-1;f=c}else if(o===5||o===6)if(o===6&&r<=c&&h<=l)f=r;else{const g=Math.max(5*this._lineHeight,a*.2),m=c-g,b=h-a;f=Math.max(b,m)}else if(o===1||o===2)if(o===2&&r<=c&&h<=l)f=r;else{const g=(c+h)/2;f=Math.max(0,g-a/2)}else f=this._computeMinimumScrolling(r,l,c,h,o===3,o===4);return f}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=t.left,n=i+t.width;let o=1073741824,r=0;if(e.type==="range"){const l=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!l)return null;for(const d of l.ranges)o=Math.min(o,d.left),r=Math.max(r,d.left+d.width)}else for(const l of e.selections){if(l.startLineNumber!==l.endLineNumber)return null;const d=this._visibleRangesForLineRange(l.startLineNumber,l.startColumn,l.endColumn);if(!d)return null;for(const c of d.ranges)o=Math.min(o,c.left),r=Math.max(r,c.left+c.width)}return o=Math.max(0,o-Fb.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding,e.type==="selections"&&r-o>t.width?null:{scrollLeft:this._computeMinimumScrolling(i,n,o,r),maxHorizontalOffset:r}}_computeMinimumScrolling(e,t,i,n,o,r){e=e|0,t=t|0,i=i|0,n=n|0,o=!!o,r=!!r;const a=t-e;if(n-i<a){if(o)return i;if(r)return Math.max(0,n-a);if(i<e)return i;if(n>t)return Math.max(0,n-a)}else return i;return e}}Fb.HORIZONTAL_EXTRA_PX=30;class Y6 extends ax{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(128);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(128);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.options.linesDecorationsClassName;l&&(i[n++]=new h_(a.range.startLineNumber,a.range.endLineNumber,l));const d=a.options.firstLineDecorationClassName;d&&(i[n++]=new h_(a.range.startLineNumber,a.range.startLineNumber,d))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=this._decorationsLeft.toString(),r=this._decorationsWidth.toString(),a='" style="left:'+o+"px;width:"+r+'px;"></div>',l=[];for(let d=t;d<=i;d++){const c=d-t,h=n[c];let u="";for(let f=0,g=h.length;f<g;f++)u+='<div class="cldr '+h[f]+a;l[c]=u}this._renderResult=l}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class X6 extends ax{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.options.marginClassName;l&&(i[n++]=new h_(a.range.startLineNumber,a.range.endLineNumber,l))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=[];for(let r=t;r<=i;r++){const a=r-t,l=n[a];let d="";for(let c=0,h=l.length;c<h;c++)d+='<div class="cmdr '+l[c]+'" style=""></div>';o[a]=d}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class qs{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=qs._clamp(e),this.g=qs._clamp(t),this.b=qs._clamp(i),this.a=qs._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}qs.Empty=new qs(0,0,0,0);class og{constructor(){this._onDidChange=new M,this.onDidChange=this._onDidChange.event,this._updateColorMap(),St.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()})}static getInstance(){return this._INSTANCE||(this._INSTANCE=new og),this._INSTANCE}_updateColorMap(){const e=St.getColorMap();if(!e){this._colors=[qs.Empty],this._backgroundIsLight=!0;return}this._colors=[qs.Empty];for(let i=1;i<e.length;i++){const n=e[i].rgba;this._colors[i]=new qs(n.r,n.g,n.b,Math.round(n.a*255))}let t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}og._INSTANCE=null;const Q6=(()=>{const s=[];for(let e=32;e<=126;e++)s.push(e);return s.push(65533),s})(),J6=(s,e)=>(s-=32,s<0||s>96?e<=2?(s+96)%96:95:s);class cf{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=cf.soften(e,12/15),this.charDataLight=cf.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=Bm(e[n]*t);return i}renderChar(e,t,i,n,o,r,a,l,d){const c=1*this.scale,h=2*this.scale,u=d?1:h;if(t+c>e.width||i+u>e.height){console.warn("bad render request outside image data");return}const f=l?this.charDataLight:this.charDataNormal,g=J6(n,a),m=e.width*4,b=r.r,v=r.g,_=r.b,w=o.r-b,C=o.g-v,S=o.b-_,D=e.data;let y=g*c*h,x=i*m+t*4;for(let E=0;E<u;E++){let P=x;for(let A=0;A<c;A++){const H=f[y++]/255;D[P++]=b+w*H,D[P++]=v+C*H,D[P++]=_+S*H,P++}x+=m}}blockRenderChar(e,t,i,n,o,r,a){const l=1*this.scale,d=2*this.scale,c=a?1:d;if(t+l>e.width||i+c>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,u=.5,f=o.r,g=o.g,m=o.b,b=n.r-f,v=n.g-g,_=n.b-m,w=f+b*u,C=g+v*u,S=m+_*u,D=e.data;let y=i*h+t*4;for(let x=0;x<c;x++){let E=y;for(let P=0;P<l;P++)D[E++]=w,D[E++]=C,D[E++]=S,E++;y+=h}}}function ya(s){const e=this;let t=!1,i;return function(){return t||(t=!0,i=s.apply(e,arguments)),i}}const AI={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},RI=s=>{const e=new Uint8ClampedArray(s.length/2);for(let t=0;t<s.length;t+=2)e[t>>1]=AI[s[t]]<<4|AI[s[t+1]]&15;return e},OI={1:ya(()=>RI("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:ya(()=>RI("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class Nu{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return OI[e]?i=new cf(OI[e](),e):i=Nu.createFromSampleData(Nu.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const o of Q6)i.fillText(String.fromCharCode(o),n,16/2),n+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");let n=Nu._downsample(e,t);return new cf(n,t)}static _downsampleChar(e,t,i,n,o){const r=1*o,a=2*o;let l=n,d=0;for(let c=0;c<a;c++){const h=c/a*16,u=(c+1)/a*16;for(let f=0;f<r;f++){const g=f/r*10,m=(f+1)/r*10;let b=0,v=0;for(let w=h;w<u;w++){const C=t+Math.floor(w)*3840,S=1-(w-Math.floor(w));for(let D=g;D<m;D++){const y=1-(D-Math.floor(D)),x=C+Math.floor(D)*4,E=y*S;v+=E,b+=e[x]*e[x+3]/255*E}}const _=b/v;d=Math.max(d,_),i[l++]=Bm(_)}}return d}static _downsample(e,t){const i=2*t*1*t,n=i*96,o=new Uint8ClampedArray(n);let r=0,a=0,l=0;for(let d=0;d<96;d++)l=Math.max(l,this._downsampleChar(e,a,o,r,t)),r+=i,a+=10*4;if(l>0){const d=255/l;for(let c=0;c<n;c++)o[c]*=d}return o}}const eH=140,tH=2;class u_{constructor(e,t,i){const n=e.options,o=n.get(126),r=n.get(128),a=r.minimap,l=n.get(40),d=n.get(62);this.renderMinimap=a.renderMinimap,this.size=d.size,this.minimapHeightIsEditorHeight=a.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(92),this.showSlider=d.showSlider,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(56),this.minimapLeft=a.minimapLeft,this.minimapWidth=a.minimapWidth,this.minimapHeight=r.height,this.canvasInnerWidth=a.minimapCanvasInnerWidth,this.canvasInnerHeight=a.minimapCanvasInnerHeight,this.canvasOuterWidth=a.minimapCanvasOuterWidth,this.canvasOuterHeight=a.minimapCanvasOuterHeight,this.isSampling=a.minimapIsSampling,this.editorHeight=r.height,this.fontScale=a.minimapScale,this.minimapLineHeight=a.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=ya(()=>Nu.create(this.fontScale,l.fontFamily)),this.backgroundColor=u_._getMinimapBackground(t,i)}static _getMinimapBackground(e,t){const i=e.getColor(EA);return i?new qs(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a):t.getColor(2)}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.showSlider===e.showSlider&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)}}class Mu{constructor(e,t,i,n,o,r,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=r,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}static create(e,t,i,n,o,r,a,l,d,c,h){const u=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){const S=l*e.lineHeight+(e.scrollBeyondLastLine?o-e.lineHeight:0),D=Math.max(1,Math.floor(o*o/S)),y=Math.max(0,e.minimapHeight-D),x=y/(c-o),E=d*x,P=y>0,A=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new Mu(d,c,P,x,E,D,1,Math.min(a,A))}let b;if(r&&i!==a){const S=i-t+1;b=Math.floor(S*f/u)}else{const S=o/m;b=Math.floor(S*f/u)}let v;e.scrollBeyondLastLine?v=(a-1)*f/u:v=Math.max(0,a*f/u-b),v=Math.min(e.minimapHeight-b,v);const _=v/(c-o),w=d*_;let C=0;if(e.scrollBeyondLastLine&&(C=o/m-1),g>=a+C){const D=a,y=v>0;return new Mu(d,c,y,_,w,b,1,D)}else{let S=Math.max(1,Math.floor(t-w*u/f));h&&h.scrollHeight===c&&(h.scrollTop>d&&(S=Math.min(S,h.startLineNumber)),h.scrollTop<d&&(S=Math.max(S,h.startLineNumber)));const D=Math.min(a,S+g-1),y=(d-n)/m,x=(t-S+y)*f/u;return new Mu(d,c,!0,_,x,b,S,D)}}}class f_{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}f_.INVALID=new f_(-1);class PI{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new VA(()=>f_.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let n=0,o=i.length;n<o;n++)if(i[n].dy===-1)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class lx{constructor(e,t,i,n){this._backgroundFillData=lx._createBackgroundFillData(t,i,n),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const n=i.r,o=i.g,r=i.b,a=new Uint8ClampedArray(e*t*4);let l=0;for(let d=0;d<t;d++)for(let c=0;c<e;c++)a[l]=n,a[l+1]=o,a[l+2]=r,a[l+3]=255,l+=4;return a}}class hf{constructor(e,t){this.samplingRatio=e,this.minimapLines=t}static compute(e,t,i){if(e.renderMinimap===0||!e.isSampling)return[null,[]];const n=e.pixelRatio,o=e.lineHeight,r=e.scrollBeyondLastLine,{minimapLineCount:a}=gc.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:r,height:e.editorHeight,lineHeight:o,pixelRatio:n}),l=t/a,d=l/2;if(!i||i.minimapLines.length===0){let w=[];if(w[0]=1,a>1){for(let C=0,S=a-1;C<S;C++)w[C]=Math.round(C*l+d);w[a-1]=t}return[new hf(l,w),[]]}const c=i.minimapLines,h=c.length;let u=[],f=0,g=0,m=1;const b=10;let v=[],_=null;for(let w=0;w<a;w++){const C=Math.max(m,Math.round(w*l)),S=Math.max(C,Math.round((w+1)*l));for(;f<h&&c[f]<C;){if(v.length<b){const y=f+1+g;_&&_.type==="deleted"&&_._oldIndex===f-1?_.deleteToLineNumber++:(_={type:"deleted",_oldIndex:f,deleteFromLineNumber:y,deleteToLineNumber:y},v.push(_)),g--}f++}let D;if(f<h&&c[f]<=S)D=c[f],f++;else if(w===0?D=1:w+1===a?D=t:D=Math.round(w*l+d),v.length<b){const y=f+1+g;_&&_.type==="inserted"&&_._i===w-1?_.insertToLineNumber++:(_={type:"inserted",_i:w,insertFromLineNumber:y,insertToLineNumber:y},v.push(_)),g++}u[w]=D,m=D}if(v.length<b)for(;f<h;){const w=f+1+g;_&&_.type==="deleted"&&_._oldIndex===f-1?_.deleteToLineNumber++:(_={type:"deleted",_oldIndex:f,deleteFromLineNumber:w,deleteToLineNumber:w},v.push(_)),g--,f++}else v=[{type:"flush"}];return[new hf(l,u),v]}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){const o=this.minimapLines[i];if(o<e||o>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),n=Math.max(n,o)):this.minimapLines[o]-=t;return[i,n]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class iH extends is{constructor(e){super(e),this.tokensColorTracker=og.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new u_(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=hf.compute(this.options,this._context.model.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new g_(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new u_(this._context.configuration,this._context.theme,this.tokensColorTracker);return this.options.equals(e)?!1:(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return e.affectsMinimap?this._actual.onDecorationsChanged():!1}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.toLineNumber);return t?this._actual.onLinesChanged(t[0],t[1]):!1}else return this._actual.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i+1),this._shouldCheckSampling=!0,!0}else return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._context.model.invalidateMinimapColorCache(),this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){let t=[];for(const i of e.ranges){const n=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);n&&t.push({fromLineNumber:n[0],toLineNumber:n[1]})}return t.length?this._actual.onTokensChanged(t):!1}else return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=hf.compute(this.options,this._context.model.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.model.getLineCount()}getRealLineCount(){return this._context.model.getLineCount()}getLineContent(e){return this._samplingState?this._context.model.getLineContent(this._samplingState.minimapLines[e-1]):this._context.model.getLineContent(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){let n=[];for(let o=0,r=t-e+1;o<r;o++)i[o]?n[o]=this._context.model.getViewLineData(this._samplingState.minimapLines[e+o-1]):n[o]=null;return n}return this._context.model.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(this._minimapSelections===null)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new ee(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const o=this._samplingState.minimapLines[e-1],r=this._samplingState.minimapLines[t-1];i=new L(o,1,r,this._context.model.getLineMaxColumn(r))}else i=new L(e,1,t,this._context.model.getLineMaxColumn(t));const n=this._context.model.getDecorationsInViewport(i);if(this._samplingState){let o=[];for(const r of n){if(!r.options.minimap)continue;const a=r.range,l=this._samplingState.modelLineToMinimapLine(a.startLineNumber),d=this._samplingState.modelLineToMinimapLine(a.endLineNumber);o.push(new LT(new L(l,a.startColumn,d,a.endColumn),r.options))}return o}return n}getOptions(){return this._context.model.getTextModelOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.model.revealRange("mouse",!1,new L(e,1,e,1),1,0)}setScrollTop(e){this._context.model.setScrollPosition({scrollTop:e},1)}}class g_ extends U{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(yI),this._domNode=Ue(document.createElement("div")),Bo.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=Ue(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=Ue(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=Ue(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=Ue(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=Ue(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._mouseDownListener=Gt(this._domNode.domNode,"mousedown",i=>{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.leftButton&&this._lastRenderData){const d=vi(this._slider.domNode),c=d.top+d.height/2;this._startSliderDragging(i.buttons,i.posx,c,i.posy,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.browserEvent.offsetY;let l=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderMouseMoveMonitor=new _d,this._sliderMouseDownListener=Gt(this._slider.domNode,"mousedown",i=>{i.preventDefault(),i.stopPropagation(),i.leftButton&&this._lastRenderData&&this._startSliderDragging(i.buttons,i.posx,i.posy,i.posy,this._lastRenderData.renderedLayout)}),this._gestureDisposable=ot.addTarget(this._domNode.domNode),this._sliderTouchStartListener=K(this._domNode.domNode,vt.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=K(this._domNode.domNode,vt.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Gt(this._domNode.domNode,vt.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i,n,o){this._slider.toggleClassName("active",!0);const r=(a,l)=>{const d=Math.abs(l-t);if(Si&&d>eH){this._model.setScrollTop(o.scrollTop);return}const c=a-i;this._model.setScrollTop(o.getDesiredScrollTopFromDelta(c))};n!==i&&r(n,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,Ch,a=>r(a.posy,a.posx),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){return this._model.options.showSlider==="always"?"minimap slider-always":"minimap slider-mouseover"}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new lx(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(yI),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=Mu.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight);const n=e.scrollLeft/this._model.options.typicalHalfwidthCharacterWidth,o=Math.min(this._model.options.minimapWidth,Math.round(n*this._model.options.minimapCharWidth/this._model.options.pixelRatio));this._sliderHorizontal.setLeft(o),this._sliderHorizontal.setWidth(this._model.options.minimapWidth-o),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections(),i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber),{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,d=this._decorationsCanvas.domNode.getContext("2d");d.clearRect(0,0,n,o);const c=new Map;for(let h=0;h<t.length;h++){const u=t[h];for(let f=u.startLineNumber;f<=u.endLineNumber;f++)this.renderDecorationOnLine(d,c,u,this._selectionColor,e,f,r,r,l,a)}for(let h=0;h<i.length;h++){const u=i[h];if(!u.options.minimap)continue;const f=u.options.minimap.getColor(this._theme);for(let g=u.range.startLineNumber;g<=u.range.endLineNumber;g++)switch(u.options.minimap.position){case ba.Inline:this.renderDecorationOnLine(d,c,u.range,f,e,g,r,r,l,a);continue;case ba.Gutter:const m=(g-e.startLineNumber)*r;this.renderDecoration(d,f,2,m,tH,r);continue}}}}renderDecorationOnLine(e,t,i,n,o,r,a,l,d,c){const h=(r-o.startLineNumber)*l;if(h+a<0||h>this._model.options.canvasInnerHeight)return;let u=t.get(r);const f=!u;if(!u){const C=this._model.getLineContent(r);u=[nu];for(let S=1;S<C.length+1;S++){const D=C.charCodeAt(S-1),y=D===9?d*c:Ks(D)?2*c:c;u[S]=u[S-1]+y}t.set(r,u)}const{startColumn:g,endColumn:m,startLineNumber:b,endLineNumber:v}=i,_=b===r?u[g-1]:nu,w=v>r?u.length-1:m-1;if(w>0){const C=u[w]-_||2;this.renderDecoration(e,n,_,h,C,a)}f&&this.renderLineHighlight(e,n,h,a)}renderLineHighlight(e,t,i,n){e.fillStyle=t&&t.transparent(.5).toString()||"",e.fillRect(nu,i,e.canvas.width,n)}renderDecoration(e,t,i,n,o,r){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,r)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const A=this._lastRenderData._get();return new PI(e,A.imageData,A.lines)}const o=this._getBuffer();if(!o)return null;let[r,a,l]=g_._renderUntouchedLines(o,t,i,n,this._lastRenderData);const d=this._model.getMinimapLinesRenderingData(t,i,l),c=this._model.getOptions().tabSize,h=this._model.options.backgroundColor,u=this._model.tokensColorTracker,f=u.backgroundIsLight(),g=this._model.options.renderMinimap,m=this._model.options.charRenderer(),b=this._model.options.fontScale,v=this._model.options.minimapCharWidth,w=(g===1?2:3)*b,C=n>w?Math.floor((n-w)/2):0;let S=0;const D=[];for(let A=0,H=i-t+1;A<H;A++)l[A]&&g_._renderLine(o,h,f,g,v,u,m,S,C,c,d[A],b,n),D[A]=new f_(S),S+=n;const y=r===-1?0:r,E=(a===-1?o.height:a)-y;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,y,o.width,E),new PI(e,o,D)}static _renderUntouchedLines(e,t,i,n,o){const r=[];if(!o){for(let x=0,E=i-t+1;x<E;x++)r[x]=!0;return[-1,-1,r]}const a=o._get(),l=a.imageData.data,d=a.rendLineNumberStart,c=a.lines,h=c.length,u=e.width,f=e.data,g=(i-t+1)*n*u*4;let m=-1,b=-1,v=-1,_=-1,w=-1,C=-1,S=0;for(let x=t;x<=i;x++){const E=x-t,P=x-d,A=P>=0&&P<h?c[P].dy:-1;if(A===-1){r[E]=!0,S+=n;continue}const H=A*u*4,q=(A+n)*u*4,de=S*u*4,ce=(S+n)*u*4;_===H&&C===de?(_=q,C=ce):(v!==-1&&(f.set(l.subarray(v,_),w),m===-1&&v===0&&v===w&&(m=_),b===-1&&_===g&&v===w&&(b=v)),v=H,_=q,w=de,C=ce),r[E]=!1,S+=n}v!==-1&&(f.set(l.subarray(v,_),w),m===-1&&v===0&&v===w&&(m=_),b===-1&&_===g&&v===w&&(b=v));const D=m===-1?-1:m/(u*4),y=b===-1?-1:b/(u*4);return[D,y,r]}static _renderLine(e,t,i,n,o,r,a,l,d,c,h,u,f){const g=h.content,m=h.tokens,b=e.width-o,v=f===1;let _=nu,w=0,C=0;for(let S=0,D=m.getCount();S<D;S++){const y=m.getEndOffset(S),x=m.getForeground(S),E=r.getColor(x);for(;w<y;w++){if(_>b)return;const P=g.charCodeAt(w);if(P===9){const A=c-(w+C)%c;C+=A-1,_+=A*o}else if(P===32)_+=o;else{const A=Ks(P)?2:1;for(let H=0;H<A;H++)if(n===2?a.blockRenderChar(e,_,l+d,E,t,i,v):a.renderChar(e,_,l+d,P,E,t,u,i,v),_+=o,_>b)return}}}}}tt((s,e)=>{const t=s.getColor(EA);t&&e.addRule(`.monaco-editor .minimap > canvas { opacity: ${t.rgba.a}; will-change: opacity; }`);const i=s.getColor(W8);i&&e.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${i}; }`);const n=s.getColor(V8);n&&e.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${n}; }`);const o=s.getColor(H8);o&&e.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${o}; }`);const r=s.getColor(Nb);r&&e.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${r} -6px 0 6px -6px inset; }`)});class nH extends is{constructor(e){super(e);const i=this._context.configuration.options.get(128);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=Ue(document.createElement("div")),Bo.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(128);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=Ue(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?!1:(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t].domNode.domNode;delete this._widgets[t],n.parentNode.removeChild(n),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(e.preference===null){t.unsetTop();return}if(e.preference===0)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(e.preference===1){const i=t.domNode.clientHeight;t.setTop(this._editorHeight-i-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else e.preference===2&&(t.setTop(0),t.domNode.style.right="50%")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let i=0,n=t.length;i<n;i++){const o=t[i];this._renderWidget(this._widgets[o])}}}class sH{constructor(e,t){const i=e.options;this.lineHeight=i.get(56),this.pixelRatio=i.get(126),this.overviewRulerLanes=i.get(71),this.renderBorder=i.get(70);const n=t.getColor(i6);this.borderColor=n?n.toString():null,this.hideCursor=i.get(48);const o=t.getColor(RA);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const r=i.get(62),a=r.enabled,l=r.side,d=a?t.getColor(n6)||St.getDefaultBackground():null;d===null||l==="left"?this.backgroundColor=null:this.backgroundColor=B.Format.CSS.formatHex(d);const h=i.get(128).overviewRuler;this.top=h.top,this.right=h.right,this.domWidth=h.width,this.domHeight=h.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[u,f]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=u,this.w=f}_initLanes(e,t,i){const n=t-e;if(i>=3){const o=Math.floor(n/3),r=Math.floor(n/3),a=n-o-r,l=e,d=l+o,c=l+o+a;return[[0,l,d,l,c,l,d,l],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(n/2),r=n-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=n;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class oH extends is{constructor(e){super(e),this._domNode=Ue(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=St.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new sH(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(O.compare),!0}onDecorationsChanged(e){return!!e.affectsOverviewRuler}onFlushed(e){return!0}onScrollChanged(e){return e.scrollHeightChanged}onZonesChanged(e){return!0}onThemeChanged(e){return this._context.model.invalidateOverviewRulerColorCache(),this._updateSettings(!1)}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render()}_render(){if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(this._settings.backgroundColor?this._settings.backgroundColor:"");return}const e=this._settings.canvasWidth,t=this._settings.canvasHeight,i=this._settings.lineHeight,n=this._context.viewLayout,o=this._context.viewLayout.getScrollHeight(),r=t/o,a=this._context.model.getAllOverviewRulerDecorations(this._context.theme),l=6*this._settings.pixelRatio|0,d=l/2|0,c=this._domNode.domNode.getContext("2d");this._settings.backgroundColor===null?c.clearRect(0,0,e,t):(c.fillStyle=this._settings.backgroundColor,c.fillRect(0,0,e,t));const h=this._settings.x,u=this._settings.w,f=Object.keys(a);f.sort();for(let g=0,m=f.length;g<m;g++){const b=f[g],v=a[b];c.fillStyle=b;let _=0,w=0,C=0;for(let S=0,D=v.length;S<D;S++){const y=v[3*S],x=v[3*S+1],E=v[3*S+2];let P=n.getVerticalOffsetForLineNumber(x)*r|0,A=(n.getVerticalOffsetForLineNumber(E)+i)*r|0;if(A-P<l){let q=(P+A)/2|0;q<d?q=d:q+d>t&&(q=t-d),P=q-d,A=q+d}P>C+1||y!==_?(S!==0&&c.fillRect(h[_],w,u[_],C-w),_=y,w=P,C=A):A>C&&(C=A)}c.fillRect(h[_],w,u[_],C-w)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,m=g/2|0,b=this._settings.x[7],v=this._settings.w[7];c.fillStyle=this._settings.cursorColor;let _=-100,w=-100;for(let C=0,S=this._cursorPositions.length;C<S;C++){const D=this._cursorPositions[C];let y=n.getVerticalOffsetForLineNumber(D.lineNumber)*r|0;y<m?y=m:y+m>t&&(y=t-m);const x=y-m,E=x+g;x>w+1?(C!==0&&c.fillRect(b,_,v,w-_),_=x,w=E):E>w&&(w=E)}c.fillRect(b,_,v,w-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(c.beginPath(),c.lineWidth=1,c.strokeStyle=this._settings.borderColor,c.moveTo(0,0),c.lineTo(0,t),c.stroke(),c.moveTo(0,0),c.lineTo(e,0),c.stroke())}}class FI{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class uf{constructor(e,t,i){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.color=i,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class rH{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(uf.compare)}setLineHeight(e){return this._lineHeight===e?!1:(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth===e?!1:(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight===e?!1:(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight===e?!1:(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),n=Math.floor(this._outerHeight),o=i/n,r=Math.floor(4*this._pixelRatio/2);let a=[];for(let l=0,d=this._zones.length;l<d;l++){const c=this._zones[l];if(!e){const _=c.getColorZones();if(_){a.push(_);continue}}const h=Math.floor(o*this._getVerticalOffsetForLine(c.startLineNumber)),u=Math.floor(o*(this._getVerticalOffsetForLine(c.endLineNumber)+t));let f=Math.floor((h+u)/2),g=u-f;g<r&&(g=r),f-g<0&&(f=g),f+g>i&&(f=i-g);const m=c.color;let b=this._color2Id[m];b||(b=++this._lastAssignedId,this._color2Id[m]=b,this._id2Color[b]=m);const v=new FI(f-g,f+g,b);c.setColorZone(v),a.push(v)}return this._colorZonesInvalid=!1,a.sort(FI.compare),a}}class aH extends ig{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Ue(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new rH(n=>this._context.viewLayout.getVerticalOffsetForLineNumber(n)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(56)),this._zoneManager.setPixelRatio(i.get(126)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(56)&&(this._zoneManager.setLineHeight(t.get(56)),this._render()),e.hasChanged(126)&&(this._zoneManager.setPixelRatio(t.get(126)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,r=0,a=0;for(const l of t){const d=l.colorId,c=l.from,h=l.to;d!==o?(e.fillRect(0,r,n,a-r),o=d,e.fillStyle=i[o],r=c,a=h):a>=c?a=Math.max(a,h):(e.fillRect(0,r,n,a-r),r=c,a=h)}e.fillRect(0,r,n,a-r)}}class lH extends is{constructor(e){super(e),this.domNode=Ue(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:n}=this._context.model.getTextModelOptions(),o=n;let r=t-e;for(;r>0;){const a=Ue(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const n=this._renderedRulers.pop();this.domNode.removeChild(n),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const n=this._renderedRulers[t],o=this._rulers[t];n.setBoxShadow(o.color?`1px 0 0 0 ${o.color} inset`:""),n.setHeight(Math.min(e.scrollHeight,1e6)),n.setLeft(o.column*this._typicalHalfwidthCharacterWidth)}}}tt((s,e)=>{const t=s.getColor(J8);t&&e.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${t} inset; }`)});class dH extends is{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const i=this._context.configuration.options.get(90);this._useShadows=i.useShadows,this._domNode=Ue(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(128);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.minimap.minimapWidth-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(90);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}tt((s,e)=>{const t=s.getColor(Nb);t&&e.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${t} 0 6px 6px -6px inset; }`)});class cH{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class hH{constructor(e,t){this.lineNumber=e,this.ranges=t}}function uH(s){return new cH(s)}function fH(s){return new hH(s.lineNumber,s.ranges.map(uH))}class Dt extends Sh{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(56),this._roundedSelection=t.get(88),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(56),this._roundedSelection=t.get(88),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let d=0;!o&&d<i.length;d++)i[d].lineNumber===a&&(o=i[d].ranges[0]);const l=t[t.length-1].lineNumber;if(l===e.endLineNumber)for(let d=i.length-1;!r&&d>=0;d--)i[d].lineNumber===l&&(r=i[d].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a<l;a++){const d=t[a].ranges[0],c=d.left,h=d.left+d.width,u={top:0,bottom:0},f={top:0,bottom:0};if(a>0){const g=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;qg(c-g)<n?u.top=2:c>g&&(u.top=1),qg(h-m)<n?f.top=2:g<h&&h<m&&(f.top=1)}else o&&(u.top=o.startStyle.top,f.top=o.endStyle.top);if(a+1<l){const g=t[a+1].ranges[0].left,m=t[a+1].ranges[0].left+t[a+1].ranges[0].width;qg(c-g)<n?u.bottom=2:g<c&&c<m&&(u.bottom=1),qg(h-m)<n?f.bottom=2:h<m&&(f.bottom=1)}else r&&(u.bottom=r.startStyle.bottom,f.bottom=r.endStyle.bottom);d.startStyle=u,d.endStyle=f}}_getVisibleRangesWithStyle(e,t,i){const o=(t.linesVisibleRangesForRange(e,!0)||[]).map(fH);return!this._visibleRangesHaveGaps(o)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,o,i),o}_createSelectionPiece(e,t,i,n,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+n.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const o=!!n[0].ranges[0].startStyle,r=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=n[0].lineNumber,d=n[n.length-1].lineNumber;for(let c=0,h=n.length;c<h;c++){const u=n[c],f=u.lineNumber,g=f-t,m=i&&(f===d||f===l)?a:r,b=i&&f===l?1:0;let v="",_="";for(let w=0,C=u.ranges.length;w<C;w++){const S=u.ranges[w];if(o){const y=S.startStyle,x=S.endStyle;if(y.top===1||y.bottom===1){v+=this._createSelectionPiece(b,m,Dt.SELECTION_CLASS_NAME,S.left-Dt.ROUNDED_PIECE_WIDTH,Dt.ROUNDED_PIECE_WIDTH);let E=Dt.EDITOR_BACKGROUND_CLASS_NAME;y.top===1&&(E+=" "+Dt.SELECTION_TOP_RIGHT),y.bottom===1&&(E+=" "+Dt.SELECTION_BOTTOM_RIGHT),v+=this._createSelectionPiece(b,m,E,S.left-Dt.ROUNDED_PIECE_WIDTH,Dt.ROUNDED_PIECE_WIDTH)}if(x.top===1||x.bottom===1){v+=this._createSelectionPiece(b,m,Dt.SELECTION_CLASS_NAME,S.left+S.width,Dt.ROUNDED_PIECE_WIDTH);let E=Dt.EDITOR_BACKGROUND_CLASS_NAME;x.top===1&&(E+=" "+Dt.SELECTION_TOP_LEFT),x.bottom===1&&(E+=" "+Dt.SELECTION_BOTTOM_LEFT),v+=this._createSelectionPiece(b,m,E,S.left+S.width,Dt.ROUNDED_PIECE_WIDTH)}}let D=Dt.SELECTION_CLASS_NAME;if(o){const y=S.startStyle,x=S.endStyle;y.top===0&&(D+=" "+Dt.SELECTION_TOP_LEFT),y.bottom===0&&(D+=" "+Dt.SELECTION_BOTTOM_LEFT),x.top===0&&(D+=" "+Dt.SELECTION_TOP_RIGHT),x.bottom===0&&(D+=" "+Dt.SELECTION_BOTTOM_RIGHT)}_+=this._createSelectionPiece(b,m,D,S.left,S.width)}e[g][0]+=v,e[g][1]+=_}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let r=i;r<=n;r++){const a=r-i;t[a]=["",""]}const o=[];for(let r=0,a=this._selections.length;r<a;r++){const l=this._selections[r];if(l.isEmpty()){o[r]=null;continue}const d=this._getVisibleRangesWithStyle(l,e,this._previousFrameVisibleRangesWithStyle[r]);o[r]=d,this._actualRenderOneSelection(t,i,this._selections.length>1,d)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Dt.SELECTION_CLASS_NAME="selected-text";Dt.SELECTION_TOP_LEFT="top-left-radius";Dt.SELECTION_BOTTOM_LEFT="bottom-left-radius";Dt.SELECTION_TOP_RIGHT="top-right-radius";Dt.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Dt.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Dt.ROUNDED_PIECE_WIDTH=10;tt((s,e)=>{const t=s.getColor(ha);t&&e.addRule(`.monaco-editor .focused .selected-text { background-color: ${t}; }`);const i=s.getColor(XL);i&&e.addRule(`.monaco-editor .selected-text { background-color: ${i}; }`);const n=s.getColor(K7);n&&!n.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${n}; }`)});function qg(s){return s<0?-s:s}class BI{constructor(e,t,i,n,o,r){this.top=e,this.left=t,this.width=i,this.height=n,this.textContent=o,this.textContentClassName=r}}class WI{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(40);this._cursorStyle=t.get(22),this._lineHeight=t.get(56),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(25),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Ue(document.createElement("div")),this._domNode.setClassName(`cursor ${xl}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Wi.applyFontInfo(this._domNode,i),this._domNode.setDisplay("none"),this._position=new O(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(40);return this._cursorStyle=t.get(22),this._lineHeight=t.get(56),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(25),this._typicalHalfwidthCharacterWidth),Wi.applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_prepareRender(e){let t="";if(this._cursorStyle===li.Line||this._cursorStyle===li.LineThin){const u=e.visibleRangeForPosition(this._position);if(!u||u.outsideRenderedLine)return null;let f;if(this._cursorStyle===li.Line){if(f=nk(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2){const b=this._context.model.getLineContent(this._position.lineNumber),v=ym(b,this._position.column-1);t=b.substr(this._position.column-1,v)}}else f=nk(1);let g=u.left;f>=2&&g>=1&&(g-=1);const m=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new BI(m,g,f,this._lineHeight,t,"")}const i=this._context.model.getLineContent(this._position.lineNumber),n=ym(i,this._position.column-1),o=e.linesVisibleRangesForRange(new L(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+n),!1);if(!o||o.length===0)return null;const r=o[0];if(r.outsideRenderedLine||r.ranges.length===0)return null;const a=r.ranges[0],l=a.width<1?this._typicalHalfwidthCharacterWidth:a.width;let d="";if(this._cursorStyle===li.Block){const u=this._context.model.getViewLineData(this._position.lineNumber);t=i.substr(this._position.column-1,n);const f=u.tokens.findTokenIndexAtOffset(this._position.column-1);d=u.tokens.getClassName(f)}let c=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===li.Underline||this._cursorStyle===li.UnderlineThin)&&(c+=this._lineHeight-2,h=2),new BI(c,a.left,l,h,t,d)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${xl} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class ff extends is{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(78),this._cursorBlinking=t.get(20),this._cursorStyle=t.get(22),this._cursorSmoothCaretAnimation=t.get(21),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new WI(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Ue(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new an,this._cursorFlatBlinkInterval=new Xf,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(78),this._cursorBlinking=t.get(20),this._cursorStyle=t.get(22),this._cursorSmoothCaretAnimation=t.get(21),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;i<n;i++)this._secondaryCursors[i].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t){if(this._primaryCursor.onCursorPositionChanged(e),this._updateBlinking(),this._secondaryCursors.length<t.length){const i=t.length-this._secondaryCursors.length;for(let n=0;n<i;n++){const o=new WI(this._context);this._domNode.domNode.insertBefore(o.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(o)}}else if(this._secondaryCursors.length>t.length){const i=this._secondaryCursors.length-t.length;for(let n=0;n<i;n++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let i=0;i<t.length;i++)this._secondaryCursors[i].onCursorPositionChanged(t[i])}onCursorStateChanged(e){const t=[];for(let n=0,o=e.selections.length;n<o;n++)t[n]=e.selections[n].getPosition();this._onCursorPositionChanged(t[0],t.slice(1));const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=i=>{for(let n=0,o=e.ranges.length;n<o;n++)if(e.ranges[n].fromLineNumber<=i.lineNumber&&i.lineNumber<=e.ranges[n].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const i of this._secondaryCursors)if(t(i.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput||!this._editorHasFocus?0:this._readOnly?5:this._cursorBlinking}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=e===0,i=e===5;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),!t&&!i&&(e===1?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},ff.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},ff.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case li.Line:e+=" cursor-line-style";break;case li.Block:e+=" cursor-block-style";break;case li.Underline:e+=" cursor-underline-style";break;case li.LineThin:e+=" cursor-line-thin-style";break;case li.BlockOutline:e+=" cursor-block-outline-style";break;case li.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return this._cursorSmoothCaretAnimation&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){let t=[],i=0;const n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let o=0,r=this._secondaryCursors.length;o<r;o++){const a=this._secondaryCursors[o].render(e);a&&(t[i++]=a)}this._renderData=t}getLastRenderData(){return this._renderData}}ff.BLINK_INTERVAL=500;tt((s,e)=>{const t=s.getColor(RA);if(t){let i=s.getColor(X8);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),s.type==="hc"&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const Pw=()=>{throw new Error("Invalid change accessor")};class gH extends is{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(128);this._lineHeight=t.get(56),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Ue(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=Ue(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const n of e)t.set(n.id,n);let i=!1;return this._context.model.changeWhitespace(n=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r<a;r++){const l=o[r],d=this._zones[l],c=this._computeWhitespaceProps(d.delegate),h=t.get(l);h&&(h.afterLineNumber!==c.afterViewLineNumber||h.height!==c.heightInPx)&&(n.changeOneWhitespace(l,c.afterViewLineNumber,c.heightInPx),this._safeCallOnComputedHeight(d.delegate,c.heightInPx),i=!0)}}),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(128);return this._lineHeight=t.get(56),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(56)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return typeof e.afterColumn<"u"?e.afterColumn:1e4}_computeWhitespaceProps(e){if(e.afterLineNumber===0)return{afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t;if(typeof e.afterColumn<"u")t=this._context.model.validateModelPosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const r=this._context.model.validateModelPosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new O(r,this._context.model.getModelLineMaxColumn(r))}let i;t.column===this._context.model.getModelLineMaxColumn(t.lineNumber)?i=this._context.model.validateModelPosition({lineNumber:t.lineNumber+1,column:1}):i=this._context.model.validateModelPosition({lineNumber:t.lineNumber,column:t.column+1});const n=this._context.model.coordinatesConverter.convertModelPositionToViewPosition(t),o=this._context.model.coordinatesConverter.modelPositionIsVisible(i);return{afterViewLineNumber:n.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.model.changeWhitespace(i=>{const n={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};pH(e,n),n.addZone=Pw,n.removeZone=Pw,n.layoutZone=Pw}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isVisible:!1,domNode:Ue(t.domNode),marginDomNode:t.marginDomNode?Ue(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){ve(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){ve(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(let r=0,a=t.length;r<a;r++)i[t[r].id]=t[r],n=!0;const o=Object.keys(this._zones);for(let r=0,a=o.length;r<a;r++){const l=o[r],d=this._zones[l];let c=0,h=0,u="none";i.hasOwnProperty(l)?(c=i[l].verticalOffset-e.bigNumbersDelta,h=i[l].height,u="block",d.isVisible||(d.domNode.setAttribute("monaco-visible-view-zone","true"),d.isVisible=!0),this._safeCallOnDomNodeTop(d.delegate,e.getScrolledTopFromAbsoluteTop(i[l].verticalOffset))):(d.isVisible&&(d.domNode.removeAttribute("monaco-visible-view-zone"),d.isVisible=!1),this._safeCallOnDomNodeTop(d.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),d.domNode.setTop(c),d.domNode.setHeight(h),d.domNode.setDisplay(u),d.marginDomNode&&(d.marginDomNode.setTop(c),d.marginDomNode.setHeight(h),d.marginDomNode.setDisplay(u))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}function pH(s,e){try{return s(e)}catch(t){ve(t)}}class mH{constructor(e){this._theme=e}get type(){return this._theme.type}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class _H{constructor(e,t,i){this.configuration=e,this.theme=new mH(t),this.model=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.model.addViewEventHandler(e)}removeEventHandler(e){this.model.removeViewEventHandler(e)}}class bH{constructor(e,t,i,n){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new L(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class vH extends ig{constructor(e,t,i,n,o,r){super(),this._selections=[new ee(1,1,1,1)],this._renderAnimationFrame=null;const a=new b6(t,n,o,e);this._context=new _H(t,i.getColorTheme(),n),this._configPixelRatio=this._context.configuration.options.get(126),this._context.addEventHandler(this),this._register(i.onDidColorThemeChange(m=>{this._context.theme.update(m),this._context.model.onDidColorThemeChange(),this.render(!0,!1)})),this._viewParts=[],this._textAreaHandler=new h6(this._context,a,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Ue(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Ue(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Ue(document.createElement("div")),Bo.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new $6(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Fb(this._context,this._linesContent),this._viewZones=new gH(this._context),this._viewParts.push(this._viewZones);const l=new oH(this._context);this._viewParts.push(l);const d=new dH(this._context);this._viewParts.push(d);const c=new C6(this._context);this._viewParts.push(c),c.addDynamicOverlay(new x6(this._context)),c.addDynamicOverlay(new Dt(this._context)),c.addDynamicOverlay(new q6(this._context)),c.addDynamicOverlay(new k6(this._context));const h=new S6(this._context);this._viewParts.push(h),h.addDynamicOverlay(new D6(this._context)),h.addDynamicOverlay(new j6(this._context)),h.addDynamicOverlay(new X6(this._context)),h.addDynamicOverlay(new Y6(this._context)),h.addDynamicOverlay(new qc(this._context));const u=new Vl(this._context);u.getDomNode().appendChild(this._viewZones.marginDomNode),u.getDomNode().appendChild(h.getDomNode()),this._viewParts.push(u),this._contentWidgets=new y6(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new ff(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new nH(this._context),this._viewParts.push(this._overlayWidgets);const f=new lH(this._context);this._viewParts.push(f);const g=new iH(this._context);if(this._viewParts.push(g),l){const m=this._scrollbar.getOverviewRulerLayoutInfo();m.parent.insertBefore(l.getDomNode(),m.insertBefore)}this._linesContent.appendChild(c.getDomNode()),this._linesContent.appendChild(f.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),r?r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new D7(this._context,a,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new p7(e,t)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new O(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPositionRelativeToEditor:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new O(e,t)))}}_applyLayout(){const t=this._context.configuration.options.get(128);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(125)+" "+t_(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this._configPixelRatio=this._context.configuration.options.get(126),this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=MM(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){wH(()=>this._actualRender())}_getViewPartsToRender(){let e=[],t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!jy(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.model.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new bH(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.model);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const n=new aV(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(n);for(const o of e)o.render(n),o.onDidRender();Math.abs(vm()-this._configPixelRatio)>.001&&this._context.configuration.updatePixelRatio()}delegateVerticalScrollbarMouseDown(e){this._scrollbar.delegateVerticalScrollbarMouseDown(e)}restoreState(e){this._context.model.setScrollPosition({scrollTop:e.scrollTop},1),this._context.model.tokenizeViewport(),this._renderNow(),this._viewLines.updateLineWidths(),this._context.model.setScrollPosition({scrollLeft:e.scrollLeft},1)}getOffsetForColumn(e,t){const i=this._context.model.validateModelPosition({lineNumber:e,column:t}),n=this._context.model.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new O(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?Ob.convertViewToModelMouseTarget(i,this._context.model.coordinatesConverter):null}createOverviewRuler(e){return new aH(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){let t=e.position&&e.position.range||null;if(t===null){const n=e.position?e.position.position:null;n!==null&&(t=new L(n.lineNumber,n.column,n.lineNumber,n.column))}const i=e.position?e.position.preference:null;this._contentWidgets.setWidgetPosition(e.widget,t,i),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}function wH(s){try{return s()}catch(e){ve(e)}}class VI{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new bi(new L(1,1,1,1),0,new O(1,1),0),new bi(new L(1,1,1,1),0,new O(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new Te(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.getDirection()===0?new ee(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new ee(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}_setState(e,t,i){if(t){const n=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new bi(n,o,r,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new bi(n,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new bi(n,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new O(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new O(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new L(n.lineNumber,n.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new bi(r,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class HI{constructor(e){this.context=e,this.primaryCursor=new VI(e),this.secondaryCursors=[],this.lastAddedCursorIndex=0}dispose(){this.primaryCursor.dispose(this.context),this.killSecondaryCursors()}startTrackingSelections(){this.primaryCursor.startTrackingSelection(this.context);for(let e=0,t=this.secondaryCursors.length;e<t;e++)this.secondaryCursors[e].startTrackingSelection(this.context)}stopTrackingSelections(){this.primaryCursor.stopTrackingSelection(this.context);for(let e=0,t=this.secondaryCursors.length;e<t;e++)this.secondaryCursors[e].stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){this.primaryCursor.ensureValidState(this.context);for(let e=0,t=this.secondaryCursors.length;e<t;e++)this.secondaryCursors[e].ensureValidState(this.context)}readSelectionFromMarkers(){let e=[];e[0]=this.primaryCursor.readSelectionFromMarkers(this.context);for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].readSelectionFromMarkers(this.context);return e}getAll(){let e=[];e[0]=this.primaryCursor.asCursorState();for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].asCursorState();return e}getViewPositions(){let e=[];e[0]=this.primaryCursor.viewState.position;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].viewState.position;return e}getTopMostViewPosition(){let e=this.primaryCursor.viewState.position;for(let t=0,i=this.secondaryCursors.length;t<i;t++){const n=this.secondaryCursors[t].viewState.position;n.isBefore(e)&&(e=n)}return e}getBottomMostViewPosition(){let e=this.primaryCursor.viewState.position;for(let t=0,i=this.secondaryCursors.length;t<i;t++){const n=this.secondaryCursors[t].viewState.position;e.isBeforeOrEqual(n)&&(e=n)}return e}getSelections(){let e=[];e[0]=this.primaryCursor.modelState.selection;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].modelState.selection;return e}getViewSelections(){let e=[];e[0]=this.primaryCursor.viewState.selection;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].viewState.selection;return e}setSelections(e){this.setStates(Te.fromModelSelections(e))}getPrimaryCursor(){return this.primaryCursor.asCursorState()}setStates(e){e!==null&&(this.primaryCursor.setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.secondaryCursors.length,i=e.length;if(t<i){let n=i-t;for(let o=0;o<n;o++)this._addSecondaryCursor()}else if(t>i){let n=t-i;for(let o=0;o<n;o++)this._removeSecondaryCursor(this.secondaryCursors.length-1)}for(let n=0;n<i;n++)this.secondaryCursors[n].setState(this.context,e[n].modelState,e[n].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.secondaryCursors.push(new VI(this.context)),this.lastAddedCursorIndex=this.secondaryCursors.length}getLastAddedCursorIndex(){return this.secondaryCursors.length===0||this.lastAddedCursorIndex===0?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)}_getAll(){let e=[];e[0]=this.primaryCursor;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t];return e}normalize(){if(this.secondaryCursors.length===0)return;let e=this._getAll(),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort((i,n)=>i.selection.startLineNumber===n.selection.startLineNumber?i.selection.startColumn-n.selection.startColumn:i.selection.startLineNumber-n.selection.startLineNumber);for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],r=n.selection,a=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let l;if(a.isEmpty()||r.isEmpty()?l=a.getStartPosition().isBeforeOrEqual(r.getEndPosition()):l=a.getStartPosition().isBefore(r.getEndPosition()),l){const d=n.index<o.index?i:i+1,c=n.index<o.index?i+1:i,h=t[c].index,u=t[d].index,f=t[c].selection,g=t[d].selection;if(!f.equalsSelection(g)){const m=f.plusRange(g),b=f.selectionStartLineNumber===f.startLineNumber&&f.selectionStartColumn===f.startColumn,v=g.selectionStartLineNumber===g.startLineNumber&&g.selectionStartColumn===g.startColumn;let _;h===this.lastAddedCursorIndex?(_=b,this.lastAddedCursorIndex=u):_=v;let w;_?w=new ee(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn):w=new ee(m.endLineNumber,m.endColumn,m.startLineNumber,m.startColumn),t[d].selection=w;const C=Te.fromModelSelection(w);e[u].setState(this.context,C.modelState,C.viewState)}for(const m of t)m.index>h&&m.index--;e.splice(h,1),t.splice(c,1),this._removeSecondaryCursor(h-1),i--}}}}class CH{constructor(){this.type=0}}class SH{constructor(){this.type=1}}class yH{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class LH{constructor(e,t){this.type=3,this.selections=e,this.modelSelections=t}}class Ud{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class Kg{constructor(){this.type=5}}class xH{constructor(e){this.type=6,this.isFocused=e}}class DH{constructor(){this.type=7}}class Gg{constructor(){this.type=8}}class qA{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}}class BS{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class WS{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class jp{constructor(e,t,i,n,o,r){this.type=12,this.source=e,this.range=t,this.selections=i,this.verticalType=n,this.revealHorizontal=o,this.scrollType=r}}class kH{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class IH{constructor(){this.type=14}}class EH{constructor(e){this.type=15,this.ranges=e}}class NH{constructor(){this.type=16}}let MH=class{constructor(){this.type=17}};class TH extends U{constructor(){super(),this._onEvent=this._register(new M),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOugoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++)if(this._outgoingEvents[t].kind===e.kind){this._outgoingEvents[t]=this._outgoingEvents[t].merge(e);return}this._outgoingEvents.push(e)}_emitOugoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,this._collectorCnt===1&&(this._collector=new AH),this._collector}endEmitViewEvents(){if(this._collectorCnt--,this._collectorCnt===0){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const i of e)this._addOutgoingEvent(i);t.length>0&&this._emitMany(t)}this._emitOugoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class AH{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class dx{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}merge(e){return e.kind!==0?this:new dx(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class cx{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}merge(e){return e.kind!==1?this:new cx(this.oldHasFocus,e.hasFocus)}}class hx{constructor(e,t,i,n,o,r,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}merge(e){return e.kind!==2?this:new hx(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class RH{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class p_{constructor(e,t,i,n,o,r,a){this.kind=5,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,n=t.length;if(i!==n)return!1;for(let o=0;o<i;o++)if(!e[o].equalsSelection(t[o]))return!1;return!0}isNoOp(){return p_._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}merge(e){return e.kind!==5?this:new p_(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class OH{constructor(){this.kind=4}isNoOp(){return!1}merge(e){return this}}class Fw{constructor(e,t){this.modelVersionId=e.getVersionId(),this.cursorState=t.getCursorStates()}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;return!0}}class zI{constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){let e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){let t=[];for(let i=0;i<this._autoClosedEnclosingDecorations.length;i++){const n=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[i]);if(n&&(t.push(n),n.startLineNumber!==n.endLineNumber))return!1}t.sort(L.compareRangesUsingStarts),e.sort(L.compareRangesUsingStarts);for(let i=0;i<e.length;i++)if(i>=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class Gc extends U{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new _I(this._model,this._coordinatesConverter,n),this._cursors=new HI(this.context),this._hasFocus=!1,this._isHandling=!1,this._isDoingComposition=!1,this._selectionsWhenCompositionStarted=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=$e(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new _I(this._model,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){let e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let o=!1;n!==null&&n.length>Gc.MAX_CURSOR_COUNT&&(n=n.slice(0,Gc.MAX_CURSOR_COUNT),o=!0);const r=new Fw(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n){const o=this._cursors.getViewPositions();if(o.length>1){this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),0,i,n);return}else{const r=o[0],a=new L(r.lineNumber,r.column,r.lineNumber,r.column);this._emitCursorRevealRange(e,t,a,null,0,i,n)}}_revealPrimaryCursor(e,t,i,n,o){const r=this._cursors.getViewPositions();if(r.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),i,n,o);else{const a=r[0],l=new L(a.lineNumber,a.column,a.lineNumber,a.column);this._emitCursorRevealRange(e,t,l,null,i,n,o)}}_emitCursorRevealRange(e,t,i,n,o,r,a){e.emitViewEvent(new jp(t,i,n,o,r,a))}saveState(){let e=[];const t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){const o=t[i];e.push({inSelectionMode:!o.isEmpty(),selectionStart:{lineNumber:o.selectionStartLineNumber,column:o.selectionStartColumn},position:{lineNumber:o.positionLineNumber,column:o.positionColumn}})}return e}restoreState(e,t){let i=[];for(let n=0,o=t.length;n<o;n++){const r=t[n];let a=1,l=1;r.position&&r.position.lineNumber&&(a=r.position.lineNumber),r.position&&r.position.column&&(l=r.position.column);let d=a,c=l;r.selectionStart&&r.selectionStart.lineNumber&&(d=r.selectionStart.lineNumber),r.selectionStart&&r.selectionStart.column&&(c=r.selectionStart.column),i.push({selectionStartLineNumber:d,selectionStartColumn:c,positionLineNumber:a,positionColumn:l})}this.setStates(e,"restoreState",0,Te.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!0,1)}onModelContentChanged(e,t){if(this._knownModelVersionId=t.versionId,this._isHandling)return;const i=t.containsEvent(1);if(this._prevEditOperationType=0,i)this._cursors.dispose(),this._cursors=new HI(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&t.resultingSelection&&t.resultingSelection.length>0){const n=Te.fromModelSelections(t.resultingSelection);this.setStates(e,"modelChange",t.isUndoing?5:t.isRedoing?6:2,n)&&this._revealPrimaryCursor(e,"modelChange",0,!0,0)}else{const n=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Te.fromModelSelections(n))}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:it.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:it.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,Te.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],n=[];for(let a=0,l=e.length;a<l;a++)i.push({range:e[a],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[a],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),r=this._model.deltaDecorations([],n);this._autoClosedActions.push(new zI(this._model,o,r))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=PH.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);let i=[],n=[];for(let o=0;o<e.commands.length;o++){const r=e.commands[o];r instanceof WA&&r.enclosingRange&&r.closeCharacterRange&&(i.push(r.closeCharacterRange),n.push(r.enclosingRange))}i.length>0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const r=new Fw(this._model,this);if(r.equals(n))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new LH(l,a)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((d,c)=>!d.modelState.equals(n.cursorState[c].modelState))){const d=n?n.cursorState.map(h=>h.modelState.selection):null,c=n?n.modelVersionId:0;e.emitOutgoingEvent(new p_(d,a,c,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let i=0,n=e.length;i<n;i++){const o=e[i];if(!o.text||o.text.indexOf(`
`)>=0)return null;const r=o.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 d=l[0].open,c=o.text.length-r[2].length-1,h=o.text.lastIndexOf(d,c-1);if(h===-1)return null;t.push([h,c])}return t}executeEdits(e,t,i,n){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);let r=[],a=[];const l=this._model.pushEditOperations(this.getSelections(),i,d=>{if(o)for(let h=0,u=o.length;h<u;h++){const[f,g]=o[h],m=d[h],b=m.range.startLineNumber,v=m.range.startColumn-1+f,_=m.range.startColumn-1+g;r.push(new L(b,_+1,b,_+2)),a.push(new L(b,v+1,b,_+2))}const c=n(d);return c&&(this._isHandling=!0),c});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),r.length>0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=new Fw(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){ve(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this._revealPrimaryCursor(t,i,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}getAutoClosedCharacters(){return zI.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{t==="keyboard"&&(this._executeEditOperation(Ct.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),this.getAutoClosedCharacters())),this._selectionsWhenCompositionStarted=null)},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let o=0;for(;o<n;){const r=ym(t,o),a=t.substr(o,r);this._executeEditOperation(Ct.typeWithInterceptors(this._isDoingComposition,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),o+=r}}else this._executeEditOperation(Ct.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,o,r){if(t.length===0&&i===0&&n===0){if(o!==0){const a=this.getSelections().map(l=>{const d=l.getPosition();return new ee(d.lineNumber,d.column+o,d.lineNumber,d.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Ct.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,r)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(Ct.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Hl.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new cn(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new cn(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}Gc.MAX_CURSOR_COUNT=1e4;class PH{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let r=0,a=n.trackedRanges.length;r<a;r++)n.model._setTrackedRange(n.trackedRanges[r],null,0);return o}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const i=this._getEditOperations(e,t);if(i.operations.length===0)return null;const n=i.operations,o=this._getLoserCursorMap(n);if(o.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;let r=[];for(let d=0,c=n.length;d<c;d++)o.hasOwnProperty(n[d].identifier.major.toString())||r.push(n[d]);i.hadTrackedEditOperation&&r.length>0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,d=>{let c=[];for(let f=0;f<e.selectionsBefore.length;f++)c[f]=[];for(const f of d)f.identifier&&c[f.identifier.major].push(f);const h=(f,g)=>f.identifier.minor-g.identifier.minor;let u=[];for(let f=0;f<e.selectionsBefore.length;f++)c[f].length>0?(c[f].sort(h),u[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>c[f],getTrackedSelection:g=>{const m=parseInt(g,10),b=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new ee(b.startLineNumber,b.startColumn,b.endLineNumber,b.endColumn):new ee(b.endLineNumber,b.endColumn,b.startLineNumber,b.startColumn)}})):u[f]=e.selectionsBefore[f];return u});a||(a=e.selectionsBefore);let l=[];for(let d in o)o.hasOwnProperty(d)&&l.push(parseInt(d,10));l.sort((d,c)=>c-d);for(const d of l)a.splice(d,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let o=0,r=t.length;o<r;o++){const a=t[o];if(a){const l=this._getEditOperationsFromCommand(e,o,a);i=i.concat(l.operations),n=n||l.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){let n=[],o=0;const r=(h,u,f=!1)=>{L.isEmpty(h)&&u===""||n.push({identifier:{major:t,minor:o++},range:h,text:u,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const c={addEditOperation:r,addTrackedEditOperation:(h,u,f)=>{a=!0,r(h,u,f)},trackSelection:(h,u)=>{const f=ee.liftSelection(h);let g;if(f.isEmpty())if(typeof u=="boolean")u?g=2:g=3;else{const v=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===v?g=2:g=3}else g=1;const m=e.trackedRanges.length,b=e.model._setTrackedRange(null,f,g);return e.trackedRanges[m]=b,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,c)}catch(h){return ve(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,n)=>-L.compareRangesUsingEnds(i.range,n.range));let t={};for(let i=1;i<e.length;i++){const n=e[i-1],o=e[i];if(L.getStartPosition(n.range).isBefore(L.getEndPosition(o.range))){let r;n.identifier.major>o.identifier.major?r=n.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a<e.length;a++)e[a].identifier.major===r&&(e.splice(a,1),a<i&&i--,a--);i>0&&i--}}return t}}class KA{constructor(e,t,i,n,o,r){this.id=e,this.label=t,this.alias=i,this._precondition=n,this._run=o,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}const UI={getInitialState:()=>Jf,tokenize2:(s,e,t,i)=>fL(0,s,t,i)};function GA(s,e=UI){return BH(s,e||UI)}function FH(s,e,t,i,n,o,r){let a="<div>",l=i,d=0;for(let c=0,h=e.getCount();c<h;c++){const u=e.getEndOffset(c);if(u<=i)continue;let f="";for(;l<u&&l<n;l++){const g=s.charCodeAt(l);switch(g){case 9:let m=o-(l+d)%o;for(d+=m-1;m>0;)f+=r?"&#160;":" ",m--;break;case 60:f+="&lt;";break;case 62:f+="&gt;";break;case 38:f+="&amp;";break;case 0:f+="&#00;";break;case 65279:case 8232:case 8233:case 133:f+="";break;case 13:f+="&#8203";break;case 32:f+=r?"&#160;":" ";break;default:f+=String.fromCharCode(g)}}if(a+=`<span style="${e.getInlineStyle(c,t)}">${f}</span>`,u>n||l>=n)break}return a+="</div>",a}function BH(s,e){let t='<div class="monaco-tokenized-source">',i=Fa(s),n=e.getInitialState();for(let o=0,r=i.length;o<r;o++){let a=i[o];o>0&&(t+="<br/>");let l=e.tokenize2(a,!0,n,0);ci.convertToEndOffset(l.tokens,a.length);let c=new ci(l.tokens,a).inflate(),h=0;for(let u=0,f=c.getCount();u<f;u++){const g=c.getClassName(u),m=c.getEndOffset(u);t+=`<span class="${g}">${Yy(a.substring(h,m))}</span>`,h=m}n=l.endState}return t+="</div>",t}class WH{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class VH{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}class gf{constructor(e,t,i,n){this._instanceId=qM(++gf.INSTANCE_COUNT),this._pendingChanges=new WH,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n<o;){const r=n+o>>>1;t===e[r].afterLineNumber?i<e[r].ordinal?o=r:n=r+1:t<e[r].afterLineNumber?o=r:n=r+1}return n}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(n,o,r,a)=>{t=!0,n=n|0,o=o|0,r=r|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new VH(l,n,o,r,a)),l},changeOneWhitespace:(n,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:n,newAfterLineNumber:o,newHeight:r})},removeWhitespace:n=>{t=!0,this._pendingChanges.remove({id:n})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const d=this._findWhitespaceIndex(l.id);d!==-1&&this._removeWhitespace(d)}return}const n=new Set;for(const l of i)n.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const r=l=>{let d=[];for(const c of l)if(!n.has(c.id)){if(o.has(c.id)){const h=o.get(c.id);c.afterLineNumber=h.newAfterLineNumber,c.height=h.newHeight}d.push(c)}return d},a=r(this._arr).concat(r(e));a.sort((l,d)=>l.afterLineNumber===d.afterLineNumber?l.ordinal-d.ordinal:l.afterLineNumber-d.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=gf.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;i<n;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const n=this._findWhitespaceIndex(e);if(n!==-1&&(this._arr[n].height!==i&&(this._arr[n].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)),this._arr[n].afterLineNumber!==t)){const o=this._arr[n];this._removeWhitespace(n),o.afterLineNumber=t,this._insertWhitespace(o)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount-=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){const o=this._arr[i].afterLineNumber;e<=o&&o<=t?this._arr[i].afterLineNumber=e-1:o>t&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){const o=this._arr[i].afterLineNumber;e<=o&&(this._arr[i].afterLineNumber+=t-e+1)}}getWhitespacesTotalHeight(){return this._checkPendingChanges(),this._arr.length===0?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e=e|0;let t=Math.max(0,this._prefixSumValidIndex+1);t===0&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){this._checkPendingChanges();const e=this._lineHeight*this._lineCount,t=this.getWhitespacesTotalHeight();return e+t+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e=e|0;const t=this._findLastWhitespaceBeforeLineNumber(e);return t===-1?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e=e|0;const t=this._arr;let i=0,n=t.length-1;for(;i<=n;){const r=(n-i|0)/2|0,a=i+r|0;if(t[a].afterLineNumber<e){if(a+1>=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else n=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i<this._arr.length?i:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e=e|0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e){this._checkPendingChanges(),e=e|0;let t;e>1?t=this._lineHeight*(e-1):t=0;const i=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e);return t+i+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){this._checkPendingChanges();const t=this.getLinesTotalHeight();return e>t}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){if(this._paddingBottom===0)return!1;this._checkPendingChanges();const t=this.getLinesTotalHeight();return e>=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let n=1,o=t;for(;n<o;){const r=(n+o)/2|0,a=this.getVerticalOffsetForLineNumber(r)|0;if(e>=a+i)n=r+1;else{if(e>=a)return r;o=r}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,n=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(n)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(n)|0;const l=this.getWhitespacesCount()|0;let d,c;a===-1?(a=l,c=r+1,d=0):(c=this.getAfterLineNumberForWhitespaceIndex(a)|0,d=this.getHeightForWhitespaceIndex(a)|0);let h=o,u=h;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/i)*i,u-=g);const m=[],b=e+(t-e)/2;let v=-1;for(let S=n;S<=r;S++){if(v===-1){const D=h,y=h+i;(D<=b&&b<y||D>b)&&(v=S)}for(h+=i,m[S-n]=u,u+=i;c===S;)u+=d,h+=d,a++,a>=l?c=r+1:(c=this.getAfterLineNumberForWhitespaceIndex(a)|0,d=this.getHeightForWhitespaceIndex(a)|0);if(h>=t){r=S;break}}v===-1&&(v=r);const _=this.getVerticalOffsetForLineNumber(r)|0;let w=n,C=r;return w<C&&o<e&&w++,w<C&&_+i>t&&C--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:v,completelyVisibleStartLineNumber:w,completelyVisibleEndLineNumber:C}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let n;return e>0?n=this.getWhitespacesAccumulatedHeight(e-1):n=0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+o)return-1;for(;t<i;){const r=Math.floor((t+i)/2),a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(e>=a+l)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];let o=[];for(let r=i;r<=n;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}}gf.INSTANCE_COUNT=0;const HH=125;class du{constructor(e,t,i,n){e=e|0,t=t|0,i=i|0,n=n|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class zH extends U{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new M),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new du(0,0,0,0),this._scrollable=this._register(new Pb(e,t)),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new dx(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}}class UH extends U{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(128),r=n.get(72);this._linesLayout=new gf(t,n.get(56),r.top,r.bottom),this._scrollable=this._register(new zH(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new du(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(101)?HH:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(56)&&this._linesLayout.setLineHeight(t.get(56)),e.hasChanged(72)){const i=t.get(72);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(128)){const i=t.get(128),n=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new du(n,r.contentWidth,o,this._getContentHeight(n,o,a)))}else this._updateHeight();e.hasChanged(101)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const n=this._configuration.options.get(90);return n.horizontal===2||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(92)?o+=Math.max(0,t-n.get(56)-n.get(72).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new du(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Fk(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Fk(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(129),n=t.get(40);if(i.isViewportWrapping){const o=t.get(128),r=t.get(62);return e>o.contentWidth+n.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?e+o.verticalScrollbarWidth:e}else{const o=t.get(91)*n.typicalHalfwidthCharacterWidth,r=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+o,r)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new du(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition();let t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class $H{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column)}convertModelRangeToViewRange(e){return this._lines.convertModelRangeToViewRange(e)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}}class jH{constructor(e){this._counts=e,this._isValid=!1,this._validEndIndex=-1,this._modelToView=[],this._viewToModel=[]}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._counts.length;e<t;e++){const i=this._counts[e],n=e>0?this._modelToView[e-1]:0;this._modelToView[e]=n+i;for(let o=0;o<i;o++)this._viewToModel[n+o]=e}this._modelToView.length=this._counts.length,this._viewToModel.length=this._modelToView[this._modelToView.length-1],this._isValid=!0,this._validEndIndex=this._counts.length-1}}changeValue(e,t){this._counts[e]!==t&&(this._counts[e]=t,this._invalidate(e))}removeValues(e,t){this._counts.splice(e,t),this._invalidate(e)}insertValues(e,t){this._counts=Qu(this._counts,e,t),this._invalidate(e)}getTotalValue(){return this._ensureValid(),this._viewToModel.length}getAccumulatedValue(e){return this._ensureValid(),this._modelToView[e]}getIndexOf(e){this._ensureValid();const t=this._viewToModel[e],i=t>0?this._modelToView[t-1]:0;return new mT(t,e-i)}}class qH{constructor(e,t,i,n,o,r,a,l,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])}createCoordinatesConverter(){return new $H(this)}_constructLines(e,t){this.lines=[],e&&(this.hiddenAreasIds=[]);const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=Er.fromDecorations(n),r=i.length,a=this.createLineBreaksComputer(),l=o.length;let d=0,c=d<l?o[d].lineNumber:r+1;for(let _=0;_<r;_++){let w=null;if(_+1===c)for(w=[];_+1===c&&d<l;)w.push(o[d]),d++,c=d<l?o[d].lineNumber:r+1;a.addRequest(i[_],w,t?t[_]:null)}const h=a.finalize();let u=[],f=this.hiddenAreasIds.map(_=>this.model.getDecorationRange(_)).sort(L.compareRangesUsingStarts),g=1,m=0,b=-1,v=b+1<f.length?m+1:r+2;for(let _=0;_<r;_++){let w=_+1;w===v&&(b++,g=f[b].startLineNumber,m=f[b].endLineNumber,v=b+1<f.length?m+1:r+2);let C=w>=g&&w<=m,S=Ww(h[_],!C);u[_]=S.getViewLineCount(),this.lines[_]=S}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new jH(u)}getHiddenAreas(){return this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e))}_reduceRanges(e){if(e.length===0)return[];let t=e.map(r=>this.model.validateRange(r)).sort(L.compareRangesUsingStarts),i=[],n=t[0].startLineNumber,o=t[0].endLineNumber;for(let r=1,a=t.length;r<a;r++){let l=t[r];l.startLineNumber>o+1?(i.push(new L(n,1,o,1)),n=l.startLineNumber,o=l.endLineNumber):l.endLineNumber>o&&(o=l.endLineNumber)}return i.push(new L(n,1,o,1)),i}setHiddenAreas(e){let t=this._reduceRanges(e),i=this.hiddenAreasIds.map(h=>this.model.getDecorationRange(h)).sort(L.compareRangesUsingStarts);if(t.length===i.length){let h=!1;for(let u=0;u<t.length;u++)if(!t[u].equalsRange(i[u])){h=!0;break}if(!h)return!1}let n=[];for(const h of t)n.push({range:h,options:De.EMPTY});this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,n);let o=t,r=1,a=0,l=-1,d=l+1<o.length?a+1:this.lines.length+2,c=!1;for(let h=0;h<this.lines.length;h++){let u=h+1;u===d&&(l++,r=o[l].startLineNumber,a=o[l].endLineNumber,d=l+1<o.length?a+1:this.lines.length+2);let f=!1;if(u>=r&&u<=a?this.lines[h].isVisible()&&(this.lines[h]=this.lines[h].setVisible(!1),f=!0):(c=!0,this.lines[h].isVisible()||(this.lines[h]=this.lines[h].setVisible(!0),f=!0)),f){let g=this.lines[h].getViewLineCount();this.prefixSumComputer.changeValue(h,g)}}return c||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.lines.length?!1:this.lines[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.lines.length?1:this.lines[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n){const o=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n;if(o&&r&&a&&l)return!1;const d=o&&r&&!a&&l;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n;let c=null;if(d){c=[];for(let h=0,u=this.lines.length;h<u;h++)c[h]=this.lines[h].getLineBreakData()}return this._constructLines(!1,c),!0}createLineBreaksComputer(){return(this.wrappingStrategy==="advanced"?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;let n=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,o=this.prefixSumComputer.getAccumulatedValue(i-1);return this.lines.splice(t-1,i-t+1),this.prefixSumComputer.removeValues(t-1,i-t+1),new BS(n,o)}onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.lines[t-2].isVisible();let r=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,a=0,l=[],d=[];for(let c=0,h=n.length;c<h;c++){let u=Ww(n[c],!o);l.push(u);let f=u.getViewLineCount();a+=f,d[c]=f}return this.lines=this.lines.slice(0,t-1).concat(l).concat(this.lines.slice(t-1)),this.prefixSumComputer.insertValues(t-1,d),new WS(r,r+a-1)}onModelLineChanged(e,t,i){if(e!==null&&e<=this._validModelVersionId)return[!1,null,null,null];let n=t-1,o=this.lines[n].getViewLineCount(),r=this.lines[n].isVisible(),a=Ww(i,r);this.lines[n]=a;let l=this.lines[n].getViewLineCount(),d=!1,c=0,h=-1,u=0,f=-1,g=0,m=-1;o>l?(c=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,h=c+l-1,g=h+1,m=g+(o-l)-1,d=!0):o<l?(c=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,h=c+o-1,u=h+1,f=u+(l-o)-1,d=!0):(c=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,h=c+l-1),this.prefixSumComputer.changeValue(n,l);const b=c<=h?new qA(c,h):null,v=u<=f?new WS(u,f):null,_=g<=m?new BS(g,m):null;return[d,b,v,_]}acceptVersionId(e){this._validModelVersionId=e,this.lines.length===1&&!this.lines[0].isVisible()&&this.setHiddenAreas([])}getViewLineCount(){return this.prefixSumComputer.getTotalValue()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.getActiveIndentGuide(n.lineNumber,o.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),d=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:d.lineNumber,indent:a.indent}}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[],r=[],a=[];const l=i.lineNumber-1,d=n.lineNumber-1;let c=null;for(let g=l;g<=d;g++){const m=this.lines[g];if(m.isVisible()){let b=m.getViewLineNumberOfModelPosition(0,g===l?i.column:1),v=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),_=v-b+1,w=0;_>1&&m.getViewLineMinColumn(this.model,g+1,v)===1&&(w=b===0?1:2),r.push(_),a.push(w),c===null&&(c=new O(g+1,0))}else c!==null&&(o=o.concat(this.model.getLinesIndentGuides(c.lineNumber,g)),c=null)}c!==null&&(o=o.concat(this.model.getLinesIndentGuides(c.lineNumber,n.lineNumber)),c=null);const h=t-e+1;let u=new Array(h),f=0;for(let g=0,m=o.length;g<m;g++){let b=o[g],v=Math.min(h-f,r[g]),_=a[g],w;_===2?w=0:_===1?w=1:w=v;for(let C=0;C<v;C++)C===w&&(b=0),u[f++]=b}return u}getViewLineContent(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineContent(this.model,i+1,n)}getViewLineLength(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineLength(this.model,i+1,n)}getViewLineMinColumn(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineMinColumn(this.model,i+1,n)}getViewLineMaxColumn(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineMaxColumn(this.model,i+1,n)}getViewLineData(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineData(this.model,i+1,n)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let n=this.prefixSumComputer.getIndexOf(e-1),o=e,r=n.index,a=n.remainder,l=[];for(let d=r,c=this.model.getLineCount();d<c;d++){let h=this.lines[d];if(!h.isVisible())continue;let u=d===r?a:0,f=h.getViewLineCount()-u,g=!1;o+f>t&&(g=!0,f=t-o+1);let m=u+f;if(h.getViewLinesData(this.model,d+1,u,m,o-e,i,l),o+=f,g)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);let n=this.prefixSumComputer.getIndexOf(e-1),o=n.index,r=n.remainder,a=this.lines[o],l=a.getViewLineMinColumn(this.model,o+1,r),d=a.getViewLineMaxColumn(this.model,o+1,r);t<l&&(t=l),t>d&&(t=d);let c=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new O(o+1,c)).equals(i)?new O(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new L(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){e=this._toValidViewLineNumber(e);let i=this.prefixSumComputer.getIndexOf(e-1),n=i.index,o=i.remainder,r=this.lines[n].getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new O(n+1,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new L(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t){const i=this.model.validatePosition(new O(e,t)),n=i.lineNumber,o=i.column;let r=n-1,a=!1;for(;r>0&&!this.lines[r].isVisible();)r--,a=!0;if(r===0&&!this.lines[r].isVisible())return new O(1,1);const l=1+(r===0?0:this.prefixSumComputer.getAccumulatedValue(r-1));let d;return a?d=this.lines[r].getViewPositionOfModelPosition(l,this.model.getLineMaxColumn(r+1)):d=this.lines[n-1].getViewPositionOfModelPosition(l,o),d}convertModelRangeToViewRange(e){let t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn);return e.startLineNumber===e.endLineNumber&&t.lineNumber!==i.lineNumber&&i.column===this.getViewLineMinColumn(i.lineNumber)?new L(t.lineNumber,t.column,i.lineNumber-1,this.getViewLineMaxColumn(i.lineNumber-1)):new L(t.lineNumber,t.column,i.lineNumber,i.column)}_getViewLineNumberForModelPosition(e,t){let i=e-1;if(this.lines[i].isVisible()){const o=1+(i===0?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.lines[i].isVisible();)i--;if(i===0&&!this.lines[i].isVisible())return 1;const n=1+(i===0?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getAllOverviewRulerDecorations(e,t,i){const n=this.model.getOverviewRulerDecorations(e,t),o=new ZA;for(const r of n){const a=r.options.overviewRuler,l=a?a.position:0;if(l===0)continue;const d=a.getColor(i),c=this._getViewLineNumberForModelPosition(r.range.startLineNumber,r.range.startColumn),h=this._getViewLineNumberForModelPosition(r.range.endLineNumber,r.range.endColumn);o.accept(d,c,h,l)}return o.result}getDecorationsInRange(e,t,i){const n=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),o=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(o.lineNumber-n.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new L(n.lineNumber,1,o.lineNumber,o.column),t,i);let r=[];const a=n.lineNumber-1,l=o.lineNumber-1;let d=null;for(let f=a;f<=l;f++)if(this.lines[f].isVisible())d===null&&(d=new O(f+1,f===a?n.column:1));else if(d!==null){const m=this.model.getLineMaxColumn(f);r=r.concat(this.model.getDecorationsInRange(new L(d.lineNumber,d.column,f,m),t,i)),d=null}d!==null&&(r=r.concat(this.model.getDecorationsInRange(new L(d.lineNumber,d.column,o.lineNumber,o.column),t,i)),d=null),r.sort((f,g)=>{const m=L.compareRangesUsingStarts(f.range,g.range);return m===0?f.id<g.id?-1:f.id>g.id?1:0:m});let c=[],h=0,u=null;for(const f of r){const g=f.id;u!==g&&(u=g,c[h++]=f)}return c}normalizePosition(e,t){const i=this._toValidViewLineNumber(e.lineNumber),n=this.prefixSumComputer.getIndexOf(i-1),o=n.index,r=n.remainder;return this.lines[o].normalizePosition(this.model,o+1,r,e,t)}getLineIndentColumn(e){const t=this._toValidViewLineNumber(e),i=this.prefixSumComputer.getIndexOf(t-1),n=i.index;return i.remainder===0?this.model.getLineIndentColumn(n+1):0}}class m_{constructor(){}isVisible(){return!0}setVisible(e){return e?this:__.INSTANCE}getLineBreakData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){let n=e.getLineTokens(t),o=n.getLineContent();return new CL(o,!1,1,o.length+1,0,n.inflate())}getViewLinesData(e,t,i,n,o,r,a){if(!r[o]){a[o]=null;return}a[o]=this.getViewLineData(e,t,0)}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new O(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i,n,o){return n}}m_.INSTANCE=new m_;class __{constructor(){}isVisible(){return!1}setVisible(e){return e?m_.INSTANCE:this}getLineBreakData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,n,o,r,a){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i,n,o){throw new Error("Not supported")}}__.INSTANCE=new __;class KH{constructor(e,t){this._lineBreakData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getLineBreakData(){return this._lineBreakData}getViewLineCount(){return this._isVisible?this._lineBreakData.breakOffsets.length:0}getInputStartOffsetOfOutputLineIndex(e){return this._lineBreakData.getInputOffsetOfOutputPosition(e,0)}getInputEndOffsetOfOutputLineIndex(e,t,i){return i+1===this._lineBreakData.breakOffsets.length?e.getLineMaxColumn(t)-1:this._lineBreakData.getInputOffsetOfOutputPosition(i+1,0)}getViewLineContent(e,t,i){if(!this._isVisible)throw new Error("Not supported");let n=this.getInputStartOffsetOfOutputLineIndex(i),o=this.getInputEndOffsetOfOutputLineIndex(e,t,i),r=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=$I(this._lineBreakData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){if(!this._isVisible)throw new Error("Not supported");const n=i>0?this._lineBreakData.breakOffsets[i-1]:0;let r=(i<this._lineBreakData.breakOffsets.length?this._lineBreakData.breakOffsets[i]:this._lineBreakData.breakOffsets[this._lineBreakData.breakOffsets.length-1])-n;return i>0&&(r=this._lineBreakData.wrappedTextIndentLength+r),r}getViewLineMinColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this._getViewLineMinColumn(i)}_getViewLineMinColumn(e){return e>0?this._lineBreakData.wrappedTextIndentLength+1:1}getViewLineMaxColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineLength(e,t,i)+1}getViewLineData(e,t,i){if(!this._isVisible)throw new Error("Not supported");const n=this._lineBreakData,o=i>0?n.wrappedTextIndentLength:0,r=n.injectionOffsets,a=n.injectionTexts;let l,d;if(r){const g=e.getLineTokens(t).withInserted(r.map((v,_)=>({offset:v,text:a[_],tokenMetadata:ci.defaultTokenMetadata}))),m=i>0?n.breakOffsets[i-1]:0,b=n.breakOffsets[i];l=g.getLineContent().substring(m,b),d=g.sliceAndInflate(m,b,o)}else{const g=this.getInputStartOffsetOfOutputLineIndex(i),m=this.getInputEndOffsetOfOutputLineIndex(e,t,i),b=e.getLineTokens(t);l=e.getValueInRange({startLineNumber:t,startColumn:g+1,endLineNumber:t,endColumn:m+1}),d=b.sliceAndInflate(g,m,o)}i>0&&(l=$I(n.wrappedTextIndentLength)+l);const c=i>0?n.wrappedTextIndentLength+1:1,h=l.length+1,u=i+1<this.getViewLineCount(),f=i===0?0:n.breakOffsetsVisibleColumn[i-1];return new CL(l,u,c,h,f,d)}getViewLinesData(e,t,i,n,o,r,a){if(!this._isVisible)throw new Error("Not supported");for(let l=i;l<n;l++){let d=o+l-i;if(!r[d]){a[d]=null;continue}a[d]=this.getViewLineData(e,t,l)}}getModelColumnOfViewPosition(e,t){if(!this._isVisible)throw new Error("Not supported");let i=t-1;return e>0&&(i<this._lineBreakData.wrappedTextIndentLength?i=0:i-=this._lineBreakData.wrappedTextIndentLength),this._lineBreakData.getInputOffsetOfOutputPosition(e,i)+1}getViewPositionOfModelPosition(e,t){if(!this._isVisible)throw new Error("Not supported");let i=this._lineBreakData.getOutputPositionOfInputOffset(t-1),n=i.outputLineIndex,o=i.outputOffset+1;return n>0&&(o+=this._lineBreakData.wrappedTextIndentLength),new O(e+n,o)}getViewLineNumberOfModelPosition(e,t){if(!this._isVisible)throw new Error("Not supported");const i=this._lineBreakData.getOutputPositionOfInputOffset(t-1);return e+i.outputLineIndex}normalizePosition(e,t,i,n,o){if(o===0){if(i>0&&n.column===this._getViewLineMinColumn(i))return new O(n.lineNumber-1,this.getViewLineMaxColumn(e,t,i-1))}else if(o===1){const r=this.getViewLineCount()-1;if(i<r&&n.column===this.getViewLineMaxColumn(e,t,i))return new O(n.lineNumber+1,this._getViewLineMinColumn(i+1))}return n}}let Bw=[""];function $I(s){if(s>=Bw.length)for(let e=1;e<=s;e++)Bw[e]=GH(e);return Bw[s]}function GH(s){return new Array(s+1).join(" ")}function Ww(s,e){return s===null?e?m_.INSTANCE:__.INSTANCE:new KH(s,e)}class ZH{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}}class YH{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new ZH(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){let e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new BS(t,i)}onModelLinesInserted(e,t,i,n){return new WS(t,i)}onModelLineChanged(e,t,i){return[!1,new qA(t,t),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesIndentGuides(e,t){const i=t-e+1;let n=new Array(i);for(let o=0;o<i;o++)n[o]=0;return n}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){let t=this.model.getLineTokens(e),i=t.getLineContent();return new CL(i,!1,1,i.length+1,0,t.inflate())}getViewLinesData(e,t,i){const n=this.model.getLineCount();e=Math.min(Math.max(1,e),n),t=Math.min(Math.max(1,t),n);let o=[];for(let r=e;r<=t;r++){let a=r-e;i[a]||(o[a]=null),o[a]=this.getViewLineData(r)}return o}getAllOverviewRulerDecorations(e,t,i){const n=this.model.getOverviewRulerDecorations(e,t),o=new ZA;for(const r of n){const a=r.options.overviewRuler,l=a?a.position:0;if(l===0)continue;const d=a.getColor(i),c=r.range.startLineNumber,h=r.range.endLineNumber;o.accept(d,c,h,l)}return o.result}getDecorationsInRange(e,t,i){return this.model.getDecorationsInRange(e,t,i)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}}class ZA{constructor(){this.result=Object.create(null)}accept(e,t,i,n){let o=this.result[e];if(o){const r=o[o.length-3],a=o[o.length-1];if(r===n&&a+1>=t){i>a&&(o[o.length-1]=i);return}o.push(n,t,i)}else this.result[e]=[n,t,i]}}class XH{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new O(n.startLineNumber,1)),l=this._coordinatesConverter.convertModelPositionToViewPosition(new O(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)));r=new L(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(n);i=new LT(r,o),this._decorationsCache[t]=i}return i}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsViewportData(e),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}_getDecorationsViewportData(e){const t=this._linesCollection.getDecorationsInRange(e,this.editorId,Wy(this.configuration.options)),i=e.startLineNumber,n=e.endLineNumber;let o=[],r=0,a=[];for(let l=i;l<=n;l++)a[l-i]=[];for(let l=0,d=t.length;l<d;l++){let c=t[l],h=c.options,u=this._getOrCreateViewModelDecoration(c),f=u.range;if(o[r++]=u,h.inlineClassName){let g=new Ap(f,h.inlineClassName,h.inlineClassNameAffectsLetterSpacing?3:0),m=Math.max(i,f.startLineNumber),b=Math.min(n,f.endLineNumber);for(let v=m;v<=b;v++)a[v-i].push(g)}if(h.beforeContentClassName&&i<=f.startLineNumber&&f.startLineNumber<=n){let g=new Ap(new L(f.startLineNumber,f.startColumn,f.startLineNumber,f.startColumn),h.beforeContentClassName,1);a[f.startLineNumber-i].push(g)}if(h.afterContentClassName&&i<=f.endLineNumber&&f.endLineNumber<=n){let g=new Ap(new L(f.endLineNumber,f.endColumn,f.endLineNumber,f.endColumn),h.afterContentClassName,2);a[f.endLineNumber-i].push(g)}}return{decorations:o,inlineDecorations:a}}}class QH extends U{constructor(e,t,i,n,o,r){if(super(),this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new TH,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new gs(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._tokenizeViewportSoon=this._register(new bt(()=>this.tokenizeViewport(),50)),this._updateConfigurationViewLineCount=this._register(new bt(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,this.model.isTooLargeForTokenization())this._lines=new YH(this.model);else{const a=this._configuration.options,l=a.get(40),d=a.get(122),c=a.get(129),h=a.get(121);this._lines=new qH(this._editorId,this.model,n,o,l,this.model.getOptions().tabSize,d,c.wrappingColumn,h)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Gc(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new UH(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(a=>{a.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new kH(a)),this._eventDispatcher.emitOutgoingEvent(new hx(a.oldScrollWidth,a.oldScrollLeft,a.oldScrollHeight,a.oldScrollTop,a.scrollWidth,a.scrollLeft,a.scrollHeight,a.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(a=>{this._eventDispatcher.emitOutgoingEvent(a)})),this._decorations=new XH(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(a=>{try{const l=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(l,a)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(og.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new NH)})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this.invalidateMinimapColorCache(),this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,null,1),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=this.coordinatesConverter.convertViewPositionToModelPosition(new O(e.startLineNumber,1)),i=this.coordinatesConverter.convertViewPositionToModelPosition(new O(e.endLineNumber,1));this.model.tokenizeViewport(t.lineNumber,i.lineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new xH(e)),this._eventDispatcher.emitOutgoingEvent(new cx(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new CH)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new SH)}onDidColorThemeChange(){this._eventDispatcher.emitSingleViewEvent(new IH)}_onConfigurationChanged(e,t){let i=null;if(this._viewportStartLine!==-1){let c=new O(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(c)}let n=!1;const o=this._configuration.options,r=o.get(40),a=o.get(122),l=o.get(129),d=o.get(121);if(this._lines.setWrappingSettings(r,a,l.wrappingColumn,d)&&(e.emitViewEvent(new Kg),e.emitViewEvent(new Gg),e.emitViewEvent(new Ud(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.getCurrentScrollTop()!==0&&(n=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(78)&&(this._decorations.reset(),e.emitViewEvent(new Ud(null))),e.emitViewEvent(new yH(t)),this.viewLayout.onConfigurationChanged(t),n&&i){const c=this.coordinatesConverter.convertModelPositionToViewPosition(i),h=this.viewLayout.getVerticalOffsetForLineNumber(c.lineNumber);this.viewLayout.setScrollPosition({scrollTop:h+this._viewportStartLineDelta},1)}gs.shouldRecreate(t)&&(this.cursorConfig=new gs(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e.changes,r=e instanceof la?e.versionId:null,a=this._lines.createLineBreaksComputer();for(const c of o)switch(c.changeType){case 4:{for(let h=0;h<c.detail.length;h++){const u=c.detail[h];let f=c.injectedTexts[h];f&&(f=f.filter(g=>!g.ownerId||g.ownerId===this._editorId)),a.addRequest(u,f,null)}break}case 2:{let h=null;c.injectedText&&(h=c.injectedText.filter(u=>!u.ownerId||u.ownerId===this._editorId)),a.addRequest(c.detail,h,null);break}}const l=a.finalize();let d=0;for(const c of o)switch(c.changeType){case 1:{this._lines.onModelFlushed(),t.emitViewEvent(new Kg),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(r,c.fromLineNumber,c.toLineNumber);h!==null&&(t.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),i=!0;break}case 4:{const h=l.slice(d,d+c.detail.length);d+=c.detail.length;const u=this._lines.onModelLinesInserted(r,c.fromLineNumber,c.toLineNumber,h);u!==null&&(t.emitViewEvent(u),this.viewLayout.onLinesInserted(u.fromLineNumber,u.toLineNumber)),i=!0;break}case 2:{const h=l[d];d++;const[u,f,g,m]=this._lines.onModelLineChanged(r,c.lineNumber,h);n=u,f&&t.emitViewEvent(f),g&&(t.emitViewEvent(g),this.viewLayout.onLinesInserted(g.fromLineNumber,g.toLineNumber)),m&&(t.emitViewEvent(m),this.viewLayout.onLinesDeleted(m.fromLineNumber,m.toLineNumber));break}case 5:break}r!==null&&this._lines.acceptVersionId(r),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new Gg),t.emitViewEvent(new Ud(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}if(this._viewportStartLine=-1,this._configuration.setMaxLineNumber(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&this._viewportStartLineTrackedRange){const t=this.model._getTrackedRange(this._viewportStartLineTrackedRange);if(t){const i=this.coordinatesConverter.convertModelPositionToViewPosition(t.getStartPosition()),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber);this.viewLayout.setScrollPosition({scrollTop:n+this._viewportStartLineDelta},1)}}if(e instanceof la)try{const t=this._eventDispatcher.beginEmitViewEvents();this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(this.model.onDidChangeTokens(e=>{let t=[];for(let i=0,n=e.ranges.length;i<n;i++){const o=e.ranges[i],r=this.coordinatesConverter.convertModelPositionToViewPosition(new O(o.fromLineNumber,1)).lineNumber,a=this.coordinatesConverter.convertModelPositionToViewPosition(new O(o.toLineNumber,this.model.getLineMaxColumn(o.toLineNumber))).lineNumber;t[i]={fromLineNumber:r,toLineNumber:a}}this._eventDispatcher.emitSingleViewEvent(new EH(t)),e.tokenizationSupportChanged&&this._tokenizeViewportSoon.schedule()})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new DH),this.cursorConfig=new gs(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new gs(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new Kg),t.emitViewEvent(new Gg),t.emitViewEvent(new Ud(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new gs(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Ud(e))}))}setHiddenAreas(e){try{const t=this._eventDispatcher.beginEmitViewEvents();this._lines.setHiddenAreas(e)&&(t.emitViewEvent(new Kg),t.emitViewEvent(new Gg),t.emitViewEvent(new Ud(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(128),t=this._configuration.options.get(56),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new L(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];let n=[],o=0,r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,d=t.endColumn;for(let c=0,h=i.length;c<h;c++){const u=i[c].startLineNumber,f=i[c].endLineNumber;f<r||u>l||(r<u&&(n[o++]=new L(r,a,u-1,this.model.getLineMaxColumn(u-1))),r=f+1,a=1)}return(r<l||r===l&&a<d)&&(n[o++]=new L(r,a,l,d)),n}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new L(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new L(i,this.getLineMinColumn(i),n,this.getLineMaxColumn(n))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),n=this.coordinatesConverter.convertViewPositionToModelPosition(new O(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:o}}reduceRestoreState(e){if(typeof e.firstPosition>"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getTextModelOptions(){return this.model.getOptions()}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStartLine=e;let n=this.coordinatesConverter.convertViewPositionToModelPosition(new O(e,this.getLineMinColumn(e)));this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,new L(n.lineNumber,n.column,n.lineNumber,n.column),1);const o=this.viewLayout.getVerticalOffsetForLineNumber(e),r=this.viewLayout.getCurrentScrollTop();this._viewportStartLineDelta=r-o}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=bn(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=xo(this.getLineContent(e));return t===-1?0:t+2}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getViewLineRenderingData(e,t){let i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(t),l=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return new Fn(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,n,r.tokens,l,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){let n=this._lines.getViewLinesData(e,t,i);return new WB(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){return this._lines.getAllOverviewRulerDecorations(this._editorId,Wy(this._configuration.options),e)}invalidateOverviewRulerColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i&&i.invalidateCachedColor()}}invalidateMinimapColorCache(){const e=this.model.getAllDecorations();for(const t of e){const i=t.options.minimap;i&&i.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getModelLineMaxColumn(e){return this.model.getLineMaxColumn(e)}validateModelPosition(e){return this.model.validatePosition(e)}validateModelRange(e){return this.model.validateRange(e)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(r)}getEOL(){return this.model.getEOL()}getPlainTextToCopy(e,t,i){const n=i?`\r
`:this.model.getEOL();e=e.slice(0),e.sort(L.compareRangesUsingStarts);let o=!1,r=!1;for(const l of e)l.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const l=e.map(c=>c.startLineNumber);let d="";for(let c=0;c<l.length;c++)c>0&&l[c-1]===l[c]||(d+=this.model.getLineContent(l[c])+n);return d}if(o&&t){let l=[],d=0;for(const c of e){const h=c.startLineNumber;c.isEmpty()?h!==d&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(c,i?2:0)),d=h}return l.length===1?l[0]:l}let 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.getLanguageIdentifier();if(i.id===1||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const c=n.startLineNumber;n=new L(c,this.model.getLineMinColumn(c),c,this.model.getLineMaxColumn(c))}const o=this._configuration.options.get(40),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Yn.fontFamily;let d;return l?d=Yn.fontFamily:(d=o.fontFamily,d=d.replace(/"/g,"'"),/[,']/.test(d)||/[+ ]/.test(d)&&(d=`'${d}'`),d=`${d}, ${Yn.fontFamily}`),{mode:i.language,html:`<div style="color: ${r[1]};background-color: ${r[2]};font-family: ${d};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,r)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let d=i;d<=o;d++){const c=this.model.getLineTokens(d),h=c.getLineContent(),u=d===i?n-1:0,f=d===o?r-1:h.length;h===""?l+="<br>":l+=FH(h,c.inflate(),t,u,f,a,Si)}return l}_getColorMap(){let e=St.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=B.Format.CSS.formatHex(e[i]);return t}pushStackElement(){this.model.pushStackElement()}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){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 OH);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._cursor.setIsDoingComposition(!0),this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._cursor.setIsDoingComposition(!1),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,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,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))}revealPrimaryCursor(e,t){this._withViewEventsCollector(i=>this._cursor.revealPrimary(i,e,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new L(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new jp(e,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new L(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new jp(e,i,null,0,!0,0)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(r=>r.emitViewEvent(new jp(e,i,null,n,t,o)))}getVerticalOffsetForLineNumber(e){return this.viewLayout.getVerticalOffsetForLineNumber(e)}getScrollTop(){return this.viewLayout.getCurrentScrollTop()}setScrollTop(e,t){this.viewLayout.setScrollPosition({scrollTop:e},t)}setScrollPosition(e,t){this.viewLayout.setScrollPosition(e,t)}deltaScrollNow(e,t){this.viewLayout.deltaScrollNow(e,t)}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new MH),this._eventDispatcher.emitOutgoingEvent(new RH))}setMaxLineWidth(e){this.viewLayout.setMaxLineWidth(e)}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class pf{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}const Hn=Ze("accessibilityService"),rg=new se("accessibilityModeEnabled",!1);class JH extends bh{constructor(e,t){super(0);for(let i=0;i<e.length;i++)this.set(e.charCodeAt(i),1);for(let i=0;i<t.length;i++)this.set(t.charCodeAt(i),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let VS=[],HS=[];class ux{constructor(e,t){this.classifier=new JH(e,t)}static create(e){return new ux(e.get(117),e.get(116))}createLineBreaksComputer(e,t,i,n){t=t|0,i=+i;const o=[],r=[],a=[];return{addRequest:(l,d,c)=>{o.push(l),r.push(d),a.push(c)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth;let d=[];for(let c=0,h=o.length;c<h;c++){const u=r[c],f=a[c];f&&!f.injectionTexts&&!u?d[c]=e9(this.classifier,f,o[c],t,i,l,n):d[c]=t9(this.classifier,o[c],u,t,i,l,n)}return VS.length=0,HS.length=0,d}}}}function e9(s,e,t,i,n,o,r){if(n===-1)return null;const a=t.length;if(a<=1)return null;const l=e.breakOffsets,d=e.breakOffsetsVisibleColumn,c=YA(t,i,n,o,r),h=n-c;let u=VS,f=HS,g=0,m=0,b=0,v=n;const _=l.length;let w=0;if(w>=0){let C=Math.abs(d[w]-v);for(;w+1<_;){const S=Math.abs(d[w+1]-v);if(S>=C)break;C=S,w++}}for(;w<_;){let C=w<0?0:l[w],S=w<0?0:d[w];m>C&&(C=m,S=b);let D=0,y=0,x=0,E=0;if(S<=v){let A=S,H=C===0?0:t.charCodeAt(C-1),q=C===0?0:s.get(H),de=!0;for(let ce=C;ce<a;ce++){const be=ce,ke=t.charCodeAt(ce);let Le,Se;if(di(ke)?(ce++,Le=0,Se=2):(Le=s.get(ke),Se=Tu(ke,A,i,o)),be>m&&zS(H,q,ke,Le)&&(D=be,y=A),A+=Se,A>v){be>m?(x=be,E=A-Se):(x=ce+1,E=A),A-y>h&&(D=0),de=!1;break}H=ke,q=Le}if(de){g>0&&(u[g]=l[l.length-1],f[g]=d[l.length-1],g++);break}}if(D===0){let A=S,H=t.charCodeAt(C),q=s.get(H),de=!1;for(let ce=C-1;ce>=m;ce--){const be=ce+1,ke=t.charCodeAt(ce);if(ke===9){de=!0;break}let Le,Se;if(Bc(ke)?(ce--,Le=0,Se=2):(Le=s.get(ke),Se=Ks(ke)?o:1),A<=v){if(x===0&&(x=be,E=A),A<=v-h)break;if(zS(ke,Le,H,q)){D=be,y=A;break}}A-=Se,H=ke,q=Le}if(D!==0){const ce=h-(E-y);if(ce<=i){const be=t.charCodeAt(x);let ke;di(be)?ke=2:ke=Tu(be,E,i,o),ce-ke<0&&(D=0)}}if(de){w--;continue}}if(D===0&&(D=x,y=E),D<=m){const A=t.charCodeAt(m);di(A)?(D=m+2,y=b+2):(D=m+1,y=b+Tu(A,b,i,o))}for(m=D,u[g]=D,b=y,f[g]=y,g++,v=y+h;w<0||w<_&&d[w]<y;)w++;let P=Math.abs(d[w]-v);for(;w+1<_;){const A=Math.abs(d[w+1]-v);if(A>=P)break;P=A,w++}}return g===0?null:(u.length=g,f.length=g,VS=e.breakOffsets,HS=e.breakOffsetsVisibleColumn,e.breakOffsets=u,e.breakOffsetsVisibleColumn=f,e.wrappedTextIndentLength=c,e)}function t9(s,e,t,i,n,o,r){const a=Er.applyInjectedText(e,t);let l,d;if(t&&t.length>0?(l=t.map(y=>y.text),d=t.map(y=>y.column-1)):(l=null,d=null),n===-1)return l?new Cu([a.length],[],0,l,d):null;const c=a.length;if(c<=1)return l?new Cu([a.length],[],0,l,d):null;const h=YA(a,i,n,o,r),u=n-h;let f=[],g=[],m=0,b=0,v=0,_=n,w=a.charCodeAt(0),C=s.get(w),S=Tu(w,0,i,o),D=1;di(w)&&(S+=1,w=a.charCodeAt(1),C=s.get(w),D++);for(let y=D;y<c;y++){const x=y,E=a.charCodeAt(y);let P,A;di(E)?(y++,P=0,A=2):(P=s.get(E),A=Tu(E,S,i,o)),zS(w,C,E,P)&&(b=x,v=S),S+=A,S>_&&((b===0||S-v>u)&&(b=x,v=S-A),f[m]=b,g[m]=v,m++,_=v+u,b=0),w=E,C=P}return m===0&&(!t||t.length===0)?null:(f[m]=c,g[m]=S,new Cu(f,g,h,l,d))}function Tu(s,e,t,i){return s===9?t-e%t:Ks(s)||s<32?i:1}function jI(s,e){return e-s%e}function zS(s,e,t,i){return t!==32&&(e===2||e===3&&i!==2||i===1||i===3&&e!==1)}function YA(s,e,t,i,n){let o=0;if(n!==0){const r=bn(s);if(r!==-1){for(let l=0;l<r;l++){const d=s.charCodeAt(l)===9?jI(o,e):1;o+=d}const a=n===3?2:n===2?1:0;for(let l=0;l<a;l++){const d=jI(o,e);o+=d}o+i>t&&(o=0)}}return o}var Vw;const Hw=(Vw=window.trustedTypes)===null||Vw===void 0?void 0:Vw.createPolicy("domLineBreaksComputer",{createHTML:s=>s});class fx{static create(){return new fx}constructor(){}createLineBreaksComputer(e,t,i,n){t=t|0,i=+i;let o=[],r=[];return{addRequest:(a,l,d)=>{o.push(a),r.push(l)},finalize:()=>i9(o,e,t,i,n,r)}}}function i9(s,e,t,i,n,o){var r;function a(S){const D=o[S];if(D){const y=Er.applyInjectedText(s[S],D),x=D.map(P=>P.text),E=D.map(P=>P.column-1);return new Cu([y.length],[],0,x,E)}else return null}if(i===-1){const S=[];for(let D=0,y=s.length;D<y;D++)S[D]=a(D);return S}const l=Math.round(i*e.typicalHalfwidthCharacterWidth);(n===2||n===3)&&(n=1);const d=document.createElement("div");Wi.applyFontInfoSlow(d,e);const c=Tl(1e4),h=[],u=[],f=[],g=[],m=[];for(let S=0;S<s.length;S++){const D=Er.applyInjectedText(s[S],o[S]);let y=0,x=0,E=l;if(n!==0)if(y=bn(D),y===-1)y=0;else{for(let q=0;q<y;q++){const de=D.charCodeAt(q)===9?t-x%t:1;x+=de}const H=Math.ceil(e.spaceWidth*x);H+e.typicalFullwidthCharacterWidth>l?(y=0,x=0):E=l-H}const P=D.substr(y),A=n9(P,x,t,E,c);h[S]=y,u[S]=x,f[S]=P,g[S]=A[0],m[S]=A[1]}const b=c.build(),v=(r=Hw==null?void 0:Hw.createHTML(b))!==null&&r!==void 0?r:b;d.innerHTML=v,d.style.position="absolute",d.style.top="10000",d.style.wordWrap="break-word",document.body.appendChild(d);let _=document.createRange();const w=Array.prototype.slice.call(d.children,0);let C=[];for(let S=0;S<s.length;S++){const D=w[S],y=s9(_,D,f[S],g[S]);if(y===null){C[S]=a(S);continue}const x=h[S],E=u[S],P=m[S],A=[];for(let ce=0,be=y.length;ce<be;ce++)A[ce]=P[y[ce]];if(x!==0)for(let ce=0,be=y.length;ce<be;ce++)y[ce]+=x;let H,q;const de=o[S];de?(H=de.map(ce=>ce.text),q=de.map(ce=>ce.column-1)):(H=null,q=null),C[S]=new Cu(y,A,E,H,q)}return document.body.removeChild(d),C}function n9(s,e,t,i,n){n.appendASCIIString('<div style="width:'),n.appendASCIIString(String(i)),n.appendASCIIString('px;">');const o=s.length;let r=e,a=0,l=[],d=[],c=0<o?s.charCodeAt(0):0;n.appendASCIIString("<span>");for(let h=0;h<o;h++){h!==0&&h%16384===0&&n.appendASCIIString("</span><span>"),l[h]=a,d[h]=r;const u=c;c=h+1<o?s.charCodeAt(h+1):0;let f=1,g=1;switch(u){case 9:f=t-r%t,g=f;for(let m=1;m<=f;m++)m<f?n.write1(160):n.appendASCII(32);break;case 32:c===32?n.write1(160):n.appendASCII(32);break;case 60:n.appendASCIIString("&lt;");break;case 62:n.appendASCIIString("&gt;");break;case 38:n.appendASCIIString("&amp;");break;case 0:n.appendASCIIString("&#00;");break;case 65279:case 8232:case 8233:case 133:n.write1(65533);break;default:Ks(u)&&g++,u<32?n.write1(9216+u):n.write1(u)}a+=f,r+=g}return n.appendASCIIString("</span>"),l[s.length]=a,d[s.length]=r,n.appendASCIIString("</div>"),[l,d]}function s9(s,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),o=[];try{US(s,n,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function US(s,e,t,i,n,o,r,a){if(i===o||(n=n||zw(s,e,t[i],t[i+1]),r=r||zw(s,e,t[o],t[o+1]),Math.abs(n[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,d=zw(s,e,t[l],t[l+1]);US(s,e,t,i,n,l,d,a),US(s,e,t,l,d,o,r,a)}function zw(s,e,t,i){return s.setStart(e[t/16384|0].firstChild,t%16384),s.setEnd(e[i/16384|0].firstChild,i%16384),s.getClientRects()}var o9=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ka=function(s,e){return function(t,i){e(t,i,s)}};let r9=0,a9=class{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){$e(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},mf=class qp extends U{constructor(e,t,i,n,o,r,a,l,d,c){super(),this._onDidDispose=this._register(new M),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new M),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new M),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new M),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new M),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new M),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeConfiguration=this._register(new M),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new M),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new M),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new M),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new M),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new M),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new qI),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new qI),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new M),this.onWillType=this._onWillType.event,this._onDidType=this._register(new M),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new M),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new M),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new M),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new M),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new M),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new M),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new M),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new M),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onContextMenu=this._register(new M),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new M),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new M),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new M),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new M),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new M),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new M),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new M),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new M),this.onDidChangeViewZones=this._onDidChangeViewZones.event;const h=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=h.overflowWidgetsDomNode,delete h.overflowWidgetsDomNode,this._id=++r9,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this.isSimpleWidget=i.isSimpleWidget||!1,this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(h,c)),this._register(this._configuration.onDidChange(f=>{this._onDidChangeConfiguration.fire(f);const g=this._configuration.options;if(f.hasChanged(128)){const m=g.get(128);this._onDidLayoutChange.fire(m)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=d,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new l9(this,this._contextKeyService)),this._register(new d9(this,this._contextKeyService)),this._instantiationService=n.createChild(new pf([we,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new c9(e),this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}),this._contentWidgets={},this._overlayWidgets={};let u;Array.isArray(i.contributions)?u=i.contributions:u=Lc.getEditorContributions();for(const f of u){if(this._contributions[f.id]){ve(new Error(`Cannot have two contributions with the same id ${f.id}`));continue}try{const g=this._instantiationService.createInstance(f.ctor,this);this._contributions[f.id]=g}catch(g){ve(g)}}Lc.getEditorActions().forEach(f=>{if(this._actions[f.id]){ve(new Error(`Cannot have two actions with the same id ${f.id}`));return}const g=new KA(f.id,f.label,f.alias,Tn(f.precondition),()=>this._instantiationService.invokeFunction(m=>Promise.resolve(f.runEditorCommand(m,this,null))),this._contextKeyService);this._actions[g.id]=g}),this._codeEditorService.addCodeEditor(this)}_createConfiguration(e,t){return new Wi(this.isSimpleWidget,e,this._domElement,t)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Qf.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;t<i;t++){const n=e[t];this._contributions[n].dispose()}this._contributions={},this._actions={},this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e)}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?ze.getWordAtPosition(this._modelData.model,this._configuration.options.get(114),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===`
`?i=1:e&&e.lineEnding&&e.lineEnding===`\r
`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(n)}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(let e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(let 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 _getVerticalOffsetForPosition(e,t,i){const n=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber)}getTopForLineNumber(e){return this._modelData?qp._getVerticalOffsetForPosition(this._modelData,e,1):-1}getTopForPosition(e,t){return this._modelData?qp._getVerticalOffsetForPosition(this._modelData,e,t):-1}setHiddenAreas(e){this._modelData&&this._modelData.viewModel.setHiddenAreas(e.map(t=>L.lift(t)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return it.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e){if(this._modelData){if(!O.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections("api",[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!L.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);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 L(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)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!O.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new L(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e){const t=ee.isISelection(e),i=L.isIRange(e);if(!t&&!i)throw new Error("Invalid arguments");if(t)this._setSelectionImpl(e);else if(i){const n={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(n)}}_setSelectionImpl(e){if(!this._modelData)return;const t=new ee(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections("api",[t])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new L(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!L.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(L.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let n=0,o=e.length;n<o;n++)if(!ee.isISelection(e[n]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if(typeof e!="number")throw new Error("Invalid arguments");this._modelData.viewModel.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if(typeof e!="number")throw new Error("Invalid arguments");this._modelData.viewModel.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.setScrollPosition(e,t)}saveViewState(){if(!this._modelData)return null;const e={},t=Object.keys(this._contributions);for(const o of t){const r=this._contributions[o];typeof r.saveViewState=="function"&&(e[o]=r.saveViewState())}const i=this._modelData.viewModel.saveCursorState(),n=this._modelData.viewModel.saveState();return{cursorState:i,viewState:n,contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const i=t.cursorState;Array.isArray(i)?this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]);const n=t.contributionsState||{},o=Object.keys(this._contributions);for(let a=0,l=o.length;a<l;a++){const d=o[a],c=this._contributions[d];typeof c.restoreViewState=="function"&&c.restoreViewState(n[d])}const r=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(r)}}getContribution(e){return this._contributions[e]||null}getActions(){const e=[],t=Object.keys(this._actions);for(let i=0,n=t.length;i<n;i++){const o=t[i];e.push(this._actions[o])}return e}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions[e]||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.run()).then(void 0,ve);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o){if(!this._modelData||t.length===0)return;const r=this._modelData.viewModel.getSelection().getStartPosition();this._modelData.viewModel.paste(t,i,n,e);const a=this._modelData.viewModel.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new L(r.lineNumber,r.column,a.lineNumber,a.column),mode:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=Lc.getEditorCommand(t);return n?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(n.runEditorCommand(o,this,i)).then(void 0,ve)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(78)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(78)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(78))return!1;let n;return i?Array.isArray(i)?n=()=>i:n=i:n=()=>null,this._modelData.viewModel.executeEdits(e,t,n),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,Wy(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(128)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarMouseDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarMouseDown(e)}layout(e){this._configuration.observeReferenceElement(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,n=i.get(128),o=qp._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(56)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Wi.applyFontInfoSlow(e,this._configuration.options.get(40))}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageIdentifier().language),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setMaxLineNumber(e.getLineCount()),e.onBeforeAttached();const i=new QH(this._id,this._configuration,e,fx.create(),ux.create(this._configuration.options),r=>Ro(r));t.push(e.onDidChangeDecorations(r=>this._onDidChangeModelDecorations.fire(r))),t.push(e.onDidChangeLanguage(r=>{this._domElement.setAttribute("data-mode-id",e.getLanguageIdentifier().language),this._onDidChangeModelLanguage.fire(r)})),t.push(e.onDidChangeLanguageConfiguration(r=>this._onDidChangeModelLanguageConfiguration.fire(r))),t.push(e.onDidChangeContent(r=>this._onDidChangeModelContent.fire(r))),t.push(e.onDidChangeOptions(r=>this._onDidChangeModelOptions.fire(r))),t.push(e.onWillDispose(()=>this.setModel(null))),t.push(i.onEvent(r=>{switch(r.kind){case 0:this._onDidContentSizeChange.fire(r);break;case 1:this._editorTextFocus.setValue(r.hasFocus);break;case 2:this._onDidScrollChange.fire(r);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidAttemptReadOnlyEdit.fire();break;case 5:{r.reachedMaxCursorCount&&this._notificationService.warn(p("cursors.maximum","The number of cursors has been limited to {0}.",Gc.MAX_CURSOR_COUNT));const a=[];for(let c=0,h=r.selections.length;c<h;c++)a[c]=r.selections[c].getPosition();const l={position:a[0],secondaryPositions:a.slice(1),reason:r.reason,source:r.source};this._onDidChangeCursorPosition.fire(l);const d={selection:r.selections[0],secondarySelections:r.selections.slice(1),modelVersionId:r.modelVersionId,oldSelections:r.oldSelections,oldModelVersionId:r.oldModelVersionId,source:r.source,reason:r.reason};this._onDidChangeCursorSelection.fire(d);break}}}));const[n,o]=this._createView(i);if(o){this._domElement.appendChild(n.domNode.domNode);let r=Object.keys(this._contentWidgets);for(let a=0,l=r.length;a<l;a++){const d=r[a];n.addContentWidget(this._contentWidgets[d])}r=Object.keys(this._overlayWidgets);for(let a=0,l=r.length;a<l;a++){const d=r[a];n.addOverlayWidget(this._overlayWidgets[d])}n.render(!1,!0),n.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new a9(e,i,n,o,t)}_createView(e){let t;this.isSimpleWidget?t={paste:(o,r,a,l)=>{this._paste("keyboard",o,r,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,l)=>{this._compositionType("keyboard",o,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,l)=>{const d={text:o,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",d)},type:o=>{const r={text:o};this._commandService.executeCommand("type",r)},compositionType:(o,r,a,l)=>{if(a||l){const d={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",d)}else{const d={text:o,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",d)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new Ob(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new vH(t,this._configuration,this._themeService,e,i,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){e&&e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}};mf=o9([Ka(3,qe),Ka(4,Ge),Ka(5,Wt),Ka(6,we),Ka(7,pt),Ka(8,Qt),Ka(9,Hn)],mf);class qI extends U{constructor(){super(),this._onDidChangeToTrue=this._register(new M),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new M),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class l9 extends U{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=I.editorSimpleInput.bindTo(t),this._editorFocus=I.focus.bindTo(t),this._textInputFocus=I.textInputFocus.bindTo(t),this._editorTextFocus=I.editorTextFocus.bindTo(t),this._editorTabMovesFocus=I.tabMovesFocus.bindTo(t),this._editorReadonly=I.readOnly.bindTo(t),this._inDiffEditor=I.inDiffEditor.bindTo(t),this._editorColumnSelection=I.columnSelection.bindTo(t),this._hasMultipleSelections=I.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=I.hasNonEmptySelection.bindTo(t),this._canUndo=I.canUndo.bindTo(t),this._canRedo=I.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(127)),this._editorReadonly.set(e.get(78)),this._inDiffEditor.set(e.get(51)),this._editorColumnSelection.set(e.get(16))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class d9 extends U{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this._langId=I.languageId.bindTo(t),this._hasCompletionItemProvider=I.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=I.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=I.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=I.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=I.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=I.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=I.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=I.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=I.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=I.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=I.hasReferenceProvider.bindTo(t),this._hasRenameProvider=I.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=I.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=I.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=I.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=I.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=I.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=I.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=I.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(zs.onDidChange(i)),this._register(Io.onDidChange(i)),this._register(lr.onDidChange(i)),this._register(Zu.onDidChange(i)),this._register(Mm.onDidChange(i)),this._register(Tm.onDidChange(i)),this._register(Am.onDidChange(i)),this._register(Gu.onDidChange(i)),this._register(Vc.onDidChange(i)),this._register(ws.onDidChange(i)),this._register(Im.onDidChange(i)),this._register(Em.onDidChange(i)),this._register(vu.onDidChange(i)),this._register(Us.onDidChange(i)),this._register(wl.onDidChange(i)),this._register(Qr.onDidChange(i)),i()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageIdentifier().language),this._hasCompletionItemProvider.set(zs.has(e)),this._hasCodeActionsProvider.set(Io.has(e)),this._hasCodeLensProvider.set(lr.has(e)),this._hasDefinitionProvider.set(Zu.has(e)),this._hasDeclarationProvider.set(Mm.has(e)),this._hasImplementationProvider.set(Tm.has(e)),this._hasTypeDefinitionProvider.set(Am.has(e)),this._hasHoverProvider.set(Gu.has(e)),this._hasDocumentHighlightProvider.set(Vc.has(e)),this._hasDocumentSymbolProvider.set(ws.has(e)),this._hasReferenceProvider.set(Im.has(e)),this._hasRenameProvider.set(Em.has(e)),this._hasSignatureHelpProvider.set(wl.has(e)),this._hasInlayHintsProvider.set(Qr.has(e)),this._hasDocumentFormattingProvider.set(vu.has(e)||Us.has(e)),this._hasDocumentSelectionFormattingProvider.set(Us.has(e)),this._hasMultipleDocumentFormattingProvider.set(vu.all(e).length+Us.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(Us.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===Oe.walkThroughSnippet)})}}class c9 extends U{constructor(e){super(),this._onChange=this._register(new M),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Fc(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}const h9=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),u9=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function Uw(s){return h9+encodeURIComponent(s.toString())+u9}const f9=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),g9=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');function p9(s){return f9+encodeURIComponent(s.toString())+g9}tt((s,e)=>{const t=s.getColor(LA);t&&e.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${t}; }`);const i=s.getColor(Eu);i&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${Uw(i)}") repeat-x bottom left; }`);const n=s.getColor(A7);n&&e.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${n}; }`);const o=s.getColor(Mb);o&&e.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${o}; }`);const r=s.getColor(vr);r&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${Uw(r)}") repeat-x bottom left; }`);const a=s.getColor(R7);a&&e.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=s.getColor(YL);l&&e.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const d=s.getColor(Cl);d&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${Uw(d)}") repeat-x bottom left; }`);const c=s.getColor(O7);c&&e.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${c}; }`);const h=s.getColor(F7);h&&e.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${h}; }`);const u=s.getColor(P7);u&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${p9(u)}") no-repeat bottom left; }`);const f=s.getColor(r6);f&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${f.rgba.a}; }`);const g=s.getColor(o6);g&&e.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${g}; }`);const m=s.getColor(ca)||"inherit";e.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${m}}`)});class ht{constructor(e,t,i){const n=o=>this.emitter.fire(o);this.emitter=new M({onFirstListenerAdd:()=>e.addEventListener(t,n,i),onLastListenerRemove:()=>e.removeEventListener(t,n,i)})}get event(){return this.emitter.event}dispose(){this.emitter.dispose()}}function KI(s){return s.preventDefault(),s.stopPropagation(),s}var Lh=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let m9=!1;var b_;(function(s){s.North="north",s.South="south",s.East="east",s.West="west"})(b_||(b_={}));let _9=4;const b9=new M;let v9=300;const w9=new M;class gx{constructor(){this.disposables=new X}get onPointerMove(){return this.disposables.add(new ht(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new ht(window,"mouseup")).event}dispose(){this.disposables.dispose()}}Lh([Zt],gx.prototype,"onPointerMove",null);Lh([Zt],gx.prototype,"onPointerUp",null);class px{constructor(e){this.el=e,this.disposables=new X}get onPointerMove(){return this.disposables.add(new ht(this.el,vt.Change)).event}get onPointerUp(){return this.disposables.add(new ht(this.el,vt.End)).event}dispose(){this.disposables.dispose()}}Lh([Zt],px.prototype,"onPointerMove",null);Lh([Zt],px.prototype,"onPointerUp",null);class v_{constructor(e){this.factory=e}get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}dispose(){}}Lh([Zt],v_.prototype,"onPointerMove",null);Lh([Zt],v_.prototype,"onPointerUp",null);class Ti extends U{constructor(e,t,i){super(),this.hoverDelay=v9,this.hoverDelayer=this._register(new yr(this.hoverDelay)),this._state=3,this._onDidEnablementChange=this._register(new M),this.onDidEnablementChange=this._onDidEnablementChange.event,this._onDidStart=this._register(new M),this.onDidStart=this._onDidStart.event,this._onDidChange=this._register(new M),this.onDidChange=this._onDidChange.event,this._onDidReset=this._register(new M),this.onDidReset=this._onDidReset.event,this._onDidEnd=this._register(new M),this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.orthogonalStartSashDisposables=this._register(new X),this.orthogonalStartDragHandleDisposables=this._register(new X),this.orthogonalEndSashDisposables=this._register(new X),this.orthogonalEndDragHandleDisposables=this._register(new X),this.el=$(e,Y(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Re&&this.el.classList.add("mac");const n=this._register(new ht(this.el,"mousedown")).event;this._register(n(h=>this.onPointerStart(h,new gx),this));const o=this._register(new ht(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new ht(this.el,"mouseenter")).event;this._register(r(()=>Ti.onMouseEnter(this)));const a=this._register(new ht(this.el,"mouseleave")).event;this._register(a(()=>Ti.onMouseLeave(this))),this._register(ot.addTarget(this.el));const l=re.map(this._register(new ht(this.el,vt.Start)).event,h=>{var u;return Object.assign(Object.assign({},h),{target:(u=h.initialTarget)!==null&&u!==void 0?u:null})});this._register(l(h=>this.onPointerStart(h,new px(this.el)),this));const d=this._register(new ht(this.el,vt.Tap)).event,c=re.map(re.filter(re.debounce(d,(h,u)=>{var f;return{event:u,count:((f=h==null?void 0:h.count)!==null&&f!==void 0?f:0)+1}},250),({count:h})=>h===2),({event:h})=>{var u;return Object.assign(Object.assign({},h),{target:(u=h.initialTarget)!==null&&u!==void 0?u:null})});this._register(c(this.onPointerDoublePress,this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=_9,this._register(b9.event(h=>{this.size=h,this.layout()}))),this._register(w9.event(h=>this.hoverDelay=h)),this.hidden=!1,this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",m9),this.layout()}get state(){return this._state}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this._onDidEnablementChange.fire(e))}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=$(this.el,Y(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Pe(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new ht(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Ti.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new ht(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Ti.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=$(this.el,Y(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Pe(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new ht(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Ti.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new ht(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Ti.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalEndSash=e}onPointerStart(e,t){et.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new v_(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new v_(t))),!this.state)return;const n=[...ik("iframe"),...ik("webview")];for(const g of n)g.style.pointerEvents="none";const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const d=On(this.el),c=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Re?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Re?"col-resize":"ew-resize",d.textContent=`* { cursor: ${g} !important; }`},h=new X;c(),i||this.onDidEnablementChange(c,null,h);const u=g=>{et.stop(g,!1);const m={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(m)},f=g=>{et.stop(g,!1),this.el.removeChild(d),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of n)m.style.pointerEvents="auto"};t.onPointerMove(u,null,h),t.onPointerUp(f,null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Ti.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Ti.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Ti.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}hide(){this.hidden=!0,this.el.style.display="none",this.el.setAttribute("aria-hidden","true")}getOrthogonalSash(e){if(!(!e.target||!(e.target instanceof HTMLElement))&&e.target.classList.contains("orthogonal-drag-handle"))return e.target.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}class Kr{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const XA=[];function vd(s,e,t){e instanceof Kr||(e=new Kr(e,[],t)),XA.push([s,e])}function C9(){return XA}const mx=Ze("IEditorCancelService"),QA=new se("cancellableOperation",!1,p("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));vd(mx,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=QA.bindTo(n.get(we)),r=new Mn;return{key:o,tokens:r}}),this._tokens.set(s,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(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},!0);class S9 extends on{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(mx).add(e,this))}dispose(){this._unregister(),super.dispose()}}G(new class extends Di{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:QA})}runEditorCommand(s,e){s.get(mx).cancel(e)}});let JA=class $S{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?Ai("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof $S))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new $S(e,this.flags))}};class _f extends S9{constructor(e,t,i,n){super(e,n),this._listener=new X,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!L.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!L.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class _x extends on{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class zl{constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}static capture(e){let t=null,i=0;if(e.getScrollTop()!==0){const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}}return new zl(t,i,e.getPosition())}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}const eR={TEXT:ms.text};class y9{constructor(e){this.data=e}update(){}getData(){return this.data}}const Xo={CurrentDragAndDropData:void 0};class Ec extends U{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof ys&&this._register(t.onDidChange(n=>{this.element&&this.handleActionChangeEvent(n)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new bb)),this._actionRunner}set actionRunner(e){this._actionRunner=e}getAction(){return this._action}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(ot.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,qi&&this._register(K(e,le.DRAG_START,n=>{var o;return(o=n.dataTransfer)===null||o===void 0?void 0:o.setData(eR.TEXT,this._action.label)}))),this._register(K(t,vt.Tap,n=>this.onClick(n,!0))),this._register(K(t,le.MOUSE_DOWN,n=>{i||et.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),Re&&this._register(K(t,le.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(K(t,le.CLICK,n=>{et.stop(n,!0),this.options&&this.options.isMenu||gm(()=>this.onClick(n))})),this._register(K(t,le.DBLCLICK,n=>{et.stop(n,!0)})),[le.MOUSE_UP,le.MOUSE_OUT].forEach(n=>{this._register(K(t,n,o=>{et.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;et.stop(e,!0);const n=qn(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),super.dispose()}}class bf extends Ec{constructor(e,t,i={}){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=$(this.element,Y("a.action-label"))),this.label&&(this._action.id===Ls.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&($(this.element,Y("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.getAction().label)}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=p({},"{0} ({1})",e,this.options.keybinding))),e&&this.label&&(this.label.title=e)}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getAction().class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label&&this.label.classList.remove("codicon")}updateEnabled(){this.getAction().enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element&&this.element.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element&&this.element.classList.add("disabled"))}updateChecked(){this.label&&(this.getAction().checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}var L9=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class Nr extends U{constructor(e,t={}){var i,n,o,r,a,l;super(),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new M),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new M({onFirstListenerAdd:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new M),this.onDidRun=this._onDidRun.event,this._onBeforeRun=this._register(new M),this.onBeforeRun=this._onBeforeRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(n=this.options.orientation)!==null&&n!==void 0?n:0,this._triggerKeys={keyDown:(r=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&r!==void 0?r:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new bb,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun(h=>this._onDidRun.fire(h))),this._register(this._actionRunner.onBeforeRun(h=>this._onBeforeRun.fire(h))),this._actionIds=[],this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let d,c;switch(this._orientation){case 0:d=[15],c=[17];break;case 1:d=[16],c=[18],this.domNode.className+=" vertical";break}this._register(K(this.domNode,le.KEY_DOWN,h=>{const u=new Mt(h);let f=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;d&&(u.equals(d[0])||u.equals(d[1]))?f=this.focusPrevious():c&&(u.equals(c[0])||u.equals(c[1]))?f=this.focusNext():u.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():u.equals(14)?f=this.focusFirst():u.equals(13)?f=this.focusLast():u.equals(2)&&g instanceof Ec&&g.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(u)?this._triggerKeys.keyDown?this.doTrigger(u):this.triggerKeyDown=!0:f=!1,f&&(u.preventDefault(),u.stopPropagation())})),this._register(K(this.domNode,le.KEY_UP,h=>{const u=new Mt(h);this.isTriggerKeyEvent(u)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(u)),u.preventDefault(),u.stopPropagation()):(u.equals(2)||u.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(Fc(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(bc()===this.domNode||!Lr(bc(),this.domNode))&&(this._onDidBlur.fire(),this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role","toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(Lr(bc(),t)){this.focusedItem=e;break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach(t=>t.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){e&&(this._actionRunner=e,this.viewItems.forEach(t=>t.actionRunner=e))}getContainer(){return this.domNode}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=Ml(t.index)?t.index:null;i.forEach(o=>{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation"),this.options.allowContextMenu||this._register(K(r,le.CONTEXT_MENU,l=>{et.stop(l,!0)}));let a;this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o)),a||(a=new bf(this.context,o,t)),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof Ec&&this.viewItems.length===0&&a.setFocusable(!0),n===null||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a),this._actionIds.push(o.id)):(this.actionsList.insertBefore(r,this.actionsList.children[n]),this.viewItems.splice(n,0,a),this._actionIds.splice(n,0,o.id),n++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem)}clear(){$e(this.viewItems),this.viewItems=[],this._actionIds=[],hi(this.actionsList)}length(){return this.viewItems.length}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const n=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=n===-1?void 0:n,this.updateFocus()}else i!==void 0&&(this.focusedItem=i),this.updateFocus()}focusFirst(){return this.focusedItem=this.length()>1?1:0,this.focusPrevious()}focusLast(){return this.focusedItem=this.length()<2?0:this.length()-2,this.focusNext()}focusNext(){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=e,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(),!0}focusPrevious(){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(this.options.preventLoopNavigation)return this.focusedItem=e,!1;this.focusedItem=this.viewItems.length-1}t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(!0),!0}updateFocus(e,t){typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t});for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=n;if(i===this.focusedItem){let r=!0;bu(o.focus)||(r=!1),this.options.focusOnlyEnabledItems&&bu(n.isEnabled)&&!n.isEnabled()&&(r=!1),r?o.focus(e):this.actionsList.focus({preventScroll:t})}else bu(o.blur)&&o.blur()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Ec){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return L9(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){$e(this.viewItems),this.viewItems=[],this._actionIds=[],this.getContainer().remove(),super.dispose()}}const x9={IconContribution:"base.contributions.icons"};class D9{constructor(){this._onDidChange=new M,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:p("iconDefintion.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:p("iconDefintion.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${mn.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return o}let r={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=r;let a={$ref:"#/definitions/icons"};return n&&(a.deprecationMessage=n),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconFont(e){return this.iconFontsById[e]}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;wt.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`};let i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of n.filter(r=>!!r.description).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${wt.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(r=>!wt.isThemeIcon(r.defaults)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join(`
`)}}const Ul=new D9;Ht.add(x9.IconContribution,Ul);function ki(s,e,t,i){return Ul.registerIcon(s,e,t,i)}function k9(){return Ul}function I9(){for(const s of km.all)Ul.registerIcon(s.id,s.definition,s.description);km.onDidRegister(s=>Ul.registerIcon(s.id,s.definition,s.description))}I9();const tR="vscode://schemas/icons";let iR=Ht.as(gb.JSONContribution);iR.registerSchema(tR,Ul.getIconSchema());const GI=new bt(()=>iR.notifySchemaChanged(tR),200);Ul.onDidChange(()=>{GI.isScheduled()||GI.schedule()});const E9=ki("widget-close",te.close,p("widgetClose","Icon for the close action in widgets."));var N9=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},$w;const Zg=3;class $h{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return this.originalLineStart===0?1:this.modifiedLineStart===0?2:0}}class jw{constructor(e){this.entries=e}}const M9=ki("diff-review-insert",te.add,p("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),T9=ki("diff-review-remove",te.remove,p("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),A9=ki("diff-review-close",te.close,p("diffReviewCloseIcon","Icon for 'Close' in diff review."));class sr extends U{constructor(e){super(),this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=Ue(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=Ue(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new Nr(this.actionBarContainer.domNode)),this._actionBar.push(new ys("diffreview.close",p("label.close","Close"),"close-diff-review "+wt.asClassName(A9),!0,()=>N9(this,void 0,void 0,function*(){return this.hide()})),{label:!1,icon:!0}),this.domNode=Ue(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=Ue(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new sg(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff(()=>{this._isVisible&&(this._diffs=this._compute(),this._render())})),this._register(e.getModifiedEditor().onDidChangeCursorPosition(()=>{this._isVisible&&this._render()})),this._register(Gt(this.domNode.domNode,"click",t=>{t.preventDefault();let i=AM(t.target,"diff-review-row");i&&this._goToRow(i)})),this._register(Gt(this.domNode.domNode,"keydown",t=>{(t.equals(18)||t.equals(2066)||t.equals(530))&&(t.preventDefault(),this._goToRow(this._getNextRow())),(t.equals(16)||t.equals(2064)||t.equals(528))&&(t.preventDefault(),this._goToRow(this._getPrevRow())),(t.equals(9)||t.equals(2057)||t.equals(521)||t.equals(1033))&&(t.preventDefault(),this.hide()),(t.equals(10)||t.equals(3))&&(t.preventDefault(),this.accept())})),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let i=-1;for(let n=0,o=this._diffs.length;n<o;n++)if(this._diffs[n]===this._currentDiff){i=n;break}e=this._diffs.length+i-1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs.length===0)return;e=e%this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new O(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}next(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let i=-1;for(let n=0,o=this._diffs.length;n<o;n++)if(this._diffs[n]===this._currentDiff){i=n;break}e=i+1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs.length===0)return;e=e%this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new O(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}accept(){let e=-1,t=this._getCurrentFocusedRow();if(t){let i=parseInt(t.getAttribute("data-line"),10);isNaN(i)||(e=i)}this.hide(),e!==-1&&(this._diffEditor.setPosition(new O(e,1)),this._diffEditor.revealPosition(new O(e,1),1))}hide(){this._isVisible=!1,this._diffEditor.updateOptions({readOnly:!1}),this._diffEditor.focus(),this._diffEditor.doLayout(),this._render()}_getPrevRow(){let e=this._getCurrentFocusedRow();return e?e.previousElementSibling?e.previousElementSibling:e:this._getFirstRow()}_getNextRow(){let e=this._getCurrentFocusedRow();return e?e.nextElementSibling?e.nextElementSibling:e:this._getFirstRow()}_getFirstRow(){return this.domNode.domNode.querySelector(".diff-review-row")}_getCurrentFocusedRow(){let e=document.activeElement;return e&&/diff-review-row/.test(e.className)?e:null}_goToRow(e){let t=this._getCurrentFocusedRow();e.tabIndex=0,e.focus(),t&&t!==e&&(t.tabIndex=-1),this.scrollbar.scanDomNode()}isVisible(){return this._isVisible}layout(e,t,i){this._width=t,this.shadow.setTop(e-6),this.shadow.setWidth(t),this.shadow.setHeight(this._isVisible?6:0),this.domNode.setTop(e),this.domNode.setWidth(t),this.domNode.setHeight(i),this._content.setHeight(i),this._content.setWidth(t),this._isVisible?(this.actionBarContainer.setAttribute("aria-hidden","false"),this.actionBarContainer.setDisplay("block")):(this.actionBarContainer.setAttribute("aria-hidden","true"),this.actionBarContainer.setDisplay("none"))}_compute(){const e=this._diffEditor.getLineChanges();if(!e||e.length===0)return[];const t=this._diffEditor.getOriginalEditor().getModel(),i=this._diffEditor.getModifiedEditor().getModel();return!t||!i?[]:sr._mergeAdjacent(e,t.getLineCount(),i.getLineCount())}static _mergeAdjacent(e,t,i){if(!e||e.length===0)return[];let n=[],o=0;for(let d=0,c=e.length;d<c;d++){const h=e[d],u=h.originalStartLineNumber,f=h.originalEndLineNumber,g=h.modifiedStartLineNumber,m=h.modifiedEndLineNumber;let b=[],v=0;{const _=f===0?u:u-1,w=m===0?g:g-1;let C=1,S=1;if(d>0){const x=e[d-1];x.originalEndLineNumber===0?C=x.originalStartLineNumber+1:C=x.originalEndLineNumber+1,x.modifiedEndLineNumber===0?S=x.modifiedStartLineNumber+1:S=x.modifiedEndLineNumber+1}let D=_-Zg+1,y=w-Zg+1;if(D<C){const x=C-D;D=D+x,y=y+x}if(y<S){const x=S-y;D=D+x,y=y+x}b[v++]=new $h(D,_,y,w)}f!==0&&(b[v++]=new $h(u,f,0,0)),m!==0&&(b[v++]=new $h(0,0,g,m));{const _=f===0?u+1:f+1,w=m===0?g+1:m+1;let C=t,S=i;if(d+1<c){const x=e[d+1];x.originalEndLineNumber===0?C=x.originalStartLineNumber:C=x.originalStartLineNumber-1,x.modifiedEndLineNumber===0?S=x.modifiedStartLineNumber:S=x.modifiedStartLineNumber-1}let D=_+Zg-1,y=w+Zg-1;if(D>C){const x=C-D;D=D+x,y=y+x}if(y>S){const x=S-y;D=D+x,y=y+x}b[v++]=new $h(_,D,w,y)}n[o++]=new jw(b)}let r=n[0].entries,a=[],l=0;for(let d=1,c=n.length;d<c;d++){const h=n[d].entries,u=r[r.length-1],f=h[0];if(u.getType()===0&&f.getType()===0&&f.originalLineStart<=u.originalLineEnd){r[r.length-1]=new $h(u.originalLineStart,f.originalLineEnd,u.modifiedLineStart,f.modifiedLineEnd),r=r.concat(h.slice(1));continue}a[l++]=new jw(r),r=h}return a[l++]=new jw(r),a}_findDiffIndex(e){const t=e.lineNumber;for(let i=0,n=this._diffs.length;i<n;i++){const o=this._diffs[i].entries,r=o[o.length-1].modifiedLineEnd;if(t<=r)return i}return 0}_render(){const e=this._diffEditor.getOriginalEditor().getOptions(),t=this._diffEditor.getModifiedEditor().getOptions(),i=this._diffEditor.getOriginalEditor().getModel(),n=this._diffEditor.getModifiedEditor().getModel(),o=i.getOptions(),r=n.getOptions();if(!this._isVisible||!i||!n){hi(this._content.domNode),this._currentDiff=null,this.scrollbar.scanDomNode();return}this._diffEditor.updateOptions({readOnly:!0});const a=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs[a]===this._currentDiff)return;this._currentDiff=this._diffs[a];const l=this._diffs[a].entries;let d=document.createElement("div");d.className="diff-review-table",d.setAttribute("role","list"),d.setAttribute("aria-label",'Difference review. Use "Stage | Unstage | Revert Selected Ranges" commands'),Wi.applyFontInfoSlow(d,t.get(40));let c=0,h=0,u=0,f=0;for(let y=0,x=l.length;y<x;y++){const E=l[y],P=E.originalLineStart,A=E.originalLineEnd,H=E.modifiedLineStart,q=E.modifiedLineEnd;P!==0&&(c===0||P<c)&&(c=P),A!==0&&(h===0||A>h)&&(h=A),H!==0&&(u===0||H<u)&&(u=H),q!==0&&(f===0||q>f)&&(f=q)}let g=document.createElement("div");g.className="diff-review-row";let m=document.createElement("div");m.className="diff-review-cell diff-review-summary";const b=h-c+1,v=f-u+1;m.appendChild(document.createTextNode(`${a+1}/${this._diffs.length}: @@ -${c},${b} +${u},${v} @@`)),g.setAttribute("data-line",String(u));const _=y=>y===0?p("no_lines_changed","no lines changed"):y===1?p("one_line_changed","1 line changed"):p("more_lines_changed","{0} lines changed",y),w=_(b),C=_(v);g.setAttribute("aria-label",p({},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",a+1,this._diffs.length,c,w,u,C)),g.appendChild(m),g.setAttribute("role","listitem"),d.appendChild(g);const S=t.get(56);let D=u;for(let y=0,x=l.length;y<x;y++){const E=l[y];sr._renderSection(d,E,D,S,this._width,e,i,o,t,n,r),E.modifiedLineStart!==0&&(D=E.modifiedLineEnd)}hi(this._content.domNode),this._content.domNode.appendChild(d),this.scrollbar.scanDomNode()}static _renderSection(e,t,i,n,o,r,a,l,d,c,h){const u=t.getType();let f="diff-review-row",g="";const m="diff-review-spacer";let b=null;switch(u){case 1:f="diff-review-row line-insert",g=" char-insert",b=M9;break;case 2:f="diff-review-row line-delete",g=" char-delete",b=T9;break}const v=t.originalLineStart,_=t.originalLineEnd,w=t.modifiedLineStart,C=t.modifiedLineEnd,S=Math.max(C-w,_-v),D=r.get(128),y=D.glyphMarginWidth+D.lineNumbersWidth,x=d.get(128),E=10+x.glyphMarginWidth+x.lineNumbersWidth;for(let P=0;P<=S;P++){const A=v===0?0:v+P,H=w===0?0:w+P,q=document.createElement("div");q.style.minWidth=o+"px",q.className=f,q.setAttribute("role","listitem"),H!==0&&(i=H),q.setAttribute("data-line",String(i));let de=document.createElement("div");de.className="diff-review-cell",de.style.height=`${n}px`,q.appendChild(de);const ce=document.createElement("span");ce.style.width=y+"px",ce.style.minWidth=y+"px",ce.className="diff-review-line-number"+g,A!==0?ce.appendChild(document.createTextNode(String(A))):ce.innerText=" ",de.appendChild(ce);const be=document.createElement("span");be.style.width=E+"px",be.style.minWidth=E+"px",be.style.paddingRight="10px",be.className="diff-review-line-number"+g,H!==0?be.appendChild(document.createTextNode(String(H))):be.innerText=" ",de.appendChild(be);const ke=document.createElement("span");if(ke.className=m,b){const st=document.createElement("span");st.className=wt.asClassName(b),st.innerText="  ",ke.appendChild(st)}else ke.innerText="  ";de.appendChild(ke);let Le;if(H!==0){let st=this._renderLine(c,d,h.tabSize,H);sr._ttPolicy&&(st=sr._ttPolicy.createHTML(st)),de.insertAdjacentHTML("beforeend",st),Le=c.getLineContent(H)}else{let st=this._renderLine(a,r,l.tabSize,A);sr._ttPolicy&&(st=sr._ttPolicy.createHTML(st)),de.insertAdjacentHTML("beforeend",st),Le=a.getLineContent(A)}Le.length===0&&(Le=p("blankLine","blank"));let Se="";switch(u){case 0:A===H?Se=p({},"{0} unchanged line {1}",Le,A):Se=p("equalLine","{0} original line {1} modified line {2}",Le,A,H);break;case 1:Se=p("insertLine","+ {0} modified line {1}",Le,H);break;case 2:Se=p("deleteLine","- {0} original line {1}",Le,A);break}q.setAttribute("aria-label",Se),e.appendChild(q)}}static _renderLine(e,t,i,n){const o=e.getLineContent(n),r=t.get(40),a=ci.createEmpty(o),l=Fn.isBasicASCII(o,e.mightContainNonBasicASCII()),d=Fn.containsRTL(o,l,e.mightContainRTL());return hb(new gd(r.isMonospace&&!t.get(27),r.canUseHalfwidthRightwardsArrow,o,!1,l,d,0,a,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(103),t.get(86),t.get(80),t.get(41)!==In.OFF,null)).html}}sr._ttPolicy=($w=window.trustedTypes)===null||$w===void 0?void 0:$w.createPolicy("diffReview",{createHTML:s=>s});tt((s,e)=>{const t=s.getColor(OA);t&&e.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${t}; }`);const i=s.getColor(Nb);i&&e.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${i} 0 -6px 6px -6px inset; }`)});class R9 extends ne{constructor(){super({id:"editor.action.diffReview.next",label:p("editor.action.diffReview.next","Go to Next Difference"),alias:"Go to Next Difference",precondition:J.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=nR(e);i&&i.diffReviewNext()}}class O9 extends ne{constructor(){super({id:"editor.action.diffReview.prev",label:p("editor.action.diffReview.prev","Go to Previous Difference"),alias:"Go to Previous Difference",precondition:J.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=nR(e);i&&i.diffReviewPrev()}}function nR(s){const e=s.get(Ge),t=e.listDiffEditors(),i=e.getActiveCodeEditor();if(!i)return null;for(let n=0,o=t.length;n<o;n++){const r=t[n];if(r.getModifiedEditor().getId()===i.getId()||r.getOriginalEditor().getId()===i.getId())return r}return null}Q(R9);Q(O9);const Wa=Ze("contextViewService"),wd=Ze("contextMenuService");var qw=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class P9 extends U{constructor(e,t,i,n,o,r){super(),this._viewZoneId=e,this._marginDomNode=t,this.editor=i,this.diff=n,this._contextMenuService=o,this._clipboardService=r,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=te.lightBulb.classNames+" lightbulb-glyph",this._diffActions.style.position="absolute";const a=i.getOption(56),l=i.getModel().getEOL();this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${a}px`,this._diffActions.style.lineHeight=`${a}px`,this._marginDomNode.appendChild(this._diffActions);const d=[];d.push(new ys("diff.clipboard.copyDeletedContent",n.originalEndLineNumber>n.modifiedStartLineNumber?p("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):p("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"),void 0,!0,()=>qw(this,void 0,void 0,function*(){const g=new L(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),m=n.originalModel.getValueInRange(g);yield this._clipboardService.writeText(m)})));let c=0,h;n.originalEndLineNumber>n.modifiedStartLineNumber&&(h=new ys("diff.clipboard.copyDeletedLineContent",p("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber),void 0,!0,()=>qw(this,void 0,void 0,function*(){const g=n.originalModel.getLineContent(n.originalStartLineNumber+c);yield this._clipboardService.writeText(g)})),d.push(h)),i.getOption(78)||d.push(new ys("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>qw(this,void 0,void 0,function*(){const g=new L(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),m=n.originalModel.getValueInRange(g);if(n.modifiedEndLineNumber===0){const b=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new L(n.modifiedStartLineNumber,b,n.modifiedStartLineNumber,b),text:l+m}])}else{const b=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new L(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,b),text:m}])}})));const f=(g,m)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:g,y:m}),getActions:()=>(h&&(h.label=p("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+c)),d),autoSelectFirstItem:!0})};this._register(Gt(this._diffActions,"mousedown",g=>{const{top:m,height:b}=vi(this._diffActions);let v=Math.floor(a/3);g.preventDefault(),f(g.posx,m+b+v)})),this._register(i.onMouseMove(g=>{g.target.type===8||g.target.type===5?g.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,c=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,a)):this.visibility=!1:this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.rightButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._viewZoneId&&(g.event.preventDefault(),c=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,a),f(g.event.posx,g.event.posy+a))}))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,e?this._diffActions.style.visibility="visible":this._diffActions.style.visibility="hidden")}_updateLightBulbPosition(e,t,i){const{top:n}=vi(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this.diff.viewLineCounts){let l=0;for(let d=0;d<this.diff.viewLineCounts.length;d++)if(l+=this.diff.viewLineCounts[d],r<l)return d}return r}}const Va=Ze("clipboardService");class Cd{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}Cd.None=Object.freeze({report(){}});const Rr=Ze("editorProgressService");var F9=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ko=function(s,e){return function(t,i){e(t,i,s)}},Kw;class ZI{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter(t=>!this._zonesMap[String(t.id)])}clean(e){this._zones.length>0&&e.changeViewZones(t=>{for(const i of this._zones)t.removeZone(i)}),this._zones=[],this._zonesMap={},this._decorations=e.deltaDecorations(this._decorations,[])}apply(e,t,i,n){const o=n?zl.capture(e):null;e.changeViewZones(r=>{for(const a of this._zones)r.removeZone(a);for(const a of this._inlineDiffMargins)a.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let a=0,l=i.zones.length;a<l;a++){const d=i.zones[a];d.suppressMouseDown=!0;const c=r.addZone(d);this._zones.push(c),this._zonesMap[String(c)]=!0,i.zones[a].diff&&d.marginDomNode&&(d.suppressMouseDown=!1,this._inlineDiffMargins.push(new P9(c,d.marginDomNode,e,i.zones[a].diff,this._contextMenuService,this._clipboardService)))}}),o&&o.restore(e),this._decorations=e.deltaDecorations(this._decorations,i.decorations),t&&t.setZones(i.overviewZones)}}let B9=0;const W9=ki("diff-insert",te.add,p("diffInsertIcon","Line decoration for inserts in the diff editor.")),sR=ki("diff-remove",te.remove,p("diffRemoveIcon","Line decoration for removals in the diff editor.")),YI=(Kw=window.trustedTypes)===null||Kw===void 0?void 0:Kw.createPolicy("diffEditorWidget",{createHTML:s=>s});let La=class Ei extends U{constructor(e,t,i,n,o,r,a,l,d,c,h,u){super(),this._editorProgressService=u,this._onDidDispose=this._register(new M),this.onDidDispose=this._onDidDispose.event,this._onDidUpdateDiff=this._register(new M),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new M),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._editorWorkerService=o,this._codeEditorService=l,this._contextKeyService=this._register(r.createScoped(e)),this._instantiationService=a.createChild(new pf([we,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=d,this._notificationService=c,this._id=++B9,this._state=0,this._updatingDiffProgress=null,this._domElement=e,t=t||{},this._renderSideBySide=!0,typeof t.renderSideBySide<"u"&&(this._renderSideBySide=t.renderSideBySide),this._maxComputationTime=5e3,typeof t.maxComputationTime<"u"&&(this._maxComputationTime=t.maxComputationTime),this._ignoreTrimWhitespace=!0,typeof t.ignoreTrimWhitespace<"u"&&(this._ignoreTrimWhitespace=t.ignoreTrimWhitespace),this._renderIndicators=!0,typeof t.renderIndicators<"u"&&(this._renderIndicators=t.renderIndicators),this._originalIsEditable=me(t.originalEditable,!1),this._diffCodeLens=me(t.diffCodeLens,!1),this._diffWordWrap=JI(t.diffWordWrap,"inherit"),typeof t.isInEmbeddedEditor<"u"?this._contextKeyService.createKey("isInEmbeddedDiffEditor",t.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._renderOverviewRuler=!0,typeof t.renderOverviewRuler<"u"&&(this._renderOverviewRuler=!!t.renderOverviewRuler),this._updateDecorationsRunner=this._register(new bt(()=>this._updateDecorations(),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=Ei._getClassName(this._themeService.getColorTheme(),this._renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=Ue(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"),this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(Gt(this._overviewDomElement,"mousedown",g=>{this._modifiedEditor.delegateVerticalScrollbarMouseDown(g)})),this._renderOverviewRuler&&this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode),this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new ZI(h,n),this._modifiedEditorState=new ZI(h,n),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new QT(this._containerDomElement,t.dimension,()=>this._onDidContainerSizeChanged())),t.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null,this._originalEditor=this._createLeftHandSideEditor(t,i.originalEditor||{}),this._modifiedEditor=this._createRightHandSideEditor(t,i.modifiedEditor||{}),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=new sr(this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._enableSplitViewResizing=!0,typeof t.enableSplitViewResizing<"u"&&(this._enableSplitViewResizing=t.enableSplitViewResizing),this._renderSideBySide?this._setStrategy(new hr(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new QI(this._createDataSource(),this._enableSplitViewResizing)),this._register(d.onDidColorThemeChange(g=>{this._strategy&&this._strategy.applyColors(g)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=Ei._getClassName(this._themeService.getColorTheme(),this._renderSideBySide)}));const f=Lc.getDiffEditorContributions();for(const g of f)try{this._register(a.createInstance(g.ctor,this))}catch(m){ve(m)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e,this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),this._state===1&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let i="monaco-diff-editor monaco-editor-background ";return t&&(i+="side-by-side "),i+=t_(e.type),i}_recreateOverviewRulers(){this._renderOverviewRuler&&(this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._originalEditor.hasModel()&&(this._originalOverviewRuler=this._originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this._modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers())}_createLeftHandSideEditor(e,t){const i=this._createInnerEditor(this._instantiationService,this._originalDomNode,this._adjustOptionsForLeftHandSide(e),t);this._register(i.onDidScrollChange(o=>{this._isHandlingScrollEvent||!o.scrollTopChanged&&!o.scrollLeftChanged&&!o.scrollHeightChanged||(this._isHandlingScrollEvent=!0,this._modifiedEditor.setScrollPosition({scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(i.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(i.onDidChangeConfiguration(o=>{i.getModel()&&(o.hasChanged(40)&&this._updateDecorationsRunner.schedule(),o.hasChanged(129)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(i.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}));const n=this._contextKeyService.createKey("isInDiffLeftEditor",i.hasWidgetFocus());return this._register(i.onDidFocusEditorWidget(()=>n.set(!0))),this._register(i.onDidBlurEditorWidget(()=>n.set(!1))),this._register(i.onDidContentSizeChange(o=>{const r=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+Ei.ONE_OVERVIEW_WIDTH,a=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:a,contentWidth:r,contentHeightChanged:o.contentHeightChanged,contentWidthChanged:o.contentWidthChanged})})),i}_createRightHandSideEditor(e,t){const i=this._createInnerEditor(this._instantiationService,this._modifiedDomNode,this._adjustOptionsForRightHandSide(e),t);this._register(i.onDidScrollChange(o=>{this._isHandlingScrollEvent||!o.scrollTopChanged&&!o.scrollLeftChanged&&!o.scrollHeightChanged||(this._isHandlingScrollEvent=!0,this._originalEditor.setScrollPosition({scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(i.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(i.onDidChangeConfiguration(o=>{i.getModel()&&(o.hasChanged(40)&&this._updateDecorationsRunner.schedule(),o.hasChanged(129)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(i.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})),this._register(i.onDidChangeModelOptions(o=>{o.tabSize&&this._updateDecorationsRunner.schedule()}));const n=this._contextKeyService.createKey("isInDiffRightEditor",i.hasWidgetFocus());return this._register(i.onDidFocusEditorWidget(()=>n.set(!0))),this._register(i.onDidBlurEditorWidget(()=>n.set(!1))),this._register(i.onDidContentSizeChange(o=>{const r=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+Ei.ONE_OVERVIEW_WIDTH,a=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:a,contentWidth:r,contentHeightChanged:o.contentHeightChanged,contentWidthChanged:o.contentWidthChanged})})),i}_createInnerEditor(e,t,i,n){return e.createInstance(mf,t,i,n)}dispose(){this._codeEditorService.removeDiffEditor(this),this._beginUpdateDecorationsTimeout!==-1&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._renderOverviewRuler&&this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this._originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this._modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode),this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Qf.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(e){let t=!1;typeof e.renderSideBySide<"u"&&this._renderSideBySide!==e.renderSideBySide&&(this._renderSideBySide=e.renderSideBySide,t=!0),typeof e.maxComputationTime<"u"&&(this._maxComputationTime=e.maxComputationTime,this._isVisible&&this._beginUpdateDecorationsSoon());let i=!1;typeof e.ignoreTrimWhitespace<"u"&&this._ignoreTrimWhitespace!==e.ignoreTrimWhitespace&&(this._ignoreTrimWhitespace=e.ignoreTrimWhitespace,i=!0),typeof e.renderIndicators<"u"&&this._renderIndicators!==e.renderIndicators&&(this._renderIndicators=e.renderIndicators,i=!0),i&&this._beginUpdateDecorations(),this._originalIsEditable=me(e.originalEditable,this._originalIsEditable),this._diffCodeLens=me(e.diffCodeLens,this._diffCodeLens),this._diffWordWrap=JI(e.diffWordWrap,this._diffWordWrap),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(e)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(e)),typeof e.enableSplitViewResizing<"u"&&(this._enableSplitViewResizing=e.enableSplitViewResizing),this._strategy.setEnableSplitViewResizing(this._enableSplitViewResizing),t&&(this._renderSideBySide?this._setStrategy(new hr(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new QI(this._createDataSource(),this._enableSplitViewResizing)),this._containerDomElement.className=Ei._getClassName(this._themeService.getColorTheme(),this._renderSideBySide)),typeof e.renderOverviewRuler<"u"&&this._renderOverviewRuler!==e.renderOverviewRuler&&(this._renderOverviewRuler=e.renderOverviewRuler,this._renderOverviewRuler?this._containerDomElement.appendChild(this._overviewDomElement):this._containerDomElement.removeChild(this._overviewDomElement))}getModel(){return{original:this._originalEditor.getModel(),modified:this._modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this._originalEditor.setModel(e?e.original:null),this._modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this._originalEditor.setScrollTop(0),this._modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._recreateOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport()}getDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this._modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._modifiedEditor.getPosition()}setPosition(e){this._modifiedEditor.setPosition(e)}revealLine(e,t=0){this._modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this._modifiedEditor.getSelection()}getSelections(){return this._modifiedEditor.getSelections()}setSelection(e){this._modifiedEditor.setSelection(e)}setSelections(e){this._modifiedEditor.setSelections(e)}revealLines(e,t,i=0){this._modifiedEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._modifiedEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._modifiedEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._modifiedEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._modifiedEditor.getSupportedActions()}saveViewState(){const e=this._originalEditor.saveViewState(),t=this._modifiedEditor.saveViewState();return{original:e,modified:t}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._originalEditor.restoreViewState(t.original),this._modifiedEditor.restoreViewState(t.modified)}}layout(e){this._elementSizeObserver.observe(e)}focus(){this._modifiedEditor.focus()}hasTextFocus(){return this._originalEditor.hasTextFocus()||this._modifiedEditor.hasTextFocus()}trigger(e,t,i){this._modifiedEditor.trigger(e,t,i)}changeDecorations(e){return this._modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._renderOverviewRuler||!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const e=this._elementSizeObserver.getHeight(),t=this._getReviewHeight(),i=Ei.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Ei.ONE_OVERVIEW_WIDTH;this._modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:Ei.ONE_OVERVIEW_WIDTH,right:i+Ei.ONE_OVERVIEW_WIDTH,height:e-t}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:Ei.ONE_OVERVIEW_WIDTH,height:e-t}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){this._beginUpdateDecorationsTimeout!==-1&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout(()=>this._beginUpdateDecorations(),Ei.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t?!0:!e||!t?!1:e.toString()===t.toString()}_beginUpdateDecorations(){this._beginUpdateDecorationsTimeout=-1;const e=this._originalEditor.getModel(),t=this._modifiedEditor.getModel();if(!e||!t)return;this._diffComputationToken++;const i=this._diffComputationToken;if(this._setState(1),!this._editorWorkerService.canComputeDiff(e.uri,t.uri)){(!Ei._equals(e.uri,this._lastOriginalWarning)||!Ei._equals(t.uri,this._lastModifiedWarning))&&(this._lastOriginalWarning=e.uri,this._lastModifiedWarning=t.uri,this._notificationService.warn(p("diff.tooLarge","Cannot compare files because one file is too large.")));return}this._editorWorkerService.computeDiff(e.uri,t.uri,this._ignoreTrimWhitespace,this._maxComputationTime).then(n=>{i===this._diffComputationToken&&e===this._originalEditor.getModel()&&t===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=n,this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())},n=>{i===this._diffComputationToken&&e===this._originalEditor.getModel()&&t===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())})}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this._originalEditor),this._modifiedEditorState.clean(this._modifiedEditor)}_updateDecorations(){if(!this._originalEditor.getModel()||!this._modifiedEditor.getModel())return;const e=this._diffComputationResult?this._diffComputationResult.changes:[],t=this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces()),i=this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces()),n=this._strategy.getEditorsDiffDecorations(e,this._ignoreTrimWhitespace,this._renderIndicators,t,i);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this._originalEditor,this._originalOverviewRuler,n.original,!1),this._modifiedEditorState.apply(this._modifiedEditor,this._modifiedOverviewRuler,n.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){const t=Object.assign({},e);return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._renderSideBySide?t.wordWrapOverride1=this._diffWordWrap:t.wordWrapOverride1="off",e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.readOnly=!this._originalIsEditable,t.extraEditorClassName="original-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}_adjustOptionsForRightHandSide(e){const t=this._adjustOptionsForSubEditor(e);return e.modifiedAriaLabel&&(t.ariaLabel=e.modifiedAriaLabel),t.wordWrapOverride1=this._diffWordWrap,t.revealHorizontalRightPadding=Js.revealHorizontalRightPadding.defaultValue+Ei.ENTIRE_DIFF_OVERVIEW_WIDTH,t.scrollbar.verticalHasArrows=!1,t.extraEditorClassName="modified-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const e=this._elementSizeObserver.getWidth(),t=this._elementSizeObserver.getHeight(),i=this._getReviewHeight(),n=this._strategy.layout();this._originalDomNode.style.width=n+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=e-n+"px",this._modifiedDomNode.style.left=n+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=t-i+"px",this._overviewDomElement.style.width=Ei.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=e-Ei.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(Ei.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:n,height:t-i}),this._modifiedEditor.layout({width:e-n-(this._renderOverviewRuler?Ei.ENTIRE_DIFF_OVERVIEW_WIDTH:0),height:t-i}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(t-i,e,i),this._layoutOverviewViewport()}_layoutOverviewViewport(){const e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){const e=this._modifiedEditor.getLayoutInfo();if(!e)return null;const t=this._modifiedEditor.getScrollTop(),i=this._modifiedEditor.getScrollHeight(),n=Math.max(0,e.height),o=Math.max(0,n-2*0),r=i>0?o/i:0,a=Math.max(0,Math.floor(e.height*r)),l=Math.floor(t*r);return{height:a,top:l}}_createDataSource(){return{getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getOptions:()=>({renderOverviewRuler:this._renderOverviewRuler}),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this._originalEditor,getModifiedEditor:()=>this._modifiedEditor}}_setStrategy(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const i=this._diffComputationResult?this._diffComputationResult.changes:[];if(i.length===0||e<t(i[0]))return null;let n=0,o=i.length-1;for(;n<o;){const r=Math.floor((n+o)/2),a=t(i[r]),l=r+1<=o?t(i[r+1]):1073741824;e<a?o=r-1:e>=l?n=r+1:(n=r,o=r)}return i[n]}_getEquivalentLineForOriginalLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,l=>l.originalStartLineNumber);if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,a=e-i;return a<=o?n+Math.min(a,r):n+r-o+a}_getEquivalentLineForModifiedLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,l=>l.modifiedStartLineNumber);if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,a=e-n;return a<=r?i+Math.min(a,o):i+o-r+a}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};La.ONE_OVERVIEW_WIDTH=15;La.ENTIRE_DIFF_OVERVIEW_WIDTH=30;La.UPDATE_DIFF_DECORATIONS_DELAY=200;La=F9([Ko(3,Va),Ko(4,Ms),Ko(5,we),Ko(6,qe),Ko(7,Ge),Ko(8,pt),Ko(9,Qt),Ko(10,wd),Ko(11,Rr)],La);class oR extends U{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=(e.getColor(xA)||AS).transparent(2),i=(e.getColor(DA)||RS).transparent(2),n=!t.equals(this._insertColor)||!i.equals(this._removeColor);return this._insertColor=t,this._removeColor=i,n}getEditorsDiffDecorations(e,t,i,n,o){o=o.sort((d,c)=>d.afterLineNumber-c.afterLineNumber),n=n.sort((d,c)=>d.afterLineNumber-c.afterLineNumber);const r=this._getViewZones(e,n,o,i),a=this._getOriginalEditorDecorations(e,t,i),l=this._getModifiedEditorDecorations(e,t,i);return{original:{decorations:a.decorations,overviewZones:a.overviewZones,zones:r.original},modified:{decorations:l.decorations,overviewZones:l.overviewZones,zones:r.modified}}}}class XI{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._index<this._source.length?this.current=this._source[this._index]:this.current=null}}class gl{constructor(e,t,i,n,o){this._lineChanges=e,this._originalForeignVZ=t,this._modifiedForeignVZ=i,this._originalEditor=n,this._modifiedEditor=o}static _getViewLineCount(e,t,i){const n=e.getModel(),o=e._getViewModel();if(n&&o){const r=vf(n,o,t,i);return r.endLineNumber-r.startLineNumber+1}return i-t+1}getViewZones(){const e=this._originalEditor.getOption(56),t=this._modifiedEditor.getOption(56),i=this._originalEditor.getOption(129).wrappingColumn!==-1,n=this._modifiedEditor.getOption(129).wrappingColumn!==-1,o=i||n,r=this._originalEditor.getModel(),a=this._originalEditor._getViewModel().coordinatesConverter,l=this._modifiedEditor._getViewModel().coordinatesConverter,d={original:[],modified:[]};let c=0,h=0,u=0,f=0,g=0,m=0;const b=(D,y)=>D.afterLineNumber-y.afterLineNumber,v=(D,y)=>{if(y.domNode===null&&D.length>0){const x=D[D.length-1];if(x.afterLineNumber===y.afterLineNumber&&x.domNode===null){x.heightInLines+=y.heightInLines;return}}D.push(y)},_=new XI(this._modifiedForeignVZ),w=new XI(this._originalForeignVZ);let C=1,S=1;for(let D=0,y=this._lineChanges.length;D<=y;D++){const x=D<y?this._lineChanges[D]:null;x!==null?(u=x.originalStartLineNumber+(x.originalEndLineNumber>0?-1:0),f=x.modifiedStartLineNumber+(x.modifiedEndLineNumber>0?-1:0),h=x.originalEndLineNumber>0?gl._getViewLineCount(this._originalEditor,x.originalStartLineNumber,x.originalEndLineNumber):0,c=x.modifiedEndLineNumber>0?gl._getViewLineCount(this._modifiedEditor,x.modifiedStartLineNumber,x.modifiedEndLineNumber):0,g=Math.max(x.originalStartLineNumber,x.originalEndLineNumber),m=Math.max(x.modifiedStartLineNumber,x.modifiedEndLineNumber)):(u+=1e7+h,f+=1e7+c,g=u,m=f);let E=[],P=[];if(o){let q;x?x.originalEndLineNumber>0?q=x.originalStartLineNumber-C:q=x.modifiedStartLineNumber-S:q=r.getLineCount()-C;for(let de=0;de<q;de++){const ce=C+de,be=S+de,ke=a.getModelLineViewLineCount(ce),Le=l.getModelLineViewLineCount(be);ke<Le?E.push({afterLineNumber:ce,heightInLines:Le-ke,domNode:null,marginDomNode:null}):ke>Le&&P.push({afterLineNumber:be,heightInLines:ke-Le,domNode:null,marginDomNode:null})}x&&(C=(x.originalEndLineNumber>0?x.originalEndLineNumber:x.originalStartLineNumber)+1,S=(x.modifiedEndLineNumber>0?x.modifiedEndLineNumber:x.modifiedStartLineNumber)+1)}for(;_.current&&_.current.afterLineNumber<=m;){let q;_.current.afterLineNumber<=f?q=u-f+_.current.afterLineNumber:q=g;let de=null;x&&x.modifiedStartLineNumber<=_.current.afterLineNumber&&_.current.afterLineNumber<=x.modifiedEndLineNumber&&(de=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),E.push({afterLineNumber:q,heightInLines:_.current.height/t,domNode:null,marginDomNode:de}),_.advance()}for(;w.current&&w.current.afterLineNumber<=g;){let q;w.current.afterLineNumber<=u?q=f-u+w.current.afterLineNumber:q=m,P.push({afterLineNumber:q,heightInLines:w.current.height/e,domNode:null}),w.advance()}if(x!==null&&Nc(x)){const q=this._produceOriginalFromDiff(x,h,c);q&&E.push(q)}if(x!==null&&Mc(x)){const q=this._produceModifiedFromDiff(x,h,c);q&&P.push(q)}let A=0,H=0;for(E=E.sort(b),P=P.sort(b);A<E.length&&H<P.length;){const q=E[A],de=P[H],ce=q.afterLineNumber-u,be=de.afterLineNumber-f;ce<be?(v(d.original,q),A++):be<ce?(v(d.modified,de),H++):q.shouldNotShrink?(v(d.original,q),A++):de.shouldNotShrink?(v(d.modified,de),H++):q.heightInLines>=de.heightInLines?(q.heightInLines-=de.heightInLines,H++):(de.heightInLines-=q.heightInLines,A++)}for(;A<E.length;)v(d.original,E[A]),A++;for(;H<P.length;)v(d.modified,P[H]),H++}return{original:gl._ensureDomNodes(d.original),modified:gl._ensureDomNodes(d.modified)}}static _ensureDomNodes(e){return e.map(t=>(t.domNode||(t.domNode=rR()),t))}}function or(s,e,t,i,n){return{range:new L(s,e,t,i),options:n}}const Xi={charDelete:De.register({description:"diff-editor-char-delete",className:"char-delete"}),charDeleteWholeLine:De.register({description:"diff-editor-char-delete-whole-line",className:"char-delete",isWholeLine:!0}),charInsert:De.register({description:"diff-editor-char-insert",className:"char-insert"}),charInsertWholeLine:De.register({description:"diff-editor-char-insert-whole-line",className:"char-insert",isWholeLine:!0}),lineInsert:De.register({description:"diff-editor-line-insert",className:"line-insert",marginClassName:"line-insert",isWholeLine:!0}),lineInsertWithSign:De.register({description:"diff-editor-line-insert-with-sign",className:"line-insert",linesDecorationsClassName:"insert-sign "+wt.asClassName(W9),marginClassName:"line-insert",isWholeLine:!0}),lineDelete:De.register({description:"diff-editor-line-delete",className:"line-delete",marginClassName:"line-delete",isWholeLine:!0}),lineDeleteWithSign:De.register({description:"diff-editor-line-delete-with-sign",className:"line-delete",linesDecorationsClassName:"delete-sign "+wt.asClassName(sR),marginClassName:"line-delete",isWholeLine:!0}),lineDeleteMargin:De.register({description:"diff-editor-line-delete-margin",marginClassName:"line-delete"})};class hr extends oR{constructor(e,t){super(e),this._disableSash=t===!1,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new Ti(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart(()=>this._onSashDragStart()),this._sash.onDidChange(i=>this._onSashDrag(i)),this._sash.onDidEnd(()=>this._onSashDragEnd()),this._sash.onDidReset(()=>this._onSashReset())}setEnableSplitViewResizing(e){const t=e===!1;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){const i=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?La.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let n=Math.floor((e||.5)*i);const o=Math.floor(.5*i);return n=this._disableSash?o:n||o,i>hr.MINIMUM_EDITOR_WIDTH*2?(n<hr.MINIMUM_EDITOR_WIDTH&&(n=hr.MINIMUM_EDITOR_WIDTH),n>i-hr.MINIMUM_EDITOR_WIDTH&&(n=i-hr.MINIMUM_EDITOR_WIDTH)):n=o,this._sashPosition!==n&&(this._sashPosition=n,this._sash.layout()),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const i=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?La.ENTIRE_DIFF_OVERVIEW_WIDTH:0),n=this.layout((this._startSashPosition+(e.currentX-e.startX))/i);this._sashRatio=n/i,this._dataSource.relayoutEditors()}_onSashDragEnd(){this._sash.layout()}_onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}_getViewZones(e,t,i){const n=this._dataSource.getOriginalEditor(),o=this._dataSource.getModifiedEditor();return new V9(e,t,i,n,o).getViewZones()}_getOriginalEditorDecorations(e,t,i){const n=this._dataSource.getOriginalEditor(),o=String(this._removeColor),r={decorations:[],overviewZones:[]},a=n.getModel(),l=n._getViewModel();for(const d of e)if(Mc(d)){r.decorations.push({range:new L(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824),options:i?Xi.lineDeleteWithSign:Xi.lineDelete}),(!Nc(d)||!d.charChanges)&&r.decorations.push(or(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824,Xi.charDeleteWholeLine));const c=vf(a,l,d.originalStartLineNumber,d.originalEndLineNumber);if(r.overviewZones.push(new uf(c.startLineNumber,c.endLineNumber,o)),d.charChanges){for(const h of d.charChanges)if(Mc(h))if(t)for(let u=h.originalStartLineNumber;u<=h.originalEndLineNumber;u++){let f,g;u===h.originalStartLineNumber?f=h.originalStartColumn:f=a.getLineFirstNonWhitespaceColumn(u),u===h.originalEndLineNumber?g=h.originalEndColumn:g=a.getLineLastNonWhitespaceColumn(u),r.decorations.push(or(u,f,u,g,Xi.charDelete))}else r.decorations.push(or(h.originalStartLineNumber,h.originalStartColumn,h.originalEndLineNumber,h.originalEndColumn,Xi.charDelete))}}return r}_getModifiedEditorDecorations(e,t,i){const n=this._dataSource.getModifiedEditor(),o=String(this._insertColor),r={decorations:[],overviewZones:[]},a=n.getModel(),l=n._getViewModel();for(const d of e)if(Nc(d)){r.decorations.push({range:new L(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824),options:i?Xi.lineInsertWithSign:Xi.lineInsert}),(!Mc(d)||!d.charChanges)&&r.decorations.push(or(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824,Xi.charInsertWholeLine));const c=vf(a,l,d.modifiedStartLineNumber,d.modifiedEndLineNumber);if(r.overviewZones.push(new uf(c.startLineNumber,c.endLineNumber,o)),d.charChanges){for(const h of d.charChanges)if(Nc(h))if(t)for(let u=h.modifiedStartLineNumber;u<=h.modifiedEndLineNumber;u++){let f,g;u===h.modifiedStartLineNumber?f=h.modifiedStartColumn:f=a.getLineFirstNonWhitespaceColumn(u),u===h.modifiedEndLineNumber?g=h.modifiedEndColumn:g=a.getLineLastNonWhitespaceColumn(u),r.decorations.push(or(u,f,u,g,Xi.charInsert))}else r.decorations.push(or(h.modifiedStartLineNumber,h.modifiedStartColumn,h.modifiedEndLineNumber,h.modifiedEndColumn,Xi.charInsert))}}return r}}hr.MINIMUM_EDITOR_WIDTH=100;class V9 extends gl{constructor(e,t,i,n,o){super(e,t,i,n,o)}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){return null}_produceOriginalFromDiff(e,t,i){return i>t?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i-t,domNode:null}:null}_produceModifiedFromDiff(e,t,i){return t>i?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-i,domNode:null}:null}}class QI extends oR{constructor(e,t){super(e),this._decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange(i=>{this._decorationsLeft!==i.decorationsLeft&&(this._decorationsLeft=i.decorationsLeft,e.relayoutEditors())}))}setEnableSplitViewResizing(e){}_getViewZones(e,t,i,n){const o=this._dataSource.getOriginalEditor(),r=this._dataSource.getModifiedEditor();return new H9(e,t,i,o,r,n).getViewZones()}_getOriginalEditorDecorations(e,t,i){const n=String(this._removeColor),o={decorations:[],overviewZones:[]},r=this._dataSource.getOriginalEditor(),a=r.getModel(),l=r._getViewModel();for(const d of e)if(Mc(d)){o.decorations.push({range:new L(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824),options:Xi.lineDeleteMargin});const c=vf(a,l,d.originalStartLineNumber,d.originalEndLineNumber);o.overviewZones.push(new uf(c.startLineNumber,c.endLineNumber,n))}return o}_getModifiedEditorDecorations(e,t,i){const n=this._dataSource.getModifiedEditor(),o=String(this._insertColor),r={decorations:[],overviewZones:[]},a=n.getModel(),l=n._getViewModel();for(const d of e)if(Nc(d)){r.decorations.push({range:new L(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824),options:i?Xi.lineInsertWithSign:Xi.lineInsert});const c=vf(a,l,d.modifiedStartLineNumber,d.modifiedEndLineNumber);if(r.overviewZones.push(new uf(c.startLineNumber,c.endLineNumber,o)),d.charChanges){for(const h of d.charChanges)if(Nc(h))if(t)for(let u=h.modifiedStartLineNumber;u<=h.modifiedEndLineNumber;u++){let f,g;u===h.modifiedStartLineNumber?f=h.modifiedStartColumn:f=a.getLineFirstNonWhitespaceColumn(u),u===h.modifiedEndLineNumber?g=h.modifiedEndColumn:g=a.getLineLastNonWhitespaceColumn(u),r.decorations.push(or(u,f,u,g,Xi.charInsert))}else r.decorations.push(or(h.modifiedStartLineNumber,h.modifiedStartColumn,h.modifiedEndLineNumber,h.modifiedEndColumn,Xi.charInsert))}else r.decorations.push(or(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824,Xi.charInsertWholeLine))}return r}layout(){return Math.max(5,this._decorationsLeft)}}class H9 extends gl{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._originalModel=n.getModel(),this._renderIndicators=r,this._pendingLineChange=[],this._pendingViewZones=[],this._lineBreaksComputer=this._modifiedEditor._getViewModel().createLineBreaksComputer()}getViewZones(){const e=super.getViewZones();return this._finalize(e),e}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){const e=document.createElement("div");return e.className="inline-added-margin-view-zone",e}_produceOriginalFromDiff(e,t,i){const n=document.createElement("div");return n.className="inline-added-margin-view-zone",{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i,domNode:document.createElement("div"),marginDomNode:n}}_produceModifiedFromDiff(e,t,i){const n=document.createElement("div");n.className=`view-lines line-delete ${xl}`;const o=document.createElement("div");o.className="inline-deleted-margin-view-zone";const r={shouldNotShrink:!0,afterLineNumber:e.modifiedEndLineNumber===0?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:0,domNode:n,marginDomNode:o,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalModel:this._originalModel,viewLineCounts:null}};for(let a=e.originalStartLineNumber;a<=e.originalEndLineNumber;a++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(a),null,null);return this._pendingLineChange.push(e),this._pendingViewZones.push(r),r}_finalize(e){const t=this._modifiedEditor.getOptions(),i=this._modifiedEditor.getModel().getOptions().tabSize,n=t.get(40),o=t.get(27),r=n.typicalHalfwidthCharacterWidth,a=t.get(91),l=this._originalModel.mightContainNonBasicASCII(),d=this._originalModel.mightContainRTL(),c=t.get(56),u=t.get(128).decorationsWidth,f=t.get(103),g=t.get(86),m=t.get(80),b=t.get(41),v=this._lineBreaksComputer.finalize();let _=0;for(let w=0;w<this._pendingLineChange.length;w++){const C=this._pendingLineChange[w],S=this._pendingViewZones[w],D=S.domNode;Wi.applyFontInfoSlow(D,n);const y=S.marginDomNode;Wi.applyFontInfoSlow(y,n);const x=[];if(C.charChanges)for(const be of C.charChanges)Mc(be)&&x.push(new Ap(new L(be.originalStartLineNumber,be.originalStartColumn,be.originalEndLineNumber,be.originalEndColumn),"char-delete",0));const E=x.length>0,P=Tl(1e4);let A=0,H=0,q=null;for(let be=C.originalStartLineNumber;be<=C.originalEndLineNumber;be++){const ke=be-C.originalStartLineNumber,Le=this._originalModel.getLineTokens(be),Se=Le.getLineContent(),st=v[_++],pi=An.filter(x,be,1,Se.length+1);if(st){let Zi=0;for(const Ii of st.breakOffsets){const rs=Le.sliceAndInflate(Zi,Ii,0),Md=Se.substring(Zi,Ii);A=Math.max(A,this._renderOriginalLine(H++,Md,rs,An.extractWrapped(pi,Zi,Ii),E,l,d,n,o,c,u,f,g,m,b,i,P,y)),Zi=Ii}for(q||(q=[]);q.length<ke;)q[q.length]=1;q[ke]=st.breakOffsets.length,S.heightInLines+=st.breakOffsets.length-1;const zt=document.createElement("div");zt.className="line-delete",e.original.push({afterLineNumber:be,afterColumn:0,heightInLines:st.breakOffsets.length-1,domNode:rR(),marginDomNode:zt})}else A=Math.max(A,this._renderOriginalLine(H++,Se,Le,pi,E,l,d,n,o,c,u,f,g,m,b,i,P,y))}A+=a;const de=P.build(),ce=YI?YI.createHTML(de):de;if(D.innerHTML=ce,S.minWidthInPx=A*r,q){const be=C.originalEndLineNumber-C.originalStartLineNumber;for(;q.length<=be;)q[q.length]=1}S.diff.viewLineCounts=q}e.original.sort((w,C)=>w.afterLineNumber-C.afterLineNumber)}_renderOriginalLine(e,t,i,n,o,r,a,l,d,c,h,u,f,g,m,b,v,_){v.appendASCIIString('<div class="view-line'),o||v.appendASCIIString(" char-delete"),v.appendASCIIString('" style="top:'),v.appendASCIIString(String(e*c)),v.appendASCIIString('px;width:1000000px;">');const w=Fn.isBasicASCII(t,r),C=Fn.containsRTL(t,w,a),S=cb(new gd(l.isMonospace&&!d,l.canUseHalfwidthRightwardsArrow,t,!1,w,C,0,i,n,b,0,l.spaceWidth,l.middotWidth,l.wsmiddotWidth,u,f,g,m!==In.OFF,null),v);if(v.appendASCIIString("</div>"),this._renderIndicators){const D=document.createElement("div");D.className=`delete-sign ${wt.asClassName(sR)}`,D.setAttribute("style",`position:absolute;top:${e*c}px;width:${h}px;height:${c}px;right:0;`),_.appendChild(D)}return S.characterMapping.getAbsoluteOffset(S.characterMapping.length)}}function JI(s,e){return fn(s,e,["off","on","inherit"])}function Nc(s){return s.modifiedEndLineNumber>0}function Mc(s){return s.originalEndLineNumber>0}function rR(){const s=document.createElement("div");return s.className="diagonal-fill",s}function vf(s,e,t,i){const n=s.getLineCount();return t=Math.min(n,Math.max(1,t)),i=Math.min(n,Math.max(1,i)),e.coordinatesConverter.convertModelRangeToViewRange(new L(t,s.getLineMinColumn(t),i,s.getLineMaxColumn(i)))}tt((s,e)=>{const t=s.getColor(xA);t&&(e.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { background-color: ${t}; }`),e.addRule(`.monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: ${t}; }`),e.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${t}; }`));const i=s.getColor(DA);i&&(e.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { background-color: ${i}; }`),e.addRule(`.monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: ${i}; }`),e.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${i}; }`));const n=s.getColor(r8);n&&e.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${s.type==="hc"?"dashed":"solid"} ${n}; }`);const o=s.getColor(a8);o&&e.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${s.type==="hc"?"dashed":"solid"} ${o}; }`);const r=s.getColor(Nb);r&&e.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${r}; }`);const a=s.getColor(l8);a&&e.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${a}; }`);const l=s.getColor(Pp);l&&e.addRule(`
.monaco-diff-editor .diffViewport {
background: ${l};
}
`);const d=s.getColor(Fp);d&&e.addRule(`
.monaco-diff-editor .diffViewport:hover {
background: ${d};
}
`);const c=s.getColor(Bp);c&&e.addRule(`
.monaco-diff-editor .diffViewport:active {
background: ${c};
}
`);const h=s.getColor(d8);e.addRule(`
.monaco-editor .diagonal-fill {
background-image: linear-gradient(
-45deg,
${h} 12.5%,
#0000 12.5%, #0000 50%,
${h} 50%, ${h} 62.5%,
#0000 62.5%, #0000 100%
);
background-size: 8px 8px;
}
`)});const Sd=Ze("themeService"),Lt=Ze("keybindingService");class z9 extends U{constructor(){super(),this._onCodeEditorAdd=this._register(new M),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new M),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new M),this._onDiffEditorRemove=this._register(new M),this._onDecorationTypeRegistered=this._register(new M),this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null)}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}}var U9=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$9=function(s,e){return function(t,i){e(t,i,s)}};class j9{constructor(e,t,i){this._parent=e,this._editorId=t,this._styleSheet=i,this._refCount=0}ref(){this._refCount++}unref(){var e;this._refCount--,this._refCount===0&&((e=this._styleSheet.parentNode)===null||e===void 0||e.removeChild(this._styleSheet),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){this._styleSheet.sheet.insertRule(e,t)}removeRulesContainingSelector(e){Sm(e,this._styleSheet)}}class q9{constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){this._styleSheet.sheet.insertRule(e,t)}removeRulesContainingSelector(e){Sm(e,this._styleSheet)}}let jS=class extends z9{constructor(e,t){super(),this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._globalStyleSheet=e||null,this._themeService=t}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=new q9(On())),this._globalStyleSheet}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!tb(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const n=new j9(this,i,On(t));this._editorStyleSheets.set(i,n)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,n,o){let r=this._decorationOptionProviders.get(t);if(!r){const a=this._getOrCreateStyleSheet(o),l={styleSheet:a,key:t,parentTypeKey:n,options:i||Object.create(null)};n?r=new K9(this._themeService,a,l):r=new G9(e,this._themeService,a,l),this._decorationOptionProviders.set(t,r),this._onDecorationTypeRegistered.fire(t)}r.refCount++}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorations(e))))}resolveDecorationOptions(e,t){const i=this._decorationOptionProviders.get(e);if(!i)throw new Error("Unknown decoration type key: "+e);return i.getOptions(this,t)}};jS=U9([$9(1,pt)],jS);class K9{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new w_(3,i,e),this._afterContentRules=new w_(4,i,e)}getOptions(e,t){const i=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(i.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(i.afterContentClassName=this._afterContentRules.className),i}dispose(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null),this._styleSheet.unref()}}class G9{constructor(e,t,i,n){this._disposables=new X,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=h=>{const u=new w_(h,n,t);if(this._disposables.add(u),u.hasContent)return u.className},r=h=>{const u=new w_(h,n,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=o(0);const a=r(1);a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=o(3),this.afterContentClassName=o(4),this.glyphMarginClassName=o(2);const l=n.options;this.isWholeLine=!!l.isWholeLine,this.stickiness=l.rangeBehavior;const d=l.light&&l.light.overviewRulerColor||l.overviewRulerColor,c=l.dark&&l.dark.overviewRulerColor||l.overviewRulerColor;(typeof d<"u"||typeof c<"u")&&(this.overviewRuler={color:d||c,darkColor:c||d,position:l.overviewRulerLane||Pn.Center})}getOptions(e,t){return t?{description:this.description,inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness}:this}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const jh={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",fontSize:"font-size:{0};",fontFamily:"font-family:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",padding:"padding:{0};",width:"width:{0};",height:"height:{0};"};class w_{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let n=Gw.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+Gw.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=Gw.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(o=>{this._theme=i.getColorTheme(),this._removeCSS(),this._buildCSS()}):this._themeListener=null}dispose(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)}get hasContent(){return this._hasContent}get hasLetterSpacing(){return this._hasLetterSpacing}get className(){return this._className}_buildCSS(){const e=this._providerArgs.options;let t,i,n;switch(this._ruleType){case 0:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),n=this.getCSSTextForModelDecorationClassName(e.dark);break;case 1:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),n=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case 2:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case 3:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case 4:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;default:throw new Error("Unknown rule type: "+this._ruleType)}const o=this._providerArgs.styleSheet;let r=!1;t.length>0&&(o.insertRule(`${this._unThemedSelector} {${t}}`,0),r=!0),i.length>0&&(o.insertRule(`.vs${this._unThemedSelector} {${i}}`,0),r=!0),n.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector} {${n}}`,0),r=!0),this._hasContent=r}_removeCSS(){this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector)}getCSSTextForModelDecorationClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")}getCSSTextForModelDecorationInlineClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")}getCSSTextForModelDecorationContentClassName(e){if(!e)return"";const t=[];if(typeof e<"u"){if(this.collectBorderSettingsCSSText(e,t),typeof e.contentIconPath<"u"&&t.push(Ai(jh.contentIconPath,xr(he.revive(e.contentIconPath)))),typeof e.contentText=="string"){const n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(Ai(jh.contentText,n))}this.collectCSSText(e,["fontStyle","fontWeight","fontSize","fontFamily","textDecoration","color","opacity","backgroundColor","margin","padding"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")}getCSSTextForModelDecorationGlyphMarginClassName(e){if(!e)return"";const t=[];return typeof e.gutterIconPath<"u"&&(t.push(Ai(jh.gutterIconPath,xr(he.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push(Ai(jh.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push(Ai("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const n=i.length;for(let o of t){const r=this.resolveValue(e[o]);typeof r=="string"&&i.push(Ai(jh[o],r))}return i.length!==n}resolveValue(e){if(l3(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}class Gw{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let n=".monaco-editor ."+this.getClassName(e,i);return t&&(n=n+"."+this.getClassName(t,i)),i===3?n+="::before":i===4&&(n+="::after"),n}}var Z9=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},eE=function(s,e){return function(t,i){e(t,i,s)}};let C_=class extends jS{constructor(e,t,i){super(e,i),this.onCodeEditorAdd(()=>this._checkContextKey()),this.onCodeEditorRemove(()=>this._checkContextKey()),this._editorIsOpen=t.createKey("editorIsOpen",!1),this._activeCodeEditor=null}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}openCodeEditor(e,t,i){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===Oe.http||o===Oe.https)return BM(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if(typeof n.endLineNumber=="number"&&typeof n.endColumn=="number")e.setSelection(n),e.revealRangeInCenter(n,1);else{const o={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};C_=Z9([eE(1,we),eE(2,pt)],C_);var bx=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},_t=function(s,e){return function(t,i){e(t,i,s)}};let Y9=0,tE=!1;function X9(){tE||(tE=!0,HW(document.body))}let S_=class extends mf{constructor(e,t,i,n,o,r,a,l,d,c){const h=Object.assign({},t);h.ariaLabel=h.ariaLabel||Zm.editorViewAccessibleLabel,h.ariaLabel=h.ariaLabel+";"+Zm.accessibilityHelpMessage,super(e,h,{},i,n,o,r,l,d,c),a instanceof zT?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,X9()}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;let n="DYNAMIC_"+ ++Y9,o=J.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),U.None;const t=e.id,i=e.label,n=J.and(J.equals("editorId",this.getId()),J.deserialize(e.precondition)),o=e.keybindings,r=J.and(n,J.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,d=(f,...g)=>Promise.resolve(e.run(this,...g)),c=new X,h=this.getId()+":"+t;if(c.add(He.registerCommand(h,d)),a){let f={command:{id:h,title:i},when:n,group:a,order:l};c.add(xs.appendMenuItem(oe.EditorContext,f))}if(Array.isArray(o))for(const f of o)c.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,d,r));let u=new KA(h,i,i,n,d,this._contextKeyService);return this._actions[t]=u,c.add(Pe(()=>{delete this._actions[t]})),c}_triggerCommand(e,t){if(this._codeEditorService instanceof C_)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};S_=bx([_t(2,qe),_t(3,Ge),_t(4,Wt),_t(5,we),_t(6,Lt),_t(7,pt),_t(8,Qt),_t(9,Hn)],S_);let qS=class extends S_{constructor(e,t,i,n,o,r,a,l,d,c,h,u,f,g,m){const b=Object.assign({},t);Ym(u,b,!1);const v=c.registerEditorContainer(e);typeof b.theme=="string"&&c.setTheme(b.theme),typeof b.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!b.autoDetectHighContrast);let _=b.model;delete b.model,super(e,b,n,o,r,a,l,c,h,f),this._contextViewService=d,this._configurationService=u,this._standaloneThemeService=c,this._register(i),this._register(v);let w;if(typeof _>"u"?(w=aR(g,m,b.value||"",b.language||ms.text,void 0),this._ownsModel=!0):(w=_,this._ownsModel=!1),this._attachModel(w),w){let C={oldModelUrl:null,newModelUrl:w.uri};this._onDidChangeModel.fire(C)}}dispose(){super.dispose()}updateOptions(e){Ym(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_attachModel(e){super._attachModel(e),this._modelData&&this._contextViewService.setContainer(this._modelData.view.domNode.domNode)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};qS=bx([_t(3,qe),_t(4,Ge),_t(5,Wt),_t(6,we),_t(7,Lt),_t(8,Wa),_t(9,Sd),_t(10,Qt),_t(11,At),_t(12,Hn),_t(13,Vt),_t(14,to)],qS);let KS=class extends La{constructor(e,t,i,n,o,r,a,l,d,c,h,u,f,g,m){const b=Object.assign({},t);Ym(u,b,!0);const v=c.registerEditorContainer(e);typeof b.theme=="string"&&c.setTheme(b.theme),typeof b.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!b.autoDetectHighContrast),super(e,b,{},m,l,o,n,d,c,h,f,g),this._contextViewService=a,this._configurationService=u,this._standaloneThemeService=c,this._register(i),this._register(v),this._contextViewService.setContainer(this._containerDomElement)}dispose(){super.dispose()}updateOptions(e){Ym(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(S_,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};KS=bx([_t(3,qe),_t(4,we),_t(5,Lt),_t(6,Wa),_t(7,Ms),_t(8,Ge),_t(9,Sd),_t(10,Qt),_t(11,At),_t(12,wd),_t(13,Rr),_t(14,Va)],KS);function aR(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(`
`);let r=t;return o!==-1&&(r=t.substring(0,o)),iE(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return iE(s,t,e.create(i),n)}function iE(s,e,t,i){return s.createModel(e,t,i)}class Q9{constructor(e){this._languageIdentifier=e}getId(){return this._languageIdentifier.language}}const J9={ModesRegistry:"editor.modesRegistry"};class ez{constructor(){this._onDidChangeLanguages=new M,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[],this._dynamicLanguages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e){this._languages.splice(t,1);return}}}}getLanguages(){return[].concat(this._languages).concat(this._dynamicLanguages)}}const Dl=new ez;Ht.add(J9.ModesRegistry,Dl);const vx="plaintext",tz=".txt",lR=new dL(vx,1);Dl.registerLanguage({id:vx,extensions:[tz],aliases:[p("plainText.alias","Plain Text"),"text"],mimetypes:[ms.text]});xe.register(lR,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],folding:{offSide:!0}},0);const Ga=Object.prototype.hasOwnProperty;class iz extends U{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new M),this.onDidChange=this._onDidChange.event,this._warnOnOverwrite=t,this._nextLanguageId2=1,this._languageIdToLanguage=[],this._languageToLanguageId=Object.create(null),this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Dl.onDidChangeLanguages(i=>this._initializeFromRegistry())))}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={};const e=Dl.getLanguages();this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{let i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(n=>{this._lowercaseNameMap[n.toLowerCase()]=i.identifier}),i.mimetypes.forEach(n=>{this._mimeTypesMap[n]=i.identifier})}),Ht.as(pd.Configuration).registerOverrideIdentifiers(Dl.getLanguages().map(t=>t.id)),this._onDidChange.fire()}_getLanguageId(e){if(this._languageToLanguageId[e])return this._languageToLanguageId[e];const t=this._nextLanguageId2++;return this._languageIdToLanguage[t]=e,this._languageToLanguageId[e]=t,t}_registerLanguage(e){const t=e.id;let i;if(Ga.call(this._languages,t))i=this._languages[t];else{const n=this._getLanguageId(t);i={identifier:new dL(t,n),name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[]},this._languages[t]=i}this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(let a of t.extensions)Hg({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let a of t.filenames)Hg({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(let a of t.filenamePatterns)Hg({id:i,mime:n,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{let l=new RegExp(a);C5(l)||Hg({id:i,mime:n,firstline:l},this._warnOnOverwrite)}catch(l){ve(l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);let r=o!==null&&o.length>0;if(!(r&&o[0]===null)){let a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration)}isRegisteredMode(e){return Ga.call(this._mimeTypesMap,e)?!0:Ga.call(this._languages,e)}getModeIdForLanguageNameLowercase(e){return Ga.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null}extractModeIds(e){return e?e.split(",").map(t=>t.trim()).map(t=>Ga.call(this._mimeTypesMap,t)?this._mimeTypesMap[t].language:t).filter(t=>Ga.call(this._languages,t)):[]}getLanguageIdentifier(e){if(e===uL||e===0)return Pm;let t;if(typeof e=="string")t=e;else if(t=this._languageIdToLanguage[e],!t)return null;return Ga.call(this._languages,t)?this._languages[t].identifier:null}getModeIdsFromFilepathOrFirstLine(e,t){if(!e&&!t)return[];let i=w7(e,t);return this.extractModeIds(i.join(","))}}class nE{constructor(e,t){this._selector=t,this.languageIdentifier=this._selector();let i;this._onDidChange=new M({onFirstListenerAdd:()=>{i=e(()=>this._evaluate())},onLastListenerRemove:()=>{i.dispose()}}),this.onDidChange=this._onDidChange.event}_evaluate(){let e=this._selector();e.id!==this.languageIdentifier.id&&(this.languageIdentifier=e,this._onDidChange.fire(this.languageIdentifier))}}class nz extends U{constructor(e=!1){super(),this._onDidCreateMode=this._register(new M),this.onDidCreateMode=this._onDidCreateMode.event,this._onLanguagesMaybeChanged=this._register(new M({leakWarningThreshold:200})),this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,this._instantiatedModes={},this._registry=this._register(new iz(!0,e)),this._register(this._registry.onDidChange(()=>this._onLanguagesMaybeChanged.fire()))}isRegisteredMode(e){return this._registry.isRegisteredMode(e)}getModeIdForLanguageName(e){return this._registry.getModeIdForLanguageNameLowercase(e)}getModeIdByFilepathOrFirstLine(e,t){const i=this._registry.getModeIdsFromFilepathOrFirstLine(e,t);return fS(i,null)}getModeId(e){const t=this._registry.extractModeIds(e);return fS(t,null)}getLanguageIdentifier(e){return this._registry.getLanguageIdentifier(e)}create(e){return new nE(this.onLanguagesMaybeChanged,()=>{const t=this.getModeId(e);return this._createModeAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new nE(this.onLanguagesMaybeChanged,()=>{const i=this.getModeIdByFilepathOrFirstLine(e,t);return this._createModeAndGetLanguageIdentifier(i)})}_createModeAndGetLanguageIdentifier(e){const t=this.getLanguageIdentifier(e||"plaintext")||Pm;return this._getOrCreateMode(t.language),t}triggerMode(e){const t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")}_getOrCreateMode(e){if(!this._instantiatedModes.hasOwnProperty(e)){let t=this.getLanguageIdentifier(e)||Pm;this._instantiatedModes[e]=new Q9(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]}}const Bb=Ze("undoRedoService");class dR{constructor(e,t){this.resource=e,this.elements=t}}class Zc{constructor(){this.id=Zc._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}Zc._ID=0;Zc.None=new Zc;class wo{constructor(){this.id=wo._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}wo._ID=0;wo.None=new wo;class sz{constructor(e,t,i){this._legend=e,this._themeService=t,this._logService=i,this._hashTable=new rr,this._hasWarnedOverlappingTokens=!1}getMetadata(e,t,i){const n=this._hashTable.get(e,t,i.id);let o;if(n)o=n.metadata,this._logService.getLevel()===js.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${$i.getForeground(o)}, fontStyle ${$i.getFontStyle(o).toString(2)}`);else{let r=this._legend.tokenTypes[e];const a=[];if(r){let l=t;for(let c=0;l>0&&c<this._legend.tokenModifiers.length;c++)l&1&&a.push(this._legend.tokenModifiers[c]),l=l>>1;l>0&&this._logService.getLevel()===js.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),a.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(r,a,i.language);if(typeof d>"u")o=2147483647;else{if(o=0,typeof d.italic<"u"){const c=(d.italic?1:0)<<11;o|=c|1}if(typeof d.bold<"u"){const c=(d.bold?2:0)<<11;o|=c|2}if(typeof d.underline<"u"){const c=(d.underline?4:0)<<11;o|=c|4}if(d.foreground){const c=d.foreground<<14;o|=c|8}o===0&&(o=2147483647)}}else this._logService.getLevel()===js.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),o=2147483647,r="not-in-legend";this._hashTable.add(e,t,i.id,o),this._logService.getLevel()===js.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${r}) / ${t} (${a.join(" ")}): foreground ${$i.getForeground(o)}, fontStyle ${$i.getFontStyle(o).toString(2)}`)}return o}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}}function cR(s,e,t){const i=s.data,n=s.data.length/5|0,o=Math.max(Math.ceil(n/1024),400),r=[];let a=0,l=1,d=0;for(;a<n;){const c=a;let h=Math.min(c+o,n);if(h<n){let w=h;for(;w-1>c&&i[5*w]===0;)w--;if(w-1===c){let C=h;for(;C+1<n&&i[5*C]===0;)C++;h=C}else h=w}let u=new Uint32Array((h-c)*4),f=0,g=0,m=0,b=0,v=0;for(;a<h;){const w=5*a,C=i[w],S=i[w+1],D=l+C,y=C===0?d+S:S,x=i[w+2],E=i[w+3],P=i[w+4],A=e.getMetadata(E,P,t);A!==2147483647&&(g===0&&(g=D),m===D&&v>y&&(e.warnOverlappingSemanticTokens(D,y+1),b<y?u[f-4+2]=y:f-=4),u[f]=D-g,u[f+1]=y,u[f+2]=y+x,u[f+3]=A,f+=4,m=D,b=y,v=y+x),l=D,d=y,a++}f!==u.length&&(u=u.subarray(0,f));const _=new n_(g,new i_(u));r.push(_)}return r}class oz{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class rr{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=rr._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<rr._SIZES.length?2/3*this._currentLength:0),this._elements=[],rr._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const n=this._hashFunc(e,t,i);let o=this._elements[n];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.next}return null}add(e,t,i,n){if(this._elementsCount++,this._growCount!==0&&this._elementsCount>=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=rr._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<rr._SIZES.length?2/3*this._currentLength:0),this._elements=[],rr._nullOutEntries(this._elements,this._currentLength);for(const r of o){let a=r;for(;a;){const l=a.next;a.next=null,this._add(a),a=l}}}this._add(new oz(e,t,i,n))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}rr._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];function rz(s){for(let e=0,t=s.length;e<t;e+=4){const i=s[e+0],n=s[e+1],o=s[e+2],r=s[e+3];s[e+0]=r,s[e+1]=o,s[e+2]=n,s[e+3]=i}}function az(s){const e=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return aM()||rz(e),nb.wrap(e)}function hR(s){const e=new Uint32Array(lz(s));let t=0;if(e[t++]=s.id,s.type==="full")e[t++]=1,e[t++]=s.data.length,e.set(s.data,t),t+=s.data.length;else{e[t++]=2,e[t++]=s.deltas.length;for(const i of s.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return az(e)}function lz(s){let e=0;if(e+=2,s.type==="full")e+=1+s.data.length;else{e+=1,e+=3*s.deltas.length;for(const t of s.deltas)t.data&&(e+=t.data.length)}return e}var Wb=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function wx(s){return s&&!!s.data}function dz(s){return s&&Array.isArray(s.edits)}function uR(s,e,t){const i=fR(s);return i?{provider:i,request:Promise.resolve(i.provideDocumentSemanticTokens(s,e,t))}:null}function fR(s){const e=Om.ordered(s);return e.length>0?e[0]:null}function Cx(s){const e=hL.ordered(s);return e.length>0?e[0]:null}He.registerCommand("_provideDocumentSemanticTokensLegend",(s,...e)=>Wb(void 0,void 0,void 0,function*(){const[t]=e;nt(t instanceof he);const i=s.get(Vt).getModel(t);if(!i)return;const n=fR(i);return n?n.getLegend():s.get(Wt).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));He.registerCommand("_provideDocumentSemanticTokens",(s,...e)=>Wb(void 0,void 0,void 0,function*(){const[t]=e;nt(t instanceof he);const i=s.get(Vt).getModel(t);if(!i)return;const n=uR(i,null,Fe.None);if(!n)return s.get(Wt).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const{provider:o,request:r}=n;let a;try{a=yield r}catch(d){gi(d);return}if(!a||!wx(a))return;const l=hR({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),l}));He.registerCommand("_provideDocumentRangeSemanticTokensLegend",(s,...e)=>Wb(void 0,void 0,void 0,function*(){const[t]=e;nt(t instanceof he);const i=s.get(Vt).getModel(t);if(!i)return;const n=Cx(i);if(n)return n.getLegend()}));He.registerCommand("_provideDocumentRangeSemanticTokens",(s,...e)=>Wb(void 0,void 0,void 0,function*(){const[t,i]=e;nt(t instanceof he),nt(L.isIRange(i));const n=s.get(Vt).getModel(t);if(!n)return;const o=Cx(n);if(!o)return;let r;try{r=yield o.provideDocumentRangeSemanticTokens(n,L.lift(i),Fe.None)}catch(a){gi(a);return}if(!(!r||!wx(r)))return hR({id:0,type:"full",data:r.data})}));var cz=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qh=function(s,e){return function(t,i){e(t,i,s)}};function Wr(s){return s.toString()}function sE(s){const e=new ob,t=s.createSnapshot();let i;for(;i=t.read();)e.update(i);return e.digest()}class hz{constructor(e,t,i){this._modelEventListeners=new X,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(n=>i(e,n)))}_disposeLanguageSelection(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null)}dispose(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()}setLanguage(e){this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange(()=>this.model.setMode(e.languageIdentifier)),this.model.setMode(e.languageIdentifier)}}const uz=sn||Re?1:2;class fz{constructor(e,t,i,n,o,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}function gz(s){return s.scheme===Oe.file||s.scheme===Oe.vscodeRemote||s.scheme===Oe.userData||s.scheme==="fake-fs"}let y_=class cu extends U{constructor(e,t,i,n,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=i,this._logService=n,this._undoRedoService=o,this._onModelAdded=this._register(new M),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new M),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new M),this.onModelModeChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new mz(this._themeService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration(()=>this._updateModelOptions())),this._updateModelOptions(),this._register(new pz(this,this._themeService,this._configurationService,this._semanticStyling))}static _readModelOptions(e,t){let i=pn.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const h=parseInt(e.editor.tabSize,10);isNaN(h)||(i=h),i<1&&(i=1)}let n=i;if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const h=parseInt(e.editor.indentSize,10);isNaN(h)||(n=h),n<1&&(n=1)}let o=pn.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(o=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=uz;const a=e.eol;a===`\r
`?r=2:a===`
`&&(r=1);let l=pn.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=pn.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let c=pn.largeFileOptimizations;return e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(c=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:o,detectIndentation:d,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&i!=="auto"?i:ps===3||ps===2?`
`:`\r
`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){let n=this._modelCreationOptionsByLanguageAndResource[e+t];if(!n){const o=this._configurationService.getValue("editor",{overrideIdentifier:e,resource:t}),r=this._getEOL(t,e);n=cu._readModelOptions({editor:o,eol:r},i),this._modelCreationOptionsByLanguageAndResource[e+t]=n}return n}_updateModelOptions(){const e=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const o=t[i],r=this._models[o],a=r.model.getLanguageIdentifier().language,l=r.model.uri,d=e[a+l],c=this.getCreationOptions(a,l,r.model.isForSimpleWidget);cu._setModelOptionsForModel(r.model,c,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)&&(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace}))}_insertDisposedModel(e){this._disposedModels.set(Wr(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(Wr(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(Wr(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 o=this.getCreationOptions(t.language,i,n),r=new si(e,o,t,i,this._undoRedoService);if(i&&this._disposedModels.has(Wr(i))){const d=this._removeDisposedModel(i),c=this._undoRedoService.getElements(i),h=sE(r)===d.sha1;if(h||d.sharesUndoRedoStack){for(const u of c.past)ir(u)&&u.matchesResource(i)&&u.setModel(r);for(const u of c.future)ir(u)&&u.matchesResource(i)&&u.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,u=>ir(u)&&u.matchesResource(i)),h&&(r._overwriteVersionId(d.versionId),r._overwriteAlternativeVersionId(d.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(d.initialUndoRedoSnapshot))}else d.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(d.initialUndoRedoSnapshot)}const a=Wr(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new hz(r,d=>this._onWillDispose(d),(d,c)=>this._onDidChangeLanguage(d,c));return this._models[a]=l,l}createModel(e,t,i,n=!1){let o;return t?(o=this._createModelData(e,t.languageIdentifier,i,n),this.setMode(o.model,t)):o=this._createModelData(e,lR,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[Wr(e.uri)];i&&i.setLanguage(t)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const o=t[i];e.push(this._models[o].model)}return e}getModel(e){const t=Wr(e),i=this._models[t];return i?i.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_onWillDispose(e){const t=Wr(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,r=0;if(n||this._shouldRestoreUndoStack()&&gz(e.uri)){const l=this._undoRedoService.getElements(e.uri);if(l.past.length>0||l.future.length>0){for(const d of l.past)ir(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of l.future)ir(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=cu.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(o)if(!n&&r>a){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,l=>ir(l)&&l.matchesResource(e.uri)),this._insertDisposedModel(new fz(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,sE(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!n){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageIdentifier().language+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageIdentifier().language,o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);cu._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldModeId:i})}};y_.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;y_=cz([qh(0,At),qh(1,_T),qh(2,pt),qh(3,Tr),qh(4,Bb)],y_);const Sx="editor.semanticHighlighting";function GS(s,e,t){var i;const n=(i=t.getValue(Sx,{overrideIdentifier:s.getLanguageIdentifier().language,resource:s.uri}))===null||i===void 0?void 0:i.enabled;return typeof n=="boolean"?n:e.getColorTheme().semanticHighlighting}class pz extends U{constructor(e,t,i,n){super(),this._watchers=Object.create(null),this._semanticStyling=n;const o=l=>{this._watchers[l.uri.toString()]=new pl(l,t,this._semanticStyling)},r=(l,d)=>{d.dispose(),delete this._watchers[l.uri.toString()]},a=()=>{for(let l of e.getModels()){const d=this._watchers[l.uri.toString()];GS(l,t,i)?d||o(l):d&&r(l,d)}};this._register(e.onModelAdded(l=>{GS(l,t,i)&&o(l)})),this._register(e.onModelRemoved(l=>{const d=this._watchers[l.uri.toString()];d&&r(l,d)})),this._register(i.onDidChangeConfiguration(l=>{l.affectsConfiguration(Sx)&&a()})),this._register(t.onDidColorThemeChange(a))}}class mz extends U{constructor(e,t){super(),this._themeService=e,this._logService=t,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}get(e){return this._caches.has(e)||this._caches.set(e,new sz(e.getLegend(),this._themeService,this._logService)),this._caches.get(e)}}class _z{constructor(e,t,i){this._provider=e,this.resultId=t,this.data=i}dispose(){this._provider.releaseDocumentSemanticTokens(this.resultId)}}class pl extends U{constructor(e,t,i){super(),this._isDisposed=!1,this._model=e,this._semanticStyling=i,this._fetchDocumentSemanticTokens=this._register(new bt(()=>this._fetchDocumentSemanticTokensNow(),pl.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule()})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const n=()=>{$e(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const o of Om.all(e))typeof o.onDidChange=="function"&&this._documentProvidersChangeListeners.push(o.onDidChange(()=>this._fetchDocumentSemanticTokens.schedule(0)))};n(),this._register(Om.onDidChange(()=>{n(),this._fetchDocumentSemanticTokens.schedule()})),this._register(t.onDidColorThemeChange(o=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule()})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;const e=new on,t=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,i=uR(this._model,t,e.token);if(!i){this._currentDocumentResponse&&this._model.setSemanticTokens(null,!1);return}const{provider:n,request:o}=i;this._currentDocumentRequestCancellationTokenSource=e;const r=[],a=this._model.onDidChangeContent(d=>{r.push(d)}),l=this._semanticStyling.get(n);o.then(d=>{this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),this._setDocumentSemanticTokens(n,d||null,l,r)},d=>{d&&(Vo(d)||typeof d.message=="string"&&d.message.indexOf("busy")!==-1)||ve(d),this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),r.length>0&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule())})}static _copy(e,t,i,n,o){for(let r=0;r<o;r++)i[n+r]=e[t+r]}_setDocumentSemanticTokens(e,t,i,n){const o=this._currentDocumentResponse,r=()=>{n.length>0&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule()};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.setSemanticTokens(null,!1);return}if(!t){this._model.setSemanticTokens(null,!0),r();return}if(dz(t)){if(!o){this._model.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const l=o.data,d=new Uint32Array(l.length+a);let c=l.length,h=d.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u],g=c-(f.start+f.deleteCount);g>0&&(pl._copy(l,c-g,d,h-g,g),h-=g),f.data&&(pl._copy(f.data,0,d,h-f.data.length,f.data.length),h-=f.data.length),c=f.start}c>0&&pl._copy(l,0,d,0,c),t={resultId:t.resultId,data:d}}}if(wx(t)){this._currentDocumentResponse=new _z(e,t.resultId,t.data);const a=cR(t,i,this._model.getLanguageIdentifier());if(n.length>0)for(const l of n)for(const d of a)for(const c of l.changes)d.applyEdit(c.range,c.text);this._model.setSemanticTokens(a,!0)}else this._model.setSemanticTokens(null,!0);r()}}pl.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY=300;class bz{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function vz(s){if(!s||!Array.isArray(s))return[];let e=[],t=0;for(let i=0,n=s.length;i<n;i++){let o=s[i],r=-1;if(typeof o.fontStyle=="string"){r=0;let d=o.fontStyle.split(" ");for(let c=0,h=d.length;c<h;c++)switch(d[c]){case"italic":r=r|1;break;case"bold":r=r|2;break;case"underline":r=r|4;break}}let a=null;typeof o.foreground=="string"&&(a=o.foreground);let l=null;typeof o.background=="string"&&(l=o.background),e[t++]=new bz(o.token||"",i,r,a,l)}return e}function wz(s,e){s.sort((c,h)=>{let u=xz(c.token,h.token);return u!==0?u:c.index-h.index});let t=0,i="000000",n="ffffff";for(;s.length>=1&&s[0].token==="";){let c=s.shift();c.fontStyle!==-1&&(t=c.fontStyle),c.foreground!==null&&(i=c.foreground),c.background!==null&&(n=c.background)}let o=new Sz;for(let c of e)o.getId(c);let r=o.getId(i),a=o.getId(n),l=new yx(t,r,a),d=new Lx(l);for(let c=0,h=s.length;c<h;c++){let u=s[c];d.insert(u.token,u.fontStyle,o.getId(u.foreground),o.getId(u.background))}return new gR(o,d)}const Cz=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class Sz{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(e===null)return 0;const t=e.match(Cz);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=B.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class gR{constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(vz(e),t)}static createFromParsedTokenTheme(e,t){return wz(e,t)}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(typeof i>"u"){let n=this._match(t),o=Lz(t);i=(n.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const yz=/\b(comment|string|regex|regexp)\b/;function Lz(s){let e=s.match(yz);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 4;case"regexp":return 4}throw new Error("Unexpected match for standard token type!")}function xz(s,e){return s<e?-1:s>e?1:0}class yx{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}clone(){return new yx(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}}class Lx{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;let t=e.indexOf("."),i,n;t===-1?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));let o=this._children.get(i);return typeof o<"u"?o.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);return}let o=e.indexOf("."),r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(r);typeof l>"u"&&(l=new Lx(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,n)}}function Dz(s){let e=[];for(let t=1,i=s.length;t<i;t++){let n=s[t];e[t]=`.mtk${t} { color: ${n}; }`}return e.push(".mtki { font-style: italic; }"),e.push(".mtkb { font-weight: bold; }"),e.push(".mtku { text-decoration: underline; text-underline-position: under; }"),e.join(`
`)}const kz={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:{[Eo]:"#FFFFFE",[ca]:"#000000",[XL]:"#E5EBF1",[Tb]:"#D3D3D3",[Ab]:"#939393",[QL]:"#ADD6FF4D",[Vp]:"#9DDDFF"}},Iz={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:{[Eo]:"#1E1E1E",[ca]:"#D4D4D4",[XL]:"#3A3D41",[Tb]:"#404040",[Ab]:"#707070",[QL]:"#ADD6FF26"}},Ez={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Eo]:"#000000",[ca]:"#FFFFFF",[Tb]:"#FFFFFF",[Ab]:"#FFFFFF"}};function Nz(){const s=new M,e=k9();return e.onDidChange(()=>s.fire()),{onDidChange:s.event,getCSS(){const t={},i=o=>{let r=o.defaults;for(;wt.isThemeIcon(r);){const l=e.getIcon(r.id);if(!l)return;r=l.defaults}const a=r.fontId;if(a){const l=e.getIconFont(a);if(l)return t[a]=l,`.codicon-${o.id}:before { content: '${r.fontCharacter}'; font-family: ${sk(a)}; }`}return`.codicon-${o.id}:before { content: '${r.fontCharacter}'; }`},n=[];for(let o of e.getIcons()){const r=i(o);r&&n.push(r)}for(let o in t){const a=t[o].definition.src.map(l=>`${xr(l.location)} format('${l.format}')`).join(", ");n.push(`@font-face { src: ${a}; font-family: ${sk(o)}; }`)}return n.join(`
`)}}}const ml="vs",L_="vs-dark",Tc="hc-black",Mz=Ht.as(pA.ColorContribution),Tz=Ht.as(jT.ThemingContribution);class pR{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;let i=t.base;e.length>0?(Kp(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(let t in this.themeData.colors)e.set(t,B.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=ZS(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,B.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=Mz.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case ml:return Xn.LIGHT;case Tc:return Xn.HIGH_CONTRAST;default:return Xn.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let i=ZS(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=gR.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=$i.getForeground(o),a=$i.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4)}}}function Kp(s){return s===ml||s===L_||s===Tc}function ZS(s){switch(s){case ml:return kz;case L_:return Iz;case Tc:return Ez}}function Zw(s){let e=ZS(s);return new pR(s,e)}class Az extends U{constructor(){super(),this._onColorThemeChange=this._register(new M),this.onDidColorThemeChange=this._onColorThemeChange.event,this._environment=Object.create(null),this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(ml,Zw(ml)),this._knownThemes.set(L_,Zw(L_)),this._knownThemes.set(Tc,Zw(Tc));const e=Nz();this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(ml),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}),m5("(forced-colors: active)",()=>{this._updateActualTheme()})}registerEditorContainer(e){return tb(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=On(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),U.None}_registerShadowDomContainer(e){const t=On(e);return t.className="monaco-colors",t.textContent=this._allCSS,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(!Kp(t.base)&&!Kp(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new pR(e,t)),Kp(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(ml),this._desiredTheme=t,this._updateActualTheme()}_updateActualTheme(){const e=this._autoDetectHighContrast&&window.matchMedia("(forced-colors: active)").matches?this._knownThemes.get(Tc):this._desiredTheme;this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._updateActualTheme()}_updateThemeOrColorMap(){let e=[],t={},i={addRule:o=>{t[o]||(e.push(o),t[o]=!0)}};Tz.getThemingParticipants().forEach(o=>o(this._theme,i,this._environment));const n=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(Dz(n)),this._themeCSS=e.join(`
`),this._updateCSS(),St.setColorMap(n),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}}}var Rz=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Oz=function(s,e){return function(t,i){e(t,i,s)}};const Au="data-keybinding-context";let xx=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}};class Yc extends xx{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Yc.INSTANCE=new Yc;class wf extends xx{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=wc.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(n=>{if(n.source===6){const o=Array.from(Be.map(this._values,([r])=>r));this._values.clear(),i.fire(new rE(o))}else{const o=[];for(const r of n.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...Be.map(l,([d])=>d)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new rE(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(wf._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(wf._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:Array.isArray(i)?n=JSON.stringify(i):n=i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}wf._keyPrefix="config.";class Pz{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class oE{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class rE{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class Fz{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class mR{constructor(e){this._onDidChangeContext=new mm({merge:t=>new Fz(t)}),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Pz(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Bz(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return Sc.contextMatchesRules(t,e)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new oE(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new oE(e))}getContext(e){return this._isDisposed?Yc.INSTANCE:this.getContextValuesContainer(Wz(e))}}let YS=class extends mR{constructor(e){super(0),this._contexts=new Map,this._toDispose=new X,this._lastContextId=0;const t=new wf(this._myContextId,e,this._onDidChangeContext);this._contexts.set(this._myContextId,t),this._toDispose.add(t)}dispose(){this._onDidChangeContext.dispose(),this._isDisposed=!0,this._toDispose.dispose()}getContextValuesContainer(e){return this._isDisposed?Yc.INSTANCE:this._contexts.get(e)||Yc.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");let t=++this._lastContextId;return this._contexts.set(t,new xx(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};YS=Rz([Oz(0,At)],YS);class Bz extends mR{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new Es,this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(Au)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(Au,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(this._onDidChangeContext.fire,this._onDidChangeContext)}dispose(){this._isDisposed||(this._onDidChangeContext.dispose(),this._parent.disposeContext(this._myContextId),this._parentChangeListener.dispose(),this._domNode.removeAttribute(Au),this._isDisposed=!0)}getContextValuesContainer(e){return this._isDisposed?Yc.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function Wz(s){for(;s;){if(s.hasAttribute(Au)){const e=s.getAttribute(Au);return e?parseInt(e,10):NaN}s=s.parentElement}return 0}He.registerCommand(UW,function(s,e,t){s.get(we).createKey(String(e),t)});He.registerCommand({id:"getContextKeyInfo",handler(){return[...se.all()].sort((s,e)=>s.key.localeCompare(e.key))},description:{description:p("getContextKeyInfo","A command that returns information about context keys"),args:[]}});He.registerCommand("_generateContextKeyInfo",function(){const s=[],e=new Set;for(let t of se.all())e.has(t.key)||(e.add(t.key),s.push(t));s.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(s,void 0,2))});var Mi;(function(s){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}s.intersect=e;function t(o){return o.end-o.start<=0}s.isEmpty=t;function i(o,r){return!t(e(o,r))}s.intersects=i;function n(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},d={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(d)||a.push(d),a}s.relativeComplement=n})(Mi||(Mi={}));var Jr;(function(s){s[s.AVOID=0]="AVOID",s[s.ALIGN=1]="ALIGN"})(Jr||(Jr={}));function lc(s,e,t){const i=t.mode===Jr.ALIGN?t.offset:t.offset+t.size,n=t.mode===Jr.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=s-i?i:e<=n?n-e:Math.max(s-e,0):e<=n?n-e:e<=s-i?i:0}class Xc extends U{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=U.None,this.toDisposeOnSetContainer=U.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Y(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Qi(this.view),this.setContainer(e,t),this._register(Pe(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=Y(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=Vz,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Y("slot"))}else this.container.appendChild(this.view);const n=new X;Xc.BUBBLE_UP_EVENTS.forEach(o=>{n.add(Gt(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),Xc.BUBBLE_DOWN_EVENTS.forEach(o=>{n.add(Gt(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),hi(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2500",this.view.style.position=this.useFixedPosition?"fixed":"absolute",En(this.view),this.toDisposeOnClean=e.render(this.view)||U.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(To&&J_.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;let e=this.delegate.getAnchor(),t;if(PM(e)){let h=vi(e);t={top:h.top,left:h.left,width:h.width,height:h.height}}else t={top:e.y,left:e.x,width:e.width||1,height:e.height||2};const i=cs(this.view),n=G0(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,d;if(a===0){const h={offset:t.top-window.pageYOffset,size:t.height,position:o===0?0:1},u={offset:t.left,size:t.width,position:r===0?0:1,mode:Jr.ALIGN};l=lc(window.innerHeight,n,h)+window.pageYOffset,Mi.intersects({start:l,end:l+n},{start:h.offset,end:h.offset+h.size})&&(u.mode=Jr.AVOID),d=lc(window.innerWidth,i,u)}else{const h={offset:t.left,size:t.width,position:r===0?0:1},u={offset:t.top,size:t.height,position:o===0?0:1,mode:Jr.ALIGN};d=lc(window.innerWidth,i,h),Mi.intersects({start:d,end:d+i},{start:h.offset,end:h.offset+h.size})&&(u.mode=Jr.AVOID),l=lc(window.innerHeight,n,u)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const c=vi(this.container);this.view.style.top=`${l-(this.useFixedPosition?vi(this.view).top:c.top)}px`,this.view.style.left=`${d-(this.useFixedPosition?vi(this.view).left:c.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Qi(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Lr(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Xc.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Xc.BUBBLE_DOWN_EVENTS=["click"];let Vz=`
:host {
all: initial; /* 1st rule so subsequent properties are reset. */
}
@font-face {
font-family: "codicon";
src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");
}
.codicon[class*='codicon-'] {
font: normal normal normal 16px/1 codicon;
display: inline-block;
text-decoration: none;
text-rendering: auto;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
:host {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
}
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
`;function aE(s){let e=s.definition;for(;e instanceof te;)e=e.definition;return`.codicon-${s.id}:before { content: '${e.fontCharacter}'; }`}function Dx(...s){return function(e,t){for(let i=0,n=s.length;i<n;i++){const o=s[i](e,t);if(o)return o}return null}}const Vb=Hz.bind(void 0,!0);function Hz(s,e,t){if(!t||t.length<e.length)return null;let i;return s?i=UM(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function _R(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function zz(s,e){return XS(s.toLowerCase(),e.toLowerCase(),0,0)}function XS(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]===e[i]){let n=null;return(n=XS(s,e,t+1,i+1))?Ex({start:i,end:i+1},n):null}return XS(s,e,t,i+1)}function kx(s){return 97<=s&&s<=122}function Hb(s){return 65<=s&&s<=90}function Ix(s){return 48<=s&&s<=57}function bR(s){return s===32||s===9||s===10||s===13}const vR=new Set;"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?".split("").forEach(s=>vR.add(s.charCodeAt(0)));function x_(s){return bR(s)||vR.has(s)}function Uz(s,e){return s===e||x_(s)&&x_(e)}function wR(s){return kx(s)||Hb(s)||Ix(s)}function Ex(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function CR(s,e){for(let t=e;t<s.length;t++){const i=s.charCodeAt(t);if(Hb(i)||Ix(i)||t>0&&!wR(s.charCodeAt(t-1)))return t}return s.length}function QS(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]!==e[i].toLowerCase())return null;{let n=null,o=i+1;for(n=QS(s,e,t+1,i+1);!n&&(o=CR(e,o))<e.length;)n=QS(s,e,t+1,o),o++;return n===null?null:Ex({start:i,end:i+1},n)}}function $z(s){let e=0,t=0,i=0,n=0,o=0;for(let c=0;c<s.length;c++)o=s.charCodeAt(c),Hb(o)&&e++,kx(o)&&t++,wR(o)&&i++,Ix(o)&&n++;const r=e/s.length,a=t/s.length,l=i/s.length,d=n/s.length;return{upperPercent:r,lowerPercent:a,alphaPercent:l,numericPercent:d}}function jz(s){const{upperPercent:e,lowerPercent:t}=s;return t===0&&e>.6}function qz(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function Kz(s){let e=0,t=0,i=0,n=0;for(let o=0;o<s.length;o++)i=s.charCodeAt(o),Hb(i)&&e++,kx(i)&&t++,bR(i)&&n++;return(e===0||t===0)&&n===0?s.length<=30:e<=5}function SR(s,e){if(!e||(e=e.trim(),e.length===0)||!Kz(s)||e.length>60)return null;const t=$z(e);if(!qz(t)){if(!jz(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n<e.length&&(i=QS(s,e,0,n))===null;)n=CR(e,n+1);return i}function Gz(s,e,t=!1){if(!e||e.length===0)return null;let i=null,n=0;for(s=s.toLowerCase(),e=e.toLowerCase();n<e.length&&(i=JS(s,e,0,n,t))===null;)n=yR(e,n+1);return i}function JS(s,e,t,i,n){if(t===s.length)return[];if(i===e.length)return null;if(Uz(s.charCodeAt(t),e.charCodeAt(i))){let o=null,r=i+1;if(o=JS(s,e,t+1,i+1,n),!n)for(;!o&&(r=yR(e,r))<e.length;)o=JS(s,e,t+1,r,n),r++;return o===null?null:Ex({start:i,end:i+1},o)}else return null}function yR(s,e){for(let t=e;t<s.length;t++)if(x_(s.charCodeAt(t))||t>0&&x_(s.charCodeAt(t-1)))return t;return s.length}const Zz=Dx(Vb,SR,_R),Yz=Dx(Vb,SR,zz),lE=new ud(1e4);function dE(s,e,t=!1){if(typeof s!="string"||typeof e!="string")return null;let i=lE.get(s);i||(i=new RegExp(v5(s),"i"),lE.set(s,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?Yz(s,e):Zz(s,e)}function Xz(s,e,t,i,n,o){const r=Math.min(13,s.length);for(;t<r;t++){const a=Qc(s,e,t,i,n,o,!1);if(a)return a}return[0,o]}function zb(s){if(typeof s>"u")return[];const e=[],t=s[1];for(let i=s.length-1;i>1;i--){const n=s[i]+t,o=e[e.length-1];o&&o.end===n?o.end=n+1:e.push({start:n,end:n+1})}return e}const ea=128;function Nx(){const s=[],e=[];for(let t=0;t<=ea;t++)e[t]=0;for(let t=0;t<=ea;t++)s.push(e.slice(0));return s}function LR(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const xR=LR(2*ea),e1=LR(2*ea),Go=Nx(),Za=Nx(),Yg=Nx();function Xg(s,e){if(e<0||e>=s.length)return!1;const t=s.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 40:case 91:return!0;case void 0:return!1;default:return!!mu(t)}}function cE(s,e){if(e<0||e>=s.length)return!1;switch(s.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function Gp(s,e,t){return e[s]!==t[s]}function Qz(s,e,t,i,n,o,r=!1){for(;e<t&&n<o;)s[e]===i[n]&&(r&&(xR[e]=n),e+=1),n+=1;return e===t}var Gs;(function(s){s.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}s.isDefault=e})(Gs||(Gs={}));function Qc(s,e,t,i,n,o,r){const a=s.length>ea?ea:s.length,l=i.length>ea?ea:i.length;if(t>=a||o>=l||a-t>l-o||!Qz(e,t,a,n,o,l,!0))return;Jz(a,l,t,o,e,n);let d=1,c=1,h=t,u=o;const f=[!1];for(d=1,h=t;h<a;d++,h++){const _=xR[h],w=e1[h],C=h+1<a?e1[h+1]:l;for(c=_-o+1,u=_;u<C;c++,u++){let S=Number.MIN_SAFE_INTEGER,D=!1;u<=w&&(S=eU(s,e,h,t,i,n,u,l,o,Go[d-1][c-1]===0,f));let y=0;S!==Number.MAX_SAFE_INTEGER&&(D=!0,y=S+Za[d-1][c-1]);const x=u>_,E=x?Za[d][c-1]+(Go[d][c-1]>0?-5:0):0,P=u>_+1&&Go[d][c-1]>0,A=P?Za[d][c-2]+(Go[d][c-2]>0?-5:0):0;if(P&&(!x||A>=E)&&(!D||A>=y))Za[d][c]=A,Yg[d][c]=3,Go[d][c]=0;else if(x&&(!D||E>=y))Za[d][c]=E,Yg[d][c]=2,Go[d][c]=0;else if(D)Za[d][c]=y,Yg[d][c]=1,Go[d][c]=Go[d-1][c-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r)return;d--,c--;const g=[Za[d][c],o];let m=0,b=0;for(;d>=1;){let _=c;do{const w=Yg[d][_];if(w===3)_=_-2;else if(w===2)_=_-1;else break}while(_>=1);m>1&&e[t+d-1]===n[o+c-1]&&!Gp(_+o-1,i,n)&&m+1>Go[d][_]&&(_=c),_===c?m++:m=1,b||(b=_),d--,c=_-1,g.push(c)}l===a&&(g[0]+=2);const v=b-a;return g[0]-=v,g}function Jz(s,e,t,i,n,o){let r=s-1,a=e-1;for(;r>=t&&a>=i;)n[r]===o[a]&&(e1[r]=a,r--),a--}function eU(s,e,t,i,n,o,r,a,l,d,c){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===t-i?h=s[t]===n[r]?7:5:Gp(r,n,o)&&(r===0||!Gp(r-1,n,o))?(h=s[t]===n[r]?7:5,u=!0):Xg(o,r)&&(r===0||!Xg(o,r-1))?h=5:(Xg(o,r-1)||cE(o,r-1))&&(h=5,u=!0),h>1&&t===i&&(c[0]=!0),u||(u=Gp(r,n,o)||Xg(o,r-1)||cE(o,r-1)),t===i?r>l&&(h-=u?3:5):d?h+=u?2:0:h+=u?0:1,r+1===a&&(h-=u?3:5),h}function tU(s,e,t,i,n,o,r){return iU(s,e,t,i,n,o,!0,r)}function iU(s,e,t,i,n,o,r,a){let l=Qc(s,e,t,i,n,o,a);if(s.length>=3){const d=Math.min(7,s.length-1);for(let c=t+1;c<d;c++){const h=nU(s,c);if(h){const u=Qc(h,h.toLowerCase(),t,i,n,o,a);u&&(u[0]-=3,(!l||u[0]>l[0])&&(l=u))}}}return l}function nU(s,e){if(e+1>=s.length)return;const t=s[e],i=s[e+1];if(t!==i)return s.slice(0,e)+i+t+s.slice(e+2)}const Ru="$(",Mx=new RegExp(`\\$\\(${mn.iconNameExpression}(?:${mn.iconModifierExpression})?\\)`,"g"),sU=new RegExp(`(\\\\)?${Mx.source}`,"g");function oU(s){return s.replace(sU,(e,t)=>t?e:`\\${e}`)}const rU=new RegExp(`\\\\${Mx.source}`,"g");function aU(s){return s.replace(rU,e=>`\\${e}`)}const lU=new RegExp(`(\\s)?(\\\\)?${Mx.source}(\\s)?`,"g");function DR(s){return s.indexOf(Ru)===-1?s:s.replace(lU,(e,t,i,n)=>i?e:t||n||"")}function Qg(s){const e=s.indexOf(Ru);return e===-1?{text:s}:dU(s,e)}function dU(s,e){const t=[];let i="";function n(u){if(u){i+=u;for(const f of u)t.push(a)}}let o=-1,r="",a=0,l,d,c=e;const h=s.length;for(n(s.substr(0,e));c<h;){if(l=s[c],d=s[c+1],l===Ru[0]&&d===Ru[1])o=c,n(r),r=Ru,c++;else if(l===")"&&o!==-1){const u=c-o+1;a+=u,o=-1,r=""}else o!==-1?/^[a-z0-9\-]$/i.test(l)?r+=l:(n(r),o=-1,r=""):n(l);c++}return n(r),{text:i,iconOffsets:t}}function Jg(s,e,t=!1){const{text:i,iconOffsets:n}=e;if(!n||n.length===0)return dE(s,i,t);const o=Xy(i," "),r=i.length-o.length,a=dE(s,o,t);if(a)for(const l of a){const d=n[l.start+r]+r;l.start+=d,l.end+=d}return a}const t1=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Yw=/(&amp;)?(&amp;)([^\s&])/g,kR=Ns("menu-selection",te.check),IR=Ns("menu-submenu",te.chevronRight);var D_;(function(s){s[s.Right=0]="Right",s[s.Left=1]="Left"})(D_||(D_={}));let ER=class hu extends Nr{constructor(e,t,i={}){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const n=document.createElement("div");n.classList.add("monaco-menu"),n.setAttribute("role","presentation"),super(n,{orientation:1,actionViewItemProvider:a=>this.doGetActionViewItem(a,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Re||sn?[10]:[]],keyDown:!0}}),this.menuElement=n,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new X),this.initializeStyleSheet(e),K(n,le.KEY_DOWN,a=>{new Mt(a).equals(2)&&a.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(K(n,le.KEY_DOWN,a=>{const l=a.key.toLocaleLowerCase();if(this.mnemonics.has(l)){et.stop(a,!0);const d=this.mnemonics.get(l);if(d.length===1&&(d[0]instanceof hE&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(a)),d.length>1){const c=d.shift();c&&c.container&&(this.focusItemByElement(c.container),d.push(c)),this.mnemonics.set(l,d)}}})),sn&&this._register(K(n,le.KEY_DOWN,a=>{const l=new Mt(a);l.equals(14)||l.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),et.stop(a,!0)):(l.equals(13)||l.equals(12))&&(this.focusedItem=0,this.focusPrevious(),et.stop(a,!0))})),this._register(K(this.domNode,le.MOUSE_OUT,a=>{let l=a.relatedTarget;Lr(l,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),a.stopPropagation())})),this._register(K(this.actionsList,le.MOUSE_OVER,a=>{let l=a.target;if(!(!l||!Lr(l,this.actionsList)||l===this.actionsList)){for(;l.parentElement!==this.actionsList&&l.parentElement!==null;)l=l.parentElement;if(l.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(l),d!==this.focusedItem&&this.updateFocus()}}}));let o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new sg(n,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this._register(K(r,le.MOUSE_UP,a=>{a.preventDefault()})),n.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(a=>{var l;return!((l=i.submenuIds)===null||l===void 0)&&l.has(a.id)?(console.warn(`Found submenu cycle: ${a.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(a=>!(a instanceof Xw)).forEach((a,l,d)=>{a.updatePositionInSet(l+1,d.length)})}initializeStyleSheet(e){tb(e)?(this.styleSheet=On(e),this.styleSheet.textContent=uE):(hu.globalStyleSheet||(hu.globalStyleSheet=On(),hu.globalStyleSheet.textContent=uE),this.styleSheet=hu.globalStyleSheet)}style(e){const t=this.getContainer(),i=e.foregroundColor?`${e.foregroundColor}`:"",n=e.backgroundColor?`${e.backgroundColor}`:"",o=e.borderColor?`1px solid ${e.borderColor}`:"",r=e.shadowColor?`0 2px 4px ${e.shadowColor}`:"";t.style.border=o,this.domNode.style.color=i,this.domNode.style.backgroundColor=n,t.style.boxShadow=r,this.viewItems&&this.viewItems.forEach(a=>{(a instanceof i1||a instanceof Xw)&&a.style(e)})}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++){let i=this.actionsList.children[t];if(e===i){this.focusedItem=t;break}}}updateFocus(e){super.updateFocus(e,!0),typeof this.focusedItem<"u"&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof Ls)return new Xw(t.context,e,{icon:!0});if(e instanceof vb){const n=new hE(e,e.actions,i,Object.assign(Object.assign({},t),{submenuIds:new Set([...t.submenuIds||[],e.id])}));if(t.enableMnemonics){const o=n.getMnemonic();if(o&&n.isEnabled()){let r=[];this.mnemonics.has(o)&&(r=this.mnemonics.get(o)),r.push(n),this.mnemonics.set(o,r)}}return n}else{const n={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const r=t.getKeyBinding(e);if(r){const a=r.getLabel();a&&(n.keybinding=a)}}const o=new i1(t.context,e,n);if(t.enableMnemonics){const r=o.getMnemonic();if(r&&o.isEnabled()){let a=[];this.mnemonics.has(r)&&(a=this.mnemonics.get(r)),a.push(o),this.mnemonics.set(r,a)}}return o}}};class i1 extends Ec{constructor(e,t,i={}){if(i.isMenu=!0,super(t,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass="",this.options.label&&i.enableMnemonics){let n=this.getAction().label;if(n){let o=t1.exec(n);o&&(this.mnemonic=(o[1]?o[1]:o[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new bt(()=>{this.element&&(this._register(K(this.element,le.MOUSE_UP,n=>{if(et.stop(n,!0),qi){if(new Zn(n).rightButton)return;this.onClick(n)}else setTimeout(()=>{this.onClick(n)},0)})),this._register(K(this.element,le.CONTEXT_MENU,n=>{et.stop(n,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=$(this.element,Y("a.action-menu-item")),this._action.id===Ls.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=$(this.item,Y("span.menu-item-check"+kR.cssSelector)),this.check.setAttribute("role","none"),this.label=$(this.item,Y("span.action-label")),this.options.label&&this.options.keybinding&&($(this.item,Y("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item&&this.item.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){hi(this.label);let e=DR(this.getAction().label);if(e){const t=cU(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=t1.exec(e);if(i){e=Yy(e),Yw.lastIndex=0;let n=Yw.exec(e);for(;n&&n[1];)n=Yw.exec(e);const o=r=>r.replace(/&amp;&amp;/g,"&amp;");n?this.label.append(Xy(o(e.substr(0,n.index))," "),Y("u",{"aria-hidden":"true"},n[3]),VM(o(e.substr(n.index+n[0].length))," ")):this.label.innerText=o(e).trim(),this.item&&this.item.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=p({},"{0} ({1})",e,this.options.keybinding))),e&&this.item&&(this.item.title=e)}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.getAction().class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.getAction().enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){this.item&&(this.getAction().checked?(this.item.classList.add("checked"),this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked","true")):(this.item.classList.remove("checked"),this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked","false")))}getMnemonic(){return this.mnemonic}applyStyle(){if(!this.menuStyle)return;const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`thin solid ${this.menuStyle.selectionBorderColor}`:"";this.item&&(this.item.style.color=t?t.toString():"",this.item.style.backgroundColor=i?i.toString():""),this.check&&(this.check.style.color=t?t.toString():""),this.container&&(this.container.style.border=n)}style(e){this.menuStyle=e,this.applyStyle()}}class hE extends i1{constructor(e,t,i,n){super(e,e,n),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new X),this.mouseOver=!1,this.expandDirection=n&&n.expandDirection!==void 0?n.expandDirection:D_.Right,this.showScheduler=new bt(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new bt(()=>{this.element&&!Lr(bc(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=$(this.item,Y("span.submenu-indicator"+IR.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(K(this.element,le.KEY_UP,t=>{let i=new Mt(t);(i.equals(17)||i.equals(3))&&(et.stop(t,!0),this.createSubmenu(!0))})),this._register(K(this.element,le.KEY_DOWN,t=>{let i=new Mt(t);bc()===this.item&&(i.equals(17)||i.equals(3))&&et.stop(t,!0)})),this._register(K(this.element,le.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(K(this.element,le.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(K(this.element,le.FOCUS_OUT,t=>{this.element&&!Lr(bc(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)})))}updateEnabled(){}onClick(e){et.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=lc(e.width,t.width,{position:n===D_.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=lc(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=$(this.element,Y("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=getComputedStyle(this.parentData.parent.domNode),i=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.zIndex="1",this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.parentData.submenu=new ER(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new wb],this.submenuOptions),this.menuStyle&&this.parentData.submenu.style(this.menuStyle);const n=this.element.getBoundingClientRect(),o={top:n.top-i,left:n.left,height:n.height+2*i,width:n.width},r=this.submenuContainer.getBoundingClientRect(),{top:a,left:l}=this.calculateSubmenuMenuLayout(new gt(window.innerWidth,window.innerHeight),gt.lift(r),o,this.expandDirection);this.submenuContainer.style.left=`${l}px`,this.submenuContainer.style.top=`${a}px`,this.submenuDisposables.add(K(this.submenuContainer,le.KEY_UP,d=>{new Mt(d).equals(15)&&(et.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(K(this.submenuContainer,le.KEY_DOWN,d=>{new Mt(d).equals(15)&&et.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){if(super.applyStyle(),!this.menuStyle)return;const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t?`${t}`:""),this.parentData.submenu&&this.parentData.submenu.style(this.menuStyle)}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Xw extends bf{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?`${e.separatorColor}`:"")}}function cU(s){const e=t1,t=e.exec(s);if(!t)return s;const i=!t[1];return s.replace(e,i?"$2$3":"").trim()}let uE=`
.monaco-menu {
font-size: 13px;
}
${aE(kR)}
${aE(IR)}
.monaco-menu .monaco-action-bar {
text-align: right;
overflow: hidden;
white-space: nowrap;
}
.monaco-menu .monaco-action-bar .actions-container {
display: flex;
margin: 0 auto;
padding: 0;
width: 100%;
justify-content: flex-end;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: inline-block;
}
.monaco-menu .monaco-action-bar.reverse .actions-container {
flex-direction: row-reverse;
}
.monaco-menu .monaco-action-bar .action-item {
cursor: pointer;
display: inline-block;
transition: transform 50ms ease;
position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
}
.monaco-menu .monaco-action-bar .action-item.disabled {
cursor: default;
}
.monaco-menu .monaco-action-bar.animated .action-item.active {
transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */
}
.monaco-menu .monaco-action-bar .action-item .icon,
.monaco-menu .monaco-action-bar .action-item .codicon {
display: inline-block;
}
.monaco-menu .monaco-action-bar .action-item .codicon {
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar .action-label {
font-size: 11px;
margin-right: 4px;
}
.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
opacity: 0.4;
}
/* 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 #bbb;
padding-top: 1px;
margin-left: .8em;
margin-right: .8em;
}
.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;
}
.monaco-menu .monaco-action-bar.vertical .action-label {
flex: 1 1 auto;
text-decoration: none;
padding: 0 1em;
background: none;
font-size: 12px;
line-height: 1;
}
.monaco-menu .monaco-action-bar.vertical .keybinding,
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
display: inline-block;
flex: 2 1 auto;
padding: 0 1em;
text-align: right;
font-size: 12px;
line-height: 1;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
font-size: 16px !important;
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
margin-left: auto;
margin-right: -20px;
}
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
opacity: 0.4;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
display: inline-block;
box-sizing: border-box;
margin: 0;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
position: static;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
position: absolute;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
padding: 0.5em 0 0 0;
margin-bottom: 0.5em;
width: 100%;
height: 0px !important;
margin-left: .8em !important;
margin-right: .8em !important;
}
.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;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
border: thin solid transparent; /* prevents jumping behaviour on hover or focus */
}
/* High Contrast Theming */
:host-context(.hc-black) .context-view.monaco-menu-container {
box-shadow: none;
}
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
background: none;
}
/* Vertical Action Bar Styles */
.monaco-menu .monaco-action-bar.vertical {
padding: .5em 0;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
height: 1.8em;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
.monaco-menu .monaco-action-bar.vertical .keybinding {
font-size: inherit;
padding: 0 2em;
}
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
font-size: inherit;
width: 2em;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
font-size: inherit;
padding: 0.2em 0 0 0;
margin-bottom: 0.2em;
}
: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;
}
: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;
}
/* 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%;
box-shadow: #DDD 0 6px 6px -6px inset;
}
.monaco-scrollable-element > .shadow.left {
display: block;
top: 3px;
left: 0;
height: 100%;
width: 3px;
box-shadow: #DDD 6px 0 6px -6px inset;
}
.monaco-scrollable-element > .shadow.top-left-corner {
display: block;
top: 0;
left: 0;
height: 3px;
width: 3px;
}
.monaco-scrollable-element > .shadow.top.left {
box-shadow: #DDD 6px 6px 6px -6px inset;
}
/* ---------- Default Style ---------- */
:host-context(.vs) .monaco-scrollable-element > .scrollbar > .slider {
background: rgba(100, 100, 100, .4);
}
:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider {
background: rgba(121, 121, 121, .4);
}
:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider {
background: rgba(111, 195, 223, .6);
}
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: rgba(100, 100, 100, .7);
}
:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider:hover {
background: rgba(111, 195, 223, .8);
}
.monaco-scrollable-element > .scrollbar > .slider.active {
background: rgba(0, 0, 0, .6);
}
:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider.active {
background: rgba(191, 191, 191, .4);
}
:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider.active {
background: rgba(111, 195, 223, 1);
}
:host-context(.vs-dark) .monaco-scrollable-element .shadow.top {
box-shadow: none;
}
:host-context(.vs-dark) .monaco-scrollable-element .shadow.left {
box-shadow: #000 6px 0 6px -6px inset;
}
:host-context(.vs-dark) .monaco-scrollable-element .shadow.top.left {
box-shadow: #000 6px 6px 6px -6px inset;
}
:host-context(.hc-black) .monaco-scrollable-element .shadow.top {
box-shadow: none;
}
:host-context(.hc-black) .monaco-scrollable-element .shadow.left {
box-shadow: none;
}
:host-context(.hc-black) .monaco-scrollable-element .shadow.top.left {
box-shadow: none;
}
`;function Fs(s,e){const t=Object.create(null);for(let i in e){const n=e[i];n&&(t[i]=qr(n,s))}return t}function Tx(s,e,t){function i(){const n=Fs(s.getColorTheme(),e);typeof t=="function"?t(n):t.style(n)}return i(),s.onDidColorThemeChange(i)}function hU(s,e,t){return Tx(e,{badgeBackground:SA,badgeForeground:yA,badgeBorder:Xt},s)}function $l(s,e,t){return Tx(e,Object.assign(Object.assign({},Ub),t||{}),s)}const Ub={listFocusBackground:c8,listFocusForeground:h8,listFocusOutline:u8,listActiveSelectionBackground:yl,listActiveSelectionForeground:ua,listActiveSelectionIconForeground:Wp,listFocusAndSelectionBackground:yl,listFocusAndSelectionForeground:ua,listInactiveSelectionBackground:f8,listInactiveSelectionIconForeground:p8,listInactiveSelectionForeground:g8,listInactiveFocusBackground:m8,listInactiveFocusOutline:_8,listHoverBackground:b8,listHoverForeground:v8,listDropBackground:w8,listSelectionOutline:Vi,listHoverOutline:Vi,listFilterWidgetBackground:C8,listFilterWidgetOutline:S8,listFilterWidgetNoMatchesOutline:y8,listMatchesShadow:Sa,treeIndentGuidesStroke:L8,tableColumnsBorder:x8},uU={shadowColor:Sa,borderColor:D8,foregroundColor:k8,backgroundColor:I8,selectionForegroundColor:E8,selectionBackgroundColor:N8,selectionBorderColor:M8,separatorColor:T8};function fU(s,e,t){return Tx(e,Object.assign(Object.assign({},uU),t),s)}class gU{constructor(e,t,i,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.themeService=o,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i,n=PM(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{let r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(Y(".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",K(this.block,le.MOUSE_DOWN,d=>d.stopPropagation()));const a=new X,l=e.actionRunner||new bb;return l.onBeforeRun(this.onActionRun,this,a),l.onDidRun(this.onDidActionRun,this,a),i=new ER(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)}),a.add(fU(i,this.themeService)),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a),a.add(K(window,le.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(K(window,le.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;let c=new Zn(d),h=c.target;if(!c.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),sa(a,i)},focus:()=>{i&&i.focus(!!e.autoSelectFirstItem)},onHide:o=>{e.onHide&&e.onHide(!!o),this.block&&(this.block.remove(),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},n,!!n)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&!Vo(e.error)&&this.notificationService.error(e.error)}}var pU=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Kh=function(s,e){return function(t,i){e(t,i,s)}};let n1=class extends U{constructor(e,t,i,n,o){super(),this.contextMenuHandler=new gU(i,e,t,n,o)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(e),ul.getInstance().resetKeyStatus()}};n1=pU([Kh(0,Ba),Kh(1,Qt),Kh(2,Wa),Kh(3,Lt),Kh(4,pt)],n1);const $b=Ze("layoutService");var mU=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},_U=function(s,e){return function(t,i){e(t,i,s)}};let s1=class extends U{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=U.None,this.container=e.container,this.contextView=this._register(new Xc(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t!==this.container&&(this.container=t,this.setContainer(t,i?3:2)):this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.contextView.show(e);const n=Pe(()=>{this.currentViewDisposable===n&&this.hideContextView()});return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};s1=mU([_U(0,$b)],s1);const ag=Ze("dialogService");let bU=class{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}};class vU{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(let t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(this._hashFn(t),n),n.incoming.set(this._hashFn(e),i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(let i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new bU(e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[t,i]of this._nodes)e.push(`${t}, (incoming)[${[...i.incoming.keys()].join(", ")}], (outgoing)[${[...i.outgoing.keys()].join(",")}]`);return e.join(`
`)}findCycleSlow(){for(let[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(let[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(n,t);if(o)return o;t.delete(i)}}}class fE extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph:
${e.toString()}`}}class k_{constructor(e=new pf,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(qe,this)}createChild(e){return new k_(e,this._strict,this)}invokeFunction(e,...t){let i=_s.traceInvocation(e),n=!1;try{return e({get:(r,a)=>{if(n)throw g4("service accessor is only valid during the invocation of its target method");const l=this._getOrCreateServiceInstance(r,i);if(!l&&a!==U0)throw new Error(`[invokeFunction] unknown service '${r}'`);return l}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof Kr?(i=_s.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=_s.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=$s.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of n){let l=this._getOrCreateServiceInstance(a.id,i);if(!l&&this._strict&&!a.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`);o.push(l)}let r=n.length>0?n[0].index:t.length;if(t.length!==r){console.warn(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);let a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return new e(...t,...o)}_setServiceInstance(e,t){if(this._services.get(e)instanceof Kr)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let i=this._getServiceInstanceOrDescriptor(e);return i instanceof Kr?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 vU(a=>a.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const a=r.pop();if(n.lookupOrInsertNode(a),o++>1e3)throw new fE(n);for(let l of $s.getServiceDependencies(a.desc.ctor)){let d=this._getServiceInstanceOrDescriptor(l.id);if(!d&&!l.optional&&console.warn(`[createInstance] ${e} depends on ${l.id} which is NOT registered.`),d instanceof Kr){const c={id:l.id,desc:d,_trace:a._trace.branch(l.id,!0)};n.insertEdge(a,c),r.push(c)}}}for(;;){const a=n.roots();if(a.length===0){if(!n.isEmpty())throw new fE(n);break}for(const{data:l}of a){if(this._getServiceInstanceOrDescriptor(l.id)instanceof Kr){const c=this._createServiceInstanceWithOwner(l.id,l.desc.ctor,l.desc.staticArguments,l.desc.supportsDelayedInstantiation,l._trace);this._setServiceInstance(l.id,c)}n.removeNode(l)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof Kr)return this._createServiceInstance(t,i,n,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t=[],i,n){if(i){const o=new _c(()=>this._createInstance(e,t,n));return new Proxy(Object.create(null),{get(r,a){if(a in r)return r[a];let l=o.value,d=l[a];return typeof d!="function"||(d=d.bind(l),r[a]=d),d},set(r,a,l){return o.value[a]=l,!0}})}else return this._createInstance(e,t,n)}}class _s{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return _s._None}static traceCreation(e){return _s._None}branch(e,t){let i=new _s(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;_s._totals+=e;let t=!1;function i(o,r){let a=[],l=new Array(o+1).join(" ");for(const[d,c,h]of r._dep)if(c&&h){t=!0,a.push(`${l}CREATES -> ${d}`);let u=i(o+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${d}`);return a.join(`
`)}let n=[`${this.type===0?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${_s._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(n.join(`
`))}}_s._None=new class extends _s{constructor(){super(-1,null)}stop(){}branch(){return this}};_s._totals=0;const lg=Ze("labelService");class Ya extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function gE(s,e){const t=[];for(let i of e){if(s.start>=i.range.end)continue;if(s.end<i.range.start)break;const n=Mi.intersect(s,i.range);Mi.isEmpty(n)||t.push({range:n,size:i.size})}return t}function o1({start:s,end:e},t){return{start:s+t,end:e+t}}function wU(s){const e=[];let t=null;for(let i of s){const n=i.range.start,o=i.range.end,r=i.size;if(t&&r===t.size){t.range.end=o;continue}t={range:{start:n,end:o},size:r},e.push(t)}return e}function CU(...s){return wU(s.reduce((e,t)=>e.concat(t),[]))}class pE{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const n=i.length-t,o=gE({start:0,end:e},this.groups),r=gE({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:o1(l.range,n),size:l.size})),a=i.map((l,d)=>({range:{start:e+d,end:e+d+1},size:l.size}));this.groups=CU(o,a,r),this._size=this.groups.reduce((l,d)=>l+d.size*(d.range.end-d.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;let t=0,i=0;for(let n of this.groups){const o=n.range.end-n.range.start,r=i+o*n.size;if(e<r)return t+Math.floor((e-i)/n.size);t+=o,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(let n of this.groups){const o=n.range.end-n.range.start,r=i+o;if(e<r)return t+(e-i)*n.size;t+=o*n.size,i=r}return-1}}function SU(s){try{s.parentElement&&s.parentElement.removeChild(s)}catch{}}class yU{constructor(e){this.renderers=e,this.cache=new Map}alloc(e){let t=this.getTemplateCache(e).pop();if(!t){const i=Y(".monaco-list-row"),o=this.getRenderer(e).renderTemplate(i);t={domNode:i,templateId:e,templateData:o}}return t}release(e){e&&this.releaseRow(e)}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(t.classList.remove("scrolling"),SU(t)),this.getTemplateCache(i).push(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var yd=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const ao={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(s){return[s]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class dg{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class LU{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class xU{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}function DU(s,e){return Array.isArray(s)&&Array.isArray(e)?Ss(s,e):s===e}class kU{constructor(e){e!=null&&e.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(t,i,n)=>n,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class io{constructor(e,t,i,n=ao){if(this.virtualDelegate=t,this.domId=`list_id_${++io.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new yr(50),this.splicing=!1,this.dragOverAnimationStopDisposable=U.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=U.None,this.onDragLeaveTimeout=U.None,this.disposables=new X,this._onDidChangeContentHeight=new M,this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new pE;for(const r of i)this.renderers.set(r.templateId,r);this.cache=this.disposables.add(new yU(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof n.mouseSupport=="boolean"?n.mouseSupport:!0),this._horizontalScrolling=ro(n,r=>r.horizontalScrolling,ao.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=typeof n.additionalScrollHeight>"u"?0:n.additionalScrollHeight,this.accessibilityProvider=new kU(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",ro(n,r=>r.transformOptimization,ao.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(ot.addTarget(this.rowsContainer)),this.scrollable=new Pb(ro(n,r=>r.smoothScrolling,!1)?125:0,r=>Ro(r)),this.scrollableElement=this.disposables.add(new rx(this.rowsContainer,{alwaysConsumeMouseWheel:ro(n,r=>r.alwaysConsumeMouseWheel,ao.alwaysConsumeMouseWheel),horizontal:1,vertical:ro(n,r=>r.verticalScrollMode,ao.verticalScrollMode),useShadows:ro(n,r=>r.useShadows,ao.useShadows)},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(K(this.rowsContainer,vt.Change,r=>this.onTouchChange(r))),this.disposables.add(K(this.scrollableElement.getDomNode(),"scroll",r=>r.target.scrollTop=0)),this.disposables.add(K(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(K(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(K(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(K(this.domNode,"dragend",r=>this.onDragEnd(r))),this.setRowLineHeight=ro(n,r=>r.setRowLineHeight,ao.setRowLineHeight),this.setRowHeight=ro(n,r=>r.setRowHeight,ao.setRowHeight),this.supportDynamicHeights=ro(n,r=>r.supportDynamicHeights,ao.supportDynamicHeights),this.dnd=ro(n,r=>r.dnd,ao.dnd),this.layout()}get contentHeight(){return this.rangeMap.size}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Yv(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}updateOptions(e){e.additionalScrollHeight!==void 0&&(this.additionalScrollHeight=e.additionalScrollHeight,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=Mi.intersect(n,o),a=new Map;for(let D=r.start;D<r.end;D++){const y=this.items[D];if(y.dragStartDisposable.dispose(),y.row){let x=a.get(y.templateId);x||(x=[],a.set(y.templateId,x));const E=this.renderers.get(y.templateId);E&&E.disposeElement&&E.disposeElement(y.element,D,y.row.templateData,y.size),x.push(y.row)}y.row=null}const l={start:e+t,end:this.items.length},d=Mi.intersect(l,n),c=Mi.relativeComplement(l,n),h=i.map(D=>({id:String(this.itemId++),element:D,templateId:this.virtualDelegate.getTemplateId(D),size:this.virtualDelegate.getHeight(D),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(D),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:U.None}));let u;e===0&&t>=this.items.length?(this.rangeMap=new pE,this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=this.items.splice(e,t,...h));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=o1(d,f),b=Mi.intersect(g,m);for(let D=b.start;D<b.end;D++)this.updateItemInDOM(this.items[D],D);const v=Mi.relativeComplement(m,g);for(const D of v)for(let y=D.start;y<D.end;y++)this.removeItemFromDOM(y);const _=c.map(D=>o1(D,f)),C=[{start:e,end:e+i.length},..._].map(D=>Mi.intersect(g,D)),S=this.getNextToLastElement(C);for(const D of C)for(let y=D.start;y<D.end;y++){const x=this.items[y],E=a.get(x.templateId),P=E==null?void 0:E.pop();this.insertItemInDOM(y,S,P)}for(const D of a.values())for(const y of D)this.cache.release(y);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(D=>D.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Ro(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10})}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let i={height:typeof e=="number"?e:d5(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:Yv(this.domNode)})}render(e,t,i,n,o,r=!1){const a=this.getRenderRange(t,i),l=Mi.relativeComplement(a,e),d=Mi.relativeComplement(e,a),c=this.getNextToLastElement(l);if(r){const h=Mi.intersect(e,a);for(let u=h.start;u<h.end;u++)this.updateItemInDOM(this.items[u],u)}for(const h of l)for(let u=h.start;u<h.end;u++)this.insertItemInDOM(u,c);for(const h of d)for(let u=h.start;u<h.end;u++)this.removeItemFromDOM(u);n!==void 0&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t,i){const n=this.items[e];n.row||(n.row=i??this.cache.alloc(n.templateId));const o=this.accessibilityProvider.getRole(n.element)||"listitem";n.row.domNode.setAttribute("role",o);const r=this.accessibilityProvider.isChecked(n.element);typeof r<"u"&&n.row.domNode.setAttribute("aria-checked",String(!!r)),n.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(n.row.domNode,t):this.rowsContainer.appendChild(n.row.domNode)),this.updateItemInDOM(n,e);const a=this.renderers.get(n.templateId);if(!a)throw new Error(`No renderer found for template id ${n.templateId}`);a&&a.renderElement(n.element,e,n.row.templateData,n.size);const l=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!l,l&&(n.dragStartDisposable=K(n.row.domNode,"dragstart",d=>this.onDragStart(n.element,l,d))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=qi?"-moz-fit-content":"fit-content",e.width=Yv(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.additionalScrollHeight}get onMouseClick(){return re.map(this.disposables.add(new ht(this.domNode,"click")).event,e=>this.toMouseEvent(e))}get onMouseDblClick(){return re.map(this.disposables.add(new ht(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e))}get onMouseMiddleClick(){return re.filter(re.map(this.disposables.add(new ht(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e)),e=>e.browserEvent.button===1)}get onMouseDown(){return re.map(this.disposables.add(new ht(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e))}get onContextMenu(){return re.any(re.map(this.disposables.add(new ht(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e)),re.map(this.disposables.add(new ht(this.domNode,vt.Contextmenu)).event,e=>this.toGestureEvent(e)))}get onTouchStart(){return re.map(this.disposables.add(new ht(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e))}get onTap(){return re.map(this.disposables.add(new ht(this.rowsContainer,vt.Tap)).event,e=>this.toGestureEvent(e))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(eR.TEXT,t),i.dataTransfer.setDragImage){let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(n,i)),typeof o>"u"&&(o=String(n.length));const r=Y(".monaco-drag-image");r.textContent=o,document.body.appendChild(r),i.dataTransfer.setDragImage(r,-10,-10),setTimeout(()=>document.body.removeChild(r),0)}this.currentDragData=new dg(n),Xo.CurrentDragAndDropData=new LU(n),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Xo.CurrentDragAndDropData&&Xo.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Xo.CurrentDragAndDropData)this.currentDragData=Xo.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new xU}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect===0?"copy":"move";let i;if(typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=wT(i).filter(n=>n>=-1&&n<this.length).sort((n,o)=>n-o),i=i[0]===-1?[-1]:i,DU(this.currentDragFeedback,i))return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Pe(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const n of i){const o=this.items[n];o.dropTarget=!0,o.row&&o.row.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=Pe(()=>{for(const n of i){const o=this.items[n];o.dropTarget=!1,o.row&&o.row.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Nl(()=>this.clearDragOverFeedback(),100),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,Xo.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,Xo.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=U.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=TM(this.domNode).top;this.dragOverAnimationDisposable=p5(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Nl(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const o=Number(n);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,r;e===this.elementTop(n.start)?(o=n.start,r=0):n.end-n.start>1&&(o=n.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let d=!1;for(let c=l.start;c<l.end;c++){const h=this.probeDynamicHeight(c);h!==0&&this.rangeMap.splice(c,1,[this.items[c]]),a+=h,d=d||h!==0}if(!d){a!==0&&this.eventuallyUpdateScrollDimensions();const c=Mi.relativeComplement(n,l);for(const u of c)for(let f=u.start;f<u.end;f++)this.items[f].row&&this.removeItemFromDOM(f);const h=Mi.relativeComplement(l,n);for(const u of h)for(let f=u.start;f<u.end;f++){const g=f+1,m=g<this.items.length?this.items[g].row:null,b=m?m.domNode:null;this.insertItemInDOM(f,b)}for(let u=l.start;u<l.end;u++)this.items[u].row&&this.updateItemInDOM(this.items[u],u);if(typeof o=="number"){const u=this.scrollable.getFutureScrollPosition().scrollTop-e,f=this.elementTop(o)-r+u;this.setScrollTop(f,i)}this._onDidChangeContentHeight.fire(this.contentHeight);return}}}probeDynamicHeight(e){const t=this.items[e];if(!t.hasDynamicHeight||t.lastDynamicHeightWidth===this.renderWidth||this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(t.element))return 0;const i=t.size;if(!this.setRowHeight&&t.row){let r=t.row.domNode.offsetHeight;return t.size=r,t.lastDynamicHeightWidth=this.renderWidth,r-i}const n=this.cache.alloc(t.templateId);n.domNode.style.height="",this.rowsContainer.appendChild(n.domNode);const o=this.renderers.get(t.templateId);return o&&(o.renderElement(t.element,e,n.templateData,void 0),o.disposeElement&&o.disposeElement(t.element,e,n.templateData,void 0)),t.size=n.domNode.offsetHeight,this.virtualDelegate.setDynamicHeight&&this.virtualDelegate.setDynamicHeight(t.element,t.size),t.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(n.domNode),this.cache.release(n),t.size-i}getNextToLastElement(e){const t=e[e.length-1];if(!t)return null;const i=this.items[t.end];return!i||!i.row?null:i.row.domNode}getElementDomId(e){return`${this.domId}_${e}`}dispose(){if(this.items){for(const e of this.items)if(e.row){const t=this.renderers.get(e.row.templateId);t&&(t.disposeElement&&t.disposeElement(e.element,-1,e.row.templateData,void 0),t.disposeTemplate(e.row.templateData))}this.items=[]}this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),$e(this.disposables)}}io.InstanceCount=0;yd([Zt],io.prototype,"onMouseClick",null);yd([Zt],io.prototype,"onMouseDblClick",null);yd([Zt],io.prototype,"onMouseMiddleClick",null);yd([Zt],io.prototype,"onMouseDown",null);yd([Zt],io.prototype,"onContextMenu",null);yd([Zt],io.prototype,"onTouchStart",null);yd([Zt],io.prototype,"onTap",null);class IU{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}var Ld=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},mE=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class EU{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.trait}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex(o=>o.templateData===i);if(n>=0){const o=this.renderedElements[n];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index<e?n.push(o):o.index>=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let I_=class{constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new M,this.onChange=this._onChange.event}get trait(){return this._trait}get renderer(){return new EU(this)}splice(e,t,i){var n;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,r=e+t,a=[...this.sortedIndexes.filter(d=>d<e),...i.map((d,c)=>d?c+e:-1).filter(d=>d!==-1),...this.sortedIndexes.filter(d=>d>=r).map(d=>d+o)],l=this.length+o;if(this.sortedIndexes.length>0&&a.length===0&&l>0){const d=(n=this.sortedIndexes.find(c=>c>=e))!==null&&n!==void 0?n:l-1;a.push(Math.min(d,l-1))}this.renderer.splice(e,t,i.length),this._set(a,a),this.length=l}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(bE),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=r1(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return _L(this.sortedIndexes,e,bE)>=0}dispose(){$e(this._onChange)}};Ld([Zt],I_.prototype,"renderer",null);class NU extends I_{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class Qw{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,i.map(()=>!1));const n=this.trait.get().map(r=>this.identityProvider.getId(this.view.element(r)).toString()),o=i.map(r=>n.indexOf(this.identityProvider.getId(r).toString())>-1);this.trait.splice(e,t,o)}}function xa(s){return s.tagName==="INPUT"||s.tagName==="TEXTAREA"}function dc(s){return s.classList.contains("monaco-editor")?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:dc(s.parentElement)}class NR{constructor(e,t,i){this.list=e,this.view=t,this.disposables=new X,this.multipleSelectionDisposables=new X,this.onKeyDown.filter(n=>n.keyCode===3).on(this.onEnter,this,this.disposables),this.onKeyDown.filter(n=>n.keyCode===16).on(this.onUpArrow,this,this.disposables),this.onKeyDown.filter(n=>n.keyCode===18).on(this.onDownArrow,this,this.disposables),this.onKeyDown.filter(n=>n.keyCode===11).on(this.onPageUpArrow,this,this.disposables),this.onKeyDown.filter(n=>n.keyCode===12).on(this.onPageDownArrow,this,this.disposables),this.onKeyDown.filter(n=>n.keyCode===9).on(this.onEscape,this,this.disposables),i.multipleSelectionSupport&&this.onKeyDown.filter(n=>(Re?n.metaKey:n.ctrlKey)&&n.keyCode===31).on(this.onCtrlA,this,this.multipleSelectionDisposables)}get onKeyDown(){return re.chain(this.disposables.add(new ht(this.view.domNode,"keydown")).event).filter(e=>!xa(e.target)).map(e=>new Mt(e))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionDisposables.clear(),e.multipleSelectionSupport&&this.onKeyDown.filter(t=>(Re?t.metaKey:t.ctrlKey)&&t.keyCode===31).on(this.onCtrlA,this,this.multipleSelectionDisposables))}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(zi(this.list.length),e.browserEvent),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}Ld([Zt],NR.prototype,"onKeyDown",null);var cc;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(cc||(cc={}));const MR=new class{mightProducePrintableCharacter(s){return s.ctrlKey||s.metaKey||s.altKey?!1:s.keyCode>=31&&s.keyCode<=56||s.keyCode>=21&&s.keyCode<=30||s.keyCode>=93&&s.keyCode<=102||s.keyCode>=80&&s.keyCode<=90}};class MU{constructor(e,t,i,n){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.delegate=n,this.enabled=!1,this.state=cc.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new X,this.disposables=new X,this.updateOptions(e.options)}updateOptions(e){(typeof e.enableKeyboardNavigation>"u"?!0:!!e.enableKeyboardNavigation)?this.enable():this.disable(),typeof e.automaticKeyboardNavigation<"u"&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=re.chain(this.enabledDisposables.add(new ht(this.view.domNode,"keydown")).event).filter(n=>!xa(n.target)).filter(()=>this.automaticKeyboardNavigation||this.triggered).map(n=>new Mt(n)).filter(n=>this.delegate.mightProducePrintableCharacter(n)).forEach(n=>{n.stopPropagation(),n.preventDefault()}).map(n=>n.browserEvent.key).event,t=re.debounce(e,()=>null,800);re.reduce(re.any(e,t),(n,o)=>o===null?null:(n||"")+o)(this.onInput,this,this.enabledDisposables),t(this.onClear,this,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));i&&wi(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=cc.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===cc.Idle?1:0;this.state=cc.Typing;for(let o=0;o<this.list.length;o++){const r=(i+o+n)%this.list.length,a=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(r)),l=a&&a.toString();if(typeof l>"u"||Vb(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class TU{constructor(e,t){this.list=e,this.view=t,this.disposables=new X,re.chain(this.disposables.add(new ht(t.domNode,"keydown")).event).filter(n=>!xa(n.target)).map(n=>new Mt(n)).filter(n=>n.keyCode===2&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey&&!n.altKey).on(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!n||!(n instanceof HTMLElement)||n.tabIndex===-1)return;const o=window.getComputedStyle(n);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function TR(s){return Re?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function AR(s){return s.browserEvent.shiftKey}function AU(s){return s instanceof MouseEvent&&s.button===2}const _E={isSelectionSingleChangeEvent:TR,isSelectionRangeChangeEvent:AR};class RR{constructor(e){this.list=e,this.disposables=new X,this._onPointer=new M,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||_E),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(ot.addTarget(e.getHTMLElement()))),re.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||_E))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){dc(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(dc(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||xa(e.browserEvent.target)||dc(e.browserEvent.target))return;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionRangeChangeEvent(e))return this.changeSelection(e);if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),AU(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(xa(e.browserEvent.target)||dc(e.browserEvent.target)||this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){const c=this.list.getFocus()[0];i=c??t,this.list.setAnchor(i)}const n=Math.min(i,t),o=Math.max(i,t),r=zi(n,o+1),a=this.list.getSelection(),l=PU(r1(a,[i]),i);if(l.length===0)return;const d=r1(r,FU(a,l));this.list.setSelection(d,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),o=n.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class OR{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&(e.listBackground.isOpaque()?i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`):Re||console.warn(`List with id '${this.selectorSuffix}' was styled with a non-opaque background color. This will break sub-pixel antialiasing.`)),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(`
.monaco-drag-image,
.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
`),e.listFocusAndSelectionForeground&&i.push(`
.monaco-drag-image,
.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) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&i.push(`
.monaco-drag-image,
.monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; 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.listDropBackground&&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.listDropBackground} !important; color: inherit !important; }
`),e.listFilterWidgetBackground&&i.push(`.monaco-list-type-filter { background-color: ${e.listFilterWidgetBackground} }`),e.listFilterWidgetOutline&&i.push(`.monaco-list-type-filter { border: 1px solid ${e.listFilterWidgetOutline}; }`),e.listFilterWidgetNoMatchesOutline&&i.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${e.listFilterWidgetNoMatchesOutline}; }`),e.listMatchesShadow&&i.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${e.listMatchesShadow}; }`),e.tableColumnsBorder&&i.push(`
.monaco-table:hover > .monaco-split-view2,
.monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
border-color: ${e.tableColumnsBorder};
}`),this.styleElement.textContent=i.join(`
`)}}const RU={listFocusBackground:B.fromHex("#7FB0D0"),listActiveSelectionBackground:B.fromHex("#0E639C"),listActiveSelectionForeground:B.fromHex("#FFFFFF"),listActiveSelectionIconForeground:B.fromHex("#FFFFFF"),listFocusAndSelectionBackground:B.fromHex("#094771"),listFocusAndSelectionForeground:B.fromHex("#FFFFFF"),listInactiveSelectionBackground:B.fromHex("#3F3F46"),listInactiveSelectionIconForeground:B.fromHex("#FFFFFF"),listHoverBackground:B.fromHex("#2A2D2E"),listDropBackground:B.fromHex("#383B3D"),treeIndentGuidesStroke:B.fromHex("#a9a9a9"),tableColumnsBorder:B.fromHex("#cccccc").transparent(.2)},OU={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function PU(s,e){const t=s.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&s[n]===e-(t-n);)i.push(s[n--]);for(i.reverse(),n=t;n<s.length&&s[n]===e+(n-t);)i.push(s[n++]);return i}function r1(s,e){const t=[];let i=0,n=0;for(;i<s.length||n<e.length;)if(i>=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){t.push(s[i]),i++,n++;continue}else s[i]<e[n]?t.push(s[i++]):t.push(e[n++]);return t}function FU(s,e){const t=[];let i=0,n=0;for(;i<s.length||n<e.length;)if(i>=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){i++,n++;continue}else s[i]<e[n]?t.push(s[i++]):n++;return t}const bE=(s,e)=>s-e;class BU{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 o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const r of this.renderers)r.disposeElement&&r.disposeElement(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class WU{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class VU{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&&this.dnd.onDragStart(e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class Ho{constructor(e,t,i,n,o=OU){var r;this.user=e,this._options=o,this.focus=new I_("focused"),this.anchor=new I_("anchor"),this.eventBufferer=new Hy,this._ariaLabel="",this.disposables=new X,this._onDidDispose=new M,this.onDidDispose=this._onDidDispose.event;const a=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new NU(a!=="listbox"),eo(o,RU,!1);const l=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(l.push(new WU(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(c=>new BU(c.templateId,[...l,c]));const d=Object.assign(Object.assign({},o),{dnd:o.dnd&&new VU(this,o.dnd)});if(this.view=new io(t,i,n,d),this.view.domNode.setAttribute("role",a),o.styleController)this.styleController=o.styleController(this.view.domId);else{const c=On(this.view.domNode);this.styleController=new OR(c,this.view.domId)}if(this.spliceable=new IU([new Qw(this.focus,this.view,o.identityProvider),new Qw(this.selection,this.view,o.identityProvider),new Qw(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new TU(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new NR(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const c=o.keyboardNavigationDelegate||MR;this.typeLabelController=new MU(this,this.view,o.keyboardNavigationLabelProvider,c),this.disposables.add(this.typeLabelController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return re.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e))}get onDidChangeSelection(){return re.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e))}get domId(){return this.view.domId}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=re.chain(this.disposables.add(new ht(this.view.domNode,"keydown")).event).map(o=>new Mt(o)).filter(o=>e=o.keyCode===58||o.shiftKey&&o.keyCode===68).map(KI).filter(()=>!1).event,i=re.chain(this.disposables.add(new ht(this.view.domNode,"keyup")).event).forEach(()=>e=!1).map(o=>new Mt(o)).filter(o=>o.keyCode===58||o.shiftKey&&o.keyCode===68).map(KI).map(({browserEvent:o})=>{const r=this.getFocus(),a=r.length?r[0]:void 0,l=typeof a<"u"?this.view.element(a):void 0,d=typeof a<"u"?this.view.domElement(a):this.view.domNode;return{index:a,element:l,anchor:d,browserEvent:o}}).event,n=re.chain(this.view.onContextMenu).filter(o=>!e).map(({element:o,index:r,browserEvent:a})=>({element:o,index:r,anchor:{x:a.pageX+1,y:a.pageY},browserEvent:a})).event;return re.any(t,i,n)}get onKeyDown(){return this.disposables.add(new ht(this.view.domNode,"keydown")).event}get onDidFocus(){return re.signal(this.disposables.add(new ht(this.view.domNode,"focus",!0)).event)}createMouseController(e){return new RR(this)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e),this.typeLabelController&&this.typeLabelController.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(t=this.keyboardController)===null||t===void 0||t.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new Ya(this.user,`Invalid start index: ${e}`);if(t<0)throw new Ya(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new Ya(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new Ya(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return fS(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new Ya(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,n);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);r>-1&&this.setFocus([r],i)}focusNextPage(e,t){return mE(this,void 0,void 0,function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const n=this.view.element(i),o=this.getFocusedElements()[0];if(o!==n){const r=this.findPreviousIndex(i,!1,t);r>-1&&o!==this.view.element(r)?this.setFocus([r],e):this.setFocus([i],e)}else{const r=this.view.getScrollTop();this.view.setScrollTop(r+this.view.renderHeight-this.view.elementHeight(i)),this.view.getScrollTop()!==r&&(this.setFocus([]),yield pa(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return mE(this,void 0,void 0,function*(){let i;const n=this.view.getScrollTop();n===0?i=this.view.indexAt(n):i=this.view.indexAfter(n-1);const o=this.view.element(i),r=this.getFocusedElements()[0];if(r!==o){const a=this.findNextIndex(i,!1,t);a>-1&&r!==this.view.element(a)?this.setFocus([a],e):this.setFocus([i],e)}else{const a=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==a&&(this.setFocus([]),yield pa(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e>=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map(e=>this.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new Ya(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(Ml(t)){const r=o-this.view.renderHeight;this.view.setScrollTop(r*fs(t,0,1)+n)}else{const r=n+o,a=i+this.view.renderHeight;n<i&&r>=a||(n<i||r>=a&&o>=this.view.renderHeight?this.view.setScrollTop(n):r>=a&&this.view.setScrollTop(r-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new Ya(this.user,`Invalid index ${e}`);const t=this.view.getScrollTop(),i=this.view.elementTop(e),n=this.view.elementHeight(e);if(i<t||i+n>t+this.view.renderHeight)return null;const o=n-this.view.renderHeight;return Math.abs((t-i)/o)}getHTMLElement(){return this.view.domNode}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Ld([Zt],Ho.prototype,"onDidChangeFocus",null);Ld([Zt],Ho.prototype,"onDidChangeSelection",null);Ld([Zt],Ho.prototype,"onContextMenu",null);Ld([Zt],Ho.prototype,"onKeyDown",null);Ld([Zt],Ho.prototype,"onDidFocus",null);class HU{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:U.None}}renderElement(e,t,i,n){if(i.disposable&&i.disposable.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,n);const r=new on,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(l=>this.renderer.renderElement(l,e,i.data,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class zU{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function UU(s,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new zU(s,e.accessibilityProvider)})}class $U{constructor(e,t,i,n,o={}){const r=()=>this.model,a=n.map(l=>new HU(l,r));this.list=new Ho(e,t,i,a,UU(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return re.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return re.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return re.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,zi(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}const jb=new se("isWindows",Si,p("isWindows","Whether the operating system is Windows")),jU="inputFocus";var Ou;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element"})(Ou||(Ou={}));class Gn extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class Ax{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function Rx(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function Cf(s){switch(s){case!0:return 1;case!1:return 0;default:return s}}function Jw(s){return typeof s.collapsible=="boolean"}class qU{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Hy,this._onDidChangeCollapseState=new M,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new M,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new M,this.onDidSplice=this._onDidSplice.event,this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren>"u"?!1:n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=Be.empty(),n={}){if(e.length===0)throw new Gn(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n,o,r){var a;n===void 0&&(n=Be.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t),d=[...n],c=t[t.length-1],h=new dr({getElements:()=>l.children.map(b=>e.getId(b.element).toString())},{getElements:()=>[...l.children.slice(0,c),...d,...l.children.slice(c+i)].map(b=>e.getId(b.element).toString())}).ComputeDiff(!1);if(h.quitEarly)return this.spliceSimple(t,i,d,o);const u=t.slice(0,-1),f=(b,v,_)=>{if(r>0)for(let w=0;w<_;w++)b--,v--,this.spliceSmart(e,[...u,b,0],Number.MAX_SAFE_INTEGER,d[v].children,o,r-1)};let g=Math.min(l.children.length,c+i),m=d.length;for(const b of h.changes.sort((v,_)=>_.originalStart-v.originalStart))f(g,m,g-(b.originalStart+b.originalLength)),g=b.originalStart,m=b.modifiedStart-c,this.spliceSimple([...u,g],b.originalLength,Be.slice(d,m,m+b.modifiedLength),o);f(g,m,g)}spliceSimple(e,t,i=Be.empty(),{onDidCreateNode:n,onDidDeleteNode:o}){const{parentNode:r,listIndex:a,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),c=[],h=Be.map(i,D=>this.createTreeNode(D,r,r.visible?1:0,l,c,n)),u=e[e.length-1],f=r.children.length>0;let g=0;for(let D=u;D>=0&&D<r.children.length;D--){const y=r.children[D];if(y.visible){g=y.visibleChildIndex;break}}const m=[];let b=0,v=0;for(const D of h)m.push(D),v+=D.renderNodeCount,D.visible&&(D.visibleChildIndex=g+b++);const _=r.children.splice(u,t,...m);let w=0;for(const D of _)D.visible&&w++;if(w!==0)for(let D=u+m.length;D<r.children.length;D++){const y=r.children[D];y.visible&&(y.visibleChildIndex-=w)}if(r.visibleChildrenCount+=b-w,l&&d){const D=_.reduce((y,x)=>y+(x.visible?x.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(r,v-D),this.list.splice(a,D,c)}if(_.length>0&&o){const D=y=>{o(y),y.children.forEach(D)};_.forEach(D)}const C=r.children.length>0;f!==C&&this.setCollapsible(e.slice(0,-1),C),this._onDidSplice.fire({insertedNodes:m,deletedNodes:_});let S=r;for(;S;){if(S.visibility===2){this.refilter();break}S=S.parent}}rerender(e){if(e.length===0)throw new Gn(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!Jw(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l<i.children.length;l++)if(i.children[l].visible)if(a>-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(Jw(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!Jw(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t)}createTreeNode(e,t,i,n,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,n&&o.push(a);const d=e.children||Be.empty(),c=n&&l!==0&&!a.collapsed,h=Be.map(d,g=>this.createTreeNode(g,a,l,c,o,r));let u=0,f=1;for(const g of h)a.children.push(g),f+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=u++);return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=u,a.visible=l===2?u>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=f):(a.renderNodeCount=0,n&&o.pop()),r&&r(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const d of e.children)a=this._updateNodeAfterFilterChange(d,o,i,n&&!e.collapsed)||a,d.visible&&(d.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):Rx(i)?(e.filterData=i.data,Cf(i.visibility)):(e.filterData=void 0,Cf(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...n]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new Gn(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Gn(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:n,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Gn(this.user,"Invalid tree location");for(let l=0;l<r;l++)i+=t.children[l].renderNodeCount;return n=n&&!t.collapsed,o=o&&t.visible,a.length===0?{parentNode:t,listIndex:i,revealed:n,visible:o}:this.getParentNodeWithListIndex(a,t.children[r],i+1,n,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){if(e.length!==0)return e.length===1?[]:bB(e)[0]}}const vE=Ns("tree-item-expanded",te.chevronDown),wE=Ns("tree-filter-on-type-on",te.listFilter),CE=Ns("tree-filter-on-type-off",te.listSelection),KU=Ns("tree-filter-clear",te.close),E_=Ns("tree-item-loading",te.loading);class GU extends dg{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function eC(s){return s instanceof dg?new GU(s):s}class ZU{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=U.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(eC(e),t)}onDragOver(e,t,i,n,o=!0){const r=this.dnd.onDragOver(eC(e),t&&t.element,i,n),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return r;if(a&&typeof r!="boolean"&&r.autoExpand&&(this.autoExpandDisposable=Nl(()=>{const u=this.modelProvider(),f=u.getNodeLocation(t);u.isCollapsed(f)&&u.setCollapsed(f,!1),this.autoExpandNode=void 0},500)),typeof r=="boolean"||!r.accept||typeof r.bubble>"u"||r.feedback){if(!o){const u=typeof r=="boolean"?r:r.accept,f=typeof r=="boolean"?void 0:r.effect;return{accept:u,effect:f,feedback:[i]}}return r}if(r.bubble===1){const u=this.modelProvider(),f=u.getNodeLocation(t),g=u.getParentNodeLocation(f),m=u.getNode(g),b=g&&u.getListIndex(g);return this.onDragOver(e,m,b,n,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),c=l.getListIndex(d),h=l.getListRenderCount(d);return Object.assign(Object.assign({},r),{feedback:zi(c,c+h)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(eC(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function YU(s,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new ZU(s,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const i=s(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}),enableKeyboardNavigation:e.simpleKeyboardNavigation})}class Ox{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight&&this.delegate.setDynamicHeight(e.element,t)}}var Sf;(function(s){s.None="none",s.OnHover="onHover",s.Always="always"})(Sf||(Sf={}));class XU{constructor(e,t=[]){this._elements=t,this.onDidChange=re.forEach(e,i=>this._elements=i)}get elements(){return this._elements}}class yf{constructor(e,t,i,n,o={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=yf.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new lW,this.activeIndentNodes=new Set,this.indentGuidesDisposable=U.None,this.disposables=new X,this.templateId=e.templateId,this.updateOptions(o),re.map(i,r=>r.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"&&(this.indent=fs(e.indent,0,40)),typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==Sf.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const i=new X;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=$(e,Y(".monaco-tl-row")),i=$(t,Y(".monaco-tl-indent")),n=$(t,Y(".monaco-tl-twistie")),o=$(t,Y(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:U.None,templateData:r}}renderElement(e,t,i,n){typeof n=="number"&&(this.renderedNodes.set(e,{templateData:i,height:n}),this.renderedElements.set(e.element,e));const o=yf.DefaultIndent+(e.depth-1)*this.indent;i.twistie.style.paddingLeft=`${o}px`,i.indent.style.width=`${o+this.indent-16}px`,this.renderTwistie(e,i),typeof n=="number"&&this.renderIndentGuides(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.templateData,n),typeof n=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this.renderTwistie(e,t.templateData),this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderIndentGuides(e,t.templateData))}renderTwistie(e,t){t.twistie.classList.remove(...vE.classNamesArray);let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...vE.classNamesArray),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded")}renderIndentGuides(e,t){if(hi(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new X,n=this.modelProvider();let o=e;for(;;){const r=n.getNodeLocation(o),a=n.getParentNodeLocation(r);if(!a)break;const l=n.getNode(a),d=Y(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(l)&&d.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(d):t.indent.insertBefore(d,t.indent.firstElementChild),this.renderedIndentGuides.add(l,d),i.add(Pe(()=>this.renderedIndentGuides.delete(l,d))),o=l}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(n=>{const o=i.getNodeLocation(n);try{const r=i.getParentNodeLocation(o);n.collapsible&&n.children.length>0&&!n.collapsed?t.add(n):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(n=>{t.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.remove("active"))}),t.forEach(n=>{this.activeIndentNodes.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),$e(this.disposables)}}yf.DefaultIndent=8;class QU{constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new X,e.onWillRefilter(this.reset,this,this.disposables)}get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}filter(e,t){if(this._filter){const o=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return o;let r;if(typeof o=="boolean"?r=o?1:0:Rx(o)?r=Cf(o.visibility):r=o,r===0)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:Gs.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),n=Array.isArray(i)?i:[i];for(const o of n){const r=o&&o.toString();if(typeof r>"u")return{data:Gs.Default,visibility:!0};const a=Qc(this._pattern,this._lowercasePattern,0,r,r.toLowerCase(),0,!0);if(a)return this._matchCount++,n.length===1?{data:a,visibility:!0}:{data:{label:r,score:a},visibility:!0}}return this.tree.options.filterOnType?2:{data:Gs.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){$e(this.disposables)}}class JU{constructor(e,t,i,n,o){this.tree=e,this.view=i,this.filter=n,this.keyboardNavigationDelegate=o,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new M,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new M,this.enabledDisposables=new X,this.disposables=new X,this.domNode=Y(`.monaco-list-type-filter.${this.positionClassName}`),this.domNode.draggable=!0,this.disposables.add(K(this.domNode,"dragstart",()=>this.onDragStart())),this.messageDomNode=$(i.getHTMLElement(),Y(".monaco-list-type-filter-message")),this.labelDomNode=$(this.domNode,Y("span.label"));const r=$(this.domNode,Y(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=$(r,Y("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),this.disposables.add(K(this.filterOnTypeDomNode,"input",()=>this.onDidChangeFilterOnType())),this.clearDomNode=$(r,Y("button.clear"+KU.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=p("clear","Clear"),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}get enabled(){return this._enabled}get pattern(){return this._pattern}get filterOnType(){return this._filterOnType}updateOptions(e){e.simpleKeyboardNavigation?this.disable():this.enable(),typeof e.filterOnType<"u"&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType,this.updateFilterOnTypeTitleAndIcon()),typeof e.automaticKeyboardNavigation<"u"&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=this.enabledDisposables.add(new ht(this.view.getHTMLElement(),"keydown")),t=re.chain(e.event).filter(n=>!xa(n.target)||n.target===this.filterOnTypeDomNode).filter(n=>n.key!=="Dead"&&!/^Media/.test(n.key)).map(n=>new Mt(n)).filter(this.keyboardNavigationEventFilter||(()=>!0)).filter(()=>this.automaticKeyboardNavigation||this.triggered).filter(n=>this.keyboardNavigationDelegate.mightProducePrintableCharacter(n)&&!(n.keyCode===18||n.keyCode===16||n.keyCode===15||n.keyCode===17)||(this.pattern.length>0||this.triggered)&&(n.keyCode===9||n.keyCode===1)&&!n.altKey&&!n.ctrlKey&&!n.metaKey||n.keyCode===1&&(Re?n.altKey&&!n.metaKey:n.ctrlKey)&&!n.shiftKey).forEach(n=>{n.stopPropagation(),n.preventDefault()}).event,i=this.enabledDisposables.add(new ht(this.clearDomNode,"click"));re.chain(re.any(t,i.event)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(),this.render(),this._enabled=!0,this.triggered=!1}disable(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.clear(),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)}onEventOrInput(e){typeof e=="string"?this.onInput(e):e instanceof MouseEvent||e.keyCode===9||e.keyCode===1&&(Re?e.altKey:e.ctrlKey)?this.onInput(""):e.keyCode===1?this.onInput(this.pattern.length===0?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)}onInput(e){const t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,n=>!Gs.isDefault(n.filterData));const i=this.tree.getFocus();if(i.length>0){const n=i[0];this.tree.getRelativeTop(n)===null&&this.tree.reveal(n,.5)}this.render(),e||(this.triggered=!1)}onDragStart(){const e=this.view.getHTMLElement(),{left:t}=vi(e),i=e.clientWidth,n=i/2,o=this.domNode.clientWidth,r=new X;let a=this.positionClassName;const l=()=>{switch(a){case"nw":this.domNode.style.top="4px",this.domNode.style.left="4px";break;case"ne":this.domNode.style.top="4px",this.domNode.style.left=`${i-o-6}px`;break}},d=h=>{h.preventDefault();const u=h.clientX-t;h.dataTransfer&&(h.dataTransfer.dropEffect="none"),u<n?a="nw":a="ne",l()},c=()=>{this.positionClassName=a,this.domNode.className=`monaco-list-type-filter ${this.positionClassName}`,this.domNode.style.top="",this.domNode.style.left="",$e(r)};l(),this.domNode.classList.remove(a),this.domNode.classList.add("dragging"),r.add(Pe(()=>this.domNode.classList.remove("dragging"))),r.add(K(document,"dragover",h=>d(h))),r.add(K(this.domNode,"dragend",()=>c())),Xo.CurrentDragAndDropData=new y9("vscode-ui"),r.add(Pe(()=>Xo.CurrentDragAndDropData=void 0))}onDidSpliceModel(){!this._enabled||this.pattern.length===0||(this.tree.refilter(),this.render())}onDidChangeFilterOnType(){this.tree.updateOptions({filterOnType:this.filterOnTypeDomNode.checked}),this.tree.refilter(),this.tree.domFocus(),this.render(),this.updateFilterOnTypeTitleAndIcon()}updateFilterOnTypeTitleAndIcon(){this.filterOnType?(this.filterOnTypeDomNode.classList.remove(...CE.classNamesArray),this.filterOnTypeDomNode.classList.add(...wE.classNamesArray),this.filterOnTypeDomNode.title=p("disable filter on type","Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...wE.classNamesArray),this.filterOnTypeDomNode.classList.add(...CE.classNamesArray),this.filterOnTypeDomNode.title=p("enable filter on type","Enable Filter on Type"))}render(){const e=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=p("empty","No elements found"),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),this.domNode.classList.toggle("no-matches",e),this.domNode.title=p("found","Matched {0} out of {1} elements",this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"…"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)}shouldAllowFocus(e){return!this.enabled||!this.pattern||this.filterOnType||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!Gs.isDefault(e.filterData)}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),$e(this.disposables)}}function SE(s){let e=Ou.Unknown;return tk(s.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Ou.Twistie:tk(s.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(e=Ou.Element),{browserEvent:s.browserEvent,element:s.element?s.element.element:null,target:e}}function Zp(s,e){e(s),s.children.forEach(t=>Zp(t,e))}class tC{constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new M,this.onDidChange=this._onDidChange.event}get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}set(e,t){var i;!(!((i=t)===null||i===void 0)&&i.__forceEvent)&&Ss(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const n=this;this._onDidChange.fire({get elements(){return n.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),d=c=>l.delete(c);t.forEach(c=>Zp(c,d)),this.set([...l.values()]);return}const i=new Set,n=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>Zp(l,n));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>Zp(l,r));const a=[];for(const l of this.nodes){const d=this.identityProvider.getId(l.element).toString();if(!i.has(d))a.push(l);else{const h=o.get(d);h&&a.push(h)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class e$ extends RR{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(xa(e.browserEvent.target)||dc(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,o&&!n&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const r=this.tree.model,a=r.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),r.setCollapsed(a,void 0,l),o&&n)return}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||super.onDoubleClick(e)}}class t$ extends Ho{constructor(e,t,i,n,o,r,a,l){super(e,t,i,n,l),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new e$(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],o=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&n.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),n.length>0&&super.setFocus(Mk([...super.getFocus(),...n])),o.length>0&&super.setSelection(Mk([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(n=>this.element(n)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(n=>this.element(n)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class PR{constructor(e,t,i,n,o={}){this._options=o,this.eventBufferer=new Hy,this.disposables=new X,this._onWillRefilter=new M,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new M;const r=new Ox(i),a=new YD,l=new YD,d=new XU(l.event);this.renderers=n.map(u=>new yf(u,()=>this.model,a.event,d,o));for(let u of this.renderers)this.disposables.add(u);let c;o.keyboardNavigationLabelProvider&&(c=new QU(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:c}),this.disposables.add(c)),this.focus=new tC(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new tC(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new tC(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new t$(e,t,r,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},YU(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const h=re.forEach(this.model.onDidSplice,u=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(u),this.selection.onDidModelSplice(u)})});if(h(()=>null,null,this.disposables),l.input=re.chain(re.any(h,this.focus.onDidChange,this.selection.onDidChange)).debounce(()=>null,0).map(()=>{const u=new Set;for(const f of this.focus.getNodes())u.add(f);for(const f of this.selection.getNodes())u.add(f);return[...u.values()]}).event,o.keyboardSupport!==!1){const u=re.chain(this.view.onKeyDown).filter(f=>!xa(f.target)).map(f=>new Mt(f));u.filter(f=>f.keyCode===15).on(this.onLeftArrow,this,this.disposables),u.filter(f=>f.keyCode===17).on(this.onRightArrow,this,this.disposables),u.filter(f=>f.keyCode===10).on(this.onSpace,this,this.disposables)}if(o.keyboardNavigationLabelProvider){const u=o.keyboardNavigationDelegate||MR;this.typeFilterController=new JU(this,this.model,this.view,c,u),this.focusNavigationFilter=f=>this.typeFilterController.shouldAllowFocus(f),this.disposables.add(this.typeFilterController)}this.styleElement=On(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Sf.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return re.map(this.view.onMouseDblClick,SE)}get onPointer(){return re.map(this.view.onPointer,SE)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(Object.assign(Object.assign({},this._options),{enableKeyboardNavigation:this._options.simpleKeyboardNavigation})),this.typeFilterController&&this.typeFilterController.updateOptions(this._options),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Sf.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeIndentGuidesStroke.transparent(.4)}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join(`
`),this.view.style(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,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){const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(n,t,!0)}focusNext(e=1,t=!1,i,n=this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}getRelativeTop(e){const t=this.model.getListIndex(e);return t===-1?null:this.view.getRelativeTop(t)}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),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){$e(this.disposables),this.view.dispose()}}class Px{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new qU(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,o){return i.sorter.compare(n.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=Be.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Be.empty(),i){const n=new Set,o=new Set,r=l=>{var d;if(l.element===null)return;const c=l;if(n.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();o.add(h),this.nodesByIdentity.set(h,c)}(d=i.onDidCreateNode)===null||d===void 0||d.call(i,c)},a=l=>{var d;if(l.element===null)return;const c=l;if(n.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();o.has(h)||this.nodesByIdentity.delete(h)}(d=i.onDidDeleteNode)===null||d===void 0||d.call(i,c)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=Be.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Be.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i)return Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children)});const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible,o=typeof t.collapsed<"u"?t.collapsed:i.collapsed;return Object.assign(Object.assign({},t),{collapsible:n,collapsed:o,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Gn(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Gn(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Gn(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Gn(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function Yp(s){const e=[s.element],t=s.incompressible||!1;return{element:{elements:e,incompressible:t},children:Be.map(Be.from(s.children),Yp),collapsible:s.collapsible,collapsed:s.collapsed}}function Xp(s){const e=[s.element],t=s.incompressible||!1;let i,n;for(;[n,i]=Be.consume(Be.from(s.children),2),!(n.length!==1||n[0].incompressible);)s=n[0],e.push(s.element);return{element:{elements:e,incompressible:t},children:Be.map(Be.concat(n,i),Xp),collapsible:s.collapsible,collapsed:s.collapsed}}function a1(s,e=0){let t;return e<s.element.elements.length-1?t=[a1(s,e+1)]:t=Be.map(Be.from(s.children),i=>a1(i,0)),e===0&&s.element.incompressible?{element:s.element.elements[e],children:t,incompressible:!0,collapsible:s.collapsible,collapsed:s.collapsed}:{element:s.element.elements[e],children:t,collapsible:s.collapsible,collapsed:s.collapsed}}function yE(s){return a1(s,0)}function FR(s,e,t){return s.element===e?Object.assign(Object.assign({},s),{children:t}):Object.assign(Object.assign({},s),{children:Be.map(Be.from(s.children),i=>FR(i,e,t))})}const i$=s=>({getId(e){return e.elements.map(t=>s.getId(t).toString()).join("\0")}});class n${constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new Px(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}setChildren(e,t=Be.empty(),i){const n=i.diffIdentityProvider&&i$(i.diffIdentityProvider);if(e===null){const f=Be.map(t,this.enabled?Xp:Yp);this._setChildren(null,f,{diffIdentityProvider:n,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Error("Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),d=yE(r),c=FR(d,e,t),h=(this.enabled?Xp:Yp)(c),u=l.children.map(f=>f===r?h:f);this._setChildren(l.element,u,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,n=Be.map(i,yE),o=Be.map(n,e?Xp:Yp);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,o=a=>{for(const l of a.element.elements)n.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)n.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:r}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Gn(this.user,`Tree element not found: ${e}`);return t}}const s$=s=>s[s.length-1];class Fx{constructor(e,t){this.unwrapper=e,this.node=t}get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new Fx(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}function o$(s,e){return{splice(t,i,n){e.splice(t,i,n.map(o=>s.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function r$(s,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(s(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(s(t),i)}}})}class a${constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||s$;const n=o=>this.elementMapper(o.elements);this.nodeMapper=new Ax(o=>new Fx(n,o)),this.model=new n$(e,o$(this.nodeMapper,t),r$(n,i))}get onDidSplice(){return re.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return re.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return re.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}setChildren(e,t=Be.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var l$=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class Bx extends PR{constructor(e,t,i,n,o={}){super(e,t,i,n,o)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=Be.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new Px(e,t,i)}}class BR{constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}l$([Zt],BR.prototype,"compressedTreeNodeProvider",null);function d$(s,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let i;try{i=s().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return i.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}class WR extends Bx{constructor(e,t,i,n,o={}){const r=()=>this,a=n.map(l=>new BR(r,l));super(e,t,i,a,d$(r,o))}setChildren(e,t=Be.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new a$(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var Vr=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function iC(s){return Object.assign(Object.assign({},s),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function l1(s,e){return e.parent?e.parent===s?!0:l1(s,e.parent):!1}function c$(s,e){return s===e||l1(s,e)||l1(e,s)}class Wx{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new Wx(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class h${constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...E_.classNamesArray),!0):(t.classList.remove(...E_.classNamesArray),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function LE(s){return{browserEvent:s.browserEvent,elements:s.elements.map(e=>e.element)}}function xE(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,target:s.target}}class u$ extends dg{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function nC(s){return s instanceof dg?new u$(s):s}class f${constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(nC(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(nC(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(nC(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function VR(s){return s&&Object.assign(Object.assign({},s),{collapseByDefault:!0,identityProvider:s.identityProvider&&{getId(e){return s.identityProvider.getId(e.element)}},dnd:s.dnd&&new f$(s.dnd),multipleSelectionController:s.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return s.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return s.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:s.accessibilityProvider&&Object.assign(Object.assign({},s.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:s.accessibilityProvider.getRole?e=>s.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:s.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=s.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return s.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return s.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:s.accessibilityProvider.getWidgetRole?()=>s.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:s.accessibilityProvider.getAriaLevel&&(e=>s.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:s.accessibilityProvider.getActiveDescendantId&&(e=>s.accessibilityProvider.getActiveDescendantId(e.element))}),filter:s.filter&&{filter(e,t){return s.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:s.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},s.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return s.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof s.expandOnlyOnTwistieClick>"u"?void 0:typeof s.expandOnlyOnTwistieClick!="function"?s.expandOnlyOnTwistieClick:e=>s.expandOnlyOnTwistieClick(e.element),additionalScrollHeight:s.additionalScrollHeight})}function d1(s,e){e(s),s.children.forEach(t=>d1(t,e))}class HR{constructor(e,t,i,n,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new M,this._onDidChangeNodeSlowState=new M,this.nodeMapper=new Ax(a=>new Wx(a)),this.disposables=new X,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.collapseByDefault=r.collapseByDefault,this.tree=this.createTree(e,t,i,n,r),this.root=iC({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}get onDidChangeFocus(){return re.map(this.tree.onDidChangeFocus,LE)}get onDidChangeSelection(){return re.map(this.tree.onDidChangeSelection,LE)}get onMouseDblClick(){return re.map(this.tree.onMouseDblClick,xE)}get onPointer(){return re.map(this.tree.onPointer,xE)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,i,n,o){const r=new Ox(i),a=n.map(d=>new h$(d,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=VR(o)||{};return new Bx(e,t,r,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return Vr(this,void 0,void 0,function*(){this.refreshPromises.forEach(n=>n.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,i=!1,n,o){return Vr(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Gn(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield re.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(yield this.refreshAndRenderNode(r,t,n,o),i)try{this.tree.rerender(r)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return Vr(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Gn(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield re.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(yield this.root.refreshPromise,yield re.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield re.toPromise(this._onDidRender.event)),n})}setSelection(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Gn(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,n){return Vr(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)})}refreshNode(e,t,i){return Vr(this,void 0,void 0,function*(){let n;return this.subTreeRefreshPromises.forEach((o,r)=>{!n&&c$(r,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n||this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return Vr(this,void 0,void 0,function*(){let n;e.refreshPromise=new Promise(o=>n=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield K0.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{n()}})}doRefreshNode(e,t,i){return Vr(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(Be.empty());else{const o=pa(800);o.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},r=>null),n=this.doGetChildren(e).finally(()=>o.cancel())}try{const o=yield n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Vo(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);return t||(t=fi(()=>Vr(this,void 0,void 0,function*(){const i=yield this.dataSource.getChildren(e.element);return this.processChildren(i)})),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(ve))}setChildren(e,t,i,n){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const c of e.children)if(r.set(c.element,c),this.identityProvider){const h=this.tree.isCollapsed(c);a.set(c.id,{node:c,collapsed:h})}const l=[],d=o.map(c=>{const h=!!this.dataSource.hasChildren(c);if(!this.identityProvider){const m=iC({element:c,parent:e,hasChildren:h});return h&&this.collapseByDefault&&!this.collapseByDefault(c)&&(m.collapsedByDefault=!1,l.push(m)),m}const u=this.identityProvider.getId(c).toString(),f=a.get(u);if(f){const m=f.node;return r.delete(m.element),this.nodes.delete(m.element),this.nodes.set(c,m),m.element=c,m.hasChildren=h,i?f.collapsed?(m.children.forEach(b=>d1(b,v=>this.nodes.delete(v.element))),m.children.splice(0,m.children.length),m.stale=!0):l.push(m):h&&this.collapseByDefault&&!this.collapseByDefault(c)&&(m.collapsedByDefault=!1,l.push(m)),m}const g=iC({element:c,parent:e,id:u,hasChildren:h});return n&&n.viewState.focus&&n.viewState.focus.indexOf(u)>-1&&n.focus.push(g),n&&n.viewState.selection&&n.viewState.selection.indexOf(u)>-1&&n.selection.push(g),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(u)>-1?l.push(g):h&&this.collapseByDefault&&!this.collapseByDefault(c)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const c of r.values())d1(c,h=>this.nodes.delete(h.element));for(const c of d)this.nodes.set(c.element,c);return e.children.splice(0,e.children.length,...d),e!==this.root&&this.autoExpandSingleChildren&&d.length===1&&l.length===0&&(d[0].collapsedByDefault=!1,l.push(d[0])),l}render(e,t,i){const n=e.children.map(r=>this.asTreeElement(r,t)),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}});this.tree.setChildren(e===this.root?null:e,n,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:i=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?Be.map(e.children,n=>this.asTreeElement(n,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}class Vx{constructor(e){this.node=e}get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new Vx(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class g${constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...E_.classNamesArray),!0):(t.classList.remove(...E_.classNamesArray),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=$e(this.disposables)}}function p$(s){const e=s&&VR(s);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return s.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}})})}class m$ extends HR{constructor(e,t,i,n,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new Ax(l=>new Vx(l)),this.filter=a.filter}createTree(e,t,i,n,o){const r=new Ox(i),a=n.map(d=>new g$(d,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=p$(o)||{};return new WR(e,t,r,a,l)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=u=>this.identityProvider.getId(u).toString(),n=u=>{const f=new Set;for(const g of u){const m=this.tree.getCompressedTreeNode(g===this.root?null:g);if(m.element)for(const b of m.element.elements)f.add(i(b.element))}return f},o=n(this.tree.getSelection()),r=n(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const d=this.getFocus();let c=!1;const h=u=>{const f=u.element;if(f)for(let g=0;g<f.elements.length;g++){const m=i(f.elements[g].element),b=f.elements[f.elements.length-1].element;o.has(m)&&a.indexOf(b)===-1&&(a.push(b),l=!0),r.has(m)&&d.indexOf(b)===-1&&(d.push(b),c=!0)}u.children.forEach(h)};h(this.tree.getCompressedTreeNode(e===this.root?null:e)),l&&this.setSelection(a),c&&this.setFocus(d)}processChildren(e){return this.filter&&(e=Be.filter(e,t=>{const i=this.filter.filter(t,1),n=_$(i);if(n===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return n===1})),super.processChildren(e)}}function _$(s){return typeof s=="boolean"?s?1:0:Rx(s)?Cf(s.visibility):Cf(s)}class b$ extends PR{constructor(e,t,i,n,o,r={}){super(e,t,i,n,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t,i){return new Px(e,t,i)}}const v$={separatorBorder:B.transparent};class zR{constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){e!==this.visible&&(e?(this.size=fs(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e),this.view.setVisible&&this.view.setVisible(e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){return this.disposable.dispose(),this.view}}class w$ extends zR{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class C$ extends zR{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Qo;(function(s){s[s.Idle=0]="Idle",s[s.Busy=1]="Busy"})(Qo||(Qo={}));var N_;(function(s){s.Distribute={type:"distribute"};function e(i){return{type:"split",index:i}}s.Split=e;function t(i){return{type:"invisible",cachedVisibleSize:i}}s.Invisible=t})(N_||(N_={}));class UR extends U{constructor(e,t={}){var i,n;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Qo.Idle,this._onDidSashChange=this._register(new M),this.onDidSashChange=this._onDidSashChange.event,this._onDidSashReset=this._register(new M),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.orientation=ji(t.orientation)?0:t.orientation,this.inverseAltBehavior=!!t.inverseAltBehavior,this.proportionalLayout=ji(t.proportionalLayout)?!0:!!t.proportionalLayout,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=$(this.el,Y(".sash-container")),this.viewContainer=Y(".split-view-container"),this.scrollable=new Pb(125,Ro),this.scrollableElement=this._register(new rx(this.viewContainer,{vertical:this.orientation===0?(i=t.scrollbarVisibility)!==null&&i!==void 0?i:1:2,horizontal:this.orientation===1?(n=t.scrollbarVisibility)!==null&&n!==void 0?n:1:2},this.scrollable)),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(o=>{this.viewContainer.scrollTop=o.scrollTop,this.viewContainer.scrollLeft=o.scrollLeft})),$(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||v$),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((o,r)=>{const a=ji(o.visible)||o.visible?o.size:{type:"invisible",cachedVisibleSize:o.size},l=o.view;this.doAddView(l,a,r,!0)}),this.contentSize=this.viewItems.reduce((o,r)=>o+r.size,0),this.saveProportions())}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions)for(let n=0;n<this.viewItems.length;n++){const o=this.viewItems[n];o.size=fs(Math.round(this.proportions[n]*e),o.minimumSize,o.maximumSize)}else{const n=zi(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.size/this.contentSize))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const n=this.sashItems.findIndex(a=>a.sash===e),o=sa(K(document.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),K(document.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const d=this.viewItems.map(g=>g.size);let c=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(n===this.sashItems.length-1){const m=this.viewItems[n];c=(m.minimumSize-m.size)/2,h=(m.maximumSize-m.size)/2}else{const m=this.viewItems[n+1];c=(m.size-m.maximumSize)/2,h=(m.size-m.minimumSize)/2}let u,f;if(!l){const g=zi(n,-1),m=zi(n+1,this.viewItems.length),b=g.reduce((x,E)=>x+(this.viewItems[E].minimumSize-d[E]),0),v=g.reduce((x,E)=>x+(this.viewItems[E].viewMaximumSize-d[E]),0),_=m.length===0?Number.POSITIVE_INFINITY:m.reduce((x,E)=>x+(d[E]-this.viewItems[E].minimumSize),0),w=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((x,E)=>x+(d[E]-this.viewItems[E].viewMaximumSize),0),C=Math.max(b,w),S=Math.min(_,v),D=this.findFirstSnapIndex(g),y=this.findFirstSnapIndex(m);if(typeof D=="number"){const x=this.viewItems[D],E=Math.floor(x.viewMinimumSize/2);u={index:D,limitDelta:x.visible?C-E:C+E,size:x.size}}if(typeof y=="number"){const x=this.viewItems[y],E=Math.floor(x.viewMinimumSize/2);f={index:y,limitDelta:x.visible?S+E:S-E,size:x.size}}}this.sashDragState={start:a,current:a,index:n,sizes:d,minDelta:c,maxDelta:h,alt:l,snapBefore:u,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:d}=this.sashDragState;this.sashDragState.current=e;const c=e-i,h=this.resize(t,c,n,void 0,void 0,r,a,l,d);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(w=>w.size),g=u?t:t+1,m=this.viewItems[g],b=m.size-m.maximumSize,v=m.size-m.minimumSize,_=u?t-1:t+1;this.resize(_,-h,f,void 0,void 0,b,v)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=fs(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==Qo.Idle)throw new Error("Cant modify splitview");if(this.state=Qo.Busy,e<0||e>=this.viewItems.length)return;const i=zi(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=fs(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,o),this.state=Qo.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=fs(i,a.minimumSize,a.maximumSize);const n=zi(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==Qo.Idle)throw new Error("Cant modify splitview");this.state=Qo.Busy;const o=Y(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(u=>this.onViewChange(c,u)),a=Pe(()=>this.viewContainer.removeChild(o)),l=sa(r,a);let d;typeof t=="number"?d=t:t.type==="split"?d=this.getViewSize(t.index)/2:t.type==="invisible"?d={cachedVisibleSize:t.cachedVisibleSize}:d=e.minimumSize;const c=this.orientation===0?new w$(o,e,d,l):new C$(o,e,d,l);if(this.viewItems.splice(i,0,c),this.viewItems.length>1){let u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash};const f=this.orientation===0?new Ti(this.sashContainer,{getHorizontalSashTop:x=>this.getSashPosition(x),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},u),{orientation:1})):new Ti(this.sashContainer,{getVerticalSashLeft:x=>this.getSashPosition(x),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},u),{orientation:0})),g=this.orientation===0?x=>({sash:f,start:x.startY,current:x.currentY,alt:x.altKey}):x=>({sash:f,start:x.startX,current:x.currentX,alt:x.altKey}),b=re.map(f.onDidStart,g)(this.onSashStart,this),_=re.map(f.onDidChange,g)(this.onSashChange,this),C=re.map(f.onDidEnd,()=>this.sashItems.findIndex(x=>x.sash===f))(this.onSashEnd,this),S=f.onDidReset(()=>{const x=this.sashItems.findIndex(q=>q.sash===f),E=zi(x,-1),P=zi(x+1,this.viewItems.length),A=this.findFirstSnapIndex(E),H=this.findFirstSnapIndex(P);typeof A=="number"&&!this.viewItems[A].visible||typeof H=="number"&&!this.viewItems[H].visible||this._onDidSashReset.fire(x)}),D=sa(b,_,C,S,f),y={sash:f,disposable:D};this.sashItems.splice(i-1,0,y)}o.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),n||this.relayout([i],h),this.state=Qo.Idle,!n&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((n,o)=>n+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(c=>c.size),n,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,d){if(e<0||e>=this.viewItems.length)return 0;const c=zi(e,-1),h=zi(e+1,this.viewItems.length);if(o)for(const y of o)hw(c,y),hw(h,y);if(n)for(const y of n)Tg(c,y),Tg(h,y);const u=c.map(y=>this.viewItems[y]),f=c.map(y=>i[y]),g=h.map(y=>this.viewItems[y]),m=h.map(y=>i[y]),b=c.reduce((y,x)=>y+(this.viewItems[x].minimumSize-i[x]),0),v=c.reduce((y,x)=>y+(this.viewItems[x].maximumSize-i[x]),0),_=h.length===0?Number.POSITIVE_INFINITY:h.reduce((y,x)=>y+(i[x]-this.viewItems[x].minimumSize),0),w=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((y,x)=>y+(i[x]-this.viewItems[x].maximumSize),0),C=Math.max(b,w,r),S=Math.min(_,v,a);let D=!1;if(l){const y=this.viewItems[l.index],x=t>=l.limitDelta;D=x!==y.visible,y.setVisible(x,l.size)}if(!D&&d){const y=this.viewItems[d.index],x=t<d.limitDelta;D=x!==y.visible,y.setVisible(x,d.size)}if(D)return this.resize(e,t,i,n,o,r,a);t=fs(t,C,S);for(let y=0,x=t;y<u.length;y++){const E=u[y],P=fs(f[y]+x,E.minimumSize,E.maximumSize),A=P-f[y];x-=A,E.size=P}for(let y=0,x=t;y<g.length;y++){const E=g[y],P=fs(m[y]-x,E.minimumSize,E.maximumSize),A=P-m[y];x+=A,E.size=P}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((a,l)=>a+l.size,0);let i=this.size-t;const n=zi(this.viewItems.length-1,-1),o=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);for(const a of r)hw(n,a);for(const a of o)Tg(n,a);typeof e=="number"&&Tg(n,e);for(let a=0;i!==0&&a<n.length;a++){const l=this.viewItems[n[a]],d=fs(l.size+i,l.minimumSize,l.maximumSize),c=d-l.size;i-=c,l.size=d}}layoutViews(){this.contentSize=this.viewItems.reduce((t,i)=>t+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),n=[...this.viewItems].reverse();e=!1;const o=n.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=n.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l<this.sashItems.length;l++){const{sash:d}=this.sashItems[l],c=this.viewItems[l];a+=c.size;const h=!(t[l]&&r[l+1]),u=!(i[l]&&o[l+1]);if(h&&u){const f=zi(l,-1),g=zi(l+1,this.viewItems.length),m=this.findFirstSnapIndex(f),b=this.findFirstSnapIndex(g),v=typeof m=="number"&&!this.viewItems[m].visible,_=typeof b=="number"&&!this.viewItems[b].visible;v&&o[l]&&(a>0||this.startSnappingEnabled)?d.state=1:_&&t[l]&&(a<this.contentSize||this.endSnappingEnabled)?d.state=2:d.state=0}else h&&!u?d.state=1:!h&&u?d.state=2:d.state=3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const i=this.viewItems[t];if(i.visible&&i.snap)return t}for(const t of e){const i=this.viewItems[t];if(i.visible&&i.maximumSize-i.minimumSize>0)return;if(!i.visible&&i.snap)return t}}dispose(){super.dispose(),this.viewItems.forEach(e=>e.dispose()),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[]}}class cg{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=cg.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=n.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=$(e,Y(".monaco-table-tr")),i=[],n=[];for(let r=0;r<this.columns.length;r++){const a=this.renderers[r],l=$(t,Y(".monaco-table-td",{"data-col-index":r}));l.style.width=`${this.getColumnSize(r)}px`,i.push(l),n.push(a.renderTemplate(l))}const o={container:e,cellContainers:i,cellTemplateData:n};return this.renderedTemplates.add(o),o}renderElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const a=this.columns[o].project(e);this.renderers[o].renderElement(a,t,i.cellTemplateData[o],n)}}disposeElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const r=this.renderers[o];if(r.disposeElement){const l=this.columns[o].project(e);r.disposeElement(l,t,i.cellTemplateData[o],n)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);hi(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}cg.TemplateId="row";function S$(s){return{getHeight(e){return s.getHeight(e)},getTemplateId(){return cg.TemplateId}}}class y${constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new M,this.onDidLayout=this._onDidLayout.event,this.element=Y(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}get minimumSize(){var e;return(e=this.column.minimumWidth)!==null&&e!==void 0?e:120}get maximumSize(){var e;return(e=this.column.maximumWidth)!==null&&e!==void 0?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return(e=this.column.onDidChangeWidthConstraints)!==null&&e!==void 0?e:re.None}layout(e){this._onDidLayout.fire([this.index,e])}}class qb{constructor(e,t,i,n,o,r){this.virtualDelegate=i,this.domId=`table_id_${++qb.InstanceCount}`,this.cachedHeight=0,this.domNode=$(t,Y(`.monaco-table.${this.domId}`));const a=n.map((c,h)=>new y$(c,h)),l={size:a.reduce((c,h)=>c+h.column.weight,0),views:a.map(c=>({size:c.column.weight,view:c}))};this.splitview=new UR(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l}),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const d=new cg(n,o,c=>this.splitview.getViewSize(c));this.list=new Ho(e,this.domNode,S$(i),[d],r),this.columnLayoutDisposable=re.any(...a.map(c=>c.onDidLayout))(([c,h])=>d.layoutColumn(c,h)),this.styleElement=On(this.domNode),this.style({})}get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {
top: ${this.virtualDelegate.headerRowHeight+1}px;
height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
}`),this.styleElement.textContent=t.join(`
`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.splitview.dispose(),this.list.dispose(),this.columnLayoutDisposable.dispose()}}qb.InstanceCount=0;var zo=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ee=function(s,e){return function(t,i){e(t,i,s)}};const ns=Ze("listService");let c1=class{constructor(e){this._themeService=e,this.disposables=new X,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}get lastFocusedList(){return this._lastFocusedWidget}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;const n=new OR(On(),"");this.disposables.add($l(n,this._themeService))}if(this.lists.some(n=>n.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&(this._lastFocusedWidget=e),sa(e.onDidFocus(()=>this._lastFocusedWidget=e),Pe(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(n=>n!==i),this._lastFocusedWidget===e&&(this._lastFocusedWidget=void 0)}))}dispose(){this.disposables.dispose()}};c1=zo([Ee(0,pt)],c1);const $R=new se("listFocus",!0),Kb=new se("listSupportsMultiselect",!0),jR=J.and($R,J.not(jU)),Hx=new se("listHasSelectionOrFocus",!1),zx=new se("listDoubleSelection",!1),Ux=new se("listMultiSelection",!1),Gb=new se("listSelectionNavigation",!1),L$=new se("listSupportsKeyboardNavigation",!0),$x="listAutomaticKeyboardNavigation",x$=new se($x,!0);let DE=!1;function Zb(s,e){const t=s.createScoped(e.getHTMLElement());return $R.bindTo(t),t}const xd="workbench.list.multiSelectModifier",h1="workbench.list.openMode",Qn="workbench.list.horizontalScrolling",M_="workbench.list.keyboardNavigation",jx="workbench.list.automaticKeyboardNavigation",T_="workbench.tree.indent",A_="workbench.tree.renderIndentGuides",Qs="workbench.list.smoothScrolling",R_="workbench.tree.expandMode";function Wo(s){return s.getValue(xd)==="alt"}class D$ extends U{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Wo(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(xd)&&(this.useAltAsMultipleSelectionModifier=Wo(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:TR(e)}isSelectionRangeChangeEvent(e){return AR(e)}}function Yb(s,e,t){const i=new X,n=Object.assign({},s);if(!s.multipleSelectionController){const o=new D$(e);n.multipleSelectionController=o,i.add(o)}return n.keyboardNavigationDelegate={mightProducePrintableCharacter(o){return t.mightProducePrintableCharacter(o)}},n.smoothScrolling=!!e.getValue(Qs),[n,i]}let u1=class extends Ho{constructor(e,t,i,n,o,r,a,l,d,c){const h=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!d.getValue(Qn),[u,f]=Yb(o,d,c);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Fs(l.getColorTheme(),Ub)),u),{horizontalScrolling:h})),this.disposables.add(f),this.contextKeyService=Zb(r,this),this.themeService=l,this.listSupportsMultiSelect=Kb.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!!o.multipleSelectionSupport),Gb.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=Hx.bindTo(this.contextKeyService),this.listDoubleSelection=zx.bindTo(this.contextKeyService),this.listMultiSelection=Ux.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Wo(d),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),b=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||b.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),b=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||b.length>0)})),this.disposables.add(d.onDidChangeConfiguration(m=>{m.affectsConfiguration(xd)&&(this._useAltAsMultipleSelectionModifier=Wo(d));let b={};if(m.affectsConfiguration(Qn)&&this.horizontalScrolling===void 0){const v=!!d.getValue(Qn);b=Object.assign(Object.assign({},b),{horizontalScrolling:v})}if(m.affectsConfiguration(Qs)){const v=!!d.getValue(Qs);b=Object.assign(Object.assign({},b),{smoothScrolling:v})}Object.keys(b).length>0&&this.updateOptions(b)})),this.navigator=new qR(this,Object.assign({configurationService:d},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;(t=this._styler)===null||t===void 0||t.dispose(),this._styler=$l(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),super.dispose()}};u1=zo([Ee(5,we),Ee(6,ns),Ee(7,pt),Ee(8,At),Ee(9,Lt)],u1);let kE=class extends $U{constructor(e,t,i,n,o,r,a,l,d,c){const h=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!d.getValue(Qn),[u,f]=Yb(o,d,c);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Fs(l.getColorTheme(),Ub)),u),{horizontalScrolling:h})),this.disposables=new X,this.disposables.add(f),this.contextKeyService=Zb(r,this),this.themeService=l,this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=Kb.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!!o.multipleSelectionSupport),Gb.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Wo(d),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),o.overrideStyles&&this.disposables.add($l(this,l,o.overrideStyles)),this.disposables.add(d.onDidChangeConfiguration(m=>{m.affectsConfiguration(xd)&&(this._useAltAsMultipleSelectionModifier=Wo(d));let b={};if(m.affectsConfiguration(Qn)&&this.horizontalScrolling===void 0){const v=!!d.getValue(Qn);b=Object.assign(Object.assign({},b),{horizontalScrolling:v})}if(m.affectsConfiguration(Qs)){const v=!!d.getValue(Qs);b=Object.assign(Object.assign({},b),{smoothScrolling:v})}Object.keys(b).length>0&&this.updateOptions(b)})),this.navigator=new qR(this,Object.assign({configurationService:d},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;(t=this._styler)===null||t===void 0||t.dispose(),this._styler=$l(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),this.disposables.dispose(),super.dispose()}};kE=zo([Ee(5,we),Ee(6,ns),Ee(7,pt),Ee(8,At),Ee(9,Lt)],kE);let IE=class extends qb{constructor(e,t,i,n,o,r,a,l,d,c,h){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(Qn),[f,g]=Yb(r,c,h);super(e,t,i,n,o,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Fs(d.getColorTheme(),Ub)),f),{horizontalScrolling:u})),this.disposables=new X,this.disposables.add(g),this.contextKeyService=Zb(a,this),this.themeService=d,this.listSupportsMultiSelect=Kb.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!!r.multipleSelectionSupport),Gb.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=Hx.bindTo(this.contextKeyService),this.listDoubleSelection=zx.bindTo(this.contextKeyService),this.listMultiSelection=Ux.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Wo(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),r.overrideStyles&&this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const b=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(b.length>0||v.length>0),this.listMultiSelection.set(b.length>1),this.listDoubleSelection.set(b.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const b=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(b.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(b=>{b.affectsConfiguration(xd)&&(this._useAltAsMultipleSelectionModifier=Wo(c));let v={};if(b.affectsConfiguration(Qn)&&this.horizontalScrolling===void 0){const _=!!c.getValue(Qn);v=Object.assign(Object.assign({},v),{horizontalScrolling:_})}if(b.affectsConfiguration(Qs)){const _=!!c.getValue(Qs);v=Object.assign(Object.assign({},v),{smoothScrolling:_})}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new k$(this,Object.assign({configurationService:c},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;(t=this._styler)===null||t===void 0||t.dispose(),this._styler=$l(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),this.disposables.dispose(),super.dispose()}};IE=zo([Ee(6,we),Ee(7,ns),Ee(8,pt),Ee(9,At),Ee(10,Lt)],IE);class qx extends U{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new M),this.onDidOpen=this._onDidOpen.event,this._register(re.filter(this.widget.onDidChangeSelection,n=>n.browserEvent instanceof KeyboardEvent)(n=>this.onSelectionFromKeyboard(n))),this._register(this.widget.onPointer(n=>this.onPointer(n.element,n.browserEvent))),this._register(this.widget.onMouseDblClick(n=>this.onMouseDblClick(n.element,n.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(h1))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(()=>{this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(h1))!=="doubleClick"}))):this.openOnSingleClick=(i=t==null?void 0:t.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,n=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const n=t.button===1,o=!0,r=n,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class qR extends qx{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class k$ extends qx{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class I$ extends qx{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function E$(s,e){let t=!1;return i=>{if(t)return t=!1,!1;const n=e.softDispatch(i,s);return n&&n.enterChord?(t=!0,!1):(t=!1,!0)}}let EE=class extends Bx{constructor(e,t,i,n,o,r,a,l,d,c,h){const{options:u,getAutomaticKeyboardNavigation:f,disposable:g}=hg(t,o,r,d,c,h);super(e,t,i,n,u),this.disposables.add(g),this.internals=new jl(this,o,f,o.overrideStyles,r,a,l,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};EE=zo([Ee(5,we),Ee(6,ns),Ee(7,pt),Ee(8,At),Ee(9,Lt),Ee(10,Hn)],EE);let NE=class extends WR{constructor(e,t,i,n,o,r,a,l,d,c,h){const{options:u,getAutomaticKeyboardNavigation:f,disposable:g}=hg(t,o,r,d,c,h);super(e,t,i,n,u),this.disposables.add(g),this.internals=new jl(this,o,f,o.overrideStyles,r,a,l,d,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};NE=zo([Ee(5,we),Ee(6,ns),Ee(7,pt),Ee(8,At),Ee(9,Lt),Ee(10,Hn)],NE);let ME=class extends b${constructor(e,t,i,n,o,r,a,l,d,c,h,u){const{options:f,getAutomaticKeyboardNavigation:g,disposable:m}=hg(t,r,a,c,h,u);super(e,t,i,n,o,f),this.disposables.add(m),this.internals=new jl(this,r,g,r.overrideStyles,a,l,d,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};ME=zo([Ee(6,we),Ee(7,ns),Ee(8,pt),Ee(9,At),Ee(10,Lt),Ee(11,Hn)],ME);let f1=class extends HR{constructor(e,t,i,n,o,r,a,l,d,c,h,u){const{options:f,getAutomaticKeyboardNavigation:g,disposable:m}=hg(t,r,a,c,h,u);super(e,t,i,n,o,f),this.disposables.add(m),this.internals=new jl(this,r,g,r.overrideStyles,a,l,d,c,u),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};f1=zo([Ee(6,we),Ee(7,ns),Ee(8,pt),Ee(9,At),Ee(10,Lt),Ee(11,Hn)],f1);let TE=class extends m${constructor(e,t,i,n,o,r,a,l,d,c,h,u,f){const{options:g,getAutomaticKeyboardNavigation:m,disposable:b}=hg(t,a,l,h,u,f);super(e,t,i,n,o,r,g),this.disposables.add(b),this.internals=new jl(this,a,m,a.overrideStyles,l,d,c,h,f),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};TE=zo([Ee(7,we),Ee(8,ns),Ee(9,pt),Ee(10,At),Ee(11,Lt),Ee(12,Hn)],TE);function hg(s,e,t,i,n,o){var r;L$.bindTo(t),DE||(x$.bindTo(t),DE=!0);const a=()=>{let g=!!t.getContextKeyValue($x);return g&&(g=!!i.getValue(jx)),g},l=o.isScreenReaderOptimized(),d=e.simpleKeyboardNavigation||l?"simple":i.getValue(M_),c=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(Qn),[h,u]=Yb(e,i,n),f=e.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},h),{indent:i.getValue(T_),renderIndentGuides:i.getValue(A_),smoothScrolling:!!i.getValue(Qs),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:d==="simple",filterOnType:d==="filter",horizontalScrolling:c,keyboardNavigationEventFilter:E$(s,n),additionalScrollHeight:f,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(r=e.expandOnlyOnTwistieClick)!==null&&r!==void 0?r:i.getValue(R_)==="doubleClick"})}}let jl=class{constructor(e,t,i,n,o,r,a,l,d){this.tree=e,this.themeService=a,this.disposables=[],this.contextKeyService=Zb(o,e),this.listSupportsMultiSelect=Kb.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!!t.multipleSelectionSupport),Gb.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.hasSelectionOrFocus=Hx.bindTo(this.contextKeyService),this.hasDoubleSelection=zx.bindTo(this.contextKeyService),this.hasMultiSelection=Ux.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Wo(l);const h=new Set;h.add($x);const u=()=>{const g=d.isScreenReaderOptimized()?"simple":l.getValue(M_);e.updateOptions({simpleKeyboardNavigation:g==="simple",filterOnType:g==="filter"})};this.updateStyleOverrides(n),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const f=e.getSelection(),g=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(f.length>0||g.length>0),this.hasMultiSelection.set(f.length>1),this.hasDoubleSelection.set(f.length===2)})}),e.onDidChangeFocus(()=>{const f=e.getSelection(),g=e.getFocus();this.hasSelectionOrFocus.set(f.length>0||g.length>0)}),l.onDidChangeConfiguration(f=>{let g={};if(f.affectsConfiguration(xd)&&(this._useAltAsMultipleSelectionModifier=Wo(l)),f.affectsConfiguration(T_)){const m=l.getValue(T_);g=Object.assign(Object.assign({},g),{indent:m})}if(f.affectsConfiguration(A_)){const m=l.getValue(A_);g=Object.assign(Object.assign({},g),{renderIndentGuides:m})}if(f.affectsConfiguration(Qs)){const m=!!l.getValue(Qs);g=Object.assign(Object.assign({},g),{smoothScrolling:m})}if(f.affectsConfiguration(M_)&&u(),f.affectsConfiguration(jx)&&(g=Object.assign(Object.assign({},g),{automaticKeyboardNavigation:i()})),f.affectsConfiguration(Qn)&&t.horizontalScrolling===void 0){const m=!!l.getValue(Qn);g=Object.assign(Object.assign({},g),{horizontalScrolling:m})}f.affectsConfiguration(R_)&&t.expandOnlyOnTwistieClick===void 0&&(g=Object.assign(Object.assign({},g),{expandOnlyOnTwistieClick:l.getValue(R_)==="doubleClick"})),Object.keys(g).length>0&&e.updateOptions(g)}),this.contextKeyService.onDidChangeContext(f=>{f.affectsSome(h)&&e.updateOptions({automaticKeyboardNavigation:i()})}),d.onDidChangeScreenReaderOptimized(()=>u())),this.navigator=new I$(e,Object.assign({configurationService:l},t)),this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){$e(this.styler),this.styler=e?$l(this.tree,this.themeService,e):U.None}dispose(){this.disposables=$e(this.disposables),$e(this.styler),this.styler=void 0}};jl=zo([Ee(4,we),Ee(5,ns),Ee(6,pt),Ee(7,At),Ee(8,Hn)],jl);const N$=Ht.as(pd.Configuration);N$.registerConfiguration({id:"workbench",order:7,title:p("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[xd]:{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[p("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),p("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:p({},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[h1]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:p({},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Qn]:{type:"boolean",default:!1,description:p("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[T_]:{type:"number",default:8,minimum:0,maximum:40,description:p("tree indent setting","Controls tree indentation in pixels.")},[A_]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:p("render tree indent guides","Controls whether the tree should render indent guides.")},[Qs]:{type:"boolean",default:!1,description:p("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[M_]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[p("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),p("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),p("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:p("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},[jx]:{type:"boolean",default:!0,markdownDescription:p("automatic keyboard navigation setting","Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.")},[R_]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:p("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")}}});var yt;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(yt||(yt={}));(function(s){function e(r,a){return a-r}s.compare=e;const t=Object.create(null);t[s.Error]=p("sev.error","Error"),t[s.Warning]=p("sev.warning","Warning"),t[s.Info]=p("sev.info","Info");function i(r){return t[r]||""}s.toString=i;function n(r){switch(r){case It.Error:return s.Error;case It.Warning:return s.Warning;case It.Info:return s.Info;case It.Ignore:return s.Hint}}s.fromSeverity=n;function o(r){switch(r){case s.Error:return It.Error;case s.Warning:return It.Warning;case s.Info:return It.Info;case s.Hint:return It.Ignore}}s.toSeverity=o})(yt||(yt={}));var O_;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,o){let r=[e];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(e),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(e),n.severity!==void 0&&n.severity!==null?r.push(yt.toString(n.severity)):r.push(e),n.message&&o?r.push(n.message.replace("¦","\\¦")):r.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(e),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(e),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}s.makeKeyOptionalMessage=i})(O_||(O_={}));const ug=Ze("markerService");class M${constructor(){this._byResource=new Ji,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 o=this._byOwner.get(t);o||(o=new Ji,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){let i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,n=!1,o=this._byResource.get(e);o&&(i=o.delete(t));let r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:Be.empty():he.isUri(e)?(o=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&o!==void 0?o:Be.empty():Be.map(Be.concat(...this._byOwner.values()),r=>r[1])}}class T${constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Ji,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(e.scheme===Oe.inMemory||e.scheme===Oe.walkThrough||e.scheme===Oe.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e}))i===yt.Error?t.errors+=1:i===yt.Warning?t.warnings+=1:i===yt.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 al{constructor(){this._onMarkerChanged=new v4({delay:0,merge:al._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new M$,this._stats=new T$(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(vT(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const r=al._toMarker(e,t,o);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:h,relatedInformation:u,tags:f}=i;if(r)return l=l>0?l:1,d=d>0?d:1,c=c>=l?c:l,h=h>0?h:d,{resource:t,owner:e,code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:h,relatedInformation:u,tags:f}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(al._accept(l,n)){const d=a.push(l);if(o>0&&d===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(let a of this._data.values())for(let l of a)if(al._accept(l,n)){const d=r.push(l);if(o>0&&d===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const d of l)if(al._accept(d,n)){const c=a.push(d);if(o>0&&c===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Ji;for(let i of e)for(let n of i)t.set(n,!0);return Array.from(t.keys())}}var Qp=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},hc;(function(s){s[s.None=0]="None",s[s.Initialized=1]="Initialized",s[s.Closed=2]="Closed"})(hc||(hc={}));class Lf extends U{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new M),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=hc.None,this.cache=new Map,this.flushDelayer=new X4(Lf.DEFAULT_FLUSH_DELAY),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;(t=e.changed)===null||t===void 0||t.forEach((n,o)=>this.accept(o,n)),(i=e.deleted)===null||i===void 0||i.forEach(n=>this.accept(n,void 0))}accept(e,t){if(this.state===hc.Closed)return;let i=!1;qn(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire(e)}get(e,t){const i=this.cache.get(e);return qn(i)?t:i}getBoolean(e,t){const i=this.get(e);return qn(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return qn(i)?t:parseInt(i,10)}set(e,t){return Qp(this,void 0,void 0,function*(){if(this.state===hc.Closed)return;if(qn(t))return this.delete(e);const i=String(t);if(this.cache.get(e)!==i)return this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger(()=>this.flushPending())})}delete(e){return Qp(this,void 0,void 0,function*(){if(!(this.state===hc.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger(()=>this.flushPending())})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return Qp(this,void 0,void 0,function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}dispose(){this.flushDelayer.dispose(),super.dispose()}}Lf.DEFAULT_FLUSH_DELAY=100;class AE{constructor(){this.onDidChangeItemsExternal=re.None,this.items=new Map}updateItems(e){return Qp(this,void 0,void 0,function*(){e.insert&&e.insert.forEach((t,i)=>this.items.set(i,t)),e.delete&&e.delete.forEach(t=>this.items.delete(t))})}}const ep="__$__targetStorageMarker",Or=Ze("storageService");var P_;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(P_||(P_={}));class Xb extends U{constructor(e={flushInterval:Xb.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new mm),this._onDidChangeTarget=this._register(new mm),this._onWillSaveState=this._register(new M),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===ep?(e===0?this._globalKeyTargets=void 0:e===1&&(this._workspaceKeyTargets=void 0),this._onDidChangeTarget.fire({scope:e})):this._onDidChangeValue.fire({scope:e,key:t,target:this.getKeyTargets(e)[t]})}get(e,t,i){var n;return(n=this.getStorage(t))===null||n===void 0?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return(n=this.getStorage(t))===null||n===void 0?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return(n=this.getStorage(t))===null||n===void 0?void 0:n.getNumber(e,i)}store(e,t,i,n){if(qn(t)){this.remove(e,i);return}this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,i,n),(o=this.getStorage(i))===null||o===void 0||o.set(e,t)})}remove(e,t){this.withPausedEmitters(()=>{var i;this.updateKeyTarget(e,t,void 0),(i=this.getStorage(t))===null||i===void 0||i.delete(e)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){var n,o;const r=this.getKeyTargets(t);typeof i=="number"?r[e]!==i&&(r[e]=i,(n=this.getStorage(t))===null||n===void 0||n.set(ep,JSON.stringify(r))):typeof r[e]=="number"&&(delete r[e],(o=this.getStorage(t))===null||o===void 0||o.set(ep,JSON.stringify(r)))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get globalKeyTargets(){return this._globalKeyTargets||(this._globalKeyTargets=this.loadKeyTargets(0)),this._globalKeyTargets}getKeyTargets(e){return e===0?this.globalKeyTargets:this.workspaceKeyTargets}loadKeyTargets(e){const t=this.get(ep,e);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}}Xb.DEFAULT_FLUSH_INTERVAL=60*1e3;class A$ extends Xb{constructor(){super(),this.globalStorage=this._register(new Lf(new AE)),this.workspaceStorage=this._register(new Lf(new AE)),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.globalStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e)))}getStorage(e){return e===0?this.globalStorage:this.workspaceStorage}}var KR=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Jp=function(s,e){return function(t,i){e(t,i,s)}};let g1=class{constructor(e){this._commandService=e}createMenu(e,t,i=!1){return new p1(e,i,this._commandService,t,this)}};g1=KR([Jp(0,Wt)],g1);let p1=class tc{constructor(e,t,i,n,o){this._id=e,this._fireEventsForSubmenuChanges=t,this._commandService=i,this._contextKeyService=n,this._menuService=o,this._disposables=new X,this._menuGroups=[],this._contextKeys=new Set,this._build();const r=new bt(()=>{this._build(),this._onDidChange.fire(this)},50);this._disposables.add(r),this._disposables.add(xs.onDidChangeMenu(d=>{d.has(e)&&r.schedule()}));const a=this._disposables.add(new X),l=()=>{const d=new bt(()=>this._onDidChange.fire(this),50);a.add(d),a.add(n.onDidChangeContext(c=>{c.affectsSome(this._contextKeys)&&d.schedule()}))};this._onDidChange=new M({onFirstListenerAdd:l,onLastListenerRemove:a.clear.bind(a)}),this.onDidChange=this._onDidChange.event}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const e=xs.getMenuItems(this._id);let t;e.sort(tc._compareMenuItems);for(const i of e){const n=i.group||"";(!t||t[0]!==n)&&(t=[n,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(tc._fillInKbExprKeys(e.when,this._contextKeys),ru(e)){if(e.command.precondition&&tc._fillInKbExprKeys(e.command.precondition,this._contextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;tc._fillInKbExprKeys(t,this._contextKeys)}}else this._fireEventsForSubmenuChanges&&xs.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}getActions(e){const t=[];for(let i of this._menuGroups){const[n,o]=i,r=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=ru(a)?new Uc(a.command,a.alt,e,this._contextKeyService,this._commandService):new ML(a,this._menuService,this._contextKeyService,e);r.push(l)}r.length>0&&t.push([n,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(let i of e.keys())t.add(i)}static _compareMenuItems(e,t){let i=e.group,n=t.group;if(i!==n){if(i){if(!n)return-1}else return 1;if(i==="navigation")return-1;if(n==="navigation")return 1;let a=i.localeCompare(n);if(a!==0)return a}let o=e.order||0,r=t.order||0;return o<r?-1:o>r?1:tc._compareTitles(ru(e)?e.command.title:e.title,ru(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,n=typeof t=="string"?t:t.original;return i.localeCompare(n)}};p1=KR([Jp(2,Wt),Jp(3,we),Jp(4,vh)],p1);var R$=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},RE=function(s,e){return function(t,i){e(t,i,s)}};function Gh(s){return s.toString()}class O$ extends U{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(Pe(()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()}))}update(e,t){const i=[...this._markersData.keys()];this._markersData.clear();const n=this.model.deltaDecorations(i,t);for(let o=0;o<n.length;o++)this._markersData.set(n[o],e[o]);return i.length!==0||n.length!==0}getMarker(e){return this._markersData.get(e.id)}}let m1=class extends U{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new M),this._markerDecorations=new Map,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(Gh(e));return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(Gh(t));i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new O$(e);this._markerDecorations.set(Gh(e.uri),t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(Gh(e.uri));t&&(t.dispose(),this._markerDecorations.delete(Gh(e.uri))),(e.uri.scheme===Oe.inMemory||e.uri.scheme===Oe.internal||e.uri.scheme===Oe.vscode)&&this._markerService&&this._markerService.read({resource:e.uri}).map(i=>i.owner).forEach(i=>this._markerService.remove(i,[e.uri]))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});let i=t.map(n=>({range:this._createDecorationRange(e.model,n),options:this._createDecorationOption(n)}));e.update(t,i)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let i=L.lift(t);if(t.severity===yt.Hint&&!this._hasMarkerTag(t,1)&&!this._hasMarkerTag(t,2)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){let n=e.getWordAtPosition(i.getStartPosition());if(n)i=new L(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn);else{let o=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);o===1||(i.endColumn>=o?i=new L(i.startLineNumber,o-1,i.endLineNumber,o):i=new L(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn+1))}}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){let n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new L(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,o,r;switch(e.severity){case yt.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",n=0;break;case yt.Warning:t="squiggly-warning",i=en(d6),n=20,r={color:en(B8),position:ba.Inline};break;case yt.Info:t="squiggly-info",i=en(c6),n=10;break;case yt.Error:default:t="squiggly-error",i=en(l6),n=30,r={color:en(F8),position:ba.Inline};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(o="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:Pn.Right},minimap:r,zIndex:n,inlineClassName:o}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}};m1=R$([RE(0,Vt),RE(1,ug)],m1);var P$=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},OE=function(s,e){return function(t,i){e(t,i,s)}};let _1=class extends U{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new M,this._accessibilityModeEnabledContext=rg.bindTo(this._contextKeyService);const i=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(n=>{n.affectsConfiguration("editor.accessibilitySupport")&&(i(),this._onDidChangeScreenReaderOptimized.fire())})),i(),this.onDidChangeScreenReaderOptimized(()=>i())}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}getAccessibilitySupport(){return this._accessibilitySupport}};_1=P$([OE(0,we),OE(1,At)],_1);var tp=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class F${constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return tp(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,n=document.body.appendChild(Y("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(n)})}readText(e){return tp(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return tp(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return tp(this,void 0,void 0,function*(){this.findText=e})}}var B$=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},PE=function(s,e){return function(t,i){e(t,i,s)}},ip=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function np(s){return s.scheme===Oe.file?s.fsPath:s.path}let GR=0;class sp{constructor(e,t,i,n,o,r,a){this.id=++GR,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class FE{constructor(e,t){this.resourceLabel=e,this.reason=t}}class BE{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(n.reason===0?e:t).push(n.resourceLabel);let i=[];return e.length>0&&i.push(p({},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(p({},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(`
`)}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 W${constructor(e,t,i,n,o,r,a){this.id=++GR,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=o,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 BE),this.removedResources.has(t)||this.removedResources.set(t,new FE(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 BE),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new FE(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class ZR{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(){let 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 dR(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const d=this._past[a];i&&(n>=t||d.id!==e.elements[n])&&(i=!1,o=0),!i&&d.type===1&&d.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)}o!==-1&&(this._past=this._past.slice(0,o)),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 sC{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 YR=new ZR("","");YR.locked=!0;let F_=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}: `);let t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(`
`))}pushElement(e,t=Zc.None,i=wo.None){if(e.type===0){const n=np(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new sp(e,n,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,o=[],r=[];for(const a of e.resources){const l=np(a),d=this.getUriComparisonKey(a);n.has(d)||(n.add(d),o.push(l),r.push(d))}o.length===1?this._pushElement(new sp(e,o[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new W$(e,o,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],o=e.strResources[t];let r;this._editStacks.has(o)?r=this._editStacks.get(o):(r=new ZR(n,o),this._editStacks.set(o,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 o of i){const r=np(o.resource),a=this.getUriComparisonKey(o.resource),l=new sp(o,r,a,0,0,0,0);n.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const o of i){const r=np(o.resource),a=this.getUriComparisonKey(o.resource),l=new sp(o,r,a,0,0,0,0);n.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).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 dR(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,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof wo){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){ve(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,o){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(),o()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),o())}_invokeWorkspacePrepare(e){return ip(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return U.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?U.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(U.None);const i=e.actual.prepareUndoRedo();return i?Vy(i)?t(i):i.then(n=>t(n)):t(U.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||YR);return new sC(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new op(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new op}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,p({},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,p({},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,p({},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,p({},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,p({},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const n=t.getSecondClosestPastElement();if(n&&n.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,n){return ip(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const a=yield this._dialogService.show(It.Info,p("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),[p({},"Undo in {0} Files",i.editStacks.length),p("nok","Undo this File"),p("cancel","Cancel")],{cancelId:2});if(a.choice===2)return;if(a.choice===1)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const l=this._checkWorkspaceUndo(e,t,i,!1);if(l)return l.returnValue;n=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,n))})}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=p({},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new sC([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof wo){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),o=n.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return ip(this,void 0,void 0,function*(){if((yield this._dialogService.show(It.Info,p("confirmDifferentSource","Would you like to undo '{0}'?",i.label),[p("confirmDifferentSource.yes","Yes"),p("cancel","Cancel")],{cancelId:1})).choice!==1)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder<t.sourceOrder)&&(t=r,i=n)}return[t,i]}canRedo(e){if(e instanceof wo){const[,i]=this._findClosestRedoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasFutureElements():!1}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new op(this._redo(e));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new op}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,p({},"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,p({},"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestFutureElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,p({},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,p({},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,p({},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return ip(this,void 0,void 0,function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=p({},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new sC([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrder<t.groupOrder)&&(t=r,i=n)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);if(t)return this._redo(t)}redo(e){if(e instanceof wo){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return typeof e=="string"?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[n,o]=this._findClosestRedoElementInGroup(i.groupId);if(i!==n&&o)return this._redo(o)}try{return i.type===1?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};F_=B$([PE(0,ag),PE(1,Qt)],F_);class op{constructor(e){this.returnValue=e}}vd(Bb,F_);const V$={ctrlCmd:!1,alt:!1};var xf;(function(s){s[s.Blur=1]="Blur",s[s.Gesture=2]="Gesture",s[s.Other=3]="Other"})(xf||(xf={}));var Os;(function(s){s[s.NONE=0]="NONE",s[s.FIRST=1]="FIRST",s[s.SECOND=2]="SECOND",s[s.LAST=3]="LAST"})(Os||(Os={}));const WE=new _c(()=>{const s=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:s,collatorIsNumeric:s.resolvedOptions().numeric}});function H$(s,e,t=!1){const i=s||"",n=e||"",o=WE.value.collator.compare(i,n);return WE.value.collatorIsNumeric&&o===0&&i!==n?i<n?-1:1:o}function z$(s,e,t){const i=s.toLowerCase(),n=e.toLowerCase(),o=U$(s,e,t);if(o)return o;const r=i.endsWith(t),a=n.endsWith(t);if(r!==a)return r?-1:1;const l=H$(i,n);return l!==0?l:i.localeCompare(n)}function U$(s,e,t){const i=s.toLowerCase(),n=e.toLowerCase(),o=i.startsWith(t),r=n.startsWith(t);if(o!==r)return o?-1:1;if(o&&r){if(i.length<n.length)return-1;if(i.length>n.length)return 1}return 0}const $$=new RegExp(`(\\\\)?\\$\\((${mn.iconNameExpression}(?:${mn.iconModifierExpression})?)\\)`,"g");function kl(s){const e=new Array;let t,i=0,n=0;for(;(t=$$.exec(s))!==null;){n=t.index||0,e.push(s.substring(i,n)),i=(t.index||0)+t[0].length;const[,o,r]=t;e.push(o?`$(${r})`:j$({id:r}))}return i<s.length&&e.push(s.substring(i)),e}function j$(s){const e=Y("span");return e.classList.add(...mn.asClassNameArray(s)),e}class Da{constructor(e,t){this.supportIcons=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=document.createElement("span"),this.domNode.className="monaco-highlighted-label",e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=Da.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&br(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t<i.start){const r=this.text.substring(t,i.start);e.push(Y("span",void 0,...this.supportIcons?kl(r):[r])),t=i.end}const n=this.text.substring(i.start,i.end),o=Y("span.highlight",void 0,...this.supportIcons?kl(n):[n]);i.extraClasses&&o.classList.add(i.extraClasses),e.push(o),t=i.end}if(t<this.text.length){const i=this.text.substring(t);e.push(Y("span",void 0,...this.supportIcons?kl(i):[i]))}ma(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let i=0,n=0;return e.replace(/\r\n|\r|\n/g,(o,r)=>{n=o===`\r
`?-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,"⏎"})}}var b1=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function q$(s,e){es(e)?s.title=e:e!=null&&e.markdownNotSupportedFallback?s.title=e.markdownNotSupportedFallback:s.removeAttribute("title")}function K$(s,e,t){if(!t)return;const i=G$(t);let n,o;const r=l=>{if(n)return;const d=new on,c=v=>{const _=v.type===le.MOUSE_DOWN;_&&(o==null||o.dispose(),o=void 0),(_||v.fromElement===e)&&(n==null||n.dispose(),n=void 0)},h=K(e,le.MOUSE_LEAVE,c,!0),u=K(e,le.MOUSE_DOWN,c,!0),f={targetElements:[e],dispose:()=>{}};let g;if(s.placement===void 0||s.placement==="mouse"){const v=_=>f.x=_.x+10;g=K(e,le.MOUSE_MOVE,v,!0)}const m=()=>b1(this,void 0,void 0,function*(){var v;if(n){const _={text:p("iconLabel.loading","Loading..."),target:f,hoverPosition:2};o==null||o.dispose(),o=s.showHover(_);const w=(v=yield i(d.token))!==null&&v!==void 0?v:es(t)?void 0:t.markdownNotSupportedFallback;if(o==null||o.dispose(),o=void 0,w&&n){const C={text:w,target:f,showPointer:s.placement==="element",hoverPosition:2};o=s.showHover(C)}}g==null||g.dispose()}),b=new bt(m,s.delay);b.schedule(),n=Pe(()=>{b.dispose(),g==null||g.dispose(),u.dispose(),h.dispose(),d.dispose(!0)})},a=K(e,le.MOUSE_OVER,r,!0);return Pe(()=>{a.dispose(),n==null||n.dispose(),o==null||o.dispose()})}function G$(s){if(es(s))return()=>b1(this,void 0,void 0,function*(){return s});if(bu(s.markdown))return s.markdown;{const e=s.markdown;return()=>b1(this,void 0,void 0,function*(){return e})}}class oC{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class Kx extends U{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new oC($(e,Y(".monaco-icon-label")))),this.labelContainer=$(this.domNode.element,Y(".monaco-icon-label-container"));const i=$(this.labelContainer,Y("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new oC($(this.labelContainer,Y("span.monaco-icon-description-container")))),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new X$(i,!!t.supportIcons):this.nameNode=new Z$(i),t!=null&&t.supportDescriptionHighlights?this.descriptionNodeFactory=()=>new Da($(this.descriptionContainer.element,Y("span.label-description")),!!t.supportIcons):this.descriptionNodeFactory=()=>this._register(new oC($(this.descriptionContainer.element,Y("span.label-description")))),this.hoverDelegate=t==null?void 0:t.hoverDelegate}setLabel(e,t,i){const n=["monaco-icon-label"];i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough")),this.domNode.className=n.join(" "),this.setupHover(this.labelContainer,i==null?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof Da?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,i==null?void 0:i.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(i==null?void 0:i.descriptionTitle)||""),this.descriptionNode.empty=!t))}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)q$(e,t);else{const n=K$(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}}class Z${constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&br(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=$(this.container,Y("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const n=e[i],o=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${i}`;$(this.container,Y("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&$(this.container,Y("span.label-separator",void 0,(t==null?void 0:t.separator)||"/"))}}}}function Y$(s,e,t){if(!t)return;let i=0;return s.map(n=>{const o={start:i,end:i+n.length},r=t.map(a=>Mi.intersect(o,a)).filter(a=>!Mi.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class X${constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&br(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Da($(this.container,Y("a.label-name",{id:t==null?void 0:t.domId})),this.supportIcons)),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",n=Y$(e,i,t==null?void 0:t.matches);for(let o=0;o<e.length;o++){const r=e[o],a=n?n[o]:void 0,l=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${o}`,d=Y("a.label-name",{id:l,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new Da($(this.container,d),this.supportIcons).set(r,a,void 0,t==null?void 0:t.labelEscapeNewLines),o<e.length-1&&$(d,Y("span.label-separator",void 0,i))}}}}class Gx{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const XR=new Gx("id#"),rC={},Q$=new Gx("quick-input-button-icon-");function v1(s){if(!s)return;let e;const t=s.dark.toString();return rC[t]?e=rC[t]:(e=Q$.nextId(),Z0(`.${e}`,`background-image: ${xr(s.light||s.dark)}`),Z0(`.vs-dark .${e}, .hc-black .${e}`,`background-image: ${xr(s.dark)}`),rC[t]=e),e}const rp=Y;class Zx{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null),this.labelBackground=this.options.keybindingLabelBackground,this.labelForeground=this.options.keybindingLabelForeground,this.labelBorder=this.options.keybindingLabelBorder,this.labelBottomBorder=this.options.keybindingLabelBottomBorder,this.labelShadow=this.options.keybindingLabelShadow,this.domNode=$(e,rp(".monaco-keybinding")),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&Zx.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){let[e,t]=this.keybinding.getParts();e&&this.renderPart(this.domNode,e,this.matches?this.matches.firstPart:null),t&&($(this.domNode,rp("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderPart(this.domNode,t,this.matches?this.matches.chordPart:null)),this.domNode.title=this.keybinding.getAriaLabel()||""}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.applyStyles(),this.didEverRender=!0}clear(){hi(this.domNode),this.keyElements.clear()}renderPart(e,t,i){const n=DL.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,!!(i!=null&&i.ctrlKey),n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,!!(i!=null&&i.shiftKey),n.separator),t.altKey&&this.renderKey(e,n.altKey,!!(i!=null&&i.altKey),n.separator),t.metaKey&&this.renderKey(e,n.metaKey,!!(i!=null&&i.metaKey),n.separator);const o=t.keyLabel;o&&this.renderKey(e,o,!!(i!=null&&i.keyCode),"")}renderKey(e,t,i,n){$(e,this.createKeyElement(t,i?".highlight":"")),n&&$(e,rp("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){$(e,this.createKeyElement(p("unbound","Unbound")))}createKeyElement(e,t=""){const i=rp("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),i}style(e){this.labelBackground=e.keybindingLabelBackground,this.labelForeground=e.keybindingLabelForeground,this.labelBorder=e.keybindingLabelBorder,this.labelBottomBorder=e.keybindingLabelBottomBorder,this.labelShadow=e.keybindingLabelShadow,this.applyStyles()}applyStyles(){var e;if(this.element){for(const t of this.keyElements)this.labelBackground&&(t.style.backgroundColor=(e=this.labelBackground)===null||e===void 0?void 0:e.toString()),this.labelBorder&&(t.style.borderColor=this.labelBorder.toString()),this.labelBottomBorder&&(t.style.borderBottomColor=this.labelBottomBorder.toString()),this.labelShadow&&(t.style.boxShadow=`inset 0 -1px 0 ${this.labelShadow}`);this.labelForeground&&(this.element.style.color=this.labelForeground.toString())}}static areSame(e,t){return e===t||!e&&!t?!0:!!e&&!!t&&br(e.firstPart,t.firstPart)&&br(e.chordPart,t.chordPart)}}var QR=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},J$=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const uo=Y;class ej{constructor(e){this.hidden=!1,this._onChecked=new M,this.onChecked=this._onChecked.event,Object.assign(this,e)}get checked(){return!!this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire(e))}dispose(){this._onChecked.dispose()}}class fg{get templateId(){return fg.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=$(e,uo(".quick-input-list-entry"));const i=$(t.entry,uo("label.quick-input-list-label"));t.toDisposeTemplate.push(Gt(i,le.CLICK,d=>{t.checkbox.offsetParent||d.preventDefault()})),t.checkbox=$(i,uo("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Gt(t.checkbox,le.CHANGE,d=>{t.element.checked=t.checkbox.checked}));const n=$(i,uo(".quick-input-list-rows")),o=$(n,uo(".quick-input-list-row")),r=$(n,uo(".quick-input-list-row"));t.label=new Kx(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const a=$(o,uo(".quick-input-list-entry-keybinding"));t.keybinding=new Zx(a,ps);const l=$(r,uo(".quick-input-list-label-meta"));return t.detail=new Da(l,!0),t.separator=$(t.entry,uo(".quick-input-list-separator")),t.actionBar=new Nr(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){i.toDisposeElement=$e(i.toDisposeElement),i.element=e,i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(d=>i.checkbox.checked=d));const{labelHighlights:n,descriptionHighlights:o,detailHighlights:r}=e,a=Object.create(null);a.matches=n||[],a.descriptionTitle=e.saneDescription,a.descriptionMatches=o||[],a.extraClasses=e.item.iconClasses,a.italic=e.item.italic,a.strikethrough=e.item.strikethrough,i.label.setLabel(e.saneLabel,e.saneDescription,a),i.keybinding.set(e.item.keybinding),i.detail.set(e.saneDetail,r),e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator),i.actionBar.clear();const l=e.item.buttons;l&&l.length?(i.actionBar.push(l.map((d,c)=>{let h=d.iconClass||(d.iconPath?v1(d.iconPath):void 0);d.alwaysVisible&&(h=h?`${h} always-visible`:"always-visible");const u=new ys(`id-${c}`,"",h,!0,()=>J$(this,void 0,void 0,function*(){e.fireButtonTriggered({button:d,item:e.item})}));return u.tooltip=d.tooltip||"",u}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=$e(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=$e(e.toDisposeElement),e.toDisposeTemplate=$e(e.toDisposeTemplate)}}fg.ID="listelement";class tj{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return fg.ID}}var Pt;(function(s){s[s.First=1]="First",s[s.Second=2]="Second",s[s.Last=3]="Last",s[s.Next=4]="Next",s[s.Previous=5]="Previous",s[s.NextPage=6]="NextPage",s[s.PreviousPage=7]="PreviousPage"})(Pt||(Pt={}));class Yx{constructor(e,t,i){this.parent=e,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnMeta=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new M,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new M,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new M,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new M,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new M,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new M,this.onKeyDown=this._onKeyDown.event,this._onLeave=new M,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=$(this.parent,uo(".quick-input-list"));const n=new tj,o=new nj;this.list=i.createList("QuickInput",this.container,n,[new fg],{identityProvider:{getId:r=>r.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(r=>{const a=new Mt(r);switch(a.keyCode){case 10:this.toggleCheckbox();break;case 31:(Re?r.metaKey:r.ctrlKey)&&this.list.setFocus(zi(this.list.length));break;case 16:const l=this.list.getFocus();l.length===1&&l[0]===0&&this._onLeave.fire();break;case 18:const d=this.list.getFocus();d.length===1&&d[0]===this.list.length-1&&this._onLeave.fire();break}this._onKeyDown.fire(a)})),this.disposables.push(this.list.onMouseDown(r=>{r.browserEvent.button!==2&&r.browserEvent.preventDefault()})),this.disposables.push(K(this.container,le.CLICK,r=>{(r.x||r.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(r=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(r=>{typeof r.index=="number"&&(r.browserEvent.preventDefault(),this.list.setSelection([r.index]))})),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return re.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return re.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i<n;i++){const o=e[i];if(!o.hidden)if(o.checked)t=!0;else return!1}return t}getCheckedCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].checked&&e++;return e}getVisibleCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].hidden||e++;return e}setAllVisibleChecked(e){try{this._fireCheckedEvents=!1,this.elements.forEach(t=>{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=$e(this.elementDisposables);const t=i=>this.fireButtonTriggered(i);this.inputElements=e,this.elements=e.reduce((i,n,o)=>{var r,a,l;if(n.type!=="separator"){const d=o&&e[o-1],c=n.label&&n.label.replace(/\r?\n/g," "),h=n.meta&&n.meta.replace(/\r?\n/g," "),u=n.description&&n.description.replace(/\r?\n/g," "),f=n.detail&&n.detail.replace(/\r?\n/g," "),g=n.ariaLabel||[c,u,f].map(m=>T3(m)).filter(m=>!!m).join(", ");i.push(new ej({index:o,item:n,saneLabel:c,saneMeta:h,saneAriaLabel:g,saneDescription:u,saneDetail:f,labelHighlights:(r=n.highlights)===null||r===void 0?void 0:r.label,descriptionHighlights:(a=n.highlights)===null||a===void 0?void 0:a.description,detailHighlights:(l=n.highlights)===null||l===void 0?void 0:l.detail,checked:!1,separator:d&&d.type==="separator"?d:void 0,fireButtonTriggered:t}))}return i},[]),this.elementDisposables.push(...this.elements),this.elementDisposables.push(...this.elements.map(i=>i.onChecked(()=>this.fireCheckedEvents()))),this.elementsToIndexes=this.elements.reduce((i,n,o)=>(i.set(n.item,o),i),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this.elements)i.checked=t.has(i.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Pt.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=Pt.First),e===Pt.Previous&&this.list.getFocus()[0]===0&&(e=Pt.Last),e===Pt.Second&&this.list.length<2&&(e=Pt.First),e){case Pt.First:this.list.focusFirst();break;case Pt.Second:this.list.focusNth(1);break;case Pt.Last:this.list.focusLast();break;case Pt.Next:this.list.focusNext();break;case Pt.Previous:this.list.focusPrevious();break;case Pt.NextPage:this.list.focusNextPage();break;case Pt.PreviousPage:this.list.focusPreviousPage();break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${Math.floor(e/44)*44}px)`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(i=>{i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!1;const n=i.index&&this.inputElements[i.index-1];i.separator=n&&n.type==="separator"?n:void 0});else{let i;this.elements.forEach(n=>{const o=this.matchOnLabel?Tn(Jg(e,Qg(n.saneLabel))):void 0,r=this.matchOnDescription?Tn(Jg(e,Qg(n.saneDescription||""))):void 0,a=this.matchOnDetail?Tn(Jg(e,Qg(n.saneDetail||""))):void 0,l=this.matchOnMeta?Tn(Jg(e,Qg(n.saneMeta||""))):void 0;if(o||r||a||l?(n.labelHighlights=o,n.descriptionHighlights=r,n.detailHighlights=a,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item.alwaysShow),n.separator=void 0,!this.sortByLabel){const d=n.index&&this.inputElements[n.index-1];i=d&&d.type==="separator"?d:i,i&&!n.hidden&&(n.separator=i,i=void 0)}})}const t=this.elements.filter(i=>!i.hidden);if(this.sortByLabel&&e){const i=e.toLowerCase();t.sort((n,o)=>ij(n,o,i))}return this.elementsToIndexes=t.reduce((i,n,o)=>(i.set(n.item,o),i),new Map),this.list.splice(0,this.list.length,t),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(t.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=$e(this.elementDisposables),this.disposables=$e(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}style(e){this.list.style(e)}}QR([Zt],Yx.prototype,"onDidChangeFocus",null);QR([Zt],Yx.prototype,"onDidChangeSelection",null);function ij(s,e,t){const i=s.labelHighlights||[],n=e.labelHighlights||[];return i.length&&!n.length?-1:!i.length&&n.length?1:i.length===0&&n.length===0?0:z$(s.saneLabel,e.saneLabel,t)}class nj{getWidgetAriaLabel(){return p("quickInput","Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}function sj(s,e={}){const t=Xx(e);return t.textContent=s,t}function JR(s,e={}){const t=Xx(e);return e2(t,rj(s,!!e.renderCodeSegements),e.actionHandler,e.renderCodeSegements),t}function Xx(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class oj{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function e2(s,e,t,i){let n;if(e.type===2)n=document.createTextNode(e.content||"");else if(e.type===3)n=document.createElement("b");else if(e.type===4)n=document.createElement("i");else if(e.type===7&&i)n=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");o.href="#",t.disposeables.add(Gt(o,"click",r=>{t.callback(String(e.index),r)})),n=o}else e.type===8?n=document.createElement("br"):e.type===1&&(n=s);n&&s!==n&&s.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(o=>{e2(n,o,t,i)})}function rj(s,e){const t={type:1,children:[]};let i=0,n=t;const o=[],r=new oj(s);for(;!r.eos();){let a=r.next();const l=a==="\\"&&w1(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&aj(a,e)&&a===r.peek()){r.advance(),n.type===2&&(n=o.pop());const d=w1(a,e);if(n.type===d||n.type===5&&d===6)n=o.pop();else{const c={type:d,children:[]};d===5&&(c.index=i,i++),n.children.push(c),o.push(n),n=c}}else if(a===`
`)n.type===2&&(n=o.pop()),n.children.push({type:8});else if(n.type!==2){const d={type:2,content:a};n.children.push(d),o.push(n),n=d}else n.content+=a}return n.type===2&&(n=o.pop()),t}function aj(s,e){return w1(s,e)!==0}function w1(s,e){switch(s){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}class lj{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 dj{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new lj(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const Zh=Y,cj={inputBackground:B.fromHex("#3C3C3C"),inputForeground:B.fromHex("#CCCCCC"),inputValidationInfoBorder:B.fromHex("#55AAFF"),inputValidationInfoBackground:B.fromHex("#063B49"),inputValidationWarningBorder:B.fromHex("#B89500"),inputValidationWarningBackground:B.fromHex("#352A05"),inputValidationErrorBorder:B.fromHex("#BE1100"),inputValidationErrorBackground:B.fromHex("#5A1D1D")};class t2 extends Vn{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new M),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new M),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),eo(this.options,cj,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(n=this.options.tooltip)!==null&&n!==void 0?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=$(e,Zh(".monaco-inputbox.idle"));let o=this.options.flexibleHeight?"textarea":"input",r=$(this.element,Zh(".ibwrapper"));if(this.input=$(r,Zh(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=$(r,Zh("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new ox(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),$(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(d=>this.input.scrollTop=d.scrollTop));const a=this._register(new ht(document,"selectionchange")),l=re.filter(a.event,()=>{const d=document.getSelection();return(d==null?void 0:d.anchorNode)===r});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this.ignoreGesture(this.input),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Nr(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:G0(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}get width(){return cs(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const i=parseFloat(this.mirror.style.paddingLeft||"")||0,n=parseFloat(this.mirror.style.paddingRight||"")||0;t=i+n}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.options.flexibleHeight&&this.options.flexibleWidth?this.input.style.width=`calc(100% - ${e}px)`:this.input.style.paddingRight=e+"px",this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=i.border?`1px solid ${i.border}`:"",(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t=()=>e.style.width=cs(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:n=>{if(!this.message)return null;e=$(n,Zh(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?JR(this.message.content,o):sj(this.message.content,o);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=a.background?a.background.toString():"",r.style.color=a.foreground?a.foreground.toString():"",r.style.border=a.border?`1px solid ${a.border}`:"",$(e,r),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=p("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=p("alertWarningMessage","Warning: {0}",this.message.content):i=p("alertInfoMessage","Info: {0}",this.message.content),wi(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";e+i?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}style(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){const e=this.inputBackground?this.inputBackground.toString():"",t=this.inputForeground?this.inputForeground.toString():"",i=this.inputBorder?this.inputBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor="inherit",this.input.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=G0(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;i!==null&&n!==null&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar&&this.actionbar.dispose(),super.dispose()}}class i2 extends t2{constructor(e,t,i){super(e,t,i),this.history=new dj(i.history,100)}addToHistory(){this.value&&this.value!==this.getCurrentValue()&&this.history.add(this.value)}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,Xm(this.value))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Xm(this.value))}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()||this.history.last()}}const hj=Y;class uj extends U{constructor(e){super(),this.parent=e,this.onKeyDown=t=>K(this.inputBox.inputElement,le.KEY_DOWN,i=>{t(new Mt(i))}),this.onMouseDown=t=>K(this.inputBox.inputElement,le.MOUSE_DOWN,i=>{t(new Zn(i))}),this.onDidChange=t=>this.inputBox.onDidChange(t),this.container=$(this.parent,hj(".quick-input-box")),this.inputBox=this._register(new t2(this.container,void 0))}get value(){return this.inputBox.value}set value(e){this.inputBox.value=e}select(e=null){this.inputBox.select(e)}isSelectionAtEnd(){return this.inputBox.isSelectionAtEnd()}get placeholder(){return this.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.inputBox.getAriaLabel()}set ariaLabel(e){this.inputBox.setAriaLabel(e)}get password(){return this.inputBox.inputElement.type==="password"}set password(e){this.inputBox.inputElement.type=e?"password":"text"}setAttribute(e,t){this.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===It.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===It.Info?1:e===It.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===It.Info?1:e===It.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}const fj={badgeBackground:B.fromHex("#4D4D4D"),badgeForeground:B.fromHex("#FFFFFF")};class C1{constructor(e,t){this.count=0,this.options=t||Object.create(null),eo(this.options,fj,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=$(e,Y(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=Ai(this.countFormat,this.count),this.element.title=Ai(this.titleFormat,this.count),this.applyStyles()}style(e){this.badgeBackground=e.badgeBackground,this.badgeForeground=e.badgeForeground,this.badgeBorder=e.badgeBorder,this.applyStyles()}applyStyles(){if(this.element){const e=this.badgeBackground?this.badgeBackground.toString():"",t=this.badgeForeground?this.badgeForeground.toString():"",i=this.badgeBorder?this.badgeBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}}}const VE="done",HE="active",aC="infinite",zE="discrete",gj={progressBarBackground:B.fromHex("#0E70C0")};class pj extends U{constructor(e,t){super(),this.options=t||Object.create(null),eo(this.options,gj,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this._register(this.showDelayedScheduler=new bt(()=>En(this.element),0)),this.create(e)}create(e){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.element.appendChild(this.bit),this.applyStyles()}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(HE,aC,zE),this.workedVal=0,this.totalWork=void 0}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(VE),this.element.classList.contains(aC)?(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(zE,VE),this.element.classList.add(HE,aC),this}getContainer(){return this.element}style(e){this.progressBarBackground=e.progressBarBackground,this.applyStyles()}applyStyles(){if(this.bit){const e=this.progressBarBackground?this.progressBarBackground.toString():"";this.bit.style.backgroundColor=e}}}const mj={buttonBackground:B.fromHex("#0E639C"),buttonHoverBackground:B.fromHex("#006BB3"),buttonForeground:B.white};class UE extends U{constructor(e,t){super(),this._onDidClick=this._register(new M),this.options=t||Object.create(null),eo(this.options,mj,!1),this.buttonForeground=this.options.buttonForeground,this.buttonBackground=this.options.buttonBackground,this.buttonHoverBackground=this.options.buttonHoverBackground,this.buttonSecondaryForeground=this.options.buttonSecondaryForeground,this.buttonSecondaryBackground=this.options.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=this.options.buttonSecondaryHoverBackground,this.buttonBorder=this.options.buttonBorder,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),e.appendChild(this._element),this._register(ot.addTarget(this._element)),[le.CLICK,vt.Tap].forEach(i=>{this._register(K(this._element,i,n=>{if(!this.enabled){et.stop(n);return}this._onDidClick.fire(n)}))}),this._register(K(this._element,le.KEY_DOWN,i=>{const n=new Mt(i);let o=!1;this.enabled&&(n.equals(3)||n.equals(10))?(this._onDidClick.fire(i),o=!0):n.equals(9)&&(this._element.blur(),o=!0),o&&et.stop(n,!0)})),this._register(K(this._element,le.MOUSE_OVER,i=>{this._element.classList.contains("disabled")||this.setHoverBackground()})),this._register(K(this._element,le.MOUSE_OUT,i=>{this.applyStyles()})),this.focusTracker=this._register(Fc(this._element)),this._register(this.focusTracker.onDidFocus(()=>this.setHoverBackground())),this._register(this.focusTracker.onDidBlur(()=>this.applyStyles())),this.applyStyles()}get onDidClick(){return this._onDidClick.event}setHoverBackground(){let e;this.options.secondary?e=this.buttonSecondaryHoverBackground?this.buttonSecondaryHoverBackground.toString():null:e=this.buttonHoverBackground?this.buttonHoverBackground.toString():null,e&&(this._element.style.backgroundColor=e)}style(e){this.buttonForeground=e.buttonForeground,this.buttonBackground=e.buttonBackground,this.buttonHoverBackground=e.buttonHoverBackground,this.buttonSecondaryForeground=e.buttonSecondaryForeground,this.buttonSecondaryBackground=e.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=e.buttonSecondaryHoverBackground,this.buttonBorder=e.buttonBorder,this.applyStyles()}applyStyles(){if(this._element){let e,t;this.options.secondary?(t=this.buttonSecondaryForeground?this.buttonSecondaryForeground.toString():"",e=this.buttonSecondaryBackground?this.buttonSecondaryBackground.toString():""):(t=this.buttonForeground?this.buttonForeground.toString():"",e=this.buttonBackground?this.buttonBackground.toString():"");const i=this.buttonBorder?this.buttonBorder.toString():"";this._element.style.color=t,this._element.style.backgroundColor=e,this._element.style.borderWidth=i?"1px":"",this._element.style.borderStyle=i?"solid":"",this._element.style.borderColor=i}}get element(){return this._element}set label(e){this._element.classList.add("monaco-text-button"),this.options.supportIcons?ma(this._element,...kl(e)):this._element.textContent=e,typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=e)}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}var $E=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Ln=Y,_j=Ns("quick-input-back",te.arrowLeft),S1={iconClass:_j.classNames,tooltip:p("quickInput.back","Back")};class Qb extends U{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.noValidationMessage=Qb.noPromptMessage,this._severity=It.Ignore,this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new M),this.onDidHideEmitter=this._register(new M),this.onDisposeEmitter=this._register(new M),this.visibleDisposables=this._register(new X),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!To;this._ignoreFocusOut=e&&!To,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=xf.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!=="&nbsp;"&&(this.ui.title.innerText=" ;");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this.busy&&!this.busyDelay&&(this.busyDelay=new an,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const n=this.buttons.filter(r=>r===S1);this.ui.leftActionBar.push(n.map((r,a)=>{const l=new ys(`id-${a}`,"",r.iconClass||v1(r.iconPath),!0,()=>$E(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(r)}));return l.tooltip=r.tooltip||"",l}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this.buttons.filter(r=>r!==S1);this.ui.rightActionBar.push(o.map((r,a)=>{const l=new ys(`id-${a}`,"",r.iconClass||v1(r.iconPath),!0,()=>$E(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(r)}));return l.tooltip=r.tooltip||"",l}),{icon:!0,label:!1})}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,ma(this.ui.message,...kl(i))),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?p("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==It.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.paddingBottom="4px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.paddingBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}Qb.noPromptMessage=p("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class Df extends Qb{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new M),this.onWillAcceptEmitter=this._register(new M),this.onDidAcceptEmitter=this._register(new M),this.onDidCustomEmitter=this._register(new M),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._sortByLabel=!0,this._autoFocusOnList=!0,this._itemActivation=this.ui.isScreenReaderOptimized()?Os.NONE:Os.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new M),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new M),this.onDidTriggerItemButtonEmitter=this._register(new M),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this._value!==e&&(this._value=e||"",this.update(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?V$:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(Pt.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{if(e===this.value)return;this._value=e,this.ui.list.filter(this.filterValue(this.ui.inputBox.value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(e)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(Pt.Next),this.canSelectMany&&this.ui.list.domFocus(),et.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Pt.Previous):this.ui.list.focus(Pt.Last),this.canSelectMany&&this.ui.list.domFocus(),et.stop(e,!0);break;case 12:this.ui.list.focus(Pt.NextPage),this.canSelectMany&&this.ui.list.domFocus(),et.stop(e,!0);break;case 11:this.ui.list.focus(Pt.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),et.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Pt.First),et.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Pt.Last),et.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{!this.canSelectMany&&this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ss(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Ss(e,this._selectedItems,(i,n)=>i===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ss(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return K(this.ui.container,le.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Mt(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const[a,l]=r.getParts();return l?!1:a.shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a.altKey&&i===6||a.ctrlKey&&i===5||a.metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=!!this._hideInput&&this._items.length>0;this.ui.container.classList.toggle("hidden-input",e&&!this.description);const t={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!e,progressBar:!e,visibleCount:!0,count:this.canSelectMany,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(t),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");const i=this.ariaLabel||this.placeholder||Df.DEFAULT_ARIA_LABEL;if(this.ui.inputBox.ariaLabel!==i&&(this.ui.inputBox.ariaLabel=i),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case Os.NONE:this._itemActivation=Os.FIRST;break;case Os.SECOND:this.ui.list.focus(Pt.Second),this._itemActivation=Os.FIRST;break;case Os.LAST:this.ui.list.focus(Pt.Last),this._itemActivation=Os.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),t.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Pt.First))}}Df.DEFAULT_ARIA_LABEL=p("quickInputBox.ariaLabel","Type to narrow down results.");class Jb extends U{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new M),this.onDidCustomEmitter=this._register(new M),this.onDidTriggerButtonEmitter=this._register(new M),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new M),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new M),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(K(window,le.KEY_DOWN,e,!0)),this._register(K(window,le.KEY_UP,e,!0)),this._register(K(window,le.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=$(this.parentElement,Ln(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=On(e),i=$(e,Ln(".quick-input-titlebar")),n=this._register(new Nr(i));n.domNode.classList.add("quick-input-left-action-bar");const o=$(i,Ln(".quick-input-title")),r=this._register(new Nr(i));r.domNode.classList.add("quick-input-right-action-bar");const a=$(e,Ln(".quick-input-description")),l=$(e,Ln(".quick-input-header")),d=$(l,Ln("input.quick-input-check-all"));d.type="checkbox",this._register(Gt(d,le.CHANGE,P=>{const A=d.checked;y.setAllVisibleChecked(A)})),this._register(K(d,le.CLICK,P=>{(P.x||P.y)&&f.setFocus()}));const c=$(l,Ln(".quick-input-description")),h=$(l,Ln(".quick-input-and-message")),u=$(h,Ln(".quick-input-filter")),f=this._register(new uj(u));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=$(u,Ln(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const m=new C1(g,{countFormat:p({},"{0} Results")}),b=$(u,Ln(".quick-input-count"));b.setAttribute("aria-live","polite");const v=new C1(b,{countFormat:p({},"{0} Selected")}),_=$(l,Ln(".quick-input-action")),w=new UE(_);w.label=p("ok","OK"),this._register(w.onDidClick(P=>{this.onDidAcceptEmitter.fire()}));const C=$(l,Ln(".quick-input-action")),S=new UE(C);S.label=p("custom","Custom"),this._register(S.onDidClick(P=>{this.onDidCustomEmitter.fire()}));const D=$(h,Ln(`#${this.idPrefix}message.quick-input-message`)),y=this._register(new Yx(e,this.idPrefix+"list",this.options));this._register(y.onChangedAllVisibleChecked(P=>{d.checked=P})),this._register(y.onChangedVisibleCount(P=>{m.setCount(P)})),this._register(y.onChangedCheckedCount(P=>{v.setCount(P)})),this._register(y.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof Df&&this.controller.canSelectMany&&y.clearFocus()},0)})),this._register(y.onDidChangeFocus(()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")}));const x=new pj(e);x.getContainer().classList.add("quick-input-progress");const E=Fc(e);return this._register(E),this._register(K(e,le.FOCUS,P=>{this.previousFocusElement=P.relatedTarget instanceof HTMLElement?P.relatedTarget:void 0},!0)),this._register(E.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(xf.Blur),this.previousFocusElement=void 0})),this._register(K(e,le.FOCUS,P=>{f.setFocus()})),this._register(K(e,le.KEY_DOWN,P=>{const A=new Mt(P);switch(A.keyCode){case 3:et.stop(P,!0),this.onDidAcceptEmitter.fire();break;case 9:et.stop(P,!0),this.hide(xf.Gesture);break;case 2:if(!A.altKey&&!A.ctrlKey&&!A.metaKey){const H=[".action-label.codicon"];e.classList.contains("show-checkboxes")?H.push("input"):H.push("input[type=text]"),this.getUI().list.isDisplayed()&&H.push(".monaco-list");const q=e.querySelectorAll(H.join(", "));A.shiftKey&&A.target===q[0]?(et.stop(P,!0),q[q.length-1].focus()):!A.shiftKey&&A.target===q[q.length-1]&&(et.stop(P,!0),q[0].focus())}break}})),this.ui={container:e,styleSheet:t,leftActionBar:n,titleBar:i,title:o,description1:a,description2:c,rightActionBar:r,checkAll:d,filterContainer:u,inputBox:f,visibleCountContainer:g,visibleCount:m,countContainer:b,count:v,okContainer:_,ok:w,message:D,customButtonContainer:C,customButton:S,list:y,progressBar:x,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:P=>this.show(P),hide:()=>this.hide(),setVisibilities:P=>this.setVisibilities(P),setComboboxAccessibility:P=>this.setComboboxAccessibility(P),setEnabled:P=>this.setEnabled(P),setContextKey:P=>this.options.setContextKey(P)},this.updateStyles(),this.ui}pick(e,t={},i=Fe.None){return new Promise((n,o)=>{let r=c=>{r=n,t.onKeyMods&&t.onKeyMods(a.keyMods),n(c)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let l;const d=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const c=a.activeItems[0];c&&(r(c),a.hide())}}),a.onDidChangeActive(c=>{const h=c[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(c=>{if(!a.canSelectMany){const h=c[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(c=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},c),{removeItem:()=>{const h=a.items.indexOf(c.item);if(h!==-1){const u=a.items.slice(),f=u.splice(h,1),g=a.activeItems.filter(m=>m!==f[0]);a.items=u,g&&(a.activeItems=g)}}}))),a.onDidChangeValue(c=>{l&&!c&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{$e(d),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([c,h])=>{l=h,a.busy=!1,a.items=c,a.canSelectMany&&(a.selectedItems=c.filter(u=>u.type!=="separator"&&u.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,c=>{o(c),a.hide()})})}createQuickPick(){const e=this.getUI();return new Df(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i&&i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(It.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),ma(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="";const n=this.options.backKeybindingLabel();S1.tooltip=n?p("quickInput.backWithKeybinding","Back ({0})",n):p("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList[e.checkBox?"add":"remove"]("show-checkboxes"),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.getAction().enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.getAction().enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t;const i=this.controller;if(i){const n=!(!((t=this.ui)===null||t===void 0)&&t.container.contains(document.activeElement));this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",n||(this.previousFocusElement&&this.previousFocusElement.offsetParent?(this.previousFocusElement.focus(),this.previousFocusElement=void 0):this.options.returnFocus()),i.didHide(e)}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,Jb.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,contrastBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e?e.toString():"",this.ui.container.style.backgroundColor=t?t.toString():"",this.ui.container.style.color=i?i.toString():"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.inputBox.style(this.styles.inputBox),this.ui.count.style(this.styles.countBadge),this.ui.ok.style(this.styles.button),this.ui.customButton.style(this.styles.button),this.ui.progressBar.style(this.styles.progressBar),this.ui.list.style(this.styles.list);const r=[];this.styles.list.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`),this.styles.list.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(`
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}Jb.MAX_WIDTH=600;const Ha=Ze("quickInputService");var y1;(function(s){s[s.PRESERVE=0]="PRESERVE",s[s.LAST=1]="LAST"})(y1||(y1={}));const Dd={Quickaccess:"workbench.contributions.quickaccess"};class bj{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Pe(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return fd([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}Ht.add(Dd.Quickaccess,new bj);var vj=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},jE=function(s,e){return function(t,i){e(t,i,s)}};let L1=class extends U{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Ht.as(Dd.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n;const[o,r]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&r&&l===r){e!==r.prefix&&!(i!=null&&i.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,r,i);return}if(r&&!(i!=null&&i.preserveValue)){let g;if(a&&l&&l!==r){const m=a.value.substr(l.prefix.length);m&&(g=`${r.prefix}${m}`)}if(!g){const m=o==null?void 0:o.defaultFilterValue;m===y1.LAST?g=this.lastAcceptedPickerValues.get(r):typeof m=="string"&&(g=`${r.prefix}${m}`)}typeof g=="string"&&(e=g)}const d=new X,c=d.add(this.quickInputService.createQuickPick());c.value=e,this.adjustValueSelection(c,r,i),c.placeholder=r==null?void 0:r.placeholder,c.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,c.hideInput=!!c.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(c.itemActivation=(n=i==null?void 0:i.itemActivation)!==null&&n!==void 0?n:Os.SECOND),c.contextKey=r==null?void 0:r.contextKey,c.filterValue=g=>g.substring(r?r.prefix.length:0),r!=null&&r.placeholder&&(c.ariaLabel=r==null?void 0:r.placeholder);let h,u;t&&(h=new Promise(g=>u=g),d.add(ya(c.onWillAccept)(g=>{g.veto(),c.hide()}))),d.add(this.registerPickerListeners(c,o,r,e));const f=d.add(new on);if(o&&d.add(o.provide(c,f.token)),ya(c.onDidHide)(()=>{c.selectedItems.length===0&&f.cancel(),d.dispose(),u==null||u(c.selectedItems)}),c.show(),t)return h}adjustValueSelection(e,t,i){var n;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(n=t==null?void 0:t.prefix.length)!==null&&n!==void 0?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n){const o=new X,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return o.add(Pe(()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),o.add(e.onDidChangeValue(a=>{const[l]=this.getOrInstantiateProvider(a);l!==t?this.show(a,{preserveValue:!0}):r.value=a})),i&&o.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),o}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};L1=vj([jE(0,Ha),jE(1,qe)],L1);var wj=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Yh=function(s,e){return function(t,i){e(t,i,s)}};let x1=class extends jW{constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=n,this.layoutService=o,this.contexts=new Map}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(L1))),this._quickAccess}createController(e=this.layoutService,t){var i,n;const o={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>{},setContextKey:a=>this.setContextKey(a),returnFocus:()=>e.focus(),createList:(a,l,d,c,h)=>this.instantiationService.createInstance(u1,a,l,d,c,h),styles:this.computeStyles()},r=this._register(new Jb(Object.assign(Object.assign({},o),t)));return r.layout(e.dimension,(n=(i=e.offset)===null||i===void 0?void 0:i.top)!==null&&n!==void 0?n:0),this._register(e.onDidLayout(a=>{var l,d;return r.layout(a,(d=(l=e.offset)===null||l===void 0?void 0:l.top)!==null&&d!==void 0?d:0)})),this._register(r.onShow(()=>this.resetContextKeys())),this._register(r.onHide(()=>this.resetContextKeys())),r}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new se(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t&&t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=Fe.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},Fs(this.theme,{quickInputBackground:CI,quickInputForeground:W7,quickInputTitleBackground:V7,contrastBorder:Xt,widgetShadow:Sa})),inputBox:Fs(this.theme,{inputForeground:jL,inputBackground:$L,inputBorder:qL,inputValidationInfoBackground:KL,inputValidationInfoForeground:GL,inputValidationInfoBorder:ZL,inputValidationWarningBackground:mA,inputValidationWarningForeground:_A,inputValidationWarningBorder:bA,inputValidationErrorBackground:vA,inputValidationErrorForeground:wA,inputValidationErrorBorder:CA}),countBadge:Fs(this.theme,{badgeBackground:SA,badgeForeground:yA,badgeBorder:Xt}),button:Fs(this.theme,{buttonForeground:N7,buttonBackground:MS,buttonHoverBackground:M7,buttonBorder:Xt}),progressBar:Fs(this.theme,{progressBarBackground:T7}),keybindingLabel:Fs(this.theme,{keybindingLabelBackground:U7,keybindingLabelForeground:$7,keybindingLabelBorder:j7,keybindingLabelBottomBorder:q7,keybindingLabelShadow:Sa}),list:Fs(this.theme,{listBackground:CI,listInactiveFocusForeground:Hp,listInactiveSelectionIconForeground:zp,listInactiveFocusBackground:Up,listFocusOutline:Vi,listInactiveFocusOutline:Vi,pickerGroupBorder:z7,pickerGroupForeground:H7})}}};x1=wj([Yh(0,qe),Yh(1,we),Yh(2,pt),Yh(3,Hn),Yh(4,$b)],x1);var n2=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ll=function(s,e){return function(t,i){e(t,i,s)}};let D1=class extends x1{constructor(e,t,i,n,o,r){super(t,i,n,o,r),this.host=void 0;const a=Jc.get(e);this.host={_serviceBrand:void 0,get container(){return a.widget.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus()}}createController(){return super.createController(this.host)}};D1=n2([ll(1,qe),ll(2,we),ll(3,pt),ll(4,Hn),ll(5,$b)],D1);let k1=class{constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(D1,e);this.mapEditorToService.set(e,t),ya(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},i=Fe.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}};k1=n2([ll(0,qe),ll(1,Ge)],k1);class Jc{constructor(e){this.editor=e,this.widget=new ev(this.editor)}static get(e){return e.getContribution(Jc.ID)}dispose(){this.widget.dispose()}}Jc.ID="editor.controller.quickInput";class ev{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return ev.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}ev.ID="editor.contrib.quickInputWidget";Xe(Jc.ID,Jc);var Qe;(function(s){const e=new pf;class t{constructor(l,d){this._serviceId=l,this._factory=d,this._value=null}get id(){return this._serviceId}get(l){if(!this._value){if(l&&(this._value=l[this._serviceId.toString()]),this._value||(this._value=this._factory(l)),!this._value)throw new Error("Service "+this._serviceId+" is missing!");e.set(this._serviceId,this._value)}return this._value}}s.LazyStaticService=t;let i=[];function n(a,l){let d=new t(a,l);return i.push(d),d}function o(a){let l=new pf;for(const[c,h]of C9())l.set(c,h);for(let c in a)a.hasOwnProperty(c)&&l.set(Ze(c),a[c]);i.forEach(c=>l.set(c.id,c.get(a)));let d=new k_(l,!0);return l.set(qe,d),[l,d]}s.init=o,s.instantiationService=n(qe,()=>new k_(e,!0));const r=new UT;s.configurationService=n(At,()=>r),s.resourceConfigurationService=n(mL,()=>new PW(r)),s.resourcePropertiesService=n(_T,()=>new CS(r)),s.contextService=n(BT,()=>new _b),s.labelService=n(lg,()=>new WW),s.telemetryService=n(Ba,()=>new FW),s.dialogService=n(ag,()=>new RW),s.notificationService=n(Qt,()=>new mb),s.markerService=n(ug,()=>new al),s.modeService=n(to,a=>new nz),s.standaloneThemeService=n(Sd,()=>new Az),s.logService=n(Tr,()=>new CB(new wB)),s.undoRedoService=n(Bb,a=>new F_(s.dialogService.get(a),s.notificationService.get(a))),s.modelService=n(Vt,a=>new y_(s.configurationService.get(a),s.resourcePropertiesService.get(a),s.standaloneThemeService.get(a),s.logService.get(a),s.undoRedoService.get(a))),s.markerDecorationsService=n(kL,a=>new m1(s.modelService.get(a),s.markerService.get(a))),s.contextKeyService=n(we,a=>new YS(s.configurationService.get(a))),s.codeEditorService=n(Ge,a=>new C_(null,s.contextKeyService.get(a),s.standaloneThemeService.get(a))),s.editorProgressService=n(Rr,()=>new pb),s.storageService=n(Or,()=>new A$),s.editorWorkerService=n(Ms,a=>new gS(s.modelService.get(a),s.resourceConfigurationService.get(a),s.logService.get(a)))})(Qe||(Qe={}));class Cj extends U{constructor(e,t){super();const[i,n]=Qe.init(t);this._serviceCollection=i,this._instantiationService=n;const o=this.get(At),r=this.get(Qt),a=this.get(Ba),l=this.get(pt),d=this.get(Tr),c=this.get(we);let h=(b,v)=>{let _=null;return t&&(_=t[b.toString()]),_||(_=v()),this._serviceCollection.set(b,_),_};h(Hn,()=>new _1(c,o)),h(ns,()=>new c1(l));let u=h(Wt,()=>new OW(this._instantiationService)),f=h(Lt,()=>this._register(new zT(c,u,a,r,d,e))),g=h($b,()=>new VW(Qe.codeEditorService.get(Ge),e));h(Ha,()=>new k1(n,Qe.codeEditorService.get(Ge)));let m=h(Wa,()=>this._register(new s1(g)));h(Va,()=>new F$),h(wd,()=>{const b=new n1(a,r,m,f,l);return b.configure({blockMouse:!1}),this._register(b)}),h(vh,()=>new g1(u)),h(yL,()=>new BW(Qe.modelService.get(Vt)))}get(e){let t=this._serviceCollection.get(e);if(!t)throw new Error("Missing service "+e);return t}set(e,t){this._serviceCollection.set(e,t)}has(e){return this._serviceCollection.has(e)}}function s2(s,e,t){let i=new Cj(s,e),n=null;i.has(Xs)||(n=new wS(Qe.modelService.get()),i.set(Xs,n)),i.has(Oo)||i.set(Oo,new iS(i.get(Ge),i.get(Wt)));let o=t(i);return n&&n.setEditor(o),o}function Sj(s,e,t){return s2(s,t||{},i=>new qS(s,e,i,i.get(qe),i.get(Ge),i.get(Wt),i.get(we),i.get(Lt),i.get(Wa),i.get(Sd),i.get(Qt),i.get(At),i.get(Hn),i.get(Vt),i.get(to)))}function yj(s){return Qe.codeEditorService.get().onCodeEditorAdd(e=>{s(e)})}function Lj(s,e,t){return s2(s,t||{},i=>new KS(s,e,i,i.get(qe),i.get(we),i.get(Lt),i.get(Wa),i.get(Ms),i.get(Ge),i.get(Sd),i.get(Qt),i.get(At),i.get(wd),i.get(Rr),i.get(Va)))}function xj(s,e){return new o3(s,e)}function Dj(s,e,t){return aR(Qe.modelService.get(),Qe.modeService.get(),s,e,t)}function kj(s,e){Qe.modelService.get().setMode(s,Qe.modeService.get().create(e))}function Ij(s,e,t){s&&Qe.markerService.get().changeOne(e,s.uri,t)}function Ej(s){return Qe.markerService.get().read(s)}function Nj(s){return Qe.markerService.get().onMarkerChanged(s)}function Mj(s){return Qe.modelService.get().getModel(s)}function Tj(){return Qe.modelService.get().getModels()}function Aj(s){return Qe.modelService.get().onModelAdded(s)}function Rj(s){return Qe.modelService.get().onModelRemoved(s)}function Oj(s){return Qe.modelService.get().onModelModeChanged(e=>{s({model:e.model,oldLanguage:e.oldModeId})})}function Pj(s){return DB(Qe.modelService.get(),s)}function Fj(s,e){const t=Qe.standaloneThemeService.get();return t.registerEditorContainer(s),SL.colorizeElement(t,Qe.modeService.get(),s,e)}function Bj(s,e,t){return Qe.standaloneThemeService.get().registerEditorContainer(document.body),SL.colorize(Qe.modeService.get(),s,e,t)}function Wj(s,e,t=4){return Qe.standaloneThemeService.get().registerEditorContainer(document.body),SL.colorizeModelLine(s,e,t)}function Vj(s){let e=St.get(s);return e||{getInitialState:()=>Jf,tokenize:(t,i,n,o)=>aT(s,t,n,o)}}function Hj(s,e){Qe.modeService.get().triggerMode(e);let i=Vj(e),n=Fa(s),o=[],r=i.getInitialState();for(let a=0,l=n.length;a<l;a++){let d=n[a],c=i.tokenize(d,!0,r,0);o[a]=c.tokens,r=c.endState}return o}function zj(s,e){Qe.standaloneThemeService.get().defineTheme(s,e)}function Uj(s){Qe.standaloneThemeService.get().setTheme(s)}function $j(){eV()}function jj(s,e){return He.registerCommand({id:s,handler:e})}function qj(){return{create:Sj,onDidCreateEditor:yj,createDiffEditor:Lj,createDiffNavigator:xj,createModel:Dj,setModelLanguage:kj,setModelMarkers:Ij,getModelMarkers:Ej,onDidChangeMarkers:Nj,getModels:Tj,getModel:Mj,onDidCreateModel:Aj,onWillDisposeModel:Rj,onDidChangeModelLanguage:Oj,createWebWorker:Pj,colorizeElement:Fj,colorize:Bj,colorizeModelLine:Wj,tokenize:Hj,defineTheme:zj,setTheme:Uj,remeasureFonts:$j,registerCommand:jj,AccessibilitySupport:l0,ContentWidgetPositionPreference:f0,CursorChangeReason:g0,DefaultEndOfLine:p0,EditorAutoIndentStrategy:_0,EditorOption:b0,EndOfLinePreference:v0,EndOfLineSequence:w0,MinimapPosition:k0,MouseTargetType:I0,OverlayWidgetPositionPreference:E0,OverviewRulerLane:N0,RenderLineNumbersType:M0,RenderMinimap:T0,ScrollbarVisibility:R0,ScrollType:A0,TextEditorCursorBlinkingStyle:W0,TextEditorCursorStyle:V0,TrackedRangeStickiness:H0,WrappingIndent:z0,ConfigurationChangedEvent:cM,BareFontInfo:Wc,FontInfo:sS,TextModelResolvedOptions:Np,FindMatch:qu,EditorType:Qf,EditorOptions:Js}}function Kj(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function ap(s,e){return typeof s=="boolean"?s:e}function qE(s,e){return typeof s=="string"?s:e}function Gj(s){const e={};for(const t of s)e[t]=!0;return e}function KE(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=Gj(s);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function I1(s,e){e=e.replace(/@@/g,"");let t=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(o,r){i=!0;let a="";if(typeof s[r]=="string")a=s[r];else if(s[r]&&s[r]instanceof RegExp)a=s[r].source;else throw s[r]===void 0?dt(s,"language definition does not contain attribute '"+r+"', used at: "+e):dt(s,"attribute reference '"+r+"' must be a string, used at: "+e);return Jd(a)?"":"(?:"+a+")"}),t++;while(i&&t<5);e=e.replace(/\x01/g,"@");let n=(s.ignoreCase?"i":"")+(s.unicode?"u":"");return new RegExp(e,n)}function Zj(s,e,t,i){if(i<0)return s;if(i<e.length)return e[i];if(i>=100){i=i-100;let n=t.split(".");if(n.unshift(t),i<n.length)return n[i]}return null}function Yj(s,e,t,i){let n=-1,o=t,r=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(n=parseInt(r[3]),r[2]&&(n=n+100)),o=r[4]);let a="~",l=o;!o||o.length===0?(a="!=",l=""):/^\w*$/.test(l)?a="==":(r=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(a=r[1],l=r[2]));let d;if((a==="~"||a==="!~")&&/^(\w|\|)*$/.test(l)){let c=KE(l.split("|"),s.ignoreCase);d=function(h){return a==="~"?c(h):!c(h)}}else if(a==="@"||a==="!@"){let c=s[l];if(!c)throw dt(s,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!Kj(function(u){return typeof u=="string"},c))throw dt(s,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);let h=KE(c,s.ignoreCase);d=function(u){return a==="@"?h(u):!h(u)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){let c=I1(s,"^"+l+"$");d=function(h){return a==="~"?c.test(h):!c.test(h)}}else d=function(c,h,u,f){return I1(s,"^"+Yr(s,l,h,u,f)+"$").test(c)};else if(l.indexOf("$")<0){let c=ra(s,l);d=function(h){return a==="=="?h===c:h!==c}}else{let c=ra(s,l);d=function(h,u,f,g,m){let b=Yr(s,c,u,f,g);return a==="=="?h===b:h!==b}}return n===-1?{name:t,value:i,test:function(c,h,u,f){return d(c,c,h,u,f)}}:{name:t,value:i,test:function(c,h,u,f){let g=Zj(c,h,u,n);return d(g||"",c,h,u,f)}}}function E1(s,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw dt(s,"a 'token' attribute must be of type string, in rule: "+e);{let i={token:t.token};if(t.token.indexOf("$")>=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw dt(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw dt(s,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!UB(s,Yr(s,n,"",[],""))))throw dt(s,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,s.usesEmbedded=!0),i}}else if(Array.isArray(t)){let i=[];for(let n=0,o=t.length;n<o;n++)i[n]=E1(s,e,t[n]);return{group:i}}else if(t.cases){let i=[];for(let o in t.cases)if(t.cases.hasOwnProperty(o)){const r=E1(s,e,t.cases[o]);o==="@default"||o==="@"||o===""?i.push({test:void 0,value:r,name:o}):o==="@eos"?i.push({test:function(a,l,d,c){return c},value:r,name:o}):i.push(Yj(s,e,o,r))}const n=s.defaultToken;return{test:function(o,r,a,l){for(const d of i)if(!d.test||d.test(o,r,a,l))return d.value;return n}}}else throw dt(s,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+e)}else return{token:""}}class Xj{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if(typeof t=="string")i=t;else if(t instanceof RegExp)i=t.source;else throw dt(e,"rules must start with a match string or regular expression: "+this.name);this.matchOnlyAtLineStart=i.length>0&&i[0]==="^",this.name=this.name+": "+i,this.regex=I1(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=E1(e,this.name,t)}}function Qj(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");let t={};t.languageId=s,t.includeLF=ap(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=ap(e.ignoreCase,!1),t.unicode=ap(e.unicode,!1),t.tokenPostfix=qE(e.tokenPostfix,"."+t.languageId),t.defaultToken=qE(e.defaultToken,"source"),t.usesEmbedded=!1;let i=e;i.languageId=s,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function n(r,a,l){for(const d of l){let c=d.include;if(c){if(typeof c!="string")throw dt(t,"an 'include' attribute must be a string at: "+r);if(c[0]==="@"&&(c=c.substr(1)),!e.tokenizer[c])throw dt(t,"include target '"+c+"' is not defined at: "+r);n(r+"."+c,a,e.tokenizer[c])}else{const h=new Xj(r);if(Array.isArray(d)&&d.length>=1&&d.length<=3)if(h.setRegex(i,d[0]),d.length>=3)if(typeof d[1]=="string")h.setAction(i,{token:d[1],next:d[2]});else if(typeof d[1]=="object"){const u=d[1];u.next=d[2],h.setAction(i,u)}else throw dt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,d[1]);else{if(!d.regex)throw dt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);d.name&&typeof d.name=="string"&&(h.name=d.name),d.matchOnlyAtStart&&(h.matchOnlyAtLineStart=ap(d.matchOnlyAtLineStart,!1)),h.setRegex(i,d.regex),h.setAction(i,d.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw dt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(let r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw dt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];let o=[];for(let r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw dt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+`
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")o.push({token:a.token+t.tokenPostfix,open:ra(t,a.open),close:ra(t,a.close)});else throw dt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function Jj(s){Dl.registerLanguage(s)}function eq(){let s=[];return s=s.concat(Dl.getLanguages()),s}function tq(s){let e=Qe.modeService.get().getLanguageIdentifier(s);return e?e.id:0}function iq(s,e){let t=Qe.modeService.get().onDidCreateMode(i=>{i.getId()===s&&(t.dispose(),e())});return t}function nq(s,e){let t=Qe.modeService.get().getLanguageIdentifier(s);if(!t)throw new Error(`Cannot set configuration for unknown language ${s}`);return xe.register(t,e,100)}class sq{constructor(e,t){this._languageIdentifier=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i,n){if(typeof this._actual.tokenize=="function")return kf.adaptTokenize(this._languageIdentifier.language,this._actual,e,i,n);throw new Error("Not supported!")}tokenize2(e,t,i){let n=this._actual.tokenizeEncoded(e,i);return new X_(n.tokens,n.endState)}}class kf{constructor(e,t,i){this._standaloneThemeService=e,this._languageIdentifier=t,this._actual=i}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t,i){let n=[],o=0;for(let r=0,a=e.length;r<a;r++){const l=e[r];let d=l.startIndex;r===0?d=0:d<o&&(d=o),n[r]=new Y_(d+i,l.scopes,t),o=d}return n}static adaptTokenize(e,t,i,n,o){let r=t.tokenize(i,n),a=kf._toClassicTokens(r.tokens,e,o),l;return r.endState.equals(n)?l=n:l=r.endState,new $y(a,l)}tokenize(e,t,i,n){return kf.adaptTokenize(this._languageIdentifier.language,this._actual,e,i,n)}_toBinaryTokens(e,t){const i=this._languageIdentifier.id,n=this._standaloneThemeService.getColorTheme().tokenTheme;let o=[],r=0,a=0;for(let d=0,c=e.length;d<c;d++){const h=e[d],u=n.match(i,h.scopes);if(r>0&&o[r-1]===u)continue;let f=h.startIndex;d===0?f=0:f<a&&(f=a),o[r++]=f+t,o[r++]=u,a=f}let l=new Uint32Array(r);for(let d=0;d<r;d++)l[d]=o[d];return l}tokenize2(e,t,i,n){let o=this._actual.tokenize(e,i),r=this._toBinaryTokens(o.tokens,n),a;return o.endState.equals(i)?a=i:a=o.endState,new X_(r,a)}}function oq(s){return"tokenizeEncoded"in s}function o2(s){return s&&typeof s.then=="function"}function rq(s){if(s){const e=[null];for(let t=1,i=s.length;t<i;t++)e[t]=B.fromHex(s[t]);Qe.standaloneThemeService.get().setColorMapOverride(e)}else Qe.standaloneThemeService.get().setColorMapOverride(null)}function aq(s,e){let t=Qe.modeService.get().getLanguageIdentifier(s);if(!t)throw new Error(`Cannot set tokens provider for unknown language ${s}`);const i=n=>oq(n)?new sq(t,n):new kf(Qe.standaloneThemeService.get(),t,n);return o2(e)?St.registerPromise(s,e.then(n=>i(n))):St.register(s,i(e))}function lq(s,e){const t=i=>qB(Qe.modeService.get(),Qe.standaloneThemeService.get(),s,Qj(s,i));return o2(e)?St.registerPromise(s,e.then(i=>t(i))):St.register(s,t(e))}function dq(s,e){return Im.register(s,e)}function cq(s,e){return Em.register(s,e)}function hq(s,e){return wl.register(s,e)}function uq(s,e){return Gu.register(s,{provideHover:(t,i,n)=>{let o=t.getWordAtPosition(i);return Promise.resolve(e.provideHover(t,i,n)).then(r=>{if(r)return!r.range&&o&&(r.range=new L(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),r.range||(r.range=new L(i.lineNumber,i.column,i.lineNumber,i.column)),r})}})}function fq(s,e){return ws.register(s,e)}function gq(s,e){return Vc.register(s,e)}function pq(s,e){return Nm.register(s,e)}function mq(s,e){return Zu.register(s,e)}function _q(s,e){return Tm.register(s,e)}function bq(s,e){return Am.register(s,e)}function vq(s,e){return lr.register(s,e)}function wq(s,e){return Io.register(s,{provideCodeActions:(t,i,n,o)=>{let r=Qe.markerService.get().read({resource:t.uri}).filter(a=>L.areIntersectingOrTouching(a,i));return e.provideCodeActions(t,i,{markers:r,only:n.only},o)}})}function Cq(s,e){return vu.register(s,e)}function Sq(s,e){return Us.register(s,e)}function yq(s,e){return Rm.register(s,e)}function Lq(s,e){return Yu.register(s,e)}function xq(s,e){return zs.register(s,e)}function Dq(s,e){return Hc.register(s,e)}function kq(s,e){return rS.register(s,e)}function Iq(s,e){return Mm.register(s,e)}function Eq(s,e){return rb.register(s,e)}function Nq(s,e){return Om.register(s,e)}function Mq(s,e){return hL.register(s,e)}function Tq(s,e){return cL.register(s,e)}function Aq(s,e){return Qr.register(s,e)}function Rq(){return{register:Jj,getLanguages:eq,onLanguage:iq,getEncodedLanguageId:tq,setLanguageConfiguration:nq,setColorMap:rq,setTokensProvider:aq,setMonarchTokensProvider:lq,registerReferenceProvider:dq,registerRenameProvider:cq,registerCompletionItemProvider:xq,registerSignatureHelpProvider:hq,registerHoverProvider:uq,registerDocumentSymbolProvider:fq,registerDocumentHighlightProvider:gq,registerLinkedEditingRangeProvider:pq,registerDefinitionProvider:mq,registerImplementationProvider:_q,registerTypeDefinitionProvider:bq,registerCodeLensProvider:vq,registerCodeActionProvider:wq,registerDocumentFormattingEditProvider:Cq,registerDocumentRangeFormattingEditProvider:Sq,registerOnTypeFormattingEditProvider:yq,registerLinkProvider:Lq,registerColorProvider:Dq,registerFoldingRangeProvider:kq,registerDeclarationProvider:Iq,registerSelectionRangeProvider:Eq,registerDocumentSemanticTokensProvider:Nq,registerDocumentRangeSemanticTokensProvider:Mq,registerInlineCompletionsProvider:Tq,registerInlayHintsProvider:Aq,DocumentHighlightKind:m0,CompletionItemKind:c0,CompletionItemTag:h0,CompletionItemInsertTextRule:d0,SymbolKind:F0,SymbolTag:B0,IndentAction:C0,CompletionTriggerKind:u0,SignatureHelpTriggerKind:P0,InlayHintKind:S0,InlineCompletionTriggerKind:y0,FoldingRangeKind:Po}}class eh{static _handleEolEdits(e,t){let i,n=[];for(let o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=eh._handleEolEdits(e,t);n.length===1&&eh._isFullModelReplaceEdit(e,n[0])?e.executeEdits("formatEditsCommand",n.map(o=>Bt.replace(L.lift(o.range),o.text))):e.executeEdits("formatEditsCommand",n.map(o=>Bt.replaceMove(L.lift(o.range),o.text))),i&&e.pushUndoStop()}}class lC{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}var ka=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function Qx(s){if(s=s.filter(n=>n.range),!s.length)return;let{range:e}=s[0];for(let n=1;n<s.length;n++)e=L.plusRange(e,s[n].range);const{startLineNumber:t,endLineNumber:i}=e;t===i?s.length===1?wi(p("hint11","Made 1 formatting edit on line {0}",t)):wi(p("hintn1","Made {0} formatting edits on line {1}",s.length,t)):s.length===1?wi(p("hint1n","Made 1 formatting edit between lines {0} and {1}",t,i)):wi(p("hintnn","Made {0} formatting edits between lines {1} and {2}",s.length,t,i))}function r2(s){const e=[],t=new Set,i=vu.ordered(s);for(const o of i)e.push(o),o.extensionId&&t.add(lC.toKey(o.extensionId));const n=Us.ordered(s);for(const o of n){if(o.extensionId){if(t.has(lC.toKey(o.extensionId)))continue;t.add(lC.toKey(o.extensionId))}e.push({displayName:o.displayName,extensionId:o.extensionId,provideDocumentFormattingEdits(r,a,l){return o.provideDocumentRangeFormattingEdits(r,r.getFullModelRange(),a,l)}})}return e}class ql{static setFormatterSelector(e){return{dispose:ql._selectors.unshift(e)}}static select(e,t,i){return ka(this,void 0,void 0,function*(){if(e.length===0)return;const n=Be.first(ql._selectors);if(n)return yield n(e,t,i)})}}ql._selectors=new Mn;function a2(s,e,t,i,n,o){return ka(this,void 0,void 0,function*(){const r=s.get(qe),a=Fo(e)?e.getModel():e,l=Us.ordered(a),d=yield ql.select(l,a,i);d&&(n.report(d),yield r.invokeFunction(Oq,d,e,t,o))})}function Oq(s,e,t,i,n){return ka(this,void 0,void 0,function*(){const o=s.get(Ms);let r,a;Fo(t)?(r=t.getModel(),a=new _f(t,5,void 0,n)):(r=t,a=new _x(t,n));let l=[],d=0;for(let g of bL(i).sort(L.compareRangesUsingStarts))d>0&&L.areIntersectingOrTouching(l[d-1],g)?l[d-1]=L.fromPositions(l[d-1].getStartPosition(),g.getEndPosition()):d=l.push(g);const c=g=>ka(this,void 0,void 0,function*(){return(yield e.provideDocumentRangeFormattingEdits(r,g,r.getFormattingOptions(),a.token))||[]}),h=(g,m)=>{if(!g.length||!m.length)return!1;const b=g.reduce((v,_)=>L.plusRange(v,_.range),g[0].range);if(!m.some(v=>L.intersectRanges(b,v.range)))return!1;for(let v of g)for(let _ of m)if(L.intersectRanges(v.range,_.range))return!0;return!1},u=[],f=[];try{for(let g of l){if(a.token.isCancellationRequested)return!0;f.push(yield c(g))}for(let g=0;g<l.length;++g)for(let m=g+1;m<l.length;++m){if(a.token.isCancellationRequested)return!0;if(h(f[g],f[m])){const b=L.plusRange(l[g],l[m]),v=yield c(b);l.splice(m,1),l.splice(g,1),l.push(b),f.splice(m,1),f.splice(g,1),f.push(v),g=0,m=0}}for(let g of f){if(a.token.isCancellationRequested)return!0;const m=yield o.computeMoreMinimalEdits(r.uri,g);m&&u.push(...m)}}finally{a.dispose()}if(u.length===0)return!1;if(Fo(t))eh.execute(t,u,!0),Qx(u),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:g}]=u,m=new ee(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn);r.pushEditOperations([m],u.map(b=>({text:b.text,range:L.lift(b.range),forceMoveMarkers:!0})),b=>{for(const{range:v}of b)if(L.areIntersectingOrTouching(v,m))return[new ee(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn)];return null})}return!0})}function Pq(s,e,t,i,n){return ka(this,void 0,void 0,function*(){const o=s.get(qe),r=Fo(e)?e.getModel():e,a=r2(r),l=yield ql.select(a,r,t);l&&(i.report(l),yield o.invokeFunction(Fq,l,e,t,n))})}function Fq(s,e,t,i,n){return ka(this,void 0,void 0,function*(){const o=s.get(Ms);let r,a;Fo(t)?(r=t.getModel(),a=new _f(t,5,void 0,n)):(r=t,a=new _x(t,n));let l;try{const d=yield e.provideDocumentFormattingEdits(r,r.getFormattingOptions(),a.token);if(l=yield o.computeMoreMinimalEdits(r.uri,d),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||l.length===0)return!1;if(Fo(t))eh.execute(t,l,i!==2),i!==2&&(Qx(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:d}]=l,c=new ee(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn);r.pushEditOperations([c],l.map(h=>({text:h.text,range:L.lift(h.range),forceMoveMarkers:!0})),h=>{for(const{range:u}of h)if(L.areIntersectingOrTouching(u,c))return[new ee(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn)];return null})}return!0})}function Bq(s,e,t,i,n){return ka(this,void 0,void 0,function*(){const o=Us.ordered(e);for(const r of o){let a=yield Promise.resolve(r.provideDocumentRangeFormattingEdits(e,t,i,n)).catch(gi);if(vn(a))return yield s.computeMoreMinimalEdits(e.uri,a)}})}function Wq(s,e,t,i){return ka(this,void 0,void 0,function*(){const n=r2(e);for(const o of n){let r=yield Promise.resolve(o.provideDocumentFormattingEdits(e,t,i)).catch(gi);if(vn(r))return yield s.computeMoreMinimalEdits(e.uri,r)}})}function l2(s,e,t,i,n){const o=Rm.ordered(e);return o.length===0||o[0].autoFormatTriggerCharacters.indexOf(i)<0?Promise.resolve(void 0):Promise.resolve(o[0].provideOnTypeFormattingEdits(e,t,i,n,Fe.None)).catch(gi).then(r=>s.computeMoreMinimalEdits(e.uri,r))}He.registerCommand("_executeFormatRangeProvider",function(s,...e){const[t,i,n]=e;nt(he.isUri(t)),nt(L.isIRange(i));const o=s.get(Vt).getModel(t);if(!o)throw Rn("resource");return Bq(s.get(Ms),o,L.lift(i),n,Fe.None)});He.registerCommand("_executeFormatDocumentProvider",function(s,...e){const[t,i]=e;nt(he.isUri(t));const n=s.get(Vt).getModel(t);if(!n)throw Rn("resource");return Wq(s.get(Ms),n,i,Fe.None)});He.registerCommand("_executeFormatOnTypeProvider",function(s,...e){const[t,i,n,o]=e;nt(he.isUri(t)),nt(O.isIPosition(i)),nt(typeof n=="string");const r=s.get(Vt).getModel(t);if(!r)throw Rn("resource");return l2(s.get(Ms),r,O.lift(i),n,o)});var dC;Js.wrappingIndent.defaultValue=0;Js.glyphMargin.defaultValue=!1;Js.autoIndent.defaultValue=3;Js.overviewRulerLanes.defaultValue=2;ql.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const Gi=CM();Gi.editor=qj();Gi.languages=Rq();Gi.CancellationTokenSource;const If=Gi.Emitter;Gi.KeyCode;Gi.KeyMod;Gi.Position;const rne=Gi.Range;Gi.Selection;Gi.SelectionDirection;const ane=Gi.MarkerSeverity,lne=Gi.MarkerTag,dne=Gi.Uri;Gi.Token;const GE=Gi.editor,nn=Gi.languages;(!((dC=jt.MonacoEnvironment)===null||dC===void 0)&&dC.globalAPI||typeof define=="function"&&define.amd)&&(self.monaco=Gi);typeof self.require<"u"&&typeof self.require.config=="function"&&self.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});var Vq="4.3.2",N1;(function(s){s[s.None=0]="None",s[s.CommonJS=1]="CommonJS",s[s.AMD=2]="AMD",s[s.UMD=3]="UMD",s[s.System=4]="System",s[s.ES2015=5]="ES2015",s[s.ESNext=99]="ESNext"})(N1||(N1={}));var M1;(function(s){s[s.None=0]="None",s[s.Preserve=1]="Preserve",s[s.React=2]="React",s[s.ReactNative=3]="ReactNative",s[s.ReactJSX=4]="ReactJSX",s[s.ReactJSXDev=5]="ReactJSXDev"})(M1||(M1={}));var T1;(function(s){s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed"})(T1||(T1={}));var Ef;(function(s){s[s.ES3=0]="ES3",s[s.ES5=1]="ES5",s[s.ES2015=2]="ES2015",s[s.ES2016=3]="ES2016",s[s.ES2017=4]="ES2017",s[s.ES2018=5]="ES2018",s[s.ES2019=6]="ES2019",s[s.ES2020=7]="ES2020",s[s.ESNext=99]="ESNext",s[s.JSON=100]="JSON",s[s.Latest=99]="Latest"})(Ef||(Ef={}));var A1;(function(s){s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs"})(A1||(A1={}));var d2=function(){function s(e,t,i){this._onDidChange=new If,this._onDidExtraLibsChange=new If,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(t),this.setWorkerOptions(i),this._onDidExtraLibsChangeTimeout=-1}return Object.defineProperty(s.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onDidExtraLibsChange",{get:function(){return this._onDidExtraLibsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"workerOptions",{get:function(){return this._workerOptions},enumerable:!1,configurable:!0}),s.prototype.getExtraLibs=function(){return this._extraLibs},s.prototype.addExtraLib=function(e,t){var i=this,n;if(typeof t>"u"?n="ts:extralib-"+Math.random().toString(36).substring(2,15):n=t,this._extraLibs[n]&&this._extraLibs[n].content===e)return{dispose:function(){}};var o=1;return this._removedExtraLibs[n]&&(o=this._removedExtraLibs[n]+1),this._extraLibs[n]&&(o=this._extraLibs[n].version+1),this._extraLibs[n]={content:e,version:o},this._fireOnDidExtraLibsChangeSoon(),{dispose:function(){var r=i._extraLibs[n];r&&r.version===o&&(delete i._extraLibs[n],i._removedExtraLibs[n]=o,i._fireOnDidExtraLibsChangeSoon())}}},s.prototype.setExtraLibs=function(e){for(var t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),e&&e.length>0)for(var i=0,n=e;i<n.length;i++){var o=n[i],t=o.filePath||"ts:extralib-"+Math.random().toString(36).substring(2,15),r=o.content,a=1;this._removedExtraLibs[t]&&(a=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:r,version:a}}this._fireOnDidExtraLibsChangeSoon()},s.prototype._fireOnDidExtraLibsChangeSoon=function(){var e=this;this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=setTimeout(function(){e._onDidExtraLibsChangeTimeout=-1,e._onDidExtraLibsChange.fire(void 0)},0))},s.prototype.getCompilerOptions=function(){return this._compilerOptions},s.prototype.setCompilerOptions=function(e){this._compilerOptions=e||Object.create(null),this._onDidChange.fire(void 0)},s.prototype.getDiagnosticsOptions=function(){return this._diagnosticsOptions},s.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(void 0)},s.prototype.setWorkerOptions=function(e){this._workerOptions=e||Object.create(null),this._onDidChange.fire(void 0)},s.prototype.setMaximumWorkerIdleTime=function(e){},s.prototype.setEagerModelSync=function(e){this._eagerModelSync=e},s.prototype.getEagerModelSync=function(){return this._eagerModelSync},s}(),Hq=Vq,c2=new d2({allowNonTsExtensions:!0,target:Ef.Latest},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{}),h2=new d2({allowNonTsExtensions:!0,allowJs:!0,target:Ef.Latest},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{}),zq=function(){return tv().then(function(s){return s.getTypeScriptWorker()})},Uq=function(){return tv().then(function(s){return s.getJavaScriptWorker()})};nn.typescript={ModuleKind:N1,JsxEmit:M1,NewLineKind:T1,ScriptTarget:Ef,ModuleResolutionKind:A1,typescriptVersion:Hq,typescriptDefaults:c2,javascriptDefaults:h2,getTypeScriptWorker:zq,getJavaScriptWorker:Uq};function tv(){return ae(()=>import("./tsMode-BubA63TC.js"),__vite__mapDeps([0,1,2,3,4,5,6]))}nn.onLanguage("typescript",function(){return tv().then(function(s){return s.setupTypeScript(c2)})});nn.onLanguage("javascript",function(){return tv().then(function(s){return s.setupJavaScript(h2)})});var Jx=function(){function s(e,t,i){this._onDidChange=new If,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}return Object.defineProperty(s.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"diagnosticsOptions",{get:function(){return this.options},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),s.prototype.setOptions=function(e){this._options=e||Object.create(null),this._onDidChange.fire(this)},s.prototype.setDiagnosticsOptions=function(e){this.setOptions(e)},s.prototype.setModeConfiguration=function(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)},s}(),eD={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0}},tD={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},u2=new Jx("css",eD,tD),f2=new Jx("scss",eD,tD),g2=new Jx("less",eD,tD);nn.css={cssDefaults:u2,lessDefaults:g2,scssDefaults:f2};function iD(){return ae(()=>import("./cssMode--Vs7p4z6.js"),__vite__mapDeps([7,1,2,3,4,5,6]))}nn.onLanguage("less",function(){iD().then(function(s){return s.setupMode(g2)})});nn.onLanguage("scss",function(){iD().then(function(s){return s.setupMode(f2)})});nn.onLanguage("css",function(){iD().then(function(s){return s.setupMode(u2)})});var $q=function(){function s(e,t,i){this._onDidChange=new If,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}return Object.defineProperty(s.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!1,configurable:!0}),s.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)},s.prototype.setModeConfiguration=function(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)},s}(),jq={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning"},qq={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},p2=new $q("json",jq,qq);nn.json={jsonDefaults:p2};function Kq(){return ae(()=>import("./jsonMode-DMYpj5fT.js"),__vite__mapDeps([8,1,2,3,4,5,6]))}nn.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});nn.onLanguage("json",function(){Kq().then(function(s){return s.setupMode(p2)})});var Gq=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},Zq=function(s,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(d){return function(c){return l([d,c])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(o=d[0]&2?n.return:d[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,d[1])).done)return o;switch(n=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,n=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){t.label=d[1];break}if(d[0]===6&&t.label<o[1]){t.label=o[1],o=d;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(d);break}o[2]&&t.ops.pop(),t.trys.pop();continue}d=e.call(s,t)}catch(c){d=[6,c],n=0}finally{i=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},Yq=function(){function s(e,t,i){this._onDidChange=new If,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}return Object.defineProperty(s.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!1,configurable:!0}),s.prototype.setOptions=function(e){this._options=e||Object.create(null),this._onDidChange.fire(this)},s.prototype.setModeConfiguration=function(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)},s}(),Xq={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:null,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},iv={format:Xq,suggest:{},data:{useDefaultDataProvider:!0}};function nv(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===Pu,documentFormattingEdits:s===Pu,documentRangeFormattingEdits:s===Pu}}var Pu="html",ZE="handlebars",YE="razor",m2=sv(Pu,iv,nv(Pu)),Qq=m2.defaults,_2=sv(ZE,iv,nv(ZE)),Jq=_2.defaults,b2=sv(YE,iv,nv(YE)),eK=b2.defaults;nn.html={htmlDefaults:Qq,razorDefaults:eK,handlebarDefaults:Jq,htmlLanguageService:m2,handlebarLanguageService:_2,razorLanguageService:b2,registerHTMLLanguageService:sv};function tK(){return ae(()=>import("./htmlMode-BA0L6YRc.js"),__vite__mapDeps([9,1,2,3,4,5,6]))}function sv(s,e,t){var i=this;e===void 0&&(e=iv),t===void 0&&(t=nv(s));var n=new Yq(s,e,t),o,r=nn.onLanguage(s,function(){return Gq(i,void 0,void 0,function(){return Zq(this,function(a){switch(a.label){case 0:return[4,tK()];case 1:return o=a.sent().setupMode(n),[2]}})})});return{defaults:n,dispose:function(){r.dispose(),o==null||o.dispose(),o=void 0}}}var v2={},cC={},iK=function(){function s(e){var t=this;this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise(function(i,n){t._lazyLoadPromiseResolve=i,t._lazyLoadPromiseReject=n})}return s.getOrCreate=function(e){return cC[e]||(cC[e]=new s(e)),cC[e]},s.prototype.whenLoaded=function(){return this._lazyLoadPromise},s.prototype.load=function(){var e=this;return this._loadingTriggered||(this._loadingTriggered=!0,v2[this._languageId].loader().then(function(t){return e._lazyLoadPromiseResolve(t)},function(t){return e._lazyLoadPromiseReject(t)})),this._lazyLoadPromise},s}();function fe(s){var e=s.id;v2[e]=s,nn.register(s);var t=iK.getOrCreate(e);nn.setMonarchTokensProvider(e,t.whenLoaded().then(function(i){return i.language})),nn.onLanguage(e,function(){t.load().then(function(i){nn.setLanguageConfiguration(e,i.conf)})})}fe({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:function(){return ae(()=>import("./abap-B9RV-_BR.js"),[])}});fe({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:function(){return ae(()=>import("./apex-BL_CmIl-.js"),[])}});fe({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:function(){return ae(()=>import("./azcli-1IWB1ccx.js"),[])}});fe({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:function(){return ae(()=>import("./bat-DPkNLes8.js"),[])}});fe({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:function(){return ae(()=>import("./bicep-DLNwh9K6.js"),[])}});fe({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:function(){return ae(()=>import("./cameligo-CGrWLZr3.js"),[])}});fe({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:function(){return ae(()=>import("./clojure-D9WOWImG.js"),[])}});fe({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:function(){return ae(()=>import("./coffee-B7EJu28W.js"),[])}});fe({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:function(){return ae(()=>import("./cpp-C72MvgAO.js"),[])}});fe({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:function(){return ae(()=>import("./cpp-C72MvgAO.js"),[])}});fe({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:function(){return ae(()=>import("./csharp-BoL64M5l.js"),[])}});fe({id:"csp",extensions:[],aliases:["CSP","csp"],loader:function(){return ae(()=>import("./csp-C46ZqvIl.js"),[])}});fe({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:function(){return ae(()=>import("./css-yEtxmcUf.js"),[])}});fe({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:function(){return ae(()=>import("./dart-D8lhlL1r.js"),[])}});fe({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:function(){return ae(()=>import("./dockerfile-DLk6rpji.js"),[])}});fe({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:function(){return ae(()=>import("./ecl-BO6FnfXk.js"),[])}});fe({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:function(){return ae(()=>import("./elixir-B9GXSzSz.js"),[])}});fe({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:function(){return ae(()=>import("./fsharp-fd1GTHhf.js"),[])}});fe({id:"go",extensions:[".go"],aliases:["Go"],loader:function(){return ae(()=>import("./go-O9LJTZXk.js"),[])}});fe({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:function(){return ae(()=>import("./graphql-LQdxqEYJ.js"),[])}});fe({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:function(){return ae(()=>import("./handlebars-CPBsJnEq.js"),__vite__mapDeps([10,1,2,3,4,5,6]))}});fe({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:function(){return ae(()=>import("./hcl-CexkA8v0.js"),[])}});fe({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:function(){return ae(()=>import("./html-CBV6GB1r.js"),__vite__mapDeps([11,1,2,3,4,5,6]))}});fe({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:function(){return ae(()=>import("./ini-BvajGCUy.js"),[])}});fe({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:function(){return ae(()=>import("./java-DPgNP7lh.js"),[])}});fe({id:"javascript",extensions:[".js",".es6",".jsx",".mjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:function(){return ae(()=>import("./javascript-BV6C_W1_.js"),__vite__mapDeps([12,13,1,2,3,4,5,6]))}});fe({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:function(){return ae(()=>import("./julia-DQXNmw_w.js"),[])}});fe({id:"kotlin",extensions:[".kt"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:function(){return ae(()=>import("./kotlin-qQ0MG-9I.js"),[])}});fe({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:function(){return ae(()=>import("./less-B86-qBTk.js"),[])}});fe({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:function(){return ae(()=>import("./lexon-Canl7DCW.js"),[])}});fe({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:function(){return ae(()=>import("./lua-D28Ae8-K.js"),[])}});fe({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:function(){return ae(()=>import("./liquid-Cbg-0PaI.js"),__vite__mapDeps([14,1,2,3,4,5,6]))}});fe({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:function(){return ae(()=>import("./m3-DPitgjJI.js"),[])}});fe({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:function(){return ae(()=>import("./markdown-BJ4KcfR-.js"),[])}});fe({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:function(){return ae(()=>import("./mips-CdjsipkG.js"),[])}});fe({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:function(){return ae(()=>import("./msdax-CYqgjx_P.js"),[])}});fe({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:function(){return ae(()=>import("./mysql-BAlWi9Ou.js"),[])}});fe({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:function(){return ae(()=>import("./objective-c-B1aVtJYH.js"),[])}});fe({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:function(){return ae(()=>import("./pascal-DTluBHOt.js"),[])}});fe({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:function(){return ae(()=>import("./pascaligo-5jv8CcQD.js"),[])}});fe({id:"perl",extensions:[".pl"],aliases:["Perl","pl"],loader:function(){return ae(()=>import("./perl-DlYyT36c.js"),[])}});fe({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:function(){return ae(()=>import("./pgsql-M-WMQIqP.js"),[])}});fe({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:function(){return ae(()=>import("./php-120yhfDK.js"),[])}});fe({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:function(){return ae(()=>import("./postiats-CQpG440k.js"),[])}});fe({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:function(){return ae(()=>import("./powerquery-DdJtto1Z.js"),[])}});fe({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:function(){return ae(()=>import("./powershell-Bu_VLpJB.js"),[])}});fe({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:function(){return ae(()=>import("./pug-kFxLfcjb.js"),[])}});fe({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:function(){return ae(()=>import("./python-LDkdiNmM.js"),__vite__mapDeps([15,1,2,3,4,5,6]))}});fe({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:function(){return ae(()=>import("./qsharp-BhgV_cYv.js"),[])}});fe({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:function(){return ae(()=>import("./r-BIFz-_sK.js"),[])}});fe({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:function(){return ae(()=>import("./razor-ID9fWjNT.js"),__vite__mapDeps([16,1,2,3,4,5,6]))}});fe({id:"redis",extensions:[".redis"],aliases:["redis"],loader:function(){return ae(()=>import("./redis-CHOsPHWR.js"),[])}});fe({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:function(){return ae(()=>import("./redshift-w2XKkDvD.js"),[])}});fe({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:function(){return ae(()=>import("./restructuredtext-CghPJEOS.js"),[])}});fe({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:function(){return ae(()=>import("./ruby-CYWGW-b1.js"),[])}});fe({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:function(){return ae(()=>import("./rust-CqlBNj3y.js"),[])}});fe({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:function(){return ae(()=>import("./sb-BYAiYHFx.js"),[])}});fe({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:function(){return ae(()=>import("./scala-Bqvq8jcR.js"),[])}});fe({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:function(){return ae(()=>import("./scheme-Dhb-2j9p.js"),[])}});fe({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:function(){return ae(()=>import("./scss-CdQcnAnq.js"),[])}});fe({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:function(){return ae(()=>import("./shell-CmmbcNmB.js"),[])}});fe({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:function(){return ae(()=>import("./solidity-CME5AdoB.js"),[])}});fe({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:function(){return ae(()=>import("./sophia-RYC1BQQz.js"),[])}});fe({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:function(){return ae(()=>import("./sparql-KEyrF7De.js"),[])}});fe({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:function(){return ae(()=>import("./sql-CbGH2FIt.js"),[])}});fe({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:function(){return ae(()=>import("./st-C8kzSboH.js"),[])}});fe({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:function(){return ae(()=>import("./swift-vE6e-x0J.js"),[])}});fe({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:function(){return ae(()=>import("./systemverilog-DeswK4rN.js"),[])}});fe({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:function(){return ae(()=>import("./systemverilog-DeswK4rN.js"),[])}});fe({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:function(){return ae(()=>import("./tcl-PloMZuKG.js"),[])}});fe({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:function(){return ae(()=>import("./twig-bne2BnKZ.js"),[])}});fe({id:"typescript",extensions:[".ts",".tsx"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:function(){return ae(()=>import("./typescript-BniNjZN7.js"),__vite__mapDeps([13,1,2,3,4,5,6]))}});fe({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:function(){return ae(()=>import("./vb-BwAE3J76.js"),[])}});fe({id:"xml",extensions:[".xml",".dtd",".ascx",".csproj",".config",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:function(){return ae(()=>import("./xml-B4dCqQoG.js"),__vite__mapDeps([17,1,2,3,4,5,6]))}});fe({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:function(){return ae(()=>import("./yaml-A89blxgn.js"),[])}});class Ia{constructor(e="",t=!1){var i,n;if(this.value=e,typeof this.value!="string")throw Rn("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1):(this.isTrusted=(i=t.isTrusted)!==null&&i!==void 0?i:void 0,this.supportThemeIcons=(n=t.supportThemeIcons)!==null&&n!==void 0?n:!1)}appendText(e,t=0){return this.value+=sK(this.supportThemeIcons?oU(e):e).replace(/([ \t]+)/g,(i,n)=>"&nbsp;".repeat(n.length)).replace(/^>/gm,"\\>").replace(/\n/g,t===1?`\\
`:`
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=`
`,this.value+=t,this.value+="\n```\n",this}}function Fu(s){return nK(s)?!s.value:Array.isArray(s)?s.every(Fu):!0}function nK(s){return s instanceof Ia?!0:s&&typeof s=="object"?typeof s.value=="string"&&(typeof s.isTrusted=="boolean"||s.isTrusted===void 0)&&(typeof s.supportThemeIcons=="boolean"||s.supportThemeIcons===void 0):!1}function sK(s){return s.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function hC(s){return s&&s.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1")}function oK(s){const e=[],t=s.split("|").map(n=>n.trim());s=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=n?n[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),d=isFinite(parseInt(r));l&&e.push(`width="${a}"`),d&&e.push(`height="${r}"`)}return{href:s,dimensions:e}}var rK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},aK=function(s,e){return function(t,i){e(t,i,s)}},ov=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const rv=new se("selectionAnchorSet",!1);let Mr=class w2{constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=rv.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}static get(e){return e.getContribution(w2.ID)}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition(),t=this.decorationId?[this.decorationId]:[],i=this.editor.deltaDecorations(t,[{range:ee.fromPositions(e,e),options:{description:"selection-anchor",stickiness:1,hoverMessage:new Ia().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"}}]);this.decorationId=i[0],this.selectionAnchorSetContextKey.set(!!this.decorationId),wi(p("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(ee.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){this.decorationId&&(this.editor.deltaDecorations([this.decorationId],[]),this.decorationId=void 0,this.selectionAnchorSetContextKey.set(!1))}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Mr.ID="editor.contrib.selectionAnchorController";Mr=rK([aK(1,we)],Mr);class lK extends ne{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2080),weight:100}})}run(e,t){return ov(this,void 0,void 0,function*(){Mr.get(t).setSelectionAnchor()})}}class dK extends ne{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:rv})}run(e,t){return ov(this,void 0,void 0,function*(){Mr.get(t).goToSelectionAnchor()})}}class cK extends ne{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:rv,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2089),weight:100}})}run(e,t){return ov(this,void 0,void 0,function*(){Mr.get(t).selectFromAnchorToCursor()})}}class hK extends ne{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:rv,kbOpts:{kbExpr:I.editorTextFocus,primary:9,weight:100}})}run(e,t){return ov(this,void 0,void 0,function*(){Mr.get(t).cancelSelectionAnchor()})}}Xe(Mr.ID,Mr);Q(lK);Q(dK);Q(cK);Q(hK);const uK=T("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hc:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class fK extends ne{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:3160,weight:100}})}run(e,t){let i=Zs.get(t);i&&i.jumpToBracket()}}class gK extends ne{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){const n=Zs.get(t);if(!n)return;let o=!0;i&&i.selectBrackets===!1&&(o=!1),n.selectToBracket(o)}}class pK{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Zs extends U{constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=[],this._updateBracketsSoon=this._register(new bt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(61),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._decorations=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(61)&&(this._matchBrackets=this._editor.getOption(61),this._decorations=this._editor.deltaDecorations(this._decorations,[]),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())}))}static get(e){return e.getContribution(Zs.ID)}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),o=e.matchBracket(n);let r=null;if(o)o[0].containsPosition(n)?r=o[1].getStartPosition():o[1].containsPosition(n)&&(r=o[0].getStartPosition());else{const a=e.findEnclosingBrackets(n);if(a)r=a[0].getStartPosition();else{const l=e.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new ee(r.lineNumber,r.column,r.lineNumber,r.column):new ee(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const o=n.getStartPosition();let r=t.matchBracket(o);if(!r&&(r=t.findEnclosingBrackets(o),!r)){const d=t.findNextBracket(o);d&&d.range&&(r=t.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(L.compareRangesUsingStarts);const[d,c]=r;a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition()}a&&l&&i.push(new ee(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();let e=[],t=0;for(const i of this._lastBracketsData){let n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations=this._editor.deltaDecorations(this._decorations,e)}_recomputeBrackets(){if(!this._editor.hasModel()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);let o=[],r=0;for(let h=0,u=e.length;h<u;h++){let f=e[h];f.isEmpty()&&(o[r++]=f.getStartPosition())}o.length>1&&o.sort(O.compare);let a=[],l=0,d=0,c=n.length;for(let h=0,u=o.length;h<u;h++){let f=o[h];for(;d<c&&n[d].position.isBefore(f);)d++;if(d<c&&n[d].position.equals(f))a[l++]=n[d];else{let g=t.matchBracket(f),m=Zs._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!g&&this._matchBrackets==="always"&&(g=t.findEnclosingBrackets(f,20),m=Zs._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new pK(f,g,m)}}this._lastBracketsData=a,this._lastVersionId=i}}Zs.ID="editor.contrib.bracketMatchingController";Zs._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=De.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:en(uK),position:Pn.Center}});Zs._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=De.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});Xe(Zs.ID,Zs);Q(gK);Q(fK);tt((s,e)=>{const t=s.getColor(t6);t&&e.addRule(`.monaco-editor .bracket-match { background-color: ${t}; }`);const i=s.getColor(PA);i&&e.addRule(`.monaco-editor .bracket-match { border: 1px solid ${i}; }`)});xs.appendMenuItem(oe.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:p({},"Go to &&Bracket")},order:2});class mK{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new L(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(i,o,i,o),a)}else{const r=new L(i,o,i,o+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new ee(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ee(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class C2 extends ne{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let i=[],n=t.getSelections();for(const o of n)i.push(new mK(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class _K extends C2{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:p("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:I.writable})}}class bK extends C2{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:p("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:I.writable})}}Q(_K);Q(bK);class vK extends ne{constructor(){super({id:"editor.action.transposeLetters",label:p("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let i=t.getModel(),n=[],o=t.getSelections();for(let r of o){if(!r.isEmpty())continue;let a=r.startLineNumber,l=r.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;let c=l===d?r.getPosition():Ke.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),h=Ke.leftPosition(i,c),u=Ke.leftPosition(i,h),f=i.getValueInRange(L.fromPositions(u,h)),g=i.getValueInRange(L.fromPositions(h,c)),m=L.fromPositions(u,c);n.push(new mi(m,g+f))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Q(vK);var wK=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Kl="9_cutcopypaste",CK=Mo||document.queryCommandSupported("cut"),S2=Mo||document.queryCommandSupported("copy"),SK=typeof navigator.clipboard>"u"||qi?document.queryCommandSupported("paste"):!0;function nD(s){return s.register(),s}const yK=CK?nD(new wh({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Mo?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:oe.MenubarEditMenu,group:"2_ccp",title:p({},"Cu&&t"),order:1},{menuId:oe.EditorContext,group:Kl,title:p("actions.clipboard.cutLabel","Cut"),when:I.writable,order:1},{menuId:oe.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:oe.SimpleEditorContext,group:Kl,title:p("actions.clipboard.cutLabel","Cut"),when:I.writable,order:1}]})):void 0,LK=S2?nD(new wh({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Mo?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:oe.MenubarEditMenu,group:"2_ccp",title:p({},"&&Copy"),order:2},{menuId:oe.EditorContext,group:Kl,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:oe.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:oe.SimpleEditorContext,group:Kl,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;xs.appendMenuItem(oe.MenubarEditMenu,{submenu:oe.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});xs.appendMenuItem(oe.EditorContext,{submenu:oe.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:Kl,order:3});const uC=SK?nD(new wh({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Mo?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:oe.MenubarEditMenu,group:"2_ccp",title:p({},"&&Paste"),order:4},{menuId:oe.EditorContext,group:Kl,title:p("actions.clipboard.pasteLabel","Paste"),when:I.writable,order:4},{menuId:oe.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:oe.SimpleEditorContext,group:Kl,title:p("actions.clipboard.pasteLabel","Paste"),when:I.writable,order:4}]})):void 0;class xK extends ne{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:p("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:I.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(30)&&t.getSelection().isEmpty()||(kS.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),kS.forceCopyWithSyntaxHighlighting=!1)}}function y2(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Ge).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const o=n.getOption(30),r=n.getSelection();return r&&r.isEmpty()&&!o||document.execCommand(e),!0}return!1}),s.addImplementation(0,"generic-dom",(t,i)=>(document.execCommand(e),!0)))}y2(yK,"cut");y2(LK,"copy");uC&&(uC.addImplementation(1e4,"code-editor",(s,e)=>{const t=s.get(Ge),i=s.get(Va),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?(!document.execCommand("paste")&&gh&&wK(void 0,void 0,void 0,function*(){const r=yield i.readText();if(r!==""){const a=rf.INSTANCE.get(r);let l=!1,d=null,c=null;a&&(l=n.getOption(30)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),n.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:c})}}),!0):!1}),uC.addImplementation(0,"generic-dom",(s,e)=>(document.execCommand("paste"),!0)));S2&&Q(xK);class B_{constructor(e){this.executor=e,this._didRun=!1}getValue(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}class Ae{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+Ae.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ae(this.value+Ae.sep+e)}}Ae.sep=".";Ae.None=new Ae("@@none@@");Ae.Empty=new Ae("");Ae.QuickFix=new Ae("quickfix");Ae.Refactor=new Ae("refactor");Ae.Source=new Ae("source");Ae.SourceOrganizeImports=Ae.Source.append("organizeImports");Ae.SourceFixAll=Ae.Source.append("fixAll");function DK(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>L2(e,t,s.include))||!s.includeSourceActions&&Ae.Source.contains(e))}function kK(s,e){const t=e.kind?new Ae(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>L2(t,i,s.include))||!s.includeSourceActions&&t&&Ae.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function L2(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}class Co{constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}static fromUser(e,t){return!e||typeof e!="object"?new Co(t.kind,t.apply,!1):new Co(Co.getKindFromUser(e,t.kind),Co.getApplyFromUser(e,t.apply),Co.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Ae(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}}var sD=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const x2="editor.action.codeAction",D2="editor.action.refactor",k2="editor.action.sourceAction",oD="editor.action.organizeImports",rD="editor.action.fixAll";class I2{constructor(e,t){this.action=e,this.provider=t}resolve(e){var t;return sD(this,void 0,void 0,function*(){if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(n){gi(n)}i&&(this.action.edit=i.edit)}return this})}}class aD extends U{constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(aD.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}static codeActionsComparator({action:e},{action:t}){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:vn(e.diagnostics)?vn(t.diagnostics)?e.diagnostics[0].message.localeCompare(t.diagnostics[0].message):-1:vn(t.diagnostics)?1:0}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ae.QuickFix.contains(new Ae(e.kind))&&!!e.isPreferred)}}const XE={actions:[],documentation:void 0};function lD(s,e,t,i,n){var o;const r=t.filter||{},a={only:(o=r.include)===null||o===void 0?void 0:o.value,trigger:t.type},l=new _x(s,n),d=IK(s,r),c=new X,h=d.map(f=>sD(this,void 0,void 0,function*(){try{i.report(f);const g=yield f.provideCodeActions(s,e,a,l.token);if(g&&c.add(g),l.token.isCancellationRequested)return XE;const m=((g==null?void 0:g.actions)||[]).filter(v=>v&&kK(r,v)),b=EK(f,m,r.include);return{actions:m.map(v=>new I2(v,f)),documentation:b}}catch(g){if(Vo(g))throw g;return gi(g),XE}})),u=Io.onDidChange(()=>{const f=Io.all(s);Ss(f,d)||l.cancel()});return Promise.all(h).then(f=>{const g=eg(f.map(b=>b.actions)),m=fd(f.map(b=>b.documentation));return new aD(g,m,c)}).finally(()=>{u.dispose(),l.dispose()})}function IK(s,e){return Io.all(s).filter(t=>t.providedCodeActionKinds?t.providedCodeActionKinds.some(i=>DK(e,new Ae(i))):!0)}function EK(s,e,t){if(!s.documentation)return;const i=s.documentation.map(n=>({kind:new Ae(n.kind),command:n.command}));if(t){let n;for(const o of i)o.kind.contains(t)&&(n?n.kind.contains(o.kind)&&(n=o):n=o);if(n)return n==null?void 0:n.command}for(const n of e)if(n.kind){for(const o of i)if(o.kind.contains(new Ae(n.kind)))return o.command}}He.registerCommand("_executeCodeActionProvider",function(s,e,t,i,n){return sD(this,void 0,void 0,function*(){if(!(e instanceof he))throw Rn();const o=s.get(Vt).getModel(e);if(!o)throw Rn();const r=ee.isISelection(t)?ee.liftSelection(t):L.isIRange(t)?o.validateRange(t):void 0;if(!r)throw Rn();const a=typeof i=="string"?new Ae(i):void 0,l=yield lD(o,r,{type:1,filter:{includeSourceActions:!0,include:a}},Cd.None,Fe.None),d=[],c=Math.min(l.validActions.length,typeof n=="number"?n:0);for(let h=0;h<c;h++)d.push(l.validActions[h].resolve(Fe.None));try{return yield Promise.all(d),l.validActions.map(h=>h.action)}finally{setTimeout(()=>l.dispose(),100)}})});var NK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},MK=function(s,e){return function(t,i){e(t,i,s)}};let Bn=class R1{constructor(e,t){this._messageWidget=new Es,this._messageListeners=new X,this._editor=e,this._visible=R1.MESSAGE_VISIBLE.bindTo(t),this._editorListener=this._editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit())}static get(e){return e.getContribution(R1.ID)}dispose(){this._editorListener.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){wi(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new QE(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(new an(()=>this.closeMessage(),3e3));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new L(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(QE.fadeOut(this._messageWidget.value))}_onDidAttemptReadOnlyEdit(){this._editor.hasModel()&&this.showMessage(p("editor.readonly","Cannot edit in read-only editor"),this._editor.getPosition())}};Bn.ID="editor.contrib.messageController";Bn.MESSAGE_VISIBLE=new se("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));Bn=NK([MK(1,we)],Bn);const TK=Di.bindToContribution(Bn.get);G(new TK({id:"leaveEditorMessage",precondition:Bn.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:130,primary:9}}));let QE=class{constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i-1},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage");const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");r.classList.add("message"),r.textContent=n,this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}static fadeOut(e){let t;const i=()=>{e.dispose(),clearTimeout(t),e.getDomNode().removeEventListener("animationend",i)};return t=setTimeout(i,110),e.getDomNode().addEventListener("animationend",i),e.getDomNode().classList.add("fadeOut"),{dispose:i}}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2]}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Xe(Bn.ID,Bn);tt((s,e)=>{const t=s.getColor(ZL);if(t){let o=s.type===Xn.HIGH_CONTRAST?2:1;e.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor.below { border-top-color: ${t}; }`),e.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor.top { border-bottom-color: ${t}; }`),e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { border: ${o}px solid ${t}; }`)}const i=s.getColor(KL);i&&e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${i}; }`);const n=s.getColor(GL);n&&e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { color: ${n}; }`)});var AK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},JE=function(s,e){return function(t,i){e(t,i,s)}},RK=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class eN extends ys{constructor(e,t){super(e.command?e.command.id:e.title,OK(e.title),void 0,!e.disabled,t),this.action=e}}function OK(s){return s.replace(/\r\n|\r|\n/g," ")}let O1=class extends U{constructor(e,t,i,n){super(),this._editor=e,this._delegate=t,this._contextMenuService=i,this._visible=!1,this._showingActions=this._register(new Es),this._keybindingResolver=new av({getKeybindings:()=>n.getKeybindings()})}get isVisible(){return this._visible}show(e,t,i,n){return RK(this,void 0,void 0,function*(){const o=n.includeDisabledActions?t.allActions:t.validActions;if(!o.length){this._visible=!1;return}if(!this._editor.getDomNode())throw this._visible=!1,mh();this._visible=!0,this._showingActions.value=t;const r=this.getMenuActions(e,o,t.documentation),a=O.isIPosition(i)?this._toCoords(i):i||{x:0,y:0},l=this._keybindingResolver.getResolver(),d=this._editor.getOption(112);this._contextMenuService.showContextMenu({domForShadowRoot:d?this._editor.getDomNode():void 0,getAnchor:()=>a,getActions:()=>r,onHide:()=>{this._visible=!1,this._editor.focus()},autoSelectFirstItem:!0,getKeyBinding:c=>c instanceof eN?l(c.action):void 0})})}getMenuActions(e,t,i){var n,o;const r=c=>new eN(c.action,()=>this._delegate.onSelectCodeAction(c)),a=t.map(r),l=[...i],d=this._editor.getModel();if(d&&a.length)for(const c of Io.all(d))c._getAdditionalMenuItems&&l.push(...c._getAdditionalMenuItems({trigger:e.type,only:(o=(n=e.filter)===null||n===void 0?void 0:n.include)===null||o===void 0?void 0:o.value},t.map(h=>h.action)));return l.length&&a.push(new Ls,...l.map(c=>r(new I2({title:c.title,command:c},void 0)))),a}_toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=vi(this._editor.getDomNode()),n=i.left+t.left,o=i.top+t.top+t.height;return{x:n,y:o}}};O1=AK([JE(2,wd),JE(3,Lt)],O1);class av{constructor(e){this._keybindingProvider=e}getResolver(){const e=new B_(()=>this._keybindingProvider.getKeybindings().filter(t=>av.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===oD?i={kind:Ae.SourceOrganizeImports.value}:t.command===rD&&(i={kind:Ae.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Co.fromUser(i,{kind:Ae.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.getValue());return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Ae(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,o)=>n?n.kind.contains(o.kind)?o:n:o,void 0)}}av.codeActionCommands=[D2,x2,k2,oD,rD];var PK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},FK=function(s,e){return function(t,i){e(t,i,s)}},Bu;(function(s){s.Hidden={type:0};class e{constructor(i,n,o,r){this.actions=i,this.trigger=n,this.editorPosition=o,this.widgetPosition=r,this.type=1}}s.Showing=e})(Bu||(Bu={}));let W_=class E2 extends U{constructor(e,t,i,n){super(),this._editor=e,this._quickFixActionId=t,this._preferredFixActionId=i,this._keybindingService=n,this._onClick=this._register(new M),this.onClick=this._onClick.event,this._state=Bu.Hidden,this._domNode=document.createElement("div"),this._domNode.className=te.lightBulb.classNames,this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(o=>{const r=this._editor.getModel();(this.state.type!==1||!r||this.state.editorPosition.lineNumber>=r.getLineCount())&&this.hide()})),ot.ignoreTarget(this._domNode),this._register(i5(this._domNode,o=>{if(this.state.type!==1)return;this._editor.focus(),o.preventDefault();const{top:r,height:a}=vi(this._domNode),l=this._editor.getOption(56);let d=Math.floor(l/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(d+=l),this._onClick.fire({x:o.posx,y:r+a+d,actions:this.state.actions,trigger:this.state.trigger})})),this._register(K(this._domNode,"mouseenter",o=>{if((o.buttons&1)!==1)return;this.hide();const r=new _d;r.startMonitoring(o.target,o.buttons,Ch,()=>{},()=>{r.dispose()})})),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(54)&&!this._editor.getOption(54).enabled&&this.hide()})),this._updateLightBulbTitleAndIcon(),this._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitleAndIcon,this))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(54).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,d=n.get(40),c=o.getLineContent(r),h=si.computeIndentLevel(c,l),u=d.spaceWidth*h>22,f=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let g=r;if(!u){if(r>1&&!f(r-1))g-=1;else if(!f(r+1))g+=1;else if(a*d.spaceWidth<22)return this.hide()}this.state=new Bu.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:E2._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state=Bu.Hidden,this._editor.layoutContentWidget(this)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix){this._domNode.classList.remove(...te.lightBulb.classNamesArray),this._domNode.classList.add(...te.lightbulbAutofix.classNamesArray);const t=this._keybindingService.lookupKeybinding(this._preferredFixActionId);if(t){this.title=p("prefferedQuickFixWithKb","Show Fixes. Preferred Fix Available ({0})",t.getLabel());return}}this._domNode.classList.remove(...te.lightbulbAutofix.classNamesArray),this._domNode.classList.add(...te.lightBulb.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._quickFixActionId);e?this.title=p("quickFixWithKb","Show Fixes ({0})",e.getLabel()):this.title=p("quickFix","Show Fixes")}set title(e){this._domNode.title=e}};W_._posPref=[0];W_=PK([FK(3,Lt)],W_);tt((s,e)=>{var t;const i=(t=s.getColor(Eo))===null||t===void 0?void 0:t.transparent(.7),n=s.getColor(s8);n&&e.addRule(`
.monaco-editor .contentWidgets ${te.lightBulb.cssSelector} {
color: ${n};
background-color: ${i};
}`);const o=s.getColor(o8);o&&e.addRule(`
.monaco-editor .contentWidgets ${te.lightbulbAutofix.cssSelector} {
color: ${o};
background-color: ${i};
}`)});var BK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},WK=function(s,e){return function(t,i){e(t,i,s)}},fC=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},VK=function(s,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(s,t):n?n.value=t:e.set(s,t),t},HK=function(s,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!i:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(s):i?i.value:e.get(s)},em;let P1=class extends U{constructor(e,t,i,n,o){super(),this._editor=e,this.delegate=n,this._activeCodeActions=this._register(new Es),em.set(this,!1),this._codeActionWidget=new B_(()=>this._register(o.createInstance(O1,this._editor,{onSelectCodeAction:r=>fC(this,void 0,void 0,function*(){this.delegate.applyCodeAction(r,!0)})}))),this._lightBulbWidget=new B_(()=>{const r=this._register(o.createInstance(W_,this._editor,t,i));return this._register(r.onClick(a=>this.showCodeActionList(a.trigger,a.actions,a,{includeDisabledActions:!1}))),r})}dispose(){VK(this,em,!0,"f"),super.dispose()}update(e){var t,i,n;return fC(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let o;try{o=yield e.actions}catch(r){ve(r);return}if(!HK(this,em,"f"))if(this._lightBulbWidget.getValue().update(o,e.trigger,e.position),e.trigger.type===1){if(!((i=e.trigger.filter)===null||i===void 0)&&i.include){const a=this.tryGetValidActionToApply(e.trigger,o);if(a){try{yield this.delegate.applyCodeAction(a,!1)}finally{o.dispose()}return}if(e.trigger.context){const l=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,o);if(l&&l.action.disabled){Bn.get(this._editor).showMessage(l.action.disabled,e.trigger.context.position),o.dispose();return}}}const r=!!(!((n=e.trigger.filter)===null||n===void 0)&&n.include);if(e.trigger.context&&(!o.allActions.length||!r&&!o.validActions.length)){Bn.get(this._editor).showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=o,o.dispose();return}this._activeCodeActions.value=o,this._codeActionWidget.getValue().show(e.trigger,o,e.position,{includeDisabledActions:r})}else this._codeActionWidget.getValue().isVisible?o.dispose():this._activeCodeActions.value=o})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,i,n){return fC(this,void 0,void 0,function*(){this._codeActionWidget.getValue().show(e,t,i,n)})}};em=new WeakMap;P1=BK([WK(4,qe)],P1);var gC=function(s,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!i:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(s):i?i.value:e.get(s)},zK=function(s,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(s,t):n?n.value=t:e.set(s,t),t},ic;const N2=new se("supportedCodeAction","");class UK extends U{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new an),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._onCursorChange()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);return this._createEventAndSignalChange(e,t)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>GM(i,t.uri))&&this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2})},this._delay)}_onCursorChange(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2})},this._delay)}_getRangeOfMarker(e){const t=this._editor.getModel();if(t)for(const i of this._markerService.read({resource:t.uri})){const n=t.validateRange(i);if(L.intersectRanges(n,e))return L.lift(n)}}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:n,column:o}=i.getPosition(),r=t.getLineContent(n);if(r.length===0)return;if(o===1){if(/\s/.test(r[0]))return}else if(o===t.getLineMaxColumn(n)){if(/\s/.test(r[r.length-1]))return}else if(/\s/.test(r[o-2])&&/\s/.test(r[o-1]))return}return i}_createEventAndSignalChange(e,t){const i=this._editor.getModel();if(!t||!i){this._signalChange(void 0);return}const n=this._getRangeOfMarker(t),o=n?n.getStartPosition():t.getStartPosition(),r={trigger:e,selection:t,position:o};return this._signalChange(r),r}}var dl;(function(s){s.Empty={type:0};class e{constructor(i,n,o,r){this.trigger=i,this.rangeOrSelection=n,this.position=o,this._cancellablePromise=r,this.type=1,this.actions=r.catch(a=>{if(Vo(a))return $K;throw a})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=e})(dl||(dl={}));const $K={allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1};class jK extends U{constructor(e,t,i,n){super(),this._editor=e,this._markerService=t,this._progressService=n,this._codeActionOracle=this._register(new Es),this._state=dl.Empty,this._onDidChangeState=this._register(new M),this.onDidChangeState=this._onDidChangeState.event,ic.set(this,!1),this._supportedCodeActions=N2.bindTo(i),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(Io.onDidChange(()=>this._update())),this._update()}dispose(){gC(this,ic,"f")||(zK(this,ic,!0,"f"),super.dispose(),this.setState(dl.Empty,!0))}_update(){if(gC(this,ic,"f"))return;this._codeActionOracle.value=void 0,this.setState(dl.Empty);const e=this._editor.getModel();if(e&&Io.has(e)&&!this._editor.getOption(78)){const t=[];for(const i of Io.all(e))Array.isArray(i.providedCodeActionKinds)&&t.push(...i.providedCodeActionKinds);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new UK(this._editor,this._markerService,i=>{var n;if(!i){this.setState(dl.Empty);return}const o=fi(r=>lD(e,i.selection,i.trigger,Cd.None,r));i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(o,250)),this.setState(new dl.Triggered(i.trigger,i.selection,i.position,o))},void 0),this._codeActionOracle.value.trigger({type:2})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value&&this._codeActionOracle.value.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!gC(this,ic,"f")&&this._onDidChangeState.fire(e))}}ic=new WeakMap;var qK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},lp=function(s,e){return function(t,i){e(t,i,s)}},M2=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function gg(s){return J.regex(N2.keys()[0],new RegExp("(\\s|^)"+Ys(s.value)+"\\b"))}const dD={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:p("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:p("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[p("args.schema.apply.first","Always apply the first returned code action."),p("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),p("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:p("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};let Gl=class T2 extends U{constructor(e,t,i,n,o){super(),this._instantiationService=o,this._editor=e,this._model=this._register(new jK(this._editor,t,i,n)),this._register(this._model.onDidChangeState(r=>this.update(r))),this._ui=new B_(()=>this._register(new P1(e,xh.Id,pg.Id,{applyCodeAction:(r,a)=>M2(this,void 0,void 0,function*(){try{yield this._applyCodeAction(r)}finally{a&&this._trigger({type:2,filter:{}})}})},this._instantiationService)))}static get(e){return e.getContribution(T2.ID)}update(e){this._ui.getValue().update(e)}showCodeActions(e,t,i){return this._ui.getValue().showCodeActionList(e,t,i,{includeDisabledActions:!1})}manualTriggerAtCurrentPosition(e,t,i){if(!this._editor.hasModel())return;Bn.get(this._editor).closeMessage();const n=this._editor.getPosition();this._trigger({type:1,filter:t,autoApply:i,context:{notAvailableMessage:e,position:n}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e){return this._instantiationService.invokeFunction(KK,e,this._editor)}};Gl.ID="editor.contrib.quickFixController";Gl=qK([lp(1,ug),lp(2,we),lp(3,Rr),lp(4,qe)],Gl);function KK(s,e,t){return M2(this,void 0,void 0,function*(){const i=s.get(yL),n=s.get(Wt),o=s.get(Ba),r=s.get(Qt);if(o.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred}),yield e.resolve(Fe.None),e.action.edit&&(yield i.apply(fb.convert(e.action.edit),{editor:t,label:e.action.title})),e.action.command)try{yield n.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(a){const l=GK(a);r.error(typeof l=="string"?l:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function GK(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}function kd(s,e,t,i){if(s.hasModel()){const n=Gl.get(s);n&&n.manualTriggerAtCurrentPosition(e,t,i)}}class xh extends ne{constructor(){super({id:xh.Id,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:J.and(I.writable,I.hasCodeActionsProvider),kbOpts:{kbExpr:I.editorTextFocus,primary:2132,weight:100}})}run(e,t){return kd(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0)}}xh.Id="editor.action.quickFix";class ZK extends Di{constructor(){super({id:x2,precondition:J.and(I.writable,I.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:dD}]}})}runEditorCommand(e,t,i){const n=Co.fromUser(i,{kind:Ae.Empty,apply:"ifSingle"});return kd(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):p("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?p("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):p("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class YK extends ne{constructor(){super({id:D2,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:J.and(I.writable,I.hasCodeActionsProvider),kbOpts:{kbExpr:I.editorTextFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:J.and(I.writable,gg(Ae.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:dD}]}})}run(e,t,i){const n=Co.fromUser(i,{kind:Ae.Refactor,apply:"never"});return kd(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):p("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):n.preferred?p("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):p("editor.action.refactor.noneMessage","No refactorings available"),{include:Ae.Refactor.contains(n.kind)?n.kind:Ae.None,onlyIncludePreferredActions:n.preferred},n.apply)}}class XK extends ne{constructor(){super({id:k2,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:J.and(I.writable,I.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:J.and(I.writable,gg(Ae.Source))},description:{description:"Source Action...",args:[{name:"args",schema:dD}]}})}run(e,t,i){const n=Co.fromUser(i,{kind:Ae.Source,apply:"never"});return kd(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):p("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?p("editor.action.source.noneMessage.preferred","No preferred source actions available"):p("editor.action.source.noneMessage","No source actions available"),{include:Ae.Source.contains(n.kind)?n.kind:Ae.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class QK extends ne{constructor(){super({id:oD,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:J.and(I.writable,gg(Ae.SourceOrganizeImports)),kbOpts:{kbExpr:I.editorTextFocus,primary:1581,weight:100}})}run(e,t){return kd(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:Ae.SourceOrganizeImports,includeSourceActions:!0},"ifSingle")}}class JK extends ne{constructor(){super({id:rD,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:J.and(I.writable,gg(Ae.SourceFixAll))})}run(e,t){return kd(t,p("fixAll.noneMessage","No fix all action available"),{include:Ae.SourceFixAll,includeSourceActions:!0},"ifSingle")}}class pg extends ne{constructor(){super({id:pg.Id,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:J.and(I.writable,gg(Ae.QuickFix)),kbOpts:{kbExpr:I.editorTextFocus,primary:1620,mac:{primary:2644},weight:100}})}run(e,t){return kd(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ae.QuickFix,onlyIncludePreferredActions:!0},"ifSingle")}}pg.Id="editor.action.autoFix";Xe(Gl.ID,Gl);Q(xh);Q(YK);Q(XK);Q(QK);Q(pg);Q(JK);G(new ZK);var tN=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class F1{constructor(){this.lenses=[],this._disposables=new X}dispose(){this._disposables.dispose()}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function A2(s,e){return tN(this,void 0,void 0,function*(){const t=lr.ordered(s),i=new Map,n=new F1,o=t.map((r,a)=>tN(this,void 0,void 0,function*(){i.set(r,a);try{const l=yield Promise.resolve(r.provideCodeLenses(s,e));l&&n.add(l,r)}catch(l){gi(l)}}));return yield Promise.all(o),n.lenses=n.lenses.sort((r,a)=>r.symbol.range.startLineNumber<a.symbol.range.startLineNumber?-1:r.symbol.range.startLineNumber>a.symbol.range.startLineNumber?1:i.get(r.provider)<i.get(a.provider)?-1:i.get(r.provider)>i.get(a.provider)?1:r.symbol.range.startColumn<a.symbol.range.startColumn?-1:r.symbol.range.startColumn>a.symbol.range.startColumn?1:0),n})}He.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;nt(he.isUri(t)),nt(typeof i=="number"||!i);const n=s.get(Vt).getModel(t);if(!n)throw Rn();const o=[],r=new X;return A2(n,Fe.None).then(a=>{r.add(a);let l=[];for(const d of a.lenses)i==null||d.symbol.command?o.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&l.push(Promise.resolve(d.provider.resolveCodeLens(n,d.symbol,Fe.None)).then(c=>o.push(c||d.symbol)));return Promise.all(l)}).then(()=>o).finally(()=>{setTimeout(()=>r.dispose(),100)})});class eG{constructor(e,t,i){this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}}class lv{constructor(e,t,i){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${lv._idPool++}`,this.updatePosition(i),this._domNode=document.createElement("span"),this._domNode.className=`codelens-decoration ${t}`}withCommands(e,t){this._commands.clear();let i=[],n=!1;for(let o=0;o<e.length;o++){const r=e[o];if(r&&(n=!0,r.command)){const a=kl(r.command.title.trim());r.command.id?(i.push(Y("a",{id:String(o),title:r.command.tooltip},...a)),this._commands.set(String(o),r.command)):i.push(Y("span",{title:r.command.tooltip},...a)),o+1<e.length&&i.push(Y("span",void 0," | "))}}n?(ma(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):ma(this._domNode,Y("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}lv._idPool=0;class pC{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){let t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,n=t.length;i<n;i++)this._addDecorationsCallbacks[i](t[i])}}class iN{constructor(e,t,i,n,o,r,a){this._isDisposed=!1,this._editor=t,this._className=i,this._data=e,this._decorationIds=[];let l,d=[];this._data.forEach((c,h)=>{c.symbol.command&&d.push(c.symbol),n.addDecoration({range:c.symbol.range,options:De.EMPTY},u=>this._decorationIds[h]=u),l?l=L.plusRange(l,c.symbol.range):l=L.lift(c.symbol.range)}),this._viewZone=new eG(l.startLineNumber-1,r,a),this._viewZoneId=o.addZone(this._viewZone),d.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(d,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new lv(this._editor,this._className,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t&&t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&L.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:De.EMPTY},o=>this._decorationIds[n]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.domNode.hasAttribute("monaco-visible-view-zone"))return null;for(let t=0;t<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:n}=this._data[t];n.command=i.command||n.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}getItems(){return this._data}}tt((s,e)=>{const t=s.getColor(e6);t&&(e.addRule(`.monaco-editor .codelens-decoration { color: ${t}; }`),e.addRule(`.monaco-editor .codelens-decoration .codicon { color: ${t}; }`));const i=s.getColor(tx);i&&(e.addRule(`.monaco-editor .codelens-decoration > a:hover { color: ${i} !important; }`),e.addRule(`.monaco-editor .codelens-decoration > a:hover .codicon { color: ${i} !important; }`))});var tG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},iG=function(s,e){return function(t,i){e(t,i,s)}};const R2=Ze("ICodeLensCache");class nN{constructor(e,t){this.lineCount=e,this.data=t}}let B1=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new ud(20,.75);const t="codelens/cache";Cm(()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),ya(e.onWillSaveState)(o=>{o.reason===P_.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),n=new F1;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new nN(e.getLineCount(),n);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const o of i.data.lenses)n.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],o=[];for(const a of n.lines)o.push({range:new L(a,1,a,11)});const r=new F1;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new nN(n.lineCount,r))}}catch{}}};B1=tG([iG(0,Or)],B1);vd(R2,B1);var nG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},mC=function(s,e){return function(t,i){e(t,i,s)}},sG=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let th=class{constructor(e,t,i,n){this._editor=e,this._commandService=t,this._notificationService=i,this._codeLensCache=n,this._disposables=new X,this._localToDispose=new X,this._lenses=[],this._getCodeLensModelDelays=new Dm(lr,250,2500),this._oldCodeLensModels=new X,this._resolveCodeLensesDelays=new Dm(lr,250,2500),this._resolveCodeLensesScheduler=new bt(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDelays.min),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(o=>{(o.hasChanged(40)||o.hasChanged(14)||o.hasChanged(13))&&this._updateLensStyle(),o.hasChanged(12)&&this._onModelChange()})),this._disposables.add(lr.onDidChange(this._onModelChange,this)),this._onModelChange(),this._styleClassName="_"+sb(this._editor.getId()).toString(16),this._styleElement=On(tb(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose(),this._styleElement.remove()}_getLayoutInfo(){let e=this._editor.getOption(14),t;return!e||e<5?(e=this._editor.getOption(42)*.9|0,t=this._editor.getOption(56)):t=e*Math.max(1.3,this._editor.getOption(56)/this._editor.getOption(42))|0,{codeLensHeight:t,fontSize:e}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(13),n=this._editor.getOption(40),o=`--codelens-font-family${this._styleClassName}`,r=`--codelens-font-features${this._styleClassName}`;let a=`
.monaco-editor .codelens-decoration.${this._styleClassName} { line-height: ${e}px; font-size: ${t}px; padding-right: ${Math.round(t*.5)}px; font-feature-settings: var(${r}) }
.monaco-editor .codelens-decoration.${this._styleClassName} span.codicon { line-height: ${e}px; font-size: ${t}px; }
`;i&&(a+=`.monaco-editor .codelens-decoration.${this._styleClassName} { font-family: var(${o})}`),this._styleElement.textContent=a,this._editor.getContainerDomNode().style.setProperty(o,i??"inherit"),this._editor.getContainerDomNode().style.setProperty(r,n.fontFeatureSettings),this._editor.changeViewZones(l=>{for(let d of this._lenses)d.updateHeight(e,l)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(12))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!lr.has(e)){t&&this._localToDispose.add(Nl(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const n of lr.all(e))if(typeof n.onDidChange=="function"){let o=n.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new bt(()=>{var n;const o=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=fi(r=>A2(e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._getCodeLensModelDelays.update(e,Date.now()-o);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewport()},ve)},this._getCodeLensModelDelays.get(e));this._localToDispose.add(i),this._localToDispose.add(Pe(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{this._editor.changeViewZones(o=>{let r=[],a=-1;this._lenses.forEach(d=>{!d.isValid()||a===d.getLineNumber()?r.push(d):(d.update(o),a=d.getLineNumber())});let l=new pC;r.forEach(d=>{d.dispose(l,o),this._lenses.splice(this._lenses.indexOf(d),1)}),l.commit(n)})}),i.schedule()})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Pe(()=>{if(this._editor.getModel()){const n=zl.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let o=n.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const r of this._lenses){let a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new pC;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t=this._editor.getModel().getLineCount(),i=[],n;for(let a of e.lenses){let l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}const o=zl.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new pC;let c=0,h=0;for(;h<i.length&&c<this._lenses.length;){let u=i[h][0].symbol.range.startLineNumber,f=this._lenses[c].getLineNumber();f<u?(this._lenses[c].dispose(d,l),this._lenses.splice(c,1)):f===u?(this._lenses[c].updateCodeLensSymbols(i[h],d),h++,c++):(this._lenses.splice(c,0,new iN(i[h],this._editor,this._styleClassName,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++,h++)}for(;c<this._lenses.length;)this._lenses[c].dispose(d,l),this._lenses.splice(c,1);for(;h<i.length;)this._lenses.push(new iN(i[h],this._editor,this._styleClassName,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;d.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),n.push(a))}),i.length===0)return;const o=Date.now(),r=fi(a=>{const l=i.map((d,c)=>{const h=new Array(d.length),u=d.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(m=>{h[g]=m},gi):(h[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(u).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(h)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDelays.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{ve(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getLenses(){return this._lenses}};th.ID="css.editor.codeLens";th=nG([mC(1,Wt),mC(2,Qt),mC(3,R2)],th);Xe(th.ID,th);Q(class extends ne{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:I.hasCodeLensProvider,label:p("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return sG(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(Ha),n=e.get(Wt),o=e.get(Qt),r=t.getSelection().positionLineNumber,a=t.getContribution(th.ID),l=[];for(let c of a.getLenses())if(c.getLineNumber()===r)for(let h of c.getItems()){const{command:u}=h.symbol;u&&l.push({label:u.title,command:u})}if(l.length===0)return;const d=yield i.pick(l,{canPickMany:!1});if(d)try{yield n.executeCommand(d.command.id,...d.command.arguments||[])}catch(c){o.error(c)}})}});function oG(s,e){const t=[],n=Hc.ordered(s).reverse().map(o=>Promise.resolve(o.provideDocumentColors(s,e)).then(r=>{if(Array.isArray(r))for(let a of r)t.push({colorInfo:a,provider:o})}));return Promise.all(n).then(()=>t)}function sN(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}He.registerCommand("_executeDocumentColorProvider",function(s,...e){const[t]=e;if(!(t instanceof he))throw Rn();const i=s.get(Vt).getModel(t);if(!i)throw Rn();const n=[],r=Hc.ordered(i).reverse().map(a=>Promise.resolve(a.provideDocumentColors(i,Fe.None)).then(l=>{if(Array.isArray(l))for(let d of l)n.push({range:d.range,color:[d.color.red,d.color.green,d.color.blue,d.color.alpha]})}));return Promise.all(r).then(()=>n)});He.registerCommand("_executeColorPresentationProvider",function(s,...e){const[t,i]=e,{uri:n,range:o}=i;if(!(n instanceof he)||!Array.isArray(t)||t.length!==4||!L.isIRange(o))throw Rn();const[r,a,l,d]=t,c=s.get(Vt).getModel(n);if(!c)throw Rn();const h={range:o,color:{red:r,green:a,blue:l,alpha:d}},u=[],g=Hc.ordered(c).reverse().map(m=>Promise.resolve(m.provideColorPresentations(c,h,Fe.None)).then(b=>{Array.isArray(b)&&u.push(...b)}));return Promise.all(g).then(()=>u)});var rG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},oN=function(s,e){return function(t,i){e(t,i,s)}};const aG=500;let Zl=class O2 extends U{constructor(e,t,i){super(),this._editor=e,this._codeEditorService=t,this._configurationService=i,this._localToDispose=this._register(new X),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=[],this._decorationsTypes=new Set,this._register(e.onDidChangeModel(()=>{this._isEnabled=this.isEnabled(),this.onModelChanged()})),this._register(e.onDidChangeModelLanguage(()=>this.onModelChanged())),this._register(Hc.onDidChange(()=>this.onModelChanged())),this._register(e.onDidChangeConfiguration(()=>{let n=this._isEnabled;this._isEnabled=this.isEnabled(),n!==this._isEnabled&&(this._isEnabled?this.onModelChanged():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isEnabled=this.isEnabled(),this.onModelChanged()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageIdentifier(),i=this._configurationService.getValue(t.language);if(i){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(15)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}onModelChanged(){if(this.stop(),!this._isEnabled)return;const e=this._editor.getModel();!e||!Hc.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new an,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},O2.RECOMPUTE_TIME))})),this.beginCompute())}beginCompute(){this._computePromise=fi(e=>{const t=this._editor.getModel();return t?oG(t,e):Promise.resolve([])}),this._computePromise.then(e=>{this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null},ve)}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:De.EMPTY}));this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((i,n)=>this._colorDatas.set(i,e[n]))}updateColorDecorators(e){let t=[],i={};for(let n=0;n<e.length&&t.length<aG;n++){const{red:o,green:r,blue:a,alpha:l}=e[n].colorInfo.color,d=new Ve(Math.round(o*255),Math.round(r*255),Math.round(a*255),l);let c=sb(`rgba(${d.r},${d.g},${d.b},${d.a})`).toString(16),h=`rgba(${d.r}, ${d.g}, ${d.b}, ${d.a})`,u="colorBox-"+c;!this._decorationsTypes.has(u)&&!i[u]&&this._codeEditorService.registerDecorationType("color-detector-color",u,{before:{contentText:" ",border:"solid 0.1em #000",margin:"0.1em 0.2em 0 0.2em",width:"0.8em",height:"0.8em",backgroundColor:h},dark:{before:{border:"solid 0.1em #eee"}}},void 0,this._editor),i[u]=!0,t.push({range:{startLineNumber:e[n].colorInfo.range.startLineNumber,startColumn:e[n].colorInfo.range.startColumn,endLineNumber:e[n].colorInfo.range.endLineNumber,endColumn:e[n].colorInfo.range.endColumn},options:this._codeEditorService.resolveDecorationOptions(u,!0)})}this._decorationsTypes.forEach(n=>{i[n]||this._codeEditorService.removeDecorationType(n)}),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,t)}removeAllDecorations(){this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,[]),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,[]),this._decorationsTypes.forEach(e=>{this._codeEditorService.removeDecorationType(e)})}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(L.fromPositions(e,e)).filter(n=>this._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}};Zl.ID="editor.contrib.colorDetector";Zl.RECOMPUTE_TIME=1e3;Zl=rG([oN(1,Ge),oN(2,At)],Zl);Xe(Zl.ID,Zl);class P2{constructor(e,t,i,n,o){this._computer=e,this._state=0,this._hoverTime=o,this._firstWaitScheduler=new bt(()=>this._triggerAsyncComputation(),0),this._secondWaitScheduler=new bt(()=>this._triggerSyncComputation(),0),this._loadingMessageScheduler=new bt(()=>this._showLoadingMessage(),0),this._asyncComputationPromise=null,this._asyncComputationPromiseDone=!1,this._completeCallback=t,this._errorCallback=i,this._progressCallback=n}setHoverTime(e){this._hoverTime=e}_firstWaitTime(){return this._hoverTime/2}_secondWaitTime(){return this._hoverTime/2}_loadingMessageTime(){return 3*this._hoverTime}_triggerAsyncComputation(){this._state=2,this._secondWaitScheduler.schedule(this._secondWaitTime()),this._computer.computeAsync?(this._asyncComputationPromiseDone=!1,this._asyncComputationPromise=fi(e=>this._computer.computeAsync(e)),this._asyncComputationPromise.then(e=>{this._asyncComputationPromiseDone=!0,this._withAsyncResult(e)},e=>this._onError(e))):this._asyncComputationPromiseDone=!0}_triggerSyncComputation(){this._computer.computeSync&&this._computer.onResult(this._computer.computeSync(),!0),this._asyncComputationPromiseDone?(this._state=0,this._onComplete(this._computer.getResult())):(this._state=3,this._onProgress(this._computer.getResult()))}_showLoadingMessage(){this._state===3&&this._onProgress(this._computer.getResultWithLoadingMessage())}_withAsyncResult(e){e&&this._computer.onResult(e,!1),this._state===3&&(this._state=0,this._onComplete(this._computer.getResult()))}_onComplete(e){this._completeCallback(e)}_onError(e){this._errorCallback?this._errorCallback(e):ve(e)}_onProgress(e){this._progressCallback(e)}start(e){if(e===0)this._state===0&&(this._state=1,this._firstWaitScheduler.schedule(this._firstWaitTime()),this._loadingMessageScheduler.schedule(this._loadingMessageTime()));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._loadingMessageScheduler.cancel(),this._state===1&&this._firstWaitScheduler.cancel(),this._state===2&&(this._secondWaitScheduler.cancel(),this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null)),this._state===3&&this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null),this._state=0}}const dp=Y;class lG extends U{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this._scrollbar=this._register(new sg(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this._scrollbar.getDomNode())}onContentsChanged(){this._scrollbar.scanDomNode()}}class cD extends U{constructor(e,t,i){super(),this.actionContainer=$(e,dp("div.action-container")),this.action=$(this.actionContainer,dp("a.action")),this.action.setAttribute("href","#"),this.action.setAttribute("role","button"),t.iconClass&&$(this.action,dp(`span.icon.${t.iconClass}`));const n=$(this.action,dp("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register(K(this.actionContainer,le.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this.setEnabled(!0)}static render(e,t,i){return new cD(e,t,i)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function F2(s){if(!s)return;typeof s=="string"&&(s=he.file(s));const e=Is(s)||(s.scheme===Oe.file?s.fsPath:s.path);return Si&&K5(e)?W1(e):e}function W1(s){return KM(s)?s.charAt(0).toUpperCase()+s.slice(1):s}var dG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Xa=function(s,e){return function(t,i){e(t,i,s)}};let Yl=class extends mf{constructor(e,t,i,n,o,r,a,l,d,c){super(e,Object.assign(Object.assign({},i.getRawOptions()),{overflowWidgetsDomNode:i.getOverflowWidgetsDomNode()}),{},n,o,r,a,l,d,c),this._parentEditor=i,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(i.onDidChangeConfiguration(h=>this._onParentConfigurationChanged(h)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){eo(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Yl=dG([Xa(3,qe),Xa(4,Ge),Xa(5,Wt),Xa(6,we),Xa(7,pt),Xa(8,Qt),Xa(9,Hn)],Yl);const rN=new B(new Ve(0,122,204)),cG={showArrow:!0,showFrame:!0,className:"",frameColor:rN,arrowColor:rN,keepEditorSelection:!1},hG="vs.editor.contrib.zoneWidget";class uG{constructor(e,t,i,n,o,r){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class fG{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class dv{constructor(e){this._editor=e,this._ruleName=dv._IdGenerator.nextId(),this._decorations=[],this._color=null,this._height=-1}dispose(){this.hide(),Sm(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){Sm(this._ruleName),Z0(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){this._decorations=this._editor.deltaDecorations(this._decorations,[{range:L.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._editor.deltaDecorations(this._decorations,[])}}dv._IdGenerator=new Gx(".arrow-decoration-");class gG{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._positionMarkerId=[],this._viewZone=null,this._disposables=new X,this.container=null,this._isShowing=!1,this.editor=e,this.options=Zr(t),eo(this.options,cG,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this.editor.deltaDecorations(this._positionMarkerId,[]),this._positionMarkerId=[],this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new dv(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){let t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash&&this._resizeSash.layout()}get position(){const[e]=this._positionMarkerId;if(!e)return;const t=this.editor.getModel();if(!t)return;const i=t.getDecorationRange(e);if(i)return i.getStartPosition()}show(e,t){const i=L.isIRange(e)?L.lift(e):L.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:i,options:De.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()}_decoratingElementsHeight(){let e=this.editor.getOption(56),t=0;if(this.options.showArrow){let i=Math.round(e/3);t+=2*i}if(this.options.showFrame){let i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(56),l=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,l);let d=0,c=0;if(this._arrow&&this.options.showArrow&&(d=Math.round(a/3),this._arrow.height=d,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(f=>{this._viewZone&&f.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new uG(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g)),this._viewZone.id=f.addZone(this._viewZone),this._overlayWidget=new fG(hG+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const f=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=f+"px",this.container.style.borderBottomWidth=f+"px"}let h=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=d+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,o),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const f=e.endLineNumber+1;f<=u.getLineCount()?this.revealLine(f,!1):this.revealLine(u.getLineCount(),!0)}}revealLine(e,t){t?this.editor.revealLineInCenter(e,0):this.editor.revealLine(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Ti(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.hide(),this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){let i=(t.currentY-e.startY)/this.editor.getOption(56),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}class pG extends bb{constructor(e,t){super(),this._onDidChangeVisibility=new M,this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=$(e,Y(".monaco-dropdown")),this._label=$(this._element,Y(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[le.CLICK,le.MOUSE_DOWN,vt.Tap])this._register(K(this.element,o,r=>et.stop(r,!0)));for(const o of[le.MOUSE_DOWN,vt.Tap])this._register(K(this._label,o,r=>{r instanceof MouseEvent&&r.detail>1||(this.visible?this.hide():this.show())}));this._register(K(this._label,le.KEY_UP,o=>{const r=new Mt(o);(r.equals(3)||r.equals(10))&&(et.stop(o,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(ot.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class mG extends pG{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:e=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class _G extends Ec{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new M),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=$(o,Y("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),n={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new mG(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return o.options.anchorAlignmentProvider()}})}this.updateEnabled()}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}updateEnabled(){var e,t;const i=!this.getAction().enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}}var B2=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},tm=function(s,e){return function(t,i){e(t,i,s)}},bG=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function vG(s,e,t,i,n,o,r){const a=s.getActions(e);return CG(a,t,!1,i,n,o,r),wG(a)}function wG(s){const e=new X;for(const[,t]of s)for(const i of t)e.add(i);return e}function CG(s,e,t,i=a=>a==="navigation",n=Number.MAX_SAFE_INTEGER,o=()=>!1,r=!1){let a,l;Array.isArray(e)?(a=e,l=e):(a=e.primary,l=e.secondary);const d=new Set;for(const[c,h]of s){let u;i(c)?(u=a,u.length>0&&r&&u.push(new Ls)):(u=l,u.length>0&&u.push(new Ls));for(let f of h){const g=u.push(f);f instanceof vb&&d.add({group:c,action:f,index:g-1})}}for(const{group:c,action:h,index:u}of d){const f=i(c)?a:l,g=h.actions;(g.length<=1||f.length+g.length-2<=n)&&o(h,c,f.length)&&f.splice(u,1,...g)}if(a!==l&&a.length>n){const c=a.splice(n,a.length-n);l.unshift(...c,new Ls)}}let V_=class extends bf{constructor(e,t,i,n,o){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Es),this._altKey=ul.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return bG(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}})}render(e){super.render(e),e.classList.add("menu-entry"),this._updateItemClass(this._menuItemAction.item);let t=!1,i=this._altKey.keyStatus.altKey||(Si||sn)&&this._altKey.keyStatus.shiftKey;const n=()=>{const o=t&&i;o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._menuItemAction.alt&&this._register(this._altKey.event(o=>{i=o.altKey||(Si||sn)&&o.shiftKey,n()})),this._register(K(e,"mouseleave",o=>{t=!1,n()})),this._register(K(e,"mouseenter",o=>{t=!0,n()}))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}updateTooltip(){if(this.label){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let n=t?p("titleAndKb","{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt){const o=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,r=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=r&&r.getLabel(),l=a?p("titleAndKb","{0} ({1})",o,a):o;n+=`
[${DL.modifierLabels[ps].altKey}] ${l}`}this.label.title=n}}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;const{element:i,label:n}=this;if(!i||!n)return;const o=this._commandAction.checked&&(!((t=e.toggled)===null||t===void 0)&&t.icon)?e.toggled.icon:e.icon;if(o)if(wt.isThemeIcon(o)){const r=wt.asClassNameArray(o);n.classList.add(...r),this._itemClassDispose.value=Pe(()=>{n.classList.remove(...r)})}else o.light&&n.style.setProperty("--menu-entry-icon-light",xr(o.light)),o.dark&&n.style.setProperty("--menu-entry-icon-dark",xr(o.dark)),n.classList.add("icon"),this._itemClassDispose.value=Pe(()=>{n.classList.remove("icon"),n.style.removeProperty("--menu-entry-icon-light"),n.style.removeProperty("--menu-entry-icon-dark")})}};V_=B2([tm(2,Lt),tm(3,Qt),tm(4,we)],V_);let V1=class extends _G{constructor(e,t){super(e,{getActions:()=>e.actions},t,{menuAsChild:!0,classNames:wt.isThemeIcon(e.item.icon)?wt.asClassName(e.item.icon):void 0})}render(e){if(super.render(e),this.element){e.classList.add("menu-entry");const{icon:t}=this._action.item;t&&!wt.isThemeIcon(t)&&(this.element.classList.add("icon"),t.light&&this.element.style.setProperty("--menu-entry-icon-light",xr(t.light)),t.dark&&this.element.style.setProperty("--menu-entry-icon-dark",xr(t.dark)))}}};V1=B2([tm(1,wd)],V1);function SG(s,e){return e instanceof Uc?s.createInstance(V_,e,void 0):e instanceof ML?s.createInstance(V1,e):void 0}var W2=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},V2=function(s,e){return function(t,i){e(t,i,s)}};const H2=Ze("IPeekViewService");vd(H2,class{constructor(){this._widgets=new Map}addExclusiveWidget(s,e){const t=this._widgets.get(s);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(s);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(s))};this._widgets.set(s,{widget:e,listener:e.onDidClose(i)})}});var Cn;(function(s){s.inPeekEditor=new se("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(Cn||(Cn={}));let Nf=class{constructor(e,t){e instanceof Yl&&Cn.inPeekEditor.bindTo(t)}dispose(){}};Nf.ID="editor.contrib.referenceController";Nf=W2([V2(1,we)],Nf);Xe(Nf.ID,Nf);function yG(s){let e=s.get(Ge).getFocusedCodeEditor();return e instanceof Yl?e.getParentEditor():e}const LG={headerBackgroundColor:B.white,primaryHeadingColor:B.fromHex("#333333"),secondaryHeadingColor:B.fromHex("#6c6c6cb3")};let H_=class extends gG{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new M,this.onDidClose=this._onDidClose.event,eo(this.options,LG,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){let t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=Y(".head"),this._bodyElement=Y(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){const i=Y(".peekview-title");$(this._headElement,i),Gt(i,"click",r=>this._onTitleClick(r)),this._fillTitleIcon(i),this._primaryHeading=Y("span.filename"),this._secondaryHeading=Y("span.dirname"),this._metaHeading=Y("span.meta"),$(i,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=Y(".peekview-actions");$(this._headElement,n);const o=this._getActionBarOptions();this._actionbarWidget=new Nr(n,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new ys("peekview.close",p("label.close","Close"),te.close.classNames,!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:SG.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:hi(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,En(this._metaHeading)):Qi(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(56)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};H_=W2([V2(2,qe)],H_);const xG=T("peekViewTitle.background",{dark:"#1E1E1E",light:"#FFFFFF",hc:"#0C141F"},p("peekViewTitleBackground","Background color of the peek view title area.")),z2=T("peekViewTitleLabel.foreground",{dark:"#FFFFFF",light:"#333333",hc:"#FFFFFF"},p("peekViewTitleForeground","Color of the peek view title.")),U2=T("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161e6",hc:"#FFFFFF99"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),DG=T("peekView.border",{dark:"#007acc",light:"#007acc",hc:Xt},p("peekViewBorder","Color of the peek view borders and arrow.")),$2=T("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:B.black},p("peekViewResultsBackground","Background color of the peek view result list.")),kG=T("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:B.white},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),IG=T("peekViewResult.fileForeground",{dark:B.white,light:"#1E1E1E",hc:B.white},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),EG=T("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),NG=T("peekViewResult.selectionForeground",{dark:B.white,light:"#6C6C6C",hc:B.white},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),im=T("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:B.black},p("peekViewEditorBackground","Background color of the peek view editor.")),MG=T("peekViewEditorGutter.background",{dark:im,light:im,hc:im},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),TG=T("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),AG=T("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),RG=T("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:Vi},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var H1;(function(s){function e(t){switch(t){case It.Ignore:return"severity-ignore "+te.info.classNames;case It.Info:return te.info.classNames;case It.Warning:return te.warning.classNames;case It.Error:return te.error.classNames;default:return""}}s.className=e})(H1||(H1={}));tt((s,e)=>{const t=s.getColor(z8);if(t){const o=te.error.cssSelector;e.addRule(`
.monaco-editor .zone-widget ${o},
.markers-panel .marker-icon${o},
.text-search-provider-messages .providerMessage ${o},
.extensions-viewlet > .extensions ${o} {
color: ${t};
}
`)}const i=s.getColor(U8);if(i){const o=te.warning.cssSelector;e.addRule(`
.monaco-editor .zone-widget ${o},
.markers-panel .marker-icon${o},
.extensions-viewlet > .extensions ${o},
.extension-editor ${o},
.text-search-provider-messages .providerMessage ${o},
.preferences-editor ${o} {
color: ${i};
}
`)}const n=s.getColor($8);if(n){const o=te.info.cssSelector;e.addRule(`
.monaco-editor .zone-widget ${o},
.markers-panel .marker-icon${o},
.extensions-viewlet > .extensions ${o},
.text-search-provider-messages .providerMessage ${o},
.extension-editor ${o} {
color: ${n};
}
`)}});var OG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$d=function(s,e){return function(t,i){e(t,i,s)}};class PG{constructor(e,t,i,n,o){this._openerService=n,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new X,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Gt(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new ox(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:3,verticalScrollbarSize:3}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){$e(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let r=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=Fa(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);hi(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),u.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=Y("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=$(this._codeLink,Y("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(hi(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),vn(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(56)*.66)}px`,this._lines+=1;for(const f of n){let g=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${F2(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);let b=document.createElement("span");b.innerText=f.message,g.appendChild(m),g.appendChild(b),this._lines+=1,u.appendChild(g)}}const d=this._editor.getOption(40),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case yt.Error:t=p("Error","Error");break;case yt.Warning:t=p("Warning","Warning");break;case yt.Info:t=p("Info","Info");break;case yt.Hint:t=p("Hint","Hint");break}let i=p("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let ih=class j2 extends H_{constructor(e,t,i,n,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new X,this._onDidSelectRelatedInformation=new M,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=yt.Warning,this._backgroundColor=B.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(VG);let t=FG;this._severity===yt.Warning?t=BG:this._severity===yt.Info&&(t=WG);const i=e.getColor(t);this.style({arrowColor:i,frameColor:i,headerBackgroundColor:this._backgroundColor,primaryHeadingColor:e.getColor(z2),secondaryHeadingColor:e.getColor(U2)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onBeforeRun(n=>this.editor.focus()));const t=[],i=this._menuService.createMenu(j2.TitleMenu,this._contextKeyService);vG(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=$(e,Y(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new PG(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());let n=L.lift(e);const o=this.editor.getPosition();let r=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?p("problems","{0} of {1} problems",t,i):p("change","{0} of {1} problem",t,i);this.setTitle(Is(a.uri),l)}this._icon.className=`codicon ${H1.className(yt.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};ih.TitleMenu=new oe("gotoErrorTitleMenu");ih=OG([$d(1,pt),$d(2,Oo),$d(3,vh),$d(4,qe),$d(5,we),$d(6,lg)],ih);let _C=af(Eu,LA),bC=af(vr,Mb),vC=af(Cl,YL);const FG=T("editorMarkerNavigationError.background",{dark:_C,light:_C,hc:_C},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),BG=T("editorMarkerNavigationWarning.background",{dark:bC,light:bC,hc:bC},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),WG=T("editorMarkerNavigationInfo.background",{dark:vC,light:vC,hc:vC},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),VG=T("editorMarkerNavigation.background",{dark:"#2D2D30",light:B.white,hc:"#0C141F"},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));tt((s,e)=>{const t=s.getColor(ng);t&&(e.addRule(`.monaco-editor .marker-widget a { color: ${t}; }`),e.addRule(`.monaco-editor .marker-widget a.code-link span:hover { color: ${t}; }`))});var q2=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},K2=function(s,e){return function(t,i){e(t,i,s)}};class aN{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let z1=class G2{constructor(e,t){this._markerService=t,this._onDidChange=new M,this.onDidChange=this._onDidChange.event,this._dispoables=new X,this._markers=[],this._nextIdx=-1,he.isUri(e)?this._resourceFilter=n=>n.toString()===e.toString():e&&(this._resourceFilter=e);const i=()=>{this._markers=this._markerService.read({resource:he.isUri(e)?e:void 0,severities:yt.Error|yt.Warning|yt.Info}),typeof e=="function"&&(this._markers=this._markers.filter(n=>this._resourceFilter(n.resource))),this._markers.sort(G2._compareMarker)};i(),this._dispoables.add(t.onMarkerChanged(n=>{(!this._resourceFilter||n.some(o=>this._resourceFilter(o)))&&(i(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new aN(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=_L(this._markers,{resource:e.uri},(r,a)=>$u(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;r<this._markers.length;r++){let a=L.lift(this._markers[r]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new L(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=r,n=!0;break}if(this._markers[r].resource.toString()!==e.uri.toString())break}n||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;let n=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex(n=>n.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(L.containsPosition(this._markers[i],t))return new aN(this._markers[i],i+1,this._markers.length)}}static _compareMarker(e,t){let i=$u(e.resource.toString(),t.resource.toString());return i===0&&(i=yt.compare(e.severity,t.severity)),i===0&&(i=L.compareRangesUsingStarts(e,t)),i}};z1=q2([K2(1,ug)],z1);const Z2=Ze("IMarkerNavigationService");let U1=class{constructor(e){this._markerService=e,this._provider=new Mn}getMarkerList(e){for(let t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new z1(e,this._markerService)}};U1=q2([K2(0,ug)],U1);vd(Z2,U1,!0);var HG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},cp=function(s,e){return function(t,i){e(t,i,s)}},Y2=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let Ea=class nm{constructor(e,t,i,n,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new X,this._editor=e,this._widgetVisible=X2.bindTo(this._contextKeyService)}static get(e){return e.getContribution(nm.ID)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(ih,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var n,o,r;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!L.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:L.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new O(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){return Y2(this,void 0,void 0,function*(){if(this._editor.hasModel()){const i=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(i.move(e,this._editor.getModel(),this._editor.getPosition()),!i.selected)return;if(i.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const n=yield this._editorService.openCodeEditor({resource:i.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:i.selected.marker}},this._editor);n&&(nm.get(n).close(),nm.get(n).nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}})}};Ea.ID="editor.contrib.markerController";Ea=HG([cp(1,Z2),cp(2,we),cp(3,Ge),cp(4,qe)],Ea);class cv extends ne{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){return Y2(this,void 0,void 0,function*(){t.hasModel()&&Ea.get(t).nagivate(this._next,this._multiFile)})}}class wr extends cv{constructor(){super(!0,!1,{id:wr.ID,label:wr.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:578,weight:100},menuOpts:{menuId:ih.TitleMenu,title:wr.LABEL,icon:ki("marker-navigation-next",te.chevronDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}wr.ID="editor.action.marker.next";wr.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class nh extends cv{constructor(){super(!1,!1,{id:nh.ID,label:nh.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:1602,weight:100},menuOpts:{menuId:ih.TitleMenu,title:wr.LABEL,icon:ki("marker-navigation-previous",te.chevronUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}nh.ID="editor.action.marker.prev";nh.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class zG extends cv{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:p("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:66,weight:100},menuOpts:{menuId:oe.MenubarGoMenu,title:p({},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class UG extends cv{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:p("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:1090,weight:100},menuOpts:{menuId:oe.MenubarGoMenu,title:p({},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Xe(Ea.ID,Ea);Q(wr);Q(nh);Q(zG);Q(UG);const X2=new se("markersNavigationVisible",!1),$G=Di.bindToContribution(Ea.get);G(new $G({id:"closeMarkersNavigation",precondition:X2,handler:s=>s.close(),kbOpts:{weight:150,kbExpr:I.focus,primary:9,secondary:[1033]}}));var jG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},lN=function(s,e){return function(t,i){e(t,i,s)}};const ls=Y;class qG{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const dN={type:1,filter:{include:Ae.QuickFix}};let $1=class{constructor(e,t,i,n){this._editor=e,this._hover=t,this._markerDecorationsService=i,this._openerService=n,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),r=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:o,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const h=new L(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new qG(this,h,c))}return r}renderHoverParts(e,t,i){if(!e.length)return U.None;const n=new X;e.forEach(r=>t.appendChild(this.renderMarkerHover(r,n)));const o=e.length===1?e[0]:e.sort((r,a)=>yt.compare(r.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(o,i,n),n}renderMarkerHover(e,t){const i=ls("div.hover-row"),n=$(i,ls("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=$(n,ls("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,o||a)if(a&&typeof a!="string"){const c=ls("span");if(o){const g=$(c,ls("span"));g.innerText=o}const h=$(c,ls("a.code-link"));h.setAttribute("href",a.target.toString()),t.add(K(h,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const u=$(h,ls("span"));u.innerText=a.value;const f=$(n,c);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const c=$(n,ls("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(vn(l))for(const{message:c,resource:h,startLineNumber:u,startColumn:f}of l){const g=$(n,ls("div"));g.style.marginTop="8px";const m=$(g,ls("a"));m.innerText=`${Is(h)}(${u}, ${f}): `,m.style.cursor="pointer",t.add(K(m,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:f}}}).catch(ve)}));const b=$(g,ls("span"));b.innerText=c,this._editor.applyFontInfo(b)}return i}renderMarkerStatusbar(e,t,i){if((e.marker.severity===yt.Error||e.marker.severity===yt.Warning||e.marker.severity===yt.Info)&&t.addAction({label:p("view problem","View Problem"),commandId:wr.ID,run:()=>{this._hover.hide(),Ea.get(this._editor).showAtMarker(e.marker),this._editor.focus()}}),!this._editor.getOption(78)){const n=t.append(ls("div"));this.recentMarkerCodeActionsInfo&&(O_.makeKey(this.recentMarkerCodeActionsInfo.marker)===O_.makeKey(e.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=p("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?U.None:i.add(Nl(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(e.marker);i.add(Pe(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:e.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=p("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(Pe(()=>{l||a.dispose()})),t.addAction({label:p("quick fixes","Quick Fix..."),commandId:xh.Id,run:d=>{l=!0;const c=Gl.get(this._editor),h=vi(d);this._hover.hide(),c.showCodeActions(dN,a,{x:h.left+6,y:h.top+h.height+6})}})})}}getCodeActions(e){return fi(t=>lD(this._editor.getModel(),new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),dN,Cd.None,t))}};$1=jG([lN(2,kL),lN(3,Oo)],$1);var Q2={exports:{}};(function(s,e){(function(t,i){s.exports=i()})(uF,function(){function t(j,V){for(var z=0;z<V.length;z++){var k=V[z];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(j,k.key,k)}}function i(j,V,z){return z&&t(j,z),j}function n(j,V){if(j){if(typeof j=="string")return o(j,V);var z=Object.prototype.toString.call(j).slice(8,-1);if(z==="Object"&&j.constructor&&(z=j.constructor.name),z==="Map"||z==="Set")return Array.from(j);if(z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z))return o(j,V)}}function o(j,V){(V==null||V>j.length)&&(V=j.length);for(var z=0,k=new Array(V);z<V;z++)k[z]=j[z];return k}function r(j,V){var z;if(typeof Symbol>"u"||j[Symbol.iterator]==null){if(Array.isArray(j)||(z=n(j))||V){z&&(j=z);var k=0;return function(){return k>=j.length?{done:!0}:{done:!1,value:j[k++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return z=j[Symbol.iterator](),z.next.bind(z)}function a(j){var V={exports:{}};return j(V,V.exports),V.exports}var l=a(function(j){function V(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function z(k){j.exports.defaults=k}j.exports={defaults:V(),getDefaults:V,changeDefaults:z}}),d=/[&<>"']/,c=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},g=function(V){return f[V]};function m(j,V){if(V){if(d.test(j))return j.replace(c,g)}else if(h.test(j))return j.replace(u,g);return j}var b=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(j){return j.replace(b,function(V,z){return z=z.toLowerCase(),z==="colon"?":":z.charAt(0)==="#"?z.charAt(1)==="x"?String.fromCharCode(parseInt(z.substring(2),16)):String.fromCharCode(+z.substring(1)):""})}var _=/(^|[^\[])\^/g;function w(j,V){j=j.source||j,V=V||"";var z={replace:function(N,R){return R=R.source||R,R=R.replace(_,"$1"),j=j.replace(N,R),z},getRegex:function(){return new RegExp(j,V)}};return z}var C=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(j,V,z){if(j){var k;try{k=decodeURIComponent(v(z)).replace(C,"").toLowerCase()}catch{return null}if(k.indexOf("javascript:")===0||k.indexOf("vbscript:")===0||k.indexOf("data:")===0)return null}V&&!S.test(z)&&(z=A(V,z));try{z=encodeURI(z).replace(/%25/g,"%")}catch{return null}return z}var y={},x=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,P=/^([^:]+:\/*[^/]*)[\s\S]*$/;function A(j,V){y[" "+j]||(x.test(j)?y[" "+j]=j+"/":y[" "+j]=ce(j,"/",!0)),j=y[" "+j];var z=j.indexOf(":")===-1;return V.substring(0,2)==="//"?z?V:j.replace(E,"$1")+V:V.charAt(0)==="/"?z?V:j.replace(P,"$1")+V:j+V}var H={exec:function(){}};function q(j){for(var V=1,z,k;V<arguments.length;V++){z=arguments[V];for(k in z)Object.prototype.hasOwnProperty.call(z,k)&&(j[k]=z[k])}return j}function de(j,V){var z=j.replace(/\|/g,function(R,F,W){for(var pe=!1,ie=F;--ie>=0&&W[ie]==="\\";)pe=!pe;return pe?"|":" |"}),k=z.split(/ \|/),N=0;if(k.length>V)k.splice(V);else for(;k.length<V;)k.push("");for(;N<k.length;N++)k[N]=k[N].trim().replace(/\\\|/g,"|");return k}function ce(j,V,z){var k=j.length;if(k===0)return"";for(var N=0;N<k;){var R=j.charAt(k-N-1);if(R===V&&!z)N++;else if(R!==V&&z)N++;else break}return j.substr(0,k-N)}function be(j,V){if(j.indexOf(V[1])===-1)return-1;for(var z=j.length,k=0,N=0;N<z;N++)if(j[N]==="\\")N++;else if(j[N]===V[0])k++;else if(j[N]===V[1]&&(k--,k<0))return N;return-1}function ke(j){j&&j.sanitize&&!j.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Le(j,V){if(V<1)return"";for(var z="";V>1;)V&1&&(z+=j),V>>=1,j+=j;return z+j}var Se={escape:m,unescape:v,edit:w,cleanUrl:D,noopTest:H,merge:q,splitCells:de,rtrim:ce,findClosingBracket:be,checkSanitizeDeprecation:ke,repeatString:Le},st=l.defaults,pi=Se.rtrim,Zi=Se.splitCells,zt=Se.escape,Ii=Se.findClosingBracket;function rs(j,V,z){var k=V.href,N=V.title?zt(V.title):null,R=j[1].replace(/\\([\[\]])/g,"$1");return j[0].charAt(0)!=="!"?{type:"link",raw:z,href:k,title:N,text:R}:{type:"image",raw:z,href:k,title:N,text:zt(R)}}function Md(j,V){var z=j.match(/^(\s+)(?:```)/);if(z===null)return V;var k=z[1];return V.split(`
`).map(function(N){var R=N.match(/^\s+/);if(R===null)return N;var F=R[0];return F.length>=k.length?N.slice(k.length):N}).join(`
`)}var Td=function(){function j(z){this.options=z||st}var V=j.prototype;return V.space=function(k){var N=this.rules.block.newline.exec(k);if(N)return N[0].length>1?{type:"space",raw:N[0]}:{raw:`
`}},V.code=function(k){var N=this.rules.block.code.exec(k);if(N){var R=N[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:N[0],codeBlockStyle:"indented",text:this.options.pedantic?R:pi(R,`
`)}}},V.fences=function(k){var N=this.rules.block.fences.exec(k);if(N){var R=N[0],F=Md(R,N[3]||"");return{type:"code",raw:R,lang:N[2]?N[2].trim():N[2],text:F}}},V.heading=function(k){var N=this.rules.block.heading.exec(k);if(N){var R=N[2].trim();if(/#$/.test(R)){var F=pi(R,"#");(this.options.pedantic||!F||/ $/.test(F))&&(R=F.trim())}return{type:"heading",raw:N[0],depth:N[1].length,text:R}}},V.nptable=function(k){var N=this.rules.block.nptable.exec(k);if(N){var R={type:"table",header:Zi(N[1].replace(/^ *| *\| *$/g,"")),align:N[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:N[3]?N[3].replace(/\n$/,"").split(`
`):[],raw:N[0]};if(R.header.length===R.align.length){var F=R.align.length,W;for(W=0;W<F;W++)/^ *-+: *$/.test(R.align[W])?R.align[W]="right":/^ *:-+: *$/.test(R.align[W])?R.align[W]="center":/^ *:-+ *$/.test(R.align[W])?R.align[W]="left":R.align[W]=null;for(F=R.cells.length,W=0;W<F;W++)R.cells[W]=Zi(R.cells[W],R.header.length);return R}}},V.hr=function(k){var N=this.rules.block.hr.exec(k);if(N)return{type:"hr",raw:N[0]}},V.blockquote=function(k){var N=this.rules.block.blockquote.exec(k);if(N){var R=N[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:N[0],text:R}}},V.list=function(k){var N=this.rules.block.list.exec(k);if(N){var R=N[0],F=N[2],W=F.length>1,pe={type:"list",raw:R,ordered:W,start:W?+F.slice(0,-1):"",loose:!1,items:[]},ie=N[0].match(this.rules.block.item),ge=!1,Ie,ut,Ri,Rt,Je,Ts,Ad,ja,oo=ie.length;Ri=this.rules.block.listItemStart.exec(ie[0]);for(var xt=0;xt<oo;xt++){if(Ie=ie[xt],R=Ie,xt!==oo-1){if(Rt=this.rules.block.listItemStart.exec(ie[xt+1]),this.options.pedantic?Rt[1].length>Ri[1].length:Rt[1].length>Ri[0].length||Rt[1].length>3){ie.splice(xt,2,ie[xt]+`
`+ie[xt+1]),xt--,oo--;continue}else(!this.options.pedantic||this.options.smartLists?Rt[2][Rt[2].length-1]!==F[F.length-1]:W===(Rt[2].length===1))&&(Je=ie.slice(xt+1).join(`
`),pe.raw=pe.raw.substring(0,pe.raw.length-Je.length),xt=oo-1);Ri=Rt}ut=Ie.length,Ie=Ie.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Ie.indexOf(`
`)&&(ut-=Ie.length,Ie=this.options.pedantic?Ie.replace(/^ {1,4}/gm,""):Ie.replace(new RegExp("^ {1,"+ut+"}","gm"),"")),Ts=ge||/\n\n(?!\s*$)/.test(Ie),xt!==oo-1&&(ge=Ie.charAt(Ie.length-1)===`
`,Ts||(Ts=ge)),Ts&&(pe.loose=!0),this.options.gfm&&(Ad=/^\[[ xX]\] /.test(Ie),ja=void 0,Ad&&(ja=Ie[1]!==" ",Ie=Ie.replace(/^\[[ xX]\] +/,""))),pe.items.push({type:"list_item",raw:R,task:Ad,checked:ja,loose:Ts,text:Ie})}return pe}},V.html=function(k){var N=this.rules.block.html.exec(k);if(N)return{type:this.options.sanitize?"paragraph":"html",raw:N[0],pre:!this.options.sanitizer&&(N[1]==="pre"||N[1]==="script"||N[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):zt(N[0]):N[0]}},V.def=function(k){var N=this.rules.block.def.exec(k);if(N){N[3]&&(N[3]=N[3].substring(1,N[3].length-1));var R=N[1].toLowerCase().replace(/\s+/g," ");return{tag:R,raw:N[0],href:N[2],title:N[3]}}},V.table=function(k){var N=this.rules.block.table.exec(k);if(N){var R={type:"table",header:Zi(N[1].replace(/^ *| *\| *$/g,"")),align:N[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:N[3]?N[3].replace(/\n$/,"").split(`
`):[]};if(R.header.length===R.align.length){R.raw=N[0];var F=R.align.length,W;for(W=0;W<F;W++)/^ *-+: *$/.test(R.align[W])?R.align[W]="right":/^ *:-+: *$/.test(R.align[W])?R.align[W]="center":/^ *:-+ *$/.test(R.align[W])?R.align[W]="left":R.align[W]=null;for(F=R.cells.length,W=0;W<F;W++)R.cells[W]=Zi(R.cells[W].replace(/^ *\| *| *\| *$/g,""),R.header.length);return R}}},V.lheading=function(k){var N=this.rules.block.lheading.exec(k);if(N)return{type:"heading",raw:N[0],depth:N[2].charAt(0)==="="?1:2,text:N[1]}},V.paragraph=function(k){var N=this.rules.block.paragraph.exec(k);if(N)return{type:"paragraph",raw:N[0],text:N[1].charAt(N[1].length-1)===`
`?N[1].slice(0,-1):N[1]}},V.text=function(k){var N=this.rules.block.text.exec(k);if(N)return{type:"text",raw:N[0],text:N[0]}},V.escape=function(k){var N=this.rules.inline.escape.exec(k);if(N)return{type:"escape",raw:N[0],text:zt(N[1])}},V.tag=function(k,N,R){var F=this.rules.inline.tag.exec(k);if(F)return!N&&/^<a /i.test(F[0])?N=!0:N&&/^<\/a>/i.test(F[0])&&(N=!1),!R&&/^<(pre|code|kbd|script)(\s|>)/i.test(F[0])?R=!0:R&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(F[0])&&(R=!1),{type:this.options.sanitize?"text":"html",raw:F[0],inLink:N,inRawBlock:R,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(F[0]):zt(F[0]):F[0]}},V.link=function(k){var N=this.rules.inline.link.exec(k);if(N){var R=N[2].trim();if(!this.options.pedantic&&/^</.test(R)){if(!/>$/.test(R))return;var F=pi(R.slice(0,-1),"\\");if((R.length-F.length)%2===0)return}else{var W=Ii(N[2],"()");if(W>-1){var pe=N[0].indexOf("!")===0?5:4,ie=pe+N[1].length+W;N[2]=N[2].substring(0,W),N[0]=N[0].substring(0,ie).trim(),N[3]=""}}var ge=N[2],Ie="";if(this.options.pedantic){var ut=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ge);ut&&(ge=ut[1],Ie=ut[3])}else Ie=N[3]?N[3].slice(1,-1):"";return ge=ge.trim(),/^</.test(ge)&&(this.options.pedantic&&!/>$/.test(R)?ge=ge.slice(1):ge=ge.slice(1,-1)),rs(N,{href:ge&&ge.replace(this.rules.inline._escapes,"$1"),title:Ie&&Ie.replace(this.rules.inline._escapes,"$1")},N[0])}},V.reflink=function(k,N){var R;if((R=this.rules.inline.reflink.exec(k))||(R=this.rules.inline.nolink.exec(k))){var F=(R[2]||R[1]).replace(/\s+/g," ");if(F=N[F.toLowerCase()],!F||!F.href){var W=R[0].charAt(0);return{type:"text",raw:W,text:W}}return rs(R,F,R[0])}},V.emStrong=function(k,N,R){R===void 0&&(R="");var F=this.rules.inline.emStrong.lDelim.exec(k);if(F&&!(F[3]&&R.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var W=F[1]||F[2]||"";if(!W||W&&(R===""||this.rules.inline.punctuation.exec(R))){var pe=F[0].length-1,ie,ge,Ie=pe,ut=0,Ri=F[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Ri.lastIndex=0,N=N.slice(-1*k.length+pe);(F=Ri.exec(N))!=null;)if(ie=F[1]||F[2]||F[3]||F[4]||F[5]||F[6],!!ie){if(ge=ie.length,F[3]||F[4]){Ie+=ge;continue}else if((F[5]||F[6])&&pe%3&&!((pe+ge)%3)){ut+=ge;continue}if(Ie-=ge,!(Ie>0)){if(Ie+ut-ge<=0&&!N.slice(Ri.lastIndex).match(Ri)&&(ge=Math.min(ge,ge+Ie+ut)),Math.min(pe,ge)%2)return{type:"em",raw:k.slice(0,pe+F.index+ge+1),text:k.slice(1,pe+F.index+ge)};if(Math.min(pe,ge)%2===0)return{type:"strong",raw:k.slice(0,pe+F.index+ge+1),text:k.slice(2,pe+F.index+ge-1)}}}}}},V.codespan=function(k){var N=this.rules.inline.code.exec(k);if(N){var R=N[2].replace(/\n/g," "),F=/[^ ]/.test(R),W=/^ /.test(R)&&/ $/.test(R);return F&&W&&(R=R.substring(1,R.length-1)),R=zt(R,!0),{type:"codespan",raw:N[0],text:R}}},V.br=function(k){var N=this.rules.inline.br.exec(k);if(N)return{type:"br",raw:N[0]}},V.del=function(k){var N=this.rules.inline.del.exec(k);if(N)return{type:"del",raw:N[0],text:N[2]}},V.autolink=function(k,N){var R=this.rules.inline.autolink.exec(k);if(R){var F,W;return R[2]==="@"?(F=zt(this.options.mangle?N(R[1]):R[1]),W="mailto:"+F):(F=zt(R[1]),W=F),{type:"link",raw:R[0],text:F,href:W,tokens:[{type:"text",raw:F,text:F}]}}},V.url=function(k,N){var R;if(R=this.rules.inline.url.exec(k)){var F,W;if(R[2]==="@")F=zt(this.options.mangle?N(R[0]):R[0]),W="mailto:"+F;else{var pe;do pe=R[0],R[0]=this.rules.inline._backpedal.exec(R[0])[0];while(pe!==R[0]);F=zt(R[0]),R[1]==="www."?W="http://"+F:W=F}return{type:"link",raw:R[0],text:F,href:W,tokens:[{type:"text",raw:F,text:F}]}}},V.inlineText=function(k,N,R){var F=this.rules.inline.text.exec(k);if(F){var W;return N?W=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(F[0]):zt(F[0]):F[0]:W=zt(this.options.smartypants?R(F[0]):F[0]),{type:"text",raw:F[0],text:W}}},j}(),Uo=Se.noopTest,Et=Se.edit,$a=Se.merge,Ne={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Uo,table:Uo,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ne._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ne._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ne.def=Et(Ne.def).replace("label",Ne._label).replace("title",Ne._title).getRegex(),Ne.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ne.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Ne.item=Et(Ne.item,"gm").replace(/bull/g,Ne.bullet).getRegex(),Ne.listItemStart=Et(/^( *)(bull)/).replace("bull",Ne.bullet).getRegex(),Ne.list=Et(Ne.list).replace(/bull/g,Ne.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ne.def.source+")").getRegex(),Ne._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ne._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Ne.html=Et(Ne.html,"i").replace("comment",Ne._comment).replace("tag",Ne._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ne.paragraph=Et(Ne._paragraph).replace("hr",Ne.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ne._tag).getRegex(),Ne.blockquote=Et(Ne.blockquote).replace("paragraph",Ne.paragraph).getRegex(),Ne.normal=$a({},Ne),Ne.gfm=$a({},Ne.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Ne.gfm.nptable=Et(Ne.gfm.nptable).replace("hr",Ne.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ne._tag).getRegex(),Ne.gfm.table=Et(Ne.gfm.table).replace("hr",Ne.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ne._tag).getRegex(),Ne.pedantic=$a({},Ne.normal,{html:Et(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ne._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Uo,paragraph:Et(Ne.normal._paragraph).replace("hr",Ne.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Ne.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Uo,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_]*?\*[^_]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^*]*?\_[^*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Uo,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Ce.punctuation=Et(Ce.punctuation).replace(/punctuation/g,Ce._punctuation).getRegex(),Ce.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ce.escapedEmSt=/\\\*|\\_/g,Ce._comment=Et(Ne._comment).replace("(?:-->|$)","-->").getRegex(),Ce.emStrong.lDelim=Et(Ce.emStrong.lDelim).replace(/punct/g,Ce._punctuation).getRegex(),Ce.emStrong.rDelimAst=Et(Ce.emStrong.rDelimAst,"g").replace(/punct/g,Ce._punctuation).getRegex(),Ce.emStrong.rDelimUnd=Et(Ce.emStrong.rDelimUnd,"g").replace(/punct/g,Ce._punctuation).getRegex(),Ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ce._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])?)+(?![-_])/,Ce.autolink=Et(Ce.autolink).replace("scheme",Ce._scheme).replace("email",Ce._email).getRegex(),Ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ce.tag=Et(Ce.tag).replace("comment",Ce._comment).replace("attribute",Ce._attribute).getRegex(),Ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ce._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ce.link=Et(Ce.link).replace("label",Ce._label).replace("href",Ce._href).replace("title",Ce._title).getRegex(),Ce.reflink=Et(Ce.reflink).replace("label",Ce._label).getRegex(),Ce.reflinkSearch=Et(Ce.reflinkSearch,"g").replace("reflink",Ce.reflink).replace("nolink",Ce.nolink).getRegex(),Ce.normal=$a({},Ce),Ce.pedantic=$a({},Ce.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Et(/^!?\[(label)\]\((.*?)\)/).replace("label",Ce._label).getRegex(),reflink:Et(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ce._label).getRegex()}),Ce.gfm=$a({},Ce.normal,{escape:Et(Ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),Ce.gfm.url=Et(Ce.gfm.url,"i").replace("email",Ce.gfm._extended_email).getRegex(),Ce.breaks=$a({},Ce.gfm,{br:Et(Ce.br).replace("{2,}","*").getRegex(),text:Et(Ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var RD={block:Ne,inline:Ce},JP=l.defaults,yg=RD.block,Th=RD.inline,OD=Se.repeatString;function eF(j){return j.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function PD(j){var V="",z,k,N=j.length;for(z=0;z<N;z++)k=j.charCodeAt(z),Math.random()>.5&&(k="x"+k.toString(16)),V+="&#"+k+";";return V}var Ah=function(){function j(z){this.tokens=[],this.tokens.links=Object.create(null),this.options=z||JP,this.options.tokenizer=this.options.tokenizer||new Td,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var k={block:yg.normal,inline:Th.normal};this.options.pedantic?(k.block=yg.pedantic,k.inline=Th.pedantic):this.options.gfm&&(k.block=yg.gfm,this.options.breaks?k.inline=Th.breaks:k.inline=Th.gfm),this.tokenizer.rules=k}j.lex=function(k,N){var R=new j(N);return R.lex(k)},j.lexInline=function(k,N){var R=new j(N);return R.inlineTokens(k)};var V=j.prototype;return V.lex=function(k){return k=k.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(k,this.tokens,!0),this.inline(this.tokens),this.tokens},V.blockTokens=function(k,N,R){N===void 0&&(N=[]),R===void 0&&(R=!0),this.options.pedantic&&(k=k.replace(/^ +$/gm,""));for(var F,W,pe,ie;k;){if(F=this.tokenizer.space(k)){k=k.substring(F.raw.length),F.type&&N.push(F);continue}if(F=this.tokenizer.code(k)){k=k.substring(F.raw.length),ie=N[N.length-1],ie&&ie.type==="paragraph"?(ie.raw+=`
`+F.raw,ie.text+=`
`+F.text):N.push(F);continue}if(F=this.tokenizer.fences(k)){k=k.substring(F.raw.length),N.push(F);continue}if(F=this.tokenizer.heading(k)){k=k.substring(F.raw.length),N.push(F);continue}if(F=this.tokenizer.nptable(k)){k=k.substring(F.raw.length),N.push(F);continue}if(F=this.tokenizer.hr(k)){k=k.substring(F.raw.length),N.push(F);continue}if(F=this.tokenizer.blockquote(k)){k=k.substring(F.raw.length),F.tokens=this.blockTokens(F.text,[],R),N.push(F);continue}if(F=this.tokenizer.list(k)){for(k=k.substring(F.raw.length),pe=F.items.length,W=0;W<pe;W++)F.items[W].tokens=this.blockTokens(F.items[W].text,[],!1);N.push(F);continue}if(F=this.tokenizer.html(k)){k=k.substring(F.raw.length),N.push(F);continue}if(R&&(F=this.tokenizer.def(k))){k=k.substring(F.raw.length),this.tokens.links[F.tag]||(this.tokens.links[F.tag]={href:F.href,title:F.title});continue}if(F=this.tokenizer.table(k)){k=k.substring(F.raw.length),N.push(F);continue}if(F=this.tokenizer.lheading(k)){k=k.substring(F.raw.length),N.push(F);continue}if(R&&(F=this.tokenizer.paragraph(k))){k=k.substring(F.raw.length),N.push(F);continue}if(F=this.tokenizer.text(k)){k=k.substring(F.raw.length),ie=N[N.length-1],ie&&ie.type==="text"?(ie.raw+=`
`+F.raw,ie.text+=`
`+F.text):N.push(F);continue}if(k){var ge="Infinite loop on byte: "+k.charCodeAt(0);if(this.options.silent){console.error(ge);break}else throw new Error(ge)}}return N},V.inline=function(k){var N,R,F,W,pe,ie,ge=k.length;for(N=0;N<ge;N++)switch(ie=k[N],ie.type){case"paragraph":case"text":case"heading":{ie.tokens=[],this.inlineTokens(ie.text,ie.tokens);break}case"table":{for(ie.tokens={header:[],cells:[]},W=ie.header.length,R=0;R<W;R++)ie.tokens.header[R]=[],this.inlineTokens(ie.header[R],ie.tokens.header[R]);for(W=ie.cells.length,R=0;R<W;R++)for(pe=ie.cells[R],ie.tokens.cells[R]=[],F=0;F<pe.length;F++)ie.tokens.cells[R][F]=[],this.inlineTokens(pe[F],ie.tokens.cells[R][F]);break}case"blockquote":{this.inline(ie.tokens);break}case"list":{for(W=ie.items.length,R=0;R<W;R++)this.inline(ie.items[R].tokens);break}}return k},V.inlineTokens=function(k,N,R,F){N===void 0&&(N=[]),R===void 0&&(R=!1),F===void 0&&(F=!1);var W,pe,ie=k,ge,Ie,ut;if(this.tokens.links){var Ri=Object.keys(this.tokens.links);if(Ri.length>0)for(;(ge=this.tokenizer.rules.inline.reflinkSearch.exec(ie))!=null;)Ri.includes(ge[0].slice(ge[0].lastIndexOf("[")+1,-1))&&(ie=ie.slice(0,ge.index)+"["+OD("a",ge[0].length-2)+"]"+ie.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ge=this.tokenizer.rules.inline.blockSkip.exec(ie))!=null;)ie=ie.slice(0,ge.index)+"["+OD("a",ge[0].length-2)+"]"+ie.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(ge=this.tokenizer.rules.inline.escapedEmSt.exec(ie))!=null;)ie=ie.slice(0,ge.index)+"++"+ie.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;k;){if(Ie||(ut=""),Ie=!1,W=this.tokenizer.escape(k)){k=k.substring(W.raw.length),N.push(W);continue}if(W=this.tokenizer.tag(k,R,F)){k=k.substring(W.raw.length),R=W.inLink,F=W.inRawBlock;var Rt=N[N.length-1];Rt&&W.type==="text"&&Rt.type==="text"?(Rt.raw+=W.raw,Rt.text+=W.text):N.push(W);continue}if(W=this.tokenizer.link(k)){k=k.substring(W.raw.length),W.type==="link"&&(W.tokens=this.inlineTokens(W.text,[],!0,F)),N.push(W);continue}if(W=this.tokenizer.reflink(k,this.tokens.links)){k=k.substring(W.raw.length);var Je=N[N.length-1];W.type==="link"?(W.tokens=this.inlineTokens(W.text,[],!0,F),N.push(W)):Je&&W.type==="text"&&Je.type==="text"?(Je.raw+=W.raw,Je.text+=W.text):N.push(W);continue}if(W=this.tokenizer.emStrong(k,ie,ut)){k=k.substring(W.raw.length),W.tokens=this.inlineTokens(W.text,[],R,F),N.push(W);continue}if(W=this.tokenizer.codespan(k)){k=k.substring(W.raw.length),N.push(W);continue}if(W=this.tokenizer.br(k)){k=k.substring(W.raw.length),N.push(W);continue}if(W=this.tokenizer.del(k)){k=k.substring(W.raw.length),W.tokens=this.inlineTokens(W.text,[],R,F),N.push(W);continue}if(W=this.tokenizer.autolink(k,PD)){k=k.substring(W.raw.length),N.push(W);continue}if(!R&&(W=this.tokenizer.url(k,PD))){k=k.substring(W.raw.length),N.push(W);continue}if(W=this.tokenizer.inlineText(k,F,eF)){k=k.substring(W.raw.length),W.raw.slice(-1)!=="_"&&(ut=W.raw.slice(-1)),Ie=!0,pe=N[N.length-1],pe&&pe.type==="text"?(pe.raw+=W.raw,pe.text+=W.text):N.push(W);continue}if(k){var Ts="Infinite loop on byte: "+k.charCodeAt(0);if(this.options.silent){console.error(Ts);break}else throw new Error(Ts)}}return N},i(j,null,[{key:"rules",get:function(){return{block:yg,inline:Th}}}]),j}(),tF=l.defaults,FD=Se.cleanUrl,Lg=Se.escape,Hv=function(){function j(z){this.options=z||tF}var V=j.prototype;return V.code=function(k,N,R){var F=(N||"").match(/\S*/)[0];if(this.options.highlight){var W=this.options.highlight(k,F);W!=null&&W!==k&&(R=!0,k=W)}return k=k.replace(/\n$/,"")+`
`,F?'<pre><code class="'+this.options.langPrefix+Lg(F,!0)+'">'+(R?k:Lg(k,!0))+`</code></pre>
`:"<pre><code>"+(R?k:Lg(k,!0))+`</code></pre>
`},V.blockquote=function(k){return`<blockquote>
`+k+`</blockquote>
`},V.html=function(k){return k},V.heading=function(k,N,R,F){return this.options.headerIds?"<h"+N+' id="'+this.options.headerPrefix+F.slug(R)+'">'+k+"</h"+N+`>
`:"<h"+N+">"+k+"</h"+N+`>
`},V.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},V.list=function(k,N,R){var F=N?"ol":"ul",W=N&&R!==1?' start="'+R+'"':"";return"<"+F+W+`>
`+k+"</"+F+`>
`},V.listitem=function(k){return"<li>"+k+`</li>
`},V.checkbox=function(k){return"<input "+(k?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},V.paragraph=function(k){return"<p>"+k+`</p>
`},V.table=function(k,N){return N&&(N="<tbody>"+N+"</tbody>"),`<table>
<thead>
`+k+`</thead>
`+N+`</table>
`},V.tablerow=function(k){return`<tr>
`+k+`</tr>
`},V.tablecell=function(k,N){var R=N.header?"th":"td",F=N.align?"<"+R+' align="'+N.align+'">':"<"+R+">";return F+k+"</"+R+`>
`},V.strong=function(k){return"<strong>"+k+"</strong>"},V.em=function(k){return"<em>"+k+"</em>"},V.codespan=function(k){return"<code>"+k+"</code>"},V.br=function(){return this.options.xhtml?"<br/>":"<br>"},V.del=function(k){return"<del>"+k+"</del>"},V.link=function(k,N,R){if(k=FD(this.options.sanitize,this.options.baseUrl,k),k===null)return R;var F='<a href="'+Lg(k)+'"';return N&&(F+=' title="'+N+'"'),F+=">"+R+"</a>",F},V.image=function(k,N,R){if(k=FD(this.options.sanitize,this.options.baseUrl,k),k===null)return R;var F='<img src="'+k+'" alt="'+R+'"';return N&&(F+=' title="'+N+'"'),F+=this.options.xhtml?"/>":">",F},V.text=function(k){return k},j}(),BD=function(){function j(){}var V=j.prototype;return V.strong=function(k){return k},V.em=function(k){return k},V.codespan=function(k){return k},V.del=function(k){return k},V.html=function(k){return k},V.text=function(k){return k},V.link=function(k,N,R){return""+R},V.image=function(k,N,R){return""+R},V.br=function(){return""},j}(),WD=function(){function j(){this.seen={}}var V=j.prototype;return V.serialize=function(k){return k.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},V.getNextSafeSlug=function(k,N){var R=k,F=0;if(this.seen.hasOwnProperty(R)){F=this.seen[k];do F++,R=k+"-"+F;while(this.seen.hasOwnProperty(R))}return N||(this.seen[k]=F,this.seen[R]=0),R},V.slug=function(k,N){N===void 0&&(N={});var R=this.serialize(k);return this.getNextSafeSlug(R,N.dryrun)},j}(),iF=l.defaults,nF=Se.unescape,Rh=function(){function j(z){this.options=z||iF,this.options.renderer=this.options.renderer||new Hv,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new BD,this.slugger=new WD}j.parse=function(k,N){var R=new j(N);return R.parse(k)},j.parseInline=function(k,N){var R=new j(N);return R.parseInline(k)};var V=j.prototype;return V.parse=function(k,N){N===void 0&&(N=!0);var R="",F,W,pe,ie,ge,Ie,ut,Ri,Rt,Je,Ts,Ad,ja,oo,xt,zv,zD,Oh,UD=k.length;for(F=0;F<UD;F++)switch(Je=k[F],Je.type){case"space":continue;case"hr":{R+=this.renderer.hr();continue}case"heading":{R+=this.renderer.heading(this.parseInline(Je.tokens),Je.depth,nF(this.parseInline(Je.tokens,this.textRenderer)),this.slugger);continue}case"code":{R+=this.renderer.code(Je.text,Je.lang,Je.escaped);continue}case"table":{for(Ri="",ut="",ie=Je.header.length,W=0;W<ie;W++)ut+=this.renderer.tablecell(this.parseInline(Je.tokens.header[W]),{header:!0,align:Je.align[W]});for(Ri+=this.renderer.tablerow(ut),Rt="",ie=Je.cells.length,W=0;W<ie;W++){for(Ie=Je.tokens.cells[W],ut="",ge=Ie.length,pe=0;pe<ge;pe++)ut+=this.renderer.tablecell(this.parseInline(Ie[pe]),{header:!1,align:Je.align[pe]});Rt+=this.renderer.tablerow(ut)}R+=this.renderer.table(Ri,Rt);continue}case"blockquote":{Rt=this.parse(Je.tokens),R+=this.renderer.blockquote(Rt);continue}case"list":{for(Ts=Je.ordered,Ad=Je.start,ja=Je.loose,ie=Je.items.length,Rt="",W=0;W<ie;W++)xt=Je.items[W],zv=xt.checked,zD=xt.task,oo="",xt.task&&(Oh=this.renderer.checkbox(zv),ja?xt.tokens.length>0&&xt.tokens[0].type==="text"?(xt.tokens[0].text=Oh+" "+xt.tokens[0].text,xt.tokens[0].tokens&&xt.tokens[0].tokens.length>0&&xt.tokens[0].tokens[0].type==="text"&&(xt.tokens[0].tokens[0].text=Oh+" "+xt.tokens[0].tokens[0].text)):xt.tokens.unshift({type:"text",text:Oh}):oo+=Oh),oo+=this.parse(xt.tokens,ja),Rt+=this.renderer.listitem(oo,zD,zv);R+=this.renderer.list(Rt,Ts,Ad);continue}case"html":{R+=this.renderer.html(Je.text);continue}case"paragraph":{R+=this.renderer.paragraph(this.parseInline(Je.tokens));continue}case"text":{for(Rt=Je.tokens?this.parseInline(Je.tokens):Je.text;F+1<UD&&k[F+1].type==="text";)Je=k[++F],Rt+=`
`+(Je.tokens?this.parseInline(Je.tokens):Je.text);R+=N?this.renderer.paragraph(Rt):Rt;continue}default:{var $D='Token with "'+Je.type+'" type was not found.';if(this.options.silent){console.error($D);return}else throw new Error($D)}}return R},V.parseInline=function(k,N){N=N||this.renderer;var R="",F,W,pe=k.length;for(F=0;F<pe;F++)switch(W=k[F],W.type){case"escape":{R+=N.text(W.text);break}case"html":{R+=N.html(W.text);break}case"link":{R+=N.link(W.href,W.title,this.parseInline(W.tokens,N));break}case"image":{R+=N.image(W.href,W.title,W.text);break}case"strong":{R+=N.strong(this.parseInline(W.tokens,N));break}case"em":{R+=N.em(this.parseInline(W.tokens,N));break}case"codespan":{R+=N.codespan(W.text);break}case"br":{R+=N.br();break}case"del":{R+=N.del(this.parseInline(W.tokens,N));break}case"text":{R+=N.text(W.text);break}default:{var ie='Token with "'+W.type+'" type was not found.';if(this.options.silent){console.error(ie);return}else throw new Error(ie)}}return R},j}(),xg=Se.merge,VD=Se.checkSanitizeDeprecation,HD=Se.escape,sF=l.getDefaults,oF=l.changeDefaults,rF=l.defaults;function at(j,V,z){if(typeof j>"u"||j===null)throw new Error("marked(): input parameter is undefined or null");if(typeof j!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(j)+", string expected");if(typeof V=="function"&&(z=V,V=null),V=xg({},at.defaults,V||{}),VD(V),z){var k=V.highlight,N;try{N=Ah.lex(j,V)}catch(pe){return z(pe)}var R=function(ie){var ge;if(!ie)try{ge=Rh.parse(N,V)}catch(Ie){ie=Ie}return V.highlight=k,ie?z(ie):z(null,ge)};if(!k||k.length<3||(delete V.highlight,!N.length))return R();var F=0;at.walkTokens(N,function(pe){pe.type==="code"&&(F++,setTimeout(function(){k(pe.text,pe.lang,function(ie,ge){if(ie)return R(ie);ge!=null&&ge!==pe.text&&(pe.text=ge,pe.escaped=!0),F--,F===0&&R()})},0))}),F===0&&R();return}try{var W=Ah.lex(j,V);return V.walkTokens&&at.walkTokens(W,V.walkTokens),Rh.parse(W,V)}catch(pe){if(pe.message+=`
Please report this to https://github.com/markedjs/marked.`,V.silent)return"<p>An error occurred:</p><pre>"+HD(pe.message+"",!0)+"</pre>";throw pe}}at.options=at.setOptions=function(j){return xg(at.defaults,j),oF(at.defaults),at},at.getDefaults=sF,at.defaults=rF,at.use=function(j){var V=xg({},j);if(j.renderer&&function(){var k=at.defaults.renderer||new Hv,N=function(W){var pe=k[W];k[W]=function(){for(var ie=arguments.length,ge=new Array(ie),Ie=0;Ie<ie;Ie++)ge[Ie]=arguments[Ie];var ut=j.renderer[W].apply(k,ge);return ut===!1&&(ut=pe.apply(k,ge)),ut}};for(var R in j.renderer)N(R);V.renderer=k}(),j.tokenizer&&function(){var k=at.defaults.tokenizer||new Td,N=function(W){var pe=k[W];k[W]=function(){for(var ie=arguments.length,ge=new Array(ie),Ie=0;Ie<ie;Ie++)ge[Ie]=arguments[Ie];var ut=j.tokenizer[W].apply(k,ge);return ut===!1&&(ut=pe.apply(k,ge)),ut}};for(var R in j.tokenizer)N(R);V.tokenizer=k}(),j.walkTokens){var z=at.defaults.walkTokens;V.walkTokens=function(k){j.walkTokens(k),z&&z(k)}}at.setOptions(V)},at.walkTokens=function(j,V){for(var z=r(j),k;!(k=z()).done;){var N=k.value;switch(V(N),N.type){case"table":{for(var R=r(N.tokens.header),F;!(F=R()).done;){var W=F.value;at.walkTokens(W,V)}for(var pe=r(N.tokens.cells),ie;!(ie=pe()).done;)for(var ge=ie.value,Ie=r(ge),ut;!(ut=Ie()).done;){var Ri=ut.value;at.walkTokens(Ri,V)}break}case"list":{at.walkTokens(N.items,V);break}default:N.tokens&&at.walkTokens(N.tokens,V)}}},at.parseInline=function(j,V){if(typeof j>"u"||j===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof j!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(j)+", string expected");V=xg({},at.defaults,V||{}),VD(V);try{var z=Ah.lexInline(j,V);return V.walkTokens&&at.walkTokens(z,V.walkTokens),Rh.parseInline(z,V)}catch(k){if(k.message+=`
Please report this to https://github.com/markedjs/marked.`,V.silent)return"<p>An error occurred:</p><pre>"+HD(k.message+"",!0)+"</pre>";throw k}},at.Parser=Rh,at.parser=Rh.parse,at.Renderer=Hv,at.TextRenderer=BD,at.Lexer=Ah,at.lexer=Ah.lex,at.Tokenizer=Td,at.Slugger=WD,at.parse=at;var aF=at;return aF})})(Q2);var cN=Q2.exports;let J2;(function(){function s(e,t,i){function n(a,l){if(!t[a]){if(!e[a]){var d=typeof require=="function"&&require;if(!l&&d)return d(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var h=t[a]={exports:{}};e[a][0].call(h.exports,function(u){var f=e[a][1][u];return n(f||u)},h,h.exports,s,e,t,i)}return t[a].exports}for(var o=typeof require=="function"&&require,r=0;r<i.length;r++)n(i[r]);return n}return s})()({1:[function(s,e,t){var i=s("./toMap"),n=["background","base","cite","href","longdesc","src","usemap"];e.exports={uris:i(n)}},{"./toMap":10}],2:[function(s,e,t){var i={allowedAttributes:{"*":["title","accesskey"],a:["href","name","target","aria-label"],iframe:["allowfullscreen","frameborder","src"],img:["src","alt","title","aria-label"]},allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],filter:null};e.exports=i},{}],3:[function(s,e,t){var i=s("./toMap"),n=["area","br","col","hr","img","wbr","input","base","basefont","link","meta"];e.exports={voids:i(n)}},{"./toMap":10}],4:[function(s,e,t){s("he");var i=s("assignment"),n=s("./parser"),o=s("./sanitizer"),r=s("./defaults");function a(l,d,c){var h=[],u=c===!0?d:i({},r,d),f=o(h,u);return n(l,f),h.join("")}a.defaults=r,e.exports=a,J2=a},{"./defaults":2,"./parser":7,"./sanitizer":8,assignment:6,he:9}],5:[function(s,e,t){e.exports=function(n){return typeof n=="string"?n.toLowerCase():n}},{}],6:[function(s,e,t){function i(n){for(var o=Array.prototype.slice.call(arguments,1),r,a;o.length;){r=o.shift();for(a in r)r.hasOwnProperty(a)&&(Object.prototype.toString.call(n[a])==="[object Object]"?n[a]=i(n[a],r[a]):n[a]=r[a])}return n}e.exports=i},{}],7:[function(s,e,t){var i=s("he"),n=s("./lowercase");s("./attributes");var o=s("./elements"),r=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,a=/^<\s*\/\s*([\w:-]+)[^>]*>/,l=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,d=/^</,c=/^<\s*\//;function h(){var f=[];return f.lastItem=function(){return f[f.length-1]},f}function u(f,g){for(var m=h(),b=f,v;f;)_();x();function _(){v=!0,w();var E=f===b;b=f,E&&(f="")}function w(){f.substr(0,4)==="<!--"?S():c.test(f)?C(a,x):d.test(f)&&C(r,y),D()}function C(E,P){var A=f.match(E);A&&(f=f.substring(A[0].length),A[0].replace(E,P),v=!1)}function S(){var E=f.indexOf("-->");E>=0&&(g.comment&&g.comment(f.substring(4,E)),f=f.substring(E+3),v=!1)}function D(){if(v){var E,P=f.indexOf("<");P>=0?(E=f.substring(0,P),f=f.substring(P)):(E=f,f=""),g.chars&&g.chars(E)}}function y(E,P,A,H){var q={},de=n(P),ce=o.voids[de]||!!H;A.replace(l,be),ce||m.push(de),g.start&&g.start(de,q,ce);function be(ke,Le,Se,st,pi){Se===void 0&&st===void 0&&pi===void 0?q[Le]=void 0:q[Le]=i.decode(Se||st||pi||"")}}function x(E,P){var A,H=0,q=n(P);if(q)for(H=m.length-1;H>=0&&m[H]!==q;H--);if(H>=0){for(A=m.length-1;A>=H;A--)g.end&&g.end(m[A]);m.length=H}}}e.exports=u},{"./attributes":1,"./elements":3,"./lowercase":5,he:9}],8:[function(s,e,t){var i=s("he"),n=s("./lowercase"),o=s("./attributes"),r=s("./elements");function a(l,d){var c,h=d||{};return w(),{start:f,end:g,chars:b};function u(C){l.push(C)}function f(C,S,D){var y=n(C);if(c.ignoring){v(y);return}if((h.allowedTags||[]).indexOf(y)===-1){v(y);return}if(h.filter&&!h.filter({tag:y,attrs:S})){v(y);return}u("<"),u(y),Object.keys(S).forEach(x),u(D?"/>":">");function x(E){var P=S[E],A=(h.allowedClasses||{})[y]||[],H=(h.allowedAttributes||{})[y]||[];H=H.concat((h.allowedAttributes||{})["*"]||[]);var q,de=n(E);de==="class"&&H.indexOf(de)===-1?(P=P.split(" ").filter(ce).join(" ").trim(),q=P.length):q=H.indexOf(de)!==-1&&(o.uris[de]!==!0||m(P)),q&&(u(" "),u(E),typeof P=="string"&&(u('="'),u(i.encode(P)),u('"')));function ce(be){return A&&A.indexOf(be)!==-1}}}function g(C){var S=n(C),D=(h.allowedTags||[]).indexOf(S)!==-1;D&&c.ignoring===!1?(u("</"),u(S),u(">")):_(S)}function m(C){var S=C[0];if(S==="#"||S==="/")return!0;var D=C.indexOf(":");if(D===-1)return!0;var y=C.indexOf("?");if(y!==-1&&D>y)return!0;var x=C.indexOf("#");if(x!==-1&&D>x)return!0;return h.allowedSchemes.some(E);function E(P){return C.indexOf(P+":")===0}}function b(C){c.ignoring===!1&&u(h.transformText?h.transformText(C):C)}function v(C){r.voids[C]||(c.ignoring===!1?c={ignoring:C,depth:1}:c.ignoring===C&&c.depth++)}function _(C){c.ignoring===C&&--c.depth<=0&&w()}function w(){c={ignoring:!1,depth:0}}}e.exports=a},{"./attributes":1,"./elements":3,"./lowercase":5,he:9}],9:[function(s,e,t){var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},n={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},o=/(&amp;|&lt;|&gt;|&quot;|&#39;)/g,r=/[&<>"']/g;function a(h){return i[h]}function l(h){return n[h]}function d(h){return h==null?"":String(h).replace(r,a)}function c(h){return h==null?"":String(h).replace(o,l)}d.options=c.options={},e.exports={encode:d,escape:d,decode:c,unescape:c,version:"1.0.0-browser"}},{}],10:[function(s,e,t){function i(o){return o.reduce(n,{})}function n(o,r){return o[r]=!0,o}e.exports=i},{}]},{},[4]);var eO=J2,wC;const CC=(wC=window.trustedTypes)===null||wC===void 0?void 0:wC.createPolicy("insane",{createHTML(s,e){return eO(s,e)}});function KG(s,e={},t={}){var i;const n=Xx(e),o=function(u){let f;try{f=Q0(decodeURIComponent(u))}catch{}return f?(f=n3(f,g=>{if(s.uris&&s.uris[g])return he.revive(s.uris[g])}),encodeURIComponent(JSON.stringify(f))):u},r=function(u,f){const g=s.uris&&s.uris[u];if(!g)return u;let m=he.revive(g);return he.parse(u).toString()===m.toString()?u:f?IM.asBrowserUri(m).toString(!0):(m.query&&(m=m.with({query:o(m.query)})),m.toString())};let a;const l=new Promise(u=>a=u),d=new cN.Renderer;if(d.image=(u,f,g)=>{let m=[],b=[];if(u){({href:u,dimensions:m}=oK(u)),u=r(u,!0);try{const v=he.parse(u);e.baseUrl&&v.scheme===Oe.file&&(u=hk(e.baseUrl,u).toString())}catch{}b.push(`src="${u}"`)}return g&&b.push(`alt="${g}"`),f&&b.push(`title="${f}"`),m.length&&(b=b.concat(m)),"<img "+b.join(" ")+">"},d.link=(u,f,g)=>(u===g&&(g=hC(g)),u=r(u,!1),e.baseUrl&&(/^\w[\w\d+.-]*:/.test(u)||(u=hk(e.baseUrl,u).toString())),f=hC(f),u=hC(u),!u||u.match(/^data:|javascript:/i)||u.match(/^command:/i)&&!s.isTrusted||u.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)?g:(u=u.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),`<a href="#" data-href="${u}" title="${f||u}">${g}</a>`)),d.paragraph=u=>(s.supportThemeIcons&&(u=kl(u).map(g=>typeof g=="string"?g:g.outerHTML).join("")),`<p>${u}</p>`),e.codeBlockRenderer&&(d.code=(u,f)=>{const g=e.codeBlockRenderer(f,u),m=XR.nextId(),b=Promise.all([g,l]).then(v=>{const _=n.querySelector(`div[data-code="${m}"]`);_&&ma(_,v[0])}).catch(v=>{});return e.asyncRenderCallback&&b.then(e.asyncRenderCallback),`<div class="code" data-code="${m}">${Yy(u)}</div>`}),e.actionHandler){const u=e.actionHandler.disposeables.add(new ht(n,"click")),f=e.actionHandler.disposeables.add(new ht(n,"auxclick"));e.actionHandler.disposeables.add(re.any(u.event,f.event)(g=>{const m=new Zn(g);if(!m.leftButton&&!m.middleButton)return;let b=m.target;if(!(b.tagName!=="A"&&(b=b.parentElement,!b||b.tagName!=="A")))try{const v=b.dataset.href;v&&e.actionHandler.callback(v,m)}catch(v){ve(v)}finally{m.preventDefault()}}))}t.sanitizer=u=>(s.isTrusted?u.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?u:"",t.sanitize=!0,t.silent=!0,t.renderer=d;let c=(i=s.value)!==null&&i!==void 0?i:"";c.length>1e5&&(c=`${c.substr(0,1e5)}…`),s.supportThemeIcons&&(c=aU(c));const h=cN.parse(c,t);if(n.innerHTML=GG(s,h),a(),e.asyncRenderCallback)for(const u of n.getElementsByTagName("img")){const f=K(u,"load",()=>{f.dispose(),e.asyncRenderCallback()})}return n}function GG(s,e){var t;const i=ZG(s);return(t=CC==null?void 0:CC.createHTML(e,i))!==null&&t!==void 0?t:eO(e,i)}function ZG(s){const e=[Oe.http,Oe.https,Oe.mailto,Oe.data,Oe.file,Oe.vscodeRemote,Oe.vscodeRemoteResource];return s.isTrusted&&e.push(Oe.command),{allowedSchemes:e,allowedTags:["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"],allowedAttributes:{a:["href","name","target","data-href"],img:["src","title","alt","width","height"],div:["class","data-code"],span:["class","style"],th:["align"],td:["align"]},filter(t){return t.tag==="span"&&s.isTrusted?t.attrs.style&&Object.keys(t.attrs).length===1?!!t.attrs.style.match(/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/):t.attrs.class?!!t.attrs.class.match(/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/):!1:!0}}}var YG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},hN=function(s,e){return function(t,i){e(t,i,s)}},XG=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},SC;let Xl=class tO{constructor(e,t,i){this._options=e,this._modeService=t,this._openerService=i,this._onDidRenderAsync=new M,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){const n=new X;let o;return e?o=KG(e,Object.assign(Object.assign({},this._getRenderOptions(e,n)),t),i):o=document.createElement("span"),{element:o,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{baseUrl:this._options.baseUrl,codeBlockRenderer:(i,n)=>XG(this,void 0,void 0,function*(){var o,r,a,l;let d;i?d=this._modeService.getModeIdForLanguageName(i):this._options.editor&&(d=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageIdentifier().language),d||(d="plaintext"),this._modeService.triggerMode(d);const c=(r=yield St.getPromise(d))!==null&&r!==void 0?r:void 0,h=document.createElement("span");h.innerHTML=(l=(a=tO._ttpTokenizer)===null||a===void 0?void 0:a.createHTML(n,c))!==null&&l!==void 0?l:GA(n,c);let u=this._options.codeBlockFontFamily;return this._options.editor&&(u=this._options.editor.getOption(40).fontFamily),u&&(h.style.fontFamily=u),h}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>this._openerService.open(i,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:e.isTrusted}).catch(ve),disposeables:t}}}};Xl._ttpTokenizer=(SC=window.trustedTypes)===null||SC===void 0?void 0:SC.createPolicy("tokenizeToString",{createHTML(s,e){return GA(s,e)}});Xl=YG([hN(1,to),hN(2,Oo)],Xl);function iO(s,e,t){const n=Gu.ordered(s).map(o=>Promise.resolve(o.provideHover(s,e,t)).then(r=>r&&QG(r)?r:void 0,r=>{gi(r)}));return Promise.all(n).then(fd)}Ar("_executeHoverProvider",(s,e)=>iO(s,e,Fe.None));function QG(s){const e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}var JG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},yC=function(s,e){return function(t,i){e(t,i,s)}},eZ=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const uN=Y;class hp{constructor(e,t,i){this.owner=e,this.range=t,this.contents=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let j1=class{constructor(e,t,i,n,o){this._editor=e,this._hover=t,this._modeService=i,this._openerService=n,this._configurationService=o}createLoadingMessage(e){return new hp(this,e.range,[new Ia().appendText(p("modesContentHover.loading","Loading..."))])}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),r=[];for(const d of t){const c=d.range.startLineNumber===n?d.range.startColumn:1,h=d.range.endLineNumber===n?d.range.endColumn:o,u=d.options.hoverMessage;if(!u||Fu(u))continue;const f=new L(e.range.startLineNumber,c,e.range.startLineNumber,h);r.push(new hp(this,f,bL(u)))}const a=this._editor.getModel().getLineLength(n),l=this._configurationService.getValue("editor.maxTokenizationLineLength");return a>=l&&r.push(new hp(this,new L(n,1,n,a+1),[{value:p("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}])),r}computeAsync(e,t,i){return eZ(this,void 0,void 0,function*(){if(!this._editor.hasModel()||e.type!==1)return Promise.resolve([]);const n=this._editor.getModel();if(!Gu.has(n))return Promise.resolve([]);const o=yield iO(n,new O(e.range.startLineNumber,e.range.startColumn),i),r=[];for(const a of o){if(Fu(a.contents))continue;const l=a.range?L.lift(a.range):e.range;r.push(new hp(this,l,a.contents))}return r})}renderHoverParts(e,t,i){const n=new X;for(const o of e)for(const r of o.contents){if(Fu(r))continue;const a=uN("div.hover-row.markdown-hover"),l=$(a,uN("div.hover-contents")),d=n.add(new Xl({editor:this._editor},this._modeService,this._openerService));n.add(d.onDidRenderAsync(()=>{l.className="hover-contents code-hover-contents",this._hover.onContentsChanged()}));const c=n.add(d.render(r));l.appendChild(c.element),t.appendChild(a)}return n}};j1=JG([yC(2,to),yC(3,Oo),yC(4,At)],j1);class fN{constructor(e,t){this.priority=e,this.range=t,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class LC{constructor(e,t,i){this.priority=e,this.owner=t,this.range=i,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}var nO=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},z_=function(s,e){return function(t,i){e(t,i,s)}},xC;const gN=(xC=window.trustedTypes)===null||xC===void 0?void 0:xC.createPolicy("editorGhostText",{createHTML:s=>s});let q1=class extends U{constructor(e,t,i,n){super(),this.editor=e,this.model=t,this.codeEditorService=i,this.themeService=n,this.disposed=!1,this.partsWidget=this._register(new K1(this.editor,this.codeEditorService,this.themeService)),this.additionalLinesWidget=this._register(new tZ(this.editor)),this.viewMoreContentWidget=void 0,this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(27)||o.hasChanged(103)||o.hasChanged(86)||o.hasChanged(80)||o.hasChanged(41)||o.hasChanged(40)||o.hasChanged(56))&&this.update()})),this._register(Pe(()=>{var o;this.disposed=!0,this.update(),(o=this.viewMoreContentWidget)===null||o===void 0||o.dispose(),this.viewMoreContentWidget=void 0})),this._register(t.onDidChange(()=>{this.update()})),this.update()}shouldShowHoverAtViewZone(e){return this.additionalLinesWidget.viewZoneId===e}update(){var e;const t=this.model.ghostText;if(!this.editor.hasModel()||!t||this.disposed){this.partsWidget.clear(),this.additionalLinesWidget.clear();return}const i=new Array,n=new Array;function o(d,c){if(n.length>0){const h=n[n.length-1];c&&h.decorations.push(new An(h.content.length+1,h.content.length+1+d[0].length,c,0)),h.content+=d[0],d=d.slice(1)}for(const h of d)n.push({content:h,decorations:c?[new An(1,h.length+1,c,0)]:[]})}const r=this.editor.getModel().getLineContent(t.lineNumber);this.editor.getModel().getLineTokens(t.lineNumber);let a,l=0;for(const d of t.parts){let c=d.lines;a===void 0?(i.push({column:d.column,text:c[0]}),c=c.slice(1)):o([r.substring(l,d.column-1)],void 0),c.length>0&&(o(c,"ghost-text"),a===void 0&&d.column<=r.length&&(a=d.column)),l=d.column-1}a!==void 0&&o([r.substring(l)],void 0),this.partsWidget.setParts(t.lineNumber,i,a!==void 0?{column:a,length:r.length+1-a}:void 0),this.additionalLinesWidget.updateLines(t.lineNumber,n,t.additionalReservedLineCount),t.parts.some(d=>d.lines.length<0)?this.viewMoreContentWidget=this.renderViewMoreLines(new O(t.lineNumber,this.editor.getModel().getLineMaxColumn(t.lineNumber)),"",0):((e=this.viewMoreContentWidget)===null||e===void 0||e.dispose(),this.viewMoreContentWidget=void 0)}renderViewMoreLines(e,t,i){const n=this.editor.getOption(40),o=document.createElement("div");o.className="suggest-preview-additional-widget",Wi.applyFontInfoSlow(o,n);const r=document.createElement("span");r.className="content-spacer",r.append(t),o.append(r);const a=document.createElement("span");a.className="content-newline suggest-preview-text",a.append("⏎ "),o.append(a);const l=new X,d=document.createElement("div");return d.className="button suggest-preview-text",d.append(`+${i} lines…`),l.add(Gt(d,"mousedown",c=>{var h;(h=this.model)===null||h===void 0||h.setExpanded(!0),c.preventDefault(),this.editor.focus()})),o.append(d),new oZ(this.editor,e,o,l)}};q1=nO([z_(2,Ge),z_(3,pt)],q1);let K1=class{constructor(e,t,i){this.editor=e,this.codeEditorService=t,this.themeService=i,this.decorationIds=[],this.disposableStore=new X}dispose(){this.clear(),this.disposableStore.dispose()}clear(){this.editor.deltaDecorations(this.decorationIds,[]),this.disposableStore.clear()}setParts(e,t,i){this.disposableStore.clear();const n=this.themeService.getColorTheme(),o=n.getColor(BA);let r,a;o&&(r=String(o.rgba.a),a=B.Format.CSS.format(sO(o)));const l=n.getColor(FA);let d;l&&(d=`2px dashed ${l}`);const c=this.editor.getModel();if(!c)return;const{tabSize:h}=c.getOptions(),u=c.getLineContent(e)||"";let f=0,g="";const m=new Array;i&&m.push({range:L.fromPositions(new O(e,i.column),new O(e,i.column+i.length)),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}}),this.decorationIds=this.editor.deltaDecorations(this.decorationIds,t.map(b=>{g+=u.substring(f,b.column-1),f=b.column-1;const v=this.renderSingleLineText(b.text,g,h,!1),_=this.disposableStore.add(sZ(this.codeEditorService,"ghost-text","0-ghost-text-",{after:{contentText:v,opacity:r,color:a,border:d}}));return{range:L.fromPositions(new O(e,b.column)),options:Object.assign({},_.resolve())}}).concat(m))}renderSingleLineText(e,t,i,n){const o=t+e,r=it.visibleColumnsByColumns(o,i);let a="",l=t.length+1;for(const d of e){if(d===" "){const c=r[l+1]-r[l];if(n){a+="→";for(let h=1;h<c;h++)a+=" "}else for(let h=0;h<c;h++)a+=" "}else d===" "?n?a+="·":a+=" ":a+=d;l+=1}return a}};K1=nO([z_(1,Ge),z_(2,pt)],K1);function sO(s){const{r:e,b:t,g:i}=s.rgba;return new B(new Ve(e,i,t,255))}class tZ{constructor(e){this.editor=e,this._viewZoneId=void 0}get viewZoneId(){return this._viewZoneId}dispose(){this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const n=this.editor.getModel();if(!n)return;const{tabSize:o}=n.getOptions();this.editor.changeViewZones(r=>{this._viewZoneId&&(r.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");iZ(l,o,t,this.editor.getOptions()),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:l})}})}}function iZ(s,e,t,i){const n=i.get(27),o=i.get(103),r="none",a=i.get(80),l=i.get(41),d=i.get(40),c=i.get(56),h=Tl(1e4);h.appendASCIIString('<div class="suggest-preview-text">');for(let g=0,m=t.length;g<m;g++){const b=t[g],v=b.content;h.appendASCIIString('<div class="view-line'),h.appendASCIIString('" style="top:'),h.appendASCIIString(String(g*c)),h.appendASCIIString('px;width:1000000px;">');const _=tL(v),w=ib(v),C=ci.createEmpty(v);cb(new gd(d.isMonospace&&!n,d.canUseHalfwidthRightwardsArrow,v,!1,_,w,0,C,b.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,o,r,a,l!==In.OFF,null),h),h.appendASCIIString("</div>")}h.appendASCIIString("</div>"),Wi.applyFontInfoSlow(s,d);const u=h.build(),f=gN?gN.createHTML(u):u;s.innerHTML=f}let nZ=0;function sZ(s,e,t,i){const n=t+nZ++;return s.registerDecorationType(e,n,i),{dispose(){s.removeDecorationType(n)},resolve(){return s.resolveDecorationOptions(n,!0)}}}class oZ extends U{constructor(e,t,i,n){super(),this.editor=e,this.position=t,this.domNode=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!1,this._register(n),this._register(Pe(()=>{this.editor.removeContentWidget(this)})),this.editor.addContentWidget(this)}getId(){return"editor.widget.viewMoreLinesWidget"}getDomNode(){return this.domNode}getPosition(){return{position:this.position,preference:[0]}}}tt((s,e)=>{const t=s.getColor(BA);if(t){const n=String(t.rgba.a),o=B.Format.CSS.format(sO(t));e.addRule(`.monaco-editor .suggest-preview-text .ghost-text { opacity: ${n}; color: ${o}; }`)}const i=s.getColor(FA);i&&e.addRule(`.monaco-editor .suggest-preview-text .ghost-text { border: 2px dashed ${i}; }`)});function rZ(s,e){return{object:s,dispose:()=>e==null?void 0:e.dispose()}}class G1{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}replace(e){const t=this._value;return this._value=e,t}}class oO{constructor(e,t,i=0){this.lineNumber=e,this.parts=t,this.additionalReservedLineCount=i}}class rO extends U{constructor(e){super(),this.editor=e,this._expanded=void 0,this.onDidChangeEmitter=new M,this.onDidChange=this.onDidChangeEmitter.event,this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(104)&&this._expanded===void 0&&this.onDidChangeEmitter.fire()}))}get expanded(){return this._expanded===void 0?!0:this._expanded}setExpanded(e){this._expanded=!0,this.onDidChangeEmitter.fire()}}var aZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},lZ=function(s,e){return function(t,i){e(t,i,s)}},ar=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let Z1=class extends U{constructor(e,t){super(),this.editor=e,this.commandService=t,this.onDidChangeEmitter=new M,this.onDidChange=this.onDidChangeEmitter.event,this.completionSession=this._register(new G1),this.active=!1,this._register(t.onDidExecuteCommand(i=>{new Set([TL.id,AL.id,Ic.Tab.id,Ic.DeleteLeft.id,Ic.DeleteRight.id]).has(i.commandId)&&e.hasTextFocus()&&this.handleUserInput()})),this._register(this.editor.onDidType(i=>{this.handleUserInput()})),this._register(this.editor.onDidChangeCursorPosition(i=>{this.session&&!this.session.isValid&&this.hide()}))}handleUserInput(){this.session&&!this.session.isValid&&this.hide(),setTimeout(()=>{this.startSessionIfTriggered()},0)}get session(){return this.completionSession.value}get ghostText(){var e;return(e=this.session)===null||e===void 0?void 0:e.ghostText}get minReservedLineCount(){return this.session?this.session.minReservedLineCount:0}get expanded(){return this.session?this.session.expanded:!1}setExpanded(e){var t;(t=this.session)===null||t===void 0||t.setExpanded(e)}setActive(e){var t;this.active=e,e&&((t=this.session)===null||t===void 0||t.scheduleAutomaticUpdate())}startSessionIfTriggered(){this.editor.getOption(52).enabled&&(this.session&&this.session.isValid||this.trigger())}trigger(){this.completionSession.value||(this.completionSession.value=new dZ(this.editor,this.editor.getPosition(),()=>this.active,this.commandService),this.completionSession.value.takeOwnership(this.completionSession.value.onDidChange(()=>{this.onDidChangeEmitter.fire()})))}hide(){this.completionSession.clear(),this.onDidChangeEmitter.fire()}commitCurrentSuggestion(){var e;(e=this.session)===null||e===void 0||e.commitCurrentCompletion()}showNext(){var e;(e=this.session)===null||e===void 0||e.showNextInlineCompletion()}showPrevious(){var e;(e=this.session)===null||e===void 0||e.showPreviousInlineCompletion()}hasMultipleInlineCompletions(){var e;return ar(this,void 0,void 0,function*(){const t=yield(e=this.session)===null||e===void 0?void 0:e.hasMultipleInlineCompletions();return t!==void 0?t:!1})}};Z1=aZ([lZ(1,Wt)],Z1);class dZ extends rO{constructor(e,t,i,n){super(e),this.triggerPosition=t,this.shouldUpdate=i,this.commandService=n,this.minReservedLineCount=0,this.updateOperation=this._register(new G1),this.cache=this._register(new G1),this.updateSoon=this._register(new bt(()=>this.update(tl.Automatic),50)),this.textModel=this.editor.getModel(),this.currentlySelectedCompletionId=void 0;let o;this._register(this.onDidChange(()=>{const r=this.currentCompletion;if(r&&r.sourceInlineCompletion!==o){o=r.sourceInlineCompletion;const a=r.sourceProvider;a.handleItemDidShow&&a.handleItemDidShow(r.sourceInlineCompletions,o)}})),this._register(this.editor.onDidChangeCursorPosition(r=>{this.cache.value&&this.onDidChangeEmitter.fire()})),this._register(this.editor.onDidChangeModelContent(r=>{if(this.cache.value){let a=!1;for(const l of this.cache.value.completions){const d=this.textModel.getDecorationRange(l.decorationId);if(!d){ve(new Error("Decoration has no range"));continue}l.synchronizedRange.equalsRange(d)||(a=!0,l.synchronizedRange=d)}a&&this.onDidChangeEmitter.fire()}this.scheduleAutomaticUpdate()})),this._register(cL.onDidChange(()=>{this.updateSoon.schedule()})),this.scheduleAutomaticUpdate()}fixAndGetIndexOfCurrentSelection(){if(!this.currentlySelectedCompletionId||!this.cache.value||this.cache.value.completions.length===0)return 0;const e=this.cache.value.completions.findIndex(t=>t.semanticId===this.currentlySelectedCompletionId);return e===-1?(this.currentlySelectedCompletionId=void 0,0):e}get currentCachedCompletion(){if(this.cache.value)return this.cache.value.completions[this.fixAndGetIndexOfCurrentSelection()]}showNextInlineCompletion(){var e;return ar(this,void 0,void 0,function*(){yield this.ensureUpdateWithExplicitContext();const t=((e=this.cache.value)===null||e===void 0?void 0:e.completions)||[];if(t.length>0){const i=(this.fixAndGetIndexOfCurrentSelection()+1)%t.length;this.currentlySelectedCompletionId=t[i].semanticId}else this.currentlySelectedCompletionId=void 0;this.onDidChangeEmitter.fire()})}showPreviousInlineCompletion(){var e;return ar(this,void 0,void 0,function*(){yield this.ensureUpdateWithExplicitContext();const t=((e=this.cache.value)===null||e===void 0?void 0:e.completions)||[];if(t.length>0){const i=(this.fixAndGetIndexOfCurrentSelection()+t.length-1)%t.length;this.currentlySelectedCompletionId=t[i].semanticId}else this.currentlySelectedCompletionId=void 0;this.onDidChangeEmitter.fire()})}ensureUpdateWithExplicitContext(){var e;return ar(this,void 0,void 0,function*(){this.updateOperation.value?this.updateOperation.value.triggerKind===tl.Explicit?yield this.updateOperation.value.promise:yield this.update(tl.Explicit):((e=this.cache.value)===null||e===void 0?void 0:e.triggerKind)!==tl.Explicit&&(yield this.update(tl.Explicit))})}hasMultipleInlineCompletions(){var e;return ar(this,void 0,void 0,function*(){return yield this.ensureUpdateWithExplicitContext(),(((e=this.cache.value)===null||e===void 0?void 0:e.completions.length)||0)>1})}get ghostText(){const e=this.currentCompletion,t=this.editor.getOptions().get(52).mode;return e?aO(e,this.editor.getModel(),t,this.editor.getSelection().getEndPosition()):void 0}get currentCompletion(){const e=this.currentCachedCompletion;if(e)return{text:e.inlineCompletion.text,range:e.synchronizedRange,command:e.inlineCompletion.command,sourceProvider:e.inlineCompletion.sourceProvider,sourceInlineCompletions:e.inlineCompletion.sourceInlineCompletions,sourceInlineCompletion:e.inlineCompletion.sourceInlineCompletion}}get isValid(){return this.editor.getPosition().lineNumber===this.triggerPosition.lineNumber}scheduleAutomaticUpdate(){this.updateOperation.clear(),this.updateSoon.schedule()}update(e){return ar(this,void 0,void 0,function*(){if(!this.shouldUpdate())return;const t=this.editor.getPosition(),i=fi(o=>ar(this,void 0,void 0,function*(){let r;try{r=yield pZ(t,this.editor.getModel(),{triggerKind:e},o)}catch(a){ve(a);return}o.isCancellationRequested||(this.cache.value=new hZ(this.editor,r,()=>this.onDidChangeEmitter.fire(),e),this.onDidChangeEmitter.fire())})),n=new cZ(i,e);this.updateOperation.value=n,yield i,this.updateOperation.value===n&&this.updateOperation.clear()})}takeOwnership(e){this._register(e)}commitCurrentCompletion(){if(!this.ghostText)return;const e=this.currentCompletion;e&&this.commit(e)}commit(e){const t=this.cache.replace(void 0);this.editor.executeEdits("inlineSuggestion.accept",[Bt.replaceMove(e.range,e.text)]),e.command?this.commandService.executeCommand(e.command.id,...e.command.arguments||[]).finally(()=>{t==null||t.dispose()}).then(void 0,gi):t==null||t.dispose(),this.onDidChangeEmitter.fire()}}class cZ{constructor(e,t){this.promise=e,this.triggerKind=t}dispose(){this.promise.cancel()}}class hZ extends U{constructor(e,t,i,n){super(),this.triggerKind=n;const o=e.deltaDecorations([],t.items.map(r=>({range:r.range,options:{description:"inline-completion-tracking-range"}})));this._register(Pe(()=>{e.deltaDecorations(o,[])})),this.completions=t.items.map((r,a)=>new uZ(r,o[a])),this._register(e.onDidChangeModelContent(()=>{let r=!1;const a=e.getModel();for(const l of this.completions){const d=a.getDecorationRange(l.decorationId);if(!d){ve(new Error("Decoration has no range"));continue}l.synchronizedRange.equalsRange(d)||(r=!0,l.synchronizedRange=d)}r&&i()})),this._register(t)}}class uZ{constructor(e,t){this.inlineCompletion=e,this.decorationId=t,this.semanticId=JSON.stringify({text:this.inlineCompletion.text,startLine:this.inlineCompletion.range.startLineNumber,startColumn:this.inlineCompletion.range.startColumn,command:this.inlineCompletion.command}),this.synchronizedRange=e.range}}function aO(s,e,t,i){if(s.range.startLineNumber!==s.range.endLineNumber)return;const n=e.getValueInRange(s.range),o=fZ(n,s.text),r=s.range.startLineNumber,a=new Array;if(t==="prefix"){const l=o.filter(d=>d.originalLength===0);if(l.length>1||l.length===1&&l[0].originalStart!==n.length)return}for(const l of o){const d=s.range.startColumn+l.originalStart+l.originalLength;if(i&&i.lineNumber===s.range.startLineNumber&&d<i.column)return;if(l.originalLength>0){const u=n.substr(l.originalStart,l.originalLength),f=e.getLineFirstNonWhitespaceColumn(r);if(!(/^(\t| )*$/.test(u)&&(f===0||d<=f)))return}if(l.modifiedLength===0)continue;const c=s.text.substr(l.modifiedStart,l.modifiedLength),h=Fa(c);a.push({column:d,lines:h})}return new oO(r,a,0)}let lo;function fZ(s,e){if((lo==null?void 0:lo.originalValue)===s&&(lo==null?void 0:lo.newValue)===e)return lo==null?void 0:lo.changes;{const t=gT(s,e,!1);return lo={originalValue:s,newValue:e,changes:t},t}}function gZ(s,e){const t=e.getWordAtPosition(s),i=e.getLineMaxColumn(s.lineNumber);return t?new L(s.lineNumber,t.startColumn,s.lineNumber,i):L.fromPositions(s,s.with(void 0,i))}function pZ(s,e,t,i=Fe.None){return ar(this,void 0,void 0,function*(){const n=gZ(s,e),o=cL.all(e),r=yield Promise.all(o.map(l=>ar(this,void 0,void 0,function*(){const d=yield l.provideInlineCompletions(e,s,t,i);return{completions:d,provider:l,dispose:()=>{d&&l.freeInlineCompletions(d)}}}))),a=new Map;for(const l of r){const d=l.completions;if(d)for(const c of d.items.map(h=>({text:h.text,range:h.range?L.lift(h.range):n,command:h.command,sourceProvider:l.provider,sourceInlineCompletions:d,sourceInlineCompletion:h})))c.range.startLineNumber===c.range.endLineNumber&&a.set(JSON.stringify({text:c.text,range:c.range}),c)}return{items:[...a.values()],dispose:()=>{for(const l of r)l.dispose()}}})}class hs{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e=this.pos,t=0,i=this.value.charCodeAt(e),n;if(n=hs._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(hs.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(hs.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(hs.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(hs.isVariableCharacter(i)||hs.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof hs._table[i]>"u"&&!hs.isDigitCharacter(i)&&!hs.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}}hs._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class Dh{constructor(){this._children=[]}appendChild(e){return e instanceof gn&&this._children[this._children.length-1]instanceof gn?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function r(a,l){for(const d of a)d.parent=l,r(d.children,d)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof hv)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class gn extends Dh{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new gn(this.value)}}class lO extends Dh{}class bs extends lO{constructor(e){super(),this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof mg?this._children[0]:void 0}clone(){let e=new bs(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class mg extends Dh{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof gn&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new mg;return this.options.forEach(e.appendChild,e),e}}class hD extends Dh{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof Bs&&!!o.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Bs){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){let e=new hD;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Bs extends Dh{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1).toLowerCase()).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.toLowerCase():i.charAt(0).toUpperCase()+i.substr(1).toLowerCase()).join(""):e}clone(){return new Bs(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Mf extends lO{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new gn(t)],!0):!1}clone(){const e=new Mf(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function pN(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class hv extends Dh{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(i){return i instanceof bs&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return pN([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof bs&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Mf&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let e=new hv;return this._children=this.children.map(t=>t.clone()),e}walk(e){pN(this.children,e)}}class uv{constructor(){this._scanner=new hs,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){this._scanner.text(e),this._token=this._scanner.next();const n=new hv;for(;this._parse(n););const o=new Map,r=[];let a=0;n.walk(l=>(l instanceof bs&&(a+=1,l.isFinalTabstop?o.set(0,void 0):!o.has(l.index)&&l.children.length>0?o.set(l.index,l.children):r.push(l)),!0));for(const l of r){const d=o.get(l.index);if(d){const c=new bs(l.index);c.transform=l.transform;for(const h of d)c.appendChild(h.clone());n.replace(l,[c])}}return i||(i=a>0&&t),!o.has(0)&&i&&n.appendChild(new bs(0)),n}_accept(e,t){if(e===void 0||this._token.type===e){let i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new gn(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new bs(Number(t)):new Mf(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new bs(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new gn("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new mg;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(r),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new gn(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new Mf(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new gn("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){let t=new hD,i="",n="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new gn(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Bs(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Bs(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){let o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Bs(Number(n),o)),!0)}else if(this._accept(11)){let o=this._until(4);if(o)return e.appendChild(new Bs(Number(n),void 0,o,void 0)),!0}else if(this._accept(12)){let o=this._until(4);if(o)return e.appendChild(new Bs(Number(n),void 0,void 0,o)),!0}else if(this._accept(13)){let o=this._until(1);if(o){let r=this._until(4);if(r)return e.appendChild(new Bs(Number(n),void 0,o,r)),!0}}else{let o=this._until(4);if(o)return e.appendChild(new Bs(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new gn(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}const mN="code-workspace";function _N(s){const e=s;return typeof(e==null?void 0:e.id)=="string"&&he.isUri(e.uri)}function mZ(s){if(s.configuration)return{id:s.id,configPath:s.configuration};if(s.folders.length===1)return{id:s.id,uri:s.folders[0].uri}}const ri=new Uint8Array(16),Hi=[];for(let s=0;s<256;s++)Hi.push(s.toString(16).padStart(2,"0"));let Y1;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?Y1=crypto.getRandomValues.bind(crypto):Y1=function(s){for(let e=0;e<s.length;e++)s[e]=Math.floor(Math.random()*256);return s};function _Z(){Y1(ri),ri[6]=ri[6]&15|64,ri[8]=ri[8]&63|128;let s=0,e="";return e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+="-",e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+="-",e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+="-",e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+="-",e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+=Hi[ri[s++]],e+=Hi[ri[s++]],e}class bZ{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){let i=t.resolve(e);if(i!==void 0)return i}}}class vZ{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,n=o.multiline)}if(i&&n&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=ct(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(d=>d===e?!1:(d instanceof gn&&(a=ct(Fa(d.value).pop())),!0));const l=ju(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(d,c,h)=>`${c}${a.substr(l)}${h}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber)}}}}class wZ{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return bl(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=bl(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY"&&this._labelService)return _M(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(nL(this._model.uri));if(t==="TM_FILEPATH"&&this._labelService)return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH"&&this._labelService)return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class CZ{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(n=>!WM(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}class SZ{constructor(e,t){this._model=e,this._selection=t}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=xe.getComments(i);if(n){if(t==="LINE_COMMENT")return n.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return n.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return n.blockCommentEndToken||void 0}}}class Lo{resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(new Date().getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(new Date().getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(new Date().getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(new Date().getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(new Date().getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(new Date().getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(new Date().getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return Lo.dayNames[new Date().getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Lo.dayNamesShort[new Date().getDay()];if(t==="CURRENT_MONTH_NAME")return Lo.monthNames[new Date().getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Lo.monthNamesShort[new Date().getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(Date.now()/1e3))}}Lo.dayNames=[p("Sunday","Sunday"),p("Monday","Monday"),p("Tuesday","Tuesday"),p("Wednesday","Wednesday"),p("Thursday","Thursday"),p("Friday","Friday"),p("Saturday","Saturday")];Lo.dayNamesShort=[p("SundayShort","Sun"),p("MondayShort","Mon"),p("TuesdayShort","Tue"),p("WednesdayShort","Wed"),p("ThursdayShort","Thu"),p("FridayShort","Fri"),p("SaturdayShort","Sat")];Lo.monthNames=[p("January","January"),p("February","February"),p("March","March"),p("April","April"),p("May","May"),p("June","June"),p("July","July"),p("August","August"),p("September","September"),p("October","October"),p("November","November"),p("December","December")];Lo.monthNamesShort=[p("JanuaryShort","Jan"),p("FebruaryShort","Feb"),p("MarchShort","Mar"),p("AprilShort","Apr"),p("MayShort","May"),p("JuneShort","Jun"),p("JulyShort","Jul"),p("AugustShort","Aug"),p("SeptemberShort","Sep"),p("OctoberShort","Oct"),p("NovemberShort","Nov"),p("DecemberShort","Dec")];class yZ{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=mZ(this._workspaceService.getWorkspace());if(t){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(_N(e))return bl(e.uri.path);let t=bl(e.configPath.path);return t.endsWith(mN)&&(t=t.substr(0,t.length-mN.length-1)),t}_resoveWorkspacePath(e){if(_N(e))return W1(e.uri.fsPath);let t=bl(e.configPath.path),i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?W1(i):"/"}}class LZ{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return _Z()}}tt((s,e)=>{function t(i){const n=s.getColor(i);return n?n.toString():"transparent"}e.addRule(`.monaco-editor .snippet-placeholder { background-color: ${t(A8)}; outline-color: ${t(R8)}; }`),e.addRule(`.monaco-editor .finish-snippet-placeholder { background-color: ${t(O8)}; outline-color: ${t(P8)}; }`)});class us{constructor(e,t,i,n){this._editor=e,this._snippet=t,this._offset=i,this._snippetLineLeadingWhitespace=n,this._nestingLevel=1,this._placeholderGroups=Nk(t.placeholders,bs.compareByIndex),this._placeholderGroupsIdx=-1}dispose(){this._placeholderDecorations&&this._editor.deltaDecorations([...this._placeholderDecorations.values()],[]),this._placeholderGroups.length=0}_initDecorations(){if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const n=this._snippet.offset(i),o=this._snippet.fullLen(i),r=L.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),a=i.isFinalTabstop?us._decor.inactiveFinal:us._decor.inactive,l=t.addDecoration(r,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){let n=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),l=this._editor.getModel().getValueInRange(a),d=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let c=1;c<d.length;c++)d[c]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+d[c]);n.push(Bt.replace(a,d.join(this._editor.getModel().getEOL())))}n.length>0&&this._editor.executeEdits("snippet.placeholderTransform",n)}let t=!1;e===!0&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):e===!1&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(n=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),d=this._editor.getModel().getDecorationRange(l);r.push(new ee(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(l,a.isFinalTabstop?us._decor.activeFinal:us._decor.active),o.add(a);for(const c of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(c);n.changeDecorationOptions(h,c.isFinalTabstop?us._decor.activeFinal:us._decor.active),o.add(c)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||n.changeDecorationOptions(l,a.isFinalTabstop?us._decor.inactiveFinal:us._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof bs){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const o=this._placeholderDecorations.get(n),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(n.index);break}i.push(r)}}return e}get choice(){return this._placeholderGroups[this._placeholderGroupsIdx][0].choice}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=n.index+(r+1)/this._nestingLevel:l.index=n.index+l.index/this._nestingLevel;this._snippet.replace(n,o._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const l of o._snippet.placeholders){const d=o._snippet.offset(l),c=o._snippet.fullLen(l),h=L.fromPositions(t.getPositionAt(o._offset+d),t.getPositionAt(o._offset+d+c)),u=i.addDecoration(h,us._decor.inactive);this._placeholderDecorations.set(l,u)}}this._placeholderGroups=Nk(this._snippet.placeholders,bs.compareByIndex)})}}us._decor={active:De.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:De.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:De.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:De.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const bN={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};class go{constructor(e,t,i=bN){this._templateMerges=[],this._snippets=[],this._editor=e,this._template=t,this._options=i}static adjustWhitespace(e,t,i,n,o){const r=e.getLineContent(t.lineNumber),a=ct(r,0,t.column-1);let l;return i.walk(d=>{if(!(d instanceof gn)||d.parent instanceof mg)return!0;const c=d.value.split(/\r\n|\r|\n/);if(n){const u=i.offset(d);if(u===0)c[0]=e.normalizeIndentation(c[0]);else{l=l??i.toString();let f=l.charCodeAt(u-1);(f===10||f===13)&&(c[0]=e.normalizeIndentation(a+c[0]))}for(let f=1;f<c.length;f++)c[f]=e.normalizeIndentation(a+c[f])}const h=c.join(e.getEOL());return h!==d.value&&(d.parent.replace(d,[new gn(h)]),l=void 0),!0}),a}static adjustSelection(e,t,i,n){if(i!==0||n!==0){const{positionLineNumber:o,positionColumn:r}=t,a=r-i,l=r+n,d=e.validateRange({startLineNumber:o,startColumn:a,endLineNumber:o,endColumn:l});t=ee.createWithDirection(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn,t.getDirection())}return t}static createEditsAndSnippets(e,t,i,n,o,r,a,l){const d=[],c=[];if(!e.hasModel())return{edits:d,snippets:c};const h=e.getModel(),u=e.invokeWithinContext(C=>C.get(BT,U0)),f=e.invokeWithinContext(C=>new wZ(C.get(lg,U0),h)),g=()=>a;let m=0,b=h.getValueInRange(go.adjustSelection(h,e.getSelection(),i,0)),v=h.getValueInRange(go.adjustSelection(h,e.getSelection(),0,n)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber);const w=e.getSelections().map((C,S)=>({selection:C,idx:S})).sort((C,S)=>L.compareRangesUsingStarts(C.selection,S.selection));for(const{selection:C,idx:S}of w){let D=go.adjustSelection(h,C,i,0),y=go.adjustSelection(h,C,0,n);b!==h.getValueInRange(D)&&(D=C),v!==h.getValueInRange(y)&&(y=C);const x=C.setStartPosition(D.startLineNumber,D.startColumn).setEndPosition(y.endLineNumber,y.endColumn),E=new uv().parse(t,!0,o),P=x.getStartPosition(),A=go.adjustWhitespace(h,P,E,r||S>0&&_!==h.getLineFirstNonWhitespaceColumn(C.positionLineNumber),!0);E.resolveVariables(new bZ([f,new CZ(g,S,w.length,e.getOption(68)==="spread"),new vZ(h,C,S,l),new SZ(h,C),new Lo,new yZ(u),new LZ]));const H=h.getOffsetAt(P)+m;m+=E.toString().length-h.getValueLengthInRange(x),d[S]=Bt.replace(x,E.toString()),d[S].identifier={major:S,minor:0},c[S]=new us(e,E,H,A)}return{edits:d,snippets:c}}dispose(){$e(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=go.createEditsAndSnippets(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer);this._snippets=t,this._editor.executeEdits("snippet",e,i=>this._snippets[0].hasPlaceholder?this._move(!0):i.filter(n=>!!n.identifier).map(n=>ee.fromPositions(n.range.getEndPosition()))),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=bN){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=go.createEditsAndSnippets(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer);this._editor.executeEdits("snippet",i,o=>{for(const r of this._snippets)r.merge(n);return console.assert(n.length===0),this._snippets[0].hasPlaceholder?this._move(void 0):o.filter(r=>!!r.identifier).map(r=>ee.fromPositions(r.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get choice(){return this._snippets[0].choice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;let t=new Map;for(const i of this._snippets){const n=i.computePossibleSelections();if(t.size===0)for(const[o,r]of n){r.sort(L.compareRangesUsingStarts);for(const a of e)if(r[0].containsRange(a)){t.set(o,[]);break}}if(t.size===0)return!1;t.forEach((o,r)=>{o.push(...n.get(r))})}e.sort(L.compareRangesUsingStarts);for(let[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(L.compareRangesUsingStarts);for(let o=0;o<n.length;o++)if(!n[o].containsRange(e[o])){t.delete(i);continue}}return t.size>0}}var Wu=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const We={Visible:new se("suggestWidgetVisible",!1,p("suggestWidgetVisible","Whether suggestion are visible")),DetailsVisible:new se("suggestWidgetDetailsVisible",!1,p("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new se("suggestWidgetMultipleSuggestions",!1,p("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new se("suggestionMakesTextEdit",!0,p("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new se("acceptSuggestionOnEnter",!0,p("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new se("suggestionHasInsertAndReplaceRange",!1,p("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new se("suggestionInsertMode",void 0,{type:"string",description:p("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new se("suggestionCanResolve",!1,p("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Na=new oe("suggestWidgetStatusBar");class xZ{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=Gs.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),L.isIRange(t.range)?(this.editStart=new O(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new O(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new O(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||L.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new O(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new O(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new O(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||L.spansMultipleLines(t.range.insert)||L.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof n.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return Wu(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._isResolved=!1});this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(i=>{Object.assign(this.completion,i),this._isResolved=!0,t.dispose()},i=>{Vo(i)&&(this._resolveCache=void 0,this._isResolved=!1)})}return this._resolveCache})}}class U_{constructor(e=2,t=new Set,i=new Set,n=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.showDeprecated=n}}U_.default=new U_;let DZ;function kZ(){return DZ}class IZ{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}function dO(s,e,t=U_.default,i={triggerKind:0},n=Fe.None){return Wu(this,void 0,void 0,function*(){const o=new Ao(!0);e=e.clone();const r=s.getWordAtPosition(e),a=r?new L(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn):L.fromPositions(e),l={replace:a,insert:a.setEndPosition(e.lineNumber,e.column)},d=[],c=new X,h=[];let u=!1;const f=(m,b,v)=>{var _,w,C;if(b){for(let S of b.suggestions)if(!t.kindFilter.has(S.kind)){if(!t.showDeprecated&&(!((_=S==null?void 0:S.tags)===null||_===void 0)&&_.includes(1)))continue;S.range||(S.range=l),S.sortText||(S.sortText=typeof S.label=="string"?S.label:S.label.label),!u&&S.insertTextRules&&S.insertTextRules&4&&(u=uv.guessNeedsClipboard(S.insertText)),d.push(new xZ(e,S,b,m))}Vy(b)&&c.add(b),h.push({providerName:(w=m._debugDisplayName)!==null&&w!==void 0?w:"unkown_provider",elapsedProvider:(C=b.duration)!==null&&C!==void 0?C:-1,elapsedOverall:v.elapsed()})}},g=Wu(this,void 0,void 0,function*(){});for(let m of zs.orderedGroups(s)){let b=d.length;if(yield Promise.all(m.map(v=>Wu(this,void 0,void 0,function*(){if(!(t.providerFilter.size>0&&!t.providerFilter.has(v)))try{const _=new Ao(!0),w=yield v.provideCompletionItems(s,e,i,n);f(v,w,_)}catch(_){gi(_)}}))),b!==d.length||n.isCancellationRequested)break}return yield g,n.isCancellationRequested?(c.dispose(),Promise.reject(mh())):new IZ(d.sort(cO(t.snippetSortOrder)),u,{entries:h,elapsed:o.elapsed()},c)})}function uD(s,e){if(s.sortTextLow&&e.sortTextLow){if(s.sortTextLow<e.sortTextLow)return-1;if(s.sortTextLow>e.sortTextLow)return 1}return s.completion.label<e.completion.label?-1:s.completion.label>e.completion.label?1:s.completion.kind-e.completion.kind}function EZ(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return uD(s,e)}function NZ(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return uD(s,e)}const fv=new Map;fv.set(0,EZ);fv.set(2,NZ);fv.set(1,uD);function cO(s){return fv.get(s)}He.registerCommand("_executeCompletionItemProvider",(s,...e)=>Wu(void 0,void 0,void 0,function*(){const[t,i,n,o]=e;nt(he.isUri(t)),nt(O.isIPosition(i)),nt(typeof n=="string"||!n),nt(typeof o=="number"||!o);const r=yield s.get(Xs).createModelReference(t);try{const a={incomplete:!1,suggestions:[]},l=[],d=yield dO(r.object.textEditorModel,O.lift(i),void 0,{triggerCharacter:n,triggerKind:n?1:0});for(const c of d.items)l.length<(o??0)&&l.push(c.resolve(Fe.None)),a.incomplete=a.incomplete||c.container.incomplete,a.suggestions.push(c.completion);try{return yield Promise.all(l),a}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{r.dispose()}}));const X1=new class{constructor(){this.onlyOnceSuggestions=[]}provideCompletionItems(){let e={suggestions:this.onlyOnceSuggestions.slice(0)};return this.onlyOnceSuggestions.length=0,e}};zs.register("*",X1);function MZ(s,e){setTimeout(()=>{X1.onlyOnceSuggestions.push(...e),s.getContribution("editor.contrib.suggestController").triggerSuggest(new Set().add(X1))},0)}var TZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},vN=function(s,e){return function(t,i){e(t,i,s)}};const wN={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let yi=class uu{constructor(e,t,i){this._editor=e,this._logService=t,this._snippetListener=new X,this._modelVersionId=-1,this._inSnippet=uu.InSnippetMode.bindTo(i),this._hasNextTabstop=uu.HasNextTabstop.bindTo(i),this._hasPrevTabstop=uu.HasPrevTabstop.bindTo(i)}static get(e){return e.getContribution(uu.ID)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?wN:Object.assign(Object.assign({},wN),t))}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){this._editor.hasModel()&&(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session?this._session.merge(e,t):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new go(this._editor,e,t),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(i=>i.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState())))}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{choice:e}=this._session;if(!e){this._currentChoice=void 0;return}if(this._currentChoice!==e){this._currentChoice=e,this._editor.setSelections(this._editor.getSelections().map(i=>ee.fromPositions(i.getStartPosition())));const[t]=e.options;MZ(this._editor,e.options.map((i,n)=>({kind:13,label:i.value,insertText:i.value,sortText:"a".repeat(n+1),range:L.fromPositions(this._editor.getPosition(),this._editor.getPosition().delta(0,t.value.length))})))}}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session&&this._session.prev(),this._updateState()}next(){this._session&&this._session.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};yi.ID="snippetController2";yi.InSnippetMode=new se("inSnippetMode",!1,p("inSnippetMode","Whether the editor in current in snippet mode"));yi.HasNextTabstop=new se("hasNextTabstop",!1,p("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));yi.HasPrevTabstop=new se("hasPrevTabstop",!1,p("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));yi=TZ([vN(1,Tr),vN(2,we)],yi);Xe(yi.ID,yi);const gv=Di.bindToContribution(yi.get);G(new gv({id:"jumpToNextSnippetPlaceholder",precondition:J.and(yi.InSnippetMode,yi.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:130,kbExpr:I.editorTextFocus,primary:2}}));G(new gv({id:"jumpToPrevSnippetPlaceholder",precondition:J.and(yi.InSnippetMode,yi.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:130,kbExpr:I.editorTextFocus,primary:1026}}));G(new gv({id:"leaveSnippet",precondition:yi.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:130,kbExpr:I.editorTextFocus,primary:9,secondary:[1033]}}));G(new gv({id:"acceptSnippet",precondition:yi.InSnippetMode,handler:s=>s.finish()}));var AZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},DC=function(s,e){return function(t,i){e(t,i,s)}};class fD{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;let n=i[0].score[0];for(let o=0;o<i.length;o++){const{score:r,completion:a}=i[o];if(r[0]!==n)break;if(a.preselect)return o}return 0}}class hO extends fD{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class RZ extends fD{constructor(){super("recentlyUsed"),this._cache=new ud(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageIdentifier().language}/${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);let o=i[0].score[0],r=-1,a=-1,l=-1;for(let d=0;d<i.length&&i[d].score[0]===o;d++){const c=`${e.getLanguageIdentifier().language}/${i[d].textLabel}`,h=this._cache.peek(c);if(h&&h.touch>l&&h.type===i[d].completion.kind&&h.insertText===i[d].completion.insertText&&(l=h.touch,a=d),i[d].completion.preselect&&r===-1)return r=d}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();let t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:rT(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class OZ extends fD{constructor(){super("recentlyUsedByPrefix"),this._trie=wc.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageIdentifier().language}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){let{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);let o=`${e.getLanguageIdentifier().language}/${n}`,r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;a<i.length;a++){let{kind:l,insertText:d}=i[a].completion;if(l===r.type&&d===r.insertText)return a}return super.select(e,t,i)}toJSON(){let 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:rT(i.type),this._trie.set(t,i)}}}let Tf=class sm{constructor(e,t,i){this._storageService=e,this._modeService=t,this._configService=i,this._disposables=new X,this._persistSoon=new bt(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(n=>{n.reason===P_.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i,n;const o=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:(i=this._modeService.getLanguageIdentifier(e.getLanguageIdAtPosition(t.lineNumber,t.column)))===null||i===void 0?void 0:i.language,resource:e.uri});if(((n=this._strategy)===null||n===void 0?void 0:n.name)!==o){this._saveState();const r=sm._strategyCtors.get(o)||hO;this._strategy=new r;try{const l=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,d=this._storageService.get(`${sm._storagePrefix}/${o}`,l);d&&this._strategy.fromJSON(JSON.parse(d))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${sm._storagePrefix}/${this._strategy.name}`,i,t,1)}}};Tf._strategyCtors=new Map([["recentlyUsedByPrefix",OZ],["recentlyUsed",RZ],["first",hO]]);Tf._storagePrefix="suggest/memories";Tf=AZ([DC(0,Or),DC(1,to),DC(2,At)],Tf);const uO=Ze("ISuggestMemories");vd(uO,Tf,!0);var PZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},FZ=function(s,e){return function(t,i){e(t,i,s)}};let Ql=class om{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=om.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(om._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let n=i;for(;n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits););return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=om._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};Ql.OtherSuggestions=new se("hasOtherSuggestions",!1);Ql=PZ([FZ(1,we)],Ql);class cl{constructor(e,t,i,n,o,r,a){this.clipboardText=a,this._snippetCompareFn=cl._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=1,this._lineContext=i,r==="top"?this._snippetCompareFn=cl._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=cl._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}get allProvider(){return this._ensureCachedState(),this._providerInfo.keys()}get incomplete(){this._ensureCachedState();const e=new Set;for(let[t,i]of this._providerInfo)i&&e.add(t);return e}adopt(e){let t=[];for(let i=0;i<this._items.length;)e.has(this._items[i].provider)?i++:(t.push(this._items[i]),this._items[i]=this._items[this._items.length-1],this._items.pop());return this._refilterKind=1,t}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._providerInfo=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",o="";const r=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||r.length>2e3?Qc:tU;for(let d=0;d<r.length;d++){const c=r[d];if(c.isInvalid)continue;this._providerInfo.set(c.provider,!!c.container.incomplete);const h=c.position.column-c.editStart.column,u=h+i-(c.position.column-this._column);if(n.length!==u&&(n=u===0?"":t.slice(-u),o=n.toLowerCase()),c.word=n,u===0)c.score=Gs.Default;else{let f=0;for(;f<h;){const g=n.charCodeAt(f);if(g===32||g===9)f+=1;else break}if(f>=u)c.score=Gs.Default;else if(typeof c.completion.filterText=="string"){let g=l(n,o,f,c.completion.filterText,c.filterTextLow,0,!1);if(!g)continue;Y0(c.completion.filterText,c.textLabel)===0?c.score=g:(c.score=Xz(n,o,f,c.textLabel,c.labelLow,0),c.score[0]=g[0])}else{let g=l(n,o,f,c.textLabel,c.labelLow,0,!1);if(!g)continue;c.score=g}}c.idx=d,c.distance=this._wordDistance.distance(c.position,c.completion),a.push(c),e.push(c.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?uS(e.length-.85,e,(d,c)=>d-c):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]<t.score[0]?1:e.distance<t.distance?-1:e.distance>t.distance?1:e.idx<t.idx?-1:e.idx>t.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return cl._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return cl._compareCompletionItems(e,t)}}var BZ=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class kn{provideSelectionRanges(e,t){return BZ(this,void 0,void 0,function*(){const i=[];for(const n of t){const o=[];i.push(o);const r=new Map;yield new Promise(a=>kn._bracketsRightYield(a,0,e,n,r)),yield new Promise(a=>kn._bracketsLeftYield(a,0,e,n,r,o))}return i})}static _bracketsRightYield(e,t,i,n,o){const r=new Map,a=Date.now();for(;;){if(t>=kn._maxRounds){e();break}if(!n){e();break}let l=i.findNextBracket(n);if(!l){e();break}if(Date.now()-a>kn._maxDuration){setTimeout(()=>kn._bracketsRightYield(e,t+1,i,n,o));break}const c=l.close[0];if(l.isOpen){let h=r.has(c)?r.get(c):0;r.set(c,h+1)}else{let h=r.has(c)?r.get(c):0;if(h-=1,r.set(c,Math.max(0,h)),h<0){let u=o.get(c);u||(u=new Mn,o.set(c,u)),u.push(l.range)}}n=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,o,r){const a=new Map,l=Date.now();for(;;){if(t>=kn._maxRounds&&o.size===0){e();break}if(!n){e();break}let d=i.findPrevBracket(n);if(!d){e();break}if(Date.now()-l>kn._maxDuration){setTimeout(()=>kn._bracketsLeftYield(e,t+1,i,n,o,r));break}const h=d.close[0];if(d.isOpen){let u=a.has(h)?a.get(h):0;if(u-=1,a.set(h,Math.max(0,u)),u<0){let f=o.get(h);if(f){let g=f.shift();f.size===0&&o.delete(h);const m=L.fromPositions(d.range.getEndPosition(),g.getStartPosition()),b=L.fromPositions(d.range.getStartPosition(),g.getEndPosition());r.push({range:m}),r.push({range:b}),kn._addBracketLeading(i,b,r)}}}else{let u=a.has(h)?a.get(h):0;a.set(h,u+1)}n=d.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);o!==0&&o!==t.startColumn&&(i.push({range:L.fromPositions(new O(n,o),t.getEndPosition())}),i.push({range:L.fromPositions(new O(n,1),t.getEndPosition())}));const r=n-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:L.fromPositions(new O(r,a),t.getEndPosition())}),i.push({range:L.fromPositions(new O(r,1),t.getEndPosition())}))}}}kn._maxDuration=30;kn._maxRounds=2;var WZ=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class _o{static create(e,t){return WZ(this,void 0,void 0,function*(){if(!t.getOption(104).localityBonus||!t.hasModel())return _o.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return _o.None;const[o]=yield new kn().provideSelectionRanges(i,[n]);if(o.length===0)return _o.None;const r=yield e.computeWordRanges(i.uri,o[0].range);if(!r)return _o.None;const a=i.getWordUntilPosition(n);return delete r[a.word],new class extends _o{distance(l,d){if(!n.equals(t.getPosition()))return 0;if(d.kind===17)return 2<<20;let c=typeof d.label=="string"?d.label:d.label.label,h=r[c];if(vT(h))return 2<<20;let u=_L(h,L.fromPositions(l),L.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)],g=o.length;for(const m of o){if(!L.containsRange(m.range,f))break;g-=1}return g}}})}}_o.None=new class extends _o{distance(){return 0}};var VZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},jd=function(s,e){return function(t,i){e(t,i,s)}},HZ=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class Xh{constructor(e,t,i,n){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.auto=i,this.shy=n}static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column||!isNaN(Number(n.word)))}}function zZ(s,e){return!!s.getContextKeyValue("inlineSuggestionVisible")&&!e.getValue("editor.inlineSuggest.allowQuickSuggestions")}function UZ(s,e){return!!s.getContextKeyValue("inlineSuggestionVisible")&&!e.getValue("editor.inlineSuggest.allowSuggestOnTriggerCharacters")}let Q1=class fO{constructor(e,t,i,n,o,r,a){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._toDispose=new X,this._quickSuggestDelay=10,this._triggerCharacterListener=new X,this._triggerQuickSuggest=new an,this._state=0,this._completionDisposables=new X,this._onDidCancel=new M,this._onDidTrigger=new M,this._onDidSuggest=new M,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new ee(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters(),this._updateQuickSuggest()})),this._toDispose.add(zs.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(d=>{this._onCursorChange(d)}));let l=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{l=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{l=!1,this._refilterCompletionItems()})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{l||this._refilterCompletionItems()})),this._updateTriggerCharacters(),this._updateQuickSuggest()}dispose(){$e(this._triggerCharacterListener),$e([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateQuickSuggest(){this._quickSuggestDelay=this._editor.getOption(77),(isNaN(this._quickSuggestDelay)||!this._quickSuggestDelay&&this._quickSuggestDelay!==0||this._quickSuggestDelay<0)&&(this._quickSuggestDelay=10)}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(78)||!this._editor.hasModel()||!this._editor.getOption(107))return;const e=new Map;for(const i of zs.all(this._editor.getModel()))for(const n of i.triggerCharacters||[]){let o=e.get(n);o||(o=new Set,o.add(kZ()),e.set(n,o)),o.add(i)}const t=i=>{if(UZ(this._contextKeyService,this._configurationService))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let n="";Bc(i.charCodeAt(i.length-1))?di(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const o=e.get(n);if(o){const r=this._completionModel?{items:this._completionModel.adopt(o),clipboardText:this._completionModel.clipboardText}:void 0;this.trigger({auto:!0,shy:!1,triggerCharacter:n},!!this._completionModel,o,r)}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(t))}get state(){return this._state}cancel(e=!1){var t;this._state!==0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._state=0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._state!==0&&(!this._editor.hasModel()||!zs.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._state===2,shy:!1},!0))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}if(zs.has(t))if(this._state===0&&e.reason===0){if(this._editor.getOption(76)===!1||!i.containsRange(this._currentSelection)&&!i.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())||this._editor.getOption(104).snippetsPreventQuickSuggestions&&yi.get(this._editor).isInSnippet())return;this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._state!==0||!Xh.shouldAutoTrigger(this._editor)||!this._editor.hasModel())return;const n=this._editor.getModel(),o=this._editor.getPosition(),r=this._editor.getOption(76);if(r!==!1){if(r!==!0){n.tokenizeIfCheap(o.lineNumber);const a=n.getLineTokens(o.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(o.column-1-1,0)));if(!(r.other&&l===0||r.comments&&l===1||r.strings&&l===2))return}zZ(this._contextKeyService,this._configurationService)||this.trigger({auto:!0,shy:!1})}},this._quickSuggestDelay)}else this._state!==0&&e.reason===3&&this._refilterCompletionItems()}_refilterCompletionItems(){Promise.resolve().then(()=>{if(this._state===0||!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=new Xh(e,t,this._state===2,!1);this._onNewContext(i)})}trigger(e,t=!1,i,n){var o;if(!this._editor.hasModel())return;const r=this._editor.getModel(),a=e.auto,l=new Xh(r,this._editor.getPosition(),a,e.shy);this.cancel(t),this._state=a?2:1,this._onDidTrigger.fire({auto:a,shy:e.shy,position:this._editor.getPosition()}),this._context=l;let d={triggerKind:(o=e.triggerKind)!==null&&o!==void 0?o:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new on;const c=this._editor.getOption(99);let h=1;switch(c){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:u,showDeprecated:f}=fO._createSuggestFilter(this._editor),g=_o.create(this._editorWorkerService,this._editor),m=dO(r,this._editor.getPosition(),new U_(h,u,i,f),d,this._requestToken.token);Promise.all([m,g]).then(([b,v])=>HZ(this,void 0,void 0,function*(){var _;if((_=this._requestToken)===null||_===void 0||_.dispose(),!this._editor.hasModel())return;let w=n==null?void 0:n.clipboardText;if(!w&&b.needsClipboard&&(w=yield this._clipboardService.readText()),this._state===0)return;const C=this._editor.getModel();let S=b.items;if(n){const y=cO(h);S=S.concat(n.items).sort(y)}const D=new Xh(C,this._editor.getPosition(),a,e.shy);this._completionModel=new cl(S,this._context.column,{leadingLineContent:D.leadingLineContent,characterCountDelta:D.column-this._context.column},v,this._editor.getOption(104),this._editor.getOption(99),w),this._completionDisposables.add(b.disposable),this._onNewContext(D),this._reportDurationsTelemetry(b.durations)})).catch(ve)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static _createSuggestFilter(e){const t=new Set;e.getOption(99)==="none"&&t.add(27);const n=e.getOption(104);return n.showMethods||t.add(0),n.showFunctions||t.add(1),n.showConstructors||t.add(2),n.showFields||t.add(3),n.showVariables||t.add(4),n.showClasses||t.add(5),n.showStructs||t.add(6),n.showInterfaces||t.add(7),n.showModules||t.add(8),n.showProperties||t.add(9),n.showEvents||t.add(10),n.showOperators||t.add(11),n.showUnits||t.add(12),n.showValues||t.add(13),n.showConstants||t.add(14),n.showEnums||t.add(15),n.showEnumMembers||t.add(16),n.showKeywords||t.add(17),n.showWords||t.add(18),n.showColors||t.add(19),n.showFiles||t.add(20),n.showReferences||t.add(21),n.showColors||t.add(22),n.showFolders||t.add(23),n.showTypeParameters||t.add(24),n.showSnippets||t.add(27),n.showUsers||t.add(25),n.showIssues||t.add(26),{itemKind:t,showDeprecated:n.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(ct(e.leadingLineContent)!==ct(this._context.leadingLineContent)){this.cancel();return}if(e.column<this._context.column){e.leadingWord.word?this.trigger({auto:this._context.auto,shy:!1},!0):this.cancel();return}if(this._completionModel){if(e.leadingWord.word.length!==0&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){const t=new Set(zs.all(this._editor.getModel()));for(let n of this._completionModel.allProvider)t.delete(n);const i=this._completionModel.adopt(new Set);this.trigger({auto:this._context.auto,shy:!1},!0,t,{items:i,clipboardText:this._completionModel.clipboardText});return}if(e.column>this._context.column&&this._completionModel.incomplete.size>0&&e.leadingWord.word.length!==0){const{incomplete:t}=this._completionModel,i=this._completionModel.adopt(t);this.trigger({auto:this._state===2,shy:!1,triggerKind:2},!0,t,{items:i,clipboardText:this._completionModel.clipboardText})}else{let t=this._completionModel.lineContext,i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){if(Xh.shouldAutoTrigger(this._editor)&&this._context.leadingWord.endColumn<e.leadingWord.startColumn){this.trigger({auto:this._context.auto,shy:!1},!0);return}if(this._context.auto){this.cancel();return}else if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,auto:this._context.auto,shy:this._context.shy,isFrozen:i})}}}}};Q1=VZ([jd(1,Ms),jd(2,Va),jd(3,Ba),jd(4,Tr),jd(5,we),jd(6,At)],Q1);const $Z=T("symbolIcon.arrayForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),jZ=T("symbolIcon.booleanForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),qZ=T("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},p("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),KZ=T("symbolIcon.colorForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),GZ=T("symbolIcon.constantForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),ZZ=T("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},p("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),YZ=T("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},p("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),XZ=T("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},p("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),QZ=T("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},p("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),JZ=T("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},p("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),eY=T("symbolIcon.fileForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),tY=T("symbolIcon.folderForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),iY=T("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},p("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),nY=T("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},p("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),sY=T("symbolIcon.keyForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),oY=T("symbolIcon.keywordForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),rY=T("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},p("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),aY=T("symbolIcon.moduleForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),lY=T("symbolIcon.namespaceForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),dY=T("symbolIcon.nullForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),cY=T("symbolIcon.numberForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),hY=T("symbolIcon.objectForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),uY=T("symbolIcon.operatorForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),fY=T("symbolIcon.packageForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),gY=T("symbolIcon.propertyForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),pY=T("symbolIcon.referenceForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mY=T("symbolIcon.snippetForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),_Y=T("symbolIcon.stringForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),bY=T("symbolIcon.structForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),vY=T("symbolIcon.textForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),wY=T("symbolIcon.typeParameterForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),CY=T("symbolIcon.unitForeground",{dark:ue,light:ue,hc:ue},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SY=T("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},p("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));tt((s,e)=>{const t=s.getColor($Z);t&&e.addRule(`${te.symbolArray.cssSelector} { color: ${t}; }`);const i=s.getColor(jZ);i&&e.addRule(`${te.symbolBoolean.cssSelector} { color: ${i}; }`);const n=s.getColor(qZ);n&&e.addRule(`${te.symbolClass.cssSelector} { color: ${n}; }`);const o=s.getColor(rY);o&&e.addRule(`${te.symbolMethod.cssSelector} { color: ${o}; }`);const r=s.getColor(KZ);r&&e.addRule(`${te.symbolColor.cssSelector} { color: ${r}; }`);const a=s.getColor(GZ);a&&e.addRule(`${te.symbolConstant.cssSelector} { color: ${a}; }`);const l=s.getColor(ZZ);l&&e.addRule(`${te.symbolConstructor.cssSelector} { color: ${l}; }`);const d=s.getColor(YZ);d&&e.addRule(`
${te.symbolValue.cssSelector},${te.symbolEnum.cssSelector} { color: ${d}; }`);const c=s.getColor(XZ);c&&e.addRule(`${te.symbolEnumMember.cssSelector} { color: ${c}; }`);const h=s.getColor(QZ);h&&e.addRule(`${te.symbolEvent.cssSelector} { color: ${h}; }`);const u=s.getColor(JZ);u&&e.addRule(`${te.symbolField.cssSelector} { color: ${u}; }`);const f=s.getColor(eY);f&&e.addRule(`${te.symbolFile.cssSelector} { color: ${f}; }`);const g=s.getColor(tY);g&&e.addRule(`${te.symbolFolder.cssSelector} { color: ${g}; }`);const m=s.getColor(iY);m&&e.addRule(`${te.symbolFunction.cssSelector} { color: ${m}; }`);const b=s.getColor(nY);b&&e.addRule(`${te.symbolInterface.cssSelector} { color: ${b}; }`);const v=s.getColor(sY);v&&e.addRule(`${te.symbolKey.cssSelector} { color: ${v}; }`);const _=s.getColor(oY);_&&e.addRule(`${te.symbolKeyword.cssSelector} { color: ${_}; }`);const w=s.getColor(aY);w&&e.addRule(`${te.symbolModule.cssSelector} { color: ${w}; }`);const C=s.getColor(lY);C&&e.addRule(`${te.symbolNamespace.cssSelector} { color: ${C}; }`);const S=s.getColor(dY);S&&e.addRule(`${te.symbolNull.cssSelector} { color: ${S}; }`);const D=s.getColor(cY);D&&e.addRule(`${te.symbolNumber.cssSelector} { color: ${D}; }`);const y=s.getColor(hY);y&&e.addRule(`${te.symbolObject.cssSelector} { color: ${y}; }`);const x=s.getColor(uY);x&&e.addRule(`${te.symbolOperator.cssSelector} { color: ${x}; }`);const E=s.getColor(fY);E&&e.addRule(`${te.symbolPackage.cssSelector} { color: ${E}; }`);const P=s.getColor(gY);P&&e.addRule(`${te.symbolProperty.cssSelector} { color: ${P}; }`);const A=s.getColor(pY);A&&e.addRule(`${te.symbolReference.cssSelector} { color: ${A}; }`);const H=s.getColor(mY);H&&e.addRule(`${te.symbolSnippet.cssSelector} { color: ${H}; }`);const q=s.getColor(_Y);q&&e.addRule(`${te.symbolString.cssSelector} { color: ${q}; }`);const de=s.getColor(bY);de&&e.addRule(`${te.symbolStruct.cssSelector} { color: ${de}; }`);const ce=s.getColor(vY);ce&&e.addRule(`${te.symbolText.cssSelector} { color: ${ce}; }`);const be=s.getColor(wY);be&&e.addRule(`${te.symbolTypeParameter.cssSelector} { color: ${be}; }`);const ke=s.getColor(CY);ke&&e.addRule(`${te.symbolUnit.cssSelector} { color: ${ke}; }`);const Le=s.getColor(SY);Le&&e.addRule(`${te.symbolVariable.cssSelector} { color: ${Le}; }`)});class gO{constructor(){this._onDidWillResize=new M,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new M,this.onDidResize=this._onDidResize.event,this._sashListener=new X,this._size=new gt(0,0),this._minSize=new gt(0,0),this._maxSize=new gt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Ti(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Ti(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Ti(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:b_.North}),this._southSash=new Ti(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:b_.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(re.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(re.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(re.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(re.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(r,t));const a=new gt(t,e);gt.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}var yY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},LY=function(s,e){return function(t,i){e(t,i,s)}};function gD(s){return!!s&&!!(s.completion.documentation||s.completion.detail&&s.completion.detail!==s.completion.label)}let J1=class{constructor(e,t){this._editor=e,this._onDidClose=new M,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new M,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new X,this._renderDisposeable=new X,this._borderWidth=1,this._size=new gt(330,0),this.domNode=Y(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Xl,{editor:e}),this._body=Y(".body"),this._scrollbar=new sg(this._body,{}),$(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=$(this._body,Y(".header")),this._close=$(this._header,Y("span"+te.close.cssSelector)),this._close.title=p("details.close","Close"),this._type=$(this._header,Y("p.type")),this._docs=$(this._body,Y("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(40)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(40),i=t.fontFamily,n=e.get(105)||t.fontSize,o=e.get(106)||t.lineHeight,r=t.fontWeight,a=`${n}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=l,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(106)||this._editor.getOption(40).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=p("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,n;this._renderDisposeable.clear();let{detail:o,documentation:r}=e.completion;if(t){let a="";a+=`score: ${e.score[0]}
`,a+=`prefix: ${(i=e.word)!==null&&i!==void 0?i:"(no prefix)"}
`,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
`,a+=`distance: ${e.distance} (localityBonus-setting)
`,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
`,a+=`commit_chars: ${(n=e.completion.commitCharacters)===null||n===void 0?void 0:n.join("")}
`,r=new Ia().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!gD(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=a,this._type.title=a,En(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else hi(this._type),this._type.title="",Qi(this._type),this.domNode.classList.add("no-type");if(hi(this._docs),typeof r=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),hi(this._docs);const a=this._markdownRenderer.render(r);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new gt(e,t);gt.equals(i,this._size)||(this._size=i,l5(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}};J1=yY([LY(1,qe)],J1);class xY{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new X,this._added=!1,this._resizable=new gO,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,o=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&&(o=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,n=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e){var t;const i=vi(e);this._anchorBox=i,this._placeAtAnchor(this._anchorBox,(t=this._userSize)!==null&&t!==void 0?t:this.widget.size)}_placeAtAnchor(e,t){const i=eb(document.body),n=this.widget.getLayoutInfo();let o,r,a=new gt(220,2*n.lineHeight),l=0,d=e.top,c=e.top+e.height-n.borderHeight,h,u,f=i.width-(e.left+e.width+n.borderWidth+n.horizontalPadding);l=-n.borderWidth+e.left+e.width,u=!0,o=new gt(f,i.height-e.top-n.borderHeight-n.verticalPadding),r=o.with(void 0,e.top+e.height-n.borderHeight-n.verticalPadding),t.width>f&&(e.left>f&&(f=e.left-n.borderWidth-n.horizontalPadding,u=!1,l=Math.max(n.horizontalPadding,e.left-t.width-n.borderWidth),o=o.with(f),r=o.with(void 0,r.height)),e.width>f*1.3&&i.height-(e.top+e.height)>e.height&&(f=e.width,l=e.left,d=-n.borderWidth+e.top+e.height,o=new gt(e.width-n.borderHeight,i.height-e.top-e.height-n.verticalPadding),r=o.with(void 0,e.top-n.verticalPadding),a=a.with(o.width)));let g=t.height,m=Math.max(o.height,r.height);g>m&&(g=m);let b;g<=o.height?(h=!0,b=o):(h=!1,b=r),this._applyTopLeft({left:l,top:h?d:c-g}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!h,u,h,!u),this._resizable.minSize=a,this._resizable.maxSize=b,this._resizable.layout(g,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var DY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},kC=function(s,e){return function(t,i){e(t,i,s)}};class pD extends V_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=p("ddd","{0} ({1})",this._action.label,pD.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}}let ey=class{constructor(e,t,i,n){this._menuService=i,this._contextKeyService=n,this._menuDisposables=new X,this.element=$(e,Y(".suggest-status-bar"));const o=r=>r instanceof Uc?t.createInstance(pD,r,void 0):void 0;this._leftActions=new Nr(this.element,{actionViewItemProvider:o}),this._rightActions=new Nr(this.element,{actionViewItemProvider:o}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(Na,this._contextKeyService),t=()=>{const i=[],n=[];for(let[o,r]of e.getActions())o==="left"?i.push(...r):n.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(n)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};ey=DY([kC(1,qe),kC(2,vh),kC(3,we)],ey);var mr;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})(mr||(mr={}));function up(s,e,t,i){const n=i===mr.ROOT_FOLDER?["rootfolder-icon"]:i===mr.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Oe.data?o=_a.parseMetaData(t).get(_a.META_DATA_LABEL):o=CN(ZM(t).toLowerCase()),i===mr.FOLDER)n.push(`${o}-name-folder-icon`);else{if(o){if(n.push(`${o}-name-file-icon`),o.length<=255){const a=o.split(".");for(let l=1;l<a.length;l++)n.push(`${a.slice(l).join(".")}-ext-file-icon`)}n.push("ext-file-icon")}const r=kY(s,e,t);r&&n.push(`${CN(r)}-lang-file-icon`)}}return n}function kY(s,e,t){if(!t)return null;let i=null;if(t.scheme===Oe.data){const o=_a.parseMetaData(t).get(_a.META_DATA_MIME);o&&(i=e.getModeId(o))}else{const n=s.getModel(t);n&&(i=n.getModeId())}return i&&i!==vx?i:e.getModeIdByFilepathOrFirstLine(t)}function CN(s){return s.replace(/[\11\12\14\15\40]/g,"/")}var IY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},IC=function(s,e){return function(t,i){e(t,i,s)}},Qh;function pO(s){return`suggest-aria-id:${s}`}const EY=ki("suggest-more-info",te.chevronRight,p("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),NY=new(Qh=class rm{extract(e,t){if(e.textLabel.match(rm._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(rm._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const i=rm._regexRelaxed.exec(e.completion.documentation);if(i&&(i.index===0||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}},Qh._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,Qh._regexStrict=new RegExp(`^${Qh._regexRelaxed.source}$`,"i"),Qh);let ty=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._modeService=i,this._themeService=n,this._onDidToggleDetails=new M,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=Object.create(null);t.disposables=new X,t.root=e,t.root.classList.add("show-file-icons"),t.icon=$(e,Y(".icon")),t.colorspan=$(t.icon,Y("span.colorspan"));const i=$(e,Y(".contents")),n=$(i,Y(".main"));t.iconContainer=$(n,Y(".icon-label.codicon")),t.left=$(n,Y("span.left")),t.right=$(n,Y("span.right")),t.iconLabel=new Kx(t.left,{supportHighlights:!0,supportIcons:!0}),t.disposables.add(t.iconLabel),t.parametersLabel=$(t.left,Y("span.signature-label")),t.qualifierLabel=$(t.left,Y("span.qualifier-label")),t.detailsLabel=$(t.right,Y("span.details-label")),t.readMore=$(t.right,Y("span.readMore"+wt.asCSSSelector(EY))),t.readMore.title=p("readMore","Read More");const o=()=>{const r=this._editor.getOptions(),a=r.get(40),l=a.fontFamily,d=a.fontFeatureSettings,c=r.get(105)||a.fontSize,h=r.get(106)||a.lineHeight,u=a.fontWeight,f=`${c}px`,g=`${h}px`;t.root.style.fontSize=f,t.root.style.fontWeight=u,n.style.fontFamily=l,n.style.fontFeatureSettings=d,n.style.lineHeight=g,t.icon.style.height=g,t.icon.style.width=g,t.readMore.style.height=g,t.readMore.style.width=g};return o(),t.disposables.add(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(40)||r.hasChanged(105)||r.hasChanged(106))&&o()})),t}renderElement(e,t,i){const{completion:n}=e;i.root.id=pO(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:zb(e.score)};let r=[];if(n.kind===19&&NY.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(n.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=up(this._modelService,this._modeService,he.from({scheme:"fake",path:e.textLabel}),mr.FILE),l=up(this._modelService,this._modeService,he.from({scheme:"fake",path:n.detail}),mr.FILE);o.extraClasses=a.length>l.length?a:l}else n.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=eg([up(this._modelService,this._modeService,he.from({scheme:"fake",path:e.textLabel}),mr.FOLDER),up(this._modelService,this._modeService,he.from({scheme:"fake",path:n.detail}),mr.FOLDER)])):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...A3(n.kind).split(" ")));n.tags&&n.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=EC(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=EC(n.label.detail||""),i.detailsLabel.textContent=EC(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(104).showInlineDetails?En(i.detailsLabel):Qi(i.detailsLabel),gD(e)?(i.right.classList.add("can-expand-details"),En(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Qi(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};ty=IY([IC(1,Vt),IC(2,to),IC(3,pt)],ty);function EC(s){return s.replace(/\r\n|\r|\n/g,"")}var MY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},fp=function(s,e){return function(t,i){e(t,i,s)}},TY=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const AY=T("editorSuggestWidget.background",{dark:Ki,light:Ki,hc:Ki},p("editorSuggestWidgetBackground","Background color of the suggest widget.")),RY=T("editorSuggestWidget.border",{dark:Sl,light:Sl,hc:Sl},p("editorSuggestWidgetBorder","Border color of the suggest widget.")),OY=T("editorSuggestWidget.foreground",{dark:ca,light:ca,hc:ca},p("editorSuggestWidgetForeground","Foreground color of the suggest widget.")),PY=T("editorSuggestWidget.selectedForeground",{dark:Hp,light:Hp,hc:Hp},p("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget.")),FY=T("editorSuggestWidget.selectedIconForeground",{dark:zp,light:zp,hc:zp},p("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget.")),BY=T("editorSuggestWidget.selectedBackground",{dark:Up,light:Up,hc:Up},p("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget.")),WY=T("editorSuggestWidget.highlightForeground",{dark:kc,light:kc,hc:kc},p("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget.")),VY=T("editorSuggestWidget.focusHighlightForeground",{dark:Vp,light:Vp,hc:Vp},p("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));class HY{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Yl}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(gt.is(i))return gt.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Af=class iy{constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new an,this._disposables=new X,this._onDidSelect=new M,this._onDidFocus=new M,this._onDidHide=new M,this._onDidShow=new M,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new M,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new gO,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new zY(this,e),this._persistedSize=new HY(t,e);class r{constructor(f,g,m=!1,b=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=m,this.persistWidth=b}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(u=>{var f,g,m,b;if(this._resize(u.dimension.width,u.dimension.height),a&&(a.persistHeight=a.persistHeight||!!u.north||!!u.south,a.persistWidth=a.persistWidth||!!u.east||!!u.west),!!u.done){if(a){const{itemHeight:v,defaultSize:_}=this.getLayoutInfo(),w=Math.round(v/2);let{width:C,height:S}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-S)<=w)&&(S=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:_.height),(!a.persistWidth||Math.abs(a.currentSize.width-C)<=w)&&(C=(b=(m=a.persistedSize)===null||m===void 0?void 0:m.width)!==null&&b!==void 0?b:_.width),this._persistedSize.store(new gt(C,S))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=$(this.element.domNode,Y(".message")),this._listElement=$(this.element.domNode,Y(".tree"));const l=o.createInstance(J1,this.editor);l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new xY(l,this.editor);const d=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(104).showIcons);d();const c=o.createInstance(ty,this.editor);this._disposables.add(c),this._disposables.add(c.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Ho("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[c],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,accessibilityProvider:{getRole:()=>"option",getAriaLabel:u=>{if(u.isResolved&&this._isDetailsVisible()){const{documentation:f,detail:g}=u.completion,m=Ai("{0}{1}",g||"",f?typeof f=="string"?f:f.value:"");return p("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",u.textLabel,m)}else return u.textLabel},getWidgetAriaLabel:()=>p("suggest","Suggest"),getWidgetRole:()=>"listbox"}}),this._status=o.createInstance(ey,this.element.domNode);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(104).showStatusBar);h(),this._disposables.add($l(this._list,n,{listInactiveFocusBackground:BY,listInactiveFocusOutline:Vi})),this._disposables.add(n.onDidColorThemeChange(u=>this._onThemeChange(u))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onTap(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onDidChangeSelection(u=>this._onListSelection(u))),this._disposables.add(this._list.onDidChangeFocus(u=>this._onListFocus(u))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(104)&&(h(),d())})),this._ctxSuggestWidgetVisible=We.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=We.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=We.MultipleSuggestions.bindTo(i),this._disposables.add(Gt(this._details.widget.domNode,"keydown",u=>{this._onDetailsKeydown.fire(u)})),this._disposables.add(this.editor.onMouseDown(u=>this._onEditorMouseDown(u)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){const t=e.getColor(AY);t&&(this.element.domNode.style.backgroundColor=t.toString(),this._messageElement.style.backgroundColor=t.toString(),this._details.widget.domNode.style.backgroundColor=t.toString());const i=e.getColor(RY);i&&(this.element.domNode.style.borderColor=i.toString(),this._messageElement.style.borderColor=i.toString(),this._status.element.style.borderTopColor=i.toString(),this._details.widget.domNode.style.borderColor=i.toString(),this._detailsBorderColor=i.toString());const n=e.getColor(Ca);n&&(this._detailsFocusBorderColor=n.toString()),this._details.widget.borderWidth=e.type==="hc"?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0});return}if(!this._completionModel)return;const i=e.elements[0],n=e.indexes[0];i!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(n),this._currentSuggestionDetails=fi(o=>TY(this,void 0,void 0,function*(){const r=Nl(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250);o.onCancellationRequested(()=>r.dispose());const a=yield i.resolve(o);return r.dispose(),a})),this._currentSuggestionDetails.then(()=>{n>=this._list.length||i!==this._list.element(n)||(this._ignoreFocusEvents=!0,this._list.splice(n,1,[i]),this._list.setFocus([n]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:pO(n)}))}).catch(ve)),this._onDidFocus.fire({item:i,index:n,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Qi(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=iy.LOADING_MESSAGE,Qi(this._listElement,this._status.element),En(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=iy.NO_SUGGESTIONS_MESSAGE,Qi(this._listElement,this._status.element),En(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 3:Qi(this._messageElement),En(this._listElement,this._status.element),this._show();break;case 4:Qi(this._messageElement),En(this._listElement,this._status.element),this._show();break;case 5:Qi(this._messageElement),En(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Nl(()=>this._setState(1),t)))}showSuggestions(e,t,i,n){var o,r;if(this._contentWidget.setPosition(this.editor.getPosition()),(o=this._loadingTimeout)===null||o===void 0||o.dispose(),(r=this._currentSuggestionDetails)===null||r===void 0||r.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const a=this._completionModel.items.length,l=a===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(a>1),l){this._setState(n?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus([t]),this._layout(this.element.size),this._detailsBorderColor&&(this._details.widget.domNode.style.borderColor=this._detailsBorderColor)}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._detailsBorderColor&&(this._details.widget.domNode.style.borderColor=this._detailsBorderColor)):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._detailsFocusBorderColor&&(this._details.widget.domNode.style.borderColor=this._detailsFocusBorderColor))}toggleDetails(){this._isDetailsVisible()?(this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(gD(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.height<i&&this._persistedSize.store(t.with(void 0,i))}isFrozen(){return this._state===4}_afterRender(e){if(e===null){this._isDetailsVisible()&&this._details.hide();return}this._state===2||this._state===1||(this._isDetailsVisible()&&this._details.show(),this._positionDetails())}_layout(e){var t,i,n;if(!this.editor.hasModel()||!this.editor.getDomNode())return;const o=eb(document.body),r=this.getLayoutInfo();e||(e=r.defaultSize);let a=e.height,l=e.width;if(this._status.element.style.lineHeight=`${r.itemHeight}px`,this._state===2||this._state===1)a=r.itemHeight+r.borderHeight,l=r.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new gt(l,a),this._contentWidget.setPreference(2);else{const d=o.width-r.borderHeight-2*r.horizontalPadding;l>d&&(l=d);const c=this._completionModel?this._completionModel.stats.pLabelLen*r.typicalHalfwidthCharacterWidth:l,h=r.statusBarHeight+this._list.contentHeight+r.borderHeight,u=r.itemHeight+r.statusBarHeight,f=vi(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),m=f.top+g.top+g.height,b=Math.min(o.height-m-r.verticalPadding,h),v=Math.min(f.top+g.top-r.verticalPadding,h);let _=Math.min(Math.max(v,b)+r.borderHeight,h);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),a<u&&(a=u),a>_&&(a=_),a>b||this._forceRenderingAbove&&v>100?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),_=v):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),_=b),this.element.preferredSize=new gt(c,r.defaultSize.height),this.element.maxSize=new gt(d,_),this.element.minSize=new gt(220,u),this._cappedHeight=a===h?{wanted:(n=(i=this._cappedHeight)===null||i===void 0?void 0:i.wanted)!==null&&n!==void 0?n:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode)}getLayoutInfo(){const e=this.editor.getOption(40),t=fs(this.editor.getOption(106)||e.lineHeight,8,1e3),i=!this.editor.getOption(104).showStatusBar||this._state===2||this._state===1?0:t,n=this._details.widget.borderWidth,o=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new gt(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};Af.LOADING_MESSAGE=p("suggestWidget.loading","Loading...");Af.NO_SUGGESTIONS_MESSAGE=p("suggestWidget.noSuggestions","No suggestions.");Af=MY([fp(1,Or),fp(2,we),fp(3,pt),fp(4,qe)],Af);class zY{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new gt(t+2*i+n,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}tt((s,e)=>{const t=s.getColor(WY);t&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight { color: ${t}; }`);const i=s.getColor(VY);t&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight { color: ${i}; }`);const n=s.getColor(OY);n&&e.addRule(`.monaco-editor .suggest-widget, .monaco-editor .suggest-details { color: ${n}; }`);const o=s.getColor(PY);o&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused { color: ${o}; }`);const r=s.getColor(FY);r&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon { color: ${r}; }`);const a=s.getColor(ng);a&&e.addRule(`.monaco-editor .suggest-details a { color: ${a}; }`);const l=s.getColor(UL);l&&e.addRule(`.monaco-editor .suggest-details code { background-color: ${l}; }`)});var UY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$Y=function(s,e){return function(t,i){e(t,i,s)}};let Rf=class mO{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=mO.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(109)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(109)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),n=this._editor.getSelection(),o=i.getWordAtPosition(n.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===n.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};Rf.AtEnd=new se("atEndOfWord",!1);Rf=UY([$Y(1,we)],Rf);class jY{constructor(e,t,i){this._disposables=new X,this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(n=>{if(this._active&&!t.isFrozen()){const o=n.charCodeAt(n.length-1);this._active.acceptCharacters.has(o)&&e.getOption(0)&&i(this._active.item)}}))}_onItem(e){if(!e||!vn(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new oc;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class pv{constructor(e,t){this._disposables=new X,this._lastOvertyped=[],this._empty=!0,this._disposables.add(e.onWillType(()=>{if(!this._empty||!e.hasModel())return;const i=e.getSelections(),n=i.length;let o=!1;for(let a=0;a<n;a++)if(!i[a].isEmpty()){o=!0;break}if(!o)return;this._lastOvertyped=[];const r=e.getModel();for(let a=0;a<n;a++){const l=i[a];if(r.getValueLengthInRange(l)>pv._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}this._empty=!1})),this._disposables.add(t.onDidCancel(i=>{!this._empty&&!i.retrigger&&(this._empty=!0)}))}getLastOvertypedInfo(e){if(!this._empty&&e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}pv._maxSelectionLength=51200;var qY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Jh=function(s,e){return function(t,i){e(t,i,s)}};class KY{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),o=e.getPositionAt(n+1);this._marker=e.deltaDecorations([],[{range:L.fromPositions(t,o),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let Cs=class _O{constructor(e,t,i,n,o,r){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=o,this._logService=r,this._lineSuffix=new Es,this._toDispose=new X,this.editor=e,this.model=o.createInstance(Q1,this.editor);const a=We.InsertMode.bindTo(n);a.set(e.getOption(104).insertMode),this.model.onDidTrigger(()=>a.set(e.getOption(104).insertMode)),this.widget=this._toDispose.add(new _c(()=>{const c=this._instantiationService.createInstance(Af,this.editor);this._toDispose.add(c),this._toDispose.add(c.onDidSelect(m=>this._insertSuggestion(m,0),this));const h=new jY(this.editor,c,m=>this._insertSuggestion(m,2));this._toDispose.add(h),this._toDispose.add(this.model.onDidSuggest(m=>{m.completionModel.items.length===0&&h.reset()}));const u=We.MakesTextEdit.bindTo(this._contextKeyService),f=We.HasInsertAndReplaceRange.bindTo(this._contextKeyService),g=We.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Pe(()=>{u.reset(),f.reset(),g.reset()})),this._toDispose.add(c.onDidFocus(({item:m})=>{const b=this.editor.getPosition(),v=m.editStart.column,_=b.column;let w=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!m.completion.command&&!m.completion.additionalTextEdits&&!(m.completion.insertTextRules&4)&&_-v===m.completion.insertText.length&&(w=this.editor.getModel().getValueInRange({startLineNumber:b.lineNumber,startColumn:v,endLineNumber:b.lineNumber,endColumn:_})!==m.completion.insertText),u.set(w),f.set(!O.equals(m.editInsertEnd,m.editReplaceEnd)),g.set(!!m.provider.resolveCompletionItem||!!m.completion.documentation||m.completion.detail!==m.completion.label)})),this._toDispose.add(c.onDetailsKeyDown(m=>{if(m.toKeybinding().equals(new zu(!0,!1,!1,!1,33))||Re&&m.toKeybinding().equals(new zu(!1,!1,!1,!0,33))){m.stopPropagation();return}m.toKeybinding().isModifierKey()||this.editor.focus()})),c})),this._overtypingCapturer=this._toDispose.add(new _c(()=>this._toDispose.add(new pv(this.editor,this.model)))),this._alternatives=this._toDispose.add(new _c(()=>this._toDispose.add(new Ql(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(Rf,e)),this._toDispose.add(this.model.onDidTrigger(c=>{this.widget.value.showTriggered(c.auto,c.shy?250:50),this._lineSuffix.value=new KY(this.editor.getModel(),c.position)})),this._toDispose.add(this.model.onDidSuggest(c=>{if(!c.shy){let h=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),c.completionModel.items);this.widget.value.showSuggestions(c.completionModel,h,c.isFrozen,c.auto)}})),this._toDispose.add(this.model.onDidCancel(c=>{c.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));let l=We.AcceptSuggestionsOnEnter.bindTo(n),d=()=>{const c=this.editor.getOption(1);l.set(c==="on"||c==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}static get(e){return e.getContribution(_O.ID)}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=this.editor.getModel(),n=i.getAlternativeVersionId(),{item:o}=e,r=[],a=new on;t&1||this.editor.pushUndoStop();const l=this.getOverwriteInfo(o,!!(t&8));if(this._memoryService.memorize(i,this.editor.getPosition(),o),Array.isArray(o.completion.additionalTextEdits)){const c=zl.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map(h=>Bt.replace(L.lift(h.range),h.text))),c.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!o.isResolved){const c=new Ao(!0);let h;const u=i.onDidChangeContent(b=>{if(b.isFlush){a.cancel(),u.dispose();return}for(let v of b.changes){const _=L.getEndPosition(v.range);(!h||O.isBefore(_,h))&&(h=_)}});let f=t;t|=2;let g=!1,m=this.editor.onWillType(()=>{m.dispose(),g=!0,f&2||this.editor.pushUndoStop()});r.push(o.resolve(a.token).then(()=>{if(!o.completion.additionalTextEdits||a.token.isCancellationRequested||h&&o.completion.additionalTextEdits.some(v=>O.isBefore(h,L.getStartPosition(v.range))))return!1;g&&this.editor.pushUndoStop();const b=zl.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map(v=>Bt.replace(L.lift(v.range),v.text))),b.restoreRelativeVerticalPositionOfCursor(this.editor),(g||!(f&2))&&this.editor.pushUndoStop(),!0}).then(b=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",c.elapsed(),b),u.dispose(),m.dispose()}))}let{insertText:d}=o.completion;o.completion.insertTextRules&4||(d=uv.escape(d)),yi.get(this.editor).insert(d,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(o.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),o.completion.command?o.completion.command.id===_g.id?this.model.trigger({auto:!0,shy:!1},!0):(r.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch(ve)),this.model.cancel()):this.model.cancel(),t&4&&this._alternatives.value.set(e,c=>{for(a.cancel();i.canUndo();){n!==i.getAlternativeVersionId()&&i.undo(),this._insertSuggestion(c,3|(t&8?8:0));break}}),this._alertCompletionItem(o),Promise.all(r).finally(()=>{this.model.clear(),a.dispose()})}getOverwriteInfo(e,t){nt(this.editor.hasModel());let i=this.editor.getOption(104).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:n+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(vn(e.completion.additionalTextEdits)){let t=p("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);wi(t)}}triggerSuggest(e){this.editor.hasModel()&&(this.model.trigger({auto:!1,shy:!1},!1,e),this.editor.revealLine(this.editor.getPosition().lineNumber,0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,l=r.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:l})!==o.completion.insertText};re.once(this.model.onDidTrigger)(o=>{let r=[];re.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{$e(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if($e(r),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),d=a.items[l];if(!n(d)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:d,model:a},7)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealLine(t.lineNumber,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.value.stopForceRenderingAbove()}};Cs.ID="editor.contrib.suggestController";Cs=qY([Jh(1,uO),Jh(2,Wt),Jh(3,we),Jh(4,qe),Jh(5,Tr)],Cs);class _g extends ne{constructor(){super({id:_g.id,label:p("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:J.and(I.writable,I.hasCompletionItemProvider),kbOpts:{kbExpr:I.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t){const i=Cs.get(t);i&&i.triggerSuggest()}}_g.id="editor.action.triggerSuggest";Xe(Cs.ID,Cs);Q(_g);const ss=190,yn=Di.bindToContribution(Cs.get);G(new yn({id:"acceptSelectedSuggestion",precondition:We.Visible,handler(s){s.acceptSelectedSuggestion(!0,!1)}}));ln.registerKeybindingRule({id:"acceptSelectedSuggestion",when:J.and(We.Visible,I.textInputFocus),primary:2,weight:ss});ln.registerKeybindingRule({id:"acceptSelectedSuggestion",when:J.and(We.Visible,I.textInputFocus,We.AcceptSuggestionsOnEnter,We.MakesTextEdit),primary:3,weight:ss});xs.appendMenuItem(Na,{command:{id:"acceptSelectedSuggestion",title:p("accept.insert","Insert")},group:"left",order:1,when:We.HasInsertAndReplaceRange.toNegated()});xs.appendMenuItem(Na,{command:{id:"acceptSelectedSuggestion",title:p("accept.insert","Insert")},group:"left",order:1,when:J.and(We.HasInsertAndReplaceRange,We.InsertMode.isEqualTo("insert"))});xs.appendMenuItem(Na,{command:{id:"acceptSelectedSuggestion",title:p("accept.replace","Replace")},group:"left",order:1,when:J.and(We.HasInsertAndReplaceRange,We.InsertMode.isEqualTo("replace"))});G(new yn({id:"acceptAlternativeSelectedSuggestion",precondition:J.and(We.Visible,I.textInputFocus),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:1027,secondary:[1026]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Na,group:"left",order:2,when:J.and(We.HasInsertAndReplaceRange,We.InsertMode.isEqualTo("insert")),title:p("accept.replace","Replace")},{menuId:Na,group:"left",order:2,when:J.and(We.HasInsertAndReplaceRange,We.InsertMode.isEqualTo("replace")),title:p("accept.insert","Insert")}]}));He.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");G(new yn({id:"hideSuggestWidget",precondition:We.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:9,secondary:[1033]}}));G(new yn({id:"selectNextSuggestion",precondition:J.and(We.Visible,We.MultipleSuggestions),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));G(new yn({id:"selectNextPageSuggestion",precondition:J.and(We.Visible,We.MultipleSuggestions),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:12,secondary:[2060]}}));G(new yn({id:"selectLastSuggestion",precondition:J.and(We.Visible,We.MultipleSuggestions),handler:s=>s.selectLastSuggestion()}));G(new yn({id:"selectPrevSuggestion",precondition:J.and(We.Visible,We.MultipleSuggestions),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));G(new yn({id:"selectPrevPageSuggestion",precondition:J.and(We.Visible,We.MultipleSuggestions),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:11,secondary:[2059]}}));G(new yn({id:"selectFirstSuggestion",precondition:J.and(We.Visible,We.MultipleSuggestions),handler:s=>s.selectFirstSuggestion()}));G(new yn({id:"toggleSuggestionDetails",precondition:We.Visible,handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:2058,mac:{primary:266}},menuOpts:[{menuId:Na,group:"right",order:1,when:J.and(We.DetailsVisible,We.CanResolve),title:p("detail.more","show less")},{menuId:Na,group:"right",order:1,when:J.and(We.DetailsVisible.toNegated(),We.CanResolve),title:p("detail.less","show more")}]}));G(new yn({id:"toggleExplainMode",precondition:We.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:100,primary:2133}}));G(new yn({id:"toggleSuggestionFocus",precondition:We.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:2570,mac:{primary:778}}}));G(new yn({id:"insertBestCompletion",precondition:J.and(I.textInputFocus,J.equals("config.editor.tabCompletion","on"),Rf.AtEnd,We.Visible.toNegated(),Ql.OtherSuggestions.toNegated(),yi.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(tn(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:ss,primary:2}}));G(new yn({id:"insertNextSuggestion",precondition:J.and(I.textInputFocus,J.equals("config.editor.tabCompletion","on"),Ql.OtherSuggestions,We.Visible.toNegated(),yi.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:2}}));G(new yn({id:"insertPrevSuggestion",precondition:J.and(I.textInputFocus,J.equals("config.editor.tabCompletion","on"),Ql.OtherSuggestions,We.Visible.toNegated(),yi.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:ss,kbExpr:I.textInputFocus,primary:1026}}));Q(class extends ne{constructor(){super({id:"editor.action.resetSuggestSize",label:p("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(s,e){Cs.get(e).resetWidgetSize()}});class GY extends rO{constructor(e){super(e),this.isSuggestWidgetVisible=!1,this.currentGhostText=void 0,this._isActive=!1,this.isShiftKeyPressed=!1,this.minReservedLineCount=0,this.setInactiveDelayed=this._register(new bt(()=>{this.isSuggestWidgetVisible||this.isActive&&(this._isActive=!1,this.onDidChangeEmitter.fire())},100));const t=Cs.get(this.editor);if(t){let i=!1;const n=()=>{i||(i=!0,this._register(t.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this._isActive=!0,this.updateFromSuggestion()})),this._register(t.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.setInactiveDelayed.schedule(),this.minReservedLineCount=0,this.updateFromSuggestion()})),this._register(t.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this._isActive=!0,this.updateFromSuggestion()})))};this._register(re.once(t.model.onDidTrigger)(o=>{n()}))}this.updateFromSuggestion(),this._register(Pe(()=>{const i=Cs.get(this.editor);i&&i.stopForceRenderingAbove()})),this._register(e.onKeyDown(i=>{i.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.updateFromSuggestion())})),this._register(e.onKeyUp(i=>{i.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.updateFromSuggestion())}))}get isActive(){return this._isActive}setExpanded(e){super.setExpanded(e),this.updateFromSuggestion()}isSuggestionPreviewEnabled(){return this.editor.getOption(104).preview}updateFromSuggestion(){const e=Cs.get(this.editor);if(!e){this.setCurrentInlineCompletion(void 0);return}if(!this.isSuggestWidgetVisible){this.setCurrentInlineCompletion(void 0);return}const t=e.widget.value.getFocusedItem();if(!t){this.setCurrentInlineCompletion(void 0);return}this.setCurrentInlineCompletion(ZY(e,this.editor.getPosition(),t,this.isShiftKeyPressed))}setCurrentInlineCompletion(e){const t=this.editor.getOptions().get(104).previewMode;this.currentGhostText=e?aO(e,this.editor.getModel(),t)||new oO(e.range.endLineNumber,[],this.minReservedLineCount):void 0,this.currentGhostText&&this.expanded&&(this.minReservedLineCount=Math.max(this.minReservedLineCount,...this.currentGhostText.parts.map(n=>n.lines.length-1)));const i=Cs.get(this.editor);i&&(this.minReservedLineCount>=1&&this.isSuggestionPreviewEnabled()?i.forceRenderingAbove():i.stopForceRenderingAbove()),this.onDidChangeEmitter.fire()}get ghostText(){return this.isSuggestionPreviewEnabled()?this.currentGhostText:void 0}}function ZY(s,e,t,i){const n=t.item;if(Array.isArray(n.completion.additionalTextEdits))return{text:"",range:L.fromPositions(e,e)};let{insertText:o}=n.completion;if(n.completion.insertTextRules&4){const a=new uv().parse(o),l=s.editor.getModel();go.adjustWhitespace(l,e,a,!0,!0),o=a.toString()}const r=s.getOverwriteInfo(n,i);return{text:o,range:L.fromPositions(e.delta(0,-r.overwriteBefore),e.delta(0,Math.max(r.overwriteAfter,0)))}}var YY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},XY=function(s,e){return function(t,i){e(t,i,s)}},QY=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class JY extends U{constructor(){super(...arguments),this.onDidChangeEmitter=new M,this.onDidChange=this.onDidChangeEmitter.event,this.hasCachedGhostText=!1,this.currentModelRef=this._register(new Es)}get targetModel(){var e;return(e=this.currentModelRef.value)===null||e===void 0?void 0:e.object}setTargetModel(e){this.currentModelRef.clear(),this.currentModelRef.value=e?rZ(e,e.onDidChange(()=>{this.hasCachedGhostText=!1,this.onDidChangeEmitter.fire()})):void 0,this.hasCachedGhostText=!1,this.onDidChangeEmitter.fire()}get ghostText(){var e,t;return this.hasCachedGhostText||(this.cachedGhostText=(t=(e=this.currentModelRef.value)===null||e===void 0?void 0:e.object)===null||t===void 0?void 0:t.ghostText,this.hasCachedGhostText=!0),this.cachedGhostText}setExpanded(e){var t;(t=this.targetModel)===null||t===void 0||t.setExpanded(e)}get expanded(){return this.targetModel?this.targetModel.expanded:!1}get minReservedLineCount(){return this.targetModel?this.targetModel.minReservedLineCount:0}}let ny=class extends JY{constructor(e,t){super(),this.editor=e,this.commandService=t,this.suggestWidgetAdapterModel=this._register(new GY(this.editor)),this.inlineCompletionsModel=this._register(new Z1(this.editor,this.commandService)),this._register(this.suggestWidgetAdapterModel.onDidChange(()=>{this.updateModel()})),this.updateModel()}get activeInlineCompletionsModel(){if(this.targetModel===this.inlineCompletionsModel)return this.inlineCompletionsModel}updateModel(){this.setTargetModel(this.suggestWidgetAdapterModel.isActive?this.suggestWidgetAdapterModel:this.inlineCompletionsModel),this.inlineCompletionsModel.setActive(this.targetModel===this.inlineCompletionsModel)}shouldShowHoverAt(e){var t;const i=(t=this.activeInlineCompletionsModel)===null||t===void 0?void 0:t.ghostText;return i?i.parts.some(n=>e.containsPosition(new O(i.lineNumber,n.column))):!1}triggerInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.trigger()}commitInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.commitCurrentSuggestion()}hideInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.hide()}showNextInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.showNext()}showPreviousInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.showPrevious()}hasMultipleInlineCompletions(){var e;return QY(this,void 0,void 0,function*(){const t=yield(e=this.activeInlineCompletionsModel)===null||e===void 0?void 0:e.hasMultipleInlineCompletions();return t!==void 0?t:!1})}};ny=YY([XY(1,Wt)],ny);var bO=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sy=function(s,e){return function(t,i){e(t,i,s)}},mv=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let Li=class vO extends U{constructor(e,t){super(),this.editor=e,this.instantiationService=t,this.triggeredExplicitly=!1,this.activeController=this._register(new Es),this._register(this.editor.onDidChangeModel(()=>{this.updateModelController()})),this._register(this.editor.onDidChangeConfiguration(i=>{i.hasChanged(104)&&this.updateModelController(),i.hasChanged(52)&&this.updateModelController()})),this.updateModelController()}static get(e){return e.getContribution(vO.ID)}get activeModel(){var e;return(e=this.activeController.value)===null||e===void 0?void 0:e.model}updateModelController(){const e=this.editor.getOption(104),t=this.editor.getOption(52);this.activeController.value=void 0,this.activeController.value=this.editor.hasModel()&&(e.preview||t.enabled||this.triggeredExplicitly)?this.instantiationService.createInstance(oy,this.editor):void 0}shouldShowHoverAt(e){var t;return((t=this.activeModel)===null||t===void 0?void 0:t.shouldShowHoverAt(e))||!1}shouldShowHoverAtViewZone(e){var t,i;return((i=(t=this.activeController.value)===null||t===void 0?void 0:t.widget)===null||i===void 0?void 0:i.shouldShowHoverAtViewZone(e))||!1}trigger(){var e;this.triggeredExplicitly=!0,this.activeController.value||this.updateModelController(),(e=this.activeModel)===null||e===void 0||e.triggerInlineCompletion()}commit(){var e;(e=this.activeModel)===null||e===void 0||e.commitInlineCompletion()}hide(){var e;(e=this.activeModel)===null||e===void 0||e.hideInlineCompletion()}showNextInlineCompletion(){var e;(e=this.activeModel)===null||e===void 0||e.showNextInlineCompletion()}showPreviousInlineCompletion(){var e;(e=this.activeModel)===null||e===void 0||e.showPreviousInlineCompletion()}hasMultipleInlineCompletions(){var e;return mv(this,void 0,void 0,function*(){const t=yield(e=this.activeModel)===null||e===void 0?void 0:e.hasMultipleInlineCompletions();return t!==void 0?t:!1})}};Li.inlineSuggestionVisible=new se("inlineSuggestionVisible",!1,p("inlineSuggestionVisible","Whether an inline suggestion is visible"));Li.inlineSuggestionHasIndentation=new se("inlineSuggestionHasIndentation",!1,p("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace"));Li.ID="editor.contrib.ghostTextController";Li=bO([sy(1,qe)],Li);class eX{constructor(e){this.contextKeyService=e,this.inlineCompletionVisible=Li.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Li.inlineSuggestionHasIndentation.bindTo(this.contextKeyService)}}let oy=class extends U{constructor(e,t,i){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.contextKeys=new eX(this.contextKeyService),this.model=this._register(this.instantiationService.createInstance(ny,this.editor)),this.widget=this._register(this.instantiationService.createInstance(q1,this.editor,this.model)),this._register(Pe(()=>{this.contextKeys.inlineCompletionVisible.set(!1),this.contextKeys.inlineCompletionSuggestsIndentation.set(!1)})),this._register(this.model.onDidChange(()=>{this.updateContextKeys()})),this.updateContextKeys()}updateContextKeys(){var e;this.contextKeys.inlineCompletionVisible.set(((e=this.model.activeInlineCompletionsModel)===null||e===void 0?void 0:e.ghostText)!==void 0);const t=this.model.inlineCompletionsModel.ghostText;if(t&&t.parts.length>0){const{column:i,lines:n}=t.parts[0],o=n[0].startsWith(" ")||n[0].startsWith(" "),r=this.editor.getModel().getLineIndentColumn(t.lineNumber),a=i<=r;this.contextKeys.inlineCompletionSuggestsIndentation.set(!!this.model.activeInlineCompletionsModel&&o&&a)}else this.contextKeys.inlineCompletionSuggestsIndentation.set(!1)}};oy=bO([sy(1,qe),sy(2,we)],oy);const wO=Di.bindToContribution(Li.get),ry=new wO({id:"editor.action.inlineSuggest.commit",precondition:J.and(Li.inlineSuggestionVisible,Li.inlineSuggestionHasIndentation.toNegated(),I.tabMovesFocus.toNegated()),kbOpts:{weight:200,primary:2},handler(s){s.commit(),s.editor.focus()}});G(ry);G(new wO({id:"editor.action.inlineSuggest.hide",precondition:Li.inlineSuggestionVisible,kbOpts:{weight:100,primary:9},handler(s){s.hide()}}));class sh extends ne{constructor(){super({id:sh.ID,label:p("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:J.and(I.writable,Li.inlineSuggestionVisible),kbOpts:{weight:100,primary:601}})}run(e,t){return mv(this,void 0,void 0,function*(){const i=Li.get(t);i&&(i.showNextInlineCompletion(),t.focus())})}}sh.ID="editor.action.inlineSuggest.showNext";class oh extends ne{constructor(){super({id:oh.ID,label:p("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:J.and(I.writable,Li.inlineSuggestionVisible),kbOpts:{weight:100,primary:599}})}run(e,t){return mv(this,void 0,void 0,function*(){const i=Li.get(t);i&&(i.showPreviousInlineCompletion(),t.focus())})}}oh.ID="editor.action.inlineSuggest.showPrevious";class tX extends ne{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:p("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:I.writable})}run(e,t){return mv(this,void 0,void 0,function*(){const i=Li.get(t);i&&i.trigger()})}}Xe(Li.ID,Li);Q(tX);Q(sh);Q(oh);var iX=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},NC=function(s,e){return function(t,i){e(t,i,s)}};class nX{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}hasMultipleSuggestions(){return this.controller.hasMultipleInlineCompletions()}}let ay=class{constructor(e,t,i,n,o){this._editor=e,this._commandService=i,this._menuService=n,this._contextKeyService=o}suggestHoverAnchor(e){const t=Li.get(this._editor);if(!t)return null;if(e.target.type===8){const i=e.target.detail;if(t.shouldShowHoverAtViewZone(i.viewZoneId))return new LC(1e3,this,L.fromPositions(i.positionBefore||i.position,i.positionBefore||i.position))}return e.target.type===7&&e.target.range&&t.shouldShowHoverAt(e.target.range)?new LC(1e3,this,e.target.range):e.target.type===6&&e.target.range&&e.target.detail&&e.target.detail.mightBeForeignElement&&t.shouldShowHoverAt(e.target.range)?new LC(1e3,this,e.target.range):null}computeSync(e,t){const i=Li.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new nX(this,e.range,i)]:[]}renderHoverParts(e,t,i){const n=new X,o=n.add(this._menuService.createMenu(oe.InlineCompletionsActions,this._contextKeyService)),r=i.addAction({label:p("showNextInlineSuggestion","Next"),commandId:sh.ID,run:()=>this._commandService.executeCommand(sh.ID)}),a=i.addAction({label:p("showPreviousInlineSuggestion","Previous"),commandId:oh.ID,run:()=>this._commandService.executeCommand(oh.ID)});i.addAction({label:p("acceptInlineSuggestion","Accept"),commandId:ry.id,run:()=>this._commandService.executeCommand(ry.id)});const l=[r,a];for(const d of l)d.setEnabled(!1);e[0].hasMultipleSuggestions().then(d=>{for(const c of l)c.setEnabled(d)});for(const[d,c]of o.getActions())for(const h of c)h instanceof Uc&&i.addAction({label:h.label,commandId:h.item.id,run:()=>this._commandService.executeCommand(h.item.id)});return n}};ay=iX([NC(2,Wt),NC(3,vh),NC(4,we)],ay);class sX{constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new M,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new M,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new M,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){for(let i=0;i<this.colorPresentations.length;i++)if(t.toLowerCase()===this.colorPresentations[i].label){this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation);break}}flushColor(){this._onColorFlushed.fire(this._color)}}const No=Y;class oX extends U{constructor(e,t,i){super(),this.model=t,this.domNode=No(".colorpicker-header"),$(e,this.domNode),this.pickedColorNode=$(this.domNode,No(".picked-color"));const n=$(this.domNode,No(".original-color"));n.style.backgroundColor=B.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(Wl)||B.white,this._register(tt((o,r)=>{this.backgroundColor=o.getColor(Wl)||B.white})),this._register(K(this.pickedColorNode,le.CLICK,()=>this.model.selectNextColorPresentation())),this._register(K(n,le.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this.pickedColorNode.style.backgroundColor=B.Format.CSS.format(t.color)||"",this.pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter())}onDidChangeColor(e){this.pickedColorNode.style.backgroundColor=B.Format.CSS.format(e)||"",this.pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this.pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:""}}class rX extends U{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this.domNode=No(".colorpicker-body"),$(e,this.domNode),this.saturationBox=new aX(this.domNode,this.model,this.pixelRatio),this._register(this.saturationBox),this._register(this.saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this.saturationBox.onColorFlushed(this.flushColor,this)),this.opacityStrip=new lX(this.domNode,this.model),this._register(this.opacityStrip),this._register(this.opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this.opacityStrip.onColorFlushed(this.flushColor,this)),this.hueStrip=new dX(this.domNode,this.model),this._register(this.hueStrip),this._register(this.hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this.hueStrip.onColorFlushed(this.flushColor,this))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new B(new yo(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new B(new yo(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new B(new yo(i===360?0:i,t.s,t.v,t.a))}layout(){this.saturationBox.layout(),this.opacityStrip.layout(),this.hueStrip.layout()}}class aX extends U{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new M,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new M,this.onColorFlushed=this._onColorFlushed.event,this.domNode=No(".saturation-wrap"),$(e,this.domNode),this.canvas=document.createElement("canvas"),this.canvas.className="saturation-box",$(this.domNode,this.canvas),this.selection=No(".saturation-selection"),$(this.domNode,this.selection),this.layout(),this._register(qy(this.domNode,n=>this.onMouseDown(n))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}onMouseDown(e){this.monitor=this._register(new _d);const t=vi(this.domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.buttons,Ch,n=>this.onDidChangePosition(n.posx-t.left,n.posy-t.top),()=>null);const i=NM(document,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this.domNode.offsetWidth,this.height=this.domNode.offsetHeight,this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new B(new yo(e.h,1,1,1)),i=this.canvas.getContext("2d"),n=i.createLinearGradient(0,0,this.canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this.canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this.canvas.width,this.canvas.height),i.fillStyle=B.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class CO extends U{constructor(e,t){super(),this.model=t,this._onDidChange=new M,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new M,this.onColorFlushed=this._onColorFlushed.event,this.domNode=$(e,No(".strip")),this.overlay=$(this.domNode,No(".overlay")),this.slider=$(this.domNode,No(".slider")),this.slider.style.top="0px",this._register(qy(this.domNode,i=>this.onMouseDown(i))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onMouseDown(e){const t=this._register(new _d),i=vi(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.buttons,Ch,o=>this.onDidChangeTop(o.posy-i.top),()=>null);const n=NM(document,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class lX extends CO{constructor(e,t){super(e,t),this.domNode.classList.add("opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:i,b:n}=e.rgba,o=new B(new Ve(t,i,n,1)),r=new B(new Ve(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class dX extends CO{constructor(e,t){super(e,t),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class cX extends Vn{constructor(e,t,i,n){super(),this.model=t,this.pixelRatio=i,this._register(yM(()=>this.layout()));const o=No(".colorpicker-widget");e.appendChild(o);const r=new oX(o,this.model,n);this.body=new rX(o,this.model,this.pixelRatio),this._register(r),this._register(this.body)}layout(){this.body.layout()}}var hX=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},uX=function(s,e){return function(t,i){e(t,i,s)}},SN=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class fX{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let ly=class{constructor(e,t,i){this._editor=e,this._hover=t,this._themeService=i}computeSync(e,t){return[]}computeAsync(e,t,i){return SN(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const n=Zl.get(this._editor);for(const o of t){const r=n.getColorData(o.range.getStartPosition());if(r)return[yield this._createColorHover(this._editor.getModel(),r.colorInfo,r.provider)]}return[]})}_createColorHover(e,t,i){return SN(this,void 0,void 0,function*(){const n=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:l}=t.color,d=new Ve(Math.round(o*255),Math.round(r*255),Math.round(a*255),l),c=new B(d),h=yield sN(e,t,i,Fe.None),u=new sX(c,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(c,n),new fX(this,L.lift(t.range),u,i)})}renderHoverParts(e,t,i){if(e.length===0||!this._editor.hasModel())return U.None;const n=new X,o=e[0],r=this._editor.getModel(),a=o.model,l=n.add(new cX(t,a,this._editor.getOption(126),this._themeService));let d=new L(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn);const c=()=>{let u,f;if(a.presentation.textEdit){u=[a.presentation.textEdit],f=new L(a.presentation.textEdit.range.startLineNumber,a.presentation.textEdit.range.startColumn,a.presentation.textEdit.range.endLineNumber,a.presentation.textEdit.range.endColumn);const g=this._editor.getModel()._setTrackedRange(null,f,3);this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",u),f=this._editor.getModel()._getTrackedRange(g)||f}else u=[{identifier:null,range:d,text:a.presentation.label,forceMoveMarkers:!1}],f=d.setEndPosition(d.endLineNumber,d.startColumn+a.presentation.label.length),this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",u);a.presentation.additionalTextEdits&&(u=[...a.presentation.additionalTextEdits],this._editor.executeEdits("colorpicker",u),this._hover.hide()),this._editor.pushUndoStop(),d=f},h=u=>sN(r,{range:d,color:{red:u.rgba.r/255,green:u.rgba.g/255,blue:u.rgba.b/255,alpha:u.rgba.a}},o.provider,Fe.None).then(f=>{a.colorPresentations=f||[]});return n.add(a.onColorFlushed(u=>{h(u).then(c)})),n.add(a.onDidChangeColor(h)),this._hover.setColorPicker(l),n}};ly=hX([uX(2,pt)],ly);var SO=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},dy=function(s,e){return function(t,i){e(t,i,s)}},yN=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const LN=Y;let cy=class extends U{constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=LN("div.hover-row.status-bar"),this.actionsElement=$(this.hoverElement,LN("div.actions"))}get hasContent(){return this._hasContent}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(cD.render(this.actionsElement,e,i))}append(e){const t=$(this.actionsElement,e);return this._hasContent=!0,t}};cy=SO([dy(0,Lt)],cy);class $_{constructor(e,t){this._participants=t,this._editor=e,this._result=[],this._anchor=null}setAnchor(e){this._anchor=e,this._result=[]}clearResult(){this._result=[]}static _getLineDecorations(e,t){if(t.type!==1)return[];const i=e.getModel(),n=t.range.startLineNumber,o=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:o;return!(a>t.range.startColumn||t.range.endColumn>l)})}computeAsync(e){return yN(this,void 0,void 0,function*(){const t=this._anchor;if(!this._editor.hasModel()||!t)return Promise.resolve([]);const i=$_._getLineDecorations(this._editor,t),n=yield Promise.all(this._participants.map(o=>this._computeAsync(o,i,t,e)));return eg(n)})}_computeAsync(e,t,i,n){return yN(this,void 0,void 0,function*(){return e.computeAsync?e.computeAsync(i,t,n):[]})}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=$_._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return fd(t)}onResult(e,t){t?this._result=e.concat(this._result):this._result=this._result.concat(e)}getResult(){return this._result.slice(0)}getResultWithLoadingMessage(){if(this._anchor){for(const e of this._participants)if(e.createLoadingMessage){const t=e.createLoadingMessage(this._anchor);if(t)return this._result.slice(0).concat([t])}}return this._result.slice(0)}}let ta=class hy extends Vn{constructor(e,t,i,n){super(),this._hoverVisibleKey=t,this._keybindingService=n,this.allowEditorOverflow=!0,this._participants=[i.createInstance(ly,e,this),i.createInstance(j1,e,this),i.createInstance(ay,e,this),i.createInstance($1,e,this)],this._hover=this._register(new lG),this._id=hy.ID,this._editor=e,this._isVisible=!1,this._stoleFocus=!1,this._renderDisposable=null,this.onkeydown(this._hover.containerDomNode,o=>{o.equals(9)&&this.hide()}),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(40)&&this._updateFont()})),this._editor.onDidLayoutChange(()=>this.layout()),this.layout(),this._editor.addContentWidget(this),this._showAtPosition=null,this._showAtRange=null,this._stoleFocus=!1,this._messages=[],this._lastAnchor=null,this._computer=new $_(this._editor,this._participants),this._highlightDecorations=[],this._isChangingDecorations=!1,this._shouldFocus=!1,this._colorPicker=null,this._hoverOperation=new P2(this._computer,o=>this._withResult(o,!0),null,o=>this._withResult(o,!1),this._editor.getOption(50).delay),this._register(Gt(this.getDomNode(),le.FOCUS,()=>{this._colorPicker&&this.getDomNode().classList.add("colorpicker-hover")})),this._register(Gt(this.getDomNode(),le.BLUR,()=>{this.getDomNode().classList.remove("colorpicker-hover")})),this._register(e.onDidChangeConfiguration(()=>{this._hoverOperation.setHoverTime(this._editor.getOption(50).delay)})),this._register(St.onDidChange(()=>{this._isVisible&&this._lastAnchor&&this._messages.length>0&&(this._hover.contentsDomNode.textContent="",this._renderMessages(this._lastAnchor,this._messages))}))}dispose(){this._hoverOperation.cancel(),this._editor.removeContentWidget(this),super.dispose()}getId(){return this._id}getDomNode(){return this._hover.containerDomNode}_shouldShowAt(e){const t=e.target.type;if(t===6)return!0;if(t===7){const i=this._editor.getOption(40).typicalHalfwidthCharacterWidth/2,n=e.target.detail;if(n&&!n.isAfterLines&&typeof n.horizontalDistanceToText=="number"&&n.horizontalDistanceToText<i)return!0}return!1}maybeShowAt(e){var t;const i=[];for(const n of this._participants)if(typeof n.suggestHoverAnchor=="function"){const o=n.suggestHoverAnchor(e);o&&i.push(o)}if(this._shouldShowAt(e)&&e.target.range){const o=[...((t=e.target.element)===null||t===void 0?void 0:t.classList.values())||[]].find(r=>r.startsWith("ced-colorBox"))&&e.target.range.endColumn-e.target.range.startColumn===1?new L(e.target.range.startLineNumber,e.target.range.startColumn+1,e.target.range.endLineNumber,e.target.range.endColumn+1):e.target.range;i.push(new fN(0,o))}return i.length===0?!1:(i.sort((n,o)=>o.priority-n.priority),this._startShowingAt(i[0],0,!1),!0)}_showAt(e,t,i){this._showAtPosition=e,this._showAtRange=t,this._hoverVisibleKey.set(!0),this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._editor.layoutContentWidget(this),this._editor.render(),this._stoleFocus=i,i&&this._hover.containerDomNode.focus()}getPosition(){return this._isVisible?{position:this._showAtPosition,range:this._showAtRange,preference:[1,2]}:null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont(),this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:i}=this._editor.getOption(40);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=`${i}px`,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(this._editor.getLayoutInfo().width*.66,500)}px`}onModelDecorationsChanged(){this._isChangingDecorations||this._isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._colorPicker||this._hoverOperation.start(0))}startShowingAtRange(e,t,i){this._startShowingAt(new fN(0,e),t,i)}_startShowingAt(e,t,i){if(!(this._lastAnchor&&this._lastAnchor.equals(e))){if(this._hoverOperation.cancel(),this._isVisible)if(!this._showAtPosition||!this._lastAnchor||!e.canAdoptVisibleHover(this._lastAnchor,this._showAtPosition))this.hide();else{const n=this._messages.filter(o=>o.isValidForHoverAnchor(e));if(n.length===0)this.hide();else{if(n.length===this._messages.length)return;this._renderMessages(e,n)}}this._lastAnchor=e,this._computer.setAnchor(e),this._shouldFocus=i,this._hoverOperation.start(t)}}hide(){this._lastAnchor=null,this._hoverOperation.cancel(),this._isVisible&&(setTimeout(()=>{this._isVisible||this._hoverVisibleKey.set(!1)},0),this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._editor.layoutContentWidget(this),this._stoleFocus&&this._editor.focus()),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,[]),this._isChangingDecorations=!1,this._renderDisposable&&(this._renderDisposable.dispose(),this._renderDisposable=null),this._colorPicker=null}isColorPickerVisible(){return!!this._colorPicker}setColorPicker(e){this._colorPicker=e}onContentsChanged(){this._hover.onContentsChanged()}_withResult(e,t){this._messages=e,this._lastAnchor&&this._messages.length>0?this._renderMessages(this._lastAnchor,this._messages):t&&this.hide()}_renderMessages(e,t){this._renderDisposable&&(this._renderDisposable.dispose(),this._renderDisposable=null),this._colorPicker=null;let i=1073741824,n=t[0].range,o=null,r=document.createDocumentFragment();const a=new X,l=new Map;for(const c of t)i=Math.min(i,c.range.startColumn),n=L.plusRange(n,c.range),c.forceShowAtRange&&(o=c.range),l.has(c.owner)||l.set(c.owner,[]),l.get(c.owner).push(c);const d=a.add(new cy(this._keybindingService));for(const[c,h]of l)a.add(c.renderHoverParts(h,r,d));d.hasContent&&r.appendChild(d.hoverElement),this._renderDisposable=a,r.hasChildNodes()&&(o?this._showAt(o.getStartPosition(),o,this._shouldFocus):this._showAt(new O(e.range.startLineNumber,i),n,this._shouldFocus),this._updateContents(r)),this._colorPicker&&this._colorPicker.layout(),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,n?[{range:n,options:hy._DECORATION_OPTIONS}]:[]),this._isChangingDecorations=!1}};ta.ID="editor.contrib.modesContentHoverWidget";ta._DECORATION_OPTIONS=De.register({description:"content-hover-highlight",className:"hoverHighlight"});ta=SO([dy(2,qe),dy(3,Lt)],ta);tt((s,e)=>{const t=s.getColor(ng);t&&e.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${t}; }`)});class gX extends Vn{constructor(e,t){super(),this._id=e,this._editor=t,this._isVisible=!1,this._domNode=document.createElement("div"),this._domNode.className="monaco-hover hidden",this._domNode.setAttribute("aria-hidden","true"),this._domNode.setAttribute("role","tooltip"),this._showAtLineNumber=-1,this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(40)&&this.updateFont()})),this._editor.addOverlayWidget(this)}get isVisible(){return this._isVisible}set isVisible(e){this._isVisible=e,this._domNode.classList.toggle("hidden",!this._isVisible)}getId(){return this._id}getDomNode(){return this._domNode}showAt(e){this._showAtLineNumber=e,this.isVisible||(this.isVisible=!0);const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(this._showAtLineNumber),n=this._editor.getScrollTop(),o=this._editor.getOption(56),r=this._domNode.clientHeight,a=i-n-(r-o)/2;this._domNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._domNode.style.top=`${Math.max(Math.round(a),0)}px`}hide(){this.isVisible&&(this.isVisible=!1)}getPosition(){return null}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}updateFont(){const e=Array.prototype.slice.call(this._domNode.getElementsByTagName("code")),t=Array.prototype.slice.call(this._domNode.getElementsByClassName("code"));[...e,...t].forEach(i=>this._editor.applyFontInfo(i))}updateContents(e){this._domNode.textContent="",this._domNode.appendChild(e),this.updateFont()}}class pX{constructor(e){this._editor=e,this._lineNumber=-1,this._result=[]}setLineNumber(e){this._lineNumber=e,this._result=[]}clearResult(){this._result=[]}computeSync(){const e=n=>({value:n}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const o=n.options.glyphMarginHoverMessage;!o||Fu(o)||i.push(...bL(o).map(e))}return i}onResult(e,t){this._result=this._result.concat(e)}getResult(){return this._result}getResultWithLoadingMessage(){return this.getResult()}}class _l extends gX{constructor(e,t,i=t3){super(_l.ID,e),this._renderDisposeables=this._register(new X),this._messages=[],this._lastLineNumber=-1,this._markdownRenderer=this._register(new Xl({editor:this._editor},t,i)),this._computer=new pX(this._editor),this._hoverOperation=new P2(this._computer,n=>this._withResult(n),void 0,n=>this._withResult(n),300)}dispose(){this._hoverOperation.cancel(),super.dispose()}onModelDecorationsChanged(){this.isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._hoverOperation.start(0))}startShowingAt(e){this._lastLineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._lastLineNumber=e,this._computer.setLineNumber(e),this._hoverOperation.start(0))}hide(){this._lastLineNumber=-1,this._hoverOperation.cancel(),super.hide()}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._lastLineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const n of t){const o=this._markdownRenderer.render(n.value);this._renderDisposeables.add(o),i.appendChild(Y("div.hover-row",void 0,o.element))}this.updateContents(i),this.showAt(e)}}_l.ID="editor.contrib.modesGlyphHoverWidget";var mX=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class Ma{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=XR.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?p({},"symbol in {0} on line {1} at column {2}, {3}",Is(this.uri),this.range.startLineNumber,this.range.startColumn,t.value):p("aria.oneReference","symbol in {0} on line {1} at column {2}",Is(this.uri),this.range.startLineNumber,this.range.startColumn)}}class _X{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:o-t}),d=new L(n,l.startColumn,n,o),c=new L(r,a,r,1073741824),h=i.getValueInRange(d).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(c).replace(/\s+$/,"");return{value:h+u+f,highlight:{start:h.length,end:h.length+u.length}}}}class Of{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Ji}dispose(){$e(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?p("aria.fileReferences.1","1 symbol in {0}, full path {1}",Is(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Is(this.uri),this.uri.fsPath)}resolve(e){return mX(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(let t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new _X(i))}catch(i){ve(i)}return this})}}class wn{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new M,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(wn._compareReferences);let n;for(let o of e)if((!n||!rn.isEqual(n.uri,o.uri,!0))&&(n=new Of(this,o.uri),this.groups.push(n)),n.children.length===0||wn._compareReferences(o,n.children[n.children.length-1])!==0){const r=new Ma(i===o,n,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){$e(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new wn(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?p("aria.result.0","No results found"):this.references.length===1?p("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?p("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):p("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,n=i.children.indexOf(e),o=i.children.length,r=i.parent.groups.length;return r===1||t&&n+1<o||!t&&n>0?(t?n=(n+1)%o:n=(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,o)=>({idx:o,prefixLen:ju(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,o)=>n.prefixLen>o.prefixLen?-1:n.prefixLen<o.prefixLen?1:n.offsetDist<o.offsetDist?-1:n.offsetDist>o.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&L.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return rn.compare(e.uri,t.uri)||L.compareRangesUsingStarts(e.range,t.range)}}var yO=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function bg(s,e,t,i){const o=t.ordered(s).map(r=>Promise.resolve(i(r,s,e)).then(void 0,a=>{gi(a)}));return Promise.all(o).then(r=>{const a=[];for(let l of r)Array.isArray(l)?a.push(...l):l&&a.push(l);return a})}function mD(s,e,t){return bg(s,e,Zu,(i,n,o)=>i.provideDefinition(n,o,t))}function LO(s,e,t){return bg(s,e,Mm,(i,n,o)=>i.provideDeclaration(n,o,t))}function xO(s,e,t){return bg(s,e,Tm,(i,n,o)=>i.provideImplementation(n,o,t))}function DO(s,e,t){return bg(s,e,Am,(i,n,o)=>i.provideTypeDefinition(n,o,t))}function _v(s,e,t,i){return bg(s,e,Im,(n,o,r)=>yO(this,void 0,void 0,function*(){const a=yield n.provideReferences(o,r,{includeDeclaration:!0},i);if(!t||!a||a.length!==2)return a;const l=yield n.provideReferences(o,r,{includeDeclaration:!1},i);return l&&l.length===1?l:a}))}function vg(s){return yO(this,void 0,void 0,function*(){const e=yield s(),t=new wn(e,""),i=t.references.map(n=>n.link);return t.dispose(),i})}Ar("_executeDefinitionProvider",(s,e)=>vg(()=>mD(s,e,Fe.None)));Ar("_executeDeclarationProvider",(s,e)=>vg(()=>LO(s,e,Fe.None)));Ar("_executeImplementationProvider",(s,e)=>vg(()=>xO(s,e,Fe.None)));Ar("_executeTypeDefinitionProvider",(s,e)=>vg(()=>DO(s,e,Fe.None)));Ar("_executeReferenceProvider",(s,e)=>vg(()=>_v(s,e,!1,Fe.None)));var bv=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Pf=function(s,e){return function(t,i){e(t,i,s)}};let uy=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof wn||e instanceof Of}getChildren(e){if(e instanceof wn)return e.groups;if(e instanceof Of)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};uy=bv([Pf(0,Xs)],uy);class bX{getHeight(){return 23}getTemplateId(e){return e instanceof Of?Ff.id:wg.id}}let fy=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Ma){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Is(e.uri)}};fy=bv([Pf(0,Lt)],fy);class vX{getId(e){return e instanceof Ma?e.id:e.uri}}let gy=class extends U{constructor(e,t,i){super(),this._uriLabel=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new Kx(n,{supportHighlights:!0})),this.badge=new C1($(n,Y(".count"))),this._register(hU(this.badge,i)),e.appendChild(n)}set(e,t){let i=nL(e.uri);this.file.setLabel(F2(e.uri),this._uriLabel.getUriLabel(i,{relative:!0}),{title:this._uriLabel.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(p("referencesCount","{0} references",n)):this.badge.setTitleFormat(p("referenceCount","{0} reference",n))}};gy=bv([Pf(1,lg),Pf(2,pt)],gy);let Ff=class kO{constructor(e){this._instantiationService=e,this.templateId=kO.id}renderTemplate(e){return this._instantiationService.createInstance(gy,e)}renderElement(e,t,i){i.set(e.element,zb(e.filterData))}disposeTemplate(e){e.dispose()}};Ff.id="FileReferencesRenderer";Ff=bv([Pf(0,qe)],Ff);class wX{constructor(e){this.label=new Da(e,!1)}set(e,t){var i;const n=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!n||!n.value)this.label.set(`${Is(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=n;t&&!Gs.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,zb(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class wg{constructor(){this.templateId=wg.id}renderTemplate(e){return new wX(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}wg.id="OneReferenceRenderer";class CX{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var SX=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Qa=function(s,e){return function(t,i){e(t,i,s)}},xN=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class vv{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new X,this._callOnModelChange=new X,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(let t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let o=0,r=e.children.length;o<r;o++){let a=e.children[o];this._decorationIgnoreSet.has(a.id)||a.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:a.range,options:vv.DecorationOptions}),i.push(o))}const n=this._editor.deltaDecorations([],t);for(let o=0;o<n.length;o++)this._decorations.set(n[o],e.children[i[o]])}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(let[i,n]of this._decorations){const o=t.getDecorationRange(i);if(!o)continue;let r=!1;if(!L.equalsRange(o,n.range)){if(L.spansMultipleLines(o))r=!0;else{const a=n.range.endColumn-n.range.startColumn,l=o.endColumn-o.startColumn;a!==l&&(r=!0)}r?(this._decorationIgnoreSet.add(n.id),e.push(i)):n.range=o}}for(let i=0,n=e.length;i<n;i++)this._decorations.delete(e[i]);this._editor.deltaDecorations(e,[])}}removeDecorations(){this._editor.deltaDecorations([...this._decorations.keys()],[]),this._decorations.clear()}}vv.DecorationOptions=De.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class yX{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class LX extends f1{}let py=class extends H_{constructor(e,t,i,n,o,r,a,l,d,c){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=d,this._keybindingService=c,this._disposeOnNewModel=new X,this._callOnDispose=new X,this._onDidSelectReference=new M,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new gt(0,0),this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),$e(this._preview),$e(this._previewNotAvailableMessage),$e(this._tree),$e(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(DG)||B.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(xG)||B.transparent,primaryHeadingColor:e.getColor(z2),secondaryHeadingColor:e.getColor(U2)})}show(e){this.editor.revealRangeInCenterIfOutsideViewport(e,0),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=$(e,Y("div.messages")),Qi(this._messageContainer),this._splitView=new UR(e,{orientation:1}),this._previewContainer=$(e,Y("div.preview.inline"));let t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(Yl,this._previewContainer,t,this.editor),Qi(this._previewContainer),this._previewNotAvailableMessage=new si(p("missingPreviewMessage","no preview available"),si.DEFAULT_CREATION_OPTIONS,null,null,this._undoRedoService),this._treeContainer=$(e,Y("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new CX,keyboardNavigationLabelProvider:this._instantiationService.createInstance(fy),identityProvider:new vX,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:$2}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(Gt(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(LX,"ReferencesWidget",this._treeContainer,new bX,[this._instantiationService.createInstance(Ff),this._instantiationService.createInstance(wg)],this._instantiationService.createInstance(uy),i),this._splitView.addView({onDidChange:re.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},N_.Distribute),this._splitView.addView({onDidChange:re.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},N_.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));let n=(o,r)=>{o instanceof Ma&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?n(o.element,"side"):o.editorOptions.pinned?n(o.element,"goto"):n(o.element,"show")}),Qi(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new gt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=p("noResults","No results"),En(this._messageContainer),Promise.resolve(void 0)):(Qi(this._messageContainer),this._decorationsManager=new vv(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),En(this._treeContainer),En(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof Ma)return e;if(e instanceof Of&&e.children.length>0)return e.children[0]}revealReference(e){return xN(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return xN(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Oe.inMemory?this.setTitle(ZM(e.uri),this._uriLabel.getUriLabel(nL(e.uri))):this.setTitle(p("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const n=yield i;if(!this._model){n.dispose();return}$e(this._previewModelReference);const o=n.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=L.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()})}};py=SX([Qa(3,pt),Qa(4,Xs),Qa(5,qe),Qa(6,H2),Qa(7,lg),Qa(8,Bb),Qa(9,Lt)],py);tt((s,e)=>{const t=s.getColor(TG);t&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { background-color: ${t}; }`);const i=s.getColor(AG);i&&e.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: ${i}; }`);const n=s.getColor(RG);n&&e.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid ${n}; box-sizing: border-box; }`);const o=s.getColor(Vi);o&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { border: 1px dotted ${o}; box-sizing: border-box; }`);const r=s.getColor($2);r&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree { background-color: ${r}; }`);const a=s.getColor(kG);a&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree { color: ${a}; }`);const l=s.getColor(IG);l&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .reference-file { color: ${l}; }`);const d=s.getColor(EG);d&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { background-color: ${d}; }`);const c=s.getColor(NG);c&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: ${c} !important; }`);const h=s.getColor(im);h&&e.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input { background-color: ${h};}`);const u=s.getColor(MG);u&&e.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .margin { background-color: ${u};}`)});var xX=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qd=function(s,e){return function(t,i){e(t,i,s)}},DN=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Id=new se("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Ta=class my{constructor(e,t,i,n,o,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new X,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Id.bindTo(i)}static get(e){return e.getContribution(my.ID)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=yX.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(py,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(p("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{let{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d):this.openReference(d,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(p("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));let c=this._editor.getModel().uri,h=new O(e.startLineNumber,e.startColumn),u=this._model.nearestReference(c,h);if(u)return this._widget.setSelection(u).then(()=>{this._widget&&this._editor.getOption(74)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return DN(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(n),yield this._gotoReference(n),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()})}revealReference(e){return DN(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e){this._widget&&this._widget.hide(),this._ignoreModelChangeEvent=!0;const t=L.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:t}},this._editor).then(i=>{var n;if(this._ignoreModelChangeEvent=!1,!i||!this._widget){this.closeWidget();return}if(this._editor===i)this._widget.show(t),this._widget.focusOnReferenceTree();else{const o=my.get(i),r=this._model.clone();this.closeWidget(),i.focus(),o.toggleWidget(t,fi(a=>Promise.resolve(r)),(n=this._peekMode)!==null&&n!==void 0?n:!1)}},i=>{this._ignoreModelChangeEvent=!1,ve(i)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,pinned:i}},this._editor,t)}};Ta.ID="editor.contrib.referencesController";Ta=xX([qd(2,we),qd(3,Ge),qd(4,Qt),qd(5,qe),qd(6,Or),qd(7,At)],Ta);function Ed(s,e){const t=yG(s);if(!t)return;let i=Ta.get(t);i&&e(i)}ln.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:oi(2089,60),when:J.or(Id,Cn.inPeekEditor),handler(s){Ed(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});ln.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:J.or(Id,Cn.inPeekEditor),handler(s){Ed(s,e=>{e.goToNextOrPreviousReference(!0)})}});ln.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:J.or(Id,Cn.inPeekEditor),handler(s){Ed(s,e=>{e.goToNextOrPreviousReference(!1)})}});He.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");He.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");He.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");He.registerCommand("closeReferenceSearch",s=>Ed(s,e=>e.closeWidget()));ln.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:J.and(Cn.inPeekEditor,J.not("config.editor.stablePeek"))});ln.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:J.and(Id,J.not("config.editor.stablePeek"))});ln.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:J.and(Id,jR),handler(s){var e;const i=(e=s.get(ns).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Ma&&Ed(s,n=>n.revealReference(i[0]))}});ln.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:J.and(Id,jR),handler(s){var e;const i=(e=s.get(ns).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Ma&&Ed(s,n=>n.openReference(i[0],!0,!0))}});He.registerCommand("openReference",s=>{var e;const i=(e=s.get(ns).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Ma&&Ed(s,n=>n.openReference(i[0],!1,!0))});var IO=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},fu=function(s,e){return function(t,i){e(t,i,s)}};const _D=new se("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),wv=Ze("ISymbolNavigationService");let _y=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=_D.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new by(this._editorService),n=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(const h of t.references)if(GM(h.uri,a.uri))d=!0,c=c||L.containsPosition(h.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=sa(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:L.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?p("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):p("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};_y=IO([fu(0,we),fu(1,Ge),fu(2,Qt),fu(3,Lt)],_y);vd(wv,_y,!0);G(new class extends Di{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:_D,kbOpts:{weight:100,primary:70}})}runEditorCommand(s,e){return s.get(wv).revealNext(e)}});ln.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:_D,primary:9,handler(s){s.get(wv).reset()}});let by=class{constructor(e){this._listener=new Map,this._disposables=new X,this._onDidChange=new M,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),$e(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,sa(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};by=IO([fu(0,Ge)],by);var ks=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},MC,TC,AC,RC,OC,PC,FC,BC;xs.appendMenuItem(oe.EditorContext,{submenu:oe.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});const EO=new Set;function no(s){const e=new s;return XT(e),EO.add(e.id),e}class kh extends ne{constructor(e,t){super(t),this._configuration=e}run(e,t){if(!t.hasModel())return Promise.resolve(void 0);const i=e.get(Qt),n=e.get(Ge),o=e.get(Rr),r=e.get(wv),a=t.getModel(),l=t.getPosition(),d=new _f(t,5),c=xM(this._getLocationModel(a,l,d.token),d.token).then(h=>ks(this,void 0,void 0,function*(){if(!h||d.token.isCancellationRequested)return;wi(h.ariaMessage);let u;if(h.referenceAt(a.uri,l)){const g=this._getAlternativeCommand(t);g!==this.id&&EO.has(g)&&(u=t.getAction(g))}const f=h.references.length;if(f===0){if(!this._configuration.muteMessage){const g=a.getWordAtPosition(l);Bn.get(t).showMessage(this._getNoResultFoundMessage(g),l)}}else if(f===1&&u)u.run();else return this._onResult(n,r,t,h)}),h=>{i.error(h)}).finally(()=>{d.dispose()});return o.showWhile(c,250),c}_onResult(e,t,i,n){return ks(this,void 0,void 0,function*(){const o=this._getGoToPreference(i);if(!(i instanceof Yl)&&(this._configuration.openInPeek||o==="peek"&&n.references.length>1))this._openInPeek(i,n);else{const r=n.firstReference(),a=n.references.length>1&&o==="gotoAndPeek",l=yield this._openReference(i,e,r,this._configuration.openToSide,!a);a&&l?this._openInPeek(l,n):n.dispose(),o==="goto"&&t.put(r)}})}_openReference(e,t,i,n,o){return ks(this,void 0,void 0,function*(){let r;if(R3(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:L.collapseToStart(r),selectionRevealType:3}},e,n);if(a){if(o){const l=a.getModel(),d=a.deltaDecorations([],[{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&a.deltaDecorations(d,[])},350)}return a}})}_openInPeek(e,t){let i=Ta.get(e);i&&e.hasModel()?i.toggleWidget(e.getSelection(),fi(n=>Promise.resolve(t)),this._configuration.openInPeek):t.dispose()}}class Cv extends kh{_getLocationModel(e,t,i){return ks(this,void 0,void 0,function*(){return new wn(yield mD(e,t,i),p("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?p("noResultWord","No definition found for '{0}'",e.word):p("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(47).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(47).multipleDefinitions}}const NO=gh&&!H4?2118:70;no((MC=class vy extends Cv{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:vy.id,label:p("actions.goToDecl.label","Go to Definition"),alias:"Go to Definition",precondition:J.and(I.hasDefinitionProvider,I.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:I.editorTextFocus,primary:NO,weight:100},contextMenuOpts:{group:"navigation",order:1.1},menuOpts:{menuId:oe.MenubarGoMenu,group:"4_symbol_nav",order:2,title:p({},"Go to &&Definition")}}),He.registerCommandAlias("editor.action.goToDeclaration",vy.id)}},MC.id="editor.action.revealDefinition",MC));no((TC=class wy extends Cv{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:wy.id,label:p("actions.goToDeclToSide.label","Open Definition to the Side"),alias:"Open Definition to the Side",precondition:J.and(I.hasDefinitionProvider,I.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,NO),weight:100}}),He.registerCommandAlias("editor.action.openDeclarationToTheSide",wy.id)}},TC.id="editor.action.revealDefinitionAside",TC));no((AC=class Cy extends Cv{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Cy.id,label:p("actions.previewDecl.label","Peek Definition"),alias:"Peek Definition",precondition:J.and(I.hasDefinitionProvider,Cn.notInPeekEditor,I.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:I.editorTextFocus,primary:582,linux:{primary:3140},weight:100},contextMenuOpts:{menuId:oe.EditorContextPeek,group:"peek",order:2}}),He.registerCommandAlias("editor.action.previewDeclaration",Cy.id)}},AC.id="editor.action.peekDefinition",AC));class MO extends kh{_getLocationModel(e,t,i){return ks(this,void 0,void 0,function*(){return new wn(yield LO(e,t,i),p("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(47).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(47).multipleDeclarations}}no((RC=class TO extends MO{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:TO.id,label:p("actions.goToDeclaration.label","Go to Declaration"),alias:"Go to Declaration",precondition:J.and(I.hasDeclarationProvider,I.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{group:"navigation",order:1.3},menuOpts:{menuId:oe.MenubarGoMenu,group:"4_symbol_nav",order:3,title:p({},"Go to &&Declaration")}})}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}},RC.id="editor.action.revealDeclaration",RC));no(class extends MO{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",label:p("actions.peekDecl.label","Peek Declaration"),alias:"Peek Declaration",precondition:J.and(I.hasDeclarationProvider,Cn.notInPeekEditor,I.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:oe.EditorContextPeek,group:"peek",order:3}})}});class AO extends kh{_getLocationModel(e,t,i){return ks(this,void 0,void 0,function*(){return new wn(yield DO(e,t,i),p("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?p("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):p("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(47).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(47).multipleTypeDefinitions}}no((OC=class RO extends AO{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:RO.ID,label:p("actions.goToTypeDefinition.label","Go to Type Definition"),alias:"Go to Type Definition",precondition:J.and(I.hasTypeDefinitionProvider,I.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:I.editorTextFocus,primary:0,weight:100},contextMenuOpts:{group:"navigation",order:1.4},menuOpts:{menuId:oe.MenubarGoMenu,group:"4_symbol_nav",order:3,title:p({},"Go to &&Type Definition")}})}},OC.ID="editor.action.goToTypeDefinition",OC));no((PC=class OO extends AO{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:OO.ID,label:p("actions.peekTypeDefinition.label","Peek Type Definition"),alias:"Peek Type Definition",precondition:J.and(I.hasTypeDefinitionProvider,Cn.notInPeekEditor,I.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:oe.EditorContextPeek,group:"peek",order:4}})}},PC.ID="editor.action.peekTypeDefinition",PC));class PO extends kh{_getLocationModel(e,t,i){return ks(this,void 0,void 0,function*(){return new wn(yield xO(e,t,i),p("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?p("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):p("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(47).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(47).multipleImplementations}}no((FC=class FO extends PO{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:FO.ID,label:p("actions.goToImplementation.label","Go to Implementations"),alias:"Go to Implementations",precondition:J.and(I.hasImplementationProvider,I.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:I.editorTextFocus,primary:2118,weight:100},menuOpts:{menuId:oe.MenubarGoMenu,group:"4_symbol_nav",order:4,title:p({},"Go to &&Implementations")},contextMenuOpts:{group:"navigation",order:1.45}})}},FC.ID="editor.action.goToImplementation",FC));no((BC=class BO extends PO{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:BO.ID,label:p("actions.peekImplementation.label","Peek Implementations"),alias:"Peek Implementations",precondition:J.and(I.hasImplementationProvider,Cn.notInPeekEditor,I.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:I.editorTextFocus,primary:3142,weight:100},contextMenuOpts:{menuId:oe.EditorContextPeek,group:"peek",order:5}})}},BC.ID="editor.action.peekImplementation",BC));class WO extends kh{_getNoResultFoundMessage(e){return e?p("references.no","No references found for '{0}'",e.word):p("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(47).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(47).multipleReferences}}no(class extends WO{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",label:p("goToReferences.label","Go to References"),alias:"Go to References",precondition:J.and(I.hasReferenceProvider,Cn.notInPeekEditor,I.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:I.editorTextFocus,primary:1094,weight:100},contextMenuOpts:{group:"navigation",order:1.45},menuOpts:{menuId:oe.MenubarGoMenu,group:"4_symbol_nav",order:5,title:p({},"Go to &&References")}})}_getLocationModel(e,t,i){return ks(this,void 0,void 0,function*(){return new wn(yield _v(e,t,!0,i),p("ref.title","References"))})}});no(class extends WO{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",label:p("references.action.label","Peek References"),alias:"Peek References",precondition:J.and(I.hasReferenceProvider,Cn.notInPeekEditor,I.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:oe.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i){return ks(this,void 0,void 0,function*(){return new wn(yield _v(e,t,!1,i),p("ref.title","References"))})}});class DX extends kh{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",label:p("label.generic","Go To Any Symbol"),alias:"Go To Any Symbol",precondition:J.and(Cn.notInPeekEditor,I.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i){return ks(this,void 0,void 0,function*(){return new wn(this._references,p("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&p("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(47).multipleReferences}_getAlternativeCommand(){return""}}He.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:he},{name:"position",description:"The position at which to start",constraint:O.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(s,e,t,i,n,o,r)=>ks(void 0,void 0,void 0,function*(){nt(he.isUri(e)),nt(O.isIPosition(t)),nt(Array.isArray(i)),nt(typeof n>"u"||typeof n=="string"),nt(typeof r>"u"||typeof r=="boolean");const a=s.get(Ge),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Fo(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends DX{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,n);d.get(qe).invokeFunction(c.run.bind(c),l)})})});He.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:he},{name:"position",description:"The position at which to start",constraint:O.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(s,e,t,i,n)=>ks(void 0,void 0,void 0,function*(){s.get(Wt).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)})});He.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{nt(he.isUri(e)),nt(O.isIPosition(t));const i=s.get(Ge);return i.openCodeEditor({resource:e},i.getFocusedCodeEditor()).then(n=>{if(!Fo(n)||!n.hasModel())return;const o=Ta.get(n);if(!o)return;const r=fi(l=>_v(n.getModel(),O.lift(t),!1,l).then(d=>new wn(d,p("ref.title","References")))),a=new L(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(o.toggleWidget(a,r,!1))})}});He.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");function Sy(s,e){return!!s[e]}class WC{constructor(e,t){this.target=e.target,this.hasTriggerModifier=Sy(e.event,t.triggerModifier),this.hasSideBySideModifier=Sy(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class kN{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Sy(e,t.triggerModifier)}}class gp{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function IN(s){return s==="altKey"?Re?new gp(57,"metaKey",6,"altKey"):new gp(5,"ctrlKey",6,"altKey"):Re?new gp(6,"altKey",57,"metaKey"):new gp(6,"altKey",5,"ctrlKey")}class VO extends U{constructor(e){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new M),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new M),this.onExecute=this._onExecute.event,this._onCancel=this._register(new M),this.onCancel=this._onCancel.event,this._editor=e,this._opts=IN(this._editor.getOption(67)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(t=>{if(t.hasChanged(67)){const i=IN(this._editor.getOption(67));if(this._opts.equals(i))return;this._opts=i,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(t=>this._onEditorMouseMove(new WC(t,this._opts)))),this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(new WC(t,this._opts)))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(new WC(t,this._opts)))),this._register(this._editor.onKeyDown(t=>this._onEditorKeyDown(new kN(t,this._opts)))),this._register(this._editor.onKeyUp(t=>this._onEditorKeyUp(new kN(t,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(t=>this._onDidChangeCursorSelection(t))),this._register(this._editor.onDidChangeModel(t=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(t=>{(t.scrollTopChanged||t.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var kX=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},EN=function(s,e){return function(t,i){e(t,i,s)}};let Jl=class gu{constructor(e,t,i){this.textModelResolverService=t,this.modeService=i,this.toUnhook=new X,this.toUnhookForKeyboard=new X,this.linkDecorations=[],this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e;let n=new VO(e);this.toUnhook.add(n),this.toUnhook.add(n.onMouseMoveOrRelevantKeyDown(([o,r])=>{this.startFindDefinitionFromMouse(o,Tn(r))})),this.toUnhook.add(n.onExecute(o=>{this.isEnabled(o)&&this.gotoDefinition(o.target.position,o.hasSideBySideModifier).then(()=>{this.removeLinkDecorations()},r=>{this.removeLinkDecorations(),ve(r)})})),this.toUnhook.add(n.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(gu.ID)}startFindDefinitionFromCursor(e){return this.startFindDefinition(e).then(()=>{this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i)return this.currentWordAtPosition=null,this.removeLinkDecorations(),Promise.resolve(0);if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return Promise.resolve(0);this.currentWordAtPosition=i;let n=new JA(this.editor,15);return this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=fi(o=>this.findDefinition(e,o)),this.previousPromise.then(o=>{if(!o||!o.length||!n.validate(this.editor)){this.removeLinkDecorations();return}if(o.length>1)this.addDecoration(new L(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),new Ia().appendText(p("multipleResults","Click to show {0} definitions.",o.length)));else{let r=o[0];if(!r.uri)return;this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:l}}=a,{startLineNumber:d}=r.range;if(d<1||d>l.getLineCount()){a.dispose();return}const c=this.getPreviewValue(l,d,r);let h;r.originSelectionRange?h=L.lift(r.originSelectionRange):h=new L(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);const u=this.modeService.getModeIdByFilepathOrFirstLine(l.uri);this.addDecoration(h,new Ia().appendCodeblock(u||"",c)),a.dispose()})}}).then(void 0,ve)}getPreviewValue(e,t,i){let n=i.targetSelectionRange?i.range:this.getPreviewRangeBasedOnBrackets(e,t);return n.endLineNumber-n.startLineNumber>=gu.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);o=Math.min(o,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${o-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+gu.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<n;o++){let r=e.getLineFirstNonWhitespaceColumn(o);if(i===r)break}return new L(t,1,o+1,1)}getPreviewRangeBasedOnBrackets(e,t){const i=Math.min(e.getLineCount(),t+gu.MAX_SOURCE_PREVIEW_LINES),n=[];let o=!0,r=e.findNextBracket(new O(t,1));for(;r!==null;){if(n.length===0)n.push(r);else{const c=n[n.length-1];if(c.open[0]===r.open[0]&&c.isOpen&&!r.isOpen?n.pop():n.push(r),n.length===0)if(o)o=!1;else return new L(t,1,r.range.endLineNumber+1,1)}const a=e.getLineMaxColumn(t);let l=r.range.endLineNumber,d=r.range.endColumn;if(a===r.range.endColumn&&(l++,d=1),l>i)return new L(t,1,i+1,1);r=e.findNextBracket(new O(l,d))}return new L(t,1,i+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[i])}removeLinkDecorations(){this.linkDecorations.length>0&&(this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[]))}isEnabled(e,t){return this.editor.hasModel()&&e.isNoneOrSingleMouseDown&&e.target.type===6&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&Zu.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?mD(i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const n=!t&&this.editor.getOption(75)&&!this.isInPeekEditor(i);return new Cv({openToSide:t,openInPeek:n,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(i,this.editor)})}isInPeekEditor(e){const t=e.get(we);return Cn.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose()}};Jl.ID="editor.contrib.gotodefinitionatposition";Jl.MAX_SOURCE_PREVIEW_LINES=8;Jl=kX([EN(1,Xs),EN(2,to)],Jl);Xe(Jl.ID,Jl);tt((s,e)=>{const t=s.getColor(tx);t&&e.addRule(`.monaco-editor .goto-definition-link { color: ${t} !important; }`)});var IX=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},pp=function(s,e){return function(t,i){e(t,i,s)}};let Aa=class HO{constructor(e,t,i,n,o){this._editor=e,this._instantiationService=t,this._openerService=i,this._modeService=n,this._toUnhook=new X,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._hookEvents(),this._didChangeConfigurationHandler=this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&(this._unhookEvents(),this._hookEvents())}),this._hoverVisibleKey=I.hoverVisible.bindTo(o)}static get(e){return e.getContribution(HO.ID)}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(50);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i))),this._toUnhook.add(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged()))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(e)),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onModelDecorationsChanged(){var e,t;(e=this._contentWidget)===null||e===void 0||e.onModelDecorationsChanged(),(t=this._glyphWidget)===null||t===void 0||t.onModelDecorationsChanged()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._isMouseDown=!0;const t=e.target.type;if(t===9&&e.target.detail===ta.ID){this._hoverClicked=!0;return}t===12&&e.target.detail===_l.ID||(t!==12&&e.target.detail!==_l.ID&&(this._hoverClicked=!1),this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseMove(e){var t,i,n,o,r;let a=e.target.type;if(this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&a===9&&e.target.detail===ta.ID||this._isHoverSticky&&!(!((i=(t=e.event.browserEvent.view)===null||t===void 0?void 0:t.getSelection())===null||i===void 0)&&i.isCollapsed)||!this._isHoverSticky&&a===9&&e.target.detail===ta.ID&&(!((n=this._contentWidget)===null||n===void 0)&&n.isColorPickerVisible())||this._isHoverSticky&&a===12&&e.target.detail===_l.ID)return;if(!this._isHoverEnabled){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(o=this._glyphWidget)===null||o===void 0||o.hide();return}if(a===2&&e.target.position){(r=this._contentWidget)===null||r===void 0||r.hide(),this._glyphWidget||(this._glyphWidget=new _l(this._editor,this._modeService,this._openerService)),this._glyphWidget.startShowingAt(e.target.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible())||(this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(ta,this._editor,this._hoverVisibleKey)),this._contentWidget}isColorPickerVisible(){var e;return((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible())||!1}showContentHover(e,t,i){this._getOrCreateContentWidget().startShowingAtRange(e,t,i)}dispose(){var e,t;this._unhookEvents(),this._toUnhook.dispose(),this._didChangeConfigurationHandler.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Aa.ID="editor.contrib.hover";Aa=IX([pp(1,qe),pp(2,Oo),pp(3,to),pp(4,we)],Aa);class EX extends ne{constructor(){super({id:"editor.action.showHover",label:p({},"Show Hover"),alias:"Show Hover",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2087),weight:100}})}run(e,t){if(!t.hasModel())return;let i=Aa.get(t);if(!i)return;const n=t.getPosition(),o=new L(n.lineNumber,n.column,n.lineNumber,n.column),r=t.getOption(2)===2;i.showContentHover(o,1,r)}}class NX extends ne{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:p({},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){let i=Aa.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new L(n.lineNumber,n.column,n.lineNumber,n.column);Jl.get(t).startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(o,1,!0)})}}Xe(Aa.ID,Aa);Q(EX);Q(NX);tt((s,e)=>{const t=s.getColor(e8);t&&e.addRule(`.monaco-editor .hoverHighlight { background-color: ${t}; }`);const i=s.getColor(Wl);i&&e.addRule(`.monaco-editor .monaco-hover { background-color: ${i}; }`);const n=s.getColor(ex);n&&(e.addRule(`.monaco-editor .monaco-hover { border: 1px solid ${n}; }`),e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${n.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${n.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${n.transparent(.5)}; }`));const o=s.getColor(ng);o&&e.addRule(`.monaco-editor .monaco-hover a { color: ${o}; }`);const r=s.getColor(E7);r&&e.addRule(`.monaco-editor .monaco-hover a:hover { color: ${r}; }`);const a=s.getColor(JL);a&&e.addRule(`.monaco-editor .monaco-hover { color: ${a}; }`);const l=s.getColor(t8);l&&e.addRule(`.monaco-editor .monaco-hover .hover-row .actions { background-color: ${l}; }`);const d=s.getColor(UL);d&&e.addRule(`.monaco-editor .monaco-hover code { background-color: ${d}; }`)});class yy extends U{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){var t;if(e.target.type!==6||![...((t=e.target.element)===null||t===void 0?void 0:t.classList.values())||[]].find(r=>r.startsWith("ced-colorBox"))||!e.target.range)return;const o=this._editor.getContribution(Aa.ID);if(!o.isColorPickerVisible()){const r=new L(e.target.range.startLineNumber,e.target.range.startColumn+1,e.target.range.endLineNumber,e.target.range.endColumn+1);o.showContentHover(r,0,!1)}}}yy.ID="editor.contrib.colorContribution";Xe(yy.ID,yy);class ia{constructor(e,t){this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length,o=e.length;if(i+n>o)return!1;for(let r=0;r<n;r++){const a=e.charCodeAt(i+r),l=t.charCodeAt(r);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,o,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,h=o.getLineContent(a),u=o.getLineContent(d);let f=h.lastIndexOf(t,l-1+t.length),g=u.indexOf(i,c-1-i.length);if(f!==-1&&g!==-1)if(a===d)h.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const b=h.substring(f+t.length),v=u.substring(0,g);(b.indexOf(i)>=0||v.indexOf(i)>=0)&&(f=-1,g=-1)}let m;f!==-1&&g!==-1?(n&&f+t.length<h.length&&h.charCodeAt(f+t.length)===32&&(t=t+" "),n&&g>0&&u.charCodeAt(g-1)===32&&(i=" "+i,g-=1),m=ia._createRemoveBlockCommentOperations(new L(a,f+t.length+1,d,g+1),t,i)):(m=ia._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const b of m)r.addTrackedEditOperation(b.range,b.text)}static _createRemoveBlockCommentOperations(e,t,i){let n=[];return L.isEmpty(e)?n.push(Bt.delete(new L(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Bt.delete(new L(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Bt.delete(new L(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){let o=[];return L.isEmpty(e)?o.push(Bt.replace(new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Bt.insert(new O(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(Bt.insert(new O(e.endLineNumber,e.endColumn),(n?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),r=xe.getComments(o);!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],o=i[1];return new ee(n.range.endLineNumber,n.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const n=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new ee(n.endLineNumber,n.endColumn+o,n.endLineNumber,n.endColumn+o)}}}class Jo{constructor(e,t,i,n,o,r){this._selection=e,this._tabSize=t,this._type=i,this._insertSpace=n,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o,this._ignoreFirstLine=r||!1}static _gatherPreflightCommentStrings(e,t,i){e.tokenizeIfCheap(t);const n=e.getLanguageIdAtPosition(t,1),o=xe.getComments(n),r=o?o.lineCommentToken:null;if(!r)return null;let a=[];for(let l=0,d=i-t+1;l<d;l++)a[l]={ignore:!1,commentStr:r,commentStrOffset:0,commentStrLength:r.length};return a}static _analyzeLines(e,t,i,n,o,r,a){let l=!0,d;e===0?d=!0:e===1?d=!1:d=!0;for(let c=0,h=n.length;c<h;c++){const u=n[c],f=o+c;if(f===o&&a){u.ignore=!0;continue}const g=i.getLineContent(f),m=bn(g);if(m===-1){u.ignore=r,u.commentStrOffset=g.length;continue}if(l=!1,u.ignore=!1,u.commentStrOffset=m,d&&!ia._haystackHasNeedleAtOffset(g,u.commentStr,m)&&(e===0?d=!1:e===1||(u.ignore=!0)),d&&t){const b=m+u.commentStrLength;b<g.length&&g.charCodeAt(b)===32&&(u.commentStrLength+=1)}}if(e===0&&l){d=!1;for(let c=0,h=n.length;c<h;c++)n[c].ignore=!1}return{supported:!0,shouldRemoveComments:d,lines:n}}static _gatherPreflightData(e,t,i,n,o,r,a){const l=Jo._gatherPreflightCommentStrings(i,n,o);return l===null?{supported:!1}:Jo._analyzeLines(e,t,i,l,n,r,a)}_executeLineComments(e,t,i,n){let o;i.shouldRemoveComments?o=Jo._createRemoveLineCommentsOperations(i.lines,n.startLineNumber):(Jo._normalizeInsertionPoint(e,i.lines,n.startLineNumber,this._tabSize),o=this._createAddLineCommentsOperations(i.lines,n.startLineNumber));const r=new O(n.positionLineNumber,n.positionColumn);for(let a=0,l=o.length;a<l;a++)t.addEditOperation(o[a].range,o[a].text),L.isEmpty(o[a].range)&&L.getStartPosition(o[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(o[a].text||"").length);this._selectionId=t.trackSelection(n)}_attemptRemoveBlockComment(e,t,i,n){let o=t.startLineNumber,r=t.endLineNumber,a=n.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn),l=e.getLineContent(o).lastIndexOf(i,a-1),d=e.getLineContent(r).indexOf(n,t.endColumn-1-i.length);return l!==-1&&d===-1&&(d=e.getLineContent(o).indexOf(n,l+i.length),r=o),l===-1&&d!==-1&&(l=e.getLineContent(r).lastIndexOf(i,d),o=r),t.isEmpty()&&(l===-1||d===-1)&&(l=e.getLineContent(o).indexOf(i),l!==-1&&(d=e.getLineContent(o).indexOf(n,l+i.length))),l!==-1&&e.getLineContent(o).charCodeAt(l+i.length)===32&&(i+=" "),d!==-1&&e.getLineContent(r).charCodeAt(d-1)===32&&(n=" "+n,d-=1),l!==-1&&d!==-1?ia._createRemoveBlockCommentOperations(new L(o,l+i.length+1,r,d+1),i,n):null}_executeBlockComment(e,t,i){e.tokenizeIfCheap(i.startLineNumber);let n=e.getLanguageIdAtPosition(i.startLineNumber,1),o=xe.getComments(n);if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const r=o.blockCommentStartToken,a=o.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,i,r,a);if(!l){if(i.isEmpty()){const d=e.getLineContent(i.startLineNumber);let c=bn(d);c===-1&&(c=d.length),l=ia._createAddBlockCommentOperations(new L(i.startLineNumber,c+1,i.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=ia._createAddBlockCommentOperations(new L(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),r,a,this._insertSpace);l.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(i);for(const d of l)t.addEditOperation(d.range,d.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new L(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
`),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=Jo._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine);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 ee(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){let i=[];for(let n=0,o=e.length;n<o;n++){const r=e[n];r.ignore||i.push(Bt.delete(new L(t+n,r.commentStrOffset+1,t+n,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){let i=[];const n=this._insertSpace?" ":"";for(let o=0,r=e.length;o<r;o++){const a=e[o];a.ignore||i.push(Bt.insert(new O(t+o,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 o=1073741824,r,a;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(let u=0,f=t[l].commentStrOffset;h<o&&u<f;u++)h=Jo.nextVisibleColumn(h,n,c.charCodeAt(u)===9,1);h<o&&(o=h)}o=Math.floor(o/n)*n;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(r=0,a=t[l].commentStrOffset;h<o&&r<a;r++)h=Jo.nextVisibleColumn(h,n,c.charCodeAt(r)===9,1);h>o?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class bD extends ne{constructor(e,t){super(t),this._type=e}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],o=i.getOptions(),r=t.getOption(17),a=t.getSelections().map((d,c)=>({selection:d,index:c,ignoreFirstLine:!1}));a.sort((d,c)=>L.compareRangesUsingStarts(d.selection,c.selection));let l=a[0];for(let d=1;d<a.length;d++){const c=a[d];l.selection.endLineNumber===c.selection.startLineNumber&&(l.index<c.index?c.ignoreFirstLine=!0:(l.ignoreFirstLine=!0,l=c))}for(const d of a)n.push(new Jo(d.selection,o.tabSize,this._type,r.insertSpace,r.ignoreEmptyLines,d.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class MX extends bD{constructor(){super(0,{id:"editor.action.commentLine",label:p("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:2133,weight:100},menuOpts:{menuId:oe.MenubarEditMenu,group:"5_insert",title:p({},"&&Toggle Line Comment"),order:1}})}}class TX extends bD{constructor(){super(1,{id:"editor.action.addCommentLine",label:p("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2081),weight:100}})}}class AX extends bD{constructor(){super(2,{id:"editor.action.removeCommentLine",label:p("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2099),weight:100}})}}class RX extends ne{constructor(){super({id:"editor.action.blockComment",label:p("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:oe.MenubarEditMenu,group:"5_insert",title:p({},"Toggle &&Block Comment"),order:2}})}run(e,t){if(!t.hasModel())return;const i=t.getOption(17),n=[],o=t.getSelections();for(const r of o)n.push(new ia(r,i.insertSpace));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}Q(MX);Q(TX);Q(AX);Q(RX);var OX=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},eu=function(s,e){return function(t,i){e(t,i,s)}};let rh=class zO{constructor(e,t,i,n,o,r){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=o,this._menuService=r,this._toDispose=new X,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(a=>this._onContextMenu(a))),this._toDispose.add(this._editor.onMouseWheel(a=>{if(this._contextMenuIsBeingShownCount>0){const l=this._contextViewService.getContextViewElement(),d=a.srcElement;d.shadowRoot&&_h(l)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(a=>{a.keyCode===58&&(a.preventDefault(),a.stopPropagation(),this.showContextMenu())}))}static get(e){return e.getContribution(zO.ID)}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(18)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||(e.event.preventDefault(),e.target.type!==6&&e.target.type!==7&&e.target.type!==1))return;if(this._editor.focus(),e.target.position){let i=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t={x:e.event.posx-1,width:2,y:e.event.posy-1,height:2}),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(18)||!this._editor.hasModel())return;if(!this._contextMenuService){this._editor.focus();return}const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?oe.SimpleEditorContext:oe.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),o=n.getActions({arg:e.uri});n.dispose();for(let r of o){const[,a]=r;let l=0;for(const d of a)if(d instanceof ML){const c=this._getMenuActions(e,d.item.submenu);c.length>0&&(i.push(new vb(d.id,d.label,c)),l++)}else i.push(d),l++;l&&i.push(new Ls)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(50);if(this._editor.updateOptions({hover:{enabled:!1}}),!t){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),r=vi(this._editor.getDomNode()),a=r.left+o.left,l=r.top+o.top+o.height;t={x:a,y:l}}const n=this._editor.getOption(112)&&!To;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:n?this._editor.getDomNode():void 0,getAnchor:()=>t,getActions:()=>e,getActionViewItem:o=>{const r=this._keybindingFor(o);if(r)return new bf(o,o,{label:!0,keybinding:r.getLabel(),isMenu:!0});const a=o;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new bf(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--,this._editor.focus(),this._editor.updateOptions({hover:i})}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};rh.ID="editor.contrib.contextmenu";rh=OX([eu(1,wd),eu(2,Wa),eu(3,we),eu(4,Lt),eu(5,vh)],rh);class PX extends ne{constructor(){super({id:"editor.action.showContextMenu",label:p("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:I.textInputFocus,primary:1092,weight:100}})}run(e,t){rh.get(t).showContextMenu()}}Xe(rh.ID,rh);Q(PX);class VC{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let n=0;n<t;n++)if(!this.selections[n].equalsSelection(e.selections[n]))return!1;return!0}}class HC{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class ed extends U{constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new VC(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new HC(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}static get(e){return e.getContribution(ed.ID)}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new HC(new VC(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new HC(new VC(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}ed.ID="editor.contrib.cursorUndoRedoController";class FX extends ne{constructor(){super({id:"cursorUndo",label:p("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:I.textInputFocus,primary:2099,weight:100}})}run(e,t,i){ed.get(t).cursorUndo()}}class BX extends ne{constructor(){super({id:"cursorRedo",label:p("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){ed.get(t).cursorRedo()}}Xe(ed.ID,ed);Q(FX);Q(BX);class WX{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){let i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new L(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new ee(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new ee(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber<this.selection.endLineNumber){this.targetSelection=new ee(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new ee(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column-this.selection.endColumn+this.selection.startColumn:this.targetPosition.column-this.selection.endColumn+this.selection.startColumn,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new ee(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,t){return this.targetSelection}}function Kd(s){return Re?s.altKey:s.ctrlKey}class Cr extends U{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._dndDecorationIds=[],this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(29)||this._editor.getOption(16)||(Kd(e)&&(this._modifierPressed=!0),this._mouseDown&&Kd(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(29)||this._editor.getOption(16)||(Kd(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Cr.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){let t=e.target;if(this._dragSelection===null){let n=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}Kd(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){let t=new O(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){let n=this._editor.getSelection();if(n){const{selectionStartLineNumber:o,selectionStartColumn:r}=n;i=[new ee(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new ee(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(Kd(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Cr.ID,new WX(this._dragSelection,t,Kd(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){let t=[{range:new L(e.lineNumber,e.column,e.lineNumber,e.column),options:Cr._DECORATION_OPTIONS}];this._dndDecorationIds=this._editor.deltaDecorations(this._dndDecorationIds,t),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds=this._editor.deltaDecorations(this._dndDecorationIds,[])}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}Cr.ID="editor.contrib.dragAndDrop";Cr.TRIGGER_KEY_VALUE=Re?6:5;Cr._DECORATION_OPTIONS=De.register({description:"dnd-target",className:"dnd-target"});Xe(Cr.ID,Cr);class Fi{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.deltaDecorations(this._allDecorations(),[]),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getCurrentMatchesPosition(e){let t=this._editor.getModel().getDecorationsInRange(e);for(const i of t){const n=i.options;if(n===Fi._FIND_MATCH_DECORATION||n===Fi._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let n=0,o=this._decorations.length;n<o;n++){let r=this._editor.getModel().getDecorationRange(this._decorations[n]);if(e.equalsRange(r)){t=this._decorations[n],i=n+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(n=>{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,Fi._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,Fi._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){let r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new L(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(o,Fi._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=Fi._FIND_MATCH_DECORATION,o=[];if(e.length>1e3){n=Fi._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),d=this._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/d));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let f=1,g=e.length;f<g;f++){const m=e[f].range;u+c>=m.startLineNumber?m.endLineNumber>u&&(u=m.endLineNumber):(o.push({range:new L(h,1,u,1),options:Fi._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}o.push({range:new L(h,1,u,1),options:Fi._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let r=new Array(e.length);for(let a=0,l=e.length;a<l;a++)r[a]={range:e[a].range,options:n};this._decorations=i.deltaDecorations(this._decorations,r),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,o),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>i.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Fi._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){let i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumber<e.lineNumber)return n;if(!(n.endColumn>e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;t<i;t++){let n=this._decorations[t],o=this._editor.getModel().getDecorationRange(n);if(!(!o||o.startLineNumber<e.lineNumber)){if(o.startLineNumber>e.lineNumber)return o;if(!(o.startColumn<e.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}}Fi._CURRENT_FIND_MATCH_DECORATION=De.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:en(ix),position:Pn.Center},minimap:{color:en(IA),position:ba.Inline}});Fi._FIND_MATCH_DECORATION=De.register({description:"find-match",stickiness:1,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:en(ix),position:Pn.Center},minimap:{color:en(IA),position:ba.Inline}});Fi._FIND_MATCH_NO_OVERVIEW_DECORATION=De.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});Fi._FIND_MATCH_ONLY_OVERVIEW_DECORATION=De.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:en(ix),position:Pn.Center}});Fi._RANGE_HIGHLIGHT_DECORATION=De.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});Fi._FIND_SCOPE_DECORATION=De.register({description:"find-scope",className:"findScope",isWholeLine:!0});class VX{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){let i=[];for(let r=0;r<this._ranges.length;r++)i.push({range:this._ranges[r],text:this._replaceStrings[r]});i.sort((r,a)=>L.compareRangesUsingStarts(r.range,a.range));let n=[],o=i[0];for(let r=1;r<i.length;r++)o.range.endLineNumber===i[r].range.startLineNumber&&o.range.endColumn===i[r].range.startColumn?(o.range=o.range.plusRange(i[r].range),o.text=o.text+i[r].text):(n.push(o),o=i[r]);n.push(o);for(const r of n)t.addEditOperation(r.range,r.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function UO(s,e){if(s&&s[0]!==""){const t=NN(s,e,"-"),i=NN(s,e,"_");return t&&!i?MN(s,e,"-"):!t&&i?MN(s,e,"_"):s[0].toUpperCase()===s[0]?e.toUpperCase():s[0].toLowerCase()===s[0]?e.toLowerCase():N5(s[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):s[0][0].toUpperCase()!==s[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function NN(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function MN(s,e,t){const i=e.split(t),n=s[0].split(t);let o="";return i.forEach((r,a)=>{o+=UO([n[a]],r)+t}),o.slice(0,-1)}class TN{constructor(e){this.staticValue=e,this.kind=0}}class HX{constructor(e){this.pieces=e,this.kind=1}}class ah{constructor(e){!e||e.length===0?this._state=new TN(""):e.length===1&&e[0].staticValue!==null?this._state=new TN(e[0].staticValue):this._state=new HX(e)}static fromStaticValue(e){return new ah([Il.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}buildReplaceString(e,t){if(this._state.kind===0)return t?UO(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,o=this._state.pieces.length;n<o;n++){let r=this._state.pieces[n];if(r.staticValue!==null){i+=r.staticValue;continue}let a=ah._substitute(r.matchIndex,e);if(r.caseOps!==null&&r.caseOps.length>0){let l=[],d=r.caseOps.length,c=0;for(let h=0,u=a.length;h<u;h++){if(c>=d){l.push(a.slice(h));break}switch(r.caseOps[c]){case"U":l.push(a[h].toUpperCase());break;case"u":l.push(a[h].toUpperCase()),c++;break;case"L":l.push(a[h].toLowerCase());break;case"l":l.push(a[h].toLowerCase()),c++;break;default:l.push(a[h])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class Il{constructor(e,t,i){this.staticValue=e,this.matchIndex=t,!i||i.length===0?this.caseOps=null:this.caseOps=i.slice(0)}static staticValue(e){return new Il(e,-1,null)}static caseOps(e,t){return new Il(null,e,t)}}class zX{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Il.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=Il.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Il.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new ah(this._result)}}function UX(s){if(!s||s.length===0)return new ah(null);let e=[],t=new zX(s);for(let i=0,n=s.length;i<n;i++){let o=s.charCodeAt(i);if(o===92){if(i++,i>=n)break;let r=s.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(`
`,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(o===36){if(i++,i>=n)break;let r=s.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){let l=s.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 Nd=new se("findWidgetVisible",!1),Sv=new se("findInputFocussed",!1),vD=new se("replaceInputFocussed",!1),mp={primary:545,mac:{primary:2593}},_p={primary:565,mac:{primary:2613}},bp={primary:560,mac:{primary:2608}},vp={primary:554,mac:{primary:2602}},wp={primary:558,mac:{primary:2606}},ft={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",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"},na=19999,$X=240;class Vu{constructor(e,t){this._toDispose=new X,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new an,this._decorations=new Fi(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new bt(()=>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,$e(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)},$X)):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 L(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));let n=this._findMatches(i,!1,na);this._decorations.set(n,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&n.length>0){const a=bT(n.map(l=>l.range),l=>L.compareRangesUsingStarts(l,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(33).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){let e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){let t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){let t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),{lineNumber:i,column:n}=e,o=this._editor.getModel();return t||n===1?(i===1?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new O(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const c=this._decorations.matchAfterPosition(e);c&&this._setCurrentFindMatch(c);return}if(this._decorations.getCount()<na){let c=this._decorations.matchBeforePosition(e);c&&c.isEmpty()&&c.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),c=this._decorations.matchBeforePosition(e)),c&&this._setCurrentFindMatch(c);return}if(this._cannotFind())return;let i=this._decorations.getFindScope(),n=Vu._getSearchRange(this._editor.getModel(),i);n.getEndPosition().isBefore(e)&&(e=n.getEndPosition()),e.isBefore(n.getStartPosition())&&(e=n.getEndPosition());let{lineNumber:o,column:r}=e,a=this._editor.getModel(),l=new O(o,r),d=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(114):null,!1);if(d&&d.range.isEmpty()&&d.range.getStartPosition().equals(l)&&(l=this._prevSearchPosition(l),d=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(114):null,!1)),!!d){if(!t&&!n.containsRange(d.range))return this._moveToPrevMatch(d.range.getStartPosition(),!0);this._setCurrentFindMatch(d.range)}}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){let t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),{lineNumber:i,column:n}=e,o=this._editor.getModel();return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new O(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()<na){let i=this._decorations.matchAfterPosition(e);i&&i.isEmpty()&&i.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),i=this._decorations.matchAfterPosition(e)),i&&this._setCurrentFindMatch(i);return}let t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(e,t,i,n=!1){if(this._cannotFind())return null;let o=this._decorations.getFindScope(),r=Vu._getSearchRange(this._editor.getModel(),o);r.getEndPosition().isBefore(e)&&(e=r.getStartPosition()),e.isBefore(r.getStartPosition())&&(e=r.getStartPosition());let{lineNumber:a,column:l}=e,d=this._editor.getModel(),c=new O(a,l),h=d.findNextMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(114):null,t);return i&&h&&h.range.isEmpty()&&h.range.getStartPosition().equals(c)&&(c=this._nextSearchPosition(c),h=d.findNextMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(114):null,t)),h?!n&&!r.containsRange(h.range)?this._getNextMatch(h.range.getEndPosition(),t,i,!0):h:null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_getReplacePattern(){return this._state.isRegex?UX(this._state.replaceString):ah.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;let e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){let n=e.buildReplaceString(i.matches,this._state.preserveCase),o=new mi(t,n);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new O(t.startLineNumber,t.startColumn+n.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const n=(e||[null]).map(o=>Vu._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(114):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=na?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new Ja(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(114):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let h="mu";i.ignoreCase&&(h+="i"),i.global&&(h+="g"),i=new RegExp(i.source,h)}const n=this._editor.getModel(),o=n.getValue(1),r=n.getFullModelRange(),a=this._getReplacePattern();let l;const d=this._state.preserveCase;a.hasReplacementPatterns||d?l=o.replace(i,function(){return a.buildReplaceString(arguments,d)}):l=o.replace(i,a.buildReplaceString(null,d));let c=new sx(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",c)}_regularReplaceAll(e){const t=this._getReplacePattern();let i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let r=0,a=i.length;r<a;r++)n[r]=t.buildReplaceString(i[r].matches,this._state.preserveCase);let o=new VX(this._editor.getSelection(),i.map(r=>r.range),n);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;let e=this._decorations.getFindScopes(),i=this._findMatches(e,!1,1073741824).map(o=>new ee(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)),n=this._editor.getSelection();for(let o=0,r=i.length;o<r;o++)if(i[o].equalsRange(n)){i=[n].concat(i.slice(0,o)).concat(i.slice(o+1));break}this._editor.setSelections(i)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}const jX={inputActiveOptionBorder:B.fromHex("#007ACC00"),inputActiveOptionForeground:B.fromHex("#FFFFFF"),inputActiveOptionBackground:B.fromHex("#0E639C50")};class Cg extends Vn{constructor(e){super(),this._onChange=this._register(new M),this.onChange=this._onChange.event,this._onKeyDown=this._register(new M),this.onKeyDown=this._onKeyDown.event,this._opts=Object.assign(Object.assign({},jX),e),this._checked=this._opts.isChecked;const t=["monaco-custom-checkbox"];this._opts.icon&&t.push(...mn.asClassNameArray(this._opts.icon)),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=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.checked=!this._checked,this._onChange.fire(!1),i.preventDefault()}),this.ignoreGesture(this.domNode),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault();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()}width(){return 22}style(e){e.inputActiveOptionBorder&&(this._opts.inputActiveOptionBorder=e.inputActiveOptionBorder),e.inputActiveOptionForeground&&(this._opts.inputActiveOptionForeground=e.inputActiveOptionForeground),e.inputActiveOptionBackground&&(this._opts.inputActiveOptionBackground=e.inputActiveOptionBackground),this.applyStyles()}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder?this._opts.inputActiveOptionBorder.toString():"transparent",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground?this._opts.inputActiveOptionForeground.toString():"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground?this._opts.inputActiveOptionBackground.toString():"transparent")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const qX=p("caseDescription","Match Case"),KX=p("wordsDescription","Match Whole Word"),GX=p("regexDescription","Use Regular Expression");class $O extends Cg{constructor(e){super({icon:te.caseSensitive,title:qX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class jO extends Cg{constructor(e){super({icon:te.wholeWord,title:KX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class qO extends Cg{constructor(e){super({icon:te.regex,title:GX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class yv extends Vn{constructor(e,t,i,n){super(),this._hideSoon=this._register(new bt(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const o=n.getColorTheme().getColor(IS),r=n.getColorTheme().getColor(NS),a=n.getColorTheme().getColor(ES);this.caseSensitive=this._register(new $O({appendTitle:this._keybindingLabelFor(ft.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,inputActiveOptionBorder:o,inputActiveOptionForeground:r,inputActiveOptionBackground:a})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new jO({appendTitle:this._keybindingLabelFor(ft.ToggleWholeWordCommand),isChecked:this._state.wholeWord,inputActiveOptionBorder:o,inputActiveOptionForeground:r,inputActiveOptionBackground:a})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new qO({appendTitle:this._keybindingLabelFor(ft.ToggleRegexCommand),isChecked:this._state.isRegex,inputActiveOptionBorder:o,inputActiveOptionForeground:r,inputActiveOptionBackground:a})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(l=>{let d=!1;l.isRegex&&(this.regex.checked=this._state.isRegex,d=!0),l.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,d=!0),l.matchCase&&(this.caseSensitive.checked=this._state.matchCase,d=!0),!this._state.isRevealed&&d&&this._revealTemporarily()})),this._register(Ky(this._domNode,l=>this._onMouseOut())),this._register(K(this._domNode,"mouseover",l=>this._onMouseOver())),this._applyTheme(n.getColorTheme()),this._register(n.onDidColorThemeChange(this._applyTheme.bind(this)))}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return yv.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseOut(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(IS),inputActiveOptionForeground:e.getColor(NS),inputActiveOptionBackground:e.getColor(ES)};this.caseSensitive.style(t),this.wholeWords.style(t),this.regex.style(t)}}yv.ID="editor.contrib.findOptionsWidget";tt((s,e)=>{const t=s.getColor(Ki);t&&e.addRule(`.monaco-editor .findOptionsWidget { background-color: ${t}; }`);const i=s.getColor(Ds);i&&e.addRule(`.monaco-editor .findOptionsWidget { color: ${i}; }`);const n=s.getColor(Sa);n&&e.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 0 8px 2px ${n}; }`);const o=s.getColor(Xt);o&&e.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${o}; }`)});function Cp(s,e){return s===1?!0:s===2?!1:e}class ZX extends U{constructor(){super(),this._onFindReplaceStateChange=this._register(new M),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0}get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return Cp(this._isRegexOverride,this._isRegex)}get wholeWord(){return Cp(this._wholeWordOverride,this._wholeWord)}get matchCase(){return Cp(this._matchCaseOverride,this._matchCase)}get preserveCase(){return Cp(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}changeMatchInfo(e,t,i){let n={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1},o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,o=!0),typeof i<"u"&&(L.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){var n;let o={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1},r=!1;const a=this.isRegex,l=this.wholeWord,d=this.matchCase,c=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,r=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((n=e.searchScope)===null||n===void 0)&&n.every(h=>{var u;return(u=this._searchScope)===null||u===void 0?void 0:u.some(f=>!L.equalsRange(f,h))})||(this._searchScope=e.searchScope,o.searchScope=!0,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,r=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(r=!0,o.isRegex=!0),l!==this.wholeWord&&(r=!0,o.wholeWord=!0),d!==this.matchCase&&(r=!0,o.matchCase=!0),c!==this.preserveCase&&(r=!0,o.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=na}}const YX=p("defaultLabel","input");class XX extends Vn{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this._onDidOptionChange=this._register(new M),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new M),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new M),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new M),this._onKeyUp=this._register(new M),this._onCaseSensitiveKeyDown=this._register(new M),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new M),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||YX,this.inputActiveOptionBorder=n.inputActiveOptionBorder,this.inputActiveOptionForeground=n.inputActiveOptionForeground,this.inputActiveOptionBackground=n.inputActiveOptionBackground,this.inputBackground=n.inputBackground,this.inputForeground=n.inputForeground,this.inputBorder=n.inputBorder,this.inputValidationInfoBorder=n.inputValidationInfoBorder,this.inputValidationInfoBackground=n.inputValidationInfoBackground,this.inputValidationInfoForeground=n.inputValidationInfoForeground,this.inputValidationWarningBorder=n.inputValidationWarningBorder,this.inputValidationWarningBackground=n.inputValidationWarningBackground,this.inputValidationWarningForeground=n.inputValidationWarningForeground,this.inputValidationErrorBorder=n.inputValidationErrorBorder,this.inputValidationErrorBackground=n.inputValidationErrorBackground,this.inputValidationErrorForeground=n.inputValidationErrorForeground;const o=n.appendCaseSensitiveLabel||"",r=n.appendWholeWordsLabel||"",a=n.appendRegexLabel||"",l=n.history||[],d=!!n.flexibleHeight,c=!!n.flexibleWidth,h=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new i2(this.domNode,this.contextViewProvider,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:l,flexibleHeight:d,flexibleWidth:c,flexibleMaxHeight:h})),this.regex=this._register(new qO({appendTitle:a,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.regex.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(g=>{this._onRegexKeyDown.fire(g)})),this.wholeWords=this._register(new jO({appendTitle:r,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.wholeWords.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new $O({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.caseSensitive.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(g=>{this._onCaseSensitiveKeyDown.fire(g)})),this._showOptionButtons&&(this.inputBox.paddingRight=this.caseSensitive.width()+this.wholeWords.width()+this.regex.width());let u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,g=>{if(g.equals(15)||g.equals(17)||g.equals(9)){let m=u.indexOf(document.activeElement);if(m>=0){let b=-1;g.equals(17)?b=(m+1)%u.length:g.equals(15)&&(m===0?b=u.length-1:b=m-1),g.equals(9)?(u[m].blur(),this.inputBox.focus()):b>=0&&u[b].focus(),et.stop(g,!0)}}});let f=document.createElement("div");f.className="controls",f.style.display=this._showOptionButtons?"block":"none",f.appendChild(this.caseSensitive.domNode),f.appendChild(this.wholeWords.domNode),f.appendChild(this.regex.domNode),this.domNode.appendChild(f),e&&e.appendChild(this.domNode),this._register(K(this.inputBox.inputElement,"compositionstart",g=>{this.imeSessionInProgress=!0})),this._register(K(this.inputBox.inputElement,"compositionend",g=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,g=>this._onKeyDown.fire(g)),this.onkeyup(this.inputBox.inputElement,g=>this._onKeyUp.fire(g)),this.oninput(this.inputBox.inputElement,g=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,g=>this._onMouseDown.fire(g))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive.checked}setCaseSensitive(e){this.caseSensitive.checked=e}getWholeWords(){return this.wholeWords.checked}setWholeWords(e){this.wholeWords.checked=e}getRegex(){return this.regex.checked}setRegex(e){this.regex.checked=e,this.validate()}focusOnCaseSensitive(){this.caseSensitive.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}clearMessage(){this.inputBox.hideMessage()}}const QX=p("defaultLabel","input"),JX=p("label.preserveCaseCheckbox","Preserve Case");class eQ extends Cg{constructor(e){super({icon:te.preserveCase,title:JX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class tQ extends Vn{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new M),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new M),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new M),this._onInput=this._register(new M),this._onKeyUp=this._register(new M),this._onPreserveCaseKeyDown=this._register(new M),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||QX,this.inputActiveOptionBorder=n.inputActiveOptionBorder,this.inputActiveOptionForeground=n.inputActiveOptionForeground,this.inputActiveOptionBackground=n.inputActiveOptionBackground,this.inputBackground=n.inputBackground,this.inputForeground=n.inputForeground,this.inputBorder=n.inputBorder,this.inputValidationInfoBorder=n.inputValidationInfoBorder,this.inputValidationInfoBackground=n.inputValidationInfoBackground,this.inputValidationInfoForeground=n.inputValidationInfoForeground,this.inputValidationWarningBorder=n.inputValidationWarningBorder,this.inputValidationWarningBackground=n.inputValidationWarningBackground,this.inputValidationWarningForeground=n.inputValidationWarningForeground,this.inputValidationErrorBorder=n.inputValidationErrorBorder,this.inputValidationErrorBackground=n.inputValidationErrorBackground,this.inputValidationErrorForeground=n.inputValidationErrorForeground;const o=n.appendPreserveCaseLabel||"",r=n.history||[],a=!!n.flexibleHeight,l=!!n.flexibleWidth,d=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new i2(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:r,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:d})),this.preserveCase=this._register(new eQ({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.preserveCase.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(u=>{this._onPreserveCaseKeyDown.fire(u)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;let c=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){let f=c.indexOf(document.activeElement);if(f>=0){let g=-1;u.equals(17)?g=(f+1)%c.length:u.equals(15)&&(f===0?g=c.length-1:g=f-1),u.equals(9)?(c[f].blur(),this.inputBox.focus()):g>=0&&c[g].focus(),et.stop(u,!0)}}});let h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e&&e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.preserveCase.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox&&this.inputBox.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var KO=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},GO=function(s,e){return function(t,i){e(t,i,s)}};const Bf="historyNavigationWidget",wD="historyNavigationEnabled";function iQ(s,e,t){new se(t,e).bindTo(s)}function nQ(s,e){return s.createScoped(e.target)}function ZO(s,e){return s.getContext(document.activeElement).getValue(e)}function YO(s,e){const t=nQ(s,e);iQ(t,e,Bf);const i=new se(wD,!0).bindTo(t);return{scopedContextKeyService:t,historyNavigationEnablement:i}}let Ly=class extends XX{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(YO(n,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};Ly=KO([GO(3,we)],Ly);let xy=class extends tQ{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(YO(n,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};xy=KO([GO(3,we)],xy);ln.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:J.and(J.has(Bf),J.equals(wD,!0)),primary:16,secondary:[528],handler:(s,e)=>{const t=ZO(s.get(we),Bf);t&&t.historyNavigator.showPreviousValue()}});ln.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:J.and(J.has(Bf),J.equals(wD,!0)),primary:18,secondary:[530],handler:(s,e)=>{const t=ZO(s.get(we),Bf);t&&t.historyNavigator.showNextValue()}});var sQ=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const oQ=ki("find-selection",te.selection,p("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),AN=ki("find-collapsed",te.chevronRight,p("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),RN=ki("find-expanded",te.chevronDown,p("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),rQ=ki("find-replace",te.replace,p("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),aQ=ki("find-replace-all",te.replaceAll,p("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),lQ=ki("find-previous-match",te.arrowUp,p("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),dQ=ki("find-next-match",te.arrowDown,p("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),cQ=p("label.find","Find"),hQ=p("placeholder.find","Find"),uQ=p("label.previousMatchButton","Previous match"),fQ=p("label.nextMatchButton","Next match"),gQ=p("label.toggleSelectionFind","Find in selection"),pQ=p("label.closeButton","Close"),mQ=p("label.replace","Replace"),_Q=p("placeholder.replace","Replace"),bQ=p("label.replaceButton","Replace"),vQ=p("label.replaceAllButton","Replace All"),wQ=p("label.toggleReplaceButton","Toggle Replace mode"),CQ=p("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",na),SQ=p("label.matchesLocation","{0} of {1}"),ON=p("label.noResults","No results"),co=419,yQ=275,LQ=yQ-54;let tu=69;const xQ=33,PN="ctrlEnterReplaceAll.windows.donotask",FN=Re?256:2048;class zC{constructor(e){this.afterLineNumber=e,this.heightInPx=xQ,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function BN(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){s.stopPropagation();return}}function WN(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEnd<t.value.length){s.stopPropagation();return}}class Lv extends Vn{constructor(e,t,i,n,o,r,a,l,d){super(),this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=n,this._keybindingService=o,this._contextKeyService=r,this._storageService=l,this._notificationService=d,this._ctrlEnterReplaceAllWarningPrompted=!!l.getBoolean(PN,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new yr(500),this._register(Pe(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(c=>this._onStateChanged(c))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(c=>{if(c.hasChanged(78)&&(this._codeEditor.getOption(78)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),c.hasChanged(128)&&this._tryUpdateWidgetWidth(),c.hasChanged(2)&&this.updateAccessibilitySupport(),c.hasChanged(33)){const h=this._codeEditor.getOption(33).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new zC(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>sQ(this,void 0,void 0,function*(){if(this._isVisible){let c=yield this._controller.getGlobalBufferTerm();c&&c!==this._state.searchString&&(this._state.change({searchString:c},!1),this._findInput.select())}}))),this._findInputFocused=Sv.bindTo(r),this._findFocusTracker=this._register(Fc(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=vD.bindTo(r),this._replaceFocusTracker=this._register(Fc(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(33).addExtraSpaceOnTop&&(this._viewZone=new zC(0)),this._applyTheme(a.getColorTheme()),this._register(a.onDidColorThemeChange(this._applyTheme.bind(this))),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(c=>{if(c.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return Lv.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(78)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=cs(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){let t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,ve)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=tu+"px",this._state.matchesCount>=na?this._matchesCount.title=CQ:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=na&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=Ai(SQ,i,t)}else e=ON;this._matchesCount.appendChild(document.createTextNode(e)),wi(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),tu=Math.max(tu,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===ON)return i===""?p("ariaSearchNoResultEmpty","{0} found",e):p("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const n=p("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${n}`:n}return p("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){let e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);let e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);let i=!this._codeEditor.getOption(78);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(33).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(33).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=vi(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=n.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&a<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const l=TM(this._domNode).left;r>l&&(t=!1);const d=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(d?d.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(33).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(n=>{i.heightInPx=this._getHeight(),this._viewZoneId=n.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(33).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new zC(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;let r=o-i.heightInPx;i.heightInPx=o,n.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(72).top,o<=0)return;i.heightInPx=o,this._viewZoneId=n.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(IS),inputActiveOptionBackground:e.getColor(ES),inputActiveOptionForeground:e.getColor(NS),inputBackground:e.getColor($L),inputForeground:e.getColor(jL),inputBorder:e.getColor(qL),inputValidationInfoBackground:e.getColor(KL),inputValidationInfoForeground:e.getColor(GL),inputValidationInfoBorder:e.getColor(ZL),inputValidationWarningBackground:e.getColor(mA),inputValidationWarningForeground:e.getColor(_A),inputValidationWarningBorder:e.getColor(bA),inputValidationErrorBackground:e.getColor(vA),inputValidationErrorForeground:e.getColor(wA),inputValidationErrorBorder:e.getColor(CA)};this._findInput.style(t),this._replaceInput.style(t),this._toggleSelectionFind.style(t)}_tryUpdateWidgetWidth(){if(!this._isVisible||!jy(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,n=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&cs(this._domNode)>co){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=cs(this._findInput.domNode);return}if(co+28+n>=i&&(r=!0),co+28+n-tu>=i&&(a=!0),co+28+n-tu>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-n-15}px`),this._resized){this._findInput.inputBox.layout();let l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=cs(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){let e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!L.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(FN|3)){this._findInput.inputBox.insertAtCursor(`
`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return BN(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return WN(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(FN|3)){Si&&Mo&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(p("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(PN,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(`
`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return BN(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return WN(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new Ly(null,this._contextViewProvider,{width:LQ,label:cQ,placeholder:hQ,appendCaseSensitiveLabel:this._keybindingLabelFor(ft.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(ft.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(ft.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(d){return{content:d.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118},this._contextKeyService,!0)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),sn&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new Gd({label:uQ+this._keybindingLabelFor(ft.PreviousMatchFindAction),icon:lQ,onTrigger:()=>{this._codeEditor.getAction(ft.PreviousMatchFindAction).run().then(void 0,ve)}})),this._nextBtn=this._register(new Gd({label:fQ+this._keybindingLabelFor(ft.NextMatchFindAction),icon:dQ,onTrigger:()=>{this._codeEditor.getAction(ft.NextMatchFindAction).run().then(void 0,ve)}}));let i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const n=document.createElement("div");n.className="find-actions",i.appendChild(n),n.appendChild(this._matchesCount),n.appendChild(this._prevBtn.domNode),n.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Cg({icon:oQ,title:gQ+this._keybindingLabelFor(ft.ToggleSearchScopeCommand),isChecked:!1})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let l=this._codeEditor.getSelections();l.map(d=>(d.endColumn===1&&d.endLineNumber>d.startLineNumber&&(d=d.setEndPosition(d.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(d.endLineNumber-1))),d.isEmpty()?null:d)).filter(d=>!!d),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),n.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new Gd({label:pQ+this._keybindingLabelFor(ft.CloseFindWidgetCommand),icon:E9,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),n.appendChild(this._closeBtn.domNode),this._replaceInput=this._register(new xy(null,void 0,{label:mQ,placeholder:_Q,appendPreserveCaseLabel:this._keybindingLabelFor(ft.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new Gd({label:bQ+this._keybindingLabelFor(ft.ReplaceOneAction),icon:rQ,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new Gd({label:vQ+this._keybindingLabelFor(ft.ReplaceAllAction),icon:aQ,onTrigger:()=>{this._controller.replaceAll()}}));let o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const r=document.createElement("div");r.className="replace-actions",o.appendChild(r),r.appendChild(this._replaceBtn.domNode),r.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new Gd({label:wQ,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=cs(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.style.width=`${co}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(o),this._resizeSash=new Ti(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=co;this._register(this._resizeSash.onDidStart(()=>{a=cs(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;let d=a+l.startX-l.currentX;if(d<co)return;const c=parseFloat(Zy(this._domNode).maxWidth)||0;d>c||(this._domNode.style.width=`${d}px`,this._isReplaceVisible&&(this._replaceInput.width=cs(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=cs(this._domNode);if(l<co)return;let d=co;if(!this._resized||l===co){const c=this._codeEditor.getLayoutInfo();d=c.width-28-c.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${d}px`,this._isReplaceVisible&&(this._replaceInput.width=cs(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}Lv.ID="editor.contrib.findWidget";class Gd extends Vn{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+wt.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=t,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,i=>{this._opts.onTrigger(),i.preventDefault()}),this.onkeydown(this._domNode,i=>{if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}this._opts.onKeyDown&&this._opts.onKeyDown(i)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...wt.asClassNameArray(AN)),this._domNode.classList.add(...wt.asClassNameArray(RN))):(this._domNode.classList.remove(...wt.asClassNameArray(RN)),this._domNode.classList.add(...wt.asClassNameArray(AN)))}}tt((s,e)=>{const t=(f,g)=>{g&&e.addRule(`.monaco-editor ${f} { background-color: ${g}; }`)};t(".findMatch",s.getColor(TS)),t(".currentFindMatch",s.getColor(Z7)),t(".findScope",s.getColor(Y7));const i=s.getColor(Ki);t(".find-widget",i);const n=s.getColor(Sa);n&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${n}; }`);const o=s.getColor(Q7);o&&e.addRule(`.monaco-editor .findMatch { border: 1px ${s.type==="hc"?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const r=s.getColor(X7);r&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${r}; padding: 1px; box-sizing: border-box; }`);const a=s.getColor(J7);a&&e.addRule(`.monaco-editor .findScope { border: 1px ${s.type==="hc"?"dashed":"solid"} ${a}; }`);const l=s.getColor(Xt);l&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${l}; }`);const d=s.getColor(Ds);d&&e.addRule(`.monaco-editor .find-widget { color: ${d}; }`);const c=s.getColor(I7);c&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${c}; }`);const h=s.getColor(B7);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const f=s.getColor(Sl);f&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${f}; }`)}const u=s.getColor(Ca);u&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${u}; }`)});var XO=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},po=function(s,e){return function(t,i){e(t,i,s)}},lh=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const DQ=524288;function Dy(s,e="single"){if(!s.hasModel())return null;const t=s.getSelection();if(e==="single"&&t.startLineNumber===t.endLineNumber||e==="multiple"){if(t.isEmpty()){const i=s.getConfiguredWordAtPosition(t.getStartPosition());if(i)return i.word}else if(s.getModel().getValueLengthInRange(t)<DQ)return s.getModel().getValueInRange(t)}return null}let Wn=class QO extends U{constructor(e,t,i,n){super(),this._editor=e,this._findWidgetVisible=Nd.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._updateHistoryDelayer=new yr(500),this._state=this._register(new ZX),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(o=>this._onStateChanged(o))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{let o=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),o&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(33).loop})}))}get editor(){return this._editor}static get(e){return e.getContribution(QO.ID)}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,0),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,0),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,0),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,0)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!Sv.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=Ys(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e){return lh(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;let t={isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){let i=Dy(this._editor,e.seedSearchStringFromSelection);i&&(this._state.isRegex?t.searchString=Ys(i):t.searchString=i)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){let i=Dy(this._editor,e.seedSearchStringFromSelection);i&&(t.searchString=i)}if(!t.searchString&&e.seedSearchStringFromGlobalClipboard){let i=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;i&&(t.searchString=i)}if(e.forceRevealReplace?t.isReplaceRevealed=!0:this._findWidgetVisible.get()||(t.isReplaceRevealed=!1),e.updateSearchScope){let i=this._editor.getSelections();i.some(n=>!n.isEmpty())&&(t.searchScope=i)}t.loop=e.loop,this._state.change(t,!1),this._model||(this._model=new Vu(this._editor,this._state))})}start(e){return this._start(e)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return lh(this,void 0,void 0,function*(){return this._editor.getOption(33).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(33).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};Wn.ID="editor.contrib.findController";Wn=XO([po(1,we),po(2,Or),po(3,Va)],Wn);let ky=class extends Wn{constructor(e,t,i,n,o,r,a,l){super(e,i,a,l),this._contextViewService=t,this._keybindingService=n,this._themeService=o,this._notificationService=r,this._widget=null,this._findOptionsWidget=null}_start(e){const t=Object.create(null,{_start:{get:()=>super._start}});return lh(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(33).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":n=!!i&&i.startLineNumber!==i.endLineNumber;break}e.updateSearchScope=n,yield t._start.call(this,e),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())})}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new Lv(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new yv(this._editor,this._state,this._keybindingService,this._themeService))}};ky=XO([po(1,Wa),po(2,we),po(3,Lt),po(4,pt),po(5,Qt),po(6,Or),po(7,Va)],ky);const kQ=YT(new ZT({id:ft.StartFindAction,label:p("startFindAction","Find"),alias:"Find",precondition:J.or(I.focus,J.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:oe.MenubarEditMenu,group:"3_find",title:p({},"&&Find"),order:1}}));kQ.addImplementation(0,(s,e,t)=>{const i=Wn.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(33).seedSearchStringFromSelection?"single":"none",seedSearchStringFromGlobalClipboard:e.getOption(33).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(33).loop}):!1});class IQ extends ne{constructor(){super({id:ft.StartFindWithSelection,label:p("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return lh(this,void 0,void 0,function*(){let i=Wn.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(33).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class JO extends ne{run(e,t){return lh(this,void 0,void 0,function*(){let i=Wn.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(33).seedSearchStringFromSelection?"single":"none",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(33).loop}),this._run(i))})}}class EQ extends JO{constructor(){super({id:ft.NextMatchFindAction,label:p("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:I.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:J.and(I.focus,Sv),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class NQ extends JO{constructor(){super({id:ft.PreviousMatchFindAction,label:p("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:I.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:J.and(I.focus,Sv),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class eP extends ne{run(e,t){return lh(this,void 0,void 0,function*(){let i=Wn.get(t);if(!i)return;let n=Dy(t);n&&i.setSearchString(n),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getOption(33).seedSearchStringFromSelection?"single":"none",seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(33).loop}),this._run(i))})}}class MQ extends eP{constructor(){super({id:ft.NextSelectionMatchFindAction,label:p("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class TQ extends eP{constructor(){super({id:ft.PreviousSelectionMatchFindAction,label:p("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const AQ=YT(new ZT({id:ft.StartFindReplaceAction,label:p("startReplace","Replace"),alias:"Replace",precondition:J.or(I.focus,J.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:oe.MenubarEditMenu,group:"3_find",title:p({},"&&Replace"),order:2}}));AQ.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(78))return!1;const i=Wn.get(e);if(!i)return!1;const n=e.getSelection(),o=i.isFindInputFocused(),r=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(33).seedSearchStringFromSelection&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromGlobalClipboard:e.getOption(33).seedSearchStringFromSelection,shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(33).loop})});Xe(Wn.ID,ky);Q(IQ);Q(EQ);Q(NQ);Q(MQ);Q(TQ);const so=Di.bindToContribution(Wn.get);G(new so({id:ft.CloseFindWidgetCommand,precondition:Nd,handler:s=>s.closeFindWidget(),kbOpts:{weight:105,kbExpr:J.and(I.focus,J.not("isComposing")),primary:9,secondary:[1033]}}));G(new so({id:ft.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:I.focus,primary:mp.primary,mac:mp.mac,win:mp.win,linux:mp.linux}}));G(new so({id:ft.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:105,kbExpr:I.focus,primary:_p.primary,mac:_p.mac,win:_p.win,linux:_p.linux}}));G(new so({id:ft.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:105,kbExpr:I.focus,primary:bp.primary,mac:bp.mac,win:bp.win,linux:bp.linux}}));G(new so({id:ft.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:105,kbExpr:I.focus,primary:vp.primary,mac:vp.mac,win:vp.win,linux:vp.linux}}));G(new so({id:ft.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:105,kbExpr:I.focus,primary:wp.primary,mac:wp.mac,win:wp.win,linux:wp.linux}}));G(new so({id:ft.ReplaceOneAction,precondition:Nd,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:I.focus,primary:3094}}));G(new so({id:ft.ReplaceOneAction,precondition:Nd,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:J.and(I.focus,vD),primary:3}}));G(new so({id:ft.ReplaceAllAction,precondition:Nd,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:I.focus,primary:2563}}));G(new so({id:ft.ReplaceAllAction,precondition:Nd,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:J.and(I.focus,vD),primary:void 0,mac:{primary:2051}}}));G(new so({id:ft.SelectAllMatchesAction,precondition:Nd,handler:s=>s.selectAllMatches(),kbOpts:{weight:105,kbExpr:I.focus,primary:515}}));const VN=65535,ur=16777215,HN=4278190080;class Wf{constructor(e,t,i){if(e.length!==t.length||e.length>VN)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Uint32Array(Math.ceil(e.length/32)),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;let e=[],t=(i,n)=>{let o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=n};for(let i=0,n=this._startIndexes.length;i<n;i++){let o=this._startIndexes[i],r=this._endIndexes[i];if(o>ur||r>ur)throw new Error("startLineNumber or endLineNumber must not exceed "+ur);for(;e.length>0&&!t(o,r);)e.pop();let a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&ur}getEndLineNumber(e){return this._endIndexes[e]&ur}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){let t=e/32|0,i=e%32;return(this._collapseStates[t]&1<<i)!==0}setCollapsed(e,t){let i=e/32|0,n=e%32,o=this._collapseStates[i];t?this._collapseStates[i]=o|1<<n:this._collapseStates[i]=o&~(1<<n)}toRegion(e){return new RQ(this,e)}getParentIndex(e){this.ensureParentIndices();let t=((this._startIndexes[e]&HN)>>>24)+((this._endIndexes[e]&HN)>>>16);return t===VN?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){let n=Math.floor((t+i)/2);e<this.getStartLineNumber(n)?i=n:t=n+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){let e=[];for(let t=0;t<this.length;t++)e[t]=`[${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}}class RQ{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class OQ{constructor(e,t){this._updateEventEmitter=new M,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Wf(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[],this._isInitialized=!1}get regions(){return this._regions}get textModel(){return this._textModel}get isInitialized(){return this._isInitialized}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,n)=>i.regionIndex-n.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,o=-1,r=-1;const a=l=>{for(;n<l;){const d=this._regions.getEndLineNumber(n),c=this._regions.isCollapsed(n);d<=o&&i.changeDecorationOptions(this._editorDecorationIds[n],this._decorationProvider.getDecorationOption(c,d<=r)),c&&d>r&&(r=d),n++}};for(let l of e){let d=l.regionIndex,c=this._editorDecorationIds[d];if(c&&!t[c]){t[c]=!0,a(d);let h=!this._regions.isCollapsed(d);this._regions.setCollapsed(d,h),o=Math.max(o,this._regions.getEndLineNumber(d))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}update(e,t=[]){let i=[],n=(h,u)=>{for(let f of t)if(h<f&&f<=u)return!0;return!1},o=-1,r=(h,u)=>{const f=e.getStartLineNumber(h),g=e.getEndLineNumber(h);u&&n(f,g)&&(u=!1),e.setCollapsed(h,u);const m=this._textModel.getLineMaxColumn(f),b={startLineNumber:f,startColumn:Math.max(m-1,1),endLineNumber:f,endColumn:m};i.push({range:b,options:this._decorationProvider.getDecorationOption(u,g<=o)}),u&&g>o&&(o=g)},a=0,l=()=>{for(;a<this._regions.length;){let h=this._regions.isCollapsed(a);if(a++,h)return a-1}return-1},d=0,c=l();for(;c!==-1&&d<e.length;){let h=this._textModel.getDecorationRange(this._editorDecorationIds[c]);if(h){let u=h.startLineNumber;if(h.startColumn===Math.max(h.endColumn-1,1)&&this._textModel.getLineMaxColumn(u)===h.endColumn)for(;d<e.length;){let f=e.getStartLineNumber(d);if(u>=f)r(d,u===f),d++;else break}}c=l()}for(;d<e.length;)r(d,!1),d++;this._editorDecorationIds=this._decorationProvider.deltaDecorations(this._editorDecorationIds,i),this._regions=e,this._isInitialized=!0,this._updateEventEmitter.fire({model:this})}getMemento(){let e=[];for(let t=0;t<this._regions.length;t++)if(this._regions.isCollapsed(t)){let i=this._textModel.getDecorationRange(this._editorDecorationIds[t]);if(i){let n=i.startLineNumber,o=i.endLineNumber+this._regions.getEndLineNumber(t)-this._regions.getStartLineNumber(t);e.push({startLineNumber:n,endLineNumber:o})}}if(e.length>0)return e}applyMemento(e){if(!Array.isArray(e))return;let t=[];for(let i of e){let n=this.getRegionAtLine(i.startLineNumber);n&&!n.isCollapsed&&t.push(n)}this.toggleCollapseState(t)}dispose(){this._decorationProvider.deltaDecorations(this._editorDecorationIds,[])}getAllRegionsAtLine(e,t){let i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){let r=this._regions.toRegion(n);(!t||t(r,o))&&i.push(r),o++,n=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){let t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){let i=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=n,l=this._regions.length;a<l;a++){let d=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<o){for(;r.length>0&&!d.containedBy(r[r.length-1]);)r.pop();r.push(d),t(d,r.length)&&i.push(d)}else break}}else for(let r=n,a=this._regions.length;r<a;r++){let l=this._regions.toRegion(r);if(this._regions.getStartLineNumber(r)<o)(!t||t(l))&&i.push(l);else break}return i}}function PQ(s,e,t){let i=[];for(let n of t){let o=s.getRegionAtLine(n);o&&(o.isCollapsed,i.push(o))}s.toggleCollapseState(i)}function Ih(s,e,t=Number.MAX_VALUE,i){let n=[];if(i&&i.length>0)for(let o of i){let r=s.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&n.push(r),t>1)){let a=s.getRegionsInside(r,(l,d)=>l.isCollapsed!==e&&d<t);n.push(...a)}}else{let o=s.getRegionsInside(null,(r,a)=>r.isCollapsed!==e&&a<t);n.push(...o)}s.toggleCollapseState(n)}function tP(s,e,t,i){let n=[];for(let o of i){let r=s.getAllRegionsAtLine(o,(a,l)=>a.isCollapsed!==e&&l<=t);n.push(...r)}s.toggleCollapseState(n)}function FQ(s,e,t){let i=[];for(let n of t){let o=s.getAllRegionsAtLine(n,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}s.toggleCollapseState(i)}function BQ(s,e,t,i){let n=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function iP(s,e,t){let i=[];for(let r of t)i.push(s.getAllRegionsAtLine(r,void 0)[0]);let n=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function CD(s,e,t){let i=s.textModel,n=s.regions,o=[];for(let r=n.length-1;r>=0;r--)if(t!==n.isCollapsed(r)){let a=n.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(n.toRegion(r))}s.toggleCollapseState(o)}function SD(s,e,t){let i=s.regions,n=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&n.push(i.toRegion(o));s.toggleCollapseState(n)}const yD=ki("folding-expanded",te.chevronDown,p("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),LD=ki("folding-collapsed",te.chevronRight,p("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin."));class vs{constructor(e){this.editor=e,this.autoHideFoldingControls=!0,this.showFoldingHighlights=!0}getDecorationOption(e,t){return t?vs.HIDDEN_RANGE_DECORATION:e?this.showFoldingHighlights?vs.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:vs.COLLAPSED_VISUAL_DECORATION:this.autoHideFoldingControls?vs.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:vs.EXPANDED_VISUAL_DECORATION}deltaDecorations(e,t){return this.editor.deltaDecorations(e,t)}changeDecorations(e){return this.editor.changeDecorations(e)}}vs.COLLAPSED_VISUAL_DECORATION=De.register({description:"folding-collapsed-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:wt.asClassName(LD)});vs.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=De.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",className:"folded-background",isWholeLine:!0,firstLineDecorationClassName:wt.asClassName(LD)});vs.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=De.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:wt.asClassName(yD)});vs.EXPANDED_VISUAL_DECORATION=De.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+wt.asClassName(yD)});vs.HIDDEN_RANGE_DECORATION=De.register({description:"folding-hidden-range-decoration",stickiness:1});class WQ{constructor(e){this._updateEventEmitter=new M,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}updateHiddenRanges(){let e=!1,t=[],i=0,n=0,o=Number.MAX_VALUE,r=-1,a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;let l=a.getStartLineNumber(i)+1,d=a.getEndLineNumber(i);o<=l&&d<=r||(!e&&n<this._hiddenRanges.length&&this._hiddenRanges[n].startLineNumber===l&&this._hiddenRanges[n].endLineNumber===d?(t.push(this._hiddenRanges[n]),n++):(e=!0,t.push(new L(l,1,d,1))),o=l,r=d)}(e||n<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyMemento(e){if(!Array.isArray(e)||e.length===0)return!1;let t=[];for(let i of e){if(!i.startLineNumber||!i.endLineNumber)return!1;t.push(new L(i.startLineNumber+1,1,i.endLineNumber,1))}return this.applyHiddenRanges(t),!0}getMemento(){return this._hiddenRanges.map(e=>({startLineNumber:e.startLineNumber-1,endLineNumber:e.endLineNumber}))}applyHiddenRanges(e){this._hiddenRanges=e,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return zN(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1,i=this._foldingModel.textModel,n=null,o=r=>((!n||!VQ(r,n))&&(n=zN(this._hiddenRanges,r)),n?n.startLineNumber-1:null);for(let r=0,a=e.length;r<a;r++){let l=e[r],d=o(l.startLineNumber);d&&(l=l.setStartPosition(d,i.getLineMaxColumn(d)),t=!0);let c=o(l.endLineNumber);c&&(l=l.setEndPosition(c,i.getLineMaxColumn(c)),t=!0),e[r]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function VQ(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function zN(s,e){let t=bT(s,i=>e<i.startLineNumber)-1;return t>=0&&s[t].endLineNumber>=e?s[t]:null}const HQ=5e3,zQ="indent";class UQ{constructor(e){this.editorModel=e,this.id=zQ}dispose(){}compute(e){let t=xe.getFoldingRules(this.editorModel.getLanguageIdentifier().id),i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(jQ(this.editorModel,i,n))}}let $Q=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>ur||t>ur)return;let n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){if(this._length<=this._foldingRangesLimit){let t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let n=this._length-1,o=0;n>=0;n--,o++)t[o]=this._startIndexes[n],i[o]=this._endIndexes[n];return new Wf(t,i)}else{let t=0,i=this._indentOccurrences.length;for(let a=0;a<this._indentOccurrences.length;a++){let l=this._indentOccurrences[a];if(l){if(l+t>this._foldingRangesLimit){i=a;break}t+=l}}const n=e.getOptions().tabSize;let o=new Uint32Array(this._foldingRangesLimit),r=new Uint32Array(this._foldingRangesLimit);for(let a=this._length-1,l=0;a>=0;a--){let d=this._startIndexes[a],c=e.getLineContent(d),h=si.computeIndentLevel(c,n);(h<i||h===i&&t++<this._foldingRangesLimit)&&(o[l]=d,r[l]=this._endIndexes[a],l++)}return new Wf(o,r)}}};function jQ(s,e,t,i=HQ){const n=s.getOptions().tabSize;let o=new $Q(i),r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));let a=[],l=s.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let d=s.getLineCount();d>0;d--){let c=s.getLineContent(d),h=si.computeIndentLevel(c,n),u=a[a.length-1];if(h===-1){e&&(u.endAbove=d);continue}let f;if(r&&(f=c.match(r)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,u=a[g],o.insertFirst(d,u.line,h),u.line=d,u.indent=h,u.endAbove=d;continue}}else{a.push({indent:-2,endAbove:d,line:d});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);let g=u.endAbove-1;g-d>=1&&o.insertFirst(d,g,h)}u.indent===h?u.endAbove=d:a.push({indent:h,endAbove:d,line:d})}return o.toIndentRanges(s)}const qQ=5e3,KQ={},nP="syntax";class GQ{constructor(e,t,i,n=qQ){this.editorModel=e,this.providers=t,this.limit=n,this.id=nP;for(const o of t)typeof o.onDidChange=="function"&&(this.disposables||(this.disposables=new X),this.disposables.add(o.onDidChange(i)))}compute(e){return ZQ(this.providers,this.editorModel,e).then(t=>t?sP(t,this.limit):null)}dispose(){var e;(e=this.disposables)===null||e===void 0||e.dispose()}}function ZQ(s,e,t){let i=null,n=s.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,KQ,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);let l=e.getLineCount();for(let d of a)d.start>0&&d.end>d.start&&d.end<=l&&i.push({start:d.start,end:d.end,rank:r,kind:d.kind})}},gi));return Promise.all(n).then(o=>i)}class YQ{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>ur||t>ur)return;let o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;i<this._length;i++)e[i]=this._startIndexes[i],t[i]=this._endIndexes[i];return new Wf(e,t,this._types)}else{let e=0,t=this._nestingLevelCounts.length;for(let r=0;r<this._nestingLevelCounts.length;r++){let a=this._nestingLevelCounts[r];if(a){if(a+e>this._foldingRangesLimit){t=r;break}e+=a}}let i=new Uint32Array(this._foldingRangesLimit),n=new Uint32Array(this._foldingRangesLimit),o=[];for(let r=0,a=0;r<this._length;r++){let l=this._nestingLevels[r];(l<t||l===t&&e++<this._foldingRangesLimit)&&(i[a]=this._startIndexes[r],n[a]=this._endIndexes[r],o[a]=this._types[r],a++)}return new Wf(i,n,o)}}}function sP(s,e){let t=s.sort((r,a)=>{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new YQ(e),n,o=[];for(let r of t)if(!n)n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>n.start)if(r.end<=n.end)o.push(n),n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>n.end){do n=o.pop();while(n&&r.start>n.end);n&&o.push(n),n=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}const oP="init";class XQ{constructor(e,t,i,n){if(this.editorModel=e,this.id=oP,t.length){let o=r=>({range:{startLineNumber:r.startLineNumber,startColumn:0,endLineNumber:r.endLineNumber,endColumn:e.getLineLength(r.endLineNumber)},options:{description:"folding-initializing-range-provider",stickiness:1}});this.decorationIds=e.deltaDecorations([],t.map(o)),this.timeout=setTimeout(i,n)}}dispose(){this.decorationIds&&(this.editorModel.deltaDecorations(this.decorationIds,[]),this.decorationIds=void 0),typeof this.timeout=="number"&&(clearTimeout(this.timeout),this.timeout=void 0)}compute(e){let t=[];if(this.decorationIds)for(let i of this.decorationIds){let n=this.editorModel.getDecorationRange(i);n&&t.push({start:n.startLineNumber,end:n.endLineNumber,rank:1})}return Promise.resolve(sP(t,Number.MAX_VALUE))}}var QQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},JQ=function(s,e){return function(t,i){e(t,i,s)}};const zn=new se("foldingEnabled",!1);let dh=class rP extends U{constructor(e,t){super(),this.contextKeyService=t,this.localToDispose=this._register(new X),this.editor=e;const i=this.editor.getOptions();this._isEnabled=i.get(35),this._useFoldingProviders=i.get(36)!=="indentation",this._unfoldOnClickAfterEndOfLine=i.get(38),this._restoringViewState=!1,this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingStateMemento=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new vs(e),this.foldingDecorationProvider.autoHideFoldingControls=i.get(97)==="mouseover",this.foldingDecorationProvider.showFoldingHighlights=i.get(37),this.foldingEnabled=zn.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(n=>{if(n.hasChanged(35)&&(this._isEnabled=this.editor.getOptions().get(35),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),n.hasChanged(97)||n.hasChanged(37)){const o=this.editor.getOptions();this.foldingDecorationProvider.autoHideFoldingControls=o.get(97)==="mouseover",this.foldingDecorationProvider.showFoldingHighlights=o.get(37),this.onModelContentChanged()}n.hasChanged(36)&&(this._useFoldingProviders=this.editor.getOptions().get(36)!=="indentation",this.onFoldingStrategyChanged()),n.hasChanged(38)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(38))})),this.onModelChanged()}static get(e){return e.getContribution(rP.ID)}saveViewState(){let e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){let t=this.foldingModel.isInitialized?this.foldingModel.getMemento():this.hiddenRangeModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i}}}restoreViewState(e){let t=this.editor.getModel();if(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel||!e||!e.collapsedRegions||e.lineCount!==t.getLineCount())return;(e.provider===nP||e.provider===oP)&&(this.foldingStateMemento=e);const i=e.collapsedRegions;if(this.hiddenRangeModel.applyMemento(i)){const n=this.getFoldingModel();n&&n.then(o=>{if(o){this._restoringViewState=!0;try{o.applyMemento(i)}finally{this._restoringViewState=!1}}}).then(void 0,ve)}}onModelChanged(){this.localToDispose.clear();let e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this.foldingModel=new OQ(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new WQ(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new yr(200),this.cursorChangedScheduler=new bt(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(rS.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(()=>this.onModelContentChanged())),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler&&this.updateScheduler.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.foldingStateMemento=null,this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null}}),this.onModelContentChanged())}onFoldingStrategyChanged(){this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null,this.onModelContentChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;if(this.rangeProvider=new UQ(e),this._useFoldingProviders&&this.foldingModel){let t=rS.ordered(this.foldingModel.textModel);if(t.length===0&&this.foldingStateMemento&&this.foldingStateMemento.collapsedRegions)return this.rangeProvider=new XQ(e,this.foldingStateMemento.collapsedRegions,()=>{this.foldingStateMemento=null,this.onFoldingStrategyChanged()},3e4);t.length>0&&(this.rangeProvider=new GQ(e,t,()=>this.onModelContentChanged()))}return this.foldingStateMemento=null,this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onModelContentChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;let t=this.foldingRegionPromise=fi(i=>this.getRangeProvider(e.textModel).compute(i));return t.then(i=>{if(i&&t===this.foldingRegionPromise){let n=this.editor.getSelections(),o=n?n.map(r=>r.startLineNumber):[];e.update(i,o)}return e})}).then(void 0,e=>(ve(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){let t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){let i=this.editor.getSelections();if(i&&i.length>0){let n=[];for(let o of i){let r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&n.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),this.reveal(i[0].getPosition()))}}}).then(void 0,ve)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:const n=e.target.detail,o=e.target.element.offsetLeft;if(n.offsetX-o<5)return;i=!0;break;case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){let a=this.editor.getModel();if(a&&t.startColumn===a.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.getFoldingModel();if(!t||!this.mouseDownInfo||!e.target)return;let i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(!(!o||o.startLineNumber!==i)){if(n){if(e.target.type!==4)return}else{let r=this.editor.getModel();if(!r||o.startColumn!==r.getLineMaxColumn(i))return}t.then(r=>{if(r){let a=r.getRegionAtLine(i);if(a&&a.startLineNumber===i){let l=a.isCollapsed;if(n||l){let d=e.event.altKey,c=[];if(d){let h=f=>!f.containedBy(a)&&!a.containedBy(f),u=r.getRegionsInside(null,h);for(const f of u)f.isCollapsed&&c.push(f);c.length===0&&(c=u)}else{let h=e.event.middleButton||e.event.shiftKey;if(h)for(const u of r.getRegionsInside(a))u.isCollapsed===l&&c.push(u);(l||!h||c.length===0)&&c.push(a)}r.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}}).then(void 0,ve)}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};dh.ID="editor.contrib.folding";dh=QQ([JQ(1,we)],dh);class os extends ne{runEditorCommand(e,t,i){let n=dh.get(t);if(!n)return;let o=n.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(r=>{if(r){this.invoke(n,r,t,i);const a=t.getSelection();a&&n.reveal(a.getStartPosition())}})}getSelectedLines(e){let t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function aP(s){if(!ji(s)){if(!tn(s))return!1;const e=s;if(!ji(e.levels)&&!Ml(e.levels)||!ji(e.direction)&&!es(e.direction)||!ji(e.selectionLines)&&(!YM(e.selectionLines)||!e.selectionLines.every(Ml)))return!1}return!0}class eJ extends os{constructor(){super({id:"editor.unfold",label:p("unfoldAction.label","Unfold"),alias:"Unfold",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:3161,mac:{primary:2649},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument:
* 'levels': Number of levels to unfold. If not set, defaults to 1.
* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
* 'selectionLines': 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:aP,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){let o=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?tP(t,!1,o,r):Ih(t,!1,o,r)}}class tJ extends os{constructor(){super({id:"editor.unfoldRecursively",label:p("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2137),weight:100}})}invoke(e,t,i,n){Ih(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class iJ extends os{constructor(){super({id:"editor.fold",label:p("foldAction.label","Fold"),alias:"Fold",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:3159,mac:{primary:2647},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument:
* 'levels': Number of levels to fold.
* 'direction': If 'up', folds given number of levels up otherwise folds down.
* 'selectionLines': 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:aP,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){let o=this.getLineNumbers(n,i);const r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?FQ(t,!0,o):a==="up"?tP(t,!0,r||1,o):Ih(t,!0,r||1,o)}}class nJ extends os{constructor(){super({id:"editor.toggleFold",label:p("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2090),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);PQ(t,1,n)}}class sJ extends os{constructor(){super({id:"editor.foldRecursively",label:p("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2135),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);Ih(t,!0,Number.MAX_VALUE,n)}}class oJ extends os{constructor(){super({id:"editor.foldAllBlockComments",label:p("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2133),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())SD(t,Po.Comment.value,!0);else{const n=i.getModel();if(!n)return;let o=xe.getComments(n.getLanguageIdentifier().id);if(o&&o.blockCommentStartToken){let r=new RegExp("^\\s*"+Ys(o.blockCommentStartToken));CD(t,r,!0)}}}}class rJ extends os{constructor(){super({id:"editor.foldAllMarkerRegions",label:p("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2077),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())SD(t,Po.Region.value,!0);else{const n=i.getModel();if(!n)return;let o=xe.getFoldingRules(n.getLanguageIdentifier().id);if(o&&o.markers&&o.markers.start){let r=new RegExp(o.markers.start);CD(t,r,!0)}}}}class aJ extends os{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:p("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2078),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())SD(t,Po.Region.value,!1);else{const n=i.getModel();if(!n)return;let o=xe.getFoldingRules(n.getLanguageIdentifier().id);if(o&&o.markers&&o.markers.start){let r=new RegExp(o.markers.start);CD(t,r,!1)}}}}class lJ extends os{constructor(){super({id:"editor.foldAllExcept",label:p("foldAllExcept.label","Fold All Regions Except Selected"),alias:"Fold All Regions Except Selected",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2131),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);iP(t,!0,n)}}class dJ extends os{constructor(){super({id:"editor.unfoldAllExcept",label:p("unfoldAllExcept.label","Unfold All Regions Except Selected"),alias:"Unfold All Regions Except Selected",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2129),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);iP(t,!1,n)}}class cJ extends os{constructor(){super({id:"editor.foldAll",label:p("foldAllAction.label","Fold All"),alias:"Fold All",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2069),weight:100}})}invoke(e,t,i){Ih(t,!0)}}class hJ extends os{constructor(){super({id:"editor.unfoldAll",label:p("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2088),weight:100}})}invoke(e,t,i){Ih(t,!1)}}class td extends os{getFoldingLevel(){return parseInt(this.id.substr(td.ID_PREFIX.length))}invoke(e,t,i){BQ(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}td.ID_PREFIX="editor.foldLevel";td.ID=s=>td.ID_PREFIX+s;Xe(dh.ID,dh);Q(eJ);Q(tJ);Q(iJ);Q(sJ);Q(cJ);Q(hJ);Q(oJ);Q(rJ);Q(aJ);Q(lJ);Q(dJ);Q(nJ);for(let s=1;s<=7;s++)XT(new td({id:td.ID(s),label:p("foldLevelAction.label","Fold Level {0}",s),alias:`Fold Level ${s}`,precondition:zn,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2048|21+s),weight:100}}));const uJ=T("editor.foldBackground",{light:ui(ha,.3),dark:ui(ha,.3),hc:null},p("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0),fJ=T("editorGutter.foldingControlForeground",{dark:kw,light:kw,hc:kw},p("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));tt((s,e)=>{const t=s.getColor(uJ);t&&e.addRule(`.monaco-editor .folded-background { background-color: ${t}; }`);const i=s.getColor(fJ);i&&e.addRule(`
.monaco-editor .cldr${wt.asCSSSelector(yD)},
.monaco-editor .cldr${wt.asCSSSelector(LD)} {
color: ${i} !important;
}
`)});class gJ extends ne{constructor(){super({id:"editor.action.fontZoomIn",label:p("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){Dr.setZoomLevel(Dr.getZoomLevel()+1)}}class pJ extends ne{constructor(){super({id:"editor.action.fontZoomOut",label:p("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){Dr.setZoomLevel(Dr.getZoomLevel()-1)}}class mJ extends ne{constructor(){super({id:"editor.action.fontZoomReset",label:p("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){Dr.setZoomLevel(0)}}Q(gJ);Q(pJ);Q(mJ);var lP=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},dP=function(s,e){return function(t,i){e(t,i,s)}},xD=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let Vf=class{constructor(e,t){this._workerService=t,this._callOnDispose=new X,this._callOnModel=new X,this._editor=e,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(Rm.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){if(this._callOnModel.clear(),!this._editor.getOption(45)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=Rm.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;let i=new oc;for(let n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._callOnModel.add(this._editor.onDidType(n=>{let o=n.charCodeAt(n.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1)return;const t=this._editor.getModel(),i=this._editor.getPosition();let n=!1;const o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){n=!0,o.dispose();return}for(let a=0,l=r.changes.length;a<l;a++)if(r.changes[a].range.endLineNumber<=i.lineNumber){n=!0,o.dispose();return}});l2(this._workerService,t,i,e,t.getFormattingOptions()).then(r=>{o.dispose(),!n&&vn(r)&&(eh.execute(this._editor,r,!0),Qx(r))},r=>{throw o.dispose(),r})}};Vf.ID="editor.contrib.autoFormat";Vf=lP([dP(1,Ms)],Vf);let Hf=class{constructor(e,t){this.editor=e,this._instantiationService=t,this._callOnDispose=new X,this._callOnModel=new X,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(Us.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(44)&&this.editor.hasModel()&&Us.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(a2,this.editor,e,2,Cd.None,Fe.None).catch(ve))}};Hf.ID="editor.contrib.formatOnPaste";Hf=lP([dP(1,qe)],Hf);class _J extends ne{constructor(){super({id:"editor.action.formatDocument",label:p("formatDocument.label","Format Document"),alias:"Format Document",precondition:J.and(I.notInCompositeEditor,I.writable,I.hasDocumentFormattingProvider),kbOpts:{kbExpr:I.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return xD(this,void 0,void 0,function*(){if(t.hasModel()){const i=e.get(qe);yield e.get(Rr).showWhile(i.invokeFunction(Pq,t,1,Cd.None,Fe.None),250)}})}}class bJ extends ne{constructor(){super({id:"editor.action.formatSelection",label:p("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:J.and(I.writable,I.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2084),weight:100},contextMenuOpts:{when:I.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return xD(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(qe),n=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new L(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);yield e.get(Rr).showWhile(i.invokeFunction(a2,t,o,1,Cd.None,Fe.None),250)})}}Xe(Vf.ID,Vf);Xe(Hf.ID,Hf);Q(_J);Q(bJ);He.registerCommand("editor.action.format",s=>xD(void 0,void 0,void 0,function*(){const e=s.get(Ge).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=s.get(Wt);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));class uc{remove(){this.parent&&this.parent.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let o=0;t.children.get(n)!==void 0;o++)n=`${i}_${o}`;return n}static empty(e){return e.children.size===0}}class UN extends uc{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class vJ extends uc{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class Ui extends uc{constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}static create(e,t){let i=this._keys.for(e,!0),n=Ui._requests.get(i);if(!n){let o=new on;n={promiseCnt:0,source:o,promise:Ui._create(e,o.token),model:void 0},Ui._requests.set(i,n);const r=Date.now();n.promise.then(()=>{this._requestDurations.update(e,Date.now()-r)})}return n.model?Promise.resolve(n.model):(n.promiseCnt+=1,t.onCancellationRequested(()=>{--n.promiseCnt===0&&(n.source.cancel(),Ui._requests.delete(i))}),new Promise((o,r)=>{n.promise.then(a=>{n.model=a,o(a)},a=>{Ui._requests.delete(i),r(a)})}))}static _create(e,t){const i=new on(t),n=new Ui(e.uri),o=ws.ordered(e),r=o.map((l,d)=>{var c;let h=uc.findId(`provider_${d}`,n),u=new vJ(h,n,(c=l.displayName)!==null&&c!==void 0?c:"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(e,i.token)).then(f=>{for(const g of f||[])Ui._makeOutlineElement(g,u);return u},f=>(gi(f),u)).then(f=>{uc.empty(f)?f.remove():n._groups.set(h,f)})}),a=ws.onDidChange(()=>{const l=ws.ordered(e);Ss(l,o)||i.cancel()});return Promise.all(r).then(()=>i.token.isCancellationRequested&&!t.isCancellationRequested?Ui._create(e,t):n._compact()).finally(()=>{a.dispose()})}static _makeOutlineElement(e,t){let i=uc.findId(e,t),n=new UN(i,t,e);if(e.children)for(const o of e.children)Ui._makeOutlineElement(o,n);t.children.set(n.id,n)}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{let t=Be.first(this._groups.values());for(let[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof UN?e.push(t.symbol):e.push(...Be.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>L.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Ui._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>L.compareRangesUsingStarts(i.range,n.range))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&Ui._flattenDocumentSymbols(e,n.children,n.name)}}Ui._requestDurations=new Dm(ws,350);Ui._requests=new ud(9,.75);Ui._keys=new class{constructor(){this._counter=1,this._data=new WeakMap}for(s,e){return`${s.id}/${e?s.getVersionId():""}/${this._hash(ws.all(s))}`}_hash(s){let e="";for(const t of s){let i=this._data.get(t);typeof i>"u"&&(i=this._counter++,this._data.set(t,i)),e+=i}return e}};var cP=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function $N(s,e,t){return cP(this,void 0,void 0,function*(){return(yield Ui.create(s,t)).getTopLevelSymbols()})}He.registerCommand("_executeDocumentSymbolProvider",function(s,...e){return cP(this,void 0,void 0,function*(){const[t]=e;nt(he.isUri(t));const i=s.get(Vt).getModel(t);if(i)return $N(i,!1,Fe.None);const n=yield s.get(Xs).createModelReference(t);try{return yield $N(n.object.textEditorModel,!1,Fe.None)}finally{n.dispose()}})});function hn(s,e){let t=0;for(let i=0;i<s.length;i++)s.charAt(i)===" "?t+=e:t++;return t}function Hu(s,e,t){s=s<0?0:s;let i="";if(!t){let n=Math.floor(s/e);s=s%e;for(let o=0;o<n;o++)i+=" "}for(let n=0;n<s;n++)i+=" ";return i}function hP(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return[];let n=xe.getIndentationRules(s.getLanguageIdentifier().id);if(!n)return[];for(t=Math.min(t,s.getLineCount());e<=t&&n.unIndentedLinePattern;){let m=s.getLineContent(e);if(!n.unIndentedLinePattern.test(m))break;e++}if(e>t-1)return[];const{tabSize:o,indentSize:r,insertSpaces:a}=s.getOptions(),l=(m,b)=>(b=b||1,Nn.shiftIndent(m,m.length+b,o,r,a)),d=(m,b)=>(b=b||1,Nn.unshiftIndent(m,m.length+b,o,r,a));let c=[],h,u=s.getLineContent(e),f=u;h=ct(u);let g=h;n.increaseIndentPattern&&n.increaseIndentPattern.test(f)?(g=l(g),h=l(h)):n.indentNextLinePattern&&n.indentNextLinePattern.test(f)&&(g=l(g)),e++;for(let m=e;m<=t;m++){let b=s.getLineContent(m),v=ct(b),_=g+b.substring(v.length);n.decreaseIndentPattern&&n.decreaseIndentPattern.test(_)&&(g=d(g),h=d(h)),v!==g&&c.push(Bt.replaceMove(new ee(m,1,m,v.length+1),si.normalizeIndentation(g,r,a))),!(n.unIndentedLinePattern&&n.unIndentedLinePattern.test(b))&&(n.increaseIndentPattern&&n.increaseIndentPattern.test(_)?(h=l(h),g=h):n.indentNextLinePattern&&n.indentNextLinePattern.test(_)?g=l(g):g=h)}return c}class xv extends ne{constructor(){super({id:xv.ID,label:p("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:I.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new yJ(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}xv.ID="editor.action.indentationToSpaces";class Dv extends ne{constructor(){super({id:Dv.ID,label:p("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:I.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new LJ(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}Dv.ID="editor.action.indentationToTabs";class uP extends ne{constructor(e,t){super(t),this.insertSpaces=e}run(e,t){const i=e.get(Ha),n=e.get(Vt);let o=t.getModel();if(!o)return;let r=n.getCreationOptions(o.getLanguageIdentifier().language,o.uri,o.isForSimpleWidget);const a=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize?p("configuredTabSize","Configured Tab Size"):void 0})),l=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(a,{placeHolder:p({},"Select Tab Size for Current File"),activeItem:a[l]}).then(d=>{d&&o&&!o.isDisposed()&&o.updateOptions({tabSize:parseInt(d.label,10),insertSpaces:this.insertSpaces})})},50)}}class kv extends uP{constructor(){super(!1,{id:kv.ID,label:p("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}kv.ID="editor.action.indentUsingTabs";class Iv extends uP{constructor(){super(!0,{id:Iv.ID,label:p("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}Iv.ID="editor.action.indentUsingSpaces";class Ev extends ne{constructor(){super({id:Ev.ID,label:p("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(Vt);let n=t.getModel();if(!n)return;let o=i.getCreationOptions(n.getLanguageIdentifier().language,n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}}Ev.ID="editor.action.detectIndentation";class wJ extends ne{constructor(){super({id:"editor.action.reindentlines",label:p("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:I.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=hP(i,1,i.getLineCount());n.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,n),t.pushUndoStop())}}class CJ extends ne{constructor(){super({id:"editor.action.reindentselectedlines",label:p("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:I.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=t.getSelections();if(n===null)return;let o=[];for(let r of n){let a=r.startLineNumber,l=r.endLineNumber;if(a!==l&&r.endColumn===1&&l--,a===1){if(a===l)continue}else a--;let d=hP(i,a,l);o.push(...d)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class SJ{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(let i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(let n of this._edits)t.addEditOperation(L.lift(n.range),n.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class Iy{constructor(e){this.callOnDispose=new X,this.callOnModel=new X,this.editor=e,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(9)<4||this.editor.getOption(44))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){let t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||!i.isCheapToTokenize(e.getStartPosition().lineNumber))return;const n=this.editor.getOption(9),{tabSize:o,indentSize:r,insertSpaces:a}=i.getOptions();let l=[],d={shiftIndent:f=>Nn.shiftIndent(f,f.length+1,o,r,a),unshiftIndent:f=>Nn.unshiftIndent(f,f.length+1,o,r,a)},c=e.startLineNumber;for(;c<=e.endLineNumber;){if(this.shouldIgnoreLine(i,c)){c++;continue}break}if(c>e.endLineNumber)return;let h=i.getLineContent(c);if(!/\S/.test(h.substring(0,e.startColumn-1))){let f=xe.getGoodIndentForLine(n,i,i.getLanguageIdentifier().id,c,d);if(f!==null){let g=ct(h),m=hn(f,o),b=hn(g,o);if(m!==b){let v=Hu(m,o,a);l.push({range:new L(c,1,c,g.length+1),text:v}),h=v+h.substr(g.length)}else{let v=xe.getIndentMetadata(i,c);if(v===0||v===8)return}}}const u=c;for(;c<e.endLineNumber;){if(!/\S/.test(i.getLineContent(c+1))){c++;continue}break}if(c!==e.endLineNumber){let f={getLineTokens:m=>i.getLineTokens(m),getLanguageIdentifier:()=>i.getLanguageIdentifier(),getLanguageIdAtPosition:(m,b)=>i.getLanguageIdAtPosition(m,b),getLineContent:m=>m===u?h:i.getLineContent(m)},g=xe.getGoodIndentForLine(n,f,i.getLanguageIdentifier().id,c+1,d);if(g!==null){let m=hn(g,o),b=hn(ct(i.getLineContent(c+1)),o);if(m!==b){let v=m-b;for(let _=c+1;_<=e.endLineNumber;_++){let w=i.getLineContent(_),C=ct(w),D=hn(C,o)+v,y=Hu(D,o,a);y!==C&&l.push({range:new L(_,1,_,C.length+1),text:y})}}}}if(l.length>0){this.editor.pushUndoStop();let f=new SJ(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.forceTokenization(t);let i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;let n=e.getLineTokens(t);if(n.getCount()>0){let o=n.findTokenIndexAtOffset(i);if(o>=0&&n.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}}Iy.ID="editor.contrib.autoIndentOnPaste";function fP(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let n="";for(let r=0;r<t;r++)n+=" ";let o=new RegExp(n,"gi");for(let r=1,a=s.getLineCount();r<=a;r++){let l=s.getLineFirstNonWhitespaceColumn(r);if(l===0&&(l=s.getLineMaxColumn(r)),l===1)continue;const d=new L(r,1,r,l),c=s.getValueInRange(d),h=i?c.replace(/\t/ig,n):c.replace(o," ");e.addEditOperation(d,h)}}class yJ{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),fP(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class LJ{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),fP(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}Xe(Iy.ID,Iy);Q(xv);Q(Dv);Q(kv);Q(Iv);Q(Ev);Q(wJ);Q(CJ);var xJ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},jN=function(s,e){return function(t,i){e(t,i,s)}},DD=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const DJ=500;function gP(s,e,t){return DD(this,void 0,void 0,function*(){const i=[],n=Qr.ordered(s).reverse(),o=eg(n.map(r=>e.map(a=>Promise.resolve(r.provideInlayHints(s,a,t)).then(l=>{l&&i.push({list:l,provider:r})},l=>{gi(l)}))));return yield Promise.all(o),i})}let zf=class{constructor(e,t,i){this._editor=e,this._codeEditorService=t,this._themeService=i,this._disposables=new X,this._sessionDisposables=new X,this._getInlayHintsDelays=new Dm(Qr,250,2500),this._decorationsTypeIds=[],this._decorationIds=[],this._disposables.add(Qr.onDidChange(()=>this._update())),this._disposables.add(i.onDidColorThemeChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(n=>{n.hasChanged(124)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(124).enabled){this._removeAllDecorations();return}const e=this._editor.getModel();if(!e||!Qr.has(e)){this._removeAllDecorations();return}const t=new bt(()=>DD(this,void 0,void 0,function*(){const n=Date.now(),o=new on;this._sessionDisposables.add(Pe(()=>o.dispose(!0)));const r=this._editor.getVisibleRangesPlusViewportAboveBelow(),a=yield gP(e,r,o.token),l=this._getInlayHintsDelays.update(e,Date.now()-n);t.delay=l,this._updateHintsDecorators(a)}),this._getInlayHintsDelays.get(e));this._sessionDisposables.add(t),this._sessionDisposables.add(this._editor.onDidChangeModelContent(()=>t.schedule())),this._disposables.add(this._editor.onDidScrollChange(()=>t.schedule())),t.schedule();const i=new X;this._sessionDisposables.add(i);for(const n of Qr.all(e))typeof n.onDidChangeInlayHints=="function"&&i.add(n.onDidChangeInlayHints(()=>t.schedule()))}_updateHintsDecorators(e){const{fontSize:t,fontFamily:i}=this._getLayoutInfo(),n=this._themeService.getColorTheme().getColor(n8),o=this._themeService.getColorTheme().getColor(i8),r=[],a=[],l="--inlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(l,i);for(const{list:d}of e)for(let c=0;c<d.length&&a.length<DJ;c++){const{text:h,position:u,whitespaceBefore:f,whitespaceAfter:g}=d[c],m=f?t/3|0:0,b=g?t/3|0:0,v={contentText:h,backgroundColor:`${n}`,color:`${o}`,margin:`0px ${b}px 0px ${m}px`,fontSize:`${t}px`,fontFamily:`var(${l})`,padding:`0px ${t/4|0}px`,borderRadius:`${t/4|0}px`},_="inlayHints-"+sb(v).toString(16);this._codeEditorService.registerDecorationType("inlay-hints-controller",_,{before:v},void 0,this._editor),r.push(_);const w=this._codeEditorService.resolveDecorationOptions(_,!0);a.push({range:L.fromPositions(u),options:w})}this._decorationsTypeIds.forEach(this._codeEditorService.removeDecorationType,this._codeEditorService),this._decorationsTypeIds=r,this._decorationIds=this._editor.deltaDecorations(this._decorationIds,a)}_getLayoutInfo(){const e=this._editor.getOption(124),t=this._editor.getOption(42);let i=e.fontSize;(!i||i<5||i>t)&&(i=t*.9|0);const n=e.fontFamily;return{fontSize:i,fontFamily:n}}_removeAllDecorations(){this._decorationIds=this._editor.deltaDecorations(this._decorationIds,[]),this._decorationsTypeIds.forEach(this._codeEditorService.removeDecorationType,this._codeEditorService),this._decorationsTypeIds=[]}};zf.ID="editor.contrib.InlayHints";zf=xJ([jN(1,Ge),jN(2,pt)],zf);Xe(zf.ID,zf);He.registerCommand("_executeInlayHintProvider",(s,...e)=>DD(void 0,void 0,void 0,function*(){const[t,i]=e;nt(he.isUri(t)),nt(L.isIRange(i));const n=yield s.get(Xs).createModelReference(t);try{const o=yield gP(n.object.textEditorModel,[L.lift(i)],Fe.None);return eg(o.map(r=>r.list)).sort((r,a)=>O.compare(r.position,a.position))}finally{n.dispose()}}));class kJ{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new ee(n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn),n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn)):new ee(n.endLineNumber,n.endColumn-this._text.length,n.endLineNumber,n.endColumn)}}var IJ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},EJ=function(s,e){return function(t,i){e(t,i,s)}};let Ra=class Ey{constructor(e,t){this.decorationIds=[],this.editor=e,this.editorWorkerService=t}static get(e){return e.getContribution(Ey.ID)}dispose(){}run(e,t){this.currentRequest&&this.currentRequest.cancel();const i=this.editor.getSelection(),n=this.editor.getModel();if(!n||!i)return;let o=i;if(o.startLineNumber!==o.endLineNumber)return;const r=new JA(this.editor,5),a=n.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=fi(l=>this.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(l=>{if(!l||!l.range||!l.value||!r.validate(this.editor))return;let d=L.lift(l.range),c=l.range,h=l.value.length-(o.endColumn-o.startColumn);c={startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.startColumn+l.value.length},h>1&&(o=new ee(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+h-1));const u=new kJ(d,o,l.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[{range:c,options:Ey.DECORATION}]),this.decorationRemover&&this.decorationRemover.cancel(),this.decorationRemover=pa(350),this.decorationRemover.then(()=>this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[])).catch(ve)}).catch(ve)):Promise.resolve(void 0)}};Ra.ID="editor.contrib.inPlaceReplaceController";Ra.DECORATION=De.register({description:"in-place-replace",className:"valueSetReplacement"});Ra=IJ([EJ(1,Ms)],Ra);class NJ extends ne{constructor(){super({id:"editor.action.inPlaceReplace.up",label:p("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:3154,weight:100}})}run(e,t){const i=Ra.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}class MJ extends ne{constructor(){super({id:"editor.action.inPlaceReplace.down",label:p("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:3156,weight:100}})}run(e,t){const i=Ra.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}Xe(Ra.ID,Ra);Q(NJ);Q(MJ);tt((s,e)=>{const t=s.getColor(PA);t&&e.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${t}; }`)});class TJ{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){let i=AJ(e,this._cursors);for(let n=0,o=i.length;n<o;n++){let r=i[n];t.addEditOperation(r.range,r.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function AJ(s,e){e.sort((r,a)=>r.lineNumber===a.lineNumber?r.column-a.column:r.lineNumber-a.lineNumber);for(let r=e.length-2;r>=0;r--)e[r].lineNumber===e[r+1].lineNumber&&e.splice(r,1);let t=[],i=0,n=0,o=e.length;for(let r=1,a=s.getLineCount();r<=a;r++){let l=s.getLineContent(r),d=l.length+1,c=0;if(n<o&&e[n].lineNumber===r&&(c=e[n].column,n++,c===d)||l.length===0)continue;let h=xo(l),u=0;if(h===-1)u=1;else if(h!==l.length-1)u=h+2;else continue;u=Math.max(c,u),t[i++]=Bt.delete(new L(r,u,r,d))}return t}class pP{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));let n=[];for(let r=i.startLineNumber;r<=i.endLineNumber;r++)n.push(e.getLineContent(r));const o=n.join(`
`);o===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new L(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
`):this._isCopyingDown?t.addEditOperation(new L(i.startLineNumber,1,i.startLineNumber,1),o+`
`):t.addEditOperation(new L(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),`
`+o),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,o=i.startColumn,r=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,o=1),this._endLineNumberDelta!==0&&(r=r+this._endLineNumberDelta,a=1),i=ee.createWithDirection(n,o,r,a,this._selectionDirection)}return i}}class RJ{constructor(e,t,i){this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){let i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){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 n=this._selection;n.startLineNumber<n.endLineNumber&&n.endColumn===1&&(this._moveEndPositionDown=!0,n=n.setEndPosition(n.endLineNumber-1,e.getLineMaxColumn(n.endLineNumber-1)));const{tabSize:o,indentSize:r,insertSpaces:a}=e.getOptions();let l=this.buildIndentConverter(o,r,a),d={getLineTokens:c=>e.getLineTokens(c),getLanguageIdentifier:()=>e.getLanguageIdentifier(),getLanguageIdAtPosition:(c,h)=>e.getLanguageIdAtPosition(c,h),getLineContent:null};if(n.startLineNumber===n.endLineNumber&&e.getLineMaxColumn(n.startLineNumber)===1){let c=n.startLineNumber,h=this._isMovingDown?c+1:c-1;e.getLineMaxColumn(h)===1?t.addEditOperation(new L(1,1,1,1),null):(t.addEditOperation(new L(c,1,c,1),e.getLineContent(h)),t.addEditOperation(new L(h,1,h,e.getLineMaxColumn(h)),null)),n=new ee(h,1,h,1)}else{let c,h;if(this._isMovingDown){c=n.endLineNumber+1,h=e.getLineContent(c),t.addEditOperation(new L(c-1,e.getLineMaxColumn(c-1),c,e.getLineMaxColumn(c)),null);let u=h;if(this.shouldAutoIndent(e,n)){let f=this.matchEnterRule(e,l,o,c,n.startLineNumber-1);if(f!==null){let m=ct(e.getLineContent(c)),b=f+hn(m,o);u=Hu(b,o,a)+this.trimLeft(h)}else{d.getLineContent=b=>b===n.startLineNumber?e.getLineContent(c):e.getLineContent(b);let m=xe.getGoodIndentForLine(this._autoIndent,d,e.getLanguageIdAtPosition(c,1),n.startLineNumber,l);if(m!==null){let b=ct(e.getLineContent(c)),v=hn(m,o),_=hn(b,o);v!==_&&(u=Hu(v,o,a)+this.trimLeft(h))}}t.addEditOperation(new L(n.startLineNumber,1,n.startLineNumber,1),u+`
`);let g=this.matchEnterRuleMovingDown(e,l,o,n.startLineNumber,c,u);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,n,o,a,g);else{d.getLineContent=b=>b===n.startLineNumber?u:b>=n.startLineNumber+1&&b<=n.endLineNumber+1?e.getLineContent(b-1):e.getLineContent(b);let m=xe.getGoodIndentForLine(this._autoIndent,d,e.getLanguageIdAtPosition(c,1),n.startLineNumber+1,l);if(m!==null){const b=ct(e.getLineContent(n.startLineNumber)),v=hn(m,o),_=hn(b,o);if(v!==_){const w=v-_;this.getIndentEditsOfMovingBlock(e,t,n,o,a,w)}}}}else t.addEditOperation(new L(n.startLineNumber,1,n.startLineNumber,1),u+`
`)}else if(c=n.startLineNumber-1,h=e.getLineContent(c),t.addEditOperation(new L(c,1,c+1,1),null),t.addEditOperation(new L(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),`
`+h),this.shouldAutoIndent(e,n)){d.getLineContent=f=>f===c?e.getLineContent(n.startLineNumber):e.getLineContent(f);let u=this.matchEnterRule(e,l,o,n.startLineNumber,n.startLineNumber-2);if(u!==null)u!==0&&this.getIndentEditsOfMovingBlock(e,t,n,o,a,u);else{let f=xe.getGoodIndentForLine(this._autoIndent,d,e.getLanguageIdAtPosition(n.startLineNumber,1),c,l);if(f!==null){let g=ct(e.getLineContent(n.startLineNumber)),m=hn(f,o),b=hn(g,o);if(m!==b){let v=m-b;this.getIndentEditsOfMovingBlock(e,t,n,o,a,v)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>Nn.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>Nn.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let r=o.indentation;o.indentAction===Ft.None||o.indentAction===Ft.Indent?r=o.indentation+o.appendText:o.indentAction===Ft.IndentOutdent?r=o.indentation:o.indentAction===Ft.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);let a=e.getLineContent(n);if(this.trimLeft(a).indexOf(this.trimLeft(r))>=0){let l=ct(e.getLineContent(n)),d=ct(r),c=xe.getIndentMetadata(e,n);c!==null&&c&2&&(d=t.unshiftIndent(d));let h=hn(d,i),u=hn(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,o,r){if(xo(r)>=0){let a=e.getLineMaxColumn(o),l=xe.getEnterAction(this._autoIndent,e,new L(o,a,o,a));return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){let c=e.getLineContent(a);if(xo(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;let l=e.getLineMaxColumn(a),d=xe.getEnterAction(this._autoIndent,e,new L(a,l,a,l));return this.parseEnterResult(e,t,i,n,d)}}matchEnterRule(e,t,i,n,o,r){let a=o;for(;a>=1;){let c;if(a===o&&r!==void 0?c=r:c=e.getLineContent(a),xo(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;let l=e.getLineMaxColumn(a),d=xe.getEnterAction(this._autoIndent,e,new L(a,l,a,l));return this.parseEnterResult(e,t,i,n,d)}trimLeft(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.isCheapToTokenize(t.startLineNumber))return!1;let i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||xe.getIndentRulesSupport(i)===null)}getIndentEditsOfMovingBlock(e,t,i,n,o,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){let l=e.getLineContent(a),d=ct(l),h=hn(d,n)+r,u=Hu(h,n,o);u!==d&&(t.addEditOperation(new L(a,1,a,d.length+1),u),a===i.endLineNumber&&i.endColumn<=d.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}}class fa{constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}static getCollator(){return fa._COLLATOR||(fa._COLLATOR=new Intl.Collator),fa._COLLATOR}getEditOperations(e,t){let i=OJ(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;let n=mP(e,t,i);if(!n)return!1;for(let o=0,r=n.before.length;o<r;o++)if(n.before[o]!==n.after[o])return!0;return!1}}fa._COLLATOR=null;function mP(s,e,t){let i=e.startLineNumber,n=e.endLineNumber;if(e.endColumn===1&&n--,i>=n)return null;let o=[];for(let a=i;a<=n;a++)o.push(s.getLineContent(a));let r=o.slice(0);return r.sort(fa.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:o,after:r}}function OJ(s,e,t){let i=mP(s,e,t);return i?Bt.replace(new L(i.startLineNumber,1,i.endLineNumber,s.getLineMaxColumn(i.endLineNumber)),i.after.join(`
`)):null}class _P extends ne{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)=>L.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 o=[];for(const r of i)o.push(new pP(r.selection,this.down,r.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class PJ extends _P{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:p("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"2_line",title:p({},"&&Copy Line Up"),order:1}})}}class FJ extends _P{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:p("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"2_line",title:p({},"Co&&py Line Down"),order:2}})}}class BJ extends ne{constructor(){super({id:"editor.action.duplicateSelection",label:p("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:I.writable,menuOpts:{menuId:oe.MenubarSelectionMenu,group:"2_line",title:p({},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],o=t.getSelections(),r=t.getModel();for(const a of o)if(a.isEmpty())n.push(new pP(a,!0));else{const l=new ee(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new p6(l,r.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class bP extends ne{constructor(e,t){super(t),this.down=e}run(e,t){let i=[],n=t.getSelections()||[];const o=t.getOption(9);for(const r of n)i.push(new RJ(r,this.down,o));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class WJ extends bP{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:p("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"2_line",title:p({},"Mo&&ve Line Up"),order:3}})}}class VJ extends bP{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:p("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"2_line",title:p({},"Move &&Line Down"),order:4}})}}class vP extends ne{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const o of i)if(!fa.canRun(t.getModel(),o,this.descending))return;let n=[];for(let o=0,r=i.length;o<r;o++)n[o]=new fa(i[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class HJ extends vP{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:p("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:I.writable})}}class zJ extends vP{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:p("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:I.writable})}}class Nv extends ne{constructor(){super({id:Nv.ID,label:p("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:oi(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(a=>new O(a.positionLineNumber,a.positionColumn)));let o=t.getSelection();if(o===null)return;let r=new TJ(o,n);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop()}}Nv.ID="editor.action.trimTrailingWhitespace";class UJ extends ne{constructor(){super({id:"editor.action.deleteLines",label:p("lines.delete","Delete Line"),alias:"Delete Line",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;let i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let o=0,r=[],a=[];for(let l=0,d=i.length;l<d;l++){const c=i[l];let h=c.startLineNumber,u=c.endLineNumber,f=1,g=n.getLineMaxColumn(u);u<n.getLineCount()?(u+=1,g=1):h>1&&(h-=1,f=n.getLineMaxColumn(h)),r.push(Bt.replace(new ee(h,f,u,g),"")),a.push(new ee(h-o,c.positionColumn,h-o,c.positionColumn)),o+=c.endLineNumber-c.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){let t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumber<o.endLineNumber&&o.endColumn===1&&(r-=1),{startLineNumber:o.startLineNumber,selectionStartColumn:o.selectionStartColumn,endLineNumber:r,positionColumn:o.positionColumn}});t.sort((o,r)=>o.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);let i=[],n=t[0];for(let o=1;o<t.length;o++)n.endLineNumber+1>=t[o].startLineNumber?n.endLineNumber=t[o].endLineNumber:(i.push(n),n=t[o]);return i.push(n),i}}class $J extends ne{constructor(){super({id:"editor.action.indentLines",label:p("lines.indent","Indent Line"),alias:"Indent Line",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:2137,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Ct.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class jJ extends ne{constructor(){super({id:"editor.action.outdentLines",label:p("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:2135,weight:100}})}run(e,t){Ic.Outdent.runEditorCommand(e,t,null)}}class qJ extends ne{constructor(){super({id:"editor.action.insertLineBefore",label:p("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Ct.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class KJ extends ne{constructor(){super({id:"editor.action.insertLineAfter",label:p("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Ct.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class wP extends ne{run(e,t){if(!t.hasModel())return;const i=t.getSelection();let n=this._getRangesToDelete(t),o=[];for(let l=0,d=n.length-1;l<d;l++){let c=n[l],h=n[l+1];L.intersectRanges(c,h)===null?o.push(c):n[l+1]=L.plusRange(c,h)}o.push(n[n.length-1]);let r=this._getEndCursorState(i,o),a=o.map(l=>Bt.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class GJ extends wP{constructor(){super({id:"deleteAllLeft",label:p("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null,n=[],o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){let l=r.startLineNumber-o;a=new ee(l,r.startColumn,l,r.startColumn)}else a=new ee(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:n.push(a)}),i&&n.unshift(i),n}_getRangesToDelete(e){let t=e.getSelections();if(t===null)return[];let i=t,n=e.getModel();return n===null?[]:(i.sort(L.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){let r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:n.getLineContent(r).length+1;return new L(r,a,o.startLineNumber,1)}else return new L(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new L(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class ZJ extends wP{constructor(){super({id:"deleteAllRight",label:p("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null,n=[];for(let o=0,r=t.length,a=0;o<r;o++){let l=t[o],d=new ee(l.startLineNumber-a,l.startColumn,l.startLineNumber-a,l.startColumn);l.intersectRanges(e)?i=d:n.push(d)}return i&&n.unshift(i),n}_getRangesToDelete(e){let t=e.getModel();if(t===null)return[];let i=e.getSelections();if(i===null)return[];let n=i.map(o=>{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new L(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new L(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return n.sort(L.compareRangesUsingStarts),n}}class YJ extends ne{constructor(){super({id:"editor.action.joinLines",label:p("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){let i=t.getSelections();if(i===null)return;let n=t.getSelection();if(n===null)return;i.sort(L.compareRangesUsingStarts);let o=[],r=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(n.equalsSelection(u)&&(n=f),f):f.startLineNumber>u.endLineNumber+1?(o.push(u),f):new ee(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new ee(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);let a=t.getModel();if(a===null)return;let l=[],d=[],c=n,h=0;for(let u=0,f=o.length;u<f;u++){let g=o[u],m=g.startLineNumber,b=1,v=0,_,w,C=a.getLineContent(g.endLineNumber).length-g.endColumn;if(g.isEmpty()||g.startLineNumber===g.endLineNumber){let y=g.getStartPosition();y.lineNumber<a.getLineCount()?(_=m+1,w=a.getLineMaxColumn(_)):(_=y.lineNumber,w=a.getLineMaxColumn(y.lineNumber))}else _=g.endLineNumber,w=a.getLineMaxColumn(_);let S=a.getLineContent(m);for(let y=m+1;y<=_;y++){let x=a.getLineContent(y),E=a.getLineFirstNonWhitespaceColumn(y);if(E>=1){let P=!0;S===""&&(P=!1),P&&(S.charAt(S.length-1)===" "||S.charAt(S.length-1)===" ")&&(P=!1,S=S.replace(/[\s\uFEFF\xA0]+$/g," "));let A=x.substr(E-1);S+=(P?" ":"")+A,P?v=A.length+1:v=A.length}else v=0}let D=new L(m,b,_,w);if(!D.isEmpty()){let y;g.isEmpty()?(l.push(Bt.replace(D,S)),y=new ee(D.startLineNumber-h,S.length-v+1,m-h,S.length-v+1)):g.startLineNumber===g.endLineNumber?(l.push(Bt.replace(D,S)),y=new ee(g.startLineNumber-h,g.startColumn,g.endLineNumber-h,g.endColumn)):(l.push(Bt.replace(D,S)),y=new ee(g.startLineNumber-h,g.startColumn,g.startLineNumber-h,S.length-C)),L.intersectRanges(D,n)!==null?c=y:d.push(y)}h+=D.endLineNumber-D.startLineNumber}d.unshift(c),t.pushUndoStop(),t.executeEdits(this.id,l,d),t.pushUndoStop()}}class XJ extends ne{constructor(){super({id:"editor.action.transpose",label:p("editor.transpose","Transpose characters around the cursor"),alias:"Transpose characters around the cursor",precondition:I.writable})}run(e,t){let i=t.getSelections();if(i===null)return;let n=t.getModel();if(n===null)return;let o=[];for(let r=0,a=i.length;r<a;r++){let l=i[r];if(!l.isEmpty())continue;let d=l.getStartPosition(),c=n.getLineMaxColumn(d.lineNumber);if(d.column>=c){if(d.lineNumber===n.getLineCount())continue;let h=new L(d.lineNumber,Math.max(1,d.column-1),d.lineNumber+1,1),u=n.getValueInRange(h).split("").reverse().join("");o.push(new mi(new ee(d.lineNumber,Math.max(1,d.column-1),d.lineNumber+1,1),u))}else{let h=new L(d.lineNumber,Math.max(1,d.column-1),d.lineNumber,d.column+1),u=n.getValueInRange(h).split("").reverse().join("");o.push(new sx(h,u,new ee(d.lineNumber,d.column+1,d.lineNumber,d.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class Mv extends ne{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=t.getOption(114),r=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),d=t.getConfiguredWordAtPosition(l);if(!d)continue;const c=new L(l.lineNumber,d.startColumn,l.lineNumber,d.endColumn),h=n.getValueInRange(c);r.push(Bt.replace(c,this._modifyText(h,o)))}else{const l=n.getValueInRange(a);r.push(Bt.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class QJ extends Mv{constructor(){super({id:"editor.action.transformToUppercase",label:p("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:I.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class JJ extends Mv{constructor(){super({id:"editor.action.transformToLowercase",label:p("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:I.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class eee extends Mv{constructor(){super({id:"editor.action.transformToTitlecase",label:p("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:I.writable})}_modifyText(e,t){const n=(`\r
`+t).split("");let o="",r=!0;for(let a=0;a<e.length;a++){let l=e[a];n.indexOf(l)>=0?(r=!0,o+=l):r?(r=!1,o+=l.toLocaleUpperCase()):o+=l.toLocaleLowerCase()}return o}}class CP{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class ga extends Mv{constructor(){super({id:"editor.action.transformToSnakecase",label:p("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:I.writable})}_modifyText(e,t){const i=ga.regExp1.get(),n=ga.regExp2.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}}ga.regExp1=new CP("(\\p{Ll})(\\p{Lu})","gmu");ga.regExp2=new CP("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");Q(PJ);Q(FJ);Q(BJ);Q(WJ);Q(VJ);Q(HJ);Q(zJ);Q(Nv);Q(UJ);Q($J);Q(jJ);Q(qJ);Q(KJ);Q(GJ);Q(ZJ);Q(YJ);Q(XJ);Q(QJ);Q(JJ);Q(eee);ga.regExp1.isSupported()&&ga.regExp2.isSupported()&&Q(ga);var tee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},iee=function(s,e){return function(t,i){e(t,i,s)}},Ny=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const SP=new se("LinkedEditingInputVisible",!1),yP="linked-editing-decoration";let Oa=class My extends U{constructor(e,t){super(),this._debounceDuration=200,this._localToDispose=this._register(new X),this._editor=e,this._enabled=!1,this._visibleContextKey=SP.bindTo(t),this._currentDecorations=[],this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new X),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(i=>{(i.hasChanged(59)||i.hasChanged(79))&&this.reinitialize(!1)})),this._register(Nm.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}static get(e){return e.getContribution(My.ID)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(59)||this._editor.getOption(79))&&Nm.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._languageWordPattern=xe.getWordDefinition(t.getLanguageIdentifier().id),this._localToDispose.add(t.onDidChangeLanguageConfiguration(()=>{this._languageWordPattern=xe.getWordDefinition(t.getLanguageIdentifier().id)}));const n=new yr(this._debounceDuration),o=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration)},r=new yr(0),a=l=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const d=t.getDecorationRange(this._currentDecorations[0]);if(d&&l.changes.every(c=>d.intersectRanges(c.range))){a(this._currentDecorations);return}}o()})),this._localToDispose.add({dispose:()=>{n.cancel(),r.cancel()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._currentDecorations||e.length===0)return;const t=this._editor.getModel(),i=t.getDecorationRange(e[0]);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const n=t.getValueInRange(i);if(this._currentWordPattern){const r=n.match(this._currentWordPattern);if((r?r[0].length:0)!==n.length)return this.clearRanges()}let o=[];for(let r=1,a=e.length;r<a;r++){const l=t.getDecorationRange(e[r]);if(l)if(l.startLineNumber!==l.endLineNumber)o.push({range:l,text:n});else{let d=t.getValueInRange(l),c=n,h=l.startColumn,u=l.endColumn;const f=ju(d,c);h+=f,d=d.substr(f),c=c.substr(f);const g=X0(d,c);u-=g,d=d.substr(0,d.length-g),c=c.substr(0,c.length-g),(h!==u||c.length!==0)&&o.push({range:new L(l.startLineNumber,h,l.endLineNumber,u),text:c})}}if(o.length!==0)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const r=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(r)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations=this._editor.deltaDecorations(this._currentDecorations,[]),this._currentRequest&&(this._currentRequest.cancel(),this._currentRequest=null,this._currentRequestPosition=null)}updateRanges(e=!1){return Ny(this,void 0,void 0,function*(){if(!this._editor.hasModel()){this.clearRanges();return}const t=this._editor.getPosition();if(!this._enabled&&!e||this._editor.getSelections().length>1){this.clearRanges();return}const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations&&this._currentDecorations.length>0){const r=i.getDecorationRange(this._currentDecorations[0]);if(r&&r.containsPosition(t))return}}this._currentRequestPosition=t,this._currentRequestModelVersion=n;const o=fi(r=>Ny(this,void 0,void 0,function*(){try{const a=yield LP(i,t,r);if(o!==this._currentRequest||(this._currentRequest=null,n!==i.getVersionId()))return;let l=[];a!=null&&a.ranges&&(l=a.ranges),this._currentWordPattern=(a==null?void 0:a.wordPattern)||this._languageWordPattern;let d=!1;for(let h=0,u=l.length;h<u;h++)if(L.containsPosition(l[h],t)){if(d=!0,h!==0){const f=l[h];l.splice(h,1),l.unshift(f)}break}if(!d){this.clearRanges();return}const c=l.map(h=>({range:h,options:My.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations=this._editor.deltaDecorations(this._currentDecorations,c)}catch(a){Vo(a)||ve(a),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};Oa.ID="editor.contrib.linkedEditing";Oa.DECORATION=De.register({description:"linked-editing",stickiness:0,className:yP});Oa=tee([iee(1,we)],Oa);class nee extends ne{constructor(){super({id:"editor.action.linkedEditing",label:p("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:J.and(I.writable,I.hasRenameProvider),kbOpts:{kbExpr:I.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(Ge),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return he.isUri(n)&&O.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},ve):super.runCommand(e,t)}run(e,t){const i=Oa.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const see=Di.bindToContribution(Oa.get);G(new see({id:"cancelLinkedEditingInput",precondition:SP,handler:s=>s.clearRanges(),kbOpts:{kbExpr:I.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function LP(s,e,t){const i=Nm.ordered(s);return DM(i.map(n=>()=>Ny(this,void 0,void 0,function*(){try{return yield n.provideLinkedEditingRanges(s,e,t)}catch(o){gi(o);return}})),n=>!!n&&vn(n==null?void 0:n.ranges))}const oee=T("editor.linkedEditingBackground",{dark:B.fromHex("#f00").transparent(.3),light:B.fromHex("#f00").transparent(.3),hc:B.fromHex("#f00").transparent(.3)},p("editorLinkedEditingBackground","Background color when the editor auto renames on type."));tt((s,e)=>{const t=s.getColor(oee);t&&e.addRule(`.monaco-editor .${yP} { background: ${t}; border-left-color: ${t}; }`)});Ar("_executeLinkedEditingProvider",(s,e)=>LP(s,e,Fe.None));Xe(Oa.ID,Oa);Q(nee);var xP=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class ree{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}resolve(e){return xP(this,void 0,void 0,function*(){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))})}}class j_{constructor(e){this._disposables=new X;let t=[];for(const[i,n]of e){const o=i.links.map(r=>new ree(r,n));t=j_._union(t,o),Vy(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){let i=[],n,o,r,a;for(n=0,r=0,o=e.length,a=t.length;n<o&&r<a;){const l=e[n],d=t[r];if(L.areIntersectingOrTouching(l.range,d.range)){n++;continue}L.compareRangesUsingStarts(l.range,d.range)<0?(i.push(l),n++):(i.push(d),r++)}for(;n<o;n++)i.push(e[n]);for(;r<a;r++)i.push(t[r]);return i}}function DP(s,e){const t=[],i=Yu.ordered(s).reverse().map((n,o)=>Promise.resolve(n.provideLinks(s,e)).then(r=>{r&&(t[o]=[r,n])},gi));return Promise.all(i).then(()=>{const n=new j_(fd(t));return e.isCancellationRequested?(n.dispose(),new j_([])):n})}He.registerCommand("_executeLinkProvider",(s,...e)=>xP(void 0,void 0,void 0,function*(){let[t,i]=e;nt(t instanceof he),typeof i!="number"&&(i=0);const n=s.get(Vt).getModel(t);if(!n)return[];const o=yield DP(n,Fe.None);if(!o)return[];for(let a=0;a<Math.min(i,o.links.length);a++)yield o.links[a].resolve(Fe.None);const r=o.links.slice(0);return o.dispose(),r}));var aee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qN=function(s,e){return function(t,i){e(t,i,s)}},lee=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function dee(s,e){const t=s.url&&/^command:/i.test(s.url.toString()),i=s.tooltip?s.tooltip:t?p("links.navigate.executeCmd","Execute command"):p("links.navigate.follow","Follow link"),n=e?Re?p("links.navigate.kb.meta.mac","cmd + click"):p("links.navigate.kb.meta","ctrl + click"):Re?p("links.navigate.kb.alt.mac","option + click"):p("links.navigate.kb.alt","alt + click");if(s.url){let o="";if(/^command:/i.test(s.url.toString())){const a=s.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=` "${p("tooltip.explanation","Execute command {0}",l)}"`}}return new Ia("",!0).appendMarkdown(`[${i}](${s.url.toString(!0)}${o}) (${n})`)}else return new Ia().appendText(`${i} (${n})`)}const KN={general:De.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:De.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Ac{constructor(e,t){this.link=e,this.decorationId=t}static decoration(e,t){return{range:e.range,options:Ac._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n=Object.assign({},i?KN.active:KN.general);return n.hoverMessage=dee(e,t),n}activate(e,t){e.changeDecorationOptions(this.decorationId,Ac._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Ac._getOptions(this.link,t,!1))}}let id=class Ty{constructor(e,t,i){this.listenersToRemove=new X,this.editor=e,this.openerService=t,this.notificationService=i;let n=new VO(e);this.listenersToRemove.add(n),this.listenersToRemove.add(n.onMouseMoveOrRelevantKeyDown(([o,r])=>{this._onEditorMouseMove(o,r)})),this.listenersToRemove.add(n.onExecute(o=>{this.onEditorMouseUp(o)})),this.listenersToRemove.add(n.onCancel(o=>{this.cleanUpActiveLinkDecoration()})),this.enabled=e.getOption(60),this.listenersToRemove.add(e.onDidChangeConfiguration(o=>{const r=e.getOption(60);this.enabled!==r&&(this.enabled=r,this.updateDecorations([]),this.stop(),this.beginCompute())})),this.listenersToRemove.add(e.onDidChangeModelContent(o=>this.onChange())),this.listenersToRemove.add(e.onDidChangeModel(o=>this.onModelChanged())),this.listenersToRemove.add(e.onDidChangeModelLanguage(o=>this.onModelModeChanged())),this.listenersToRemove.add(Yu.onDidChange(o=>this.onModelModeChanged())),this.timeout=new an,this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null,this.beginCompute()}static get(e){return e.getContribution(Ty.ID)}onModelChanged(){this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.beginCompute()}onModelModeChanged(){this.stop(),this.beginCompute()}onChange(){this.timeout.setIfNotSet(()=>this.beginCompute(),Ty.RECOMPUTE_TIME)}beginCompute(){return lee(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.enabled)return;const e=this.editor.getModel();if(Yu.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=fi(t=>DP(e,t));try{this.activeLinksList=yield this.computePromise,this.updateDecorations(this.activeLinksList.links)}catch(t){ve(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(67)==="altKey";let i=[],n=Object.keys(this.currentOccurrences);for(let a=0,l=n.length;a<l;a++){let d=n[a],c=this.currentOccurrences[d];i.push(c.decorationId)}let o=[];if(e)for(const a of e)o.push(Ac.decoration(a,t));let r=this.editor.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let a=0,l=r.length;a<l;a++){let d=new Ac(e[a],r[a]);this.currentOccurrences[d.decorationId]=d}}_onEditorMouseMove(e,t){const i=this.editor.getOption(67)==="altKey";if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const n=this.getLinkOccurrence(e.target.position);n&&this.editor.changeDecorations(o=>{n.activate(o,i),this.activeLinkDecorationId=n.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(67)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:n}=e;n.resolve(Fe.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Oe.file&&o.startsWith(`${Oe.file}:`)){const a=he.parse(o);if(a.scheme===Oe.file){const l=Ip(a);let d=null;l.startsWith("/./")?d=`.${l.substr(1)}`:l.startsWith("//./")&&(d=`.${l.substr(2)}`),d&&(o=Z5(r,d))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(p("invalid.url","Failed to open this link because it is not well-formed: {0}",n.url.toString())):r==="missing"?this.notificationService.warn(p("missing.url","Failed to open this link because its target is missing.")):ve(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const n=this.currentOccurrences[i.id];if(n)return n}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.timeout.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){this.listenersToRemove.dispose(),this.stop(),this.timeout.dispose()}};id.ID="editor.linkDetector";id.RECOMPUTE_TIME=1e3;id=aee([qN(1,Oo),qN(2,Qt)],id);class cee extends ne{constructor(){super({id:"editor.action.openLink",label:p("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){let i=id.get(t);if(!i||!t.hasModel())return;let n=t.getSelections();for(let o of n){let r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}Xe(id.ID,id);Q(cee);tt((s,e)=>{const t=s.getColor(tx);t&&e.addRule(`.monaco-editor .detected-link-active { color: ${t} !important; }`)});function Eh(s,e){const t=e.filter(i=>!s.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),n=t.length===1?p("cursorAdded","Cursor added: {0}",i):p("cursorsAdded","Cursors added: {0}",i);Xm(n)}}class hee extends ne{constructor(){super({id:"editor.action.insertCursorAbove",label:p("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"3_multi",title:p({},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;const n=i&&i.logicalLine===!0,o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,ai.addCursorUp(o,r,n)),o.revealTopMostCursor(i.source),Eh(r,o.getCursorStates())}}class uee extends ne{constructor(){super({id:"editor.action.insertCursorBelow",label:p("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"3_multi",title:p({},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;const n=i&&i.logicalLine===!0,o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,ai.addCursorDown(o,r,n)),o.revealBottomMostCursor(i.source),Eh(r,o.getCursorStates())}}class fee extends ne{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:p("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"3_multi",title:p({},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n<e.endLineNumber;n++){let o=t.getLineMaxColumn(n);i.push(new ee(n,o,n,o))}e.endColumn>1&&i.push(new ee(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates();let a=[];n.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),Eh(r,o.getCursorStates())}}class gee extends ne{constructor(){super({id:"editor.action.addCursorsToBottom",label:p("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount();let o=[];for(let l=i[0].startLineNumber;l<=n;l++)o.push(new ee(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),Eh(a,r.getCursorStates())}}class pee extends ne{constructor(){super({id:"editor.action.addCursorsToTop",label:p("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections();let n=[];for(let a=i[0].startLineNumber;a>=1;a--)n.push(new ee(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();n.length>0&&t.setSelections(n),Eh(r,o.getCursorStates())}}class Sp{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Uf{constructor(e,t,i,n,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new Uf(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const l=e.getSelection();let d,c=null;if(l.isEmpty()){const h=e.getConfiguredWordAtPosition(l.getStartPosition());if(!h)return null;d=h.word,c=new ee(l.startLineNumber,h.startColumn,l.startLineNumber,h.endColumn)}else d=e.getModel().getValueInRange(l).replace(/\r\n/g,`
`);return new Uf(e,t,n,d,o,r,c)}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Sp(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 Sp(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(114):null,!1);return i?new ee(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 Sp(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 Sp(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(114):null,!1);return i?new ee(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(){return this._editor.hasModel()?(this.findController.highlightFindOptions(),this._editor.getModel().findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(114):null,!1,1073741824)):[]}}class nd extends U{constructor(e){super(),this._sessionDispose=this._register(new X),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}static get(e){return e.getContribution(nd.ID)}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Uf.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 ee(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>1){const n=e.getState().matchCase;if(!kP(this._editor.getModel(),t,n)){const r=this._editor.getModel();let a=[];for(let l=0,d=t.length;l<d;l++)a[l]=this._expandEmptyToWord(r,t[l]);this._editor.setSelections(a);return}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null;const i=e.getState();if(i.isRevealed&&i.searchString.length>0&&i.isRegex)t=this._editor.getModel().findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(114):null,!1,1073741824);else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll()}if(i.searchScope){const n=i.searchScope;let o=[];t.forEach(r=>{n.forEach(a=>{r.range.endLineNumber<=a.endLineNumber&&r.range.startLineNumber>=a.startLineNumber&&o.push(r)})}),t=o}if(t.length>0){const n=this._editor.getSelection();for(let o=0,r=t.length;o<r;o++){const a=t[o];if(a.range.intersectRanges(n)){t[o]=t[0],t[0]=a;break}}this._setSelections(t.map(o=>new ee(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}nd.ID="editor.contrib.multiCursorController";class Nh extends ne{run(e,t){const i=nd.get(t);if(!i)return;const n=Wn.get(t);if(!n)return;const o=t._getViewModel();if(o){const r=o.getCursorStates();this._run(i,n),Eh(r,o.getCursorStates())}}}class mee extends Nh{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:p("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:2082,weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"3_multi",title:p({},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class _ee extends Nh{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:p("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:oe.MenubarSelectionMenu,group:"3_multi",title:p({},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class bee extends Nh{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:p("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:oi(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class vee extends Nh{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:p("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class wee extends Nh{constructor(){super({id:"editor.action.selectHighlights",label:p("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:3114,weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"3_multi",title:p({},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class Cee extends Nh{constructor(){super({id:"editor.action.changeAll",label:p("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:J.and(I.writable,I.editorTextFocus),kbOpts:{kbExpr:I.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class GN{constructor(e,t,i,n){this.searchText=e,this.matchCase=t,this.wordSeparators=i,this.modelVersionId=n}static softEquals(e,t){return!e&&!t?!0:!e||!t?!1:e.searchText===t.searchText&&e.matchCase===t.matchCase&&e.wordSeparators===t.wordSeparators&&e.modelVersionId===t.modelVersionId}}class Sr extends U{constructor(e){super(),this.editor=e,this._isEnabled=e.getOption(95),this.decorations=[],this.updateSoon=this._register(new bt(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(t=>{this._isEnabled=e.getOption(95)})),this._register(e.onDidChangeCursorSelection(t=>{this._isEnabled&&(t.selection.isEmpty()?t.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(t=>{this._setState(null)})),this._register(e.onDidChangeModelContent(t=>{this._isEnabled&&this.updateSoon.schedule()})),this._register(Wn.get(e).getState().onFindReplaceStateChange(t=>{this._update()}))}_update(){this._setState(Sr._createState(this._isEnabled,this.editor))}static _createState(e,t){if(!e||!t.hasModel())return null;const i=t.getSelection();if(i.startLineNumber!==i.endLineNumber)return null;const n=nd.get(t);if(!n)return null;const o=Wn.get(t);if(!o)return null;let r=n.getSession(o);if(!r){const d=t.getSelections();if(d.length>1){const h=o.getState().matchCase;if(!kP(t.getModel(),d,h))return null}r=Uf.create(t,o)}if(!r||r.currentMatch||/^[ \t]+$/.test(r.searchText)||r.searchText.length>200)return null;const a=o.getState(),l=a.matchCase;if(a.isRevealed){let d=a.searchString;l||(d=d.toLowerCase());let c=r.searchText;if(l||(c=c.toLowerCase()),d===c&&r.matchCase===a.matchCase&&r.wholeWord===a.wholeWord&&!a.isRegex)return null}return new GN(r.searchText,r.matchCase,r.wholeWord?t.getOption(114):null,t.getModel().getVersionId())}_setState(e){if(GN.softEquals(this.state,e)){this.state=e;return}if(this.state=e,!this.state){this.decorations=this.editor.deltaDecorations(this.decorations,[]);return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=Vc.has(t)&&this.editor.getOption(69);let n=t.findMatches(this.state.searchText,!0,!1,this.state.matchCase,this.state.wordSeparators,!1).map(l=>l.range);n.sort(L.compareRangesUsingStarts);let o=this.editor.getSelections();o.sort(L.compareRangesUsingStarts);let r=[];for(let l=0,d=0,c=n.length,h=o.length;l<c;){const u=n[l];if(d>=h)r.push(u),l++;else{const f=L.compareRangesUsingStarts(u,o[d]);f<0?((o[d].isEmpty()||!L.areIntersecting(u,o[d]))&&r.push(u),l++):(f>0||l++,d++)}}const a=r.map(l=>({range:l,options:i?Sr._SELECTION_HIGHLIGHT:Sr._SELECTION_HIGHLIGHT_OVERVIEW}));this.decorations=this.editor.deltaDecorations(this.decorations,a)}dispose(){this._setState(null),super.dispose()}}Sr.ID="editor.contrib.selectionHighlighter";Sr._SELECTION_HIGHLIGHT_OVERVIEW=De.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:en(kA),position:Pn.Center}});Sr._SELECTION_HIGHLIGHT=De.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"});function kP(s,e,t){const i=ZN(s,e[0],!t);for(let n=1,o=e.length;n<o;n++){const r=e[n];if(r.isEmpty())return!1;const a=ZN(s,r,!t);if(i!==a)return!1}return!0}function ZN(s,e,t){const i=s.getValueInRange(e);return t?i.toLowerCase():i}Xe(nd.ID,nd);Xe(Sr.ID,Sr);Q(hee);Q(uee);Q(fee);Q(mee);Q(_ee);Q(bee);Q(vee);Q(wee);Q(Cee);Q(gee);Q(pee);var IP=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const sd={Visible:new se("parameterHintsVisible",!1),MultipleSignatures:new se("parameterHintsMultipleSignatures",!1)};function EP(s,e,t,i){return IP(this,void 0,void 0,function*(){const n=wl.ordered(s);for(const o of n)try{const r=yield o.provideSignatureHelp(s,e,i,t);if(r)return r}catch(r){gi(r)}})}He.registerCommand("_executeSignatureHelpProvider",(s,...e)=>IP(void 0,void 0,void 0,function*(){const[t,i,n]=e;nt(he.isUri(t)),nt(O.isIPosition(i)),nt(typeof n=="string"||!n);const o=yield s.get(Xs).createModelReference(t);try{const r=yield EP(o.object.textEditorModel,O.lift(i),{triggerKind:ko.Invoke,isRetrigger:!1,triggerCharacter:n},Fe.None);return r?(setTimeout(()=>r.dispose(),0),r.value):void 0}finally{o.dispose()}}));var See=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},Gr;(function(s){s.Default={type:0};class e{constructor(n,o){this.request=n,this.previouslyActiveHints=o,this.type=2}}s.Pending=e;class t{constructor(n){this.hints=n,this.type=1}}s.Active=t})(Gr||(Gr={}));class Tv extends U{constructor(e,t=Tv.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new M),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Gr.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Es),this.triggerChars=new oc,this.retriggerChars=new oc,this.triggerId=0,this.editor=e,this.throttledDelayer=new yr(t),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(i=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(i=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(i=>this.onCursorChange(i))),this._register(this.editor.onDidChangeModelContent(i=>this.onModelContentChange())),this._register(wl.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(i=>this.onDidType(i))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Gr.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!wl.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(ve)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(73).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,n=this.editor.getOption(73).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Gr.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return See(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(yee);this._pendingTriggers=[];const o={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new Gr.Pending(fi(l=>EP(r,a,o,l)),i);try{const l=yield this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Gr.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Gr.Default),ve(l),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars=new oc,this.retriggerChars=new oc;const e=this.editor.getModel();if(e)for(const t of wl.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])this.triggerChars.add(i.charCodeAt(0)),this.retriggerChars.add(i.charCodeAt(0));for(const i of t.signatureHelpRetriggerCharacters||[])this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:ko.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:ko.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:ko.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(73).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}Tv.DEFAULT_DELAY=120;function yee(s,e){switch(e.triggerKind){case ko.Invoke:return e;case ko.ContentChange:return s;case ko.TriggerCharacter:default:return e}}var Lee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},UC=function(s,e){return function(t,i){e(t,i,s)}};const xn=Y,xee=ki("parameter-hints-next",te.chevronDown,p("parameterHintsNextIcon","Icon for show next parameter hint.")),Dee=ki("parameter-hints-previous",te.chevronUp,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let q_=class NP extends U{constructor(e,t,i,n){super(),this.editor=e,this.renderDisposeables=this._register(new X),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Xl({editor:e},n,i)),this.model=this._register(new Tv(e)),this.keyVisible=sd.Visible.bindTo(t),this.keyMultipleSignatures=sd.MultipleSignatures.bindTo(t),this._register(this.model.onChangedHints(o=>{o?(this.show(),this.render(o)):this.hide()}))}createParamaterHintDOMNodes(){const e=xn(".editor-widget.parameter-hints-widget"),t=$(e,xn(".phwrapper"));t.tabIndex=-1;const i=$(t,xn(".controls")),n=$(i,xn(".button"+wt.asCSSSelector(Dee))),o=$(i,xn(".overloads")),r=$(i,xn(".button"+wt.asCSSSelector(xee)));this._register(K(n,"click",u=>{et.stop(u),this.previous()})),this._register(K(r,"click",u=>{et.stop(u),this.next()}));const a=xn(".body"),l=new sg(a,{});this._register(l),t.appendChild(l.getDomNode());const d=$(a,xn(".signature")),c=$(a,xn(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:d,overloads:o,docs:c,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(40);this.domNodes.element.style.fontSize=`${u.fontSize}px`};h(),this._register(re.chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(u=>u.hasChanged(40)).on(h,null)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParamaterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes&&this.domNodes.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes&&this.domNodes.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const n=e.signatures[e.activeSignature];if(!n)return;const o=$(this.domNodes.signature,xn(".code")),r=this.editor.getOption(40);o.style.fontSize=`${r.fontSize}px`,o.style.fontFamily=r.fontFamily;const a=n.parameters.length>0,l=(t=n.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,n,l);else{const h=$(o,xn("span"));h.textContent=n.label}const d=n.parameters[l];if(d!=null&&d.documentation){const h=xn("span.documentation");if(typeof d.documentation=="string")h.textContent=d.documentation;else{const u=this.renderMarkdownDocs(d.documentation);h.appendChild(u.element)}$(this.domNodes.docs,xn("p",{},h))}if(n.documentation!==void 0)if(typeof n.documentation=="string")$(this.domNodes.docs,xn("p",{},n.documentation));else{const h=this.renderMarkdownDocs(n.documentation);$(this.domNodes.docs,h.element)}const c=this.hasDocs(n,d);if(this.domNodes.signature.classList.toggle("has-docs",c),this.domNodes.docs.classList.toggle("empty",!c),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,d){const h=this.getParameterLabel(n,l);this.announcedLabel!==h&&(wi(p("hint","{0}, hint",h)),this.announcedLabel=h)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var i;(i=this.domNodes)===null||i===void 0||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&Eg(t.documentation).length>0||t&&typeof t.documentation=="object"&&Eg(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Eg(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Eg(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),$(e,r,a,l)}getParameterLabel(e,t){const i=e.parameters[t];return Array.isArray(i.label)?e.label.substring(i.label[0],i.label[1]):i.label}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const n=new RegExp(`(\\W|^)${Ys(i.label)}(?=\\W|$)`,"g");n.test(e.label);const o=n.lastIndex-i.label.length;return o>=0?[o,n.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}cancel(){this.model.cancel()}getDomNode(){return this.domNodes||this.createParamaterHintDOMNodes(),this.domNodes.element}getId(){return NP.ID}trigger(e){this.model.trigger(e,0)}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}};q_.ID="editor.widget.parameterHintsWidget";q_=Lee([UC(1,we),UC(2,Oo),UC(3,to)],q_);tt((s,e)=>{const t=s.getColor(ex);if(t){const a=s.type===Xn.HIGH_CONTRAST?2:1;e.addRule(`.monaco-editor .parameter-hints-widget { border: ${a}px solid ${t}; }`),e.addRule(`.monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid ${t.transparent(.5)}; }`)}const i=s.getColor(Wl);i&&e.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${i}; }`);const n=s.getColor(ng);n&&e.addRule(`.monaco-editor .parameter-hints-widget a { color: ${n}; }`);const o=s.getColor(JL);o&&e.addRule(`.monaco-editor .parameter-hints-widget { color: ${o}; }`);const r=s.getColor(UL);r&&e.addRule(`.monaco-editor .parameter-hints-widget code { background-color: ${r}; }`)});var kee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Iee=function(s,e){return function(t,i){e(t,i,s)}};let od=class MP extends U{constructor(e,t){super(),this.editor=e,this.widget=this._register(t.createInstance(q_,this.editor))}static get(e){return e.getContribution(MP.ID)}cancel(){this.widget.cancel()}previous(){this.widget.previous()}next(){this.widget.next()}trigger(e){this.widget.trigger(e)}};od.ID="editor.controller.parameterHints";od=kee([Iee(1,qe)],od);class Eee extends ne{constructor(){super({id:"editor.action.triggerParameterHints",label:p("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:I.hasSignatureHelpProvider,kbOpts:{kbExpr:I.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=od.get(t);i&&i.trigger({triggerKind:ko.Invoke})}}Xe(od.ID,od);Q(Eee);const kD=175,ID=Di.bindToContribution(od.get);G(new ID({id:"closeParameterHints",precondition:sd.Visible,handler:s=>s.cancel(),kbOpts:{weight:kD,kbExpr:I.focus,primary:9,secondary:[1033]}}));G(new ID({id:"showPrevParameterHint",precondition:J.and(sd.Visible,sd.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:kD,kbExpr:I.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));G(new ID({id:"showNextParameterHint",precondition:J.and(sd.Visible,sd.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:kD,kbExpr:I.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var Nee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$C=function(s,e){return function(t,i){e(t,i,s)}};const Av=new se("renameInputVisible",!1,p("renameInputVisible","Whether the rename input widget is visible"));let Ay=class{constructor(e,t,i,n,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._disposables=new X,this.allowEditorOverflow=!0,this._visibleContextKey=Av.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(40)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){if(!this._domNode){this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",p("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label);const e=()=>{var t,i;const[n,o]=this._acceptKeybindings;this._keybindingService.lookupKeybinding(n),this._label.innerText=p({},"{0} to Rename, {1} to Preview",(t=this._keybindingService.lookupKeybinding(n))===null||t===void 0?void 0:t.getLabel(),(i=this._keybindingService.lookupKeybinding(o))===null||i===void 0?void 0:i.getLabel())};e(),this._disposables.add(this._keybindingService.onDidUpdateKeybindings(e)),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())}return this._domNode}_updateStyles(e){var t,i,n,o;if(!this._input||!this._domNode)return;const r=e.getColor(Sa);this._domNode.style.backgroundColor=String((t=e.getColor(Ki))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=r?` 0 0 8px 2px ${r}`:"",this._domNode.style.color=String((i=e.getColor(jL))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((n=e.getColor($L))!==null&&n!==void 0?n:"");const a=e.getColor(qL);this._input.style.borderWidth=a?"1px":"0px",this._input.style.borderStyle=a?"solid":"none",this._input.style.borderColor=(o=a==null?void 0:a.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(40);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){this._currentAcceptInput&&this._currentAcceptInput(e)}cancelInput(e){this._currentCancelInput&&this._currentCancelInput(e)}getInput(e,t,i,n,o,r){this._domNode.classList.toggle("preview",o),this._position=new O(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",n.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new X;return new Promise(l=>{this._currentCancelInput=d=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l(d),!0),this._currentAcceptInput=d=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l({newName:this._input.value,wantsPreview:o&&d})},r.onCancellationRequested(()=>this.cancelInput(!0)),a.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!1))),this._show()}).finally(()=>{a.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};Ay=Nee([$C(2,pt),$C(3,Lt),$C(4,we)],Ay);var Mee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Zd=function(s,e){return function(t,i){e(t,i,s)}},Rc=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class TP{constructor(e,t){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=Em.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return Rc(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const n=this._providers[this._providerRenameIdx];if(!n.resolveRenameLocation)break;let o=yield n.resolveRenameLocation(this.model,this.position,e);if(o){if(o.rejectReason){t.push(o.rejectReason);continue}return o}}const i=this.model.getWordAtPosition(this.position);return i?{range:new L(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(`
`):void 0}:{range:L.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
`):void 0}})}provideRenameEdits(e,t){return Rc(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,n){return Rc(this,void 0,void 0,function*(){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(`
`)};const r=yield o.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("no result","No result.")),n);return r})}}function Tee(s,e,t){return Rc(this,void 0,void 0,function*(){const i=new TP(s,e),n=yield i.resolveRenameLocation(Fe.None);return n!=null&&n.rejectReason?{edits:[],rejectReason:n.rejectReason}:i.provideRenameEdits(t,Fe.None)})}let rd=class AP{constructor(e,t,i,n,o,r,a){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=r,this._configService=a,this._dispoableStore=new X,this._cts=new on,this._renameInputField=this._dispoableStore.add(new _c(()=>this._dispoableStore.add(this._instaService.createInstance(Ay,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))))}static get(e){return e.getContribution(AP.ID)}dispose(){this._dispoableStore.dispose(),this._cts.dispose(!0)}run(){return Rc(this,void 0,void 0,function*(){if(this._cts.dispose(!0),!this.editor.hasModel())return;const e=this.editor.getPosition(),t=new TP(this.editor.getModel(),e);if(!t.hasProvider())return;this._cts=new _f(this.editor,5);let i;try{const c=t.resolveRenameLocation(this._cts.token);this._progressService.showWhile(c,250),i=yield c}catch(c){Bn.get(this.editor).showMessage(c||p("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),e);return}if(!i)return;if(i.rejectReason){Bn.get(this.editor).showMessage(i.rejectReason,e);return}if(this._cts.token.isCancellationRequested)return;this._cts.dispose(),this._cts=new _f(this.editor,5,i.range);let n=this.editor.getSelection(),o=0,r=i.text.length;!L.isEmpty(n)&&!L.spansMultipleLines(n)&&L.containsRange(i.range,n)&&(o=Math.max(0,n.startColumn-i.range.startColumn),r=Math.min(i.range.endColumn,n.endColumn)-i.range.startColumn);const a=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),l=yield this._renameInputField.value.getInput(i.range,i.text,o,r,a,this._cts.token);if(typeof l=="boolean"){l&&this.editor.focus();return}this.editor.focus();const d=xM(t.provideRenameEdits(l.newName,this._cts.token),this._cts.token).then(c=>Rc(this,void 0,void 0,function*(){if(!(!c||!this.editor.hasModel())){if(c.rejectReason){this._notificationService.info(c.rejectReason);return}this._bulkEditService.apply(fb.convert(c),{editor:this.editor,showPreview:l.wantsPreview,label:p("label","Renaming '{0}'",i==null?void 0:i.text),quotableLabel:p("quotableLabel","Renaming {0}",i==null?void 0:i.text)}).then(h=>{h.ariaSummary&&wi(p("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",i.text,l.newName,h.ariaSummary))}).catch(h=>{this._notificationService.error(p("rename.failedApply","Rename failed to apply edits")),this._logService.error(h)})}}),c=>{this._notificationService.error(p("rename.failed","Rename failed to compute edits")),this._logService.error(c)});return this._progressService.showWhile(d,250),d})}acceptRenameInput(e){this._renameInputField.value.acceptInput(e)}cancelRenameInput(){this._renameInputField.value.cancelInput(!0)}};rd.ID="editor.contrib.renameController";rd=Mee([Zd(1,qe),Zd(2,Qt),Zd(3,yL),Zd(4,Rr),Zd(5,Tr),Zd(6,mL)],rd);class Aee extends ne{constructor(){super({id:"editor.action.rename",label:p("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:J.and(I.writable,I.hasRenameProvider),kbOpts:{kbExpr:I.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Ge),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return he.isUri(n)&&O.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},ve):super.runCommand(e,t)}run(e,t){const i=rd.get(t);return i?i.run():Promise.resolve()}}Xe(rd.ID,rd);Q(Aee);const ED=Di.bindToContribution(rd.get);G(new ED({id:"acceptRenameInput",precondition:Av,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:I.focus,primary:3}}));G(new ED({id:"acceptRenameInputWithPreview",precondition:J.and(Av,J.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:I.focus,primary:1027}}));G(new ED({id:"cancelRenameInput",precondition:Av,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:I.focus,primary:9,secondary:[1033]}}));Ar("_executeDocumentRenameProvider",function(s,e,...t){const[i]=t;return nt(typeof i=="string"),Tee(s,e,i)});Ht.as(pd.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:p("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});class Ree{provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o),this._addInWordRanges(o,e,n),this._addWordRanges(o,e,n),this._addWhitespaceLine(o,e,n),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;let{word:o,startColumn:r}=n,a=i.column-r,l=a,d=a,c=0;for(;l>=0;l--){let h=o.charCodeAt(l);if(l!==a&&(h===95||h===45))break;if(fr(h)&&Vs(c))break;c=h}for(l+=1;d<o.length;d++){let h=o.charCodeAt(d);if(Vs(h)&&fr(c))break;if(h===95||h===45)break;c=h}l<d&&e.push({range:new L(i.lineNumber,r+l,i.lineNumber,r+d)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new L(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new L(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var ND=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class MD{constructor(e,t){this.index=e,this.ranges=t}mov(e){let t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new MD(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}class ch{constructor(e){this._editor=e,this._ignoreSelection=!1}static get(e){return e.getContribution(ch.ID)}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return ND(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(!rb.has(i)||(this._state||(yield OP(i,t.map(o=>o.getPosition()),this._editor.getOption(100),Fe.None).then(o=>{var r;if(!(!vn(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!Ss(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<o.length;a++)o[a]=o[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new MD(0,a)),(r=this._selectionListener)===null||r===void 0||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}})),!this._state))return;this._state=this._state.map(o=>o.mov(e));const n=this._state.map(o=>ee.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}})}}ch.ID="editor.contrib.smartSelectController";class RP extends ne{constructor(e,t){super(t),this._forward=e}run(e,t){return ND(this,void 0,void 0,function*(){let i=ch.get(t);i&&(yield i.run(this._forward))})}}class Oee extends RP{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:p("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Expand Selection"),order:2}})}}He.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Pee extends RP{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:p("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:oe.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Shrink Selection"),order:3}})}}Xe(ch.ID,ch);Q(Oee);Q(Pee);rb.register("*",new Ree);function OP(s,e,t,i){return ND(this,void 0,void 0,function*(){const n=rb.all(s);n.length===1&&n.unshift(new kn);let o=[],r=[];for(const a of n)o.push(Promise.resolve(a.provideSelectionRanges(s,e,i)).then(l=>{if(vn(l)&&l.length===e.length)for(let d=0;d<e.length;d++){r[d]||(r[d]=[]);for(const c of l[d])L.isIRange(c.range)&&L.containsPosition(c.range,e[d])&&r[d].push(L.lift(c.range))}},gi));return yield Promise.all(o),r.map(a=>{if(a.length===0)return[];a.sort((h,u)=>O.isBefore(h.getStartPosition(),u.getStartPosition())?1:O.isBefore(u.getStartPosition(),h.getStartPosition())||O.isBefore(h.getEndPosition(),u.getEndPosition())?-1:O.isBefore(u.getEndPosition(),h.getEndPosition())?1:0);let l=[],d;for(const h of a)(!d||L.containsRange(h,d)&&!L.equalsRange(h,d))&&(l.push(h),d=h);if(!t.selectLeadingAndTrailingWhitespace)return l;let c=[l[0]];for(let h=1;h<l.length;h++){const u=l[h-1],f=l[h];if(f.startLineNumber!==u.startLineNumber||f.endLineNumber!==u.endLineNumber){const g=new L(u.startLineNumber,s.getLineFirstNonWhitespaceColumn(u.startLineNumber),u.endLineNumber,s.getLineLastNonWhitespaceColumn(u.endLineNumber));g.containsRange(u)&&!g.equalsRange(u)&&f.containsRange(g)&&!f.equalsRange(g)&&c.push(g);const m=new L(u.startLineNumber,1,u.endLineNumber,s.getLineMaxColumn(u.endLineNumber));m.containsRange(u)&&!m.equalsRange(g)&&f.containsRange(m)&&!f.equalsRange(m)&&c.push(m)}c.push(f)}return c})})}KW("_executeSelectionRangeProvider",function(s,...e){const[t]=e;return OP(s,t,{selectLeadingAndTrailingWhitespace:!0},Fe.None)});class Fee extends ne{constructor(){super({id:"editor.action.forceRetokenize",label:p("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.resetTokenization();const n=new Ao(!0);i.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Q(Fee);class hh extends ne{constructor(){super({id:hh.ID,label:p({},"Toggle Tab Key Moves Focus"),alias:"Toggle Tab Key Moves Focus",precondition:void 0,kbOpts:{kbExpr:null,primary:2091,mac:{primary:1323},weight:100}})}run(e,t){const n=!zm.getTabFocusMode();zm.setTabFocusMode(n),wi(n?p("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):p("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}hh.ID="editor.action.toggleTabFocusMode";Q(hh);var Bee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},YN=function(s,e){return function(t,i){e(t,i,s)}},Wee=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const PP="ignoreUnusualLineTerminators";function Vee(s,e,t){s.setModelProperty(e.uri,PP,t)}function Hee(s,e){return s.getModelProperty(e.uri,PP)}let $f=class extends U{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._config=this._editor.getOption(111),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(111)&&(this._config=this._editor.getOption(111),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()}))}_checkForUnusualLineTerminators(){return Wee(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||Hee(this._codeEditorService,e)===!0||this._editor.getOption(78))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(!(yield this._dialogService.confirm({title:p("unusualLineTerminators.title","Unusual Line Terminators"),message:p("unusualLineTerminators.message","Detected unusual line terminators"),detail:p("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Is(e.uri)),primaryButton:p("unusualLineTerminators.fix","Remove Unusual Line Terminators"),secondaryButton:p("unusualLineTerminators.ignore","Ignore")})).confirmed){Vee(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};$f.ID="editor.contrib.unusualLineTerminatorsDetector";$f=Bee([YN(1,ag),YN(2,Ge)],$f);Xe($f.ID,$f);var zee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},jC=function(s,e){return function(t,i){e(t,i,s)}};let jf=class extends U{constructor(e,t,i,n){super(),this._modelService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._tokenizeViewport=new bt(()=>this._tokenizeViewportNow(),100),this._outstandingRequests=[],this._register(this._editor.onDidScrollChange(()=>{this._tokenizeViewport.schedule()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(this._editor.onDidChangeModelContent(o=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(hL.onDidChange(()=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(this._configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration(Sx)&&(this._cancelAll(),this._tokenizeViewport.schedule())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),this._tokenizeViewport.schedule()}))}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.hasCompleteSemanticTokens())return;if(!GS(e,this._themeService,this._configurationService)){e.hasSomeSemanticTokens()&&e.setSemanticTokens(null,!1);return}const t=Cx(e);if(!t){e.hasSomeSemanticTokens()&&e.setSemanticTokens(null,!1);return}const i=this._modelService.getSemanticTokensProviderStyling(t),n=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(n.map(o=>this._requestRange(e,o,t,i)))}_requestRange(e,t,i,n){const o=e.getVersionId(),r=fi(a=>Promise.resolve(i.provideDocumentRangeSemanticTokens(e,t,a)));return r.then(a=>{!a||e.isDisposed()||e.getVersionId()!==o||e.setPartialSemanticTokens(t,cR(a,n,e.getLanguageIdentifier()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};jf.ID="editor.contrib.viewportSemanticTokens";jf=zee([jC(1,Vt),jC(2,pt),jC(3,At)],jf);Xe(jf.ID,jf);var Uee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$ee=function(s,e){return function(t,i){e(t,i,s)}};const jee=T("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hc:null},p("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0),qee=T("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hc:null},p("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0),Kee=T("editor.wordHighlightBorder",{light:null,dark:null,hc:Vi},p("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable.")),Gee=T("editor.wordHighlightStrongBorder",{light:null,dark:null,hc:Vi},p("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable.")),Zee=T("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},p("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Yee=T("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hc:"#C0A0C0CC"},p("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Rv=new se("hasWordHighlights",!1);function FP(s,e,t){const i=Vc.ordered(s);return DM(i.map(n=>()=>Promise.resolve(n.provideDocumentHighlights(s,e,t)).then(void 0,gi)),vn)}class BP{constructor(e,t,i){this._wordRange=this._getCurrentWordRange(e,t),this.result=fi(n=>this._compute(e,t,i,n))}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new L(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,o=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let d=0,c=i.length;!l&&d<c;d++){let h=e.getDecorationRange(i[d]);h&&h.startLineNumber===n&&h.startColumn<=o&&h.endColumn>=r&&(l=!0)}return l}cancel(){this.result.cancel()}}class Xee extends BP{_compute(e,t,i,n){return FP(e,t.getPosition(),n).then(o=>o||[])}}class Qee extends BP{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,n){return pa(250,n).then(()=>{if(!t.isEmpty())return[];const o=e.getWordAtPosition(t.getPosition());return!o||o.word.length>1e3?[]:e.findMatches(o.word,!0,!1,!0,i,!1).map(a=>({range:a.range,kind:Ku.Text}))})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function Jee(s,e,t){return Vc.has(s)?new Xee(s,e,t):new Qee(s,e,t)}Ar("_executeDocumentHighlights",(s,e)=>FP(s,e,Fe.None));class Mh{constructor(e,t){this.toUnhook=new X,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this._hasWordHighlights=Rv.bindTo(t),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(69),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(i=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(i)})),this.toUnhook.add(e.onDidChangeModelContent(i=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(i=>{let n=this.editor.getOption(69);this.occurrencesHighlight!==n&&(this.occurrencesHighlight=n,this._stopAll())})),this._decorationIds=[],this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this._decorationIds.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return fd(this._decorationIds.map(e=>this.model.getDecorationRange(e)).sort(L.compareRangesUsingStarts))}moveNext(){let e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);wi(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);wi(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this._decorationIds.length>0&&(this._decorationIds=this.editor.deltaDecorations(this._decorationIds,[]),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(!this.occurrencesHighlight){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){let e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}let t=e.startColumn,i=e.endColumn;const n=this._getWord();if(!n||n.startColumn>t||n.endColumn<i){this._stopAll();return}const o=this.workerRequest&&this.workerRequest.isValid(this.model,e,this._decorationIds);if(this.lastCursorPositionChangeTime=new Date().getTime(),o)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();let r=++this.workerRequestTokenId;this.workerRequestCompleted=!1,this.workerRequest=Jee(this.model,this.editor.getSelection(),this.editor.getOption(114)),this.workerRequest.result.then(a=>{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},ve)}}_beginRenderDecorations(){let e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;let e=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:Mh._getDecorationOptions(t.kind)});this._decorationIds=this.editor.deltaDecorations(this._decorationIds,e),this._hasWordHighlights.set(this.hasDecorations())}static _getDecorationOptions(e){return e===Ku.Write?this._WRITE_OPTIONS:e===Ku.Text?this._TEXT_OPTIONS:this._REGULAR_OPTIONS}dispose(){this._stopAll(),this.toUnhook.dispose()}}Mh._WRITE_OPTIONS=De.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:en(Yee),position:Pn.Center}});Mh._TEXT_OPTIONS=De.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight",overviewRuler:{color:en(kA),position:Pn.Center}});Mh._REGULAR_OPTIONS=De.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:en(Zee),position:Pn.Center}});let ad=class WP extends U{constructor(e,t){super(),this.wordHighlighter=null;const i=()=>{e.hasModel()&&(this.wordHighlighter=new Mh(e,t))};this._register(e.onDidChangeModel(n=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),i()})),i()}static get(e){return e.getContribution(WP.ID)}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){this.wordHighlighter&&this.wordHighlighter.moveNext()}moveBack(){this.wordHighlighter&&this.wordHighlighter.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};ad.ID="editor.contrib.wordHighlighter";ad=Uee([$ee(1,we)],ad);class VP extends ne{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=ad.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class ete extends VP{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:p("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Rv,kbOpts:{kbExpr:I.editorTextFocus,primary:65,weight:100}})}}class tte extends VP{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:p("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Rv,kbOpts:{kbExpr:I.editorTextFocus,primary:1089,weight:100}})}}class ite extends ne{constructor(){super({id:"editor.action.wordHighlight.trigger",label:p("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:Rv.toNegated(),kbOpts:{kbExpr:I.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=ad.get(t);n&&n.restoreViewState(!0)}}Xe(ad.ID,ad);Q(ete);Q(tte);Q(ite);tt((s,e)=>{const t=s.getColor(QL);t&&(e.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${t}; }`),e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`));const i=s.getColor(jee);i&&e.addRule(`.monaco-editor .wordHighlight { background-color: ${i}; }`);const n=s.getColor(qee);n&&e.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${n}; }`);const o=s.getColor(G7);o&&e.addRule(`.monaco-editor .selectionHighlight { border: 1px ${s.type==="hc"?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const r=s.getColor(Kee);r&&e.addRule(`.monaco-editor .wordHighlight { border: 1px ${s.type==="hc"?"dashed":"solid"} ${r}; box-sizing: border-box; }`);const a=s.getColor(Gee);a&&e.addRule(`.monaco-editor .wordHighlightStrong { border: 1px ${s.type==="hc"?"dashed":"solid"} ${a}; box-sizing: border-box; }`)});class Ov extends Di{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=ts(t.getOption(114)),o=t.getModel(),a=t.getSelections().map(l=>{const d=new O(l.positionLineNumber,l.positionColumn),c=this._move(n,o,d,this._wordNavigationType);return this._moveTo(l,c,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>Te.fromModelSelection(l))),a.length===1){const l=new O(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new ee(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ee(t.lineNumber,t.column,t.lineNumber,t.column)}}class za extends Ov{_move(e,t,i,n){return ze.moveWordLeft(e,t,i,n)}}class Ua extends Ov{_move(e,t,i,n){return ze.moveWordRight(e,t,i,n)}}class nte extends za{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class ste extends za{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class ote extends za{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:J.and(I.textInputFocus,(e=J.and(rg,jb))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class rte extends za{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class ate extends za{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class lte extends za{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:J.and(I.textInputFocus,(e=J.and(rg,jb))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class dte extends za{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move(ts(Js.wordSeparators.defaultValue),t,i,n)}}class cte extends za{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move(ts(Js.wordSeparators.defaultValue),t,i,n)}}class hte extends Ua{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class ute extends Ua{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:J.and(I.textInputFocus,(e=J.and(rg,jb))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class fte extends Ua{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class gte extends Ua{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class pte extends Ua{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:J.and(I.textInputFocus,(e=J.and(rg,jb))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class mte extends Ua{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class _te extends Ua{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move(ts(Js.wordSeparators.defaultValue),t,i,n)}}class bte extends Ua{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move(ts(Js.wordSeparators.defaultValue),t,i,n)}}class Pv extends Di{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=ts(t.getOption(114)),o=t.getModel(),r=t.getSelections(),a=t.getOption(5),l=t.getOption(8),d=xe.getAutoClosingPairs(o.getLanguageIdentifier().id),c=t._getViewModel(),h=r.map(u=>{const f=this._delete({wordSeparators:n,model:o,selection:u,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(6),autoClosingBrackets:a,autoClosingQuotes:l,autoClosingPairs:d,autoClosedCharacters:c.getCursorAutoClosedCharacters()},this._wordNavigationType);return new mi(f,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class TD extends Pv{_delete(e,t){let i=ze.deleteWordLeft(e,t);return i||new L(1,1,1,1)}}class AD extends Pv{_delete(e,t){let i=ze.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new L(n,o,n,o)}}class vte extends TD{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:I.writable})}}class wte extends TD{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:I.writable})}}class Cte extends TD{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class Ste extends AD{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:I.writable})}}class yte extends AD{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:I.writable})}}class Lte extends AD{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class xte extends ne{constructor(){super({id:"deleteInsideWord",precondition:I.writable,label:p("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=ts(t.getOption(114)),o=t.getModel(),a=t.getSelections().map(l=>{const d=ze.deleteInsideWord(n,o,l);return new mi(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}G(new nte);G(new ste);G(new ote);G(new rte);G(new ate);G(new lte);G(new hte);G(new ute);G(new fte);G(new gte);G(new pte);G(new mte);G(new dte);G(new cte);G(new _te);G(new bte);G(new vte);G(new wte);G(new Cte);G(new Ste);G(new yte);G(new Lte);Q(xte);class Dte extends Pv{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){let i=Rb.deleteWordPartLeft(e);return i||new L(1,1,1,1)}}class kte extends Pv{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let i=Rb.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new L(n,o,n,o)}}class HP extends Ov{_move(e,t,i,n){return Rb.moveWordPartLeft(e,t,i)}}class Ite extends HP{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}He.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Ete extends HP{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}He.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class zP extends Ov{_move(e,t,i,n){return Rb.moveWordPartRight(e,t,i)}}class Nte extends zP{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class Mte extends zP{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}G(new Dte);G(new kte);G(new Ite);G(new Ete);G(new Nte);G(new Mte);var UP=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},am=function(s,e){return function(t,i){e(t,i,s)}};const $P=new se("accessibilityHelpWidgetVisible",!1);let ld=class jP extends U{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(uh,this._editor))}static get(e){return e.getContribution(jP.ID)}show(){this._widget.show()}hide(){this._widget.hide()}};ld.ID="editor.contrib.accessibilityHelpController";ld=UP([am(1,qe)],ld);function Tte(s,e){return!s||s.length===0?$t.noSelection:s.length===1?e?Ai($t.singleSelectionRange,s[0].positionLineNumber,s[0].positionColumn,e):Ai($t.singleSelection,s[0].positionLineNumber,s[0].positionColumn):e?Ai($t.multiSelectionRange,s.length,e):s.length>0?Ai($t.multiSelection,s.length):""}let uh=class lm extends Vn{constructor(e,t,i,n){super(),this._contextKeyService=t,this._keybindingService=i,this._openerService=n,this._editor=e,this._isVisibleKey=$P.bindTo(this._contextKeyService),this._domNode=Ue(document.createElement("div")),this._domNode.setClassName("accessibilityHelpWidget"),this._domNode.setDisplay("none"),this._domNode.setAttribute("role","dialog"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode=Ue(document.createElement("div")),this._contentDomNode.setAttribute("role","document"),this._domNode.appendChild(this._contentDomNode),this._isVisible=!1,this._register(this._editor.onDidLayoutChange(()=>{this._isVisible&&this._layout()})),this._register(Gt(this._contentDomNode.domNode,"keydown",o=>{if(this._isVisible&&(o.equals(2083)&&(wi($t.emergencyConfOn),this._editor.updateOptions({accessibilitySupport:"on"}),hi(this._contentDomNode.domNode),this._buildContent(),this._contentDomNode.domNode.focus(),o.preventDefault(),o.stopPropagation()),o.equals(2086))){wi($t.openingDocs);let r=this._editor.getRawOptions().accessibilityHelpUrl;typeof r>"u"&&(r="https://go.microsoft.com/fwlink/?linkid=852450"),this._openerService.open(he.parse(r)),o.preventDefault(),o.stopPropagation()}})),this.onblur(this._contentDomNode.domNode,()=>{this.hide()}),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return lm.ID}getDomNode(){return this._domNode.domNode}getPosition(){return{preference:null}}show(){this._isVisible||(this._isVisible=!0,this._isVisibleKey.set(!0),this._layout(),this._domNode.setDisplay("block"),this._domNode.setAttribute("aria-hidden","false"),this._contentDomNode.domNode.tabIndex=0,this._buildContent(),this._contentDomNode.domNode.focus())}_descriptionForCommand(e,t,i){let n=this._keybindingService.lookupKeybinding(e);return n?Ai(t,n.getAriaLabel()):Ai(i,e)}_buildContent(){const e=this._editor.getOptions(),t=this._editor.getSelections();let i=0;if(t){const a=this._editor.getModel();a&&t.forEach(l=>{i+=a.getValueLengthInRange(l)})}let n=Tte(t,i);e.get(51)?e.get(78)?n+=$t.readonlyDiffEditor:n+=$t.editableDiffEditor:e.get(78)?n+=$t.readonlyEditor:n+=$t.editableEditor;const o=Re?$t.changeConfigToOnMac:$t.changeConfigToOnWinLinux;switch(e.get(2)){case 0:n+=`
- `+o;break;case 2:n+=`
- `+$t.auto_on;break;case 1:n+=`
- `+$t.auto_off,n+=" "+o;break}e.get(127)?n+=`
- `+this._descriptionForCommand(hh.ID,$t.tabFocusModeOnMsg,$t.tabFocusModeOnMsgNoKb):n+=`
- `+this._descriptionForCommand(hh.ID,$t.tabFocusModeOffMsg,$t.tabFocusModeOffMsgNoKb);const r=Re?$t.openDocMac:$t.openDocWinLinux;n+=`
- `+r,n+=`
`+$t.outroMsg,this._contentDomNode.domNode.appendChild(JR(n)),this._contentDomNode.domNode.setAttribute("aria-label",n)}hide(){this._isVisible&&(this._isVisible=!1,this._isVisibleKey.reset(),this._domNode.setDisplay("none"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode.domNode.tabIndex=-1,hi(this._contentDomNode.domNode),this._editor.focus())}_layout(){let e=this._editor.getLayoutInfo(),t=Math.max(5,Math.min(lm.WIDTH,e.width-40)),i=Math.max(5,Math.min(lm.HEIGHT,e.height-40));this._domNode.setWidth(t),this._domNode.setHeight(i);let n=Math.round((e.height-i)/2);this._domNode.setTop(n);let o=Math.round((e.width-t)/2);this._domNode.setLeft(o)}};uh.ID="editor.contrib.accessibilityHelpWidget";uh.WIDTH=500;uh.HEIGHT=300;uh=UP([am(1,we),am(2,Lt),am(3,Oo)],uh);class Ate extends ne{constructor(){super({id:"editor.action.showAccessibilityHelp",label:$t.showAccessibilityHelpAction,alias:"Show Accessibility Help",precondition:void 0,kbOpts:{primary:571,weight:100,linux:{primary:1595,secondary:[571]}}})}run(e,t){let i=ld.get(t);i&&i.show()}}Xe(ld.ID,ld);Q(Ate);const Rte=Di.bindToContribution(ld.get);G(new Rte({id:"closeAccessibilityHelp",precondition:$P,handler:s=>s.hide(),kbOpts:{weight:200,kbExpr:I.focus,primary:9,secondary:[1033]}}));tt((s,e)=>{const t=s.getColor(Ki);t&&e.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${t}; }`);const i=s.getColor(Ds);i&&e.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${i}; }`);const n=s.getColor(Sa);n&&e.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${n}; }`);const o=s.getColor(Xt);o&&e.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${o}; }`)});class Ry extends U{constructor(e){super(),this.editor=e,this.widget=null,To&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(78);!this.widget&&e?this.widget=new Fv(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}Ry.ID="editor.contrib.iPadShowKeyboard";class Fv extends U{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(K(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(K(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return Fv.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}Fv.ID="editor.contrib.ShowKeyboardWidget";Xe(Ry.ID,Ry);var Ote=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},XN=function(s,e){return function(t,i){e(t,i,s)}};let fh=class qP extends U{constructor(e,t,i){super(),this._editor=e,this._modeService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(St.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}static get(e){return e.getContribution(qP.ID)}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new Bv(this._editor,this._modeService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};fh.ID="editor.contrib.inspectTokens";fh=Ote([XN(1,Sd),XN(2,to)],fh);class Pte extends ne{constructor(){super({id:"editor.action.inspectTokens",label:mS.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){let i=fh.get(t);i&&i.launch()}}function Fte(s){let e="";for(let t=0,i=s.length;t<i;t++){let n=s.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function Bte(s){let e=St.get(s.language);return e||{getInitialState:()=>Jf,tokenize:(t,i,n,o)=>aT(s.language,t,n,o),tokenize2:(t,i,n,o)=>fL(s.id,t,n,o)}}class Bv extends U{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._modeService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=Bte(this._model.getLanguageIdentifier()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return Bv._ID}_compute(e){let t=this._getTokensAtLine(e.lineNumber),i=0;for(let l=t.tokens1.length-1;l>=0;l--){let d=t.tokens1[l];if(e.column-1>=d.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}let o=this._model.getLineContent(e.lineNumber),r="";if(i<t.tokens1.length){let l=t.tokens1[i].offset,d=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;r=o.substring(l,d)}ma(this._domNode,Y("h2.tm-token",void 0,Fte(r),Y("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),$(this._domNode,Y("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;$(this._domNode,Y("table.tm-metadata-table",void 0,Y("tbody",void 0,Y("tr",void 0,Y("td.tm-metadata-key",void 0,"language"),Y("td.tm-metadata-value",void 0,`${a?a.languageIdentifier.language:"-?-"}`)),Y("tr",void 0,Y("td.tm-metadata-key",void 0,"token type"),Y("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Y("tr",void 0,Y("td.tm-metadata-key",void 0,"font style"),Y("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Y("tr",void 0,Y("td.tm-metadata-key",void 0,"foreground"),Y("td.tm-metadata-value",void 0,`${a?B.Format.CSS.formatHex(a.foreground):"-?-"}`)),Y("tr",void 0,Y("td.tm-metadata-key",void 0,"background"),Y("td.tm-metadata-value",void 0,`${a?B.Format.CSS.formatHex(a.background):"-?-"}`))))),$(this._domNode,Y("hr.tokens-inspect-separator")),i<t.tokens1.length&&$(this._domNode,Y("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){let t=St.getColorMap(),i=$i.getLanguageId(e),n=$i.getTokenType(e),o=$i.getFontStyle(e),r=$i.getForeground(e),a=$i.getBackground(e);return{languageIdentifier:this._modeService.getLanguageIdentifier(i),tokenType:n,fontStyle:o,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 4:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),t.length===0&&(t="---"),t}_getTokensAtLine(e){let t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t,0),n=this._tokenizationSupport.tokenize2(this._model.getLineContent(e),!0,t,0);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t,0).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}}Bv._ID="editor.contrib.inspectTokensWidget";Xe(fh.ID,fh);Q(Pte);tt((s,e)=>{const t=s.getColor(ex);if(t){let o=s.type===Xn.HIGH_CONTRAST?2:1;e.addRule(`.monaco-editor .tokens-inspect-widget { border: ${o}px solid ${t}; }`),e.addRule(`.monaco-editor .tokens-inspect-widget .tokens-inspect-separator { background-color: ${t}; }`)}const i=s.getColor(Wl);i&&e.addRule(`.monaco-editor .tokens-inspect-widget { background-color: ${i}; }`);const n=s.getColor(JL);n&&e.addRule(`.monaco-editor .tokens-inspect-widget { color: ${n}; }`)});var Wte=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Vte=function(s,e){return function(t,i){e(t,i,s)}};let K_=class dm{constructor(e){this.quickInputService=e,this.registry=Ht.as(Dd.Quickaccess)}provide(e){const t=new X;t.add(e.onDidAccept(()=>{const[o]=e.selectedItems;o&&this.quickInputService.quickAccess.show(o.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(o=>{const r=this.registry.getQuickAccessProvider(o.substr(dm.PREFIX.length));r&&r.prefix&&r.prefix!==dm.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})}));const{editorProviders:i,globalProviders:n}=this.getQuickAccessProviders();return e.items=i.length===0||n.length===0?[...i.length===0?n:i]:[{label:p("globalCommands","global commands"),type:"separator"},...n,{label:p("editorCommands","editor commands"),type:"separator"},...i],t}getQuickAccessProviders(){const e=[],t=[];for(const i of this.registry.getQuickAccessProviders().sort((n,o)=>n.prefix.localeCompare(o.prefix)))if(i.prefix!==dm.PREFIX)for(const n of i.helpEntries){const o=n.prefix||i.prefix,r=o||"…";(n.needsEditor?t:e).push({prefix:o,label:r,ariaLabel:p("helpPickAriaLabel","{0}, {1}",r,n.description),description:n.description})}return{editorProviders:t,globalProviders:e}}};K_.PREFIX="?";K_=Wte([Vte(0,Ha)],K_);Ht.as(Dd.Quickaccess).registerQuickAccessProvider({ctor:K_,prefix:"",helpEntries:[{description:_S.helpQuickAccessActionLabel,needsEditor:!0}]});class KP{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const n=new X;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new Es);return o.value=this.doProvide(e,t),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t){const i=new X,n=this.activeTextEditorControl;if(n&&this.canProvideWithTextEditor(n)){const o={editor:n},r=IT(n);if(r){let a=Tn(n.saveViewState());i.add(r.onDidChangeCursorPosition(()=>{a=Tn(n.saveViewState())})),o.restoreViewState=()=>{a&&n===this.activeTextEditorControl&&n.restoreViewState(a)},i.add(ya(t.onCancellationRequested)(()=>{var l;return(l=o.restoreViewState)===null||l===void 0?void 0:l.call(o)}))}i.add(Pe(()=>this.clearDecorations(n))),i.add(this.provideWithTextEditor(o,e,t))}else i.add(this.provideWithoutTextEditor(e,t));return i}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus()}getModel(e){var t;return kT(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:en(a6),position:Pn.Full}}}],[r,a]=i.deltaDecorations(n,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class Wv extends KP{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=p("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,U.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new X;o.add(t.onDidAccept(l=>{const[d]=t.selectedItems;if(d){if(!this.isValidLineNumber(n,d.lineNumber))return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const r=()=>{const l=this.parsePosition(n,t.value.trim().substr(Wv.PREFIX.length)),d=this.getPickLabel(n,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:d}],t.ariaLabel=d,!this.isValidLineNumber(n,l.lineNumber)){this.clearDecorations(n);return}const c=this.toRange(l.lineNumber,l.column);n.revealRangeInCenter(c,0),this.addDecorations(n,c)};r(),o.add(t.onDidChangeValue(()=>r()));const a=IT(n);return a&&a.getOptions().get(57).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(Pe(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?p("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):p("gotoLineLabel","Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?p("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,o):p("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const n=this.getModel(e);if(!n)return!1;const o={lineNumber:t,column:i};return n.validatePosition(o).equals(o)}lineCount(e){var t,i;return(i=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&i!==void 0?i:0}}Wv.PREFIX=":";var Hte=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},zte=function(s,e){return function(t,i){e(t,i,s)}};let qf=class extends Wv{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=re.None}get activeTextEditorControl(){return Tn(this.editorService.getFocusedCodeEditor())}};qf=Hte([zte(0,Ge)],qf);Ht.as(Dd.Quickaccess).registerQuickAccessProvider({ctor:qf,prefix:qf.PREFIX,helpEntries:[{description:Km.gotoLineActionLabel,needsEditor:!0}]});let Ute=class extends ne{constructor(){super({id:"editor.action.gotoLine",label:Km.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Ha).quickAccess.show(qf.PREFIX)}};Q(Ute);const GP=[void 0,[]];function qC(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?$te(s,n.values,t,i):ZP(s,e,t,i)}function $te(s,e,t,i){let n=0;const o=[];for(const r of e){const[a,l]=ZP(s,r,t,i);if(typeof a!="number")return GP;n+=a,o.push(...l)}return[n,jte(o)]}function ZP(s,e,t,i){const n=Qc(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,!0);return n?[n[0],zb(n)]:GP}function jte(s){const e=s.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!qte(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function qte(s,e){return!(s.end<e.start||e.end<s.start)}const YP=" ";function Oy(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=QN(s),o=t.indexOf(vl)>=0;let r;const a=s.split(YP);if(a.length>1)for(const l of a){const{pathNormalized:d,normalized:c,normalizedLowercase:h}=QN(l);c&&(r||(r=[]),r.push({original:l,originalLowercase:l.toLowerCase(),pathNormalized:d,normalized:c,normalizedLowercase:h}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:r,containsPathSeparator:o}}function QN(s){let e;Si?e=s.replace(/\//g,vl):e=s.replace(/\\/g,vl);const t=w5(e).replace(/\s/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function JN(s){return Array.isArray(s)?Oy(s.map(e=>e.original).join(YP)):Oy(s.original)}var iu=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class Jn extends KP{constructor(e=Object.create(null)){super(e),this.options=e,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,p("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),U.None}provideWithTextEditor(e,t,i){const n=e.editor,o=this.getModel(n);return o?ws.has(o)?this.doProvideWithEditorSymbols(e,o,t,i):this.doProvideWithoutEditorSymbols(e,o,t,i):U.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new X;return this.provideLabelPick(i,p("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),iu(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,o))||n.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,n))}),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return iu(this,void 0,void 0,function*(){if(ws.has(e))return!0;let i;const n=new Promise(r=>i=r),o=t.add(ws.onDidChange(()=>{ws.has(e)&&(o.dispose(),i(!0))}));return t.add(Pe(()=>i(!1))),n})}doProvideWithEditorSymbols(e,t,i,n){const o=e.editor,r=new X;r.add(i.onDidAccept(h=>{const[u]=i.selectedItems;u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,preserveFocus:h.inBackground}),h.inBackground||i.hide())})),r.add(i.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const a=this.getDocumentSymbols(t,n);let l;const d=()=>iu(this,void 0,void 0,function*(){l==null||l.dispose(!0),i.busy=!1,l=new on(n),i.busy=!0;try{const h=Oy(i.value.substr(Jn.PREFIX.length).trim()),u=yield this.doGetSymbolPicks(a,h,void 0,l.token);if(n.isCancellationRequested)return;u.length>0?i.items=u:h.original.length>0?this.provideLabelPick(i,p("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,p("noSymbolResults","No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}});r.add(i.onDidChangeValue(()=>d())),d();let c=!0;return r.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;if(h&&h.range){if(c){c=!1;return}o.revealRangeInCenter(h.range.selection,0),this.addDecorations(o,h.range.decoration)}})),r}doGetSymbolPicks(e,t,i,n){return iu(this,void 0,void 0,function*(){const o=yield e;if(n.isCancellationRequested)return[];const r=t.original.indexOf(Jn.SCOPE_PREFIX)===0,a=r?1:0;let l,d;t.values&&t.values.length>1?(l=JN(t.values[0]),d=JN(t.values.slice(1))):l=t;const c=[];for(let f=0;f<o.length;f++){const g=o[f],m=b5(g.name),b=`$(symbol-${oS.toString(g.kind)||"property"}) ${m}`,v=b.length-m.length;let _=g.containerName;i!=null&&i.extraContainerLabel&&(_?_=`${i.extraContainerLabel} • ${_}`:_=i.extraContainerLabel);let w,C,S,D;if(t.original.length>a){let x=!1;if(l!==t&&([w,C]=qC(b,Object.assign(Object.assign({},t),{values:void 0}),a,v),typeof w=="number"&&(x=!0)),typeof w!="number"&&([w,C]=qC(b,l,a,v),typeof w!="number"))continue;if(!x&&d){if(_&&d.original.length>0&&([S,D]=qC(_,d)),typeof S!="number")continue;typeof w=="number"&&(w+=S)}}const y=g.tags&&g.tags.indexOf(1)>=0;c.push({index:f,kind:g.kind,score:w,label:b,ariaLabel:m,description:_,highlights:y?void 0:{label:C,description:D},range:{selection:L.collapseToStart(g.selectionRange),decoration:g.range},strikethrough:y,buttons:(()=>{var x,E;const P=!((x=this.options)===null||x===void 0)&&x.openSideBySideDirection?(E=this.options)===null||E===void 0?void 0:E.openSideBySideDirection():void 0;if(P)return[{iconClass:P==="right"?te.splitHorizontal.classNames:te.splitVertical.classNames,tooltip:P==="right"?p("openToSide","Open to the Side"):p("openToBottom","Open to the Bottom")}]})()})}const h=c.sort((f,g)=>r?this.compareByKindAndScore(f,g):this.compareByScore(f,g));let u=[];if(r){let b=function(){g&&typeof f=="number"&&m>0&&(g.label=Ai(GC[f]||KC,m))},f,g,m=0;for(const v of h)f!==v.kind?(b(),f=v.kind,m=1,g={type:"separator"},u.push(g)):m++,u.push(v);b()}else h.length>0&&(u=[{label:p("symbols","symbols ({0})",c.length),type:"separator"},...h]);return u})}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=GC[e.kind]||KC,n=GC[t.kind]||KC,o=i.localeCompare(n);return o===0?this.compareByScore(e,t):o}getDocumentSymbols(e,t){return iu(this,void 0,void 0,function*(){const i=yield Ui.create(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()})}}Jn.PREFIX="@";Jn.SCOPE_PREFIX=":";Jn.PREFIX_BY_CATEGORY=`${Jn.PREFIX}${Jn.SCOPE_PREFIX}`;const KC=p("property","properties ({0})"),GC={5:p("method","methods ({0})"),11:p("function","functions ({0})"),8:p("_constructor","constructors ({0})"),12:p("variable","variables ({0})"),4:p("class","classes ({0})"),22:p("struct","structs ({0})"),23:p("event","events ({0})"),24:p("operator","operators ({0})"),10:p("interface","interfaces ({0})"),2:p("namespace","namespaces ({0})"),3:p("package","packages ({0})"),25:p("typeParameter","type parameters ({0})"),1:p("modules","modules ({0})"),6:p("property","properties ({0})"),9:p("enum","enumerations ({0})"),21:p("enumMember","enumeration members ({0})"),14:p("string","strings ({0})"),0:p("file","files ({0})"),17:p("array","arrays ({0})"),15:p("number","numbers ({0})"),16:p("boolean","booleans ({0})"),18:p("object","objects ({0})"),19:p("key","keys ({0})"),7:p("field","fields ({0})"),13:p("constant","constants ({0})")};var Kte=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Gte=function(s,e){return function(t,i){e(t,i,s)}};let Py=class extends Jn{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=re.None}get activeTextEditorControl(){return Tn(this.editorService.getFocusedCodeEditor())}};Py=Kte([Gte(0,Ge)],Py);Ht.as(Dd.Quickaccess).registerQuickAccessProvider({ctor:Py,prefix:Jn.PREFIX,helpEntries:[{description:tf.quickOutlineActionLabel,prefix:Jn.PREFIX,needsEditor:!0},{description:tf.quickOutlineByCategoryActionLabel,prefix:Jn.PREFIX_BY_CATEGORY,needsEditor:!0}]});let Zte=class extends ne{constructor(){super({id:"editor.action.quickOutline",label:tf.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:I.hasDocumentSymbolProvider,kbOpts:{kbExpr:I.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Ha).quickAccess.show(Jn.PREFIX)}};Q(Zte);var yp=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},fc;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(fc||(fc={}));function ZC(s){const e=s;return Array.isArray(e.items)}function Yte(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class Vv extends U{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t){var i;const n=new X;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=n.add(new Es),a=()=>yp(this,void 0,void 0,function*(){const l=r.value=new X;o==null||o.dispose(!0),e.busy=!1,o=new on(t);const d=o.token,c=e.value.substr(this.prefix.length).trim(),h=this._getPicks(c,l,d),u=(f,g)=>{var m;let b,v;if(ZC(f)?(b=f.items,v=f.active):b=f,b.length===0){if(g)return!1;c.length>0&&(!((m=this.options)===null||m===void 0)&&m.noResultsPick)&&(b=[this.options.noResultsPick])}return e.items=b,v&&(e.activeItems=[v]),!0};if(h!==null)if(Yte(h)){let f=!1,g=!1;yield Promise.all([yp(this,void 0,void 0,function*(){yield pa(Vv.FAST_PICKS_RACE_DELAY),!d.isCancellationRequested&&(g||(f=u(h.picks,!0)))}),yp(this,void 0,void 0,function*(){e.busy=!0;try{const m=yield h.additionalPicks;if(d.isCancellationRequested)return;let b,v;ZC(h.picks)?(b=h.picks.items,v=h.picks.active):b=h.picks;let _,w;if(ZC(m)?(_=m.items,w=m.active):_=m,_.length>0||!f){let C;if(!v&&!w){const S=e.activeItems[0];S&&b.indexOf(S)!==-1&&(C=S)}u({items:[...b,..._],active:v||w||C})}}finally{d.isCancellationRequested||(e.busy=!1),g=!0}})])}else if(!(h instanceof Promise))u(h);else{e.busy=!0;try{const f=yield h;if(d.isCancellationRequested)return;u(f)}finally{d.isCancellationRequested||(e.busy=!1)}}});return n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(l=>{const[d]=e.selectedItems;typeof(d==null?void 0:d.accept)=="function"&&(l.inBackground||e.hide(),d.accept(e.keyMods,l))})),n.add(e.onDidTriggerItemButton(({button:l,item:d})=>yp(this,void 0,void 0,function*(){var c,h;if(typeof d.trigger=="function"){const u=(h=(c=d.buttons)===null||c===void 0?void 0:c.indexOf(l))!==null&&h!==void 0?h:-1;if(u>=0){const f=d.trigger(u,e.keyMods),g=typeof f=="number"?f:yield f;if(t.isCancellationRequested)return;switch(g){case fc.NO_ACTION:break;case fc.CLOSE_PICKER:e.hide();break;case fc.REFRESH_PICKER:a();break;case fc.REMOVE_ITEM:const m=e.items.indexOf(d);if(m!==-1){const b=e.items.slice();b.splice(m,1),e.items=b}break}}}}))),n}}Vv.FAST_PICKS_RACE_DELAY=200;function YC(s,e){return e&&(s.stack||s.stacktrace)?p("stackTrace.format","{0}: {1}",tM(s),eM(s.stack)||eM(s.stacktrace)):tM(s)}function eM(s){return Array.isArray(s)?s.join(`
`):s}function tM(s){return typeof s.code=="string"&&typeof s.errno=="number"&&typeof s.syscall=="string"?p("nodeExceptionMessage","A system error occurred ({0})",s.message):s.message||p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function XP(s=null,e=!1){if(!s)return p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(s)){const t=fd(s),i=XP(t[0],e);return t.length>1?p("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(es(s))return s;if(s.detail){const t=s.detail;if(t.error)return YC(t.error,e);if(t.exception)return YC(t.exception,e)}return s.stack?YC(s,e):s.message?s.message:p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var QP=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},hl=function(s,e){return function(t,i){e(t,i,s)}},iM=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let Kf=class cm extends Vv{constructor(e,t,i,n,o,r){super(cm.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(dd)),this.options=e}_getPicks(e,t,i){return iM(this,void 0,void 0,function*(){const n=yield this.getCommandPicks(t,i);if(i.isCancellationRequested)return[];const o=[];for(const d of n){const c=Tn(cm.WORD_FILTER(e,d.label)),h=d.commandAlias?Tn(cm.WORD_FILTER(e,d.commandAlias)):void 0;c||h?(d.highlights={label:c,detail:this.options.showAlias?h:void 0},o.push(d)):e===d.commandId&&o.push(d)}const r=new Map;for(const d of o){const c=r.get(d.label);c?(d.description=d.commandId,c.description=c.commandId):r.set(d.label,d)}o.sort((d,c)=>{const h=this.commandsHistory.peek(d.commandId),u=this.commandsHistory.peek(c.commandId);return h&&u?h>u?-1:1:h?-1:u?1:d.label.localeCompare(c.label)});const a=[];let l=!1;for(let d=0;d<o.length;d++){const c=o[d],h=this.keybindingService.lookupKeybinding(c.commandId),u=h?p("commandPickAriaLabelWithKeybinding","{0}, {1}",c.label,h.getAriaLabel()):c.label;d===0&&this.commandsHistory.peek(c.commandId)&&(a.push({type:"separator",label:p("recentlyUsed","recently used")}),l=!0),d!==0&&l&&!this.commandsHistory.peek(c.commandId)&&(a.push({type:"separator",label:p("morecCommands","other commands")}),l=!1),a.push(Object.assign(Object.assign({},c),{ariaLabel:u,detail:this.options.showAlias&&c.commandAlias!==c.label?c.commandAlias:void 0,keybinding:h,accept:()=>iM(this,void 0,void 0,function*(){this.commandsHistory.push(c.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"quick open"});try{yield this.commandService.executeCommand(c.commandId)}catch(f){Vo(f)||this.dialogService.show(It.Error,p("canNotRun","Command '{0}' resulted in an error ({1})",c.label,XP(f)))}})}))}return a})}};Kf.PREFIX=">";Kf.WORD_FILTER=Dx(Vb,Gz,_R);Kf=QP([hl(1,qe),hl(2,Lt),hl(3,Wt),hl(4,Ba),hl(5,ag)],Kf);let dd=class Jt extends U{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(()=>this.updateConfiguration()))}updateConfiguration(){this.configuredCommandsHistoryLength=Jt.getConfiguredCommandHistoryLength(this.configurationService),Jt.cache&&Jt.cache.limit!==this.configuredCommandsHistoryLength&&(Jt.cache.limit=this.configuredCommandsHistoryLength,Jt.saveState(this.storageService))}load(){const e=this.storageService.get(Jt.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=Jt.cache=new ud(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((o,r)=>o.value-r.value),n.forEach(o=>i.set(o.key,o.value))}Jt.counter=this.storageService.getNumber(Jt.PREF_KEY_COUNTER,0,Jt.counter)}push(e){Jt.cache&&(Jt.cache.set(e,Jt.counter++),Jt.saveState(this.storageService))}peek(e){var t;return(t=Jt.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!Jt.cache)return;const t={usesLRU:!0,entries:[]};Jt.cache.forEach((i,n)=>t.entries.push({key:n,value:i})),e.store(Jt.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(Jt.PREF_KEY_COUNTER,Jt.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,i;const o=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof o=="number"?o:Jt.DEFAULT_COMMANDS_HISTORY_LENGTH}};dd.DEFAULT_COMMANDS_HISTORY_LENGTH=50;dd.PREF_KEY_CACHE="commandPalette.mru.cache";dd.PREF_KEY_COUNTER="commandPalette.mru.counter";dd.counter=1;dd=QP([hl(0,Or),hl(1,At)],dd);class Xte extends Kf{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:DR(i.label)||i.id});return t}}var Qte=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Yd=function(s,e){return function(t,i){e(t,i,s)}},Jte=function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?o(c.value):n(c.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let Gf=class extends Xte{constructor(e,t,i,n,o,r){super({showAlias:!1},e,i,n,o,r),this.codeEditorService=t}get activeTextEditorControl(){return Tn(this.codeEditorService.getFocusedCodeEditor())}getCommandPicks(){return Jte(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}};Gf=Qte([Yd(0,qe),Yd(1,Ge),Yd(2,Lt),Yd(3,Wt),Yd(4,Ba),Yd(5,ag)],Gf);Ht.as(Dd.Quickaccess).registerQuickAccessProvider({ctor:Gf,prefix:Gf.PREFIX,helpEntries:[{description:Gm.quickCommandHelp,needsEditor:!0}]});class eie extends ne{constructor(){super({id:"editor.action.quickCommand",label:Gm.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:I.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ha).quickAccess.show(Gf.PREFIX)}}Q(eie);var tie=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Xd=function(s,e){return function(t,i){e(t,i,s)}};let Fy=class extends Ta{constructor(e,t,i,n,o,r,a){super(!0,e,t,i,n,o,r,a)}};Fy=tie([Xd(1,we),Xd(2,Ge),Xd(3,Qt),Xd(4,qe),Xd(5,Or),Xd(6,At)],Fy);Xe(Ta.ID,Fy);class iie extends ne{constructor(){super({id:"editor.action.toggleHighContrast",label:bS.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Sd);this._originalThemeName?(i.setTheme(this._originalThemeName),this._originalThemeName=null):(this._originalThemeName=i.getColorTheme().themeName,i.setTheme("hc-black"))}}Q(iie);const nie=`/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.26.0(69d9363bfed1fbfc1ccb914875a20299f46bcc2e)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/.monaco-action-bar{white-space:nowrap;height:100%}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;height:100%;width:100%;align-items:center}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar .action-item{display:block;align-items:center;justify-content:center;cursor:pointer;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar .action-item .codicon,.monaco-action-bar .action-item .icon{display:block}.monaco-action-bar .action-item .codicon{display:flex;align-items:center;width:16px;height:16px}.monaco-action-bar .action-label{font-size:11px;padding:3px;border-radius:5px}.monaco-action-bar .action-item.disabled .action-label,.monaco-action-bar .action-item.disabled .action-label:before,.monaco-action-bar .action-item.disabled .action-label:hover{opacity:.4}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid #bbb;padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar .action-item .action-label.separator{width:1px;height:16px;margin:5px 4px!important;cursor:default;min-width:1px;padding:0;background-color:#bbb}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;flex:1;max-width:170px;min-width:60px;display:flex;align-items:center;justify-content:center;margin-right:10px}.monaco-action-bar .action-item.action-dropdown-item{display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-label{margin-right:1px}.monaco-aria-container{position:absolute;left:-999em}.monaco-text-button{box-sizing:border-box;display:flex;width:100%;padding:4px;text-align:center;cursor:pointer;justify-content:center;align-items:center}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled,.monaco-button.disabled:focus{opacity:.4!important;cursor:default}.monaco-text-button>.codicon{margin:0 .2em;color:inherit!important}.monaco-button-dropdown{display:flex;cursor:pointer}.monaco-button-dropdown>.monaco-dropdown-button{margin-left:1px}.monaco-description-button{flex-direction:column}.monaco-description-button .monaco-button-label{font-weight:500}.monaco-description-button .monaco-button-description{font-style:italic}.monaco-custom-checkbox{margin-left:2px;float:left;cursor:pointer;overflow:hidden;opacity:.7;width:20px;height:20px;border:1px solid transparent;padding:1px;box-sizing:border-box;user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-custom-checkbox.checked,.monaco-custom-checkbox:hover{opacity:1}.hc-black .monaco-custom-checkbox,.hc-black .monaco-custom-checkbox:hover{background:none}.monaco-custom-checkbox.monaco-simple-checkbox{height:18px;width:18px;border:1px solid transparent;border-radius:3px;margin-right:9px;margin-left:0;padding:0;opacity:1;background-size:16px!important}.monaco-custom-checkbox.monaco-simple-checkbox:not(.checked):before{visibility:hidden}@font-face{font-family:codicon;src:url(/rodydavis/lit-examples/assets/codicon-TsL6DSKR.ttf) format("truetype")}.codicon[class*=codicon-]{font: 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}.codicon-wrench-subaction{opacity:.5}@keyframes codicon-spin{to{transform:rotate(1turn)}}.codicon-gear.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin,.codicon-sync.codicon-modifier-spin{animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.context-view{position:absolute;z-index:2500}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;z-index:2500;color:inherit}.monaco-count-badge{padding:3px 6px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}.monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{cursor:pointer;height:100%;display:flex;align-items:center;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-4px}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:50%;background-repeat:no-repeat}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:#fdff00cc}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:#fdff00cc}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:#ffffff70}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:#ffffff70}99%{background:transparent}}.monaco-hover{cursor:default;position:absolute;overflow:hidden;z-index:50;user-select:text;-webkit-user-select:text;-ms-user-select:text;box-sizing:initial;animation:fadein .1s linear;line-height:1.5em}.monaco-hover.hidden{display:none}.monaco-hover .hover-contents{padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:500px;word-wrap:break-word}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover .code,.monaco-hover p,.monaco-hover ul{margin:8px 0}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{box-sizing:border-box;border-left:0;border-right:0;margin:4px -8px -4px;height:1px}.monaco-hover .code:first-child,.monaco-hover p:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover .code:last-child,.monaco-hover p:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ol,.monaco-hover ul{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:pre-wrap}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px}.monaco-hover .hover-row.status-bar .actions .action-container{margin-right:16px;cursor:pointer}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link{color:inherit}.monaco-hover .hover-contents a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents) span{margin-bottom:4px;display:inline-block}.monaco-hover-content .action-container a{-webkit-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{pointer-events:none;opacity:.4;cursor:default}.monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:0;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;flex-shrink:0}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;margin:0 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}.monaco-inputbox{position:relative;display:block;padding:0;box-sizing:border-box;font-size:inherit}.monaco-inputbox.idle{border:1px solid transparent}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px}.monaco-inputbox>.ibwrapper{position:relative;width:100%;height:100%}.monaco-inputbox>.ibwrapper>.input{display:inline-block;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;-ms-overflow-style:none;scrollbar-width:none;outline:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;width:16px;height:16px}.monaco-keybinding{display:flex;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border-style:solid;border-width:1px;border-radius:3px;vertical-align:middle;font-size:11px;padding:3px 5px;margin:0 2px}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000}.monaco-list-type-filter{display:flex;align-items:center;position:absolute;border-radius:2px;padding:0 3px;max-width:calc(100% - 10px);text-overflow:ellipsis;overflow:hidden;text-align:right;box-sizing:border-box;cursor:all-scroll;font-size:13px;line-height:18px;height:20px;z-index:1;top:4px}.monaco-list-type-filter.dragging{transition:top .2s,left .2s}.monaco-list-type-filter.ne{right:4px}.monaco-list-type-filter.nw{left:4px}.monaco-list-type-filter>.controls{display:flex;align-items:center;box-sizing:border-box;transition:width .2s;width:0}.monaco-list-type-filter.dragging>.controls,.monaco-list-type-filter:hover>.controls{width:36px}.monaco-list-type-filter>.controls>*{border:none;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;background:none;width:16px;height:16px;flex-shrink:0;margin:0;padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer}.monaco-list-type-filter>.controls>.filter{margin-left:4px}.monaco-list-type-filter-message{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-list-type-filter{cursor:grab}.monaco-list-type-filter.dragging{cursor:grabbing}.monaco-mouse-cursor-text{cursor:text}.hc-black.mac .monaco-mouse-cursor-text,.hc-black .mac .monaco-mouse-cursor-text,.vs-dark.mac .monaco-mouse-cursor-text,.vs-dark .mac .monaco-mouse-cursor-text{cursor:-webkit-image-set(url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII=) 1x,url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC) 2x) 5 8,text}.monaco-progress-container{width:100%;height:5px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:5px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;animation-timing-function:linear;transform:translateZ(0)}@keyframes progress{0%{transform:translate(0) scaleX(1)}50%{transform:translate(2500%) scaleX(3)}to{transform:translate(4900%) scaleX(1)}}:root{--sash-size:4px}.monaco-sash{position:absolute;z-index:35;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;top:0;width:var(--sash-size);height:100%}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:var(--sash-size)}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";height:calc(var(--sash-size)*2);width:calc(var(--sash-size)*2);z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--sash-size)*-.5);top:calc(var(--sash-size)*-1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{left:calc(var(--sash-size)*-.5);bottom:calc(var(--sash-size)*-1)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{top:calc(var(--sash-size)*-.5);left:calc(var(--sash-size)*-1)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{top:calc(var(--sash-size)*-.5);right:calc(var(--sash-size)*-1)}.monaco-sash:before{content:"";pointer-events:none;position:absolute;width:100%;height:100%;transition:background-color .1s ease-out;background:transparent}.monaco-sash.vertical:before{width:var(--sash-hover-size);left:calc(50% - var(--sash-hover-size)/2)}.monaco-sash.horizontal:before{height:var(--sash-hover-size);top:calc(50% - var(--sash-hover-size)/2)}.monaco-sash.debug{background:#0ff}.monaco-sash.debug.disabled{background:#0ff3}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}.monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:transparent;transition:opacity .1s linear}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:inset 0 6px 6px -6px #ddd}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:inset 6px 0 6px -6px #ddd}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:inset 6px 6px 6px -6px #ddd}.vs .monaco-scrollable-element>.scrollbar>.slider{background:#64646466}.vs-dark .monaco-scrollable-element>.scrollbar>.slider{background:#79797966}.hc-black .monaco-scrollable-element>.scrollbar>.slider{background:#6fc3df99}.monaco-scrollable-element>.scrollbar>.slider:hover{background:#646464b3}.hc-black .monaco-scrollable-element>.scrollbar>.slider:hover{background:#6fc3dfcc}.monaco-scrollable-element>.scrollbar>.slider.active{background:#0009}.vs-dark .monaco-scrollable-element>.scrollbar>.slider.active{background:#bfbfbf66}.hc-black .monaco-scrollable-element>.scrollbar>.slider.active{background:#6fc3df}.vs-dark .monaco-scrollable-element .shadow.top{box-shadow:none}.vs-dark .monaco-scrollable-element .shadow.left{box-shadow:inset 6px 0 6px -6px #000}.vs-dark .monaco-scrollable-element .shadow.top.left{box-shadow:inset 6px 6px 6px -6px #000}.hc-black .monaco-scrollable-element .shadow.left,.hc-black .monaco-scrollable-element .shadow.top,.hc-black .monaco-scrollable-element .shadow.top.left{box-shadow:none}.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:auto}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{width:100%;height:100%;white-space:nowrap;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:normal;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:" ";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}.monaco-table{display:flex;flex-direction:column;position:relative;height:100%;width:100%;white-space:nowrap}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{width:100%;height:100%;font-weight:700;overflow:hidden;text-overflow:ellipsis}.monaco-table-td,.monaco-table-th{box-sizing:border-box;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{content:"";position:absolute;left:calc(var(--sash-size)/2);width:0;border-left:1px solid transparent}.monaco-table>.monaco-split-view2,.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}.monaco-tl-row{display:flex;height:100%;align-items:center;position:relative}.monaco-tl-indent{height:100%;position:absolute;top:0;left:16px;pointer-events:none}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{display:inline-block;box-sizing:border-box;height:100%;border-left:1px solid transparent;transition:border-color .1s linear}.monaco-tl-contents,.monaco-tl-twistie{height:100%}.monaco-tl-twistie{font-size:10px;text-align:right;padding-right:6px;flex-shrink:0;width:16px;display:flex!important;align-items:center;justify-content:center;transform:translate(3px)}.monaco-tl-contents{flex:1;overflow:hidden}.monaco-tl-twistie:before{border-radius:20px}.monaco-tl-twistie.collapsed:before{transform:rotate(-90deg)}.monaco-tl-twistie.codicon-tree-item-loading:before{animation:codicon-spin 1.25s steps(30) infinite}.quick-input-widget{position:absolute;width:600px;z-index:2000;padding:0 1px 6px;left:50%;margin-left:-300px}.quick-input-titlebar{display:flex;align-items:center}.quick-input-left-action-bar{display:flex;margin-left:4px;flex:1}.quick-input-title{padding:3px 0;text-align:center}.quick-input-right-action-bar{display:flex;margin-right:4px;flex:1}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:50%;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px}.quick-input-header .quick-input-description{margin:4px 2px}.quick-input-header{display:flex;padding:6px 6px 0;margin-bottom:-2px}.quick-input-widget.hidden-input .quick-input-header{padding:0;margin-bottom:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-filter{flex-grow:1;display:flex;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{position:absolute;left:-10000px}.quick-input-count{align-self:center;position:absolute;right:4px;display:flex;align-items:center}.quick-input-count .monaco-count-badge{vertical-align:middle;padding:2px 4px;border-radius:2px;min-height:auto;line-height:normal}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{font-size:11px;padding:0 6px;display:flex;height:27.5px;align-items:center}.quick-input-message{margin-top:-1px;padding:5px 5px 2px}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-progress.monaco-progress-container,.quick-input-progress.monaco-progress-container .progress-bit{height:2px}.quick-input-list{line-height:22px;margin-top:6px}.quick-input-widget.hidden-input .quick-input-list{margin-top:0}.quick-input-list .monaco-list{overflow:hidden;max-height:440px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;overflow:hidden;display:flex;height:100%;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-width:1px;border-top-style:solid}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-list .quick-input-list-checkbox{align-self:center;margin:0}.quick-input-list .quick-input-list-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows{margin-left:10px}.quick-input-widget .quick-input-list .quick-input-list-checkbox{display:none}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox{display:inline}.quick-input-list .quick-input-list-rows>.quick-input-list-row{display:flex;align-items:center}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:sub}.quick-input-list .quick-input-list-rows .monaco-highlighted-label span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{opacity:.7;line-height:normal;text-overflow:ellipsis;overflow:hidden}.quick-input-list .monaco-highlighted-label .highlight{font-weight:700}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:8px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-list .quick-input-list-entry-action-bar{margin-top:1px;margin-right:4px}.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent}.monaco-editor .inputarea.ime-input{z-index:10}.monaco-editor .margin-view-overlays .current-line,.monaco-editor .view-overlays .current-line{display:block;position:absolute;left:0;top:0;box-sizing:border-box}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .margin-view-overlays .cgmr{position:absolute;display:flex;align-items:center;justify-content:center}.monaco-editor .lines-content .cigr,.monaco-editor .lines-content .cigra{position:absolute}.monaco-editor .margin-view-overlays .line-numbers{font-variant-numeric:tabular-nums;position:absolute;text-align:right;display:inline-block;vertical-align:middle;box-sizing:border-box;cursor:default;height:100%}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .mtkz{display:inline-block}.monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover .minimap-slider.active,.monaco-editor .minimap.slider-mouseover:hover .minimap-slider{opacity:1}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{position:absolute;left:-1px;width:1px}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{box-sizing:border-box;background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important;box-sizing:border-box}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:#00000008}.monaco-diff-editor.vs-dark .diffOverview{background:#ffffff03}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:#ababab66}.modified-in-monaco-diff-editor.hc-black .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{font-size:11px!important;opacity:.7!important;display:flex!important;align-items:center}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign{opacity:1}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-diff-editor .diff-review-line-number{text-align:right;display:inline-block}.monaco-diff-editor .diff-review{position:absolute;user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-diff-editor .diff-review-summary{padding-left:10px}.monaco-diff-editor .diff-review-shadow{position:absolute}.monaco-diff-editor .diff-review-row{white-space:pre}.monaco-diff-editor .diff-review-table{display:table;min-width:100%}.monaco-diff-editor .diff-review-row{display:table-row;width:100%}.monaco-diff-editor .diff-review-spacer{display:inline-block;width:10px;vertical-align:middle}.monaco-diff-editor .diff-review-spacer>.codicon{font-size:9px!important}.monaco-diff-editor .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px}.monaco-diff-editor .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}.monaco-editor .bracket-match{box-sizing:border-box}.monaco-editor .contentWidgets .codicon-light-bulb,.monaco-editor .contentWidgets .codicon-lightbulb-autofix{display:flex;align-items:center;justify-content:center}.monaco-editor .contentWidgets .codicon-light-bulb:hover,.monaco-editor .contentWidgets .codicon-lightbulb-autofix:hover{cursor:pointer}.monaco-editor .codelens-decoration{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .codelens-decoration>a,.monaco-editor .codelens-decoration>span{user-select:none;-webkit-user-select:none;-ms-user-select:none;white-space:nowrap;vertical-align:sub}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer}.monaco-editor .codelens-decoration .codicon{vertical-align:middle;color:currentColor!important}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}.colorpicker-widget{height:190px;user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-editor .colorpicker-hover:focus{outline:none}.colorpicker-header{display:flex;height:24px;position:relative;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-header .picked-color{width:216px;line-height:24px;cursor:pointer;color:#fff;flex:1;text-align:center}.colorpicker-header .picked-color.light{color:#000}.colorpicker-header .original-color{width:74px;z-index:inherit;cursor:pointer}.colorpicker-body{display:flex;padding:8px;position:relative}.colorpicker-body .saturation-wrap{overflow:hidden;height:150px;position:relative;min-width:220px;flex:1}.colorpicker-body .saturation-box{height:150px;position:absolute}.colorpicker-body .saturation-selection{width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid #fff;border-radius:100%;box-shadow:0 0 2px #000c;position:absolute}.colorpicker-body .strip{width:25px;height:150px}.colorpicker-body .hue-strip{position:relative;margin-left:8px;cursor:grab;background:linear-gradient(180deg,red 0,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.colorpicker-body .opacity-strip{position:relative;margin-left:8px;cursor:grab;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-body .strip.grabbing{cursor:grabbing}.colorpicker-body .slider{position:absolute;top:0;left:-2px;width:calc(100% + 4px);height:4px;box-sizing:border-box;border:1px solid hsla(0,0%,100%,.71);box-shadow:0 0 1px #000000d9}.colorpicker-body .strip .overlay{height:150px;pointer-events:none}.monaco-editor.vs .dnd-target{border-right:2px dotted #000;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #aeafad;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines{cursor:default}.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines{cursor:copy}.monaco-editor .find-widget{position:absolute;z-index:35;height:33px;overflow:hidden;line-height:19px;transition:transform .2s linear;padding:0 4px;box-sizing:border-box;transform:translateY(calc(-100% - 10px))}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:4px 0 0 17px;font-size:12px;display:flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions,.monaco-editor .find-widget>.replace-part .replace-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:flex;flex:1}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{display:flex;flex:initial;margin:0 0 0 3px;padding:2px 0 0 2px;height:25px;vertical-align:middle;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button{width:20px;height:20px;flex:initial;margin-left:3px;background-position:50%;background-repeat:no-repeat;cursor:pointer;display:flex;align-items:center;justify-content:center}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:3px;width:18px;height:100%;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{opacity:.3;cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{position:relative;display:flex;vertical-align:middle;flex:auto;flex-grow:0;flex-shrink:0}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important}.monaco-editor .find-widget .monaco-sash{left:0!important}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor .margin-view-overlays .codicon-folding-collapsed,.monaco-editor .margin-view-overlays .codicon-folding-expanded{cursor:pointer;opacity:0;transition:opacity .5s;display:flex;align-items:center;justify-content:center;font-size:140%;margin-left:2px}.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons,.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,.monaco-editor .margin-view-overlays:hover .codicon{opacity:1}.monaco-editor .inline-folded:after{color:gray;margin:.1em .2em 0;content:"⋯";display:inline;line-height:1em;cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;vertical-align:text-top;margin-right:4px}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:absolute;white-space:pre;user-select:text;-webkit-user-select:text;-ms-user-select:text;padding:8px 12px 0 20px}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{opacity:.6;color:inherit}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:inline-flex;width:100%;height:100%}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{display:inline-block;cursor:pointer;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{opacity:0;font-size:0}.monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{cursor:pointer}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:1px 4px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;z-index:1000;border:8px solid transparent;position:absolute}.monaco-editor .monaco-editor-overlaymessage.below .anchor.below,.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}.monaco-editor .parameter-hints-widget{z-index:10;display:flex;flex-direction:column;line-height:1.5em}.monaco-editor .parameter-hints-widget>.phwrapper{max-width:440px;display:flex;flex-direction:row}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.visible{transition:left .05s ease-in-out}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .body,.monaco-editor .parameter-hints-widget .monaco-scrollable-element{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:normal}.monaco-editor .parameter-hints-widget .docs .markdown-docs code{font-family:var(--monaco-monospace-font)}.monaco-editor .parameter-hints-widget .docs .code{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs code{border-radius:3px;padding:0 .4em}.monaco-editor .parameter-hints-widget .controls{display:none;flex-direction:column;align-items:center;min-width:22px;justify-content:flex-end}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{width:16px;height:16px;background-repeat:no-repeat;cursor:pointer}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{text-align:center;height:12px;line-height:12px;opacity:.5;font-family:var(--monaco-monospace-font)}.monaco-editor .parameter-hints-widget .signature .parameter.active{font-weight:700;text-decoration:underline}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex}.monaco-editor .peekview-widget .head .peekview-title{display:flex;align-items:center;font-size:13px;margin-left:20px;cursor:pointer;min-width:0}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .meta{white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .filename{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{margin-right:4px}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}.monaco-editor .rename-box{z-index:100;color:inherit}.monaco-editor .rename-box.preview{padding:3px 3px 0}.monaco-editor .rename-box .rename-input{padding:3px;width:calc(100% - 6px)}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}.monaco-editor .snippet-placeholder{min-width:2px}.monaco-editor .finish-snippet-placeholder,.monaco-editor .snippet-placeholder{outline-style:solid;outline-width:1px}.monaco-editor .suggest-widget{width:430px;z-index:40;display:flex;flex-direction:column}.monaco-editor .suggest-widget.message{flex-direction:row;align-items:center}.monaco-editor .suggest-details,.monaco-editor .suggest-widget{flex:0 1 auto;width:100%;border-style:solid;border-width:1px}.monaco-editor.hc-black .suggest-details,.monaco-editor.hc-black .suggest-widget{border-width:2px}.monaco-editor .suggest-widget .suggest-status-bar{box-sizing:border-box;display:none;flex-flow:row nowrap;justify-content:space-between;width:100%;font-size:80%;padding:0 4px;border-top:1px solid transparent;overflow:hidden}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar{display:flex}.monaco-editor .suggest-widget .suggest-status-bar .left{padding-right:8px}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-label{opacity:.5;color:inherit}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label{margin-right:0}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label:after{content:", ";margin-right:.3em}.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore,.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover>.contents>.main>.right.can-expand-details>.details-label{width:100%}.monaco-editor .suggest-widget>.message{padding-left:22px}.monaco-editor .suggest-widget>.tree{height:100%;width:100%}.monaco-editor .suggest-widget .monaco-list{user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row{display:flex;-mox-box-sizing:border-box;box-sizing:border-box;padding-right:10px;background-repeat:no-repeat;background-position:2px 2px;white-space:nowrap;cursor:pointer;touch-action:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents{flex:1;height:100%;overflow:hidden;padding-left:2px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main{display:flex;overflow:hidden;text-overflow:ellipsis;white-space:pre;justify-content:space-between}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{display:flex}.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:before{color:inherit;opacity:1;font-size:14px;cursor:pointer}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close{position:absolute;top:6px;right:2px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close:hover,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:hover{opacity:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{opacity:.7}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.signature-label{overflow:hidden;text-overflow:ellipsis;opacity:.6}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.qualifier-label{margin-left:12px;opacity:.4;font-size:85%;line-height:normal;text-overflow:ellipsis;overflow:hidden;align-self:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{font-size:85%;margin-left:1.1em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label>.monaco-tokenized-source{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{display:none}.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label)>.contents>.main>.right>.details-label,.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.right>.details-label,.monaco-editor .suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row:hover>.contents>.main>.right.can-expand-details>.details-label{width:calc(100% - 26px)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left{flex-shrink:1;flex-grow:1;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.monaco-icon-label{flex-shrink:0}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.left>.monaco-icon-label{max-width:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.left>.monaco-icon-label{flex-shrink:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{overflow:hidden;flex-shrink:4;max-width:70%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:inline-block;position:absolute;right:10px;width:18px;height:18px;visibility:hidden}.monaco-editor .suggest-widget.docs-below .monaco-list .monaco-list-row>.contents>.main>.right>.readMore,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none!important}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:inline-block}.monaco-editor .suggest-widget.docs-below .monaco-list .monaco-list-row>.contents>.main>.right>.readMore,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:hover>.contents>.main>.right>.readMore{visibility:visible}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated{opacity:.66;text-decoration:unset}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-container>.monaco-icon-name-container{text-decoration:line-through}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon{display:block;height:16px;width:16px;margin-left:2px;background-repeat:no-repeat;background-size:80%;background-position:50%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon{display:flex;align-items:center;margin-right:4px}.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon:before{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{margin:0 0 0 .3em;border:.1em solid #000;width:.7em;height:.7em;display:inline-block}.monaco-editor .suggest-details-container{z-index:41}.monaco-editor .suggest-details{display:flex;flex-direction:column;cursor:default}.monaco-editor .suggest-details.no-docs{display:none}.monaco-editor .suggest-details>.monaco-scrollable-element{flex:1}.monaco-editor .suggest-details>.monaco-scrollable-element>.body{box-sizing:border-box;height:100%;width:100%}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type{flex:2;overflow:hidden;text-overflow:ellipsis;opacity:.7;white-space:pre;margin:0 24px 0 0;padding:4px 0 12px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type.auto-wrap{white-space:normal;word-break:break-all}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs{margin:0;padding:4px 5px;white-space:pre-wrap}.monaco-editor .suggest-details.no-type>.monaco-scrollable-element>.body>.docs{margin-right:24px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs{padding:0;white-space:normal;min-height:calc(1rem + 8px)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty){padding:4px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child{margin-top:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child{margin-bottom:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs .code{white-space:pre-wrap;word-wrap:break-word}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .codicon{vertical-align:sub}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>p:empty{display:none}.monaco-editor .suggest-details code{border-radius:3px;padding:0 .4em}.monaco-editor .suggest-details ol,.monaco-editor .suggest-details ul{padding-left:20px}.monaco-editor .suggest-details p code{font-family:var(--monaco-monospace-font)}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-editor .accessibilityHelpWidget{padding:10px;vertical-align:middle;overflow:scroll}.monaco-editor .iPadShowKeyboard{width:58px;min-width:0;height:36px;min-height:0;margin:0;padding:0;position:absolute;resize:none;overflow:hidden;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00OC4wMzYgNC4wMUg0LjAwOFYzMi4wM2g0NC4wMjhWNC4wMXpNNC4wMDguMDA4QTQuMDAzIDQuMDAzIDAgMDAuMDA1IDQuMDFWMzIuMDNhNC4wMDMgNC4wMDMgMCAwMDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAwNC4wMDMtNC4wMDJWNC4wMUE0LjAwMyA0LjAwMyAwIDAwNDguMDM2LjAwOEg0LjAwOHpNOC4wMSA4LjAxM2g0LjAwM3Y0LjAwM0g4LjAxVjguMDEzem0xMi4wMDggMGgtNC4wMDJ2NC4wMDNoNC4wMDJWOC4wMTN6bTQuMDAzIDBoNC4wMDJ2NC4wMDNoLTQuMDAyVjguMDEzem0xMi4wMDggMGgtNC4wMDN2NC4wMDNoNC4wMDNWOC4wMTN6bTQuMDAyIDBoNC4wMDN2NC4wMDNINDAuMDNWOC4wMTN6bS0yNC4wMTUgOC4wMDVIOC4wMXY0LjAwM2g4LjAwNnYtNC4wMDN6bTQuMDAyIDBoNC4wMDN2NC4wMDNoLTQuMDAzdi00LjAwM3ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzdi00LjAwM3ptMTIuMDA4IDB2NC4wMDNoLTguMDA1di00LjAwM2g4LjAwNXptLTMyLjAyMSA4LjAwNUg4LjAxdjQuMDAzaDQuMDAzdi00LjAwM3ptNC4wMDMgMGgyMC4wMTN2NC4wMDNIMTYuMDE2di00LjAwM3ptMjguMDE4IDBINDAuMDN2NC4wMDNoNC4wMDN2LTQuMDAzeiIgZmlsbD0iIzQyNDI0MiIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+) 50% no-repeat;border:4px solid #f6f6f6;border-radius:4px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00OC4wMzYgNC4wMUg0LjAwOFYzMi4wM2g0NC4wMjhWNC4wMXpNNC4wMDguMDA4QTQuMDAzIDQuMDAzIDAgMDAuMDA1IDQuMDFWMzIuMDNhNC4wMDMgNC4wMDMgMCAwMDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAwNC4wMDMtNC4wMDJWNC4wMUE0LjAwMyA0LjAwMyAwIDAwNDguMDM2LjAwOEg0LjAwOHpNOC4wMSA4LjAxM2g0LjAwM3Y0LjAwM0g4LjAxVjguMDEzem0xMi4wMDggMGgtNC4wMDJ2NC4wMDNoNC4wMDJWOC4wMTN6bTQuMDAzIDBoNC4wMDJ2NC4wMDNoLTQuMDAyVjguMDEzem0xMi4wMDggMGgtNC4wMDN2NC4wMDNoNC4wMDNWOC4wMTN6bTQuMDAyIDBoNC4wMDN2NC4wMDNINDAuMDNWOC4wMTN6bS0yNC4wMTUgOC4wMDVIOC4wMXY0LjAwM2g4LjAwNnYtNC4wMDN6bTQuMDAyIDBoNC4wMDN2NC4wMDNoLTQuMDAzdi00LjAwM3ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzdi00LjAwM3ptMTIuMDA4IDB2NC4wMDNoLTguMDA1di00LjAwM2g4LjAwNXptLTMyLjAyMSA4LjAwNUg4LjAxdjQuMDAzaDQuMDAzdi00LjAwM3ptNC4wMDMgMGgyMC4wMTN2NC4wMDNIMTYuMDE2di00LjAwM3ptMjguMDE4IDBINDAuMDN2NC4wMDNoNC4wMDN2LTQuMDAzeiIgZmlsbD0iI0M1QzVDNSIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+) 50% no-repeat;border:4px solid #252526}.monaco-editor .tokens-inspect-widget{z-index:50;user-select:text;-webkit-user-select:text;-ms-user-select:text;padding:10px}.tokens-inspect-separator{height:1px;border:0}.monaco-editor .tokens-inspect-widget .tm-token{font-family:var(--monaco-monospace-font)}.monaco-editor .tokens-inspect-widget .tm-token-length{font-weight:400;font-size:60%;float:right}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:var(--monaco-monospace-font);text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:var(--monaco-monospace-font)}.quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.monaco-keybinding>.monaco-keybinding-key{background-color:#ddd6;border:1px solid hsla(0,0%,80%,.4);border-bottom-color:#bbb6;box-shadow:inset 0 -1px #bbb6;color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:1px solid #6fc3df;box-shadow:none;color:#fff}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:#8080802b;border:1px solid rgba(51,51,51,.6);border-bottom-color:#4449;box-shadow:inset 0 -1px #4449;color:#ccc}.monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif;--monaco-monospace-font:"SF Mono",Monaco,Menlo,Consolas,"Ubuntu Mono","Liberation Mono","DejaVu Sans Mono","Courier New",monospace}.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{position:absolute!important;top:0;height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%)}.monaco-editor.hc-black{-ms-high-contrast-adjust:none}@media screen and (-ms-high-contrast:active){.monaco-editor.vs-dark .view-overlays .current-line,.monaco-editor.vs .view-overlays .current-line{border-color:windowtext!important;border-left:0;border-right:0}.monaco-editor.vs-dark .cursor,.monaco-editor.vs .cursor{background-color:windowtext!important}.monaco-editor.vs-dark .dnd-target,.monaco-editor.vs .dnd-target{border-color:windowtext!important}.monaco-editor.vs-dark .selected-text,.monaco-editor.vs .selected-text{background-color:highlight!important}.monaco-editor.vs-dark .view-line,.monaco-editor.vs .view-line{-ms-high-contrast-adjust:none}.monaco-editor.vs-dark .view-line span,.monaco-editor.vs .view-line span{color:windowtext!important}.monaco-editor.vs-dark .view-line span.inline-selected-text,.monaco-editor.vs .view-line span.inline-selected-text{color:highlighttext!important}.monaco-editor.vs-dark .view-overlays,.monaco-editor.vs .view-overlays{-ms-high-contrast-adjust:none}.monaco-editor.vs-dark .reference-decoration,.monaco-editor.vs-dark .selectionHighlight,.monaco-editor.vs-dark .wordHighlight,.monaco-editor.vs-dark .wordHighlightStrong,.monaco-editor.vs .reference-decoration,.monaco-editor.vs .selectionHighlight,.monaco-editor.vs .wordHighlight,.monaco-editor.vs .wordHighlightStrong{border:2px dotted highlight!important;background:transparent!important;box-sizing:border-box}.monaco-editor.vs-dark .rangeHighlight,.monaco-editor.vs .rangeHighlight{background:transparent!important;border:1px dotted activeborder!important;box-sizing:border-box}.monaco-editor.vs-dark .bracket-match,.monaco-editor.vs .bracket-match{border-color:windowtext!important;background:transparent!important}.monaco-editor.vs-dark .currentFindMatch,.monaco-editor.vs-dark .findMatch,.monaco-editor.vs .currentFindMatch,.monaco-editor.vs .findMatch{border:2px dotted activeborder!important;background:transparent!important;box-sizing:border-box}.monaco-editor.vs-dark .find-widget,.monaco-editor.vs .find-widget{border:1px solid windowtext}.monaco-editor.vs-dark .monaco-list .monaco-list-row,.monaco-editor.vs .monaco-list .monaco-list-row{-ms-high-contrast-adjust:none;color:windowtext!important}.monaco-editor.vs-dark .monaco-list .monaco-list-row.focused,.monaco-editor.vs .monaco-list .monaco-list-row.focused{color:highlighttext!important;background-color:highlight!important}.monaco-editor.vs-dark .monaco-list .monaco-list-row:hover,.monaco-editor.vs .monaco-list .monaco-list-row:hover{background:transparent!important;border:1px solid highlight;box-sizing:border-box}.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar,.monaco-editor.vs .monaco-scrollable-element>.scrollbar{-ms-high-contrast-adjust:none;background:background!important;border:1px solid windowtext;box-sizing:border-box}.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar>.slider,.monaco-editor.vs .monaco-scrollable-element>.scrollbar>.slider{background:windowtext!important}.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar>.slider.active,.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar>.slider:hover,.monaco-editor.vs .monaco-scrollable-element>.scrollbar>.slider.active,.monaco-editor.vs .monaco-scrollable-element>.scrollbar>.slider:hover{background:highlight!important}.monaco-editor.vs-dark .decorationsOverviewRuler,.monaco-editor.vs .decorationsOverviewRuler{opacity:0}.monaco-editor.vs-dark .minimap,.monaco-editor.vs .minimap{display:none}.monaco-editor.vs-dark .squiggly-d-error,.monaco-editor.vs .squiggly-d-error{background:transparent!important;border-bottom:4px double #e47777}.monaco-editor.vs-dark .squiggly-b-info,.monaco-editor.vs-dark .squiggly-c-warning,.monaco-editor.vs .squiggly-b-info,.monaco-editor.vs .squiggly-c-warning{border-bottom:4px double #71b771}.monaco-editor.vs-dark .squiggly-a-hint,.monaco-editor.vs .squiggly-a-hint{border-bottom:4px double #6c6c6c}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{-ms-high-contrast-adjust:none;color:highlighttext!important;background-color:highlight!important}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .action-label,.monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .action-label{-ms-high-contrast-adjust:none;background:transparent!important;border:1px solid highlight;box-sizing:border-box}.monaco-diff-editor.vs-dark .diffOverviewRuler,.monaco-diff-editor.vs .diffOverviewRuler{display:none}.monaco-editor.vs-dark .line-delete,.monaco-editor.vs-dark .line-insert,.monaco-editor.vs .line-delete,.monaco-editor.vs .line-insert{background:transparent!important;border:1px solid highlight!important;box-sizing:border-box}.monaco-editor.vs-dark .char-delete,.monaco-editor.vs-dark .char-insert,.monaco-editor.vs .char-delete,.monaco-editor.vs .char-insert{background:transparent!important}}.monaco-action-bar .action-item.menu-entry .action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-action-bar .action-item.menu-entry .action-label{background-image:var(--menu-entry-icon-light)}.hc-black .monaco-action-bar .action-item.menu-entry .action-label,.vs-dark .monaco-action-bar .action-item.menu-entry .action-label{background-image:var(--menu-entry-icon-dark)}.context-view .monaco-menu{min-width:130px}`;function sie(s){return new Worker("/rodydavis/lit-examples/assets/editor.worker-DJ-RZEZD.js",{name:s==null?void 0:s.name})}function oie(s){return new Worker("/rodydavis/lit-examples/assets/json.worker-DkmBn0cG.js",{name:s==null?void 0:s.name})}function rie(s){return new Worker("/rodydavis/lit-examples/assets/css.worker-BgTF7BWw.js",{name:s==null?void 0:s.name})}function aie(s){return new Worker("/rodydavis/lit-examples/assets/html.worker-Pgpgtqhe.js",{name:s==null?void 0:s.name})}function lie(s){return new Worker("/rodydavis/lit-examples/assets/ts.worker-Cbsaw3Jw.js",{name:s==null?void 0:s.name})}var die=Object.defineProperty,cie=Object.getOwnPropertyDescriptor,Sg=(s,e,t,i)=>{for(var n=i>1?void 0:i?cie(e,t):e,o=s.length-1,r;o>=0;o--)(r=s[o])&&(n=(i?r(e,t,n):r(n))||n);return i&&n&&die(e,t,n),n};self.MonacoEnvironment={getWorker(s,e){return e==="json"?new oie:e==="css"||e==="scss"||e==="less"?new rie:e==="html"||e==="handlebars"||e==="razor"?new aie:e==="typescript"||e==="javascript"?new lie:new sie}};let Pa=class extends lF{constructor(){super(...arguments),this.container=CF()}render(){return dF`
<style>
${nie}
</style>
<main ${yF(this.container)}></main>
`}getFile(){return this.children.length>0?this.children[0]:null}getCode(){if(this.code)return this.code;const s=this.getFile();if(s)return s.innerHTML.trim()}getLang(){if(this.language)return this.language;const s=this.getFile();return s?s.getAttribute("type").split("/").pop():void 0}getTheme(){return this.theme?this.theme:this.isDark()?"vs-dark":"vs-light"}isDark(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}setValue(s){this.editor.setValue(s)}getValue(){return this.editor.getValue()}setReadOnly(s){this.readOnly=s,this.setOptions({readOnly:s})}setOptions(s){this.editor.updateOptions(s)}firstUpdated(){this.editor=GE.create(this.container.value,{value:this.getCode(),language:this.getLang(),theme:this.getTheme(),automaticLayout:!0,readOnly:this.readOnly??!1}),this.editor.getModel().onDidChangeContent(()=>{this.dispatchEvent(new CustomEvent("change",{detail:{}}))}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{GE.setTheme(this.getTheme())})}};Pa.styles=cF`
:host {
--editor-width: 100%;
--editor-height: 100vh;
}
main {
width: var(--editor-width);
height: var(--editor-height);
}
`;Sg([G_({type:Boolean,attribute:"readonly"})],Pa.prototype,"readOnly",2);Sg([G_()],Pa.prototype,"theme",2);Sg([G_()],Pa.prototype,"language",2);Sg([G_()],Pa.prototype,"code",2);Pa=Sg([hF("code-editor")],Pa);const rse=Object.freeze(Object.defineProperty({__proto__:null,get CodeEditor(){return Pa}},Symbol.toStringTag,{value:"Module"}));export{ane as M,rne as R,dne as U,lne as a,rse as c,GE as e,nn as l,c2 as t};